diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 12:40:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 12:40:26 -0700 |
commit | c813b4e16ead3c3df98ac84419d4df2adf33fe01 (patch) | |
tree | 2ca4a5b6966d833b6149e3dda7a4e85d1255779c /drivers/usb/gadget/f_loopback.c | |
parent | c8d8a2321f9c4ee18fbcc399fdc2a77e580a03b9 (diff) | |
parent | 02683ffdf655b4ae15245376ba6fea6d9e5829a6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits)
UIO: Fix mapping of logical and virtual memory
UIO: add automata sercos3 pci card support
UIO: Change driver name of uio_pdrv
UIO: Add alignment warnings for uio-mem
Driver core: add bus_sort_breadthfirst() function
NET: convert the phy_device file to use bus_find_device_by_name
kobject: Cleanup kobject_rename and !CONFIG_SYSFS
kobject: Fix kobject_rename and !CONFIG_SYSFS
sysfs: Make dir and name args to sysfs_notify() const
platform: add new device registration helper
sysfs: use ilookup5() instead of ilookup5_nowait()
PNP: create device attributes via default device attributes
Driver core: make bus_find_device_by_name() more robust
usb: turn dev_warn+WARN_ON combos into dev_WARN
debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
debug: Introduce a dev_WARN() function
sysfs: fix deadlock
device model: Do a quickcheck for driver binding before doing an expensive check
Driver core: Fix cleanup in device_create_vargs().
Driver core: Clarify device cleanup.
...
Diffstat (limited to 'drivers/usb/gadget/f_loopback.c')
-rw-r--r-- | drivers/usb/gadget/f_loopback.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c index eda4cde72c8..87dde012dac 100644 --- a/drivers/usb/gadget/f_loopback.c +++ b/drivers/usb/gadget/f_loopback.c @@ -70,7 +70,7 @@ static struct usb_interface_descriptor loopback_intf = { /* full speed support: */ -static struct usb_endpoint_descriptor fs_source_desc = { +static struct usb_endpoint_descriptor fs_loop_source_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, @@ -78,7 +78,7 @@ static struct usb_endpoint_descriptor fs_source_desc = { .bmAttributes = USB_ENDPOINT_XFER_BULK, }; -static struct usb_endpoint_descriptor fs_sink_desc = { +static struct usb_endpoint_descriptor fs_loop_sink_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, @@ -88,14 +88,14 @@ static struct usb_endpoint_descriptor fs_sink_desc = { static struct usb_descriptor_header *fs_loopback_descs[] = { (struct usb_descriptor_header *) &loopback_intf, - (struct usb_descriptor_header *) &fs_sink_desc, - (struct usb_descriptor_header *) &fs_source_desc, + (struct usb_descriptor_header *) &fs_loop_sink_desc, + (struct usb_descriptor_header *) &fs_loop_source_desc, NULL, }; /* high speed support: */ -static struct usb_endpoint_descriptor hs_source_desc = { +static struct usb_endpoint_descriptor hs_loop_source_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, @@ -103,7 +103,7 @@ static struct usb_endpoint_descriptor hs_source_desc = { .wMaxPacketSize = __constant_cpu_to_le16(512), }; -static struct usb_endpoint_descriptor hs_sink_desc = { +static struct usb_endpoint_descriptor hs_loop_sink_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, @@ -113,8 +113,8 @@ static struct usb_endpoint_descriptor hs_sink_desc = { static struct usb_descriptor_header *hs_loopback_descs[] = { (struct usb_descriptor_header *) &loopback_intf, - (struct usb_descriptor_header *) &hs_source_desc, - (struct usb_descriptor_header *) &hs_sink_desc, + (struct usb_descriptor_header *) &hs_loop_source_desc, + (struct usb_descriptor_header *) &hs_loop_sink_desc, NULL, }; @@ -152,7 +152,7 @@ loopback_bind(struct usb_configuration *c, struct usb_function *f) /* allocate endpoints */ - loop->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_source_desc); + loop->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_source_desc); if (!loop->in_ep) { autoconf_fail: ERROR(cdev, "%s: can't autoconfigure on %s\n", @@ -161,17 +161,17 @@ autoconf_fail: } loop->in_ep->driver_data = cdev; /* claim */ - loop->out_ep = usb_ep_autoconfig(cdev->gadget, &fs_sink_desc); + loop->out_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_sink_desc); if (!loop->out_ep) goto autoconf_fail; loop->out_ep->driver_data = cdev; /* claim */ /* support high speed hardware */ if (gadget_is_dualspeed(c->cdev->gadget)) { - hs_source_desc.bEndpointAddress = - fs_source_desc.bEndpointAddress; - hs_sink_desc.bEndpointAddress = - fs_sink_desc.bEndpointAddress; + hs_loop_source_desc.bEndpointAddress = + fs_loop_source_desc.bEndpointAddress; + hs_loop_sink_desc.bEndpointAddress = + fs_loop_sink_desc.bEndpointAddress; f->hs_descriptors = hs_loopback_descs; } @@ -255,8 +255,10 @@ enable_loopback(struct usb_composite_dev *cdev, struct f_loopback *loop) struct usb_request *req; unsigned i; - src = ep_choose(cdev->gadget, &hs_source_desc, &fs_source_desc); - sink = ep_choose(cdev->gadget, &hs_sink_desc, &fs_sink_desc); + src = ep_choose(cdev->gadget, + &hs_loop_source_desc, &fs_loop_source_desc); + sink = ep_choose(cdev->gadget, + &hs_loop_sink_desc, &fs_loop_sink_desc); /* one endpoint writes data back IN to the host */ ep = loop->in_ep; |