aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLuis Lloret <luislloret@gmail.com>2007-07-26 10:08:47 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-08-22 17:27:44 -0400
commit88e45dbbababd29cd6c80a3e0b60a828676b3ba9 (patch)
treed3d279011484f6f55d58dff7f0eed346024e8d15 /drivers/usb
parent468d13623b6c8d048abab71ed465fa8ad3bf8875 (diff)
USB: Stall control endpoint when file storage class request wValue != 0
This patch makes the File Storage Gadget stall the control endpoint when a MSC class request is made with wValue != 0. This change makes some MSC compliance test warnings disappear. Signed-off-by: Luis Lloret <luislloret@gmail.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/file_storage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index be7a1bd2823b..01ddb6d3e51b 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -1295,6 +1295,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1295 struct usb_request *req = fsg->ep0req; 1295 struct usb_request *req = fsg->ep0req;
1296 int value = -EOPNOTSUPP; 1296 int value = -EOPNOTSUPP;
1297 u16 w_index = le16_to_cpu(ctrl->wIndex); 1297 u16 w_index = le16_to_cpu(ctrl->wIndex);
1298 u16 w_value = le16_to_cpu(ctrl->wValue);
1298 u16 w_length = le16_to_cpu(ctrl->wLength); 1299 u16 w_length = le16_to_cpu(ctrl->wLength);
1299 1300
1300 if (!fsg->config) 1301 if (!fsg->config)
@@ -1308,7 +1309,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1308 if (ctrl->bRequestType != (USB_DIR_OUT | 1309 if (ctrl->bRequestType != (USB_DIR_OUT |
1309 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1310 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1310 break; 1311 break;
1311 if (w_index != 0) { 1312 if (w_index != 0 || w_value != 0) {
1312 value = -EDOM; 1313 value = -EDOM;
1313 break; 1314 break;
1314 } 1315 }
@@ -1324,7 +1325,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1324 if (ctrl->bRequestType != (USB_DIR_IN | 1325 if (ctrl->bRequestType != (USB_DIR_IN |
1325 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1326 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1326 break; 1327 break;
1327 if (w_index != 0) { 1328 if (w_index != 0 || w_value != 0) {
1328 value = -EDOM; 1329 value = -EDOM;
1329 break; 1330 break;
1330 } 1331 }
@@ -1343,7 +1344,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1343 if (ctrl->bRequestType != (USB_DIR_OUT | 1344 if (ctrl->bRequestType != (USB_DIR_OUT |
1344 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1345 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1345 break; 1346 break;
1346 if (w_index != 0) { 1347 if (w_index != 0 || w_value != 0) {
1347 value = -EDOM; 1348 value = -EDOM;
1348 break; 1349 break;
1349 } 1350 }