/************************************************************************* HandleClassRequest ================== Handle mass storage class request **************************************************************************/ static BOOL HandleClassRequest(TSetupPacket *pSetup, int *piLen, U8 **ppbData) { if (pSetup->wIndex != 0) { DBG("Invalid idx %X\n", pSetup->wIndex); return FALSE; } if (pSetup->wValue != 0) { DBG("Invalid val %X\n", pSetup->wValue); return FALSE; } switch (pSetup->bRequest) { // get max LUN case 0xFE: *ppbData[0] = 0; // No LUNs *piLen = 1; break; // MSC reset case 0xFF: if (pSetup->wLength > 0) { return FALSE; } MSCBotReset(); break; default: DBG("Unhandled class\n"); return FALSE; } return TRUE; }
/************************************************************************* HandleClassRequest ================== Handle mass storage class request **************************************************************************/ static bool HandleClassRequest(TSetupPacket *pSetup, int *piLen, uint8_t **ppbData) { if(pSetup->wIndex != 0) { debug("Invalid idx %X", pSetup->wIndex); return false; } if(pSetup->wValue != 0) { debug("Invalid val %X", pSetup->wValue); return false; } switch (pSetup->bRequest) { // get max LUN case 0xFE: *ppbData[0] = 0; // No LUNs *piLen = 1; break; // MSC reset case 0xFF: if(pSetup->wLength > 0) { return false; } MSCBotReset(); break; default: debug("Unhandled class"); return false; } return true; }