diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-14 13:52:40 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-14 13:52:40 -0400 |
| commit | e90a4e475a8b34adbefe189c9d0932fa0b7b750f (patch) | |
| tree | 9547183741c7361edd9e329d8a000ae432378a87 | |
| parent | 6aa5fc434958d15a4d66d922d0416dfb03c07def (diff) | |
| parent | 405177070614f35133304d4daa1332afeb83ffa2 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (22 commits)
USB: atmel_usba_udc fixes, mostly disconnect()
USB: pxa27x_udc: minor fixes
usbtest: comment on why this code "expects" negative and positive errnos
USB: remove PICDEM FS USB demo (04d8:000c) device from ldusb
USB: option: add new Dell 5520 HSDPA variant
USB: unusual_devs: Add support for GI 0401 SD-Card interface
USB: serial gadget: descriptor cleanup
USB: serial gadget: simplify endpoint handling
USB: serial gadget: remove needless data structure
USB: serial gadget: cleanup/reorg
usb: fix compile warning in isp1760
USB: do not handle device 1410:5010 in 'option' driver
USB: Fix unusual_devs.h ordering
USB: add Zoom Telephonics Model 3095F V.92 USB Mini External modem to cdc-acm
USB: Support for the ET502HS HDSPA modem in option driver
USB: Support for the ET502HS HDSPA modem
usb: fix integer as NULL pointer warnings found by sparse
USB: isp1760: fix printk format
USB: add Telstra NextG CDMA id to option driver
USB: add association.h
...
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 3 | ||||
| -rw-r--r-- | drivers/usb/core/endpoint.c | 11 | ||||
| -rw-r--r-- | drivers/usb/core/message.c | 1 | ||||
| -rw-r--r-- | drivers/usb/core/sysfs.c | 137 | ||||
| -rw-r--r-- | drivers/usb/core/usb.c | 1 | ||||
| -rw-r--r-- | drivers/usb/core/usb.h | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/amd5536udc.c | 10 | ||||
| -rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 48 | ||||
| -rw-r--r-- | drivers/usb/gadget/pxa27x_udc.c | 17 | ||||
| -rw-r--r-- | drivers/usb/gadget/pxa27x_udc.h | 8 | ||||
| -rw-r--r-- | drivers/usb/gadget/serial.c | 778 | ||||
| -rw-r--r-- | drivers/usb/host/isp1760-hcd.c | 4 | ||||
| -rw-r--r-- | drivers/usb/host/isp1760-if.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/ohci-sm501.c | 2 | ||||
| -rw-r--r-- | drivers/usb/misc/ldusb.c | 4 | ||||
| -rw-r--r-- | drivers/usb/misc/usbtest.c | 5 | ||||
| -rw-r--r-- | drivers/usb/serial/Kconfig | 9 | ||||
| -rw-r--r-- | drivers/usb/serial/Makefile | 1 | ||||
| -rw-r--r-- | drivers/usb/serial/moto_modem.c | 70 | ||||
| -rw-r--r-- | drivers/usb/serial/option.c | 9 | ||||
| -rw-r--r-- | drivers/usb/storage/unusual_devs.h | 71 | ||||
| -rw-r--r-- | include/linux/usb/association.h | 150 |
22 files changed, 777 insertions, 568 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index cefe7f2c6f75..63c34043b4d9 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -1248,6 +1248,9 @@ static struct usb_device_id acm_ids[] = { | |||
| 1248 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ | 1248 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ |
| 1249 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 1249 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
| 1250 | }, | 1250 | }, |
| 1251 | { USB_DEVICE(0x0803, 0x3095), /* Zoom Telephonics Model 3095F USB MODEM */ | ||
| 1252 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | ||
| 1253 | }, | ||
| 1251 | 1254 | ||
| 1252 | /* control interfaces with various AT-command sets */ | 1255 | /* control interfaces with various AT-command sets */ |
| 1253 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | 1256 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 99e5a68a3f12..fae55a31e26d 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
| @@ -156,6 +156,10 @@ static struct attribute *ep_dev_attrs[] = { | |||
| 156 | static struct attribute_group ep_dev_attr_grp = { | 156 | static struct attribute_group ep_dev_attr_grp = { |
| 157 | .attrs = ep_dev_attrs, | 157 | .attrs = ep_dev_attrs, |
| 158 | }; | 158 | }; |
| 159 | static struct attribute_group *ep_dev_groups[] = { | ||
| 160 | &ep_dev_attr_grp, | ||
| 161 | NULL | ||
| 162 | }; | ||
| 159 | 163 | ||
| 160 | static int usb_endpoint_major_init(void) | 164 | static int usb_endpoint_major_init(void) |
| 161 | { | 165 | { |
| @@ -298,6 +302,7 @@ int usb_create_ep_files(struct device *parent, | |||
| 298 | 302 | ||
| 299 | ep_dev->desc = &endpoint->desc; | 303 | ep_dev->desc = &endpoint->desc; |
| 300 | ep_dev->udev = udev; | 304 | ep_dev->udev = udev; |
| 305 | ep_dev->dev.groups = ep_dev_groups; | ||
| 301 | ep_dev->dev.devt = MKDEV(usb_endpoint_major, ep_dev->minor); | 306 | ep_dev->dev.devt = MKDEV(usb_endpoint_major, ep_dev->minor); |
| 302 | ep_dev->dev.class = ep_class->class; | 307 | ep_dev->dev.class = ep_class->class; |
| 303 | ep_dev->dev.parent = parent; | 308 | ep_dev->dev.parent = parent; |
| @@ -309,9 +314,6 @@ int usb_create_ep_files(struct device *parent, | |||
| 309 | retval = device_register(&ep_dev->dev); | 314 | retval = device_register(&ep_dev->dev); |
| 310 | if (retval) | 315 | if (retval) |
| 311 | goto error_chrdev; | 316 | goto error_chrdev; |
| 312 | retval = sysfs_create_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
| 313 | if (retval) | ||
| 314 | goto error_group; | ||
| 315 | 317 | ||
| 316 | /* create the symlink to the old-style "ep_XX" directory */ | 318 | /* create the symlink to the old-style "ep_XX" directory */ |
| 317 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); | 319 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); |
| @@ -322,8 +324,6 @@ int usb_create_ep_files(struct device *parent, | |||
| 322 | return retval; | 324 | return retval; |
| 323 | 325 | ||
| 324 | error_link: | 326 | error_link: |
| 325 | sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
| 326 | error_group: | ||
| 327 | device_unregister(&ep_dev->dev); | 327 | device_unregister(&ep_dev->dev); |
| 328 | destroy_endpoint_class(); | 328 | destroy_endpoint_class(); |
| 329 | return retval; | 329 | return retval; |
| @@ -348,7 +348,6 @@ void usb_remove_ep_files(struct usb_host_endpoint *endpoint) | |||
| 348 | 348 | ||
| 349 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); | 349 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); |
| 350 | sysfs_remove_link(&ep_dev->dev.parent->kobj, name); | 350 | sysfs_remove_link(&ep_dev->dev.parent->kobj, name); |
| 351 | sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
| 352 | device_unregister(&ep_dev->dev); | 351 | device_unregister(&ep_dev->dev); |
| 353 | endpoint->ep_dev = NULL; | 352 | endpoint->ep_dev = NULL; |
| 354 | destroy_endpoint_class(); | 353 | destroy_endpoint_class(); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 3e69266e1f4d..fe47d145255a 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -1607,6 +1607,7 @@ free_interfaces: | |||
| 1607 | intf->dev.driver = NULL; | 1607 | intf->dev.driver = NULL; |
| 1608 | intf->dev.bus = &usb_bus_type; | 1608 | intf->dev.bus = &usb_bus_type; |
| 1609 | intf->dev.type = &usb_if_device_type; | 1609 | intf->dev.type = &usb_if_device_type; |
| 1610 | intf->dev.groups = usb_interface_groups; | ||
| 1610 | intf->dev.dma_mask = dev->dev.dma_mask; | 1611 | intf->dev.dma_mask = dev->dev.dma_mask; |
| 1611 | device_initialize(&intf->dev); | 1612 | device_initialize(&intf->dev); |
| 1612 | mark_quiesced(intf); | 1613 | mark_quiesced(intf); |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 5b20a60de8ba..c783cb111847 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
| @@ -538,6 +538,46 @@ static struct attribute_group dev_attr_grp = { | |||
| 538 | .attrs = dev_attrs, | 538 | .attrs = dev_attrs, |
| 539 | }; | 539 | }; |
| 540 | 540 | ||
| 541 | /* When modifying this list, be sure to modify dev_string_attrs_are_visible() | ||
| 542 | * accordingly. | ||
| 543 | */ | ||
| 544 | static struct attribute *dev_string_attrs[] = { | ||
| 545 | &dev_attr_manufacturer.attr, | ||
| 546 | &dev_attr_product.attr, | ||
| 547 | &dev_attr_serial.attr, | ||
| 548 | NULL | ||
| 549 | }; | ||
| 550 | |||
| 551 | static mode_t dev_string_attrs_are_visible(struct kobject *kobj, | ||
| 552 | struct attribute *a, int n) | ||
| 553 | { | ||
| 554 | struct usb_device *udev = to_usb_device( | ||
| 555 | container_of(kobj, struct device, kobj)); | ||
| 556 | |||
| 557 | if (a == &dev_attr_manufacturer.attr) { | ||
| 558 | if (udev->manufacturer == NULL) | ||
| 559 | return 0; | ||
| 560 | } else if (a == &dev_attr_product.attr) { | ||
| 561 | if (udev->product == NULL) | ||
| 562 | return 0; | ||
| 563 | } else if (a == &dev_attr_serial.attr) { | ||
| 564 | if (udev->serial == NULL) | ||
| 565 | return 0; | ||
| 566 | } | ||
| 567 | return a->mode; | ||
| 568 | } | ||
| 569 | |||
| 570 | static struct attribute_group dev_string_attr_grp = { | ||
| 571 | .attrs = dev_string_attrs, | ||
| 572 | .is_visible = dev_string_attrs_are_visible, | ||
| 573 | }; | ||
| 574 | |||
| 575 | struct attribute_group *usb_device_groups[] = { | ||
| 576 | &dev_attr_grp, | ||
| 577 | &dev_string_attr_grp, | ||
| 578 | NULL | ||
| 579 | }; | ||
| 580 | |||
| 541 | /* Binary descriptors */ | 581 | /* Binary descriptors */ |
| 542 | 582 | ||
| 543 | static ssize_t | 583 | static ssize_t |
| @@ -591,10 +631,9 @@ int usb_create_sysfs_dev_files(struct usb_device *udev) | |||
| 591 | struct device *dev = &udev->dev; | 631 | struct device *dev = &udev->dev; |
| 592 | int retval; | 632 | int retval; |
| 593 | 633 | ||
| 594 | retval = sysfs_create_group(&dev->kobj, &dev_attr_grp); | 634 | /* Unforunately these attributes cannot be created before |
| 595 | if (retval) | 635 | * the uevent is broadcast. |
| 596 | return retval; | 636 | */ |
| 597 | |||
| 598 | retval = device_create_bin_file(dev, &dev_bin_attr_descriptors); | 637 | retval = device_create_bin_file(dev, &dev_bin_attr_descriptors); |
| 599 | if (retval) | 638 | if (retval) |
| 600 | goto error; | 639 | goto error; |
| @@ -607,21 +646,6 @@ int usb_create_sysfs_dev_files(struct usb_device *udev) | |||
| 607 | if (retval) | ||
