diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-07 20:58:12 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-07 20:58:12 -0700 |
| commit | 11c046a0a05eab1566bd47fee54a20c207e12b99 (patch) | |
| tree | 68f2e39ab271ac04c609d36ecfbfc1fd86231225 /usb | |
| parent | 9fb5a90450511eee3b9e86ceea2d7cf2988ce6ef (diff) | |
| download | patches-11c046a0a05eab1566bd47fee54a20c207e12b99.tar.gz | |
rework series file, adding .next sections
Diffstat (limited to 'usb')
| -rw-r--r-- | usb/usb-add-association.h.patch | 173 | ||||
| -rw-r--r-- | usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch | 120 | ||||
| -rw-r--r-- | usb/usb-create-attributes-before-sending-uevent.patch | 329 |
3 files changed, 0 insertions, 622 deletions
diff --git a/usb/usb-add-association.h.patch b/usb/usb-add-association.h.patch deleted file mode 100644 index 28875baa051382..00000000000000 --- a/usb/usb-add-association.h.patch +++ /dev/null @@ -1,173 +0,0 @@ -From foo@baz Tue Apr 9 12:12:43 2002 -Date: Fri, 25 Apr 2008 19:23:16 -0700 -To: Greg KH <greg@kroah.com> -From: Greg Kroah-Hartman <gregkh@suse.de> -Subject: USB: add association.h - -This will be used by the wireless usb code, as well as potentially other -USB code. - -Originally based on some .c code written by Inaky Perez-Gonzalez -<inaky.perez-gonzalez@intel.com> - -Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> -Cc: David Brownell <david-b@pacbell.net> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - include/linux/usb/association.h | 150 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 150 insertions(+) - ---- /dev/null -+++ b/include/linux/usb/association.h -@@ -0,0 +1,150 @@ -+/* -+ * Wireless USB - Cable Based Association -+ * -+ * Copyright (C) 2006 Intel Corporation -+ * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License version -+ * 2 as published by the Free Software Foundation. -+ * -+ */ -+#ifndef __LINUX_USB_ASSOCIATION_H -+#define __LINUX_USB_ASSOCIATION_H -+ -+ -+/* -+ * Association attributes -+ * -+ * Association Models Supplement to WUSB 1.0 T[3-1] -+ * -+ * Each field in the structures has it's ID, it's length and then the -+ * value. This is the actual definition of the field's ID and its -+ * length. -+ */ -+struct wusb_am_attr { -+ __u8 id; -+ __u8 len; -+}; -+ -+/* Different fields defined by the spec */ -+#define WUSB_AR_AssociationTypeId { .id = 0x0000, .len = 2 } -+#define WUSB_AR_AssociationSubTypeId { .id = 0x0001, .len = 2 } -+#define WUSB_AR_Length { .id = 0x0002, .len = 4 } -+#define WUSB_AR_AssociationStatus { .id = 0x0004, .len = 4 } -+#define WUSB_AR_LangID { .id = 0x0008, .len = 2 } -+#define WUSB_AR_DeviceFriendlyName { .id = 0x000b, .len = 64 } /* max */ -+#define WUSB_AR_HostFriendlyName { .id = 0x000c, .len = 64 } /* max */ -+#define WUSB_AR_CHID { .id = 0x1000, .len = 16 } -+#define WUSB_AR_CDID { .id = 0x1001, .len = 16 } -+#define WUSB_AR_ConnectionContext { .id = 0x1002, .len = 48 } -+#define WUSB_AR_BandGroups { .id = 0x1004, .len = 2 } -+ -+/* CBAF Control Requests (AMS1.0[T4-1] */ -+enum { -+ CBAF_REQ_GET_ASSOCIATION_INFORMATION = 0x01, -+ CBAF_REQ_GET_ASSOCIATION_REQUEST, -+ CBAF_REQ_SET_ASSOCIATION_RESPONSE -+}; -+ -+/* -+ * CBAF USB-interface defitions -+ * -+ * No altsettings, one optional interrupt endpoint. -+ */ -+enum { -+ CBAF_IFACECLASS = 0xef, -+ CBAF_IFACESUBCLASS = 0x03, -+ CBAF_IFACEPROTOCOL = 0x01, -+}; -+ -+/* Association Information (AMS1.0[T4-3]) */ -+struct wusb_cbaf_assoc_info { -+ __le16 Length; -+ __u8 NumAssociationRequests; -+ __le16 Flags; -+ __u8 AssociationRequestsArray[]; -+} __attribute__((packed)); -+ -+/* Association Request (AMS1.0[T4-4]) */ -+struct wusb_cbaf_assoc_request { -+ __u8 AssociationDataIndex; -+ __u8 Reserved; -+ __le16 AssociationTypeId; -+ __le16 AssociationSubTypeId; -+ __le32 AssociationTypeInfoSize; -+} __attribute__((packed)); -+ -+enum { -+ AR_TYPE_WUSB = 0x0001, -+ AR_TYPE_WUSB_RETRIEVE_HOST_INFO = 0x0000, -+ AR_TYPE_WUSB_ASSOCIATE = 0x0001, -+}; -+ -+/* Association Attribute header (AMS1.0[3.8]) */ -+struct wusb_cbaf_attr_hdr { -+ __le16 id; -+ __le16 len; -+} __attribute__((packed)); -+ -+/* Host Info (AMS1.0[T4-7]) (yeah, more headers and fields...) */ -+struct wusb_cbaf_host_info { -+ struct wusb_cbaf_attr_hdr AssociationTypeId_hdr; -+ __le16 AssociationTypeId; -+ struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr; -+ __le16 AssociationSubTypeId; -+ struct wusb_cbaf_attr_hdr CHID_hdr; -+ struct wusb_ckhdid CHID; -+ struct wusb_cbaf_attr_hdr LangID_hdr; -+ __le16 LangID; -+ struct wusb_cbaf_attr_hdr HostFriendlyName_hdr; -+ __u8 HostFriendlyName[]; -+} __attribute__((packed)); -+ -+/* Device Info (AMS1.0[T4-8]) -+ * -+ * I still don't get this tag'n'header stuff for each goddamn -+ * field... -+ */ -+struct wusb_cbaf_device_info { -+ struct wusb_cbaf_attr_hdr Length_hdr; -+ __le32 Length; -+ struct wusb_cbaf_attr_hdr CDID_hdr; -+ struct wusb_ckhdid CDID; -+ struct wusb_cbaf_attr_hdr BandGroups_hdr; -+ __le16 BandGroups; -+ struct wusb_cbaf_attr_hdr LangID_hdr; -+ __le16 LangID; -+ struct wusb_cbaf_attr_hdr DeviceFriendlyName_hdr; -+ __u8 DeviceFriendlyName[]; -+} __attribute__((packed)); -+ -+/* Connection Context; CC_DATA - Success case (AMS1.0[T4-9]) */ -+struct wusb_cbaf_cc_data { -+ struct wusb_cbaf_attr_hdr AssociationTypeId_hdr; -+ __le16 AssociationTypeId; -+ struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr; -+ __le16 AssociationSubTypeId; -+ struct wusb_cbaf_attr_hdr Length_hdr; -+ __le32 Length; -+ struct wusb_cbaf_attr_hdr ConnectionContext_hdr; -+ struct wusb_ckhdid CHID; -+ struct wusb_ckhdid CDID; -+ struct wusb_ckhdid CK; -+ struct wusb_cbaf_attr_hdr BandGroups_hdr; -+ __le16 BandGroups; -+} __attribute__((packed)); -+ -+/* CC_DATA - Failure case (AMS1.0[T4-10]) */ -+struct wusb_cbaf_cc_data_fail { -+ struct wusb_cbaf_attr_hdr AssociationTypeId_hdr; -+ __le16 AssociationTypeId; -+ struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr; -+ __le16 AssociationSubTypeId; -+ struct wusb_cbaf_attr_hdr Length_hdr; -+ __le16 Length; -+ struct wusb_cbaf_attr_hdr AssociationStatus_hdr; -+ __u32 AssociationStatus; -+} __attribute__((packed)); -+ -+#endif /* __LINUX_USB_ASSOCIATION_H */ diff --git a/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch b/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch deleted file mode 100644 index 37aada3ff7fd7b..00000000000000 --- a/usb/usb-add-new-moto_modem-driver-for-some-morotola-phones.patch +++ /dev/null @@ -1,120 +0,0 @@ -From foo@baz Tue Apr 9 12:12:43 2002 -Date: Fri, 2 May 2008 12:02:20 -0700 -To: Greg KH <greg@kroah.com> -From: Greg Kroah-Hartman <gregkh@suse.de> -Subject: USB: add new moto_modem driver for some Morotola phones - -This should work on a KRZR K1m, and some other Motorola phones that do -not use the "standard" cdc ACM protocol to talk to USB hosts. - -Tested-by: Jeff Garzik <jeff@garzik.org> -Cc: Jiang Dejun <a5652c@motorola.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/usb/serial/Kconfig | 9 +++++ - drivers/usb/serial/Makefile | 1 - drivers/usb/serial/moto_modem.c | 70 ++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 80 insertions(+) - ---- a/drivers/usb/serial/Kconfig -+++ b/drivers/usb/serial/Kconfig -@@ -447,6 +447,15 @@ config USB_SERIAL_MOS7840 - To compile this driver as a module, choose M here: the - module will be called mos7840. If unsure, choose N. - -+config USB_SERIAL_MOTOROLA -+ tristate "USB Motorola Phone modem driver" -+ ---help--- -+ Say Y here if you want to use a Motorola phone with a USB -+ connector as a modem link. -+ -+ To compile this driver as a module, choose M here: the -+ module will be called moto_modem. If unsure, choose N. -+ - config USB_SERIAL_NAVMAN - tristate "USB Navman GPS device" - help ---- a/drivers/usb/serial/Makefile -+++ b/drivers/usb/serial/Makefile -@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += k - obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o - obj-$(CONFIG_USB_SERIAL_MOS7720) += mos7720.o - obj-$(CONFIG_USB_SERIAL_MOS7840) += mos7840.o -+obj-$(CONFIG_USB_SERIAL_MOTOROLA) += moto_modem.o - obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o - obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o - obj-$(CONFIG_USB_SERIAL_OPTION) += option.o ---- /dev/null -+++ b/drivers/usb/serial/moto_modem.c -@@ -0,0 +1,70 @@ -+/* -+ * Motorola USB Phone driver -+ * -+ * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com> -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * {sigh} -+ * Mororola should be using the CDC ACM USB spec, but instead -+ * they try to just "do their own thing"... This driver should handle a -+ * few phones in which a basic "dumb serial connection" is needed to be -+ * able to get a connection through to them. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/init.h> -+#include <linux/tty.h> -+#include <linux/module.h> -+#include <linux/usb.h> -+#include <linux/usb/serial.h> -+ -+static struct usb_device_id id_table [] = { -+ { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */ -+ { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */ -+ { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */ -+ { }, -+}; -+MODULE_DEVICE_TABLE(usb, id_table); -+ -+static struct usb_driver moto_driver = { -+ .name = "moto-modem", -+ .probe = usb_serial_probe, -+ .disconnect = usb_serial_disconnect, -+ .id_table = id_table, -+ .no_dynamic_id = 1, -+}; -+ -+static struct usb_serial_driver moto_device = { -+ .driver = { -+ .owner = THIS_MODULE, -+ .name = "moto-modem", -+ }, -+ .id_table = id_table, -+ .num_ports = 1, -+}; -+ -+static int __init moto_init(void) -+{ -+ int retval; -+ -+ retval = usb_serial_register(&moto_device); -+ if (retval) -+ return retval; -+ retval = usb_register(&moto_driver); -+ if (retval) -+ usb_serial_deregister(&moto_device); -+ return retval; -+} -+ -+static void __exit moto_exit(void) -+{ -+ usb_deregister(&moto_driver); -+ usb_serial_deregister(&moto_device); -+} -+ -+module_init(moto_init); -+module_exit(moto_exit); -+MODULE_LICENSE("GPL"); diff --git a/usb/usb-create-attributes-before-sending-uevent.patch b/usb/usb-create-attributes-before-sending-uevent.patch deleted file mode 100644 index 8887d5ddbce424..00000000000000 --- a/usb/usb-create-attributes-before-sending-uevent.patch +++ /dev/null @@ -1,329 +0,0 @@ -From stern+48120c40@rowland.harvard.edu Tue May 6 23:27:50 2008 -From: Alan Stern <stern@rowland.harvard.edu> -Date: Wed, 30 Apr 2008 15:37:19 -0400 (EDT) -Subject: USB: create attributes before sending uevent -To: Greg KH <greg@kroah.com> -Cc: Kay Sievers <kay.sievers@vrfy.org>, USB list <linux-usb@vger.kernel.org> -Message-ID: <Pine.LNX.4.44L0.0804301535210.3004-100000@iolanthe.rowland.org> - - -This patch (as1087d) fixes a long-standing problem in usbcore: Device, -interface, and endpoint attributes aren't added until _after_ the -creation uevent has already been broadcast. - -Unfortunately there are a few attributes which cannot be created that -early. The "descriptors" attribute is binary and so must be created -separately. The power-management attributes can't be created until -the dev/power/ group exists. And the interface string can vary from -one altsetting to another, so it has to be created dynamically. - -Signed-off-by: Alan Stern <stern@rowland.harvard.edu> -Cc: Kay Sievers <kay.sievers@vrfy.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/usb/core/endpoint.c | 11 +-- - drivers/usb/core/message.c | 1 - drivers/usb/core/sysfs.c | 137 +++++++++++++++++++++++++++----------------- - drivers/usb/core/usb.c | 1 - drivers/usb/core/usb.h | 4 + - 5 files changed, 96 insertions(+), 58 deletions(-) - ---- a/drivers/usb/core/endpoint.c -+++ b/drivers/usb/core/endpoint.c -@@ -156,6 +156,10 @@ static struct attribute *ep_dev_attrs[] - static struct attribute_group ep_dev_attr_grp = { - .attrs = ep_dev_attrs, - }; -+static struct attribute_group *ep_dev_groups[] = { -+ &ep_dev_attr_grp, -+ NULL -+}; - - static int usb_endpoint_major_init(void) - { -@@ -298,6 +302,7 @@ int usb_create_ep_files(struct device *p - - ep_dev->desc = &endpoint->desc; - ep_dev->udev = udev; -+ ep_dev->dev.groups = ep_dev_groups; - ep_dev->dev.devt = MKDEV(usb_endpoint_major, ep_dev->minor); - ep_dev->dev.class = ep_class->class; - ep_dev->dev.parent = parent; -@@ -309,9 +314,6 @@ int usb_create_ep_files(struct device *p - retval = device_register(&ep_dev->dev); - if (retval) - goto error_chrdev; -- retval = sysfs_create_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); -- if (retval) -- goto error_group; - - /* create the symlink to the old-style "ep_XX" directory */ - sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); -@@ -322,8 +324,6 @@ int usb_create_ep_files(struct device *p - return retval; - - error_link: -- sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); --error_group: - device_unregister(&ep_dev->dev); - destroy_endpoint_class(); - return retval; -@@ -348,7 +348,6 @@ void usb_remove_ep_files(struct usb_host - - sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); - sysfs_remove_link(&ep_dev->dev.parent->kobj, name); -- sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); - device_unregister(&ep_dev->dev); - endpoint->ep_dev = NULL; - destroy_endpoint_class(); ---- a/drivers/usb/core/message.c -+++ b/drivers/usb/core/message.c -@@ -1607,6 +1607,7 @@ free_interfaces: - intf->dev.driver = NULL; - intf->dev.bus = &usb_bus_type; - intf->dev.type = &usb_if_device_type; -+ intf->dev.groups = usb_interface_groups; - intf->dev.dma_mask = dev->dev.dma_mask; - device_initialize(&intf->dev); - mark_quiesced(intf); ---- a/drivers/usb/core/sysfs.c -+++ b/drivers/usb/core/sysfs.c -@@ -538,6 +538,46 @@ static struct attribute_group dev_attr_g - .attrs = dev_attrs, - }; - -+/* When modifying this list, be sure to modify dev_string_attrs_are_visible() -+ * accordingly. -+ */ -+static struct attribute *dev_string_attrs[] = { -+ &dev_attr_manufacturer.attr, -+ &dev_attr_product.attr, -+ &dev_attr_serial.attr, -+ NULL -+}; -+ -+static mode_t dev_string_attrs_are_visible(struct kobject *kobj, -+ struct attribute *a, int n) -+{ -+ struct usb_device *udev = to_usb_device( -+ container_of(kobj, struct device, kobj)); -+ -+ if (a == &dev_attr_manufacturer.attr) { -+ if (udev->manufacturer == NULL) -+ return 0; -+ } else if (a == &dev_attr_product.attr) { -+ if (udev->product == NULL) -+ return 0; -+ } else if (a == &dev_attr_serial.attr) { -+ if (udev->serial == NULL) -+ return 0; -+ } -+ return a->mode; -+} -+ -+static struct attribute_group dev_string_attr_grp = { -+ .attrs = dev_string_attrs, -+ .is_visible = dev_string_attrs_are_visible, -+}; -+ -+struct attribute_group *usb_device_groups[] = { -+ &dev_attr_grp, -+ &dev_string_attr_grp, -+ NULL -+}; -+ - /* Binary descriptors */ - - static ssize_t -@@ -591,10 +631,9 @@ int usb_create_sysfs_dev_files(struct us - struct device *dev = &udev->dev; - int retval; - -- retval = sysfs_create_group(&dev->kobj, &dev_attr_grp); -- if (retval) -- return retval; -- -+ /* Unforunately these attributes cannot be created before -+ * the uevent is broadcast. -+ */ - retval = device_create_bin_file(dev, &dev_bin_attr_descriptors); - if (retval) - goto error; -@@ -607,21 +646,6 @@ int usb_create_sysfs_dev_files(struct us - if (retval) - goto error; - -- if (udev->manufacturer) { -- retval = device_create_file(dev, &dev_attr_manufacturer); -- if (retval) -- goto error; -- } -- if (udev->product) { -- retval = device_create_file(dev, &dev_attr_product); -- if (retval) -- goto error; -- } -- if (udev->serial) { -- retval = device_create_file(dev, &dev_attr_serial); -- if (retval) -- goto error; -- } - retval = usb_create_ep_files(dev, &udev->ep0, udev); - if (retval) - goto error; -@@ -636,13 +660,9 @@ void usb_remove_sysfs_dev_files(struct u - struct device *dev = &udev->dev; - - usb_remove_ep_files(&udev->ep0); -- device_remove_file(dev, &dev_attr_manufacturer); -- device_remove_file(dev, &dev_attr_product); -- device_remove_file(dev, &dev_attr_serial); - remove_power_attributes(dev); - remove_persist_attributes(dev); - device_remove_bin_file(dev, &dev_bin_attr_descriptors); -- sysfs_remove_group(&dev->kobj, &dev_attr_grp); - } - - /* Interface Accociation Descriptor fields */ -@@ -688,17 +708,15 @@ static ssize_t show_interface_string(str - struct device_attribute *attr, char *buf) - { - struct usb_interface *intf; -- struct usb_device *udev; -- int len; -+ char *string; - - intf = to_usb_interface(dev); -- udev = interface_to_usbdev(intf); -- len = snprintf(buf, 256, "%s", intf->cur_altsetting->string); -- if (len < 0) -+ string = intf->cur_altsetting->string; -+ barrier(); /* The altsetting might change! */ -+ -+ if (!string) - return 0; -- buf[len] = '\n'; -- buf[len+1] = 0; -- return len+1; -+ return sprintf(buf, "%s\n", string); - } - static DEVICE_ATTR(interface, S_IRUGO, show_interface_string, NULL); - -@@ -727,18 +745,6 @@ static ssize_t show_modalias(struct devi - } - static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); - --static struct attribute *intf_assoc_attrs[] = { -- &dev_attr_iad_bFirstInterface.attr, -- &dev_attr_iad_bInterfaceCount.attr, -- &dev_attr_iad_bFunctionClass.attr, -- &dev_attr_iad_bFunctionSubClass.attr, -- &dev_attr_iad_bFunctionProtocol.attr, -- NULL, --}; --static struct attribute_group intf_assoc_attr_grp = { -- .attrs = intf_assoc_attrs, --}; -- - static struct attribute *intf_attrs[] = { - &dev_attr_bInterfaceNumber.attr, - &dev_attr_bAlternateSetting.attr, -@@ -753,6 +759,37 @@ static struct attribute_group intf_attr_ - .attrs = intf_attrs, - }; - -+static struct attribute *intf_assoc_attrs[] = { -+ &dev_attr_iad_bFirstInterface.attr, -+ &dev_attr_iad_bInterfaceCount.attr, -+ &dev_attr_iad_bFunctionClass.attr, -+ &dev_attr_iad_bFunctionSubClass.attr, -+ &dev_attr_iad_bFunctionProtocol.attr, -+ NULL, -+}; -+ -+static mode_t intf_assoc_attrs_are_visible(struct kobject *kobj, -+ struct attribute *a, int n) -+{ -+ struct usb_interface *intf = to_usb_interface( -+ container_of(kobj, struct device, kobj)); -+ -+ if (intf->intf_assoc == NULL) -+ return 0; -+ return a->mode; -+} -+ -+static struct attribute_group intf_assoc_attr_grp = { -+ .attrs = intf_assoc_attrs, -+ .is_visible = intf_assoc_attrs_are_visible, -+}; -+ -+struct attribute_group *usb_interface_groups[] = { -+ &intf_attr_grp, -+ &intf_assoc_attr_grp, -+ NULL -+}; -+ - static inline void usb_create_intf_ep_files(struct usb_interface *intf, - struct usb_device *udev) - { -@@ -777,23 +814,21 @@ static inline void usb_remove_intf_ep_fi - - int usb_create_sysfs_intf_files(struct usb_interface *intf) - { -- struct device *dev = &intf->dev; - struct usb_device *udev = interface_to_usbdev(intf); - struct usb_host_interface *alt = intf->cur_altsetting; - int retval; - - if (intf->sysfs_files_created) - return 0; -- retval = sysfs_create_group(&dev->kobj, &intf_attr_grp); -- if (retval) -- return retval; - -+ /* The interface string may be present in some altsettings -+ * and missing in others. Hence its attribute cannot be created -+ * before the uevent is broadcast. -+ */ - if (alt->string == NULL) - alt->string = usb_cache_string(udev, alt->desc.iInterface); - if (alt->string) -- retval = device_create_file(dev, &dev_attr_interface); -- if (intf->intf_assoc) -- retval = sysfs_create_group(&dev->kobj, &intf_assoc_attr_grp); -+ retval = device_create_file(&intf->dev, &dev_attr_interface); - usb_create_intf_ep_files(intf, udev); - intf->sysfs_files_created = 1; - return 0; -@@ -807,7 +842,5 @@ void usb_remove_sysfs_intf_files(struct - return; - usb_remove_intf_ep_files(intf); - device_remove_file(dev, &dev_attr_interface); -- sysfs_remove_group(&dev->kobj, &intf_attr_grp); -- sysfs_remove_group(&intf->dev.kobj, &intf_assoc_attr_grp); - intf->sysfs_files_created = 0; - } ---- a/drivers/usb/core/usb.c -+++ b/drivers/usb/core/usb.c -@@ -291,6 +291,7 @@ struct usb_device *usb_alloc_dev(struct - device_initialize(&dev->dev); - dev->dev.bus = &usb_bus_type; - dev->dev.type = &usb_device_type; -+ dev->dev.groups = usb_device_groups; - dev->dev.dma_mask = bus->controller->dma_mask; - set_dev_node(&dev->dev, dev_to_node(bus->controller)); - dev->state = USB_STATE_ATTACHED; ---- a/drivers/usb/core/usb.h -+++ b/drivers/usb/core/usb.h -@@ -130,6 +130,10 @@ static inline int is_active(const struct - /* for labeling diagnostics */ - extern const char *usbcore_name; - -+/* sysfs stuff */ -+extern struct attribute_group *usb_device_groups[]; -+extern struct attribute_group *usb_interface_groups[]; -+ - /* usbfs stuff */ - extern struct mutex usbfs_mutex; - extern struct usb_driver usbfs_driver; |
