/* Handle various control requests related to the msc storage interface.  */
bool usbd_msc_setup_ep0(usbd_msc *ms, const struct usb_setup_data *setup_data)
/* Handle various control requests related to the msc storage interface.  */
bool usbd_msc_setup_ep0(usbd_msc *ms, const struct usb_setup_data *setup_data)
{
	usbd_device *dev = ms->dev;
	const uint8_t mask = USB_REQ_TYPE_TYPE | USB_REQ_TYPE_RECIPIENT;
	const uint8_t value = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE;
	if ((setup_data->bmRequestType & mask) == value) {
		switch (setup_data->bRequest) {
		case USB_MSC_REQ_BULK_ONLY_RESET:
			usbd_ep0_transfer(dev, setup_data, NULL, 0, NULL);
		return true;
		case USB_MSC_REQ_GET_MAX_LUN: {
			static const uint8_t res = 0;
			usbd_ep0_transfer(dev, setup_data, (void *) &res,
							sizeof(res), NULL);
		return true;
		}}
 	}
	return false;
}