[PATCH] USB: gadget driver updates (SETUP api change)
This updates most of the gadget framework to expect SETUP packets use USB byteorder (matching the annotation in <linux/usb_ch9.h> and usage in the host side stack): - definition in <linux/usb_gadget.h> - gadget drivers: Ethernet/RNDIS, serial/ACM, file_storage, gadgetfs. - dummy_hcd It also includes some other similar changes as suggested by "sparse", which was used to detect byteorder bugs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
028b271b68
commit
1bbc169621
@@ -417,8 +417,8 @@ ep_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr)
|
||||
goto free1;
|
||||
|
||||
value = ep_io (data, kbuf, len);
|
||||
VDEBUG (data->dev, "%s read %d OUT, status %d\n",
|
||||
data->name, len, value);
|
||||
VDEBUG (data->dev, "%s read %zu OUT, status %d\n",
|
||||
data->name, len, (int) value);
|
||||
if (value >= 0 && copy_to_user (buf, kbuf, value))
|
||||
value = -EFAULT;
|
||||
|
||||
@@ -465,8 +465,8 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||
}
|
||||
|
||||
value = ep_io (data, kbuf, len);
|
||||
VDEBUG (data->dev, "%s write %d IN, status %d\n",
|
||||
data->name, len, value);
|
||||
VDEBUG (data->dev, "%s write %zu IN, status %d\n",
|
||||
data->name, len, (int) value);
|
||||
free1:
|
||||
up (&data->lock);
|
||||
kfree (kbuf);
|
||||
@@ -1318,8 +1318,8 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
||||
struct usb_request *req = dev->req;
|
||||
int value = -EOPNOTSUPP;
|
||||
struct usb_gadgetfs_event *event;
|
||||
u16 w_value = ctrl->wValue;
|
||||
u16 w_length = ctrl->wLength;
|
||||
u16 w_value = le16_to_cpu(ctrl->wValue);
|
||||
u16 w_length = le16_to_cpu(ctrl->wLength);
|
||||
|
||||
spin_lock (&dev->lock);
|
||||
dev->setup_abort = 0;
|
||||
|
Reference in New Issue
Block a user