usb: msc: Stall data stage before sending error status
When an unsupported SCSI command is received, an error status reply is sent even if the Host expects data prior to the status. This fix stalls the data reply before sending the error status. Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
This commit is contained in:
parent
4253280525
commit
8fac501c0f
1 changed files with 5 additions and 0 deletions
|
@ -491,6 +491,11 @@ static bool infoTransfer(void)
|
||||||
|
|
||||||
static void fail(void)
|
static void fail(void)
|
||||||
{
|
{
|
||||||
|
if (cbw.DataLength) {
|
||||||
|
/* Stall data stage */
|
||||||
|
usb_ep_set_stall(mass_ep_data[MSD_IN_EP_IDX].ep_addr);
|
||||||
|
}
|
||||||
|
|
||||||
csw.Status = CSW_FAILED;
|
csw.Status = CSW_FAILED;
|
||||||
sendCSW();
|
sendCSW();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue