Re: usbhost_storage.c : the driver should be able to handle STALL as a response for USBSTRG_REQ_GETMAXLUN
- Hi, Sheref,
I have incorporated your recommended change.
> if(DRVR_CTRLIN(priv->drvr, req, priv->tbuffer) != OK)The only thing that I wondered about was the DRVR_CTRLIN macro return value. Not equal to OK does not necessary mean a stall. Couldn't the DRVR_CTRLIN fail for some other. But looking at the following logic I think it is okay. If the function returns success, the driver will just try more communications and if there is something seriously wrong, other communication failures should be caught and handled anyway.
> /* devices that does not support multible LUN may stall this
> single LUN is assumed */
> *(priv->tbuffer) = 0;
> return OK;
In fact, usbhost_maxlunreq() really should just be a function returning void now.
Thanks for the bug report! I hate making mistakes but not as much as I hate having bugs in NuttX.