aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-01-05 10:39:51 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-05 10:39:51 -0800
commitf4e5beb57e7624d770355437e859ad849e1f68fa (patch)
treefe720a4578e890e778dd2c51fc5f1dbf4d810000 /usb
parent5758ac5a57c079fa516d792c9f4d65229c83f135 (diff)
downloadpatches-f4e5beb57e7624d770355437e859ad849e1f68fa.tar.gz
removed rest of 2.6.15-git1 commited patches
Diffstat (limited to 'usb')
-rw-r--r--usb/add-pxa27x-ohci-pm-functions.patch77
-rw-r--r--usb/correct-ohci-pxa27x-suspend-resume-struct-confusion.patch64
-rw-r--r--usb/disconnect-children-during-hub-unbind.patch176
-rw-r--r--usb/drivers-usb-misc-sisusbvga-sisusb.c-remove-dead-code.patch40
-rw-r--r--usb/ehci-fix-conflation-of-buf-0-with-len-0.patch63
-rw-r--r--usb/ftdi_sio-new-ids-for-teratronik-devices.patch55
-rw-r--r--usb/isp116x-hcd-cleanup.patch782
-rw-r--r--usb/isp116x-hcd-minor-cleanup.patch35
-rw-r--r--usb/isp116x-hcd-support-reiniting-hc-on-resume.patch78
-rw-r--r--usb/isp116x-hcd.c-removed-unused-variable.patch37
-rw-r--r--usb/one-potential-problem-in-gadget-serial.c.patch31
-rw-r--r--usb/pxa27x-ohci-separate-platform-code-from-main-driver.patch308
-rw-r--r--usb/remove-usb-private-semaphore.patch507
-rw-r--r--usb/uhci-change-uhci_explen-macro.patch113
-rw-r--r--usb/uhci-edit-some-comments.patch273
-rw-r--r--usb/usb-add-driver-for-ati-philips-usb-rf-remotes.patch534
-rw-r--r--usb/usb-asix.c-add-linksys-usb200m-rev-2-ids.patch30
-rw-r--r--usb/usb-ati_remote-use-time_before-and-friends.patch63
-rw-r--r--usb/usb-cdc-acm-ring-queue.patch524
-rw-r--r--usb/usb-cleanups-for-usb-gadget-mass-storage.patch31
-rw-r--r--usb/usb-don-t-allocate-dma-pools-for-pio-hcds.patch34
-rw-r--r--usb/usb-don-t-assume-root-hub-resume-succeeds.patch34
-rw-r--r--usb/usb-driver-owner-removal.patch1364
-rw-r--r--usb/usb-driver-owner.patch71
-rw-r--r--usb/usb-dummy_hcd-rename-variables.patch164
-rw-r--r--usb/usb-dynamic-id-01.patch742
-rw-r--r--usb/usb-dynamic-id-02.patch352
-rw-r--r--usb/usb-dynamic-id-03.patch417
-rw-r--r--usb/usb-eagle-and-adi-930-usb-adsl-modem-driver-fix.patch90
-rw-r--r--usb/usb-eagle-and-adi-930-usb-adsl-modem-driver.patch1906
-rw-r--r--usb/usb-ehci-fix-driver-model-wakeup-flags.patch32
-rw-r--r--usb/usb-ehci-updates-driver-model-wakeup-flags.patch74
-rw-r--r--usb/usb-export-ieee-1284-device-id-in-sysfs-for-usblp-devices.patch98
-rw-r--r--usb/usb-file-storage-gadget-add-reference-count-for-children.patch137
-rw-r--r--usb/usb-fix-buffer-size-limiting-in-skeleton-driver.patch28
-rw-r--r--usb/usb-fix-locking-for-usb-suspend-resume.patch116
-rw-r--r--usb/usb-fix-usb-skeleton-limit-resource-usage-patch.patch44
-rw-r--r--usb/usb-fix-usb_find_interface-for-ppc64.patch66
-rw-r--r--usb/usb-gadget-dummy_hcd-updates-to-hcd-state.patch118
-rw-r--r--usb/usb-gadget-file_storage-remove-volatile-declarations.patch235
-rw-r--r--usb/usb-hcd-uses-extra_cflags-for-ddebug.patch135
-rw-r--r--usb/usb-input-touchkitusb-handle-multiple-packets.patch218
-rw-r--r--usb/usb-ioctl-compat-for-usblp.c.patch48
-rw-r--r--usb/usb-let-usbmon-collect-less-garbage.patch47
-rw-r--r--usb/usb-libusual.patch914
-rw-r--r--usb/usb-limiting-of-resource-use-in-skeleton-driver.patch118
-rw-r--r--usb/usb-make-bias-writeable-in-libusual.patch128
-rw-r--r--usb/usb-mark-various-usb-tables-const.patch431
-rw-r--r--usb/usb-net-new-device-id-passed-through-module-parameter.patch104
-rw-r--r--usb/usb-net-removes-redundant-return.patch293
-rw-r--r--usb/usb-pl2303_update_line_status-data-length-fix.patch30
-rw-r--r--usb/usb-remove-unneeded-kmalloc-return-value-casts.patch93
-rw-r--r--usb/usb-replace-__setup-with-__module_param_call.patch56
53 files changed, 0 insertions, 12558 deletions
diff --git a/usb/add-pxa27x-ohci-pm-functions.patch b/usb/add-pxa27x-ohci-pm-functions.patch
deleted file mode 100644
index a75bb96d02839..0000000000000
--- a/usb/add-pxa27x-ohci-pm-functions.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From rpurdie@rpsys.net Sat Nov 12 06:24:45 2005
-Subject: [usb patch 2/2] Add pxa27x OHCI PM functions
-From: Richard Purdie <rpurdie@rpsys.net>
-To: Greg KH <greg@kroah.com>
-Date: Sat, 12 Nov 2005 14:22:14 +0000
-Message-Id: <1131805334.7597.18.camel@localhost.localdomain>
-
-Add power management functions for the pxa27x USB OHCI host controller.
-This is a totally rewritten version of the patch by Nicolas Pitre and
-Todd Poynor which accounts for recent USB changes.
-
-Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/ohci-pxa27x.c | 33 +++++++++++++++++++++++++++------
- 1 file changed, 27 insertions(+), 6 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ohci-pxa27x.c
-+++ gregkh-2.6/drivers/usb/host/ohci-pxa27x.c
-@@ -312,28 +312,49 @@ static int ohci_hcd_pxa27x_drv_remove(st
- return 0;
- }
-
--static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state)
-+#ifdef CONFIG_PM
-+static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state)
- {
--// struct usb_hcd *hcd = platform_get_drvdata(dev);
-- printk("%s: not implemented yet\n", __FUNCTION__);
-+ struct ohci_hcd *ohci = platform_get_drvdata(pdev);
-+
-+ if (time_before(jiffies, ohci->next_statechange))
-+ msleep(5);
-+ ohci->next_statechange = jiffies;
-+
-+ pxa27x_stop_hc(&pdev->dev);
-+ ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED;
-+ pdev->dev.power.power_state = PMSG_SUSPEND;
-
- return 0;
- }
-
--static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev)
-+static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
- {
--// struct usb_hcd *hcd = platform_get_drvdata(dev);
-- printk("%s: not implemented yet\n", __FUNCTION__);
-+ struct ohci_hcd *ohci = platform_get_drvdata(pdev);
-+ int status;
-+
-+ if (time_before(jiffies, ohci->next_statechange))
-+ msleep(5);
-+ ohci->next_statechange = jiffies;
-+
-+ if ((status = pxa27x_start_hc(&pdev->dev)) < 0)
-+ return status;
-+
-+ pdev->dev.power.power_state = PMSG_ON;
-+ usb_hcd_resume_root_hub(platform_get_drvdata(pdev));
-
- return 0;
- }
-+#endif
-
-
- static struct platform_driver ohci_hcd_pxa27x_driver = {
- .probe = ohci_hcd_pxa27x_drv_probe,
- .remove = ohci_hcd_pxa27x_drv_remove,
-+#ifdef CONFIG_PM
- .suspend = ohci_hcd_pxa27x_drv_suspend,
- .resume = ohci_hcd_pxa27x_drv_resume,
-+#endif
- .driver = {
- .name = "pxa27x-ohci",
- },
diff --git a/usb/correct-ohci-pxa27x-suspend-resume-struct-confusion.patch b/usb/correct-ohci-pxa27x-suspend-resume-struct-confusion.patch
deleted file mode 100644
index 4881ad198f243..0000000000000
--- a/usb/correct-ohci-pxa27x-suspend-resume-struct-confusion.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From rpurdie@rpsys.net Mon Nov 28 14:21:56 2005
-Subject: [patch] Correct ohci-pxa27x suspend/resume struct confusion
-From: Richard Purdie <rpurdie@rpsys.net>
-To: Greg KH <gregkh@suse.de>
-Date: Mon, 28 Nov 2005 22:15:46 +0000
-Message-Id: <1133216147.8673.31.camel@localhost.localdomain>
-
-The device data in ohci-pxa27x is a struct hcd, not a struct ohci_hcd.
-This correct the suspend/resume calls to account for this and adds some
-code to invalidate the platform data when the module is removed.
-
-Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/ohci-pxa27x.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ohci-pxa27x.c
-+++ gregkh-2.6/drivers/usb/host/ohci-pxa27x.c
-@@ -309,20 +309,22 @@ static int ohci_hcd_pxa27x_drv_remove(st
- struct usb_hcd *hcd = platform_get_drvdata(pdev);
-
- usb_hcd_pxa27x_remove(hcd, pdev);
-+ platform_set_drvdata(pdev, NULL);
- return 0;
- }
-
- #ifdef CONFIG_PM
- static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state)
- {
-- struct ohci_hcd *ohci = platform_get_drvdata(pdev);
-+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
-+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-
- if (time_before(jiffies, ohci->next_statechange))
- msleep(5);
- ohci->next_statechange = jiffies;
-
- pxa27x_stop_hc(&pdev->dev);
-- ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED;
-+ hcd->state = HC_STATE_SUSPENDED;
- pdev->dev.power.power_state = PMSG_SUSPEND;
-
- return 0;
-@@ -330,7 +332,8 @@ static int ohci_hcd_pxa27x_drv_suspend(s
-
- static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
- {
-- struct ohci_hcd *ohci = platform_get_drvdata(pdev);
-+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
-+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
- int status;
-
- if (time_before(jiffies, ohci->next_statechange))
-@@ -341,7 +344,7 @@ static int ohci_hcd_pxa27x_drv_resume(st
- return status;
-
- pdev->dev.power.power_state = PMSG_ON;
-- usb_hcd_resume_root_hub(platform_get_drvdata(pdev));
-+ usb_hcd_resume_root_hub(hcd);
-
- return 0;
- }
diff --git a/usb/disconnect-children-during-hub-unbind.patch b/usb/disconnect-children-during-hub-unbind.patch
deleted file mode 100644
index 8486b0cf19b87..0000000000000
--- a/usb/disconnect-children-during-hub-unbind.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-From stern@rowland.harvard.edu Fri Nov 18 08:55:35 2005
-Date: Fri, 18 Nov 2005 12:06:34 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: [PATCH] Disconnect children during hub unbind
-Message-ID: <Pine.LNX.4.44L0.0511181157490.4518-100000@iolanthe.rowland.org>
-
-This patch (as606b) is an updated version of my earlier patch to
-disconnect children from a hub device when the hub driver is unbound.
-Thanks to the changes in the driver core locking, we now know that the
-entire hub device (and not just the interface) is locked whenever the
-hub driver's disconnect method runs. Hence it is safe to disconnect the
-child device structures immediately instead of deferring the job.
-
-The earlier version of the patch neglected to disable the hub's ports.
-We don't want to forget that; otherwise we'd end up with live devices
-using addresses that have been recycled. This update adds the necessary
-code.
-
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/hub.c | 94 ++++++++++++++++---------------------------------
- 1 file changed, 31 insertions(+), 63 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/hub.c
-+++ gregkh-2.6/drivers/usb/core/hub.c
-@@ -515,6 +515,31 @@ static int hub_port_disable(struct usb_h
- return ret;
- }
-
-+
-+/* caller has locked the hub device */
-+static void hub_pre_reset(struct usb_hub *hub, int disable_ports)
-+{
-+ struct usb_device *hdev = hub->hdev;
-+ int port1;
-+
-+ for (port1 = 1; port1 <= hdev->maxchild; ++port1) {
-+ if (hdev->children[port1 - 1]) {
-+ usb_disconnect(&hdev->children[port1 - 1]);
-+ if (disable_ports)
-+ hub_port_disable(hub, port1, 0);
-+ }
-+ }
-+ hub_quiesce(hub);
-+}
-+
-+/* caller has locked the hub device */
-+static void hub_post_reset(struct usb_hub *hub)
-+{
-+ hub_activate(hub);
-+ hub_power_on(hub);
-+}
-+
-+
- static int hub_configure(struct usb_hub *hub,
- struct usb_endpoint_descriptor *endpoint)
- {
-@@ -750,29 +775,10 @@ fail:
-
- static unsigned highspeed_hubs;
-
--/* Called after the hub driver is unbound from a hub with children */
--static void hub_remove_children_work(void *__hub)
--{
-- struct usb_hub *hub = __hub;
-- struct usb_device *hdev = hub->hdev;
-- int i;
--
-- kfree(hub);
--
-- usb_lock_device(hdev);
-- for (i = 0; i < hdev->maxchild; ++i) {
-- if (hdev->children[i])
-- usb_disconnect(&hdev->children[i]);
-- }
-- usb_unlock_device(hdev);
-- usb_put_dev(hdev);
--}
--
- static void hub_disconnect(struct usb_interface *intf)
- {
- struct usb_hub *hub = usb_get_intfdata (intf);
- struct usb_device *hdev;
-- int n, port1;
-
- usb_set_intfdata (intf, NULL);
- hdev = hub->hdev;
-@@ -780,7 +786,9 @@ static void hub_disconnect(struct usb_in
- if (hdev->speed == USB_SPEED_HIGH)
- highspeed_hubs--;
-
-- hub_quiesce(hub);
-+ /* Disconnect all children and quiesce the hub */
-+ hub_pre_reset(hub, 1);
-+
- usb_free_urb(hub->urb);
- hub->urb = NULL;
-
-@@ -800,27 +808,7 @@ static void hub_disconnect(struct usb_in
- hub->buffer = NULL;
- }
-
-- /* If there are any children then this is an unbind only, not a
-- * physical disconnection. The active ports must be disabled
-- * and later on we must call usb_disconnect(). We can't call
-- * it now because we may not hold the hub's device lock.
-- */
-- n = 0;
-- for (port1 = 1; port1 <= hdev->maxchild; ++port1) {
-- if (hdev->children[port1 - 1]) {
-- ++n;
-- hub_port_disable(hub, port1, 1);
-- }
-- }
--
-- if (n == 0)
-- kfree(hub);
-- else {
-- /* Reuse the hub->leds work_struct for our own purposes */
-- INIT_WORK(&hub->leds, hub_remove_children_work, hub);
-- schedule_work(&hub->leds);
-- usb_get_dev(hdev);
-- }
-+ kfree(hub);
- }
-
- static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
-@@ -917,26 +905,6 @@ hub_ioctl(struct usb_interface *intf, un
- }
- }
-
--/* caller has locked the hub device */
--static void hub_pre_reset(struct usb_hub *hub)
--{
-- struct usb_device *hdev = hub->hdev;
-- int i;
--
-- for (i = 0; i < hdev->maxchild; ++i) {
-- if (hdev->children[i])
-- usb_disconnect(&hdev->children[i]);
-- }
-- hub_quiesce(hub);
--}
--
--/* caller has locked the hub device */
--static void hub_post_reset(struct usb_hub *hub)
--{
-- hub_activate(hub);
-- hub_power_on(hub);
--}
--
-
- /* grab device/port lock, returning index of that port (zero based).
- * protects the upstream link used by this device from concurrent
-@@ -2682,7 +2650,7 @@ static void hub_events(void)
-
- /* If the hub has died, clean up after it */
- if (hdev->state == USB_STATE_NOTATTACHED) {
-- hub_pre_reset(hub);
-+ hub_pre_reset(hub, 0);
- goto loop;
- }
-
-@@ -2997,7 +2965,7 @@ int usb_reset_device(struct usb_device *
- udev->actconfig->interface[0]->dev.driver ==
- &hub_driver.driver &&
- (hub = hdev_to_hub(udev)) != NULL) {
-- hub_pre_reset(hub);
-+ hub_pre_reset(hub, 0);
- }
-
- set_bit(port1, parent_hub->busy_bits);
diff --git a/usb/drivers-usb-misc-sisusbvga-sisusb.c-remove-dead-code.patch b/usb/drivers-usb-misc-sisusbvga-sisusb.c-remove-dead-code.patch
deleted file mode 100644
index e22a99227fd57..0000000000000
--- a/usb/drivers-usb-misc-sisusbvga-sisusb.c-remove-dead-code.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From bunk@stusta.de Tue Nov 29 05:03:48 2005
-Date: Tue, 29 Nov 2005 14:01:55 +0100
-From: Adrian Bunk <bunk@stusta.de>
-To: Greg KH <greg@kroah.com>
-Cc: gregkh@suse.de, Thomas Winischhofer <thomas@winischhofer.net>
-Subject: [2.6 patch] drivers/usb/misc/sisusbvga/sisusb.c: remove dead code
-Message-ID: <20051129130155.GH31395@stusta.de>
-Content-Disposition: inline
-
-The Coverity checker found this dead code.
-
-Signed-off-by: Adrian Bunk <bunk@stusta.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/misc/sisusbvga/sisusb.c | 6 ------
- 1 file changed, 6 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/misc/sisusbvga/sisusb.c
-+++ gregkh-2.6/drivers/usb/misc/sisusbvga/sisusb.c
-@@ -863,9 +863,6 @@ static int sisusb_write_mem_bulk(struct
-
- switch (length) {
-
-- case 0:
-- return ret;
--
- case 1:
- if (userbuffer) {
- if (get_user(swap8, (u8 __user *)userbuffer))
-@@ -1221,9 +1218,6 @@ static int sisusb_read_mem_bulk(struct s
-
- switch (length) {
-
-- case 0:
-- return ret;
--
- case 1:
-
- ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM,
diff --git a/usb/ehci-fix-conflation-of-buf-0-with-len-0.patch b/usb/ehci-fix-conflation-of-buf-0-with-len-0.patch
deleted file mode 100644
index a5d550c747adc..0000000000000
--- a/usb/ehci-fix-conflation-of-buf-0-with-len-0.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From linux-usb-devel-admin@lists.sourceforge.net Thu Nov 3 08:50:40 2005
-From: Alan Stern <stern@rowland.harvard.edu>
-To: David Brownell <david-b@pacbell.net>
-Message-ID: <Pine.LNX.4.44L0.0511031054300.5056-100000@iolanthe.rowland.org>
-Subject: EHCI: fix conflation of buf == 0 with len == 0
-Date: Thu, 3 Nov 2005 11:44:49 -0500 (EST)
-
-When the ehci-hcd driver prepares a control URB, it tests for a
-zero-length data stage by looking at the transfer_dma value instead of
-the transfer_buffer_length. (In fact it does this even for non-control
-URBs, which is an additional aspect of the same bug.)
-
-However, under certain circumstances it's possible for transfer_dma to
-be 0 while transfer_buffer_length is non-zero. This can happen when a
-freshly allocated page (mapped to address 0 and marked Copy-On-Write,
-but never written to) is used as the source buffer for an OUT transfer.
-This patch (as598) fixes the problem.
-
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/ehci-q.c | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ehci-q.c
-+++ gregkh-2.6/drivers/usb/host/ehci-q.c
-@@ -514,18 +514,18 @@ qh_urb_transaction (
- qtd->urb = urb;
- qtd_prev->hw_next = QTD_NEXT (qtd->qtd_dma);
- list_add_tail (&qtd->qtd_list, head);
-+
-+ /* for zero length DATA stages, STATUS is always IN */
-+ if (len == 0)
-+ token |= (1 /* "in" */ << 8);
- }
-
- /*
- * data transfer stage: buffer setup
- */
-- if (likely (len > 0))
-- buf = urb->transfer_dma;
-- else
-- buf = 0;
-+ buf = urb->transfer_dma;
-
-- /* for zero length DATA stages, STATUS is always IN */
-- if (!buf || is_input)
-+ if (is_input)
- token |= (1 /* "in" */ << 8);
- /* else it's already initted to "out" pid (0 << 8) */
-
-@@ -572,7 +572,7 @@ qh_urb_transaction (
- * control requests may need a terminating data "status" ack;
- * bulk ones may need a terminating short packet (zero length).
- */
-- if (likely (buf != 0)) {
-+ if (likely (urb->transfer_buffer_length != 0)) {
- int one_more = 0;
-
- if (usb_pipecontrol (urb->pipe)) {
diff --git a/usb/ftdi_sio-new-ids-for-teratronik-devices.patch b/usb/ftdi_sio-new-ids-for-teratronik-devices.patch
deleted file mode 100644
index 0dadf63712f79..0000000000000
--- a/usb/ftdi_sio-new-ids-for-teratronik-devices.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From ian.abbott@mev.co.uk Tue Dec 13 08:23:07 2005
-Message-ID: <439EF467.1090506@mev.co.uk>
-Date: Tue, 13 Dec 2005 16:18:47 +0000
-From: Ian Abbott <abbotti@mev.co.uk>
-Cc: Greg KH <greg@kroah.com>
-Subject: ftdi_sio: new IDs for Teratronik devices
-
-From: Ian Abbott <abbotti@mev.co.uk>
-
-This patch adds vendor and product IDs to the ftdi_sio driver's device
-ID table for two devices from teratronik.de. The device IDs were
-submitted by O. Wölfelschneider of Teratronik Elektronische Systeme
-GmbH.
-
-The charset of the patch is latin-1, same as the original files.
-
-Please apply, thanks! (I've tried to avoid a clash with Andrew Morton's
-patch to add support for Posiflex PP-7700 printer to the same driver.)
-
-Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- drivers/usb/serial/ftdi_sio.c | 2 ++
- drivers/usb/serial/ftdi_sio.h | 7 +++++++
- 2 files changed, 9 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.c
-+++ gregkh-2.6/drivers/usb/serial/ftdi_sio.c
-@@ -471,6 +471,8 @@ static struct usb_device_id id_table_com
- { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) },
-+ { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) },
-+ { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) },
- { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) },
---- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.h
-+++ gregkh-2.6/drivers/usb/serial/ftdi_sio.h
-@@ -343,6 +343,13 @@
- #define XSENS_CONVERTER_7_PID 0xD38F
-
- /*
-+ * Teratronik product ids.
-+ * Submitted by O. Wölfelschneider.
-+ */
-+#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */
-+#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */
-+
-+/*
- * Evolution Robotics products (http://www.evolution.com/).
- * Submitted by Shawn M. Lavelle.
- */
diff --git a/usb/isp116x-hcd-cleanup.patch b/usb/isp116x-hcd-cleanup.patch
deleted file mode 100644
index c36a0ff9b481d..0000000000000
--- a/usb/isp116x-hcd-cleanup.patch
+++ /dev/null
@@ -1,782 +0,0 @@
-From ok@artecdesign.ee Thu Nov 3 07:40:17 2005
-Date: Thu, 3 Nov 2005 17:38:14 +0200 (EET)
-From: Olav Kongas <ok@artecdesign.ee>
-To: Greg KH <greg@kroah.com>
-cc: linux-usb-devel@lists.sourceforge.net
-Subject: [PATCH] isp116x-hcd: cleanup
-Message-ID: <Pine.LNX.4.63.0511031730010.19908@pcy.artec.ee>
-
-The attached patch makes a cleanup of isp116x-hcd. Most of the volume of
-the patch comes from 2 sources: moving the code around to get rid of a
-few function prototypes and reworking register dumping functions/macros.
-Among other things, switched over from using procfs to debugfs.
-
-Cleanup. The following changes were made:
-
-- Rework register dumping code so it can be used for dumping
- to both syslog and debugfs.
-- Switch from procfs to debugfs..
-- Die gracefully on Unrecoverable Error interrupt.
-- Fix memory leak in isp116x_urb_enqueue(), if HC happens to
- die in a narrow time window.
-- Fix a 'sparce' warning (unnecessary cast).
-- Report Devices Removable for root hub ports by default
- (was Devices Permanently Attached).
-- Move bus suspend/resume functions down in code to get rid of
- a few function prototypes.
-- A number of one-line cleanups.
-- Add an entry to MAINTAINERS.
-
-Signed-off-by: Olav Kongas <ok@artecdesign.ee>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
- MAINTAINERS | 6
- drivers/usb/host/isp116x-hcd.c | 429 ++++++++++++++++-------------------------
- drivers/usb/host/isp116x.h | 83 +++++--
- 3 files changed, 230 insertions(+), 288 deletions(-)
-
----
---- gregkh-2.6.orig/drivers/usb/host/isp116x.h
-+++ gregkh-2.6/drivers/usb/host/isp116x.h
-@@ -259,7 +259,7 @@ struct isp116x {
-
- struct isp116x_platform_data *board;
-
-- struct proc_dir_entry *pde;
-+ struct dentry *dentry;
- unsigned long stat1, stat2, stat4, stat8, stat16;
-
- /* HC registers */
-@@ -450,7 +450,7 @@ static void isp116x_write_reg32(struct i
- isp116x_write_data32(isp116x, (u32) val);
- }
-
--#define isp116x_show_reg(d,r) { \
-+#define isp116x_show_reg_log(d,r,s) { \
- if ((r) < 0x20) { \
- DBG("%-12s[%02x]: %08x\n", #r, \
- r, isp116x_read_reg32(d, r)); \
-@@ -459,35 +459,60 @@ static void isp116x_write_reg32(struct i
- r, isp116x_read_reg16(d, r)); \
- } \
- }
-+#define isp116x_show_reg_seq(d,r,s) { \
-+ if ((r) < 0x20) { \
-+ seq_printf(s, "%-12s[%02x]: %08x\n", #r, \
-+ r, isp116x_read_reg32(d, r)); \
-+ } else { \
-+ seq_printf(s, "%-12s[%02x]: %04x\n", #r, \
-+ r, isp116x_read_reg16(d, r)); \
-+ } \
-+}
-
--static inline void isp116x_show_regs(struct isp116x *isp116x)
-+#define isp116x_show_regs(d,type,s) { \
-+ isp116x_show_reg_##type(d, HCREVISION, s); \
-+ isp116x_show_reg_##type(d, HCCONTROL, s); \
-+ isp116x_show_reg_##type(d, HCCMDSTAT, s); \
-+ isp116x_show_reg_##type(d, HCINTSTAT, s); \
-+ isp116x_show_reg_##type(d, HCINTENB, s); \
-+ isp116x_show_reg_##type(d, HCFMINTVL, s); \
-+ isp116x_show_reg_##type(d, HCFMREM, s); \
-+ isp116x_show_reg_##type(d, HCFMNUM, s); \
-+ isp116x_show_reg_##type(d, HCLSTHRESH, s); \
-+ isp116x_show_reg_##type(d, HCRHDESCA, s); \
-+ isp116x_show_reg_##type(d, HCRHDESCB, s); \
-+ isp116x_show_reg_##type(d, HCRHSTATUS, s); \
-+ isp116x_show_reg_##type(d, HCRHPORT1, s); \
-+ isp116x_show_reg_##type(d, HCRHPORT2, s); \
-+ isp116x_show_reg_##type(d, HCHWCFG, s); \
-+ isp116x_show_reg_##type(d, HCDMACFG, s); \
-+ isp116x_show_reg_##type(d, HCXFERCTR, s); \
-+ isp116x_show_reg_##type(d, HCuPINT, s); \
-+ isp116x_show_reg_##type(d, HCuPINTENB, s); \
-+ isp116x_show_reg_##type(d, HCCHIPID, s); \
-+ isp116x_show_reg_##type(d, HCSCRATCH, s); \
-+ isp116x_show_reg_##type(d, HCITLBUFLEN, s); \
-+ isp116x_show_reg_##type(d, HCATLBUFLEN, s); \
-+ isp116x_show_reg_##type(d, HCBUFSTAT, s); \
-+ isp116x_show_reg_##type(d, HCRDITL0LEN, s); \
-+ isp116x_show_reg_##type(d, HCRDITL1LEN, s); \
-+}
-+
-+/*
-+ Dump registers for debugfs.
-+*/
-+static inline void isp116x_show_regs_seq(struct isp116x *isp116x,
-+ struct seq_file *s)
-+{
-+ isp116x_show_regs(isp116x, seq, s);
-+}
-+
-+/*
-+ Dump registers to syslog.
-+*/
-+static inline void isp116x_show_regs_log(struct isp116x *isp116x)
- {
-- isp116x_show_reg(isp116x, HCREVISION);
-- isp116x_show_reg(isp116x, HCCONTROL);
-- isp116x_show_reg(isp116x, HCCMDSTAT);
-- isp116x_show_reg(isp116x, HCINTSTAT);
-- isp116x_show_reg(isp116x, HCINTENB);
-- isp116x_show_reg(isp116x, HCFMINTVL);
-- isp116x_show_reg(isp116x, HCFMREM);
-- isp116x_show_reg(isp116x, HCFMNUM);
-- isp116x_show_reg(isp116x, HCLSTHRESH);
-- isp116x_show_reg(isp116x, HCRHDESCA);
-- isp116x_show_reg(isp116x, HCRHDESCB);
-- isp116x_show_reg(isp116x, HCRHSTATUS);
-- isp116x_show_reg(isp116x, HCRHPORT1);
-- isp116x_show_reg(isp116x, HCRHPORT2);
-- isp116x_show_reg(isp116x, HCHWCFG);
-- isp116x_show_reg(isp116x, HCDMACFG);
-- isp116x_show_reg(isp116x, HCXFERCTR);
-- isp116x_show_reg(isp116x, HCuPINT);
-- isp116x_show_reg(isp116x, HCuPINTENB);
-- isp116x_show_reg(isp116x, HCCHIPID);
-- isp116x_show_reg(isp116x, HCSCRATCH);
-- isp116x_show_reg(isp116x, HCITLBUFLEN);
-- isp116x_show_reg(isp116x, HCATLBUFLEN);
-- isp116x_show_reg(isp116x, HCBUFSTAT);
-- isp116x_show_reg(isp116x, HCRDITL0LEN);
-- isp116x_show_reg(isp116x, HCRDITL1LEN);
-+ isp116x_show_regs(isp116x, log, NULL);
- }
-
- #if defined(URB_TRACE)
---- gregkh-2.6.orig/drivers/usb/host/isp116x-hcd.c
-+++ gregkh-2.6/drivers/usb/host/isp116x-hcd.c
-@@ -55,19 +55,13 @@
- /* enqueuing/finishing log of urbs */
- //#define URB_TRACE
-
--#include <linux/config.h>
- #include <linux/module.h>
--#include <linux/moduleparam.h>
--#include <linux/kernel.h>
- #include <linux/delay.h>
--#include <linux/ioport.h>
--#include <linux/sched.h>
--#include <linux/slab.h>
--#include <linux/smp_lock.h>
-+#include <linux/debugfs.h>
-+#include <linux/seq_file.h>
- #include <linux/errno.h>
- #include <linux/init.h>
- #include <linux/list.h>
--#include <linux/interrupt.h>
- #include <linux/usb.h>
- #include <linux/usb_isp116x.h>
- #include <linux/platform_device.h>
-@@ -77,14 +71,10 @@
- #include <asm/system.h>
- #include <asm/byteorder.h>
-
--#ifndef DEBUG
--# define STUB_DEBUG_FILE
--#endif
--
- #include "../core/hcd.h"
- #include "isp116x.h"
-
--#define DRIVER_VERSION "05 Aug 2005"
-+#define DRIVER_VERSION "03 Nov 2005"
- #define DRIVER_DESC "ISP116x USB Host Controller Driver"
-
- MODULE_DESCRIPTION(DRIVER_DESC);
-@@ -305,9 +295,8 @@ static void postproc_atl_queue(struct is
- udev = urb->dev;
- ptd = &ep->ptd;
- cc = PTD_GET_CC(ptd);
--
-- spin_lock(&urb->lock);
- short_not_ok = 1;
-+ spin_lock(&urb->lock);
-
- /* Data underrun is special. For allowed underrun
- we clear the error and continue as normal. For
-@@ -420,7 +409,7 @@ static void postproc_atl_queue(struct is
- ep->nextpid = 0;
- break;
- default:
-- BUG_ON(1);
-+ BUG();
- }
- spin_unlock(&urb->lock);
- }
-@@ -628,8 +617,12 @@ static irqreturn_t isp116x_irq(struct us
- u32 intstat = isp116x_read_reg32(isp116x, HCINTSTAT);
- isp116x_write_reg32(isp116x, HCINTSTAT, intstat);
- if (intstat & HCINT_UE) {
-- ERR("Unrecoverable error\n");
-- /* What should we do here? Reset? */
-+ ERR("Unrecoverable error, HC is dead!\n");
-+ /* IRQ's are off, we do no DMA,
-+ perfectly ready to die ... */
-+ hcd->state = HC_STATE_HALT;
-+ ret = IRQ_HANDLED;
-+ goto done;
- }
- if (intstat & HCINT_RHSC)
- /* When root hub or any of its ports is going
-@@ -640,7 +633,6 @@ static irqreturn_t isp116x_irq(struct us
- if (intstat & HCINT_RD) {
- DBG("---- remote wakeup\n");
- usb_hcd_resume_root_hub(hcd);
-- ret = IRQ_HANDLED;
- }
- irqstat &= ~HCuPINT_OPR;
- ret = IRQ_HANDLED;
-@@ -651,6 +643,7 @@ static irqreturn_t isp116x_irq(struct us
- }
-
- isp116x_write_reg16(isp116x, HCuPINTENB, isp116x->irqenb);
-+ done:
- spin_unlock(&isp116x->lock);
- return ret;
- }
-@@ -724,6 +717,7 @@ static int isp116x_urb_enqueue(struct us
-
- spin_lock_irqsave(&isp116x->lock, flags);
- if (!HC_IS_RUNNING(hcd->state)) {
-+ kfree(ep);
- ret = -ENODEV;
- goto fail;
- }
-@@ -888,7 +882,7 @@ static void isp116x_endpoint_disable(str
- struct usb_host_endpoint *hep)
- {
- int i;
-- struct isp116x_ep *ep = hep->hcpriv;;
-+ struct isp116x_ep *ep = hep->hcpriv;
-
- if (!ep)
- return;
-@@ -916,8 +910,6 @@ static int isp116x_get_frame(struct usb_
- return (int)fmnum;
- }
-
--/*----------------------------------------------------------------*/
--
- /*
- Adapted from ohci-hub.c. Currently we don't support autosuspend.
- */
-@@ -968,11 +960,10 @@ static void isp116x_hub_descriptor(struc
- desc->bHubContrCurrent = 0;
- desc->bNbrPorts = (u8) (reg & 0x3);
- /* Power switching, device type, overcurrent. */
-- desc->wHubCharacteristics =
-- (__force __u16) cpu_to_le16((u16) ((reg >> 8) & 0x1f));
-+ desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & 0x1f));
- desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff);
- /* two bitmaps: ports removable, and legacy PortPwrCtrlMask */
-- desc->bitmap[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1;
-+ desc->bitmap[0] = 0;
- desc->bitmap[1] = ~0;
- }
-
-@@ -1159,145 +1150,9 @@ static int isp116x_hub_control(struct us
- return ret;
- }
-
--#ifdef CONFIG_PM
--
--static int isp116x_bus_suspend(struct usb_hcd *hcd)
--{
-- struct isp116x *isp116x = hcd_to_isp116x(hcd);
-- unsigned long flags;
-- u32 val;
-- int ret = 0;
--
-- spin_lock_irqsave(&isp116x->lock, flags);
--
-- val = isp116x_read_reg32(isp116x, HCCONTROL);
-- switch (val & HCCONTROL_HCFS) {
-- case HCCONTROL_USB_OPER:
-- hcd->state = HC_STATE_QUIESCING;
-- val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE);
-- val |= HCCONTROL_USB_SUSPEND;
-- if (hcd->remote_wakeup)
-- val |= HCCONTROL_RWE;
-- /* Wait for usb transfers to finish */
-- mdelay(2);
-- isp116x_write_reg32(isp116x, HCCONTROL, val);
-- hcd->state = HC_STATE_SUSPENDED;
-- /* Wait for devices to suspend */
-- mdelay(5);
-- case HCCONTROL_USB_SUSPEND:
-- break;
-- case HCCONTROL_USB_RESUME:
-- isp116x_write_reg32(isp116x, HCCONTROL,
-- (val & ~HCCONTROL_HCFS) |
-- HCCONTROL_USB_RESET);
-- case HCCONTROL_USB_RESET:
-- ret = -EBUSY;
-- break;
-- default:
-- ret = -EINVAL;
-- }
--
-- spin_unlock_irqrestore(&isp116x->lock, flags);
-- return ret;
--}
--
--/* Get rid of these declarations later in cleanup */
--static int isp116x_reset(struct usb_hcd *hcd);
--static int isp116x_start(struct usb_hcd *hcd);
--
--static int isp116x_bus_resume(struct usb_hcd *hcd)
--{
-- struct isp116x *isp116x = hcd_to_isp116x(hcd);
-- u32 val;
--
-- msleep(5);
-- spin_lock_irq(&isp116x->lock);
--
-- val = isp116x_read_reg32(isp116x, HCCONTROL);
-- switch (val & HCCONTROL_HCFS) {
-- case HCCONTROL_USB_SUSPEND:
-- val &= ~HCCONTROL_HCFS;
-- val |= HCCONTROL_USB_RESUME;
-- isp116x_write_reg32(isp116x, HCCONTROL, val);
-- case HCCONTROL_USB_RESUME:
-- break;
-- case HCCONTROL_USB_OPER:
-- spin_unlock_irq(&isp116x->lock);
-- /* Without setting power_state here the
-- SUSPENDED state won't be removed from
-- sysfs/usbN/power.state as a response to remote
-- wakeup. Maybe in the future. */
-- hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-- return 0;
-- default:
-- /* HCCONTROL_USB_RESET: this may happen, when during
-- suspension the HC lost power. Reinitialize completely */
-- spin_unlock_irq(&isp116x->lock);
-- DBG("Chip has been reset while suspended. Reinit from scratch.\n");
-- isp116x_reset(hcd);
-- isp116x_start(hcd);
-- isp116x_hub_control(hcd, SetPortFeature,
-- USB_PORT_FEAT_POWER, 1, NULL, 0);
-- if ((isp116x->rhdesca & RH_A_NDP) == 2)
-- isp116x_hub_control(hcd, SetPortFeature,
-- USB_PORT_FEAT_POWER, 2, NULL, 0);
-- hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-- return 0;
-- }
--
-- val = isp116x->rhdesca & RH_A_NDP;
-- while (val--) {
-- u32 stat =
-- isp116x_read_reg32(isp116x, val ? HCRHPORT2 : HCRHPORT1);
-- /* force global, not selective, resume */
-- if (!(stat & RH_PS_PSS))
-- continue;
-- DBG("%s: Resuming port %d\n", __func__, val);
-- isp116x_write_reg32(isp116x, RH_PS_POCI, val
-- ? HCRHPORT2 : HCRHPORT1);
-- }
-- spin_unlock_irq(&isp116x->lock);
--
-- hcd->state = HC_STATE_RESUMING;
-- mdelay(20);
--
-- /* Go operational */
-- spin_lock_irq(&isp116x->lock);
-- val = isp116x_read_reg32(isp116x, HCCONTROL);
-- isp116x_write_reg32(isp116x, HCCONTROL,
-- (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER);
-- spin_unlock_irq(&isp116x->lock);
-- /* see analogous comment above */
-- hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-- hcd->state = HC_STATE_RUNNING;
--
-- return 0;
--}
--
--
--#else
--
--#define isp116x_bus_suspend NULL
--#define isp116x_bus_resume NULL
--
--#endif
--
- /*-----------------------------------------------------------------*/
-
--#ifdef STUB_DEBUG_FILE
--
--static inline void create_debug_file(struct isp116x *isp116x)
--{
--}
--
--static inline void remove_debug_file(struct isp116x *isp116x)
--{
--}
--
--#else
--
--#include <linux/proc_fs.h>
--#include <linux/seq_file.h>
-+#ifdef CONFIG_DEBUG_FS
-
- static void dump_irq(struct seq_file *s, char *label, u16 mask)
- {
-@@ -1321,13 +1176,9 @@ static void dump_int(struct seq_file *s,
- mask & HCINT_SF ? " sof" : "", mask & HCINT_SO ? " so" : "");
- }
-
--static int proc_isp116x_show(struct seq_file *s, void *unused)
-+static int isp116x_show_dbg(struct seq_file *s, void *unused)
- {
- struct isp116x *isp116x = s->private;
-- struct isp116x_ep *ep;
-- struct urb *urb;
-- unsigned i;
-- char *str;
-
- seq_printf(s, "%s\n%s version %s\n",
- isp116x_to_hcd(isp116x)->product_desc, hcd_name,
-@@ -1343,105 +1194,50 @@ static int proc_isp116x_show(struct seq_
- }
-
- spin_lock_irq(&isp116x->lock);
--
- dump_irq(s, "hc_irq_enable", isp116x_read_reg16(isp116x, HCuPINTENB));
- dump_irq(s, "hc_irq_status", isp116x_read_reg16(isp116x, HCuPINT));
- dump_int(s, "hc_int_enable", isp116x_read_reg32(isp116x, HCINTENB));
- dump_int(s, "hc_int_status", isp116x_read_reg32(isp116x, HCINTSTAT));
--
-- list_for_each_entry(ep, &isp116x->async, schedule) {
--
-- switch (ep->nextpid) {
-- case USB_PID_IN:
-- str = "in";
-- break;
-- case USB_PID_OUT:
-- str = "out";
-- break;
-- case USB_PID_SETUP:
-- str = "setup";
-- break;
-- case USB_PID_ACK:
-- str = "status";
-- break;
-- default:
-- str = "?";
-- break;
-- };
-- seq_printf(s, "%p, ep%d%s, maxpacket %d:\n", ep,
-- ep->epnum, str, ep->maxpacket);
-- list_for_each_entry(urb, &ep->hep->urb_list, urb_list) {
-- seq_printf(s, " urb%p, %d/%d\n", urb,
-- urb->actual_length,
-- urb->transfer_buffer_length);
-- }
-- }
-- if (!list_empty(&isp116x->async))
-- seq_printf(s, "\n");
--
-- seq_printf(s, "periodic size= %d\n", PERIODIC_SIZE);
--
-- for (i = 0; i < PERIODIC_SIZE; i++) {
-- ep = isp116x->periodic[i];
-- if (!ep)
-- continue;
-- seq_printf(s, "%2d [%3d]:\n", i, isp116x->load[i]);
--
-- /* DUMB: prints shared entries multiple times */
-- do {
-- seq_printf(s, " %d/%p (%sdev%d ep%d%s max %d)\n",
-- ep->period, ep,
-- (ep->udev->speed ==
-- USB_SPEED_FULL) ? "" : "ls ",
-- ep->udev->devnum, ep->epnum,
-- (ep->epnum ==
-- 0) ? "" : ((ep->nextpid ==
-- USB_PID_IN) ? "in" : "out"),
-- ep->maxpacket);
-- ep = ep->next;
-- } while (ep);
-- }
-+ isp116x_show_regs_seq(isp116x, s);
- spin_unlock_irq(&isp116x->lock);
- seq_printf(s, "\n");
-
- return 0;
- }
-
--static int proc_isp116x_open(struct inode *inode, struct file *file)
-+static int isp116x_open_seq(struct inode *inode, struct file *file)
- {
-- return single_open(file, proc_isp116x_show, PDE(inode)->data);
-+ return single_open(file, isp116x_show_dbg, inode->u.generic_ip);
- }
-
--static struct file_operations proc_ops = {
-- .open = proc_isp116x_open,
-+static struct file_operations isp116x_debug_fops = {
-+ .open = isp116x_open_seq,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- };
-
--/* expect just one isp116x per system */
--static const char proc_filename[] = "driver/isp116x";
--
--static void create_debug_file(struct isp116x *isp116x)
-+static int create_debug_file(struct isp116x *isp116x)
- {
-- struct proc_dir_entry *pde;
--
-- pde = create_proc_entry(proc_filename, 0, NULL);
-- if (pde == NULL)
-- return;
--
-- pde->proc_fops = &proc_ops;
-- pde->data = isp116x;
-- isp116x->pde = pde;
-+ isp116x->dentry = debugfs_create_file(hcd_name,
-+ S_IRUGO, NULL, isp116x,
-+ &isp116x_debug_fops);
-+ if (!isp116x->dentry)
-+ return -ENOMEM;
-+ return 0;
- }
-
- static void remove_debug_file(struct isp116x *isp116x)
- {
-- if (isp116x->pde)
-- remove_proc_entry(proc_filename, NULL);
-+ debugfs_remove(isp116x->dentry);
- }
-
--#endif
-+#else
-+
-+#define create_debug_file(d) 0
-+#define remove_debug_file(d) do{}while(0)
-+
-+#endif /* CONFIG_DEBUG_FS */
-
- /*-----------------------------------------------------------------*/
-
-@@ -1476,7 +1272,7 @@ static int isp116x_reset(struct usb_hcd
- struct isp116x *isp116x = hcd_to_isp116x(hcd);
- unsigned long t;
- u16 clkrdy = 0;
-- int ret = 0, timeout = 15 /* ms */ ;
-+ int ret, timeout = 15 /* ms */ ;
-
- ret = isp116x_sw_reset(isp116x);
- if (ret)
-@@ -1492,7 +1288,7 @@ static int isp116x_reset(struct usb_hcd
- break;
- }
- if (!clkrdy) {
-- ERR("Clock not ready after 20ms\n");
-+ ERR("Clock not ready after %dms\n", timeout);
- /* After sw_reset the clock won't report to be ready, if
- H_WAKEUP pin is high. */
- ERR("Please make sure that the H_WAKEUP pin is pulled low!\n");
-@@ -1610,12 +1406,128 @@ static int isp116x_start(struct usb_hcd
- isp116x_write_reg32(isp116x, HCRHPORT1, RH_PS_CCS);
- isp116x_write_reg32(isp116x, HCRHPORT2, RH_PS_CCS);
-
-- isp116x_show_regs(isp116x);
-+ isp116x_show_regs_log(isp116x);
- spin_unlock_irqrestore(&isp116x->lock, flags);
- return 0;
- }
-
--/*-----------------------------------------------------------------*/
-+#ifdef CONFIG_PM
-+
-+static int isp116x_bus_suspend(struct usb_hcd *hcd)
-+{
-+ struct isp116x *isp116x = hcd_to_isp116x(hcd);
-+ unsigned long flags;
-+ u32 val;
-+ int ret = 0;
-+
-+ spin_lock_irqsave(&isp116x->lock, flags);
-+
-+ val = isp116x_read_reg32(isp116x, HCCONTROL);
-+ switch (val & HCCONTROL_HCFS) {
-+ case HCCONTROL_USB_OPER:
-+ hcd->state = HC_STATE_QUIESCING;
-+ val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE);
-+ val |= HCCONTROL_USB_SUSPEND;
-+ if (hcd->remote_wakeup)
-+ val |= HCCONTROL_RWE;
-+ /* Wait for usb transfers to finish */
-+ mdelay(2);
-+ isp116x_write_reg32(isp116x, HCCONTROL, val);
-+ hcd->state = HC_STATE_SUSPENDED;
-+ /* Wait for devices to suspend */
-+ mdelay(5);
-+ case HCCONTROL_USB_SUSPEND:
-+ break;
-+ case HCCONTROL_USB_RESUME:
-+ isp116x_write_reg32(isp116x, HCCONTROL,
-+ (val & ~HCCONTROL_HCFS) |
-+ HCCONTROL_USB_RESET);
-+ case HCCONTROL_USB_RESET:
-+ ret = -EBUSY;
-+ break;
-+ default:
-+ ret = -EINVAL;
-+ }
-+
-+ spin_unlock_irqrestore(&isp116x->lock, flags);
-+ return ret;
-+}
-+
-+static int isp116x_bus_resume(struct usb_hcd *hcd)
-+{
-+ struct isp116x *isp116x = hcd_to_isp116x(hcd);
-+ u32 val;
-+
-+ msleep(5);
-+ spin_lock_irq(&isp116x->lock);
-+
-+ val = isp116x_read_reg32(isp116x, HCCONTROL);
-+ switch (val & HCCONTROL_HCFS) {
-+ case HCCONTROL_USB_SUSPEND:
-+ val &= ~HCCONTROL_HCFS;
-+ val |= HCCONTROL_USB_RESUME;
-+ isp116x_write_reg32(isp116x, HCCONTROL, val);
-+ case HCCONTROL_USB_RESUME:
-+ break;
-+ case HCCONTROL_USB_OPER:
-+ spin_unlock_irq(&isp116x->lock);
-+ /* Without setting power_state here the
-+ SUSPENDED state won't be removed from
-+ sysfs/usbN/power.state as a response to remote
-+ wakeup. Maybe in the future. */
-+ hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-+ return 0;
-+ default:
-+ /* HCCONTROL_USB_RESET: this may happen, when during
-+ suspension the HC lost power. Reinitialize completely */
-+ spin_unlock_irq(&isp116x->lock);
-+ DBG("Chip has been reset while suspended. Reinit from scratch.\n");
-+ isp116x_reset(hcd);
-+ isp116x_start(hcd);
-+ isp116x_hub_control(hcd, SetPortFeature,
-+ USB_PORT_FEAT_POWER, 1, NULL, 0);
-+ if ((isp116x->rhdesca & RH_A_NDP) == 2)
-+ isp116x_hub_control(hcd, SetPortFeature,
-+ USB_PORT_FEAT_POWER, 2, NULL, 0);
-+ hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-+ return 0;
-+ }
-+
-+ val = isp116x->rhdesca & RH_A_NDP;
-+ while (val--) {
-+ u32 stat =
-+ isp116x_read_reg32(isp116x, val ? HCRHPORT2 : HCRHPORT1);
-+ /* force global, not selective, resume */
-+ if (!(stat & RH_PS_PSS))
-+ continue;
-+ DBG("%s: Resuming port %d\n", __func__, val);
-+ isp116x_write_reg32(isp116x, RH_PS_POCI, val
-+ ? HCRHPORT2 : HCRHPORT1);
-+ }
-+ spin_unlock_irq(&isp116x->lock);
-+
-+ hcd->state = HC_STATE_RESUMING;
-+ msleep(20);
-+
-+ /* Go operational */
-+ spin_lock_irq(&isp116x->lock);
-+ val = isp116x_read_reg32(isp116x, HCCONTROL);
-+ isp116x_write_reg32(isp116x, HCCONTROL,
-+ (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER);
-+ spin_unlock_irq(&isp116x->lock);
-+ /* see analogous comment above */
-+ hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-+ hcd->state = HC_STATE_RUNNING;
-+
-+ return 0;
-+}
-+
-+#else
-+
-+#define isp116x_bus_suspend NULL
-+#define isp116x_bus_resume NULL
-+
-+#endif
-
- static struct hc_driver isp116x_hc_driver = {
- .description = hcd_name,
-@@ -1745,12 +1657,19 @@ static int __init isp116x_probe(struct p
- }
-
- ret = usb_add_hcd(hcd, irq, SA_INTERRUPT);
-- if (ret != 0)
-+ if (ret)
- goto err6;
-
-- create_debug_file(isp116x);
-+ ret = create_debug_file(isp116x);
-+ if (ret) {
-+ ERR("Couldn't create debugfs entry\n");
-+ goto err7;
-+ }
-+
- return 0;
-
-+ err7:
-+ usb_remove_hcd(hcd);
- err6:
- usb_put_hcd(hcd);
- err5:
-@@ -1772,13 +1691,9 @@ static int __init isp116x_probe(struct p
- */
- static int isp116x_suspend(struct platform_device *dev, pm_message_t state)
- {
-- int ret = 0;
--
-- VDBG("%s: state %x\n", __func__, state);
--
-+ VDBG("%s: state %x\n", __func__, state.event);
- dev->dev.power.power_state = state;
--
-- return ret;
-+ return 0;
- }
-
- /*
-@@ -1786,13 +1701,9 @@ static int isp116x_suspend(struct platfo
- */
- static int isp116x_resume(struct platform_device *dev)
- {
-- int ret = 0;
--
-- VDBG("%s: state %x\n", __func__, dev->dev.power.power_state);
--
-+ VDBG("%s: state %x\n", __func__, dev->power.power_state.event);
- dev->dev.power.power_state = PMSG_ON;
--
-- return ret;
-+ return 0;
- }
-
- #else
---- gregkh-2.6.orig/MAINTAINERS
-+++ gregkh-2.6/MAINTAINERS
-@@ -2641,6 +2641,12 @@ L: linux-usb-users@lists.sourceforge.net
- L: linux-usb-devel@lists.sourceforge.net
- S: Maintained
-
-+USB ISP116X DRIVER
-+P: Olav Kongas
-+M: ok@artecdesign.ee
-+L: linux-usb-devel@lists.sourceforge.net
-+S: Maintained
-+
- USB KAWASAKI LSI DRIVER
- P: Oliver Neukum
- M: oliver@neukum.name
diff --git a/usb/isp116x-hcd-minor-cleanup.patch b/usb/isp116x-hcd-minor-cleanup.patch
deleted file mode 100644
index bea2f547c00ff..0000000000000
--- a/usb/isp116x-hcd-minor-cleanup.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From ok@artecdesign.ee Fri Nov 25 16:01:02 2005
-Date: Sat, 26 Nov 2005 01:58:36 +0200 (EET)
-From: Olav Kongas <ok@artecdesign.ee>
-To: Greg KH <greg@kroah.com>
-Subject: isp116x-hcd: minor cleanup
-Message-ID: <Pine.LNX.4.63.0511260153120.21074@pcy.artec.ee>
-
-When going to suspend, there's no point in setting HC state in
-host controller driver as USB core takes care of this.
-
-Signed-off-by: Olav Kongas <ok@artecdesign.ee>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/isp116x-hcd.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/isp116x-hcd.c
-+++ gregkh-2.6/drivers/usb/host/isp116x-hcd.c
-@@ -1426,7 +1426,6 @@ static int isp116x_bus_suspend(struct us
- val = isp116x_read_reg32(isp116x, HCCONTROL);
- switch (val & HCCONTROL_HCFS) {
- case HCCONTROL_USB_OPER:
-- hcd->state = HC_STATE_QUIESCING;
- val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE);
- val |= HCCONTROL_USB_SUSPEND;
- if (device_may_wakeup(&hcd->self.root_hub->dev))
-@@ -1434,7 +1433,6 @@ static int isp116x_bus_suspend(struct us
- /* Wait for usb transfers to finish */
- mdelay(2);
- isp116x_write_reg32(isp116x, HCCONTROL, val);
-- hcd->state = HC_STATE_SUSPENDED;
- /* Wait for devices to suspend */
- mdelay(5);
- case HCCONTROL_USB_SUSPEND:
diff --git a/usb/isp116x-hcd-support-reiniting-hc-on-resume.patch b/usb/isp116x-hcd-support-reiniting-hc-on-resume.patch
deleted file mode 100644
index aca1bc7beb602..0000000000000
--- a/usb/isp116x-hcd-support-reiniting-hc-on-resume.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From ok@artecdesign.ee Fri Oct 28 05:08:38 2005
-Date: Fri, 28 Oct 2005 15:04:45 +0300 (EEST)
-From: Olav Kongas <ok@artecdesign.ee>
-To: Greg KH <greg@kroah.com>
-Subject: [PATCH] isp116x-hcd: support reiniting HC on resume
-Message-ID: <Pine.LNX.4.63.0510281453020.23961@pcy.artec.ee>
-
-Until now the isp116x-hcd had no support to reinitialize the HC on
-resume, if the controller lost its state during suspend. This patch,
-generated against your Oct 26 git tree, adds that support. The patch is
-basically the same as the one tested by Ivan Kalatchev, who reported the
-problem, on 2.6.13.
-
-Please apply,
-
-Support reinitializing the isp116x host controller from scratch on
-resume, if the controller has lost its state.
-
-Signed-off-by: Olav Kongas <ok@artecdesign.ee>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/isp116x-hcd.c | 26 ++++++++++++++++++--------
- 1 file changed, 18 insertions(+), 8 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/isp116x-hcd.c
-+++ gregkh-2.6/drivers/usb/host/isp116x-hcd.c
-@@ -1201,11 +1201,14 @@ static int isp116x_bus_suspend(struct us
- return ret;
- }
-
-+/* Get rid of these declarations later in cleanup */
-+static int isp116x_reset(struct usb_hcd *hcd);
-+static int isp116x_start(struct usb_hcd *hcd);
-+
- static int isp116x_bus_resume(struct usb_hcd *hcd)
- {
- struct isp116x *isp116x = hcd_to_isp116x(hcd);
- u32 val;
-- int ret = -EINPROGRESS;
-
- msleep(5);
- spin_lock_irq(&isp116x->lock);
-@@ -1219,20 +1222,27 @@ static int isp116x_bus_resume(struct usb
- case HCCONTROL_USB_RESUME:
- break;
- case HCCONTROL_USB_OPER:
-+ spin_unlock_irq(&isp116x->lock);
- /* Without setting power_state here the
- SUSPENDED state won't be removed from
- sysfs/usbN/power.state as a response to remote
- wakeup. Maybe in the future. */
- hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-- ret = 0;
-- break;
-+ return 0;
- default:
-- ret = -EBUSY;
-- }
--
-- if (ret != -EINPROGRESS) {
-+ /* HCCONTROL_USB_RESET: this may happen, when during
-+ suspension the HC lost power. Reinitialize completely */
- spin_unlock_irq(&isp116x->lock);
-- return ret;
-+ DBG("Chip has been reset while suspended. Reinit from scratch.\n");
-+ isp116x_reset(hcd);
-+ isp116x_start(hcd);
-+ isp116x_hub_control(hcd, SetPortFeature,
-+ USB_PORT_FEAT_POWER, 1, NULL, 0);
-+ if ((isp116x->rhdesca & RH_A_NDP) == 2)
-+ isp116x_hub_control(hcd, SetPortFeature,
-+ USB_PORT_FEAT_POWER, 2, NULL, 0);
-+ hcd->self.root_hub->dev.power.power_state = PMSG_ON;
-+ return 0;
- }
-
- val = isp116x->rhdesca & RH_A_NDP;
diff --git a/usb/isp116x-hcd.c-removed-unused-variable.patch b/usb/isp116x-hcd.c-removed-unused-variable.patch
deleted file mode 100644
index c990eaf3fa3bc..0000000000000
--- a/usb/isp116x-hcd.c-removed-unused-variable.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From ok@artecdesign.ee Tue Dec 13 05:34:03 2005
-Date: Tue, 13 Dec 2005 15:30:20 +0200 (EET)
-From: Olav Kongas <ok@artecdesign.ee>
-To: Greg KH <greg@kroah.com>
-cc: <daniel.marjamaki@comhem.se>
-Subject: isp116x-hcd.c: Removed unused variable
-Message-ID: <Pine.LNX.4.63.0512131524330.31176@pcy.artec.ee>
-
-From: Daniel Marjamäki <daniel.marjamaki@comhem.se>
-
-Removed unused variable
-
-Signed-off-by: Daniel Marjamäki <daniel.marjamaki@comhem.se>
-Signed-off-by: Olav Kongas <ok@artecdesign.ee>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- drivers/usb/host/isp116x-hcd.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/isp116x-hcd.c
-+++ gregkh-2.6/drivers/usb/host/isp116x-hcd.c
-@@ -154,13 +154,11 @@ static void pack_fifo(struct isp116x *is
- struct ptd *ptd;
- int buflen = isp116x->atl_last_dir == PTD_DIR_IN
- ? isp116x->atl_bufshrt : isp116x->atl_buflen;
-- int ptd_count = 0;
-
- isp116x_write_reg16(isp116x, HCuPINT, HCuPINT_AIIEOT);
- isp116x_write_reg16(isp116x, HCXFERCTR, buflen);
- isp116x_write_addr(isp116x, HCATLPORT | ISP116x_WRITE_OFFSET);
- for (ep = isp116x->atl_active; ep; ep = ep->active) {
-- ++ptd_count;
- ptd = &ep->ptd;
- dump_ptd(ptd);
- dump_ptd_out_data(ptd, ep->data);
diff --git a/usb/one-potential-problem-in-gadget-serial.c.patch b/usb/one-potential-problem-in-gadget-serial.c.patch
deleted file mode 100644
index ed0c03a6c065d..0000000000000
--- a/usb/one-potential-problem-in-gadget-serial.c.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From linux-usb-devel-admin@lists.sourceforge.net Thu Nov 17 18:24:41 2005
-Message-ID: <f3977ab60511171835o550d86a6p161651ac29108fd6@mail.gmail.com>
-From: Fengwei Yin <xaityyy@gmail.com>
-Subject: [linux-usb-devel] One potential problem in gadget/serial.c
-Date: Fri, 18 Nov 2005 10:35:36 +0800
-
-It looks like that the gs_serial module maybe sleep with spinlock in gs_close.
-Sometimes, system hang when I remove the gs_serial module.
-
-From: Fengwei Yin <xaityyy@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/gadget/serial.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/gadget/serial.c
-+++ gregkh-2.6/drivers/usb/gadget/serial.c
-@@ -890,10 +890,12 @@ static void gs_close(struct tty_struct *
- /* wait for write buffer to drain, or */
- /* at most GS_CLOSE_TIMEOUT seconds */
- if (gs_buf_data_avail(port->port_write_buf) > 0) {
-+ spin_unlock_irqrestore(&port->port_lock, flags);
- wait_cond_interruptible_timeout(port->port_write_wait,
- port->port_dev == NULL
- || gs_buf_data_avail(port->port_write_buf) == 0,
- &port->port_lock, flags, GS_CLOSE_TIMEOUT * HZ);
-+ spin_lock_irqsave(&port->port_lock, flags);
- }
-
- /* free disconnected port on final close */
diff --git a/usb/pxa27x-ohci-separate-platform-code-from-main-driver.patch b/usb/pxa27x-ohci-separate-platform-code-from-main-driver.patch
deleted file mode 100644
index a8a9f91f8bbdc..0000000000000
--- a/usb/pxa27x-ohci-separate-platform-code-from-main-driver.patch
+++ /dev/null
@@ -1,308 +0,0 @@
-From rpurdie@rpsys.net Sat Nov 12 06:24:32 2005
-From: Richard Purdie <rpurdie@rpsys.net>
-Subject: [usb patch 1/2] pxa27x OHCI - Separate platform code from main driver
-To: Greg KH <greg@kroah.com>
-Date: Sat, 12 Nov 2005 14:22:11 +0000
-Message-Id: <1131805332.7597.17.camel@localhost.localdomain>
-
-
-To allow multiple platforms to use the PXA27x OHCI driver, the platform
-code needs to be moved into the board specific files in
-arch/arm/mach-pxa. This patch does this for mainstone and adds
-preliminary hooks to allow other boards to use the driver.
-
-This has been compile tested for mainstone and successfully run on Spitz
-(Sharp Zaurus SL-C3000) with the addition of an appropriate board
-support file.
-
-Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-Signed-off-by: Nicolas Pitre <nico@cam.org>
-Acked-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- arch/arm/mach-pxa/mainstone.c | 21 +++++++++
- arch/arm/mach-pxa/pxa27x.c | 6 ++
- drivers/usb/host/ohci-pxa27x.c | 85 ++++++++++++++++++++--------------------
- include/asm-arm/arch-pxa/ohci.h | 18 ++++++++
- 4 files changed, 88 insertions(+), 42 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ohci-pxa27x.c
-+++ gregkh-2.6/drivers/usb/host/ohci-pxa27x.c
-@@ -26,18 +26,12 @@
- #include <asm/mach-types.h>
- #include <asm/hardware.h>
- #include <asm/arch/pxa-regs.h>
--
--
--#define PMM_NPS_MODE 1
--#define PMM_GLOBAL_MODE 2
--#define PMM_PERPORT_MODE 3
-+#include <asm/arch/ohci.h>
-
- #define PXA_UHC_MAX_PORTNUM 3
-
- #define UHCRHPS(x) __REG2( 0x4C000050, (x)<<2 )
-
--static int pxa27x_ohci_pmm_state;
--
- /*
- PMM_NPS_MODE -- PMM Non-power switching mode
- Ports are powered continuously.
-@@ -50,8 +44,6 @@ static int pxa27x_ohci_pmm_state;
- */
- static int pxa27x_ohci_select_pmm( int mode )
- {
-- pxa27x_ohci_pmm_state = mode;
--
- switch ( mode ) {
- case PMM_NPS_MODE:
- UHCRHDA |= RH_A_NPS;
-@@ -71,7 +63,6 @@ static int pxa27x_ohci_select_pmm( int m
- "Invalid mode %d, set to non-power switch mode.\n",
- mode );
-
-- pxa27x_ohci_pmm_state = PMM_NPS_MODE;
- UHCRHDA |= RH_A_NPS;
- }
-
-@@ -82,8 +73,13 @@ extern int usb_disabled(void);
-
- /*-------------------------------------------------------------------------*/
-
--static void pxa27x_start_hc(struct platform_device *dev)
-+static int pxa27x_start_hc(struct device *dev)
- {
-+ int retval = 0;
-+ struct pxaohci_platform_data *inf;
-+
-+ inf = dev->platform_data;
-+
- pxa_set_cken(CKEN10_USBHOST, 1);
-
- UHCHR |= UHCHR_FHR;
-@@ -94,21 +90,11 @@ static void pxa27x_start_hc(struct platf
- while (UHCHR & UHCHR_FSBIR)
- cpu_relax();
-
-- /* This could be properly abstracted away through the
-- device data the day more machines are supported and
-- their differences can be figured out correctly. */
-- if (machine_is_mainstone()) {
-- /* setup Port1 GPIO pin. */
-- pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
-- pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
--
-- /* Set the Power Control Polarity Low and Power Sense
-- Polarity Low to active low. Supply power to USB ports. */
-- UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
-- ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
-+ if (inf->init)
-+ retval = inf->init(dev);
-
-- pxa27x_ohci_pmm_state = PMM_PERPORT_MODE;
-- }
-+ if (retval < 0)
-+ return retval;
-
- UHCHR &= ~UHCHR_SSE;
-
-@@ -117,10 +103,19 @@ static void pxa27x_start_hc(struct platf
- /* Clear any OTG Pin Hold */
- if (PSSR & PSSR_OTGPH)
- PSSR |= PSSR_OTGPH;
-+
-+ return 0;
- }
-
--static void pxa27x_stop_hc(struct platform_device *dev)
-+static void pxa27x_stop_hc(struct device *dev)
- {
-+ struct pxaohci_platform_data *inf;
-+
-+ inf = dev->platform_data;
-+
-+ if (inf->exit)
-+ inf->exit(dev);
-+
- UHCHR |= UHCHR_FHR;
- udelay(11);
- UHCHR &= ~UHCHR_FHR;
-@@ -147,22 +142,27 @@ static void pxa27x_stop_hc(struct platfo
- * through the hotplug entry's driver_data.
- *
- */
--int usb_hcd_pxa27x_probe (const struct hc_driver *driver,
-- struct platform_device *dev)
-+int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device *pdev)
- {
- int retval;
- struct usb_hcd *hcd;
-+ struct pxaohci_platform_data *inf;
-+
-+ inf = pdev->dev.platform_data;
-
-- if (dev->resource[1].flags != IORESOURCE_IRQ) {
-+ if (!inf)
-+ return -ENODEV;
-+
-+ if (pdev->resource[1].flags != IORESOURCE_IRQ) {
- pr_debug ("resource[1] is not IORESOURCE_IRQ");
- return -ENOMEM;
- }
-
-- hcd = usb_create_hcd (driver, &dev->dev, "pxa27x");
-+ hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x");
- if (!hcd)
- return -ENOMEM;
-- hcd->rsrc_start = dev->resource[0].start;
-- hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
-+ hcd->rsrc_start = pdev->resource[0].start;
-+ hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
-
- if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
- pr_debug("request_mem_region failed");
-@@ -177,18 +177,22 @@ int usb_hcd_pxa27x_probe (const struct h
- goto err2;
- }
-
-- pxa27x_start_hc(dev);
-+ if ((retval = pxa27x_start_hc(&pdev->dev)) < 0) {
-+ pr_debug("pxa27x_start_hc failed");
-+ goto err3;
-+ }
-
- /* Select Power Management Mode */
-- pxa27x_ohci_select_pmm(pxa27x_ohci_pmm_state);
-+ pxa27x_ohci_select_pmm(inf->port_mode);
-
- ohci_hcd_init(hcd_to_ohci(hcd));
-
-- retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
-+ retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT);
- if (retval == 0)
- return retval;
-
-- pxa27x_stop_hc(dev);
-+ pxa27x_stop_hc(&pdev->dev);
-+ err3:
- iounmap(hcd->regs);
- err2:
- release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
-@@ -211,10 +215,10 @@ int usb_hcd_pxa27x_probe (const struct h
- * context, normally "rmmod", "apmd", or something similar.
- *
- */
--void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *dev)
-+void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *pdev)
- {
- usb_remove_hcd(hcd);
-- pxa27x_stop_hc(dev);
-+ pxa27x_stop_hc(&pdev->dev);
- iounmap(hcd->regs);
- release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
- usb_put_hcd(hcd);
-@@ -292,15 +296,12 @@ static const struct hc_driver ohci_pxa27
-
- static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev)
- {
-- int ret;
--
- pr_debug ("In ohci_hcd_pxa27x_drv_probe");
-
- if (usb_disabled())
- return -ENODEV;
-
-- ret = usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev);
-- return ret;
-+ return usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev);
- }
-
- static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev)
---- gregkh-2.6.orig/arch/arm/mach-pxa/pxa27x.c
-+++ gregkh-2.6/arch/arm/mach-pxa/pxa27x.c
-@@ -21,6 +21,7 @@
- #include <asm/hardware.h>
- #include <asm/irq.h>
- #include <asm/arch/pxa-regs.h>
-+#include <asm/arch/ohci.h>
-
- #include "generic.h"
-
-@@ -194,6 +195,11 @@ static struct platform_device ohci_devic
- .resource = pxa27x_ohci_resources,
- };
-
-+void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
-+{
-+ ohci_device.dev.platform_data = info;
-+}
-+
- static struct platform_device *devices[] __initdata = {
- &ohci_device,
- };
---- /dev/null
-+++ gregkh-2.6/include/asm-arm/arch-pxa/ohci.h
-@@ -0,0 +1,18 @@
-+#ifndef ASMARM_ARCH_OHCI_H
-+#define ASMARM_ARCH_OHCI_H
-+
-+struct device;
-+
-+struct pxaohci_platform_data {
-+ int (*init)(struct device *);
-+ void (*exit)(struct device *);
-+
-+ int port_mode;
-+#define PMM_NPS_MODE 1
-+#define PMM_GLOBAL_MODE 2
-+#define PMM_PERPORT_MODE 3
-+};
-+
-+extern void pxa_set_ohci_info(struct pxaohci_platform_data *info);
-+
-+#endif
---- gregkh-2.6.orig/arch/arm/mach-pxa/mainstone.c
-+++ gregkh-2.6/arch/arm/mach-pxa/mainstone.c
-@@ -43,6 +43,7 @@
- #include <asm/arch/pxafb.h>
- #include <asm/arch/mmc.h>
- #include <asm/arch/irda.h>
-+#include <asm/arch/ohci.h>
-
- #include "generic.h"
-
-@@ -393,6 +394,25 @@ static struct platform_device *platform_
- &mst_flash_device[1],
- };
-
-+static int mainstone_ohci_init(struct device *dev)
-+{
-+ /* setup Port1 GPIO pin. */
-+ pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
-+ pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
-+
-+ /* Set the Power Control Polarity Low and Power Sense
-+ Polarity Low to active low. */
-+ UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
-+ ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
-+
-+ return 0;
-+}
-+
-+static struct pxaohci_platform_data mainstone_ohci_platform_data = {
-+ .port_mode = PMM_PERPORT_MODE,
-+ .init = mainstone_ohci_init,
-+};
-+
- static void __init mainstone_init(void)
- {
- int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
-@@ -424,6 +444,7 @@ static void __init mainstone_init(void)
-
- pxa_set_mci_info(&mainstone_mci_platform_data);
- pxa_set_ficp_info(&mainstone_ficp_platform_data);
-+ pxa_set_ohci_info(&mainstone_ohci_platform_data);
- }
-
-
diff --git a/usb/remove-usb-private-semaphore.patch b/usb/remove-usb-private-semaphore.patch
deleted file mode 100644
index b785abee786ba..0000000000000
--- a/usb/remove-usb-private-semaphore.patch
+++ /dev/null
@@ -1,507 +0,0 @@
-From stern@rowland.harvard.edu Thu Nov 17 14:00:29 2005
-Date: Thu, 17 Nov 2005 17:10:32 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: Remove USB private semaphore
-Message-ID: <Pine.LNX.4.44L0.0511171655590.4465-100000@iolanthe.rowland.org>
-
-This patch (as605) removes the private udev->serialize semaphore,
-relying instead on the locking provided by the embedded struct device's
-semaphore. The changes are confined to the core, except that the
-usb_trylock_device routine now uses the return convention of
-down_trylock rather than down_read_trylock (they return opposite values
-for no good reason).
-
-A couple of other associated changes are included as well:
-
- Now that we aren't concerned about HCDs that avoid using the
- hcd glue layer, usb_disconnect no longer needs to acquire the
- usb_bus_lock -- that can be done by usb_remove_hcd where it
- belongs.
-
- Devices aren't locked over the same scope of code in
- usb_new_device and hub_port_connect_change as they used to be.
- This shouldn't cause any trouble.
-
-Along with the preceding driver core patch, this needs a lot of testing.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/devices.c | 4 -
- drivers/usb/core/devio.c | 2
- drivers/usb/core/driver.c | 4 -
- drivers/usb/core/hcd.c | 5 +
- drivers/usb/core/hub.c | 48 ++++++------------
- drivers/usb/core/usb.c | 114 +++-----------------------------------------
- drivers/usb/core/usb.h | 3 -
- drivers/usb/host/ohci-hub.c | 2
- include/linux/usb.h | 9 +--
- 9 files changed, 37 insertions(+), 154 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/devio.c
-+++ gregkh-2.6/drivers/usb/core/devio.c
-@@ -1349,9 +1349,7 @@ static int proc_ioctl(struct dev_state *
- /* let kernel drivers try to (re)bind to the interface */
- case USBDEVFS_CONNECT:
- usb_unlock_device(ps->dev);
-- usb_lock_all_devices();
- bus_rescan_devices(intf->dev.bus);
-- usb_unlock_all_devices();
- usb_lock_device(ps->dev);
- break;
-
---- gregkh-2.6.orig/drivers/usb/core/usb.h
-+++ gregkh-2.6/drivers/usb/core/usb.h
-@@ -16,9 +16,6 @@ extern int usb_get_device_descriptor(str
- extern char *usb_cache_string(struct usb_device *udev, int index);
- extern int usb_set_configuration(struct usb_device *dev, int configuration);
-
--extern void usb_lock_all_devices(void);
--extern void usb_unlock_all_devices(void);
--
- extern void usb_kick_khubd(struct usb_device *dev);
- extern void usb_suspend_root_hub(struct usb_device *hdev);
- extern void usb_resume_root_hub(struct usb_device *dev);
---- gregkh-2.6.orig/drivers/usb/core/hub.c
-+++ gregkh-2.6/drivers/usb/core/hub.c
-@@ -32,7 +32,7 @@
- #include "hub.h"
-
- /* Protect struct usb_device->state and ->children members
-- * Note: Both are also protected by ->serialize, except that ->state can
-+ * Note: Both are also protected by ->dev.sem, except that ->state can
- * change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */
- static DEFINE_SPINLOCK(device_state_lock);
-
-@@ -975,8 +975,8 @@ static int locktree(struct usb_device *u
- /* when everyone grabs locks top->bottom,
- * non-overlapping work may be concurrent
- */
-- down(&udev->serialize);
-- up(&hdev->serialize);
-+ usb_lock_device(udev);
-+ usb_unlock_device(hdev);
- return t + 1;
- }
- }
-@@ -1132,16 +1132,10 @@ void usb_disconnect(struct usb_device **
- * this quiesces everyting except pending urbs.
- */
- usb_set_device_state(udev, USB_STATE_NOTATTACHED);
--
-- /* lock the bus list on behalf of HCDs unregistering their root hubs */
-- if (!udev->parent) {
-- down(&usb_bus_list_lock);
-- usb_lock_device(udev);
-- } else
-- down(&udev->serialize);
--
- dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);
-
-+ usb_lock_device(udev);
-+
- /* Free up all the children before we remove this device */
- for (i = 0; i < USB_MAXCHILDREN; i++) {
- if (udev->children[i])
-@@ -1169,11 +1163,7 @@ void usb_disconnect(struct usb_device **
- *pdev = NULL;
- spin_unlock_irq(&device_state_lock);
-
-- if (!udev->parent) {
-- usb_unlock_device(udev);
-- up(&usb_bus_list_lock);
-- } else
-- up(&udev->serialize);
-+ usb_unlock_device(udev);
-
- device_unregister(&udev->dev);
- }
-@@ -1243,8 +1233,8 @@ static inline void show_string(struct us
- *
- * This is called with devices which have been enumerated, but not yet
- * configured. The device descriptor is available, but not descriptors
-- * for any device configuration. The caller must have locked udev and
-- * either the parent hub (if udev is a normal device) or else the
-+ * for any device configuration. The caller must have locked either
-+ * the parent hub (if udev is a normal device) or else the
- * usb_bus_list_lock (if udev is a root hub). The parent's pointer to
- * udev has already been installed, but udev is not yet visible through
- * sysfs or other filesystem code.
-@@ -1254,8 +1244,7 @@ static inline void show_string(struct us
- *
- * This call is synchronous, and may not be used in an interrupt context.
- *
-- * Only the hub driver should ever call this; root hub registration
-- * uses it indirectly.
-+ * Only the hub driver or root-hub registrar should ever call this.
- */
- int usb_new_device(struct usb_device *udev)
- {
-@@ -1364,6 +1353,8 @@ int usb_new_device(struct usb_device *ud
- }
- usb_create_sysfs_dev_files (udev);
-
-+ usb_lock_device(udev);
-+
- /* choose and set the configuration. that registers the interfaces
- * with the driver core, and lets usb device drivers bind to them.
- */
-@@ -1385,6 +1376,8 @@ int usb_new_device(struct usb_device *ud
- /* USB device state == configured ... usable */
- usb_notify_add_device(udev);
-
-+ usb_unlock_device(udev);
-+
- return 0;
-
- fail:
-@@ -1872,11 +1865,8 @@ int usb_resume_device(struct usb_device
- usb_unlock_device(udev);
-
- /* rebind drivers that had no suspend() */
-- if (status == 0) {
-- usb_lock_all_devices();
-+ if (status == 0)
- bus_rescan_devices(&usb_bus_type);
-- usb_unlock_all_devices();
-- }
- return status;
- }
-
-@@ -1889,14 +1879,14 @@ static int remote_wakeup(struct usb_devi
- /* don't repeat RESUME sequence if this device
- * was already woken up by some other task
- */
-- down(&udev->serialize);
-+ usb_lock_device(udev);
- if (udev->state == USB_STATE_SUSPENDED) {
- dev_dbg(&udev->dev, "RESUME (wakeup)\n");
- /* TRSMRCY = 10 msec */
- msleep(10);
- status = finish_device_resume(udev);
- }
-- up(&udev->serialize);
-+ usb_unlock_device(udev);
- #endif
- return status;
- }
-@@ -1997,7 +1987,7 @@ static int hub_resume(struct usb_interfa
-
- if (!udev || status < 0)
- continue;
-- down (&udev->serialize);
-+ usb_lock_device(udev);
- if (portstat & USB_PORT_STAT_SUSPEND)
- status = hub_port_resume(hub, port1, udev);
- else {
-@@ -2008,7 +1998,7 @@ static int hub_resume(struct usb_interfa
- hub_port_logical_disconnect(hub, port1);
- }
- }
-- up(&udev->serialize);
-+ usb_unlock_device(udev);
- }
- }
- #endif
-@@ -2573,7 +2563,6 @@ static void hub_port_connect_change(stru
- * udev becomes globally accessible, although presumably
- * no one will look at it until hdev is unlocked.
- */
-- down (&udev->serialize);
- status = 0;
-
- /* We mustn't add new devices if the parent hub has
-@@ -2597,7 +2586,6 @@ static void hub_port_connect_change(stru
- }
- }
-
-- up (&udev->serialize);
- if (status)
- goto loop_disable;
-
---- gregkh-2.6.orig/drivers/usb/core/hcd.c
-+++ gregkh-2.6/drivers/usb/core/hcd.c
-@@ -857,9 +857,7 @@ static int register_root_hub (struct usb
- return (retval < 0) ? retval : -EMSGSIZE;
- }
-
-- usb_lock_device (usb_dev);
- retval = usb_new_device (usb_dev);
-- usb_unlock_device (usb_dev);
- if (retval) {
- usb_dev->bus->root_hub = NULL;
- dev_err (parent_dev, "can't register root hub for %s, %d\n",
-@@ -1891,7 +1889,10 @@ void usb_remove_hcd(struct usb_hcd *hcd)
- spin_lock_irq (&hcd_root_hub_lock);
- hcd->rh_registered = 0;
- spin_unlock_irq (&hcd_root_hub_lock);
-+
-+ down(&usb_bus_list_lock);
- usb_disconnect(&hcd->self.root_hub);
-+ up(&usb_bus_list_lock);
-
- hcd->poll_rh = 0;
- del_timer_sync(&hcd->rh_timer);
---- gregkh-2.6.orig/include/linux/usb.h
-+++ gregkh-2.6/include/linux/usb.h
-@@ -329,8 +329,6 @@ struct usb_device {
- struct usb_tt *tt; /* low/full speed dev, highspeed hub */
- int ttport; /* device port on that tt hub */
-
-- struct semaphore serialize;
--
- unsigned int toggle[2]; /* one bit for each endpoint
- * ([0] = IN, [1] = OUT) */
-
-@@ -377,11 +375,12 @@ struct usb_device {
- extern struct usb_device *usb_get_dev(struct usb_device *dev);
- extern void usb_put_dev(struct usb_device *dev);
-
--extern void usb_lock_device(struct usb_device *udev);
--extern int usb_trylock_device(struct usb_device *udev);
-+/* USB device locking */
-+#define usb_lock_device(udev) down(&(udev)->dev.sem)
-+#define usb_unlock_device(udev) up(&(udev)->dev.sem)
-+#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem)
- extern int usb_lock_device_for_reset(struct usb_device *udev,
- struct usb_interface *iface);
--extern void usb_unlock_device(struct usb_device *udev);
-
- /* USB port reset for device reinitialization */
- extern int usb_reset_device(struct usb_device *dev);
---- gregkh-2.6.orig/drivers/usb/core/driver.c
-+++ gregkh-2.6/drivers/usb/core/driver.c
-@@ -432,9 +432,7 @@ int usb_register_driver(struct usb_drive
- spin_lock_init(&new_driver->dynids.lock);
- INIT_LIST_HEAD(&new_driver->dynids.list);
-
-- usb_lock_all_devices();
- retval = driver_register(&new_driver->driver);
-- usb_unlock_all_devices();
-
- if (!retval) {
- pr_info("%s: registered new driver %s\n",
-@@ -465,11 +463,9 @@ void usb_deregister(struct usb_driver *d
- {
- pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name);
-
-- usb_lock_all_devices();
- usb_remove_newid_file(driver);
- usb_free_dynids(driver);
- driver_unregister(&driver->driver);
-- usb_unlock_all_devices();
-
- usbfs_update_special();
- }
---- gregkh-2.6.orig/drivers/usb/host/ohci-hub.c
-+++ gregkh-2.6/drivers/usb/host/ohci-hub.c
-@@ -372,7 +372,7 @@ done:
- & ohci->hc_control)
- == OHCI_USB_OPER
- && time_after (jiffies, ohci->next_statechange)
-- && usb_trylock_device (hcd->self.root_hub)
-+ && usb_trylock_device (hcd->self.root_hub) == 0
- ) {
- ohci_vdbg (ohci, "autosuspend\n");
- (void) ohci_bus_suspend (hcd);
---- gregkh-2.6.orig/drivers/usb/core/usb.c
-+++ gregkh-2.6/drivers/usb/core/usb.c
-@@ -32,7 +32,6 @@
- #include <linux/spinlock.h>
- #include <linux/errno.h>
- #include <linux/smp_lock.h>
--#include <linux/rwsem.h>
- #include <linux/usb.h>
-
- #include <asm/io.h>
-@@ -49,8 +48,6 @@ const char *usbcore_name = "usbcore";
- static int nousb; /* Disable USB when built into kernel image */
- /* Not honored on modular build */
-
--static DECLARE_RWSEM(usb_all_devices_rwsem);
--
-
- /**
- * usb_ifnum_to_if - get the interface object with a given interface number
-@@ -443,8 +440,6 @@ usb_alloc_dev(struct usb_device *parent,
- dev->parent = parent;
- INIT_LIST_HEAD(&dev->filelist);
-
-- init_MUTEX(&dev->serialize);
--
- return dev;
- }
-
-@@ -517,76 +512,21 @@ void usb_put_intf(struct usb_interface *
-
- /* USB device locking
- *
-- * Although locking USB devices should be straightforward, it is
-- * complicated by the way the driver-model core works. When a new USB
-- * driver is registered or unregistered, the core will automatically
-- * probe or disconnect all matching interfaces on all USB devices while
-- * holding the USB subsystem writelock. There's no good way for us to
-- * tell which devices will be used or to lock them beforehand; our only
-- * option is to effectively lock all the USB devices.
-- *
-- * We do that by using a private rw-semaphore, usb_all_devices_rwsem.
-- * When locking an individual device you must first acquire the rwsem's
-- * readlock. When a driver is registered or unregistered the writelock
-- * must be held. These actions are encapsulated in the subroutines
-- * below, so all a driver needs to do is call usb_lock_device() and
-- * usb_unlock_device().
-+ * USB devices and interfaces are locked using the semaphore in their
-+ * embedded struct device. The hub driver guarantees that whenever a
-+ * device is connected or disconnected, drivers are called with the
-+ * USB device locked as well as their particular interface.
- *
- * Complications arise when several devices are to be locked at the same
- * time. Only hub-aware drivers that are part of usbcore ever have to
-- * do this; nobody else needs to worry about it. The problem is that
-- * usb_lock_device() must not be called to lock a second device since it
-- * would acquire the rwsem's readlock reentrantly, leading to deadlock if
-- * another thread was waiting for the writelock. The solution is simple:
-- *
-- * When locking more than one device, call usb_lock_device()
-- * to lock the first one. Lock the others by calling
-- * down(&udev->serialize) directly.
-- *
-- * When unlocking multiple devices, use up(&udev->serialize)
-- * to unlock all but the last one. Unlock the last one by
-- * calling usb_unlock_device().
-+ * do this; nobody else needs to worry about it. The rule for locking
-+ * is simple:
- *
- * When locking both a device and its parent, always lock the
- * the parent first.
- */
-
- /**
-- * usb_lock_device - acquire the lock for a usb device structure
-- * @udev: device that's being locked
-- *
-- * Use this routine when you don't hold any other device locks;
-- * to acquire nested inner locks call down(&udev->serialize) directly.
-- * This is necessary for proper interaction with usb_lock_all_devices().
-- */
--void usb_lock_device(struct usb_device *udev)
--{
-- down_read(&usb_all_devices_rwsem);
-- down(&udev->serialize);
--}
--
--/**
-- * usb_trylock_device - attempt to acquire the lock for a usb device structure
-- * @udev: device that's being locked
-- *
-- * Don't use this routine if you already hold a device lock;
-- * use down_trylock(&udev->serialize) instead.
-- * This is necessary for proper interaction with usb_lock_all_devices().
-- *
-- * Returns 1 if successful, 0 if contention.
-- */
--int usb_trylock_device(struct usb_device *udev)
--{
-- if (!down_read_trylock(&usb_all_devices_rwsem))
-- return 0;
-- if (down_trylock(&udev->serialize)) {
-- up_read(&usb_all_devices_rwsem);
-- return 0;
-- }
-- return 1;
--}
--
--/**
- * usb_lock_device_for_reset - cautiously acquire the lock for a
- * usb device structure
- * @udev: device that's being locked
-@@ -624,7 +564,7 @@ int usb_lock_device_for_reset(struct usb
- }
- }
-
-- while (!usb_trylock_device(udev)) {
-+ while (usb_trylock_device(udev) != 0) {
-
- /* If we can't acquire the lock after waiting one second,
- * we're probably deadlocked */
-@@ -642,39 +582,6 @@ int usb_lock_device_for_reset(struct usb
- return 1;
- }
-
--/**
-- * usb_unlock_device - release the lock for a usb device structure
-- * @udev: device that's being unlocked
-- *
-- * Use this routine when releasing the only device lock you hold;
-- * to release inner nested locks call up(&udev->serialize) directly.
-- * This is necessary for proper interaction with usb_lock_all_devices().
-- */
--void usb_unlock_device(struct usb_device *udev)
--{
-- up(&udev->serialize);
-- up_read(&usb_all_devices_rwsem);
--}
--
--/**
-- * usb_lock_all_devices - acquire the lock for all usb device structures
-- *
-- * This is necessary when registering a new driver or probing a bus,
-- * since the driver-model core may try to use any usb_device.
-- */
--void usb_lock_all_devices(void)
--{
-- down_write(&usb_all_devices_rwsem);
--}
--
--/**
-- * usb_unlock_all_devices - release the lock for all usb device structures
-- */
--void usb_unlock_all_devices(void)
--{
-- up_write(&usb_all_devices_rwsem);
--}
--
-
- static struct usb_device *match_device(struct usb_device *dev,
- u16 vendor_id, u16 product_id)
-@@ -697,10 +604,10 @@ static struct usb_device *match_device(s
- /* look through all of the children of this device */
- for (child = 0; child < dev->maxchild; ++child) {
- if (dev->children[child]) {
-- down(&dev->children[child]->serialize);
-+ usb_lock_device(dev->children[child]);
- ret_dev = match_device(dev->children[child],
- vendor_id, product_id);
-- up(&dev->children[child]->serialize);
-+ usb_unlock_device(dev->children[child]);
- if (ret_dev)
- goto exit;
- }
-@@ -1297,10 +1204,7 @@ EXPORT_SYMBOL(usb_put_dev);
- EXPORT_SYMBOL(usb_get_dev);
- EXPORT_SYMBOL(usb_hub_tt_clear_buffer);
-
--EXPORT_SYMBOL(usb_lock_device);
--EXPORT_SYMBOL(usb_trylock_device);
- EXPORT_SYMBOL(usb_lock_device_for_reset);
--EXPORT_SYMBOL(usb_unlock_device);
-
- EXPORT_SYMBOL(usb_driver_claim_interface);
- EXPORT_SYMBOL(usb_driver_release_interface);
---- gregkh-2.6.orig/drivers/usb/core/devices.c
-+++ gregkh-2.6/drivers/usb/core/devices.c
-@@ -545,10 +545,10 @@ static ssize_t usb_device_dump(char __us
- struct usb_device *childdev = usbdev->children[chix];
-
- if (childdev) {
-- down(&childdev->serialize);
-+ usb_lock_device(childdev);
- ret = usb_device_dump(buffer, nbytes, skip_bytes, file_offset, childdev,
- bus, level + 1, chix, ++cnt);
-- up(&childdev->serialize);
-+ usb_unlock_device(childdev);
- if (ret == -EFAULT)
- return total_written;
- total_written += ret;
diff --git a/usb/uhci-change-uhci_explen-macro.patch b/usb/uhci-change-uhci_explen-macro.patch
deleted file mode 100644
index d3312248bf86c..0000000000000
--- a/usb/uhci-change-uhci_explen-macro.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From stern@rowland.harvard.edu Wed Nov 30 09:00:34 2005
-Date: Wed, 30 Nov 2005 11:57:51 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: UHCI: change uhci_explen macro
-Message-ID: <Pine.LNX.4.44L0.0511301154430.4907-100000@iolanthe.rowland.org>
-
-This patch (as616) changed the uhci_explen macro in uhci-hcd.h so that
-it now accepts the desired length, rather than length - 1 with special
-handling for 0. This also fixes a minor bug that would show up only
-when a driver submits a 0-length bulk URB.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/uhci-hcd.c | 2 +-
- drivers/usb/host/uhci-hcd.h | 8 ++++----
- drivers/usb/host/uhci-q.c | 12 ++++++------
- 3 files changed, 11 insertions(+), 11 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/uhci-q.c
-+++ gregkh-2.6/drivers/usb/host/uhci-q.c
-@@ -596,7 +596,7 @@ static int uhci_submit_control(struct uh
- return -ENOMEM;
-
- uhci_add_td_to_urb(urb, td);
-- uhci_fill_td(td, status, destination | uhci_explen(7),
-+ uhci_fill_td(td, status, destination | uhci_explen(8),
- urb->setup_dma);
-
- /*
-@@ -628,7 +628,7 @@ static int uhci_submit_control(struct uh
- destination ^= TD_TOKEN_TOGGLE;
-
- uhci_add_td_to_urb(urb, td);
-- uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1),
-+ uhci_fill_td(td, status, destination | uhci_explen(pktsze),
- data);
-
- data += pktsze;
-@@ -658,7 +658,7 @@ static int uhci_submit_control(struct uh
-
- uhci_add_td_to_urb(urb, td);
- uhci_fill_td(td, status | TD_CTRL_IOC,
-- destination | uhci_explen(UHCI_NULL_DATA_SIZE), 0);
-+ destination | uhci_explen(0), 0);
-
- qh = uhci_alloc_qh(uhci);
- if (!qh)
-@@ -864,7 +864,7 @@ static int uhci_submit_common(struct uhc
- return -ENOMEM;
-
- uhci_add_td_to_urb(urb, td);
-- uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1) |
-+ uhci_fill_td(td, status, destination | uhci_explen(pktsze) |
- (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
- usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
- data);
-@@ -890,7 +890,7 @@ static int uhci_submit_common(struct uhc
- return -ENOMEM;
-
- uhci_add_td_to_urb(urb, td);
-- uhci_fill_td(td, status, destination | uhci_explen(UHCI_NULL_DATA_SIZE) |
-+ uhci_fill_td(td, status, destination | uhci_explen(0) |
- (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
- usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
- data);
-@@ -1092,7 +1092,7 @@ static int uhci_submit_isochronous(struc
- return -ENOMEM;
-
- uhci_add_td_to_urb(urb, td);
-- uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length - 1),
-+ uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length),
- urb->transfer_dma + urb->iso_frame_desc[i].offset);
-
- if (i + 1 >= urb->number_of_packets)
---- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/uhci-hcd.c
-@@ -566,7 +566,7 @@ static int uhci_start(struct usb_hcd *hc
- uhci->skel_bulk_qh->link = cpu_to_le32(uhci->skel_term_qh->dma_handle) | UHCI_PTR_QH;
-
- /* This dummy TD is to work around a bug in Intel PIIX controllers */
-- uhci_fill_td(uhci->term_td, 0, (UHCI_NULL_DATA_SIZE << 21) |
-+ uhci_fill_td(uhci->term_td, 0, uhci_explen(0) |
- (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0);
- uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle);
-
---- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.h
-+++ gregkh-2.6/drivers/usb/host/uhci-hcd.h
-@@ -71,8 +71,6 @@
- #define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */
- #define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */
-
--#define UHCI_NULL_DATA_SIZE 0x7FF /* for UHCI controller TD */
--
- #define UHCI_PTR_BITS cpu_to_le32(0x000F)
- #define UHCI_PTR_TERM cpu_to_le32(0x0001)
- #define UHCI_PTR_QH cpu_to_le32(0x0002)
-@@ -168,9 +166,11 @@ static __le32 inline qh_element(struct u
- #define TD_TOKEN_EXPLEN_MASK 0x7FF /* expected length, encoded as n - 1 */
- #define TD_TOKEN_PID_MASK 0xFF
-
--#define uhci_explen(len) ((len) << TD_TOKEN_EXPLEN_SHIFT)
-+#define uhci_explen(len) ((((len) - 1) & TD_TOKEN_EXPLEN_MASK) << \
-+ TD_TOKEN_EXPLEN_SHIFT)
-
--#define uhci_expected_length(token) ((((token) >> 21) + 1) & TD_TOKEN_EXPLEN_MASK)
-+#define uhci_expected_length(token) ((((token) >> TD_TOKEN_EXPLEN_SHIFT) + \
-+ 1) & TD_TOKEN_EXPLEN_MASK)
- #define uhci_toggle(token) (((token) >> TD_TOKEN_TOGGLE_SHIFT) & 1)
- #define uhci_endpoint(token) (((token) >> 15) & 0xf)
- #define uhci_devaddr(token) (((token) >> TD_TOKEN_DEVADDR_SHIFT) & 0x7f)
diff --git a/usb/uhci-edit-some-comments.patch b/usb/uhci-edit-some-comments.patch
deleted file mode 100644
index 4100e1890215e..0000000000000
--- a/usb/uhci-edit-some-comments.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-From stern@rowland.harvard.edu Wed Nov 30 14:21:45 2005
-Date: Wed, 30 Nov 2005 17:16:19 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: UHCI: edit some comments
-Message-ID: <Pine.LNX.4.44L0.0511301712200.5778-100000@iolanthe.rowland.org>
-
-
-This patch (as615b) edits a large number of comments in the uhci-hcd code,
-mainly removing excess apostrophes.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/uhci-debug.c | 12 ++++++------
- drivers/usb/host/uhci-hcd.c | 17 +++++++++--------
- drivers/usb/host/uhci-hcd.h | 24 ++++++++++++------------
- drivers/usb/host/uhci-q.c | 18 +++++++++---------
- 4 files changed, 36 insertions(+), 35 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/uhci-q.c
-+++ gregkh-2.6/drivers/usb/host/uhci-q.c
-@@ -80,7 +80,7 @@ static inline void uhci_fill_td(struct u
- }
-
- /*
-- * We insert Isochronous URB's directly into the frame list at the beginning
-+ * We insert Isochronous URBs directly into the frame list at the beginning
- */
- static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, unsigned framenum)
- {
-@@ -369,7 +369,7 @@ static void uhci_append_queued_urb(struc
- uhci_fixup_toggle(urb,
- uhci_toggle(td_token(lltd)) ^ 1));
-
-- /* All qh's in the queue need to link to the next queue */
-+ /* All qhs in the queue need to link to the next queue */
- urbp->qh->link = eurbp->qh->link;
-
- wmb(); /* Make sure we flush everything */
-@@ -502,7 +502,7 @@ static void uhci_destroy_urb_priv(struct
- }
-
- /* Check to see if the remove list is empty. Set the IOC bit */
-- /* to force an interrupt so we can remove the TD's*/
-+ /* to force an interrupt so we can remove the TDs*/
- if (list_empty(&uhci->td_remove_list))
- uhci_set_next_interrupt(uhci);
-
-@@ -612,7 +612,7 @@ static int uhci_submit_control(struct uh
- }
-
- /*
-- * Build the DATA TD's
-+ * Build the DATA TDs
- */
- while (len > 0) {
- int pktsze = len;
-@@ -744,7 +744,7 @@ static int uhci_result_control(struct uh
-
- urb->actual_length = 0;
-
-- /* The rest of the TD's (but the last) are data */
-+ /* The rest of the TDs (but the last) are data */
- tmp = tmp->next;
- while (tmp != head && tmp->next != head) {
- unsigned int ctrlstat;
-@@ -848,7 +848,7 @@ static int uhci_submit_common(struct uhc
- status |= TD_CTRL_SPD;
-
- /*
-- * Build the DATA TD's
-+ * Build the DATA TDs
- */
- do { /* Allow zero length packets */
- int pktsze = maxsze;
-@@ -1025,7 +1025,7 @@ static int isochronous_find_limits(struc
- list_for_each_entry(up, &uhci->urb_list, urb_list) {
- struct urb *u = up->urb;
-
-- /* look for pending URB's with identical pipe handle */
-+ /* look for pending URBs with identical pipe handle */
- if ((urb->pipe == u->pipe) && (urb->dev == u->dev) &&
- (u->status == -EINPROGRESS) && (u != urb)) {
- if (!last_urb)
-@@ -1355,7 +1355,7 @@ static void uhci_unlink_generic(struct u
-
- uhci_delete_queued_urb(uhci, urb);
-
-- /* The interrupt loop will reclaim the QH's */
-+ /* The interrupt loop will reclaim the QHs */
- uhci_remove_qh(uhci, urbp->qh);
- urbp->qh = NULL;
- }
-@@ -1413,7 +1413,7 @@ static int uhci_fsbr_timeout(struct uhci
- list_for_each_entry(td, head, list) {
- /*
- * Make sure we don't do the last one (since it'll have the
-- * TERM bit set) as well as we skip every so many TD's to
-+ * TERM bit set) as well as we skip every so many TDs to
- * make sure it doesn't hog the bandwidth
- */
- if (td->list.next != head && (count % DEPTH_INTERVAL) ==
---- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/uhci-hcd.c
-@@ -62,10 +62,10 @@ Alan Stern"
-
- /*
- * debug = 0, no debugging messages
-- * debug = 1, dump failed URB's except for stalls
-- * debug = 2, dump all failed URB's (including stalls)
-+ * debug = 1, dump failed URBs except for stalls
-+ * debug = 2, dump all failed URBs (including stalls)
- * show all queues in /debug/uhci/[pci_addr]
-- * debug = 3, show all TD's in URB's when dumping
-+ * debug = 3, show all TDs in URBs when dumping
- */
- #ifdef DEBUG
- static int debug = 1;
-@@ -88,7 +88,7 @@ static void uhci_get_current_frame_numbe
- #define FSBR_DELAY msecs_to_jiffies(50)
-
- /* When we timeout an idle transfer for FSBR, we'll switch it over to */
--/* depth first traversal. We'll do it in groups of this number of TD's */
-+/* depth first traversal. We'll do it in groups of this number of TDs */
- /* to make sure it doesn't hog all of the bandwidth */
- #define DEPTH_INTERVAL 5
-
-@@ -728,8 +728,9 @@ static int uhci_resume(struct usb_hcd *h
-
- dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
-
-- /* We aren't in D3 state anymore, we do that even if dead as I
-- * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0
-+ /* Since we aren't in D3 any more, it's safe to set this flag
-+ * even if the controller was dead. It might not even be dead
-+ * any more, if the firmware or quirks code has reset it.
- */
- set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
- mb();
-@@ -879,7 +880,7 @@ static int __init uhci_hcd_init(void)
-
- init_failed:
- if (kmem_cache_destroy(uhci_up_cachep))
-- warn("not all urb_priv's were freed!");
-+ warn("not all urb_privs were freed!");
-
- up_failed:
- debugfs_remove(uhci_debugfs_root);
-@@ -897,7 +898,7 @@ static void __exit uhci_hcd_cleanup(void
- pci_unregister_driver(&uhci_pci_driver);
-
- if (kmem_cache_destroy(uhci_up_cachep))
-- warn("not all urb_priv's were freed!");
-+ warn("not all urb_privs were freed!");
-
- debugfs_remove(uhci_debugfs_root);
- kfree(errbuf);
---- gregkh-2.6.orig/drivers/usb/host/uhci-debug.c
-+++ gregkh-2.6/drivers/usb/host/uhci-debug.c
-@@ -2,8 +2,8 @@
- * UHCI-specific debugging code. Invaluable when something
- * goes wrong, but don't get in my face.
- *
-- * Kernel visible pointers are surrounded in []'s and bus
-- * visible pointers are surrounded in ()'s
-+ * Kernel visible pointers are surrounded in []s and bus
-+ * visible pointers are surrounded in ()s
- *
- * (C) Copyright 1999 Linus Torvalds
- * (C) Copyright 1999-2001 Johannes Erdfelt
-@@ -19,7 +19,7 @@
-
- static struct dentry *uhci_debugfs_root = NULL;
-
--/* Handle REALLY large printk's so we don't overflow buffers */
-+/* Handle REALLY large printks so we don't overflow buffers */
- static inline void lprintk(char *buf)
- {
- char *p;
-@@ -160,7 +160,7 @@ static int uhci_show_qh(struct uhci_qh *
- }
-
- if (active && ni > i) {
-- out += sprintf(out, "%*s[skipped %d active TD's]\n", space, "", ni - i);
-+ out += sprintf(out, "%*s[skipped %d active TDs]\n", space, "", ni - i);
- tmp = ntmp;
- td = ntd;
- i = ni;
-@@ -173,7 +173,7 @@ static int uhci_show_qh(struct uhci_qh *
- if (list_empty(&urbp->queue_list) || urbp->queued)
- goto out;
-
-- out += sprintf(out, "%*sQueued QH's:\n", -space, "--");
-+ out += sprintf(out, "%*sQueued QHs:\n", -space, "--");
-
- head = &urbp->queue_list;
- tmp = head->next;
-@@ -464,7 +464,7 @@ static int uhci_sprint_schedule(struct u
- } while (tmp != head);
- }
-
-- out += sprintf(out, "Skeleton QH's\n");
-+ out += sprintf(out, "Skeleton QHs\n");
-
- for (i = 0; i < UHCI_NUM_SKELQH; ++i) {
- int shown = 0;
---- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.h
-+++ gregkh-2.6/drivers/usb/host/uhci-hcd.h
-@@ -223,10 +223,10 @@ static u32 inline td_status(struct uhci_
- */
-
- /*
-- * The UHCI driver places Interrupt, Control and Bulk into QH's both
-- * to group together TD's for one transfer, and also to faciliate queuing
-- * of URB's. To make it easy to insert entries into the schedule, we have
-- * a skeleton of QH's for each predefined Interrupt latency, low-speed
-+ * The UHCI driver places Interrupt, Control and Bulk into QHs both
-+ * to group together TDs for one transfer, and also to facilitate queuing
-+ * of URBs. To make it easy to insert entries into the schedule, we have
-+ * a skeleton of QHs for each predefined Interrupt latency, low-speed
- * control, full-speed control and terminating QH (see explanation for
- * the terminating QH below).
- *
-@@ -257,8 +257,8 @@ static u32 inline td_status(struct uhci_
- * reclamation.
- *
- * Isochronous transfers are stored before the start of the skeleton
-- * schedule and don't use QH's. While the UHCI spec doesn't forbid the
-- * use of QH's for Isochronous, it doesn't use them either. And the spec
-+ * schedule and don't use QHs. While the UHCI spec doesn't forbid the
-+ * use of QHs for Isochronous, it doesn't use them either. And the spec
- * says that queues never advance on an error completion status, which
- * makes them totally unsuitable for Isochronous transfers.
- */
-@@ -359,7 +359,7 @@ struct uhci_hcd {
- struct dma_pool *td_pool;
-
- struct uhci_td *term_td; /* Terminating TD, see UHCI bug */
-- struct uhci_qh *skelqh[UHCI_NUM_SKELQH]; /* Skeleton QH's */
-+ struct uhci_qh *skelqh[UHCI_NUM_SKELQH]; /* Skeleton QHs */
-
- spinlock_t lock;
-
-@@ -389,22 +389,22 @@ struct uhci_hcd {
- unsigned long resuming_ports;
- unsigned long ports_timeout; /* Time to stop signalling */
-
-- /* Main list of URB's currently controlled by this HC */
-+ /* Main list of URBs currently controlled by this HC */
- struct list_head urb_list;
-
-- /* List of QH's that are done, but waiting to be unlinked (race) */
-+ /* List of QHs that are done, but waiting to be unlinked (race) */
- struct list_head qh_remove_list;
- unsigned int qh_remove_age; /* Age in frames */
-
-- /* List of TD's that are done, but waiting to be freed (race) */
-+ /* List of TDs that are done, but waiting to be freed (race) */
- struct list_head td_remove_list;
- unsigned int td_remove_age; /* Age in frames */
-
-- /* List of asynchronously unlinked URB's */
-+ /* List of asynchronously unlinked URBs */
- struct list_head urb_remove_list;
- unsigned int urb_remove_age; /* Age in frames */
-
-- /* List of URB's awaiting completion callback */
-+ /* List of URBs awaiting completion callback */
- struct list_head complete_list;
-
- int rh_numports; /* Number of root-hub ports */
diff --git a/usb/usb-add-driver-for-ati-philips-usb-rf-remotes.patch b/usb/usb-add-driver-for-ati-philips-usb-rf-remotes.patch
deleted file mode 100644
index fc6dc7b2209ae..0000000000000
--- a/usb/usb-add-driver-for-ati-philips-usb-rf-remotes.patch
+++ /dev/null
@@ -1,534 +0,0 @@
-From syrjala@kotilo.saunalahti.fi Sat Dec 10 10:34:44 2005
-Date: Sat, 10 Dec 2005 20:30:54 +0200
-From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <syrjala@sci.fi>
-Cc: greg@kroah.com
-Subject: USB: add driver for ATI/Philips USB RF remotes
-Message-ID: <20051210183054.GA19050@sci.fi>
-Content-Disposition: inline
-
-Summary: Driver for ATI/Philips USB RF remotes
-
-This is a new input driver for ATI/Philips USB RF remotes (eg. ATI
-Remote Wonder II).
-
-Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
----
- drivers/usb/input/Kconfig | 14 +
- drivers/usb/input/Makefile | 1
- drivers/usb/input/ati_remote2.c | 477 ++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 492 insertions(+)
-
---- /dev/null
-+++ gregkh-2.6/drivers/usb/input/ati_remote2.c
-@@ -0,0 +1,477 @@
-+/*
-+ * ati_remote2 - ATI/Philips USB RF remote driver
-+ *
-+ * Copyright (C) 2005 Ville Syrjala <syrjala@sci.fi>
-+ *
-+ * 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.
-+ */
-+
-+#include <linux/usb_input.h>
-+
-+#define DRIVER_DESC "ATI/Philips USB RF remote driver"
-+#define DRIVER_VERSION "0.1"
-+
-+MODULE_DESCRIPTION(DRIVER_DESC);
-+MODULE_VERSION(DRIVER_VERSION);
-+MODULE_AUTHOR("Ville Syrjala <syrjala@sci.fi>");
-+MODULE_LICENSE("GPL");
-+
-+static unsigned int mode_mask = 0x1F;
-+module_param(mode_mask, uint, 0644);
-+MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>");
-+
-+static struct usb_device_id ati_remote2_id_table[] = {
-+ { USB_DEVICE(0x0471, 0x0602) }, /* ATI Remote Wonder II */
-+ { }
-+};
-+MODULE_DEVICE_TABLE(usb, ati_remote2_id_table);
-+
-+static struct {
-+ int hw_code;
-+ int key_code;
-+} ati_remote2_key_table[] = {
-+ { 0x00, KEY_0 },
-+ { 0x01, KEY_1 },
-+ { 0x02, KEY_2 },
-+ { 0x03, KEY_3 },
-+ { 0x04, KEY_4 },
-+ { 0x05, KEY_5 },
-+ { 0x06, KEY_6 },
-+ { 0x07, KEY_7 },
-+ { 0x08, KEY_8 },
-+ { 0x09, KEY_9 },
-+ { 0x0c, KEY_POWER },
-+ { 0x0d, KEY_MUTE },
-+ { 0x10, KEY_VOLUMEUP },
-+ { 0x11, KEY_VOLUMEDOWN },
-+ { 0x20, KEY_CHANNELUP },
-+ { 0x21, KEY_CHANNELDOWN },
-+ { 0x28, KEY_FORWARD },
-+ { 0x29, KEY_REWIND },
-+ { 0x2c, KEY_PLAY },
-+ { 0x30, KEY_PAUSE },
-+ { 0x31, KEY_STOP },
-+ { 0x37, KEY_RECORD },
-+ { 0x38, KEY_DVD },
-+ { 0x39, KEY_TV },
-+ { 0x54, KEY_MENU },
-+ { 0x58, KEY_UP },
-+ { 0x59, KEY_DOWN },
-+ { 0x5a, KEY_LEFT },
-+ { 0x5b, KEY_RIGHT },
-+ { 0x5c, KEY_OK },
-+ { 0x78, KEY_A },
-+ { 0x79, KEY_B },
-+ { 0x7a, KEY_C },
-+ { 0x7b, KEY_D },
-+ { 0x7c, KEY_E },
-+ { 0x7d, KEY_F },
-+ { 0x82, KEY_ENTER },
-+ { 0x8e, KEY_VENDOR },
-+ { 0x96, KEY_COFFEE },
-+ { 0xa9, BTN_LEFT },
-+ { 0xaa, BTN_RIGHT },
-+ { 0xbe, KEY_QUESTION },
-+ { 0xd5, KEY_FRONT },
-+ { 0xd0, KEY_EDIT },
-+ { 0xf9, KEY_INFO },
-+ { (0x00 << 8) | 0x3f, KEY_PROG1 },
-+ { (0x01 << 8) | 0x3f, KEY_PROG2 },
-+ { (0x02 << 8) | 0x3f, KEY_PROG3 },
-+ { (0x03 << 8) | 0x3f, KEY_PROG4 },
-+ { (0x04 << 8) | 0x3f, KEY_PC },
-+ { 0, KEY_RESERVED }
-+};
-+
-+struct ati_remote2 {
-+ struct input_dev *idev;
-+ struct usb_device *udev;
-+
-+ struct usb_interface *intf[2];
-+ struct usb_endpoint_descriptor *ep[2];
-+ struct urb *urb[2];
-+ void *buf[2];
-+ dma_addr_t buf_dma[2];
-+
-+ unsigned long jiffies;
-+ int mode;
-+
-+ char name[64];
-+ char phys[64];
-+};
-+
-+static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id);
-+static void ati_remote2_disconnect(struct usb_interface *interface);
-+
-+static struct usb_driver ati_remote2_driver = {
-+ .name = "ati_remote2",
-+ .probe = ati_remote2_probe,
-+ .disconnect = ati_remote2_disconnect,
-+ .id_table = ati_remote2_id_table,
-+};
-+
-+static int ati_remote2_open(struct input_dev *idev)
-+{
-+ struct ati_remote2 *ar2 = idev->private;
-+ int r;
-+
-+ r = usb_submit_urb(ar2->urb[0], GFP_KERNEL);
-+ if (r) {
-+ dev_err(&ar2->intf[0]->dev,
-+ "%s: usb_submit_urb() = %d\n", __FUNCTION__, r);
-+ return r;
-+ }
-+ r = usb_submit_urb(ar2->urb[1], GFP_KERNEL);
-+ if (r) {
-+ usb_kill_urb(ar2->urb[0]);
-+ dev_err(&ar2->intf[1]->dev,
-+ "%s: usb_submit_urb() = %d\n", __FUNCTION__, r);
-+ return r;
-+ }
-+
-+ return 0;
-+}
-+
-+static void ati_remote2_close(struct input_dev *idev)
-+{
-+ struct ati_remote2 *ar2 = idev->private;
-+
-+ usb_kill_urb(ar2->urb[0]);
-+ usb_kill_urb(ar2->urb[1]);
-+}
-+
-+static void ati_remote2_input_mouse(struct ati_remote2 *ar2, struct pt_regs *regs)
-+{
-+ struct input_dev *idev = ar2->idev;
-+ u8 *data = ar2->buf[0];
-+
-+ if (data[0] > 4) {
-+ dev_err(&ar2->intf[0]->dev,
-+ "Unknown mode byte (%02x %02x %02x %02x)\n",
-+ data[3], data[2], data[1], data[0]);
-+ return;
-+ }
-+
-+ if (!((1 << data[0]) & mode_mask))
-+ return;
-+
-+ input_regs(idev, regs);
-+ input_event(idev, EV_REL, REL_X, (s8) data[1]);
-+ input_event(idev, EV_REL, REL_Y, (s8) data[2]);
-+ input_sync(idev);
-+}
-+
-+static int ati_remote2_lookup(unsigned int hw_code)
-+{
-+ int i;
-+
-+ for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++)
-+ if (ati_remote2_key_table[i].hw_code == hw_code)
-+ return i;
-+
-+ return -1;
-+}
-+
-+static void ati_remote2_input_key(struct ati_remote2 *ar2, struct pt_regs *regs)
-+{
-+ struct input_dev *idev = ar2->idev;
-+ u8 *data = ar2->buf[1];
-+ int hw_code, index;
-+
-+ if (data[0] > 4) {
-+ dev_err(&ar2->intf[1]->dev,
-+ "Unknown mode byte (%02x %02x %02x %02x)\n",
-+ data[3], data[2], data[1], data[0]);
-+ return;
-+ }
-+
-+ hw_code = data[2];
-+ /*
-+ * Mode keys (AUX1-AUX4, PC) all generate the same code byte.
-+ * Use the mode byte to figure out which one was pressed.
-+ */
-+ if (hw_code == 0x3f) {
-+ /*
-+ * For some incomprehensible reason the mouse pad generates
-+ * events which look identical to the events from the last
-+ * pressed mode key. Naturally we don't want to generate key
-+ * events for the mouse pad so we filter out any subsequent
-+ * events from the same mode key.
-+ */
-+ if (ar2->mode == data[0])
-+ return;
-+
-+ if (data[1] == 0)
-+ ar2->mode = data[0];
-+
-+ hw_code |= data[0] << 8;
-+ }
-+
-+ if (!((1 << data[0]) & mode_mask))
-+ return;
-+
-+ index = ati_remote2_lookup(hw_code);
-+ if (index < 0) {
-+ dev_err(&ar2->intf[1]->dev,
-+ "Unknown code byte (%02x %02x %02x %02x)\n",
-+ data[3], data[2], data[1], data[0]);
-+ return;
-+ }
-+
-+ switch (data[1]) {
-+ case 0: /* release */
-+ break;
-+ case 1: /* press */
-+ ar2->jiffies = jiffies + msecs_to_jiffies(idev->rep[REP_DELAY]);
-+ break;
-+ case 2: /* repeat */
-+
-+ /* No repeat for mouse buttons. */
-+ if (ati_remote2_key_table[index].key_code == BTN_LEFT ||
-+ ati_remote2_key_table[index].key_code == BTN_RIGHT)
-+ return;
-+
-+ if (!time_after_eq(jiffies, ar2->jiffies))
-+ return;
-+
-+ ar2->jiffies = jiffies + msecs_to_jiffies(idev->rep[REP_PERIOD]);
-+ break;
-+ default:
-+ dev_err(&ar2->intf[1]->dev,
-+ "Unknown state byte (%02x %02x %02x %02x)\n",
-+ data[3], data[2], data[1], data[0]);
-+ return;
-+ }
-+
-+ input_regs(idev, regs);
-+ input_event(idev, EV_KEY, ati_remote2_key_table[index].key_code, data[1]);
-+ input_sync(idev);
-+}
-+
-+static void ati_remote2_complete_mouse(struct urb *urb, struct pt_regs *regs)
-+{
-+ struct ati_remote2 *ar2 = urb->context;
-+ int r;
-+
-+ switch (urb->status) {
-+ case 0:
-+ ati_remote2_input_mouse(ar2, regs);
-+ break;
-+ case -ENOENT:
-+ case -EILSEQ:
-+ case -ECONNRESET:
-+ case -ESHUTDOWN:
-+ dev_dbg(&ar2->intf[0]->dev,
-+ "%s(): urb status = %d\n", __FUNCTION__, urb->status);
-+ return;
-+ default:
-+ dev_err(&ar2->intf[0]->dev,
-+ "%s(): urb status = %d\n", __FUNCTION__, urb->status);
-+ }
-+
-+ r = usb_submit_urb(urb, GFP_ATOMIC);
-+ if (r)
-+ dev_err(&ar2->intf[0]->dev,
-+ "%s(): usb_submit_urb() = %d\n", __FUNCTION__, r);
-+}
-+
-+static void ati_remote2_complete_key(struct urb *urb, struct pt_regs *regs)
-+{
-+ struct ati_remote2 *ar2 = urb->context;
-+ int r;
-+
-+ switch (urb->status) {
-+ case 0:
-+ ati_remote2_input_key(ar2, regs);
-+ break;
-+ case -ENOENT:
-+ case -EILSEQ:
-+ case -ECONNRESET:
-+ case -ESHUTDOWN:
-+ dev_dbg(&ar2->intf[1]->dev,
-+ "%s(): urb status = %d\n", __FUNCTION__, urb->status);
-+ return;
-+ default:
-+ dev_err(&ar2->intf[1]->dev,
-+ "%s(): urb status = %d\n", __FUNCTION__, urb->status);
-+ }
-+
-+ r = usb_submit_urb(urb, GFP_ATOMIC);
-+ if (r)
-+ dev_err(&ar2->intf[1]->dev,
-+ "%s(): usb_submit_urb() = %d\n", __FUNCTION__, r);
-+}
-+
-+static int ati_remote2_input_init(struct ati_remote2 *ar2)
-+{
-+ struct input_dev *idev;
-+ int i;
-+
-+ idev = input_allocate_device();
-+ if (!idev)
-+ return -ENOMEM;
-+
-+ ar2->idev = idev;
-+ idev->private = ar2;
-+
-+ idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL);
-+ idev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
-+ idev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
-+ for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++)
-+ set_bit(ati_remote2_key_table[i].key_code, idev->keybit);
-+
-+ idev->rep[REP_DELAY] = 250;
-+ idev->rep[REP_PERIOD] = 33;
-+
-+ idev->open = ati_remote2_open;
-+ idev->close = ati_remote2_close;
-+
-+ idev->name = ar2->name;
-+ idev->phys = ar2->phys;
-+
-+ usb_to_input_id(ar2->udev, &idev->id);
-+ idev->cdev.dev = &ar2->udev->dev;
-+
-+ i = input_register_device(idev);
-+ if (i)
-+ input_free_device(idev);
-+
-+ return i;
-+}
-+
-+static int ati_remote2_urb_init(struct ati_remote2 *ar2)
-+{
-+ struct usb_device *udev = ar2->udev;
-+ int i, pipe, maxp;
-+
-+ for (i = 0; i < 2; i++) {
-+ ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
-+ if (!ar2->buf[i])
-+ return -ENOMEM;
-+
-+ ar2->urb[i] = usb_alloc_urb(0, GFP_KERNEL);
-+ if (!ar2->urb[i])
-+ return -ENOMEM;
-+
-+ pipe = usb_rcvintpipe(udev, ar2->ep[i]->bEndpointAddress);
-+ maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
-+ maxp = maxp > 4 ? 4 : maxp;
-+
-+ usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp,
-+ i ? ati_remote2_complete_key : ati_remote2_complete_mouse,
-+ ar2, ar2->ep[i]->bInterval);
-+ ar2->urb[i]->transfer_dma = ar2->buf_dma[i];
-+ ar2->urb[i]->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-+ }
-+
-+ return 0;
-+}
-+
-+static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
-+{
-+ int i;
-+
-+ for (i = 0; i < 2; i++) {
-+ if (ar2->urb[i])
-+ usb_free_urb(ar2->urb[i]);
-+
-+ if (ar2->buf[i])
-+ usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
-+ }
-+}
-+
-+static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id)
-+{
-+ struct usb_device *udev = interface_to_usbdev(interface);
-+ struct usb_host_interface *alt = interface->cur_altsetting;
-+ struct ati_remote2 *ar2;
-+ int r;
-+
-+ if (alt->desc.bInterfaceNumber)
-+ return -ENODEV;
-+
-+ ar2 = kzalloc(sizeof (struct ati_remote2), GFP_KERNEL);
-+ if (!ar2)
-+ return -ENOMEM;
-+
-+ ar2->udev = udev;
-+
-+ ar2->intf[0] = interface;
-+ ar2->ep[0] = &alt->endpoint[0].desc;
-+
-+ ar2->intf[1] = usb_ifnum_to_if(udev, 1);
-+ r = usb_driver_claim_interface(&ati_remote2_driver, ar2->intf[1], ar2);
-+ if (r)
-+ goto fail1;
-+ alt = ar2->intf[1]->cur_altsetting;
-+ ar2->ep[1] = &alt->endpoint[0].desc;
-+
-+ r = ati_remote2_urb_init(ar2);
-+ if (r)
-+ goto fail2;
-+
-+ usb_make_path(udev, ar2->phys, sizeof(ar2->phys));
-+ strlcat(ar2->phys, "/input0", sizeof(ar2->phys));
-+
-+ strlcat(ar2->name, "ATI Remote Wonder II", sizeof(ar2->name));
-+
-+ r = ati_remote2_input_init(ar2);
-+ if (r)
-+ goto fail2;
-+
-+ usb_set_intfdata(interface, ar2);
-+
-+ return 0;
-+
-+ fail2:
-+ ati_remote2_urb_cleanup(ar2);
-+
-+ usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]);
-+ fail1:
-+ kfree(ar2);
-+
-+ return r;
-+}
-+
-+static void ati_remote2_disconnect(struct usb_interface *interface)
-+{
-+ struct ati_remote2 *ar2;
-+ struct usb_host_interface *alt = interface->cur_altsetting;
-+
-+ if (alt->desc.bInterfaceNumber)
-+ return;
-+
-+ ar2 = usb_get_intfdata(interface);
-+ usb_set_intfdata(interface, NULL);
-+
-+ input_unregister_device(ar2->idev);
-+
-+ ati_remote2_urb_cleanup(ar2);
-+
-+ usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]);
-+
-+ kfree(ar2);
-+}
-+
-+static int __init ati_remote2_init(void)
-+{
-+ int r;
-+
-+ r = usb_register(&ati_remote2_driver);
-+ if (r)
-+ printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r);
-+ else
-+ printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n");
-+
-+ return r;
-+}
-+
-+static void __exit ati_remote2_exit(void)
-+{
-+ usb_deregister(&ati_remote2_driver);
-+}
-+
-+module_init(ati_remote2_init);
-+module_exit(ati_remote2_exit);
---- gregkh-2.6.orig/drivers/usb/input/Kconfig
-+++ gregkh-2.6/drivers/usb/input/Kconfig
-@@ -273,6 +273,20 @@ config USB_ATI_REMOTE
- To compile this driver as a module, choose M here: the module will be
- called ati_remote.
-
-+config USB_ATI_REMOTE2
-+ tristate "ATI / Philips USB RF remote control"
-+ depends on USB && INPUT
-+ ---help---
-+ Say Y here if you want to use an ATI or Philips USB RF remote control.
-+ These are RF remotes with USB receivers.
-+ ATI Remote Wonder II comes with some ATI's All-In-Wonder video cards
-+ and is also available as a separate product.
-+ This driver provides mouse pointer, left and right mouse buttons,
-+ and maps all the other remote buttons to keypress events.
-+
-+ To compile this driver as a module, choose M here: the module will be
-+ called ati_remote2.
-+
- config USB_KEYSPAN_REMOTE
- tristate "Keyspan DMR USB remote control (EXPERIMENTAL)"
- depends on USB && INPUT && EXPERIMENTAL
---- gregkh-2.6.orig/drivers/usb/input/Makefile
-+++ gregkh-2.6/drivers/usb/input/Makefile
-@@ -28,6 +28,7 @@ endif
-
- obj-$(CONFIG_USB_AIPTEK) += aiptek.o
- obj-$(CONFIG_USB_ATI_REMOTE) += ati_remote.o
-+obj-$(CONFIG_USB_ATI_REMOTE2) += ati_remote2.o
- obj-$(CONFIG_USB_HID) += usbhid.o
- obj-$(CONFIG_USB_KBD) += usbkbd.o
- obj-$(CONFIG_USB_KBTAB) += kbtab.o
diff --git a/usb/usb-asix.c-add-linksys-usb200m-rev-2-ids.patch b/usb/usb-asix.c-add-linksys-usb200m-rev-2-ids.patch
deleted file mode 100644
index 41922512223cc..0000000000000
--- a/usb/usb-asix.c-add-linksys-usb200m-rev-2-ids.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From dhollis@davehollis.com Mon Dec 19 11:01:27 2005
-From: David Hollis <dhollis@davehollis.com>
-Subject: USB: asix.c - Add Linksys USB200M Rev 2 ids
-To: Greg KH <greg@kroah.com>
-Date: Mon, 19 Dec 2005 13:58:38 -0500
-Message-Id: <1135018718.26911.3.camel@dhollis-lnx.sunera.com>
-
-Attached patch adds device IDs for the Linksys USB200M Rev 2 device
-which uses the AX88772 chipset.
-
-Signed-off-by: David Hollis <dhollis@davehollis.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/net/asix.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/net/asix.c
-+++ gregkh-2.6/drivers/usb/net/asix.c
-@@ -912,6 +912,10 @@ static const struct usb_device_id produc
- // ASIX AX88772 10/100
- USB_DEVICE (0x0b95, 0x7720),
- .driver_info = (unsigned long) &ax88772_info,
-+}, {
-+ // Linksys USB200M Rev 2
-+ USB_DEVICE (0x13b1, 0x0018),
-+ .driver_info = (unsigned long) &ax88772_info,
- },
- { }, // END
- };
diff --git a/usb/usb-ati_remote-use-time_before-and-friends.patch b/usb/usb-ati_remote-use-time_before-and-friends.patch
deleted file mode 100644
index 0c6c6b7d6ee4c..0000000000000
--- a/usb/usb-ati_remote-use-time_before-and-friends.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From adobriyan@gmail.com Wed Nov 30 13:41:31 2005
-Date: Thu, 1 Dec 2005 00:50:39 +0300
-From: Alexey Dobriyan <adobriyan@gmail.com>
-To: Greg Kroah-Hartman <gregkh@suse.de>
-Cc: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
-Subject: USB: ati_remote: use time_before() and friends
-Message-ID: <20051130215039.GF12551@mipter.zuzino.mipt.ru>
-Content-Disposition: inline
-
-From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
-
-They deal with wrapping correctly and are nicer to read.
-
-Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
-Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
----
- drivers/usb/input/ati_remote.c | 17 +++++++++--------
- 1 file changed, 9 insertions(+), 8 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/input/ati_remote.c
-+++ gregkh-2.6/drivers/usb/input/ati_remote.c
-@@ -96,6 +96,7 @@
- #include <linux/usb.h>
- #include <linux/usb_input.h>
- #include <linux/wait.h>
-+#include <linux/jiffies.h>
-
- /*
- * Module and Version Information, Module Parameters
-@@ -471,7 +472,7 @@ static void ati_remote_input_report(stru
- /* Filter duplicate events which happen "too close" together. */
- if ((ati_remote->old_data[0] == data[1]) &&
- (ati_remote->old_data[1] == data[2]) &&
-- ((ati_remote->old_jiffies + FILTER_TIME) > jiffies)) {
-+ time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) {
- ati_remote->repeat_count++;
- } else {
- ati_remote->repeat_count = 0;
-@@ -506,16 +507,16 @@ static void ati_remote_input_report(stru
- * pad down, so we increase acceleration, ramping up over two seconds to
- * a maximum speed. The acceleration curve is #defined above.
- */
-- if ((jiffies - ati_remote->old_jiffies) > (HZ >> 2)) {
-+ if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) {
- acc = 1;
- ati_remote->acc_jiffies = jiffies;
- }
-- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 3)) acc = accel[0];
-- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 2)) acc = accel[1];
-- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 1)) acc = accel[2];
-- else if ((jiffies - ati_remote->acc_jiffies) < HZ ) acc = accel[3];
-- else if ((jiffies - ati_remote->acc_jiffies) < HZ+(HZ>>1)) acc = accel[4];
-- else if ((jiffies - ati_remote->acc_jiffies) < (HZ << 1)) acc = accel[5];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3))) acc = accel[0];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2))) acc = accel[1];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1))) acc = accel[2];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + HZ)) acc = accel[3];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4];
-+ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1))) acc = accel[5];
- else acc = accel[6];
-
- input_regs(dev, regs);
diff --git a/usb/usb-cdc-acm-ring-queue.patch b/usb/usb-cdc-acm-ring-queue.patch
deleted file mode 100644
index a83513b632363..0000000000000
--- a/usb/usb-cdc-acm-ring-queue.patch
+++ /dev/null
@@ -1,524 +0,0 @@
-From oliver@neukum.org Tue Nov 1 21:18:21 2005
-From: Oliver Neukum <oliver@neukum.org>
-To: Greg KH <greg@kroah.com>, David Kubicek <dave@awk.cz>
-Subject: Converting cdc acm to a ring queue
-Date: Tue, 1 Nov 2005 18:51:34 +0100
-Content-Disposition: inline
-Message-Id: <200511011851.34625.oliver@neukum.org>
-
-From: David Kubicek <dave@awk.cz>
-
-this patch by David converts the sending queue of the CDC ACM driver
-to a queue of URBs. This is needed for quicker devices. Please apply.
-
-
-Signed-Off-By: Oliver Neukum <oliver@neukum.name>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
- drivers/usb/class/cdc-acm.c | 229 ++++++++++++++++++++++++++++++--------------
- drivers/usb/class/cdc-acm.h | 33 +++++-
- 2 files changed, 185 insertions(+), 77 deletions(-)
-
----
---- gregkh-2.6.orig/drivers/usb/class/cdc-acm.c
-+++ gregkh-2.6/drivers/usb/class/cdc-acm.c
-@@ -6,6 +6,7 @@
- * Copyright (c) 1999 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright (c) 2000 Vojtech Pavlik <vojtech@suse.cz>
- * Copyright (c) 2004 Oliver Neukum <oliver@neukum.name>
-+ * Copyright (c) 2005 David Kubicek <dave@awk.cz>
- *
- * USB Abstract Control Model driver for USB modems and ISDN adapters
- *
-@@ -29,6 +30,7 @@
- * config we want, sysadmin changes bConfigurationValue in sysfs.
- * v0.23 - use softirq for rx processing, as needed by tty layer
- * v0.24 - change probe method to evaluate CDC union descriptor
-+ * v0.25 - downstream tasks paralelized to maximize throughput
- */
-
- /*
-@@ -63,14 +65,15 @@
- #include <linux/usb_cdc.h>
- #include <asm/byteorder.h>
- #include <asm/unaligned.h>
-+#include <linux/list.h>
-
- #include "cdc-acm.h"
-
- /*
- * Version Information
- */
--#define DRIVER_VERSION "v0.23"
--#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik"
-+#define DRIVER_VERSION "v0.25"
-+#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik, David Kubicek"
- #define DRIVER_DESC "USB Abstract Control Model driver for USB modems and ISDN adapters"
-
- static struct usb_driver acm_driver;
-@@ -284,7 +287,9 @@ exit:
- /* data interface returns incoming bytes, or we got unthrottled */
- static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
- {
-- struct acm *acm = urb->context;
-+ struct acm_rb *buf;
-+ struct acm_ru *rcv = urb->context;
-+ struct acm *acm = rcv->instance;
- dbg("Entering acm_read_bulk with status %d\n", urb->status);
-
- if (!ACM_READY(acm))
-@@ -293,49 +298,109 @@ static void acm_read_bulk(struct urb *ur
- if (urb->status)
- dev_dbg(&acm->data->dev, "bulk rx status %d\n", urb->status);
-
-- /* calling tty_flip_buffer_push() in_irq() isn't allowed */
-- tasklet_schedule(&acm->bh);
-+ buf = rcv->buffer;
-+ buf->size = urb->actual_length;
-+
-+ spin_lock(&acm->read_lock);
-+ list_add_tail(&rcv->list, &acm->spare_read_urbs);
-+ list_add_tail(&buf->list, &acm->filled_read_bufs);
-+ spin_unlock(&acm->read_lock);
-+
-+ tasklet_schedule(&acm->urb_task);
- }
-
- static void acm_rx_tasklet(unsigned long _acm)
- {
- struct acm *acm = (void *)_acm;
-- struct urb *urb = acm->readurb;
-+ struct acm_rb *buf;
- struct tty_struct *tty = acm->tty;
-- unsigned char *data = urb->transfer_buffer;
-+ struct acm_ru *rcv;
-+ //unsigned long flags;
- int i = 0;
- dbg("Entering acm_rx_tasklet");
-
-- if (urb->actual_length > 0 && !acm->throttle) {
-- for (i = 0; i < urb->actual_length && !acm->throttle; i++) {
-- /* if we insert more than TTY_FLIPBUF_SIZE characters,
-- * we drop them. */
-- if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
-- tty_flip_buffer_push(tty);
-- }
-- tty_insert_flip_char(tty, data[i], 0);
-- }
-- dbg("Handed %d bytes to tty layer", i+1);
-- tty_flip_buffer_push(tty);
-- }
-+ if (!ACM_READY(acm) || acm->throttle)
-+ return;
-+
-+next_buffer:
-+ spin_lock(&acm->read_lock);
-+ if (list_empty(&acm->filled_read_bufs)) {
-+ spin_unlock(&acm->read_lock);
-+ goto urbs;
-+ }
-+ buf = list_entry(acm->filled_read_bufs.next,
-+ struct acm_rb, list);
-+ list_del(&buf->list);
-+ spin_unlock(&acm->read_lock);
-+
-+ dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size);
-+
-+ for (i = 0; i < buf->size && !acm->throttle; i++) {
-+ /* if we insert more than TTY_FLIPBUF_SIZE characters,
-+ we drop them. */
-+ if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
-+ tty_flip_buffer_push(tty);
-+ }
-+ tty_insert_flip_char(tty, buf->base[i], 0);
-+ }
-+ tty_flip_buffer_push(tty);
-
- spin_lock(&acm->throttle_lock);
- if (acm->throttle) {
- dbg("Throtteling noticed");
-- memmove(data, data + i, urb->actual_length - i);
-- urb->actual_length -= i;
-- acm->resubmit_to_unthrottle = 1;
-+ memmove(buf->base, buf->base + i, buf->size - i);
-+ buf->size -= i;
- spin_unlock(&acm->throttle_lock);
-+ spin_lock(&acm->read_lock);
-+ list_add(&buf->list, &acm->filled_read_bufs);
-+ spin_unlock(&acm->read_lock);
- return;
- }
- spin_unlock(&acm->throttle_lock);
-
-- urb->actual_length = 0;
-- urb->dev = acm->dev;
--
-- i = usb_submit_urb(urb, GFP_ATOMIC);
-- if (i)
-- dev_dbg(&acm->data->dev, "bulk rx resubmit %d\n", i);
-+ spin_lock(&acm->read_lock);
-+ list_add(&buf->list, &acm->spare_read_bufs);
-+ spin_unlock(&acm->read_lock);
-+ goto next_buffer;
-+
-+urbs:
-+ while (!list_empty(&acm->spare_read_bufs)) {
-+ spin_lock(&acm->read_lock);
-+ if (list_empty(&acm->spare_read_urbs)) {
-+ spin_unlock(&acm->read_lock);
-+ return;
-+ }
-+ rcv = list_entry(acm->spare_read_urbs.next,
-+ struct acm_ru, list);
-+ list_del(&rcv->list);
-+ spin_unlock(&acm->read_lock);
-+
-+ buf = list_entry(acm->spare_read_bufs.next,
-+ struct acm_rb, list);
-+ list_del(&buf->list);
-+
-+ rcv->buffer = buf;
-+
-+ usb_fill_bulk_urb(rcv->urb, acm->dev,
-+ acm->rx_endpoint,
-+ buf->base,
-+ acm->readsize,
-+ acm_read_bulk, rcv);
-+ rcv->urb->transfer_dma = buf->dma;
-+ rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-+
-+ dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf);
-+
-+ /* This shouldn't kill the driver as unsuccessful URBs are returned to the
-+ free-urbs-pool and resubmited ASAP */
-+ if (usb_submit_urb(rcv->urb, GFP_ATOMIC) < 0) {
-+ list_add(&buf->list, &acm->spare_read_bufs);
-+ spin_lock(&acm->read_lock);
-+ list_add(&rcv->list, &acm->spare_read_urbs);
-+ spin_unlock(&acm->read_lock);
-+ return;
-+ }
-+ }
- }
-
- /* data interface wrote those outgoing bytes */
-@@ -369,6 +434,7 @@ static int acm_tty_open(struct tty_struc
- {
- struct acm *acm;
- int rv = -EINVAL;
-+ int i;
- dbg("Entering acm_tty_open.\n");
-
- down(&open_sem);
-@@ -382,7 +448,9 @@ static int acm_tty_open(struct tty_struc
- tty->driver_data = acm;
- acm->tty = tty;
-
--
-+ /* force low_latency on so that our tty_push actually forces the data through,
-+ otherwise it is scheduled, and with high data rates data can get lost. */
-+ tty->low_latency = 1;
-
- if (acm->used++) {
- goto done;
-@@ -394,18 +462,20 @@ static int acm_tty_open(struct tty_struc
- goto bail_out;
- }
-
-- acm->readurb->dev = acm->dev;
-- if (usb_submit_urb(acm->readurb, GFP_KERNEL)) {
-- dbg("usb_submit_urb(read bulk) failed");
-- goto bail_out_and_unlink;
-- }
--
- if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS))
- goto full_bailout;
-
-- /* force low_latency on so that our tty_push actually forces the data through,
-- otherwise it is scheduled, and with high data rates data can get lost. */
-- tty->low_latency = 1;
-+ INIT_LIST_HEAD(&acm->spare_read_urbs);
-+ INIT_LIST_HEAD(&acm->spare_read_bufs);
-+ INIT_LIST_HEAD(&acm->filled_read_bufs);
-+ for (i = 0; i < ACM_NRU; i++) {
-+ list_add(&(acm->ru[i].list), &acm->spare_read_urbs);
-+ }
-+ for (i = 0; i < ACM_NRB; i++) {
-+ list_add(&(acm->rb[i].list), &acm->spare_read_bufs);
-+ }
-+
-+ tasklet_schedule(&acm->urb_task);
-
- done:
- err_out:
-@@ -413,8 +483,6 @@ err_out:
- return rv;
-
- full_bailout:
-- usb_kill_urb(acm->readurb);
--bail_out_and_unlink:
- usb_kill_urb(acm->ctrlurb);
- bail_out:
- acm->used--;
-@@ -424,18 +492,22 @@ bail_out:
-
- static void acm_tty_unregister(struct acm *acm)
- {
-+ int i;
-+
- tty_unregister_device(acm_tty_driver, acm->minor);
- usb_put_intf(acm->control);
- acm_table[acm->minor] = NULL;
- usb_free_urb(acm->ctrlurb);
-- usb_free_urb(acm->readurb);
- usb_free_urb(acm->writeurb);
-+ for (i = 0; i < ACM_NRU; i++)
-+ usb_free_urb(acm->ru[i].urb);
- kfree(acm);
- }
-
- static void acm_tty_close(struct tty_struct *tty, struct file *filp)
- {
- struct acm *acm = tty->driver_data;
-+ int i;
-
- if (!acm || !acm->used)
- return;
-@@ -446,7 +518,8 @@ static void acm_tty_close(struct tty_str
- acm_set_control(acm, acm->ctrlout = 0);
- usb_kill_urb(acm->ctrlurb);
- usb_kill_urb(acm->writeurb);
-- usb_kill_urb(acm->readurb);
-+ for (i = 0; i < ACM_NRU; i++)
-+ usb_kill_urb(acm->ru[i].urb);
- } else
- acm_tty_unregister(acm);
- }
-@@ -528,10 +601,7 @@ static void acm_tty_unthrottle(struct tt
- spin_lock_bh(&acm->throttle_lock);
- acm->throttle = 0;
- spin_unlock_bh(&acm->throttle_lock);
-- if (acm->resubmit_to_unthrottle) {
-- acm->resubmit_to_unthrottle = 0;
-- acm_read_bulk(acm->readurb, NULL);
-- }
-+ tasklet_schedule(&acm->urb_task);
- }
-
- static void acm_tty_break_ctl(struct tty_struct *tty, int state)
-@@ -694,6 +764,7 @@ static int acm_probe (struct usb_interfa
- int call_interface_num = -1;
- int data_interface_num;
- unsigned long quirks;
-+ int i;
-
- /* handle quirks deadly to normal probing*/
- quirks = (unsigned long)id->driver_info;
-@@ -833,7 +904,7 @@ skip_normal_probe:
- }
-
- ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize);
-- readsize = le16_to_cpu(epread->wMaxPacketSize);
-+ readsize = le16_to_cpu(epread->wMaxPacketSize)*2;
- acm->writesize = le16_to_cpu(epwrite->wMaxPacketSize);
- acm->control = control_interface;
- acm->data = data_interface;
-@@ -842,12 +913,14 @@ skip_normal_probe:
- acm->ctrl_caps = ac_management_function;
- acm->ctrlsize = ctrlsize;
- acm->readsize = readsize;
-- acm->bh.func = acm_rx_tasklet;
-- acm->bh.data = (unsigned long) acm;
-+ acm->urb_task.func = acm_rx_tasklet;
-+ acm->urb_task.data = (unsigned long) acm;
- INIT_WORK(&acm->work, acm_softint, acm);
- spin_lock_init(&acm->throttle_lock);
- spin_lock_init(&acm->write_lock);
-+ spin_lock_init(&acm->read_lock);
- acm->write_ready = 1;
-+ acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress);
-
- buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
- if (!buf) {
-@@ -856,13 +929,6 @@ skip_normal_probe:
- }
- acm->ctrl_buffer = buf;
-
-- buf = usb_buffer_alloc(usb_dev, readsize, GFP_KERNEL, &acm->read_dma);
-- if (!buf) {
-- dev_dbg(&intf->dev, "out of memory (read buffer alloc)\n");
-- goto alloc_fail3;
-- }
-- acm->read_buffer = buf;
--
- if (acm_write_buffers_alloc(acm) < 0) {
- dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n");
- goto alloc_fail4;
-@@ -873,10 +939,25 @@ skip_normal_probe:
- dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n");
- goto alloc_fail5;
- }
-- acm->readurb = usb_alloc_urb(0, GFP_KERNEL);
-- if (!acm->readurb) {
-- dev_dbg(&intf->dev, "out of memory (readurb kmalloc)\n");
-- goto alloc_fail6;
-+ for (i = 0; i < ACM_NRU; i++) {
-+ struct acm_ru *rcv = &(acm->ru[i]);
-+
-+ if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
-+ dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n");
-+ goto alloc_fail7;
-+ }
-+
-+ rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-+ rcv->instance = acm;
-+ }
-+ for (i = 0; i < ACM_NRB; i++) {
-+ struct acm_rb *buf = &(acm->rb[i]);
-+
-+ // Using usb_buffer_alloc instead of kmalloc as Oliver suggested
-+ if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
-+ dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n");
-+ goto alloc_fail7;
-+ }
- }
- acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
- if (!acm->writeurb) {
-@@ -889,15 +970,9 @@ skip_normal_probe:
- acm->ctrlurb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
- acm->ctrlurb->transfer_dma = acm->ctrl_dma;
-
-- usb_fill_bulk_urb(acm->readurb, usb_dev, usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress),
-- acm->read_buffer, readsize, acm_read_bulk, acm);
-- acm->readurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP;
-- acm->readurb->transfer_dma = acm->read_dma;
--
- usb_fill_bulk_urb(acm->writeurb, usb_dev, usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
- NULL, acm->writesize, acm_write_bulk, acm);
- acm->writeurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP;
-- /* acm->writeurb->transfer_dma = 0; */
-
- dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor);
-
-@@ -917,14 +992,14 @@ skip_normal_probe:
- return 0;
-
- alloc_fail7:
-- usb_free_urb(acm->readurb);
--alloc_fail6:
-+ for (i = 0; i < ACM_NRB; i++)
-+ usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma);
-+ for (i = 0; i < ACM_NRU; i++)
-+ usb_free_urb(acm->ru[i].urb);
- usb_free_urb(acm->ctrlurb);
- alloc_fail5:
- acm_write_buffers_free(acm);
- alloc_fail4:
-- usb_buffer_free(usb_dev, readsize, acm->read_buffer, acm->read_dma);
--alloc_fail3:
- usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
- alloc_fail2:
- kfree(acm);
-@@ -936,6 +1011,7 @@ static void acm_disconnect(struct usb_in
- {
- struct acm *acm = usb_get_intfdata (intf);
- struct usb_device *usb_dev = interface_to_usbdev(intf);
-+ int i;
-
- if (!acm || !acm->dev) {
- dbg("disconnect on nonexisting interface");
-@@ -946,15 +1022,24 @@ static void acm_disconnect(struct usb_in
- acm->dev = NULL;
- usb_set_intfdata (intf, NULL);
-
-+ tasklet_disable(&acm->urb_task);
-+
- usb_kill_urb(acm->ctrlurb);
-- usb_kill_urb(acm->readurb);
- usb_kill_urb(acm->writeurb);
-+ for (i = 0; i < ACM_NRU; i++)
-+ usb_kill_urb(acm->ru[i].urb);
-+
-+ INIT_LIST_HEAD(&acm->filled_read_bufs);
-+ INIT_LIST_HEAD(&acm->spare_read_bufs);
-+
-+ tasklet_enable(&acm->urb_task);
-
- flush_scheduled_work(); /* wait for acm_softint */
-
- acm_write_buffers_free(acm);
-- usb_buffer_free(usb_dev, acm->readsize, acm->read_buffer, acm->read_dma);
- usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
-+ for (i = 0; i < ACM_NRB; i++)
-+ usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma);
-
- usb_driver_release_interface(&acm_driver, acm->data);
-
---- gregkh-2.6.orig/drivers/usb/class/cdc-acm.h
-+++ gregkh-2.6/drivers/usb/class/cdc-acm.h
-@@ -59,6 +59,9 @@
- * when processing onlcr, so we only need 2 buffers.
- */
- #define ACM_NWB 2
-+#define ACM_NRU 16
-+#define ACM_NRB 16
-+
- struct acm_wb {
- unsigned char *buf;
- dma_addr_t dmah;
-@@ -66,22 +69,43 @@ struct acm_wb {
- int use;
- };
-
-+struct acm_rb {
-+ struct list_head list;
-+ int size;
-+ unsigned char *base;
-+ dma_addr_t dma;
-+};
-+
-+struct acm_ru {
-+ struct list_head list;
-+ struct acm_rb *buffer;
-+ struct urb *urb;
-+ struct acm *instance;
-+};
-+
- struct acm {
- struct usb_device *dev; /* the corresponding usb device */
- struct usb_interface *control; /* control interface */
- struct usb_interface *data; /* data interface */
- struct tty_struct *tty; /* the corresponding tty */
-- struct urb *ctrlurb, *readurb, *writeurb; /* urbs */
-- u8 *ctrl_buffer, *read_buffer; /* buffers of urbs */
-- dma_addr_t ctrl_dma, read_dma; /* dma handles of buffers */
-+ struct urb *ctrlurb, *writeurb; /* urbs */
-+ u8 *ctrl_buffer; /* buffers of urbs */
-+ dma_addr_t ctrl_dma; /* dma handles of buffers */
- struct acm_wb wb[ACM_NWB];
-+ struct acm_ru ru[ACM_NRU];
-+ struct acm_rb rb[ACM_NRB];
-+ int rx_endpoint;
-+ spinlock_t read_lock;
-+ struct list_head spare_read_urbs;
-+ struct list_head spare_read_bufs;
-+ struct list_head filled_read_bufs;
- int write_current; /* current write buffer */
- int write_used; /* number of non-empty write buffers */
- int write_ready; /* write urb is not running */
- spinlock_t write_lock;
- struct usb_cdc_line_coding line; /* bits, stop, parity */
- struct work_struct work; /* work queue entry for line discipline waking up */
-- struct tasklet_struct bh; /* rx processing */
-+ struct tasklet_struct urb_task; /* rx processing */
- spinlock_t throttle_lock; /* synchronize throtteling and read callback */
- unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
- unsigned int ctrlout; /* output control lines (DTR, RTS) */
-@@ -91,7 +115,6 @@ struct acm {
- unsigned int minor; /* acm minor number */
- unsigned char throttle; /* throttled by tty layer */
- unsigned char clocal; /* termios CLOCAL */
-- unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */
- unsigned int ctrl_caps; /* control capabilities from the class specific header */
- };
-
diff --git a/usb/usb-cleanups-for-usb-gadget-mass-storage.patch b/usb/usb-cleanups-for-usb-gadget-mass-storage.patch
deleted file mode 100644
index 204dc4c5345ad..0000000000000
--- a/usb/usb-cleanups-for-usb-gadget-mass-storage.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From stern@rowland.harvard.edu Sun Nov 27 06:49:40 2005
-Date: Sun, 27 Nov 2005 09:47:28 -0500 (EST)
-From: Pavel Machek <pavel@ucw.cz>
-To: Greg KH <greg@kroah.com>
-CC: <mtd@centrum.cz>
-Subject: USB: Cleanups for usb gadget mass-storage
-Message-ID: <Pine.LNX.4.44L0.0511270946350.6263-100000@netrider.rowland.org>
-
-Remove useless initalizers.
-
-Signed-off-by: Pavel Machek <pavel@suse.cz>
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-
-
----
- drivers/usb/gadget/file_storage.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/gadget/file_storage.c
-+++ gregkh-2.6/drivers/usb/gadget/file_storage.c
-@@ -336,8 +336,8 @@ MODULE_LICENSE("Dual BSD/GPL");
- #define MAX_LUNS 8
-
- /* Arggh! There should be a module_param_array_named macro! */
--static char *file[MAX_LUNS] = {NULL, };
--static int ro[MAX_LUNS] = {0, };
-+static char *file[MAX_LUNS];
-+static int ro[MAX_LUNS];
-
- static struct {
- int num_filenames;
diff --git a/usb/usb-don-t-allocate-dma-pools-for-pio-hcds.patch b/usb/usb-don-t-allocate-dma-pools-for-pio-hcds.patch
deleted file mode 100644
index 2344765011175..0000000000000
--- a/usb/usb-don-t-allocate-dma-pools-for-pio-hcds.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From david-b@pacbell.net Mon Nov 28 09:33:38 2005
-From: Chris Humbert <mahadri-kernel@drigon.com>
-Subject: USB: don't allocate dma pools for PIO HCDs
-Date: Mon, 28 Nov 2005 09:29:23 -0800
-Cc: David Brownell <david-b@pacbell.net>
-Content-Disposition: inline
-Message-Id: <200511280929.23666.david-b@pacbell.net>
-
-USB: don't allocate dma pools for PIO HCDs
-
-hcd_buffer_alloc() and hcd_buffer_free() have a similar dma_mask
-check and revert to kmalloc()/kfree(), but hcd_buffer_create()
-doesn't check dma_mask and allocates unused dma pools.
-
-Signed-off-by: Chris Humbert <mahadri-kernel@drigon.com>
-Acked-by: David Brownell <david-b@pacbell.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/buffer.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/core/buffer.c
-+++ gregkh-2.6/drivers/usb/core/buffer.c
-@@ -55,6 +55,9 @@ int hcd_buffer_create (struct usb_hcd *h
- char name [16];
- int i, size;
-
-+ if (!hcd->self.controller->dma_mask)
-+ return 0;
-+
- for (i = 0; i < HCD_BUFFER_POOLS; i++) {
- if (!(size = pool_max [i]))
- continue;
diff --git a/usb/usb-don-t-assume-root-hub-resume-succeeds.patch b/usb/usb-don-t-assume-root-hub-resume-succeeds.patch
deleted file mode 100644
index cf270812e49d0..0000000000000
--- a/usb/usb-don-t-assume-root-hub-resume-succeeds.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From stern@rowland.harvard.edu Tue Nov 29 09:17:12 2005
-Date: Tue, 29 Nov 2005 12:13:31 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: USB: Don't assume root-hub resume succeeds
-Message-ID: <Pine.LNX.4.44L0.0511291208260.4602-100000@iolanthe.rowland.org>
-
-This patch (as614) makes a small change to the part of the hub driver
-responsible for remote wakeup of root hubs. When these wakeups occur
-the driver is suspended, and in case the resume fails the driver should
-remain suspended -- it shouldn't try to proceed with its normal
-processing.
-
-This will hardly ever matter in normal use, but it did crop up while I
-was debugging a different problem.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/hub.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/core/hub.c
-+++ gregkh-2.6/drivers/usb/core/hub.c
-@@ -2697,6 +2697,8 @@ static void hub_events(void)
- if (i) {
- dpm_runtime_resume(&hdev->dev);
- dpm_runtime_resume(&intf->dev);
-+ usb_put_intf(intf);
-+ continue;
- }
-
- /* Lock the device, then check to see if we were
diff --git a/usb/usb-driver-owner-removal.patch b/usb/usb-driver-owner-removal.patch
deleted file mode 100644
index b3b6691c8c138..0000000000000
--- a/usb/usb-driver-owner-removal.patch
+++ /dev/null
@@ -1,1364 +0,0 @@
-From foo@baz.org Tue Nov 22 09:58:23 2005
-Date: Mon, 21 Nov 2005 14:53:03 -0800
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: USB: remove .owner field from struct usb_driver
-
-It is no longer needed, so let's remove it, saving a bit of memory.
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/block/ub.c | 1 -
- drivers/bluetooth/bcm203x.c | 1 -
- drivers/bluetooth/bfusb.c | 1 -
- drivers/bluetooth/bpa10x.c | 1 -
- drivers/bluetooth/hci_usb.c | 1 -
- drivers/char/watchdog/pcwd_usb.c | 1 -
- drivers/input/joystick/iforce/iforce-usb.c | 1 -
- drivers/isdn/hisax/hfc_usb.c | 1 -
- drivers/isdn/hisax/st5481_init.c | 1 -
- drivers/media/dvb/b2c2/flexcop-usb.c | 1 -
- drivers/media/dvb/cinergyT2/cinergyT2.c | 1 -
- drivers/media/dvb/dvb-usb/a800.c | 1 -
- drivers/media/dvb/dvb-usb/cxusb.c | 1 -
- drivers/media/dvb/dvb-usb/dibusb-mb.c | 1 -
- drivers/media/dvb/dvb-usb/dibusb-mc.c | 1 -
- drivers/media/dvb/dvb-usb/digitv.c | 1 -
- drivers/media/dvb/dvb-usb/dtt200u.c | 1 -
- drivers/media/dvb/dvb-usb/nova-t-usb2.c | 1 -
- drivers/media/dvb/dvb-usb/umt-010.c | 1 -
- drivers/media/dvb/dvb-usb/vp702x.c | 1 -
- drivers/media/dvb/dvb-usb/vp7045.c | 1 -
- drivers/media/video/cpia_usb.c | 1 -
- drivers/media/video/em28xx/em28xx-video.c | 1 -
- drivers/net/irda/irda-usb.c | 1 -
- drivers/net/irda/stir4200.c | 1 -
- drivers/usb/atm/cxacru.c | 1 -
- drivers/usb/atm/speedtch.c | 1 -
- drivers/usb/atm/ueagle-atm.c | 1 -
- drivers/usb/atm/xusbatm.c | 1 -
- drivers/usb/class/cdc-acm.c | 1 -
- drivers/usb/class/usblp.c | 1 -
- drivers/usb/core/devio.c | 1 -
- drivers/usb/core/hub.c | 1 -
- drivers/usb/image/mdc800.c | 1 -
- drivers/usb/image/microtek.c | 1 -
- drivers/usb/input/acecad.c | 1 -
- drivers/usb/input/aiptek.c | 1 -
- drivers/usb/input/appletouch.c | 1 -
- drivers/usb/input/ati_remote.c | 1 -
- drivers/usb/input/hid-core.c | 1 -
- drivers/usb/input/hiddev.c | 1 -
- drivers/usb/input/itmtouch.c | 1 -
- drivers/usb/input/kbtab.c | 1 -
- drivers/usb/input/keyspan_remote.c | 1 -
- drivers/usb/input/mtouchusb.c | 1 -
- drivers/usb/input/powermate.c | 1 -
- drivers/usb/input/touchkitusb.c | 1 -
- drivers/usb/input/usbkbd.c | 1 -
- drivers/usb/input/usbmouse.c | 1 -
- drivers/usb/input/wacom.c | 1 -
- drivers/usb/input/xpad.c | 1 -
- drivers/usb/input/yealink.c | 1 -
- drivers/usb/media/dabusb.c | 1 -
- drivers/usb/media/dsbr100.c | 1 -
- drivers/usb/media/ov511.c | 1 -
- drivers/usb/media/pwc/pwc-if.c | 1 -
- drivers/usb/media/se401.c | 1 -
- drivers/usb/media/sn9c102_core.c | 1 -
- drivers/usb/media/stv680.c | 1 -
- drivers/usb/media/vicam.c | 1 -
- drivers/usb/media/w9968cf.c | 1 -
- drivers/usb/misc/auerswald.c | 1 -
- drivers/usb/misc/cytherm.c | 1 -
- drivers/usb/misc/emi26.c | 1 -
- drivers/usb/misc/emi62.c | 1 -
- drivers/usb/misc/idmouse.c | 1 -
- drivers/usb/misc/ldusb.c | 1 -
- drivers/usb/misc/legousbtower.c | 1 -
- drivers/usb/misc/phidgetkit.c | 1 -
- drivers/usb/misc/phidgetservo.c | 1 -
- drivers/usb/misc/rio500.c | 1 -
- drivers/usb/misc/sisusbvga/sisusb.c | 1 -
- drivers/usb/misc/usblcd.c | 1 -
- drivers/usb/misc/usbled.c | 1 -
- drivers/usb/misc/usbtest.c | 1 -
- drivers/usb/misc/uss720.c | 1 -
- drivers/usb/net/asix.c | 1 -
- drivers/usb/net/catc.c | 1 -
- drivers/usb/net/cdc_ether.c | 1 -
- drivers/usb/net/cdc_subset.c | 1 -
- drivers/usb/net/gl620a.c | 1 -
- drivers/usb/net/kaweth.c | 1 -
- drivers/usb/net/net1080.c | 1 -
- drivers/usb/net/plusb.c | 1 -
- drivers/usb/net/rndis_host.c | 1 -
- drivers/usb/net/rtl8150.c | 1 -
- drivers/usb/net/zaurus.c | 1 -
- drivers/usb/net/zd1201.c | 1 -
- drivers/usb/serial/airprime.c | 1 -
- drivers/usb/serial/anydata.c | 1 -
- drivers/usb/serial/belkin_sa.c | 1 -
- drivers/usb/serial/cp2101.c | 1 -
- drivers/usb/serial/cyberjack.c | 1 -
- drivers/usb/serial/digi_acceleport.c | 1 -
- drivers/usb/serial/empeg.c | 1 -
- drivers/usb/serial/garmin_gps.c | 1 -
- drivers/usb/serial/generic.c | 1 -
- drivers/usb/serial/hp4x.c | 1 -
- drivers/usb/serial/io_edgeport.c | 1 -
- drivers/usb/serial/io_ti.c | 1 -
- drivers/usb/serial/ipaq.c | 1 -
- drivers/usb/serial/ipw.c | 1 -
- drivers/usb/serial/ir-usb.c | 1 -
- drivers/usb/serial/keyspan.h | 1 -
- drivers/usb/serial/keyspan_pda.c | 1 -
- drivers/usb/serial/kl5kusb105.c | 1 -
- drivers/usb/serial/kobil_sct.c | 1 -
- drivers/usb/serial/mct_u232.c | 1 -
- drivers/usb/serial/omninet.c | 1 -
- drivers/usb/serial/option.c | 1 -
- drivers/usb/serial/pl2303.c | 1 -
- drivers/usb/serial/safe_serial.c | 1 -
- drivers/usb/serial/ti_usb_3410_5052.c | 1 -
- drivers/usb/serial/usb-serial.c | 1 -
- drivers/usb/serial/visor.c | 1 -
- drivers/usb/serial/whiteheat.c | 1 -
- drivers/usb/storage/libusual.c | 1 -
- drivers/usb/storage/usb.c | 1 -
- drivers/usb/usb-skeleton.c | 1 -
- include/linux/usb.h | 4 ----
- sound/usb/usbaudio.c | 1 -
- sound/usb/usx2y/usbusx2y.c | 1 -
- 122 files changed, 125 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/devio.c
-+++ gregkh-2.6/drivers/usb/core/devio.c
-@@ -402,7 +402,6 @@ static void driver_disconnect(struct usb
- }
-
- struct usb_driver usbfs_driver = {
-- .owner = THIS_MODULE,
- .name = "usbfs",
- .probe = driver_probe,
- .disconnect = driver_disconnect,
---- gregkh-2.6.orig/drivers/usb/core/hub.c
-+++ gregkh-2.6/drivers/usb/core/hub.c
-@@ -2865,7 +2865,6 @@ static struct usb_device_id hub_id_table
- MODULE_DEVICE_TABLE (usb, hub_id_table);
-
- static struct usb_driver hub_driver = {
-- .owner = THIS_MODULE,
- .name = "hub",
- .probe = hub_probe,
- .disconnect = hub_disconnect,
---- gregkh-2.6.orig/include/linux/usb.h
-+++ gregkh-2.6/include/linux/usb.h
-@@ -536,8 +536,6 @@ struct usb_dynids {
-
- /**
- * struct usb_driver - identifies USB driver to usbcore
-- * @owner: Pointer to the module owner of this driver; initialize
-- * it using THIS_MODULE.
- * @name: The driver name should be unique among USB drivers,
- * and should normally be the same as the module name.
- * @probe: Called to see if the driver is willing to manage a particular
-@@ -580,8 +578,6 @@ struct usb_dynids {
- * them as necessary, and blocking until the unlinks complete).
- */
- struct usb_driver {
-- struct module *owner;
--
- const char *name;
-
- int (*probe) (struct usb_interface *intf,
---- gregkh-2.6.orig/drivers/usb/serial/airprime.c
-+++ gregkh-2.6/drivers/usb/serial/airprime.c
-@@ -23,7 +23,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE(usb, id_table);
-
- static struct usb_driver airprime_driver = {
-- .owner = THIS_MODULE,
- .name = "airprime",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/anydata.c
-+++ gregkh-2.6/drivers/usb/serial/anydata.c
-@@ -27,7 +27,6 @@ static int buffer_size;
- static int debug;
-
- static struct usb_driver anydata_driver = {
-- .owner = THIS_MODULE,
- .name = "anydata",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/belkin_sa.c
-+++ gregkh-2.6/drivers/usb/serial/belkin_sa.c
-@@ -113,7 +113,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver belkin_driver = {
-- .owner = THIS_MODULE,
- .name = "belkin",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/cp2101.c
-+++ gregkh-2.6/drivers/usb/serial/cp2101.c
-@@ -67,7 +67,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver cp2101_driver = {
-- .owner = THIS_MODULE,
- .name = "cp2101",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/cyberjack.c
-+++ gregkh-2.6/drivers/usb/serial/cyberjack.c
-@@ -76,7 +76,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver cyberjack_driver = {
-- .owner = THIS_MODULE,
- .name = "cyberjack",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/digi_acceleport.c
-+++ gregkh-2.6/drivers/usb/serial/digi_acceleport.c
-@@ -493,7 +493,6 @@ static struct usb_device_id id_table_4 [
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver digi_driver = {
-- .owner = THIS_MODULE,
- .name = "digi_acceleport",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/empeg.c
-+++ gregkh-2.6/drivers/usb/serial/empeg.c
-@@ -105,7 +105,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver empeg_driver = {
-- .owner = THIS_MODULE,
- .name = "empeg",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/garmin_gps.c
-+++ gregkh-2.6/drivers/usb/serial/garmin_gps.c
-@@ -222,7 +222,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver garmin_driver = {
-- .owner = THIS_MODULE,
- .name = "garmin_gps",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/generic.c
-+++ gregkh-2.6/drivers/usb/serial/generic.c
-@@ -68,7 +68,6 @@ static int generic_probe(struct usb_inte
- }
-
- static struct usb_driver generic_driver = {
-- .owner = THIS_MODULE,
- .name = "usbserial_generic",
- .probe = generic_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/hp4x.c
-+++ gregkh-2.6/drivers/usb/serial/hp4x.c
-@@ -37,7 +37,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE(usb, id_table);
-
- static struct usb_driver hp49gp_driver = {
-- .owner = THIS_MODULE,
- .name = "hp4X",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/io_edgeport.c
-+++ gregkh-2.6/drivers/usb/serial/io_edgeport.c
-@@ -242,7 +242,6 @@ static void edge_shutdown (struct usb_s
- #include "io_tables.h" /* all of the devices that this driver supports */
-
- static struct usb_driver io_driver = {
-- .owner = THIS_MODULE,
- .name = "io_edgeport",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/io_ti.c
-+++ gregkh-2.6/drivers/usb/serial/io_ti.c
-@@ -216,7 +216,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver io_driver = {
-- .owner = THIS_MODULE,
- .name = "io_ti",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/ipaq.c
-+++ gregkh-2.6/drivers/usb/serial/ipaq.c
-@@ -542,7 +542,6 @@ static struct usb_device_id ipaq_id_tabl
- MODULE_DEVICE_TABLE (usb, ipaq_id_table);
-
- static struct usb_driver ipaq_driver = {
-- .owner = THIS_MODULE,
- .name = "ipaq",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/ipw.c
-+++ gregkh-2.6/drivers/usb/serial/ipw.c
-@@ -152,7 +152,6 @@ static struct usb_device_id usb_ipw_ids[
- MODULE_DEVICE_TABLE(usb, usb_ipw_ids);
-
- static struct usb_driver usb_ipw_driver = {
-- .owner = THIS_MODULE,
- .name = "ipwtty",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/ir-usb.c
-+++ gregkh-2.6/drivers/usb/serial/ir-usb.c
-@@ -125,7 +125,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver ir_driver = {
-- .owner = THIS_MODULE,
- .name = "ir-usb",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/keyspan_pda.c
-+++ gregkh-2.6/drivers/usb/serial/keyspan_pda.c
-@@ -150,7 +150,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver keyspan_pda_driver = {
-- .owner = THIS_MODULE,
- .name = "keyspan_pda",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/kl5kusb105.c
-+++ gregkh-2.6/drivers/usb/serial/kl5kusb105.c
-@@ -116,7 +116,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver kl5kusb105d_driver = {
-- .owner = THIS_MODULE,
- .name = "kl5kusb105d",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/kobil_sct.c
-+++ gregkh-2.6/drivers/usb/serial/kobil_sct.c
-@@ -97,7 +97,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver kobil_driver = {
-- .owner = THIS_MODULE,
- .name = "kobil",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/mct_u232.c
-+++ gregkh-2.6/drivers/usb/serial/mct_u232.c
-@@ -125,7 +125,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver mct_u232_driver = {
-- .owner = THIS_MODULE,
- .name = "mct_u232",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/omninet.c
-+++ gregkh-2.6/drivers/usb/serial/omninet.c
-@@ -80,7 +80,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver omninet_driver = {
-- .owner = THIS_MODULE,
- .name = "omninet",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/option.c
-+++ gregkh-2.6/drivers/usb/serial/option.c
-@@ -95,7 +95,6 @@ static struct usb_device_id option_ids[]
- MODULE_DEVICE_TABLE(usb, option_ids);
-
- static struct usb_driver option_driver = {
-- .owner = THIS_MODULE,
- .name = "option",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/pl2303.c
-+++ gregkh-2.6/drivers/usb/serial/pl2303.c
-@@ -82,7 +82,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver pl2303_driver = {
-- .owner = THIS_MODULE,
- .name = "pl2303",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/safe_serial.c
-+++ gregkh-2.6/drivers/usb/serial/safe_serial.c
-@@ -160,7 +160,6 @@ static struct usb_device_id id_table[] =
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver safe_driver = {
-- .owner = THIS_MODULE,
- .name = "safe_serial",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/ti_usb_3410_5052.c
-+++ gregkh-2.6/drivers/usb/serial/ti_usb_3410_5052.c
-@@ -248,7 +248,6 @@ static struct usb_device_id ti_id_table_
- };
-
- static struct usb_driver ti_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "ti_usb_3410_5052",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c
-+++ gregkh-2.6/drivers/usb/serial/usb-serial.c
-@@ -42,7 +42,6 @@
-
- /* Driver structure we register with the USB core */
- static struct usb_driver usb_serial_driver = {
-- .owner = THIS_MODULE,
- .name = "usbserial",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/visor.c
-+++ gregkh-2.6/drivers/usb/serial/visor.c
-@@ -173,7 +173,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver visor_driver = {
-- .owner = THIS_MODULE,
- .name = "visor",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/whiteheat.c
-+++ gregkh-2.6/drivers/usb/serial/whiteheat.c
-@@ -127,7 +127,6 @@ static struct usb_device_id id_table_com
- MODULE_DEVICE_TABLE (usb, id_table_combined);
-
- static struct usb_driver whiteheat_driver = {
-- .owner = THIS_MODULE,
- .name = "whiteheat",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/serial/keyspan.h
-+++ gregkh-2.6/drivers/usb/serial/keyspan.h
-@@ -520,7 +520,6 @@ static struct usb_device_id keyspan_ids_
- MODULE_DEVICE_TABLE(usb, keyspan_ids_combined);
-
- static struct usb_driver keyspan_driver = {
-- .owner = THIS_MODULE,
- .name = "keyspan",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
---- gregkh-2.6.orig/drivers/usb/usb-skeleton.c
-+++ gregkh-2.6/drivers/usb/usb-skeleton.c
-@@ -330,7 +330,6 @@ static void skel_disconnect(struct usb_i
- }
-
- static struct usb_driver skel_driver = {
-- .owner = THIS_MODULE,
- .name = "skeleton",
- .probe = skel_probe,
- .disconnect = skel_disconnect,
---- gregkh-2.6.orig/drivers/usb/atm/cxacru.c
-+++ gregkh-2.6/drivers/usb/atm/cxacru.c
-@@ -853,7 +853,6 @@ static int cxacru_usb_probe(struct usb_i
- }
-
- static struct usb_driver cxacru_usb_driver = {
-- .owner = THIS_MODULE,
- .name = cxacru_driver_name,
- .probe = cxacru_usb_probe,
- .disconnect = usbatm_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/atm/speedtch.c
-+++ gregkh-2.6/drivers/usb/atm/speedtch.c
-@@ -659,7 +659,6 @@ MODULE_DEVICE_TABLE(usb, speedtch_usb_id
- static int speedtch_usb_probe(struct usb_interface *, const struct usb_device_id *);
-
- static struct usb_driver speedtch_usb_driver = {
-- .owner = THIS_MODULE,
- .name = speedtch_driver_name,
- .probe = speedtch_usb_probe,
- .disconnect = usbatm_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/atm/ueagle-atm.c
-+++ gregkh-2.6/drivers/usb/atm/ueagle-atm.c
-@@ -1776,7 +1776,6 @@ static const struct usb_device_id uea_id
- * USB driver descriptor
- */
- static struct usb_driver uea_driver = {
-- .owner = THIS_MODULE,
- .name = "ueagle-atm",
- .id_table = uea_ids,
- .probe = uea_probe,
---- gregkh-2.6.orig/drivers/usb/atm/xusbatm.c
-+++ gregkh-2.6/drivers/usb/atm/xusbatm.c
-@@ -140,7 +140,6 @@ static int xusbatm_usb_probe(struct usb_
- }
-
- static struct usb_driver xusbatm_usb_driver = {
-- .owner = THIS_MODULE,
- .name = xusbatm_driver_name,
- .probe = xusbatm_usb_probe,
- .disconnect = usbatm_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/class/cdc-acm.c
-+++ gregkh-2.6/drivers/usb/class/cdc-acm.c
-@@ -1088,7 +1088,6 @@ static struct usb_device_id acm_ids[] =
- MODULE_DEVICE_TABLE (usb, acm_ids);
-
- static struct usb_driver acm_driver = {
-- .owner = THIS_MODULE,
- .name = "cdc_acm",
- .probe = acm_probe,
- .disconnect = acm_disconnect,
---- gregkh-2.6.orig/drivers/usb/class/usblp.c
-+++ gregkh-2.6/drivers/usb/class/usblp.c
-@@ -1186,7 +1186,6 @@ static struct usb_device_id usblp_ids []
- MODULE_DEVICE_TABLE (usb, usblp_ids);
-
- static struct usb_driver usblp_driver = {
-- .owner = THIS_MODULE,
- .name = "usblp",
- .probe = usblp_probe,
- .disconnect = usblp_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/acecad.c
-+++ gregkh-2.6/drivers/usb/input/acecad.c
-@@ -261,7 +261,6 @@ static struct usb_device_id usb_acecad_i
- MODULE_DEVICE_TABLE(usb, usb_acecad_id_table);
-
- static struct usb_driver usb_acecad_driver = {
-- .owner = THIS_MODULE,
- .name = "usb_acecad",
- .probe = usb_acecad_probe,
- .disconnect = usb_acecad_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/aiptek.c
-+++ gregkh-2.6/drivers/usb/input/aiptek.c
-@@ -2190,7 +2190,6 @@ fail1: input_free_device(inputdev);
- static void aiptek_disconnect(struct usb_interface *intf);
-
- static struct usb_driver aiptek_driver = {
-- .owner = THIS_MODULE,
- .name = "aiptek",
- .probe = aiptek_probe,
- .disconnect = aiptek_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/appletouch.c
-+++ gregkh-2.6/drivers/usb/input/appletouch.c
-@@ -452,7 +452,6 @@ static int atp_resume(struct usb_interfa
- }
-
- static struct usb_driver atp_driver = {
-- .owner = THIS_MODULE,
- .name = "appletouch",
- .probe = atp_probe,
- .disconnect = atp_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/ati_remote.c
-+++ gregkh-2.6/drivers/usb/input/ati_remote.c
-@@ -295,7 +295,6 @@ static void ati_remote_disconnect (struc
-
- /* usb specific object to register with the usb subsystem */
- static struct usb_driver ati_remote_driver = {
-- .owner = THIS_MODULE,
- .name = "ati_remote",
- .probe = ati_remote_probe,
- .disconnect = ati_remote_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/hid-core.c
-+++ gregkh-2.6/drivers/usb/input/hid-core.c
-@@ -1930,7 +1930,6 @@ static struct usb_device_id hid_usb_ids
- MODULE_DEVICE_TABLE (usb, hid_usb_ids);
-
- static struct usb_driver hid_driver = {
-- .owner = THIS_MODULE,
- .name = "usbhid",
- .probe = hid_probe,
- .disconnect = hid_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/hiddev.c
-+++ gregkh-2.6/drivers/usb/input/hiddev.c
-@@ -826,7 +826,6 @@ static int hiddev_usbd_probe(struct usb_
-
-
- static /* const */ struct usb_driver hiddev_driver = {
-- .owner = THIS_MODULE,
- .name = "hiddev",
- .probe = hiddev_usbd_probe,
- };
---- gregkh-2.6.orig/drivers/usb/input/itmtouch.c
-+++ gregkh-2.6/drivers/usb/input/itmtouch.c
-@@ -250,7 +250,6 @@ static void itmtouch_disconnect(struct u
- MODULE_DEVICE_TABLE(usb, itmtouch_ids);
-
- static struct usb_driver itmtouch_driver = {
-- .owner = THIS_MODULE,
- .name = "itmtouch",
- .probe = itmtouch_probe,
- .disconnect = itmtouch_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/kbtab.c
-+++ gregkh-2.6/drivers/usb/input/kbtab.c
-@@ -197,7 +197,6 @@ static void kbtab_disconnect(struct usb_
- }
-
- static struct usb_driver kbtab_driver = {
-- .owner = THIS_MODULE,
- .name = "kbtab",
- .probe = kbtab_probe,
- .disconnect = kbtab_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/keyspan_remote.c
-+++ gregkh-2.6/drivers/usb/input/keyspan_remote.c
-@@ -559,7 +559,6 @@ static void keyspan_disconnect(struct us
- */
- static struct usb_driver keyspan_driver =
- {
-- .owner = THIS_MODULE,
- .name = "keyspan_remote",
- .probe = keyspan_probe,
- .disconnect = keyspan_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/mtouchusb.c
-+++ gregkh-2.6/drivers/usb/input/mtouchusb.c
-@@ -310,7 +310,6 @@ static void mtouchusb_disconnect(struct
- MODULE_DEVICE_TABLE(usb, mtouchusb_devices);
-
- static struct usb_driver mtouchusb_driver = {
-- .owner = THIS_MODULE,
- .name = "mtouchusb",
- .probe = mtouchusb_probe,
- .disconnect = mtouchusb_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/powermate.c
-+++ gregkh-2.6/drivers/usb/input/powermate.c
-@@ -441,7 +441,6 @@ static struct usb_device_id powermate_de
- MODULE_DEVICE_TABLE (usb, powermate_devices);
-
- static struct usb_driver powermate_driver = {
-- .owner = THIS_MODULE,
- .name = "powermate",
- .probe = powermate_probe,
- .disconnect = powermate_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/touchkitusb.c
-+++ gregkh-2.6/drivers/usb/input/touchkitusb.c
-@@ -267,7 +267,6 @@ static void touchkit_disconnect(struct u
- MODULE_DEVICE_TABLE(usb, touchkit_devices);
-
- static struct usb_driver touchkit_driver = {
-- .owner = THIS_MODULE,
- .name = "touchkitusb",
- .probe = touchkit_probe,
- .disconnect = touchkit_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/usbkbd.c
-+++ gregkh-2.6/drivers/usb/input/usbkbd.c
-@@ -345,7 +345,6 @@ static struct usb_device_id usb_kbd_id_t
- MODULE_DEVICE_TABLE (usb, usb_kbd_id_table);
-
- static struct usb_driver usb_kbd_driver = {
-- .owner = THIS_MODULE,
- .name = "usbkbd",
- .probe = usb_kbd_probe,
- .disconnect = usb_kbd_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/usbmouse.c
-+++ gregkh-2.6/drivers/usb/input/usbmouse.c
-@@ -226,7 +226,6 @@ static struct usb_device_id usb_mouse_id
- MODULE_DEVICE_TABLE (usb, usb_mouse_id_table);
-
- static struct usb_driver usb_mouse_driver = {
-- .owner = THIS_MODULE,
- .name = "usbmouse",
- .probe = usb_mouse_probe,
- .disconnect = usb_mouse_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/wacom.c
-+++ gregkh-2.6/drivers/usb/input/wacom.c
-@@ -945,7 +945,6 @@ static void wacom_disconnect(struct usb_
- }
-
- static struct usb_driver wacom_driver = {
-- .owner = THIS_MODULE,
- .name = "wacom",
- .probe = wacom_probe,
- .disconnect = wacom_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/xpad.c
-+++ gregkh-2.6/drivers/usb/input/xpad.c
-@@ -316,7 +316,6 @@ static void xpad_disconnect(struct usb_i
- }
-
- static struct usb_driver xpad_driver = {
-- .owner = THIS_MODULE,
- .name = "xpad",
- .probe = xpad_probe,
- .disconnect = xpad_disconnect,
---- gregkh-2.6.orig/drivers/usb/input/yealink.c
-+++ gregkh-2.6/drivers/usb/input/yealink.c
-@@ -987,7 +987,6 @@ static int usb_probe(struct usb_interfac
- }
-
- static struct usb_driver yealink_driver = {
-- .owner = THIS_MODULE,
- .name = "yealink",
- .probe = usb_probe,
- .disconnect = usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/image/mdc800.c
-+++ gregkh-2.6/drivers/usb/image/mdc800.c
-@@ -962,7 +962,6 @@ MODULE_DEVICE_TABLE (usb, mdc800_table);
- */
- static struct usb_driver mdc800_usb_driver =
- {
-- .owner = THIS_MODULE,
- .name = "mdc800",
- .probe = mdc800_usb_probe,
- .disconnect = mdc800_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/image/microtek.c
-+++ gregkh-2.6/drivers/usb/image/microtek.c
-@@ -160,7 +160,6 @@ static void mts_usb_disconnect(struct us
- static struct usb_device_id mts_usb_ids [];
-
- static struct usb_driver mts_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "microtekX6",
- .probe = mts_usb_probe,
- .disconnect = mts_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/dabusb.c
-+++ gregkh-2.6/drivers/usb/media/dabusb.c
-@@ -812,7 +812,6 @@ static struct usb_device_id dabusb_ids [
- MODULE_DEVICE_TABLE (usb, dabusb_ids);
-
- static struct usb_driver dabusb_driver = {
-- .owner = THIS_MODULE,
- .name = "dabusb",
- .probe = dabusb_probe,
- .disconnect = dabusb_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/dsbr100.c
-+++ gregkh-2.6/drivers/usb/media/dsbr100.c
-@@ -150,7 +150,6 @@ MODULE_DEVICE_TABLE (usb, usb_dsbr100_de
-
- /* USB subsystem interface */
- static struct usb_driver usb_dsbr100_driver = {
-- .owner = THIS_MODULE,
- .name = "dsbr100",
- .probe = usb_dsbr100_probe,
- .disconnect = usb_dsbr100_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/ov511.c
-+++ gregkh-2.6/drivers/usb/media/ov511.c
-@@ -6008,7 +6008,6 @@ ov51x_disconnect(struct usb_interface *i
- }
-
- static struct usb_driver ov511_driver = {
-- .owner = THIS_MODULE,
- .name = "ov511",
- .id_table = device_table,
- .probe = ov51x_probe,
---- gregkh-2.6.orig/drivers/usb/media/se401.c
-+++ gregkh-2.6/drivers/usb/media/se401.c
-@@ -1401,7 +1401,6 @@ static void se401_disconnect(struct usb_
- }
-
- static struct usb_driver se401_driver = {
-- .owner = THIS_MODULE,
- .name = "se401",
- .id_table = device_table,
- .probe = se401_probe,
---- gregkh-2.6.orig/drivers/usb/media/sn9c102_core.c
-+++ gregkh-2.6/drivers/usb/media/sn9c102_core.c
-@@ -2711,7 +2711,6 @@ static void sn9c102_usb_disconnect(struc
-
-
- static struct usb_driver sn9c102_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "sn9c102",
- .id_table = sn9c102_id_table,
- .probe = sn9c102_usb_probe,
---- gregkh-2.6.orig/drivers/usb/media/stv680.c
-+++ gregkh-2.6/drivers/usb/media/stv680.c
-@@ -1477,7 +1477,6 @@ static void stv680_disconnect (struct us
- }
-
- static struct usb_driver stv680_driver = {
-- .owner = THIS_MODULE,
- .name = "stv680",
- .probe = stv680_probe,
- .disconnect = stv680_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/vicam.c
-+++ gregkh-2.6/drivers/usb/media/vicam.c
-@@ -1257,7 +1257,6 @@ static struct usb_device_id vicam_table[
- MODULE_DEVICE_TABLE(usb, vicam_table);
-
- static struct usb_driver vicam_driver = {
-- .owner = THIS_MODULE,
- .name = "vicam",
- .probe = vicam_probe,
- .disconnect = vicam_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/pwc/pwc-if.c
-+++ gregkh-2.6/drivers/usb/media/pwc/pwc-if.c
-@@ -111,7 +111,6 @@ static int usb_pwc_probe(struct usb_inte
- static void usb_pwc_disconnect(struct usb_interface *intf);
-
- static struct usb_driver pwc_driver = {
-- .owner = THIS_MODULE,
- .name = "Philips webcam", /* name */
- .id_table = pwc_device_table,
- .probe = usb_pwc_probe, /* probe() */
---- gregkh-2.6.orig/drivers/usb/storage/libusual.c
-+++ gregkh-2.6/drivers/usb/storage/libusual.c
-@@ -155,7 +155,6 @@ static void usu_disconnect(struct usb_in
- }
-
- static struct usb_driver usu_driver = {
-- .owner = THIS_MODULE,
- .name = "libusual",
- .probe = usu_probe,
- .disconnect = usu_disconnect,
---- gregkh-2.6.orig/drivers/usb/storage/usb.c
-+++ gregkh-2.6/drivers/usb/storage/usb.c
-@@ -1000,7 +1000,6 @@ static void storage_disconnect(struct us
- ***********************************************************************/
-
- static struct usb_driver usb_storage_driver = {
-- .owner = THIS_MODULE,
- .name = "usb-storage",
- .probe = storage_probe,
- .disconnect = storage_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/auerswald.c
-+++ gregkh-2.6/drivers/usb/misc/auerswald.c
-@@ -2103,7 +2103,6 @@ MODULE_DEVICE_TABLE (usb, auerswald_ids)
-
- /* Standard usb driver struct */
- static struct usb_driver auerswald_driver = {
-- .owner = THIS_MODULE,
- .name = "auerswald",
- .probe = auerswald_probe,
- .disconnect = auerswald_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/cytherm.c
-+++ gregkh-2.6/drivers/usb/misc/cytherm.c
-@@ -50,7 +50,6 @@ static void cytherm_disconnect(struct us
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver cytherm_driver = {
-- .owner = THIS_MODULE,
- .name = "cytherm",
- .probe = cytherm_probe,
- .disconnect = cytherm_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/emi26.c
-+++ gregkh-2.6/drivers/usb/misc/emi26.c
-@@ -227,7 +227,6 @@ static void emi26_disconnect(struct usb_
- }
-
- static struct usb_driver emi26_driver = {
-- .owner = THIS_MODULE,
- .name = "emi26 - firmware loader",
- .probe = emi26_probe,
- .disconnect = emi26_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/emi62.c
-+++ gregkh-2.6/drivers/usb/misc/emi62.c
-@@ -266,7 +266,6 @@ static void emi62_disconnect(struct usb_
- }
-
- static struct usb_driver emi62_driver = {
-- .owner = THIS_MODULE,
- .name = "emi62 - firmware loader",
- .probe = emi62_probe,
- .disconnect = emi62_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/idmouse.c
-+++ gregkh-2.6/drivers/usb/misc/idmouse.c
-@@ -114,7 +114,6 @@ static struct usb_class_driver idmouse_c
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver idmouse_driver = {
-- .owner = THIS_MODULE,
- .name = DRIVER_SHORT,
- .probe = idmouse_probe,
- .disconnect = idmouse_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/ldusb.c
-+++ gregkh-2.6/drivers/usb/misc/ldusb.c
-@@ -763,7 +763,6 @@ static void ld_usb_disconnect(struct usb
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver ld_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "ldusb",
- .probe = ld_usb_probe,
- .disconnect = ld_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/legousbtower.c
-+++ gregkh-2.6/drivers/usb/misc/legousbtower.c
-@@ -282,7 +282,6 @@ static struct usb_class_driver tower_cla
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver tower_driver = {
-- .owner = THIS_MODULE,
- .name = "legousbtower",
- .probe = tower_probe,
- .disconnect = tower_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/phidgetkit.c
-+++ gregkh-2.6/drivers/usb/misc/phidgetkit.c
-@@ -555,7 +555,6 @@ static void interfacekit_disconnect(stru
- }
-
- static struct usb_driver interfacekit_driver = {
-- .owner = THIS_MODULE,
- .name = "phidgetkit",
- .probe = interfacekit_probe,
- .disconnect = interfacekit_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/phidgetservo.c
-+++ gregkh-2.6/drivers/usb/misc/phidgetservo.c
-@@ -306,7 +306,6 @@ servo_disconnect(struct usb_interface *i
- }
-
- static struct usb_driver servo_driver = {
-- .owner = THIS_MODULE,
- .name = "phidgetservo",
- .probe = servo_probe,
- .disconnect = servo_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/rio500.c
-+++ gregkh-2.6/drivers/usb/misc/rio500.c
-@@ -522,7 +522,6 @@ static struct usb_device_id rio_table []
- MODULE_DEVICE_TABLE (usb, rio_table);
-
- static struct usb_driver rio_driver = {
-- .owner = THIS_MODULE,
- .name = "rio500",
- .probe = probe_rio,
- .disconnect = disconnect_rio,
---- gregkh-2.6.orig/drivers/usb/misc/usblcd.c
-+++ gregkh-2.6/drivers/usb/misc/usblcd.c
-@@ -371,7 +371,6 @@ static void lcd_disconnect(struct usb_in
- }
-
- static struct usb_driver lcd_driver = {
-- .owner = THIS_MODULE,
- .name = "usblcd",
- .probe = lcd_probe,
- .disconnect = lcd_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/usbled.c
-+++ gregkh-2.6/drivers/usb/misc/usbled.c
-@@ -148,7 +148,6 @@ static void led_disconnect(struct usb_in
- }
-
- static struct usb_driver led_driver = {
-- .owner = THIS_MODULE,
- .name = "usbled",
- .probe = led_probe,
- .disconnect = led_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/usbtest.c
-+++ gregkh-2.6/drivers/usb/misc/usbtest.c
-@@ -2134,7 +2134,6 @@ static struct usb_device_id id_table []
- MODULE_DEVICE_TABLE (usb, id_table);
-
- static struct usb_driver usbtest_driver = {
-- .owner = THIS_MODULE,
- .name = "usbtest",
- .id_table = id_table,
- .probe = usbtest_probe,
---- gregkh-2.6.orig/drivers/usb/misc/uss720.c
-+++ gregkh-2.6/drivers/usb/misc/uss720.c
-@@ -780,7 +780,6 @@ MODULE_DEVICE_TABLE (usb, uss720_table);
-
-
- static struct usb_driver uss720_driver = {
-- .owner = THIS_MODULE,
- .name = "uss720",
- .probe = uss720_probe,
- .disconnect = uss720_disconnect,
---- gregkh-2.6.orig/drivers/usb/misc/sisusbvga/sisusb.c
-+++ gregkh-2.6/drivers/usb/misc/sisusbvga/sisusb.c
-@@ -3489,7 +3489,6 @@ static struct usb_device_id sisusb_table
- MODULE_DEVICE_TABLE (usb, sisusb_table);
-
- static struct usb_driver sisusb_driver = {
-- .owner = THIS_MODULE,
- .name = "sisusb",
- .probe = sisusb_probe,
- .disconnect = sisusb_disconnect,
---- gregkh-2.6.orig/drivers/usb/net/asix.c
-+++ gregkh-2.6/drivers/usb/net/asix.c
-@@ -918,7 +918,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver asix_driver = {
-- .owner = THIS_MODULE,
- .name = "asix",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/catc.c
-+++ gregkh-2.6/drivers/usb/net/catc.c
-@@ -934,7 +934,6 @@ static struct usb_device_id catc_id_tabl
- MODULE_DEVICE_TABLE(usb, catc_id_table);
-
- static struct usb_driver catc_driver = {
-- .owner = THIS_MODULE,
- .name = driver_name,
- .probe = catc_probe,
- .disconnect = catc_disconnect,
---- gregkh-2.6.orig/drivers/usb/net/cdc_ether.c
-+++ gregkh-2.6/drivers/usb/net/cdc_ether.c
-@@ -476,7 +476,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver cdc_driver = {
-- .owner = THIS_MODULE,
- .name = "cdc_ether",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/cdc_subset.c
-+++ gregkh-2.6/drivers/usb/net/cdc_subset.c
-@@ -306,7 +306,6 @@ MODULE_DEVICE_TABLE(usb, products);
- /*-------------------------------------------------------------------------*/
-
- static struct usb_driver cdc_subset_driver = {
-- .owner = THIS_MODULE,
- .name = "cdc_subset",
- .probe = usbnet_probe,
- .suspend = usbnet_suspend,
---- gregkh-2.6.orig/drivers/usb/net/gl620a.c
-+++ gregkh-2.6/drivers/usb/net/gl620a.c
-@@ -377,7 +377,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver gl620a_driver = {
-- .owner = THIS_MODULE,
- .name = "gl620a",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/kaweth.c
-+++ gregkh-2.6/drivers/usb/net/kaweth.c
-@@ -175,7 +175,6 @@ MODULE_DEVICE_TABLE (usb, usb_klsi_table
- * kaweth_driver
- ****************************************************************/
- static struct usb_driver kaweth_driver = {
-- .owner = THIS_MODULE,
- .name = driver_name,
- .probe = kaweth_probe,
- .disconnect = kaweth_disconnect,
---- gregkh-2.6.orig/drivers/usb/net/net1080.c
-+++ gregkh-2.6/drivers/usb/net/net1080.c
-@@ -593,7 +593,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver net1080_driver = {
-- .owner = THIS_MODULE,
- .name = "net1080",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/plusb.c
-+++ gregkh-2.6/drivers/usb/net/plusb.c
-@@ -127,7 +127,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver plusb_driver = {
-- .owner = THIS_MODULE,
- .name = "plusb",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/rndis_host.c
-+++ gregkh-2.6/drivers/usb/net/rndis_host.c
-@@ -586,7 +586,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver rndis_driver = {
-- .owner = THIS_MODULE,
- .name = "rndis_host",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/rtl8150.c
-+++ gregkh-2.6/drivers/usb/net/rtl8150.c
-@@ -177,7 +177,6 @@ static int rtl8150_probe(struct usb_inte
- static const char driver_name [] = "rtl8150";
-
- static struct usb_driver rtl8150_driver = {
-- .owner = THIS_MODULE,
- .name = driver_name,
- .probe = rtl8150_probe,
- .disconnect = rtl8150_disconnect,
---- gregkh-2.6.orig/drivers/usb/net/zaurus.c
-+++ gregkh-2.6/drivers/usb/net/zaurus.c
-@@ -357,7 +357,6 @@ static const struct usb_device_id produc
- MODULE_DEVICE_TABLE(usb, products);
-
- static struct usb_driver zaurus_driver = {
-- .owner = THIS_MODULE,
- .name = "zaurus",
- .id_table = products,
- .probe = usbnet_probe,
---- gregkh-2.6.orig/drivers/usb/net/zd1201.c
-+++ gregkh-2.6/drivers/usb/net/zd1201.c
-@@ -1923,7 +1923,6 @@ static int zd1201_resume(struct usb_inte
- #endif
-
- static struct usb_driver zd1201_usb = {
-- .owner = THIS_MODULE,
- .name = "zd1201",
- .probe = zd1201_probe,
- .disconnect = zd1201_disconnect,
---- gregkh-2.6.orig/drivers/block/ub.c
-+++ gregkh-2.6/drivers/block/ub.c
-@@ -2460,7 +2460,6 @@ static void ub_disconnect(struct usb_int
- }
-
- static struct usb_driver ub_driver = {
-- .owner = THIS_MODULE,
- .name = "ub",
- .probe = ub_probe,
- .disconnect = ub_disconnect,
---- gregkh-2.6.orig/sound/usb/usbaudio.c
-+++ gregkh-2.6/sound/usb/usbaudio.c
-@@ -1996,7 +1996,6 @@ static struct usb_device_id usb_audio_id
- MODULE_DEVICE_TABLE (usb, usb_audio_ids);
-
- static struct usb_driver usb_audio_driver = {
-- .owner = THIS_MODULE,
- .name = "snd-usb-audio",
- .probe = usb_audio_probe,
- .disconnect = usb_audio_disconnect,
---- gregkh-2.6.orig/drivers/bluetooth/bcm203x.c
-+++ gregkh-2.6/drivers/bluetooth/bcm203x.c
-@@ -275,7 +275,6 @@ static void bcm203x_disconnect(struct us
- }
-
- static struct usb_driver bcm203x_driver = {
-- .owner = THIS_MODULE,
- .name = "bcm203x",
- .probe = bcm203x_probe,
- .disconnect = bcm203x_disconnect,
---- gregkh-2.6.orig/drivers/bluetooth/bfusb.c
-+++ gregkh-2.6/drivers/bluetooth/bfusb.c
-@@ -768,7 +768,6 @@ static void bfusb_disconnect(struct usb_
- }
-
- static struct usb_driver bfusb_driver = {
-- .owner = THIS_MODULE,
- .name = "bfusb",
- .probe = bfusb_probe,
- .disconnect = bfusb_disconnect,
---- gregkh-2.6.orig/drivers/bluetooth/bpa10x.c
-+++ gregkh-2.6/drivers/bluetooth/bpa10x.c
-@@ -619,7 +619,6 @@ static void bpa10x_disconnect(struct usb
- }
-
- static struct usb_driver bpa10x_driver = {
-- .owner = THIS_MODULE,
- .name = "bpa10x",
- .probe = bpa10x_probe,
- .disconnect = bpa10x_disconnect,
---- gregkh-2.6.orig/drivers/bluetooth/hci_usb.c
-+++ gregkh-2.6/drivers/bluetooth/hci_usb.c
-@@ -1044,7 +1044,6 @@ static void hci_usb_disconnect(struct us
- }
-
- static struct usb_driver hci_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "hci_usb",
- .probe = hci_usb_probe,
- .disconnect = hci_usb_disconnect,
---- gregkh-2.6.orig/sound/usb/usx2y/usbusx2y.c
-+++ gregkh-2.6/sound/usb/usx2y/usbusx2y.c
-@@ -409,7 +409,6 @@ static void snd_usX2Y_disconnect(struct
-
- MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);
- static struct usb_driver snd_usX2Y_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "snd-usb-usx2y",
- .probe = snd_usX2Y_probe,
- .disconnect = snd_usX2Y_disconnect,
---- gregkh-2.6.orig/drivers/media/dvb/b2c2/flexcop-usb.c
-+++ gregkh-2.6/drivers/media/dvb/b2c2/flexcop-usb.c
-@@ -544,7 +544,6 @@ static struct usb_device_id flexcop_usb_
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver flexcop_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "b2c2_flexcop_usb",
- .probe = flexcop_usb_probe,
- .disconnect = flexcop_usb_disconnect,
---- gregkh-2.6.orig/drivers/media/dvb/cinergyT2/cinergyT2.c
-+++ gregkh-2.6/drivers/media/dvb/cinergyT2/cinergyT2.c
-@@ -986,7 +986,6 @@ static const struct usb_device_id cinerg
- MODULE_DEVICE_TABLE(usb, cinergyt2_table);
-
- static struct usb_driver cinergyt2_driver = {
-- .owner = THIS_MODULE,
- .name = "cinergyT2",
- .probe = cinergyt2_probe,
- .disconnect = cinergyt2_disconnect,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/a800.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/a800.c
-@@ -144,7 +144,6 @@ static struct dvb_usb_properties a800_pr
- };
-
- static struct usb_driver a800_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_a800",
- .probe = a800_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/cxusb.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/cxusb.c
-@@ -241,7 +241,6 @@ static struct dvb_usb_properties cxusb_p
- };
-
- static struct usb_driver cxusb_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_cxusb",
- .probe = cxusb_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/dibusb-mb.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/dibusb-mb.c
-@@ -373,7 +373,6 @@ static struct dvb_usb_properties artec_t
- };
-
- static struct usb_driver dibusb_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_dibusb_mb",
- .probe = dibusb_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/dibusb-mc.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/dibusb-mc.c
-@@ -82,7 +82,6 @@ static struct dvb_usb_properties dibusb_
- };
-
- static struct usb_driver dibusb_mc_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_dibusb_mc",
- .probe = dibusb_mc_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/digitv.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/digitv.c
-@@ -233,7 +233,6 @@ static struct dvb_usb_properties digitv_
- };
-
- static struct usb_driver digitv_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_digitv",
- .probe = digitv_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/dtt200u.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/dtt200u.c
-@@ -198,7 +198,6 @@ static struct dvb_usb_properties wt220u_
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver dtt200u_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_dtt200u",
- .probe = dtt200u_usb_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/nova-t-usb2.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/nova-t-usb2.c
-@@ -202,7 +202,6 @@ static struct dvb_usb_properties nova_t_
- };
-
- static struct usb_driver nova_t_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_nova_t_usb2",
- .probe = nova_t_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/umt-010.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/umt-010.c
-@@ -128,7 +128,6 @@ static struct dvb_usb_properties umt_pro
- };
-
- static struct usb_driver umt_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_umt_010",
- .probe = umt_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/vp702x.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/vp702x.c
-@@ -256,7 +256,6 @@ static struct dvb_usb_properties vp702x_
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver vp702x_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb-usb-vp702x",
- .probe = vp702x_usb_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/media/dvb/dvb-usb/vp7045.c
-+++ gregkh-2.6/drivers/media/dvb/dvb-usb/vp7045.c
-@@ -253,7 +253,6 @@ static struct dvb_usb_properties vp7045_
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver vp7045_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "dvb_usb_vp7045",
- .probe = vp7045_usb_probe,
- .disconnect = dvb_usb_device_exit,
---- gregkh-2.6.orig/drivers/isdn/hisax/hfc_usb.c
-+++ gregkh-2.6/drivers/isdn/hisax/hfc_usb.c
-@@ -1715,7 +1715,6 @@ hfc_usb_disconnect(struct usb_interface
- /* our driver information structure */
- /************************************/
- static struct usb_driver hfc_drv = {
-- .owner = THIS_MODULE,
- .name = "hfc_usb",
- .id_table = hfcusb_idtab,
- .probe = hfc_usb_probe,
---- gregkh-2.6.orig/drivers/isdn/hisax/st5481_init.c
-+++ gregkh-2.6/drivers/isdn/hisax/st5481_init.c
-@@ -180,7 +180,6 @@ static struct usb_device_id st5481_ids[]
- MODULE_DEVICE_TABLE (usb, st5481_ids);
-
- static struct usb_driver st5481_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "st5481_usb",
- .probe = probe_st5481,
- .disconnect = disconnect_st5481,
---- gregkh-2.6.orig/drivers/media/video/cpia_usb.c
-+++ gregkh-2.6/drivers/media/video/cpia_usb.c
-@@ -582,7 +582,6 @@ MODULE_LICENSE("GPL");
-
-
- static struct usb_driver cpia_driver = {
-- .owner = THIS_MODULE,
- .name = "cpia",
- .probe = cpia_probe,
- .disconnect = cpia_disconnect,
---- gregkh-2.6.orig/drivers/media/video/em28xx/em28xx-video.c
-+++ gregkh-2.6/drivers/media/video/em28xx/em28xx-video.c
-@@ -1884,7 +1884,6 @@ static void em28xx_usb_disconnect(struct
- }
-
- static struct usb_driver em28xx_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "em28xx",
- .probe = em28xx_usb_probe,
- .disconnect = em28xx_usb_disconnect,
---- gregkh-2.6.orig/drivers/net/irda/irda-usb.c
-+++ gregkh-2.6/drivers/net/irda/irda-usb.c
-@@ -1539,7 +1539,6 @@ static void irda_usb_disconnect(struct u
- * USB device callbacks
- */
- static struct usb_driver irda_driver = {
-- .owner = THIS_MODULE,
- .name = "irda-usb",
- .probe = irda_usb_probe,
- .disconnect = irda_usb_disconnect,
---- gregkh-2.6.orig/drivers/net/irda/stir4200.c
-+++ gregkh-2.6/drivers/net/irda/stir4200.c
-@@ -1152,7 +1152,6 @@ static int stir_resume(struct usb_interf
- * USB device callbacks
- */
- static struct usb_driver irda_driver = {
-- .owner = THIS_MODULE,
- .name = "stir4200",
- .probe = stir_probe,
- .disconnect = stir_disconnect,
---- gregkh-2.6.orig/drivers/char/watchdog/pcwd_usb.c
-+++ gregkh-2.6/drivers/char/watchdog/pcwd_usb.c
-@@ -151,7 +151,6 @@ static void usb_pcwd_disconnect (struct
-
- /* usb specific object needed to register this driver with the usb subsystem */
- static struct usb_driver usb_pcwd_driver = {
-- .owner = THIS_MODULE,
- .name = DRIVER_NAME,
- .probe = usb_pcwd_probe,
- .disconnect = usb_pcwd_disconnect,
---- gregkh-2.6.orig/drivers/input/joystick/iforce/iforce-usb.c
-+++ gregkh-2.6/drivers/input/joystick/iforce/iforce-usb.c
-@@ -235,7 +235,6 @@ static struct usb_device_id iforce_usb_i
- MODULE_DEVICE_TABLE (usb, iforce_usb_ids);
-
- struct usb_driver iforce_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "iforce",
- .probe = iforce_usb_probe,
- .disconnect = iforce_usb_disconnect,
---- gregkh-2.6.orig/drivers/usb/media/w9968cf.c
-+++ gregkh-2.6/drivers/usb/media/w9968cf.c
-@@ -3668,7 +3668,6 @@ static void w9968cf_usb_disconnect(struc
-
-
- static struct usb_driver w9968cf_usb_driver = {
-- .owner = THIS_MODULE,
- .name = "w9968cf",
- .id_table = winbond_id_table,
- .probe = w9968cf_usb_probe,
diff --git a/usb/usb-driver-owner.patch b/usb/usb-driver-owner.patch
deleted file mode 100644
index 727140c275886..0000000000000
--- a/usb/usb-driver-owner.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From foo@baz.org Tue Nov 22 09:58:23 2005
-Date: Mon, 21 Nov 2005 14:53:03 -0800
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: USB: make registering a usb driver automatically set the module owner
-
-This fixes the driver that forgot to set the module owner up. Now we
-can remove the unneeded pointer from the usb driver structure. The idea
-for how to do this was from Al Viro, who did this for the PCI drivers.
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/driver.c | 9 +++++----
- include/linux/usb.h | 6 +++++-
- 2 files changed, 10 insertions(+), 5 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/driver.c
-+++ gregkh-2.6/drivers/usb/core/driver.c
-@@ -404,8 +404,9 @@ int usb_device_match(struct device *dev,
- }
-
- /**
-- * usb_register - register a USB driver
-+ * usb_register_driver - register a USB driver
- * @new_driver: USB operations for the driver
-+ * @owner: module owner of this driver.
- *
- * Registers a USB driver with the USB core. The list of unattached
- * interfaces will be rescanned whenever a new driver is added, allowing
-@@ -416,7 +417,7 @@ int usb_device_match(struct device *dev,
- * usb_register_dev() to enable that functionality. This function no longer
- * takes care of that.
- */
--int usb_register(struct usb_driver *new_driver)
-+int usb_register_driver(struct usb_driver *new_driver, struct module *owner)
- {
- int retval = 0;
-
-@@ -427,7 +428,7 @@ int usb_register(struct usb_driver *new_
- new_driver->driver.bus = &usb_bus_type;
- new_driver->driver.probe = usb_probe_interface;
- new_driver->driver.remove = usb_unbind_interface;
-- new_driver->driver.owner = new_driver->owner;
-+ new_driver->driver.owner = owner;
- spin_lock_init(&new_driver->dynids.lock);
- INIT_LIST_HEAD(&new_driver->dynids.list);
-
-@@ -447,7 +448,7 @@ int usb_register(struct usb_driver *new_
-
- return retval;
- }
--EXPORT_SYMBOL_GPL(usb_register);
-+EXPORT_SYMBOL_GPL(usb_register_driver);
-
- /**
- * usb_deregister - unregister a USB driver
---- gregkh-2.6.orig/include/linux/usb.h
-+++ gregkh-2.6/include/linux/usb.h
-@@ -625,7 +625,11 @@ struct usb_class_driver {
- * use these in module_init()/module_exit()
- * and don't forget MODULE_DEVICE_TABLE(usb, ...)
- */
--extern int usb_register(struct usb_driver *);
-+int usb_register_driver(struct usb_driver *, struct module *);
-+static inline int usb_register(struct usb_driver *driver)
-+{
-+ return usb_register_driver(driver, THIS_MODULE);
-+}
- extern void usb_deregister(struct usb_driver *);
-
- extern int usb_register_dev(struct usb_interface *intf,
diff --git a/usb/usb-dummy_hcd-rename-variables.patch b/usb/usb-dummy_hcd-rename-variables.patch
deleted file mode 100644
index d16d19d8d7de2..0000000000000
--- a/usb/usb-dummy_hcd-rename-variables.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-From stern@rowland.harvard.edu Mon Nov 14 09:04:01 2005
-Date: Mon, 14 Nov 2005 12:16:30 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: USB: dummy_hcd: rename variables
-Message-ID: <Pine.LNX.4.44L0.0511141202410.4731-100000@iolanthe.rowland.org>
-
-The recent platform_device update has reintroduced into dummy_hcd.c the
-dreaded dev->dev syndrome. This harkens back to when an earlier version
-of that driver included the unforgettable line:
-
- dev->dev.dev.driver_data = dev;
-
-This patch (as602) renames the platform_device variables to "pdev", in
-the hope of reducing confusion.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/gadget/dummy_hcd.c | 50 ++++++++++++++++++++---------------------
- 1 file changed, 25 insertions(+), 25 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/gadget/dummy_hcd.c
-+++ gregkh-2.6/drivers/usb/gadget/dummy_hcd.c
-@@ -896,7 +896,7 @@ dummy_gadget_release (struct device *dev
- #endif
- }
-
--static int dummy_udc_probe (struct platform_device *dev)
-+static int dummy_udc_probe (struct platform_device *pdev)
- {
- struct dummy *dum = the_controller;
- int rc;
-@@ -909,7 +909,7 @@ static int dummy_udc_probe (struct platf
- dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0);
-
- strcpy (dum->gadget.dev.bus_id, "gadget");
-- dum->gadget.dev.parent = &dev->dev;
-+ dum->gadget.dev.parent = &pdev->dev;
- dum->gadget.dev.release = dummy_gadget_release;
- rc = device_register (&dum->gadget.dev);
- if (rc < 0)
-@@ -919,47 +919,47 @@ static int dummy_udc_probe (struct platf
- usb_bus_get (&dummy_to_hcd (dum)->self);
- #endif
-
-- platform_set_drvdata (dev, dum);
-+ platform_set_drvdata (pdev, dum);
- device_create_file (&dum->gadget.dev, &dev_attr_function);
- return rc;
- }
-
--static int dummy_udc_remove (struct platform_device *dev)
-+static int dummy_udc_remove (struct platform_device *pdev)
- {
-- struct dummy *dum = platform_get_drvdata (dev);
-+ struct dummy *dum = platform_get_drvdata (pdev);
-
-- platform_set_drvdata (dev, NULL);
-+ platform_set_drvdata (pdev, NULL);
- device_remove_file (&dum->gadget.dev, &dev_attr_function);
- device_unregister (&dum->gadget.dev);
- return 0;
- }
-
--static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state)
-+static int dummy_udc_suspend (struct platform_device *pdev, pm_message_t state)
- {
-- struct dummy *dum = platform_get_drvdata(dev);
-+ struct dummy *dum = platform_get_drvdata(pdev);
-
-- dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
-+ dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
- spin_lock_irq (&dum->lock);
- dum->udc_suspended = 1;
- set_link_state (dum);
- spin_unlock_irq (&dum->lock);
-
-- dev->dev.power.power_state = state;
-+ pdev->dev.power.power_state = state;
- usb_hcd_poll_rh_status (dummy_to_hcd (dum));
- return 0;
- }
-
--static int dummy_udc_resume (struct platform_device *dev)
-+static int dummy_udc_resume (struct platform_device *pdev)
- {
-- struct dummy *dum = platform_get_drvdata(dev);
-+ struct dummy *dum = platform_get_drvdata(pdev);
-
-- dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
-+ dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
- spin_lock_irq (&dum->lock);
- dum->udc_suspended = 0;
- set_link_state (dum);
- spin_unlock_irq (&dum->lock);
-
-- dev->dev.power.power_state = PMSG_ON;
-+ pdev->dev.power.power_state = PMSG_ON;
- usb_hcd_poll_rh_status (dummy_to_hcd (dum));
- return 0;
- }
-@@ -1899,14 +1899,14 @@ static const struct hc_driver dummy_hcd
- .bus_resume = dummy_bus_resume,
- };
-
--static int dummy_hcd_probe (struct platform_device *dev)
-+static int dummy_hcd_probe(struct platform_device *pdev)
- {
- struct usb_hcd *hcd;
- int retval;
-
-- dev_info(&dev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);
-+ dev_info(&pdev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);
-
-- hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id);
-+ hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, pdev->dev.bus_id);
- if (!hcd)
- return -ENOMEM;
- the_controller = hcd_to_dummy (hcd);
-@@ -1919,34 +1919,34 @@ static int dummy_hcd_probe (struct platf
- return retval;
- }
-
--static int dummy_hcd_remove (struct platform_device *dev)
-+static int dummy_hcd_remove (struct platform_device *pdev)
- {
- struct usb_hcd *hcd;
-
-- hcd = platform_get_drvdata (dev);
-+ hcd = platform_get_drvdata (pdev);
- usb_remove_hcd (hcd);
- usb_put_hcd (hcd);
- the_controller = NULL;
- return 0;
- }
-
--static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state)
-+static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state)
- {
- struct usb_hcd *hcd;
-
-- dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
-- hcd = platform_get_drvdata (dev);
-+ dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
-+ hcd = platform_get_drvdata (pdev);
-
- hcd->state = HC_STATE_SUSPENDED;
- return 0;
- }
-
--static int dummy_hcd_resume (struct platform_device *dev)
-+static int dummy_hcd_resume (struct platform_device *pdev)
- {
- struct usb_hcd *hcd;
-
-- dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
-- hcd = platform_get_drvdata (dev);
-+ dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
-+ hcd = platform_get_drvdata (pdev);
- hcd->state = HC_STATE_RUNNING;
-
- usb_hcd_poll_rh_status (hcd);
diff --git a/usb/usb-dynamic-id-01.patch b/usb/usb-dynamic-id-01.patch
deleted file mode 100644
index c23e61fb60d27..0000000000000
--- a/usb/usb-dynamic-id-01.patch
+++ /dev/null
@@ -1,742 +0,0 @@
-From foo@baz.org Wed Nov 16 13:31:19 2005
-Date: Wed, 16 Nov 2005 13:41:28 -0800
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: USB: reorg some functions out of the main usb.c file
-
-This will make the dynamic-id stuff easier to do, as it will be
-self-contained.
-
-No logic was changed at all.
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- Documentation/DocBook/usb.tmpl | 1
- drivers/usb/core/Makefile | 2
- drivers/usb/core/driver.c | 338 +++++++++++++++++++++++++++++++++++++++++
- drivers/usb/core/usb.c | 310 -------------------------------------
- drivers/usb/core/usb.h | 3
- 5 files changed, 343 insertions(+), 311 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/usb.c
-+++ gregkh-2.6/drivers/usb/core/usb.c
-@@ -52,161 +52,6 @@ static int nousb; /* Disable USB when bu
- static DECLARE_RWSEM(usb_all_devices_rwsem);
-
-
--static int generic_probe (struct device *dev)
--{
-- return 0;
--}
--static int generic_remove (struct device *dev)
--{
-- struct usb_device *udev = to_usb_device(dev);
--
-- /* if this is only an unbind, not a physical disconnect, then
-- * unconfigure the device */
-- if (udev->state == USB_STATE_CONFIGURED)
-- usb_set_configuration(udev, 0);
--
-- /* in case the call failed or the device was suspended */
-- if (udev->state >= USB_STATE_CONFIGURED)
-- usb_disable_device(udev, 0);
-- return 0;
--}
--
--static struct device_driver usb_generic_driver = {
-- .owner = THIS_MODULE,
-- .name = "usb",
-- .bus = &usb_bus_type,
-- .probe = generic_probe,
-- .remove = generic_remove,
--};
--
--static int usb_generic_driver_data;
--
--/* called from driver core with usb_bus_type.subsys writelock */
--static int usb_probe_interface(struct device *dev)
--{
-- struct usb_interface * intf = to_usb_interface(dev);
-- struct usb_driver * driver = to_usb_driver(dev->driver);
-- const struct usb_device_id *id;
-- int error = -ENODEV;
--
-- dev_dbg(dev, "%s\n", __FUNCTION__);
--
-- if (!driver->probe)
-- return error;
-- /* FIXME we'd much prefer to just resume it ... */
-- if (interface_to_usbdev(intf)->state == USB_STATE_SUSPENDED)
-- return -EHOSTUNREACH;
--
-- id = usb_match_id (intf, driver->id_table);
-- if (id) {
-- dev_dbg (dev, "%s - got id\n", __FUNCTION__);
--
-- /* Interface "power state" doesn't correspond to any hardware
-- * state whatsoever. We use it to record when it's bound to
-- * a driver that may start I/0: it's not frozen/quiesced.
-- */
-- mark_active(intf);
-- intf->condition = USB_INTERFACE_BINDING;
-- error = driver->probe (intf, id);
-- if (error) {
-- mark_quiesced(intf);
-- intf->condition = USB_INTERFACE_UNBOUND;
-- } else
-- intf->condition = USB_INTERFACE_BOUND;
-- }
--
-- return error;
--}
--
--/* called from driver core with usb_bus_type.subsys writelock */
--static int usb_unbind_interface(struct device *dev)
--{
-- struct usb_interface *intf = to_usb_interface(dev);
-- struct usb_driver *driver = to_usb_driver(intf->dev.driver);
--
-- intf->condition = USB_INTERFACE_UNBINDING;
--
-- /* release all urbs for this interface */
-- usb_disable_interface(interface_to_usbdev(intf), intf);
--
-- if (driver && driver->disconnect)
-- driver->disconnect(intf);
--
-- /* reset other interface state */
-- usb_set_interface(interface_to_usbdev(intf),
-- intf->altsetting[0].desc.bInterfaceNumber,
-- 0);
-- usb_set_intfdata(intf, NULL);
-- intf->condition = USB_INTERFACE_UNBOUND;
-- mark_quiesced(intf);
--
-- return 0;
--}
--
--/**
-- * usb_register - register a USB driver
-- * @new_driver: USB operations for the driver
-- *
-- * Registers a USB driver with the USB core. The list of unattached
-- * interfaces will be rescanned whenever a new driver is added, allowing
-- * the new driver to attach to any recognized devices.
-- * Returns a negative error code on failure and 0 on success.
-- *
-- * NOTE: if you want your driver to use the USB major number, you must call
-- * usb_register_dev() to enable that functionality. This function no longer
-- * takes care of that.
-- */
--int usb_register(struct usb_driver *new_driver)
--{
-- int retval = 0;
--
-- if (nousb)
-- return -ENODEV;
--
-- new_driver->driver.name = (char *)new_driver->name;
-- new_driver->driver.bus = &usb_bus_type;
-- new_driver->driver.probe = usb_probe_interface;
-- new_driver->driver.remove = usb_unbind_interface;
-- new_driver->driver.owner = new_driver->owner;
--
-- usb_lock_all_devices();
-- retval = driver_register(&new_driver->driver);
-- usb_unlock_all_devices();
--
-- if (!retval) {
-- pr_info("%s: registered new driver %s\n",
-- usbcore_name, new_driver->name);
-- usbfs_update_special();
-- } else {
-- printk(KERN_ERR "%s: error %d registering driver %s\n",
-- usbcore_name, retval, new_driver->name);
-- }
--
-- return retval;
--}
--
--/**
-- * usb_deregister - unregister a USB driver
-- * @driver: USB operations of the driver to unregister
-- * Context: must be able to sleep
-- *
-- * Unlinks the specified driver from the internal USB driver list.
-- *
-- * NOTE: If you called usb_register_dev(), you still need to call
-- * usb_deregister_dev() to clean up your driver's allocated minor numbers,
-- * this * call will no longer do it for you.
-- */
--void usb_deregister(struct usb_driver *driver)
--{
-- pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name);
--
-- usb_lock_all_devices();
-- driver_unregister (&driver->driver);
-- usb_unlock_all_devices();
--
-- usbfs_update_special();
--}
--
- /**
- * usb_ifnum_to_if - get the interface object with a given interface number
- * @dev: the device whose current configuration is considered
-@@ -352,137 +197,6 @@ void usb_driver_release_interface(struct
- mark_quiesced(iface);
- }
-
--/**
-- * usb_match_id - find first usb_device_id matching device or interface
-- * @interface: the interface of interest
-- * @id: array of usb_device_id structures, terminated by zero entry
-- *
-- * usb_match_id searches an array of usb_device_id's and returns
-- * the first one matching the device or interface, or null.
-- * This is used when binding (or rebinding) a driver to an interface.
-- * Most USB device drivers will use this indirectly, through the usb core,
-- * but some layered driver frameworks use it directly.
-- * These device tables are exported with MODULE_DEVICE_TABLE, through
-- * modutils, to support the driver loading functionality of USB hotplugging.
-- *
-- * What Matches:
-- *
-- * The "match_flags" element in a usb_device_id controls which
-- * members are used. If the corresponding bit is set, the
-- * value in the device_id must match its corresponding member
-- * in the device or interface descriptor, or else the device_id
-- * does not match.
-- *
-- * "driver_info" is normally used only by device drivers,
-- * but you can create a wildcard "matches anything" usb_device_id
-- * as a driver's "modules.usbmap" entry if you provide an id with
-- * only a nonzero "driver_info" field. If you do this, the USB device
-- * driver's probe() routine should use additional intelligence to
-- * decide whether to bind to the specified interface.
-- *
-- * What Makes Good usb_device_id Tables:
-- *
-- * The match algorithm is very simple, so that intelligence in
-- * driver selection must come from smart driver id records.
-- * Unless you have good reasons to use another selection policy,
-- * provide match elements only in related groups, and order match
-- * specifiers from specific to general. Use the macros provided
-- * for that purpose if you can.
-- *
-- * The most specific match specifiers use device descriptor
-- * data. These are commonly used with product-specific matches;
-- * the USB_DEVICE macro lets you provide vendor and product IDs,
-- * and you can also match against ranges of product revisions.
-- * These are widely used for devices with application or vendor
-- * specific bDeviceClass values.
-- *
-- * Matches based on device class/subclass/protocol specifications
-- * are slightly more general; use the USB_DEVICE_INFO macro, or
-- * its siblings. These are used with single-function devices
-- * where bDeviceClass doesn't specify that each interface has
-- * its own class.
-- *
-- * Matches based on interface class/subclass/protocol are the
-- * most general; they let drivers bind to any interface on a
-- * multiple-function device. Use the USB_INTERFACE_INFO
-- * macro, or its siblings, to match class-per-interface style
-- * devices (as recorded in bDeviceClass).
-- *
-- * Within those groups, remember that not all combinations are
-- * meaningful. For example, don't give a product version range
-- * without vendor and product IDs; or specify a protocol without
-- * its associated class and subclass.
-- */
--const struct usb_device_id *
--usb_match_id(struct usb_interface *interface, const struct usb_device_id *id)
--{
-- struct usb_host_interface *intf;
-- struct usb_device *dev;
--
-- /* proc_connectinfo in devio.c may call us with id == NULL. */
-- if (id == NULL)
-- return NULL;
--
-- intf = interface->cur_altsetting;
-- dev = interface_to_usbdev(interface);
--
-- /* It is important to check that id->driver_info is nonzero,
-- since an entry that is all zeroes except for a nonzero
-- id->driver_info is the way to create an entry that
-- indicates that the driver want to examine every
-- device and interface. */
-- for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
-- id->driver_info; id++) {
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
-- id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
-- id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
-- continue;
--
-- /* No need to test id->bcdDevice_lo != 0, since 0 is never
-- greater than any unsigned number. */
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
-- (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
-- (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
-- (id->bDeviceClass != dev->descriptor.bDeviceClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
-- (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
-- (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
-- (id->bInterfaceClass != intf->desc.bInterfaceClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
-- (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
-- (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
-- continue;
--
-- return id;
-- }
--
-- return NULL;
--}
--
--
- static int __find_interface(struct device * dev, void * data)
- {
- struct usb_interface ** ret = (struct usb_interface **)data;
-@@ -520,27 +234,6 @@ struct usb_interface *usb_find_interface
- return ret ? intf : NULL;
- }
-
--static int usb_device_match (struct device *dev, struct device_driver *drv)
--{
-- struct usb_interface *intf;
-- struct usb_driver *usb_drv;
-- const struct usb_device_id *id;
--
-- /* check for generic driver, which we don't match any device with */
-- if (drv == &usb_generic_driver)
-- return 0;
--
-- intf = to_usb_interface(dev);
-- usb_drv = to_usb_driver(drv);
--
-- id = usb_match_id (intf, usb_drv->id_table);
-- if (id)
-- return 1;
--
-- return 0;
--}
--
--
- #ifdef CONFIG_HOTPLUG
-
- /*
-@@ -1594,8 +1287,6 @@ module_exit(usb_exit);
- * driver modules to use.
- */
-
--EXPORT_SYMBOL(usb_register);
--EXPORT_SYMBOL(usb_deregister);
- EXPORT_SYMBOL(usb_disabled);
-
- EXPORT_SYMBOL_GPL(usb_get_intf);
-@@ -1613,7 +1304,6 @@ EXPORT_SYMBOL(usb_unlock_device);
-
- EXPORT_SYMBOL(usb_driver_claim_interface);
- EXPORT_SYMBOL(usb_driver_release_interface);
--EXPORT_SYMBOL(usb_match_id);
- EXPORT_SYMBOL(usb_find_interface);
- EXPORT_SYMBOL(usb_ifnum_to_if);
- EXPORT_SYMBOL(usb_altnum_to_altsetting);
---- gregkh-2.6.orig/drivers/usb/core/Makefile
-+++ gregkh-2.6/drivers/usb/core/Makefile
-@@ -2,7 +2,7 @@
- # Makefile for USB Core files and filesystem
- #
-
--usbcore-objs := usb.o hub.o hcd.o urb.o message.o \
-+usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \
- config.o file.o buffer.o sysfs.o devio.o notify.o
-
- ifeq ($(CONFIG_PCI),y)
---- /dev/null
-+++ gregkh-2.6/drivers/usb/core/driver.c
-@@ -0,0 +1,338 @@
-+/*
-+ * drivers/usb/driver.c - most of the driver model stuff for usb
-+ *
-+ * (C) Copyright 2005 Greg Kroah-Hartman <gregkh@suse.de>
-+ *
-+ * based on drivers/usb/usb.c which had the following copyrights:
-+ * (C) Copyright Linus Torvalds 1999
-+ * (C) Copyright Johannes Erdfelt 1999-2001
-+ * (C) Copyright Andreas Gal 1999
-+ * (C) Copyright Gregory P. Smith 1999
-+ * (C) Copyright Deti Fliegl 1999 (new USB architecture)
-+ * (C) Copyright Randy Dunlap 2000
-+ * (C) Copyright David Brownell 2000-2004
-+ * (C) Copyright Yggdrasil Computing, Inc. 2000
-+ * (usb_device_id matching changes by Adam J. Richter)
-+ * (C) Copyright Greg Kroah-Hartman 2002-2003
-+ *
-+ * NOTE! This is not actually a driver at all, rather this is
-+ * just a collection of helper routines that implement the
-+ * generic USB things that the real drivers can use..
-+ *
-+ */
-+
-+#include <linux/config.h>
-+#include <linux/device.h>
-+#include <linux/usb.h>
-+#include "hcd.h"
-+#include "usb.h"
-+
-+static int generic_probe(struct device *dev)
-+{
-+ return 0;
-+}
-+static int generic_remove(struct device *dev)
-+{
-+ struct usb_device *udev = to_usb_device(dev);
-+
-+ /* if this is only an unbind, not a physical disconnect, then
-+ * unconfigure the device */
-+ if (udev->state == USB_STATE_CONFIGURED)
-+ usb_set_configuration(udev, 0);
-+
-+ /* in case the call failed or the device was suspended */
-+ if (udev->state >= USB_STATE_CONFIGURED)
-+ usb_disable_device(udev, 0);
-+ return 0;
-+}
-+
-+struct device_driver usb_generic_driver = {
-+ .owner = THIS_MODULE,
-+ .name = "usb",
-+ .bus = &usb_bus_type,
-+ .probe = generic_probe,
-+ .remove = generic_remove,
-+};
-+
-+/* Fun hack to determine if the struct device is a
-+ * usb device or a usb interface. */
-+int usb_generic_driver_data;
-+
-+/* called from driver core with usb_bus_type.subsys writelock */
-+static int usb_probe_interface(struct device *dev)
-+{
-+ struct usb_interface * intf = to_usb_interface(dev);
-+ struct usb_driver * driver = to_usb_driver(dev->driver);
-+ const struct usb_device_id *id;
-+ int error = -ENODEV;
-+
-+ dev_dbg(dev, "%s\n", __FUNCTION__);
-+
-+ if (!driver->probe)
-+ return error;
-+ /* FIXME we'd much prefer to just resume it ... */
-+ if (interface_to_usbdev(intf)->state == USB_STATE_SUSPENDED)
-+ return -EHOSTUNREACH;
-+
-+ id = usb_match_id(intf, driver->id_table);
-+ if (id) {
-+ dev_dbg(dev, "%s - got id\n", __FUNCTION__);
-+
-+ /* Interface "power state" doesn't correspond to any hardware
-+ * state whatsoever. We use it to record when it's bound to
-+ * a driver that may start I/0: it's not frozen/quiesced.
-+ */
-+ mark_active(intf);
-+ intf->condition = USB_INTERFACE_BINDING;
-+ error = driver->probe(intf, id);
-+ if (error) {
-+ mark_quiesced(intf);
-+ intf->condition = USB_INTERFACE_UNBOUND;
-+ } else
-+ intf->condition = USB_INTERFACE_BOUND;
-+ }
-+
-+ return error;
-+}
-+
-+/* called from driver core with usb_bus_type.subsys writelock */
-+static int usb_unbind_interface(struct device *dev)
-+{
-+ struct usb_interface *intf = to_usb_interface(dev);
-+ struct usb_driver *driver = to_usb_driver(intf->dev.driver);
-+
-+ intf->condition = USB_INTERFACE_UNBINDING;
-+
-+ /* release all urbs for this interface */
-+ usb_disable_interface(interface_to_usbdev(intf), intf);
-+
-+ if (driver && driver->disconnect)
-+ driver->disconnect(intf);
-+
-+ /* reset other interface state */
-+ usb_set_interface(interface_to_usbdev(intf),
-+ intf->altsetting[0].desc.bInterfaceNumber,
-+ 0);
-+ usb_set_intfdata(intf, NULL);
-+ intf->condition = USB_INTERFACE_UNBOUND;
-+ mark_quiesced(intf);
-+
-+ return 0;
-+}
-+
-+/**
-+ * usb_match_id - find first usb_device_id matching device or interface
-+ * @interface: the interface of interest
-+ * @id: array of usb_device_id structures, terminated by zero entry
-+ *
-+ * usb_match_id searches an array of usb_device_id's and returns
-+ * the first one matching the device or interface, or null.
-+ * This is used when binding (or rebinding) a driver to an interface.
-+ * Most USB device drivers will use this indirectly, through the usb core,
-+ * but some layered driver frameworks use it directly.
-+ * These device tables are exported with MODULE_DEVICE_TABLE, through
-+ * modutils, to support the driver loading functionality of USB hotplugging.
-+ *
-+ * What Matches:
-+ *
-+ * The "match_flags" element in a usb_device_id controls which
-+ * members are used. If the corresponding bit is set, the
-+ * value in the device_id must match its corresponding member
-+ * in the device or interface descriptor, or else the device_id
-+ * does not match.
-+ *
-+ * "driver_info" is normally used only by device drivers,
-+ * but you can create a wildcard "matches anything" usb_device_id
-+ * as a driver's "modules.usbmap" entry if you provide an id with
-+ * only a nonzero "driver_info" field. If you do this, the USB device
-+ * driver's probe() routine should use additional intelligence to
-+ * decide whether to bind to the specified interface.
-+ *
-+ * What Makes Good usb_device_id Tables:
-+ *
-+ * The match algorithm is very simple, so that intelligence in
-+ * driver selection must come from smart driver id records.
-+ * Unless you have good reasons to use another selection policy,
-+ * provide match elements only in related groups, and order match
-+ * specifiers from specific to general. Use the macros provided
-+ * for that purpose if you can.
-+ *
-+ * The most specific match specifiers use device descriptor
-+ * data. These are commonly used with product-specific matches;
-+ * the USB_DEVICE macro lets you provide vendor and product IDs,
-+ * and you can also match against ranges of product revisions.
-+ * These are widely used for devices with application or vendor
-+ * specific bDeviceClass values.
-+ *
-+ * Matches based on device class/subclass/protocol specifications
-+ * are slightly more general; use the USB_DEVICE_INFO macro, or
-+ * its siblings. These are used with single-function devices
-+ * where bDeviceClass doesn't specify that each interface has
-+ * its own class.
-+ *
-+ * Matches based on interface class/subclass/protocol are the
-+ * most general; they let drivers bind to any interface on a
-+ * multiple-function device. Use the USB_INTERFACE_INFO
-+ * macro, or its siblings, to match class-per-interface style
-+ * devices (as recorded in bDeviceClass).
-+ *
-+ * Within those groups, remember that not all combinations are
-+ * meaningful. For example, don't give a product version range
-+ * without vendor and product IDs; or specify a protocol without
-+ * its associated class and subclass.
-+ */
-+const struct usb_device_id *usb_match_id(struct usb_interface *interface,
-+ const struct usb_device_id *id)
-+{
-+ struct usb_host_interface *intf;
-+ struct usb_device *dev;
-+
-+ /* proc_connectinfo in devio.c may call us with id == NULL. */
-+ if (id == NULL)
-+ return NULL;
-+
-+ intf = interface->cur_altsetting;
-+ dev = interface_to_usbdev(interface);
-+
-+ /* It is important to check that id->driver_info is nonzero,
-+ since an entry that is all zeroes except for a nonzero
-+ id->driver_info is the way to create an entry that
-+ indicates that the driver want to examine every
-+ device and interface. */
-+ for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
-+ id->driver_info; id++) {
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
-+ id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
-+ id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
-+ continue;
-+
-+ /* No need to test id->bcdDevice_lo != 0, since 0 is never
-+ greater than any unsigned number. */
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
-+ (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
-+ (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
-+ (id->bDeviceClass != dev->descriptor.bDeviceClass))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
-+ (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
-+ (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
-+ (id->bInterfaceClass != intf->desc.bInterfaceClass))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
-+ (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
-+ continue;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
-+ (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
-+ continue;
-+
-+ return id;
-+ }
-+
-+ return NULL;
-+}
-+EXPORT_SYMBOL_GPL(usb_match_id);
-+
-+int usb_device_match(struct device *dev, struct device_driver *drv)
-+{
-+ struct usb_interface *intf;
-+ struct usb_driver *usb_drv;
-+ const struct usb_device_id *id;
-+
-+ /* check for generic driver, which we don't match any device with */
-+ if (drv == &usb_generic_driver)
-+ return 0;
-+
-+ intf = to_usb_interface(dev);
-+ usb_drv = to_usb_driver(drv);
-+
-+ id = usb_match_id(intf, usb_drv->id_table);
-+ if (id)
-+ return 1;
-+
-+ return 0;
-+}
-+
-+/**
-+ * usb_register - register a USB driver
-+ * @new_driver: USB operations for the driver
-+ *
-+ * Registers a USB driver with the USB core. The list of unattached
-+ * interfaces will be rescanned whenever a new driver is added, allowing
-+ * the new driver to attach to any recognized devices.
-+ * Returns a negative error code on failure and 0 on success.
-+ *
-+ * NOTE: if you want your driver to use the USB major number, you must call
-+ * usb_register_dev() to enable that functionality. This function no longer
-+ * takes care of that.
-+ */
-+int usb_register(struct usb_driver *new_driver)
-+{
-+ int retval = 0;
-+
-+ if (usb_disabled())
-+ return -ENODEV;
-+
-+ new_driver->driver.name = (char *)new_driver->name;
-+ new_driver->driver.bus = &usb_bus_type;
-+ new_driver->driver.probe = usb_probe_interface;
-+ new_driver->driver.remove = usb_unbind_interface;
-+ new_driver->driver.owner = new_driver->owner;
-+
-+ usb_lock_all_devices();
-+ retval = driver_register(&new_driver->driver);
-+ usb_unlock_all_devices();
-+
-+ if (!retval) {
-+ pr_info("%s: registered new driver %s\n",
-+ usbcore_name, new_driver->name);
-+ usbfs_update_special();
-+ } else {
-+ printk(KERN_ERR "%s: error %d registering driver %s\n",
-+ usbcore_name, retval, new_driver->name);
-+ }
-+
-+ return retval;
-+}
-+EXPORT_SYMBOL_GPL(usb_register);
-+
-+/**
-+ * usb_deregister - unregister a USB driver
-+ * @driver: USB operations of the driver to unregister
-+ * Context: must be able to sleep
-+ *
-+ * Unlinks the specified driver from the internal USB driver list.
-+ *
-+ * NOTE: If you called usb_register_dev(), you still need to call
-+ * usb_deregister_dev() to clean up your driver's allocated minor numbers,
-+ * this * call will no longer do it for you.
-+ */
-+void usb_deregister(struct usb_driver *driver)
-+{
-+ pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name);
-+
-+ usb_lock_all_devices();
-+ driver_unregister(&driver->driver);
-+ usb_unlock_all_devices();
-+
-+ usbfs_update_special();
-+}
-+EXPORT_SYMBOL_GPL(usb_deregister);
---- gregkh-2.6.orig/drivers/usb/core/usb.h
-+++ gregkh-2.6/drivers/usb/core/usb.h
-@@ -33,6 +33,9 @@ extern void usb_host_cleanup(void);
- extern int usb_suspend_device(struct usb_device *dev);
- extern int usb_resume_device(struct usb_device *dev);
-
-+extern struct device_driver usb_generic_driver;
-+extern int usb_generic_driver_data;
-+extern int usb_device_match(struct device *dev, struct device_driver *drv);
-
- /* Interfaces and their "power state" are owned by usbcore */
-
---- gregkh-2.6.orig/Documentation/DocBook/usb.tmpl
-+++ gregkh-2.6/Documentation/DocBook/usb.tmpl
-@@ -253,6 +253,7 @@
- !Edrivers/usb/core/urb.c
- !Edrivers/usb/core/message.c
- !Edrivers/usb/core/file.c
-+!Edrivers/usb/core/driver.c
- !Edrivers/usb/core/usb.c
- !Edrivers/usb/core/hub.c
- </chapter>
diff --git a/usb/usb-dynamic-id-02.patch b/usb/usb-dynamic-id-02.patch
deleted file mode 100644
index 28200bc23b81a..0000000000000
--- a/usb/usb-dynamic-id-02.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-From foo@baz.org Wed Nov 16 13:31:19 2005
-Date: Wed, 16 Nov 2005 13:41:28 -0800
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: USB: add dynamic id functionality to USB core
-
-Echo the usb vendor and product id to the "new_id" file in the driver's
-sysfs directory, and then that driver will be able to bind to a device
-with those ids if it is present.
-
-
-Example:
- echo 0557 2008 > /sys/bus/usb/drivers/foo_driver/new_id
-adds the hex values 0557 and 2008 to the device id table for the foo_driver.
-
-
-Note, usb-serial drivers do not currently work with this capability yet.
-usb-storage also might have some oddities.
-
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- drivers/usb/core/driver.c | 218 +++++++++++++++++++++++++++++++++++-----------
- include/linux/usb.h | 8 +
- 2 files changed, 176 insertions(+), 50 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/driver.c
-+++ gregkh-2.6/drivers/usb/core/driver.c
-@@ -27,6 +27,15 @@
- #include "hcd.h"
- #include "usb.h"
-
-+static int usb_match_one_id(struct usb_interface *interface,
-+ const struct usb_device_id *id);
-+
-+struct usb_dynid {
-+ struct list_head node;
-+ struct usb_device_id id;
-+};
-+
-+
- static int generic_probe(struct device *dev)
- {
- return 0;
-@@ -58,6 +67,96 @@ struct device_driver usb_generic_driver
- * usb device or a usb interface. */
- int usb_generic_driver_data;
-
-+#ifdef CONFIG_HOTPLUG
-+
-+/*
-+ * Adds a new dynamic USBdevice ID to this driver,
-+ * and cause the driver to probe for all devices again.
-+ */
-+static ssize_t store_new_id(struct device_driver *driver,
-+ const char *buf, size_t count)
-+{
-+ struct usb_driver *usb_drv = to_usb_driver(driver);
-+ struct usb_dynid *dynid;
-+ u32 idVendor = 0;
-+ u32 idProduct = 0;
-+ int fields = 0;
-+
-+ fields = sscanf(buf, "%x %x", &idVendor, &idProduct);
-+ if (fields < 2)
-+ return -EINVAL;
-+
-+ dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);
-+ if (!dynid)
-+ return -ENOMEM;
-+
-+ INIT_LIST_HEAD(&dynid->node);
-+ dynid->id.idVendor = idVendor;
-+ dynid->id.idProduct = idProduct;
-+ dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE;
-+
-+ spin_lock(&usb_drv->dynids.lock);
-+ list_add_tail(&usb_drv->dynids.list, &dynid->node);
-+ spin_unlock(&usb_drv->dynids.lock);
-+
-+ if (get_driver(driver)) {
-+ driver_attach(driver);
-+ put_driver(driver);
-+ }
-+
-+ return count;
-+}
-+static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id);
-+
-+static int usb_create_newid_file(struct usb_driver *usb_drv)
-+{
-+ int error = 0;
-+
-+ if (usb_drv->probe != NULL)
-+ error = sysfs_create_file(&usb_drv->driver.kobj,
-+ &driver_attr_new_id.attr);
-+ return error;
-+}
-+
-+static void usb_free_dynids(struct usb_driver *usb_drv)
-+{
-+ struct usb_dynid *dynid, *n;
-+
-+ spin_lock(&usb_drv->dynids.lock);
-+ list_for_each_entry_safe(dynid, n, &usb_drv->dynids.list, node) {
-+ list_del(&dynid->node);
-+ kfree(dynid);
-+ }
-+ spin_unlock(&usb_drv->dynids.lock);
-+}
-+#else
-+static inline int usb_create_newid_file(struct usb_driver *usb_drv)
-+{
-+ return 0;
-+}
-+
-+static inline void usb_free_dynids(struct usb_driver *usb_drv)
-+{
-+}
-+#endif
-+
-+static const struct usb_device_id *usb_match_dynamic_id(struct usb_interface *intf,
-+ struct usb_driver *drv)
-+{
-+ struct usb_dynid *dynid;
-+
-+ spin_lock(&drv->dynids.lock);
-+ list_for_each_entry(dynid, &drv->dynids.list, node) {
-+ if (usb_match_one_id(intf, &dynid->id)) {
-+ spin_unlock(&drv->dynids.lock);
-+ return &dynid->id;
-+ }
-+ }
-+ spin_unlock(&drv->dynids.lock);
-+ return NULL;
-+}
-+
-+
- /* called from driver core with usb_bus_type.subsys writelock */
- static int usb_probe_interface(struct device *dev)
- {
-@@ -75,6 +174,8 @@ static int usb_probe_interface(struct de
- return -EHOSTUNREACH;
-
- id = usb_match_id(intf, driver->id_table);
-+ if (!id)
-+ id = usb_match_dynamic_id(intf, driver);
- if (id) {
- dev_dbg(dev, "%s - got id\n", __FUNCTION__);
-
-@@ -120,6 +221,64 @@ static int usb_unbind_interface(struct d
- return 0;
- }
-
-+/* returns 0 if no match, 1 if match */
-+static int usb_match_one_id(struct usb_interface *interface,
-+ const struct usb_device_id *id)
-+{
-+ struct usb_host_interface *intf;
-+ struct usb_device *dev;
-+
-+ /* proc_connectinfo in devio.c may call us with id == NULL. */
-+ if (id == NULL)
-+ return 0;
-+
-+ intf = interface->cur_altsetting;
-+ dev = interface_to_usbdev(interface);
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
-+ id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
-+ id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
-+ return 0;
-+
-+ /* No need to test id->bcdDevice_lo != 0, since 0 is never
-+ greater than any unsigned number. */
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
-+ (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
-+ (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
-+ (id->bDeviceClass != dev->descriptor.bDeviceClass))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
-+ (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
-+ (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
-+ (id->bInterfaceClass != intf->desc.bInterfaceClass))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
-+ (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
-+ return 0;
-+
-+ if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
-+ (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
-+ return 0;
-+
-+ return 1;
-+}
- /**
- * usb_match_id - find first usb_device_id matching device or interface
- * @interface: the interface of interest
-@@ -184,16 +343,10 @@ static int usb_unbind_interface(struct d
- const struct usb_device_id *usb_match_id(struct usb_interface *interface,
- const struct usb_device_id *id)
- {
-- struct usb_host_interface *intf;
-- struct usb_device *dev;
--
- /* proc_connectinfo in devio.c may call us with id == NULL. */
- if (id == NULL)
- return NULL;
-
-- intf = interface->cur_altsetting;
-- dev = interface_to_usbdev(interface);
--
- /* It is important to check that id->driver_info is nonzero,
- since an entry that is all zeroes except for a nonzero
- id->driver_info is the way to create an entry that
-@@ -201,50 +354,8 @@ const struct usb_device_id *usb_match_id
- device and interface. */
- for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
- id->driver_info; id++) {
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
-- id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
-- id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
-- continue;
--
-- /* No need to test id->bcdDevice_lo != 0, since 0 is never
-- greater than any unsigned number. */
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
-- (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
-- (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
-- (id->bDeviceClass != dev->descriptor.bDeviceClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
-- (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
-- (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
-- (id->bInterfaceClass != intf->desc.bInterfaceClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
-- (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
-- continue;
--
-- if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
-- (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
-- continue;
--
-- return id;
-+ if (usb_match_one_id(interface, id))
-+ return id;
- }
-
- return NULL;
-@@ -268,6 +379,9 @@ int usb_device_match(struct device *dev,
- if (id)
- return 1;
-
-+ id = usb_match_dynamic_id(intf, usb_drv);
-+ if (id)
-+ return 1;
- return 0;
- }
-
-@@ -296,6 +410,8 @@ int usb_register(struct usb_driver *new_
- new_driver->driver.probe = usb_probe_interface;
- new_driver->driver.remove = usb_unbind_interface;
- new_driver->driver.owner = new_driver->owner;
-+ spin_lock_init(&new_driver->dynids.lock);
-+ INIT_LIST_HEAD(&new_driver->dynids.list);
-
- usb_lock_all_devices();
- retval = driver_register(&new_driver->driver);
-@@ -305,6 +421,7 @@ int usb_register(struct usb_driver *new_
- pr_info("%s: registered new driver %s\n",
- usbcore_name, new_driver->name);
- usbfs_update_special();
-+ usb_create_newid_file(new_driver);
- } else {
- printk(KERN_ERR "%s: error %d registering driver %s\n",
- usbcore_name, retval, new_driver->name);
-@@ -330,6 +447,7 @@ void usb_deregister(struct usb_driver *d
- pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name);
-
- usb_lock_all_devices();
-+ usb_free_dynids(driver);
- driver_unregister(&driver->driver);
- usb_unlock_all_devices();
-
---- gregkh-2.6.orig/include/linux/usb.h
-+++ gregkh-2.6/include/linux/usb.h
-@@ -529,6 +529,11 @@ static inline int usb_make_path (struct
-
- /* ----------------------------------------------------------------------- */
-
-+struct usb_dynids {
-+ spinlock_t lock;
-+ struct list_head list;
-+};
-+
- /**
- * struct usb_driver - identifies USB driver to usbcore
- * @owner: Pointer to the module owner of this driver; initialize
-@@ -553,6 +558,8 @@ static inline int usb_make_path (struct
- * @id_table: USB drivers use ID table to support hotplugging.
- * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
- * or your driver's probe function will never get called.
-+ * @dynids: used internally to hold the list of dynamically added device
-+ * ids for this driver.
- * @driver: the driver model core driver structure.
- *
- * USB drivers must provide a name, probe() and disconnect() methods,
-@@ -588,6 +595,7 @@ struct usb_driver {
-
- const struct usb_device_id *id_table;
-
-+ struct usb_dynids dynids;
- struct device_driver driver;
- };
- #define to_usb_driver(d) container_of(d, struct usb_driver, driver)
diff --git a/usb/usb-dynamic-id-03.patch b/usb/usb-dynamic-id-03.patch
deleted file mode 100644
index 105a2c1cd9c73..0000000000000
--- a/usb/usb-dynamic-id-03.patch
+++ /dev/null
@@ -1,417 +0,0 @@
-From foo@baz.org Wed Nov 16 13:31:19 2005
-Date: Wed, 16 Nov 2005 13:41:28 -0800
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: USB: allow usb drivers to disable dynamic ids
-
-This lets drivers, like the usb-serial ones, disable the ability to add
-ids from sysfs.
-
-The usb-serial drivers are "odd" in that they are really usb-serial bus
-drivers, not usb bus drivers, so the dynamic id logic will have to go
-into the usb-serial bus core for those drivers to get that ability.
-
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- drivers/usb/core/driver.c | 19 +++++++++++++++++++
- drivers/usb/serial/airprime.c | 1 +
- drivers/usb/serial/anydata.c | 1 +
- drivers/usb/serial/belkin_sa.c | 1 +
- drivers/usb/serial/cp2101.c | 1 +
- drivers/usb/serial/cyberjack.c | 1 +
- drivers/usb/serial/cypress_m8.c | 1 +
- drivers/usb/serial/digi_acceleport.c | 1 +
- drivers/usb/serial/empeg.c | 1 +
- drivers/usb/serial/ftdi_sio.c | 1 +
- drivers/usb/serial/garmin_gps.c | 1 +
- drivers/usb/serial/generic.c | 1 +
- drivers/usb/serial/hp4x.c | 1 +
- drivers/usb/serial/io_edgeport.c | 1 +
- drivers/usb/serial/io_ti.c | 1 +
- drivers/usb/serial/ipaq.c | 1 +
- drivers/usb/serial/ipw.c | 1 +
- drivers/usb/serial/ir-usb.c | 1 +
- drivers/usb/serial/keyspan.h | 1 +
- drivers/usb/serial/keyspan_pda.c | 1 +
- drivers/usb/serial/kl5kusb105.c | 1 +
- drivers/usb/serial/kobil_sct.c | 1 +
- drivers/usb/serial/mct_u232.c | 1 +
- drivers/usb/serial/omninet.c | 1 +
- drivers/usb/serial/option.c | 1 +
- drivers/usb/serial/pl2303.c | 1 +
- drivers/usb/serial/safe_serial.c | 1 +
- drivers/usb/serial/ti_usb_3410_5052.c | 1 +
- drivers/usb/serial/usb-serial.c | 1 +
- drivers/usb/serial/visor.c | 1 +
- drivers/usb/serial/whiteheat.c | 1 +
- include/linux/usb.h | 3 +++
- 32 files changed, 52 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/serial/pl2303.c
-+++ gregkh-2.6/drivers/usb/serial/pl2303.c
-@@ -87,6 +87,7 @@ static struct usb_driver pl2303_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- #define SET_LINE_REQUEST_TYPE 0x21
---- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c
-+++ gregkh-2.6/drivers/usb/serial/usb-serial.c
-@@ -46,6 +46,7 @@ static struct usb_driver usb_serial_driv
- .name = "usbserial",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
-+ .no_dynamic_id = 1,
- };
-
- /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead
---- gregkh-2.6.orig/drivers/usb/core/driver.c
-+++ gregkh-2.6/drivers/usb/core/driver.c
-@@ -112,12 +112,26 @@ static int usb_create_newid_file(struct
- {
- int error = 0;
-
-+ if (usb_drv->no_dynamic_id)
-+ goto exit;
-+
- if (usb_drv->probe != NULL)
- error = sysfs_create_file(&usb_drv->driver.kobj,
- &driver_attr_new_id.attr);
-+exit:
- return error;
- }
-
-+static void usb_remove_newid_file(struct usb_driver *usb_drv)
-+{
-+ if (usb_drv->no_dynamic_id)
-+ return;
-+
-+ if (usb_drv->probe != NULL)
-+ sysfs_remove_file(&usb_drv->driver.kobj,
-+ &driver_attr_new_id.attr);
-+}
-+
- static void usb_free_dynids(struct usb_driver *usb_drv)
- {
- struct usb_dynid *dynid, *n;
-@@ -135,6 +149,10 @@ static inline int usb_create_newid_file(
- return 0;
- }
-
-+static void usb_remove_newid_file(struct usb_driver *usb_drv)
-+{
-+}
-+
- static inline void usb_free_dynids(struct usb_driver *usb_drv)
- {
- }
-@@ -447,6 +465,7 @@ void usb_deregister(struct usb_driver *d
- pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name);
-
- usb_lock_all_devices();
-+ usb_remove_newid_file(driver);
- usb_free_dynids(driver);
- driver_unregister(&driver->driver);
- usb_unlock_all_devices();
---- gregkh-2.6.orig/include/linux/usb.h
-+++ gregkh-2.6/include/linux/usb.h
-@@ -561,6 +561,8 @@ struct usb_dynids {
- * @dynids: used internally to hold the list of dynamically added device
- * ids for this driver.
- * @driver: the driver model core driver structure.
-+ * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be
-+ * added to this driver by preventing the sysfs file from being created.
- *
- * USB drivers must provide a name, probe() and disconnect() methods,
- * and an id_table. Other driver fields are optional.
-@@ -597,6 +599,7 @@ struct usb_driver {
-
- struct usb_dynids dynids;
- struct device_driver driver;
-+ unsigned int no_dynamic_id:1;
- };
- #define to_usb_driver(d) container_of(d, struct usb_driver, driver)
-
---- gregkh-2.6.orig/drivers/usb/serial/airprime.c
-+++ gregkh-2.6/drivers/usb/serial/airprime.c
-@@ -28,6 +28,7 @@ static struct usb_driver airprime_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver airprime_device = {
---- gregkh-2.6.orig/drivers/usb/serial/anydata.c
-+++ gregkh-2.6/drivers/usb/serial/anydata.c
-@@ -32,6 +32,7 @@ static struct usb_driver anydata_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static int anydata_open(struct usb_serial_port *port, struct file *filp)
---- gregkh-2.6.orig/drivers/usb/serial/belkin_sa.c
-+++ gregkh-2.6/drivers/usb/serial/belkin_sa.c
-@@ -118,6 +118,7 @@ static struct usb_driver belkin_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- /* All of the device info needed for the serial converters */
---- gregkh-2.6.orig/drivers/usb/serial/cp2101.c
-+++ gregkh-2.6/drivers/usb/serial/cp2101.c
-@@ -72,6 +72,7 @@ static struct usb_driver cp2101_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver cp2101_device = {
---- gregkh-2.6.orig/drivers/usb/serial/cyberjack.c
-+++ gregkh-2.6/drivers/usb/serial/cyberjack.c
-@@ -81,6 +81,7 @@ static struct usb_driver cyberjack_drive
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver cyberjack_device = {
---- gregkh-2.6.orig/drivers/usb/serial/cypress_m8.c
-+++ gregkh-2.6/drivers/usb/serial/cypress_m8.c
-@@ -112,6 +112,7 @@ static struct usb_driver cypress_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- struct cypress_private {
---- gregkh-2.6.orig/drivers/usb/serial/digi_acceleport.c
-+++ gregkh-2.6/drivers/usb/serial/digi_acceleport.c
-@@ -498,6 +498,7 @@ static struct usb_driver digi_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/empeg.c
-+++ gregkh-2.6/drivers/usb/serial/empeg.c
-@@ -110,6 +110,7 @@ static struct usb_driver empeg_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver empeg_device = {
---- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.c
-+++ gregkh-2.6/drivers/usb/serial/ftdi_sio.c
-@@ -488,6 +488,7 @@ static struct usb_driver ftdi_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- static char *ftdi_chip_name[] = {
---- gregkh-2.6.orig/drivers/usb/serial/garmin_gps.c
-+++ gregkh-2.6/drivers/usb/serial/garmin_gps.c
-@@ -227,6 +227,7 @@ static struct usb_driver garmin_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/generic.c
-+++ gregkh-2.6/drivers/usb/serial/generic.c
-@@ -73,6 +73,7 @@ static struct usb_driver generic_driver
- .probe = generic_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = generic_serial_ids,
-+ .no_dynamic_id = 1,
- };
- #endif
-
---- gregkh-2.6.orig/drivers/usb/serial/hp4x.c
-+++ gregkh-2.6/drivers/usb/serial/hp4x.c
-@@ -42,6 +42,7 @@ static struct usb_driver hp49gp_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver hp49gp_device = {
---- gregkh-2.6.orig/drivers/usb/serial/io_edgeport.c
-+++ gregkh-2.6/drivers/usb/serial/io_edgeport.c
-@@ -247,6 +247,7 @@ static struct usb_driver io_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- /* function prototypes for all of our local functions */
---- gregkh-2.6.orig/drivers/usb/serial/io_ti.c
-+++ gregkh-2.6/drivers/usb/serial/io_ti.c
-@@ -221,6 +221,7 @@ static struct usb_driver io_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/ipaq.c
-+++ gregkh-2.6/drivers/usb/serial/ipaq.c
-@@ -547,6 +547,7 @@ static struct usb_driver ipaq_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = ipaq_id_table,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/ipw.c
-+++ gregkh-2.6/drivers/usb/serial/ipw.c
-@@ -157,6 +157,7 @@ static struct usb_driver usb_ipw_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = usb_ipw_ids,
-+ .no_dynamic_id = 1,
- };
-
- static int debug;
---- gregkh-2.6.orig/drivers/usb/serial/ir-usb.c
-+++ gregkh-2.6/drivers/usb/serial/ir-usb.c
-@@ -130,6 +130,7 @@ static struct usb_driver ir_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/keyspan.h
-+++ gregkh-2.6/drivers/usb/serial/keyspan.h
-@@ -525,6 +525,7 @@ static struct usb_driver keyspan_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = keyspan_ids_combined,
-+ .no_dynamic_id = 1,
- };
-
- /* usb_device_id table for the pre-firmware download keyspan devices */
---- gregkh-2.6.orig/drivers/usb/serial/keyspan_pda.c
-+++ gregkh-2.6/drivers/usb/serial/keyspan_pda.c
-@@ -155,6 +155,7 @@ static struct usb_driver keyspan_pda_dri
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_device_id id_table_std [] = {
---- gregkh-2.6.orig/drivers/usb/serial/kl5kusb105.c
-+++ gregkh-2.6/drivers/usb/serial/kl5kusb105.c
-@@ -121,6 +121,7 @@ static struct usb_driver kl5kusb105d_dri
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver kl5kusb105d_device = {
---- gregkh-2.6.orig/drivers/usb/serial/kobil_sct.c
-+++ gregkh-2.6/drivers/usb/serial/kobil_sct.c
-@@ -102,6 +102,7 @@ static struct usb_driver kobil_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/mct_u232.c
-+++ gregkh-2.6/drivers/usb/serial/mct_u232.c
-@@ -130,6 +130,7 @@ static struct usb_driver mct_u232_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver mct_u232_device = {
---- gregkh-2.6.orig/drivers/usb/serial/omninet.c
-+++ gregkh-2.6/drivers/usb/serial/omninet.c
-@@ -85,6 +85,7 @@ static struct usb_driver omninet_driver
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
-
---- gregkh-2.6.orig/drivers/usb/serial/option.c
-+++ gregkh-2.6/drivers/usb/serial/option.c
-@@ -100,6 +100,7 @@ static struct usb_driver option_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = option_ids,
-+ .no_dynamic_id = 1,
- };
-
- /* The card has three separate interfaces, wich the serial driver
---- gregkh-2.6.orig/drivers/usb/serial/safe_serial.c
-+++ gregkh-2.6/drivers/usb/serial/safe_serial.c
-@@ -165,6 +165,7 @@ static struct usb_driver safe_driver = {
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table,
-+ .no_dynamic_id = 1,
- };
-
- static __u16 crc10_table[256] = {
---- gregkh-2.6.orig/drivers/usb/serial/ti_usb_3410_5052.c
-+++ gregkh-2.6/drivers/usb/serial/ti_usb_3410_5052.c
-@@ -253,6 +253,7 @@ static struct usb_driver ti_usb_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = ti_id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- static struct usb_serial_driver ti_1port_device = {
---- gregkh-2.6.orig/drivers/usb/serial/visor.c
-+++ gregkh-2.6/drivers/usb/serial/visor.c
-@@ -178,6 +178,7 @@ static struct usb_driver visor_driver =
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- /* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */
---- gregkh-2.6.orig/drivers/usb/serial/whiteheat.c
-+++ gregkh-2.6/drivers/usb/serial/whiteheat.c
-@@ -132,6 +132,7 @@ static struct usb_driver whiteheat_drive
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = id_table_combined,
-+ .no_dynamic_id = 1,
- };
-
- /* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */
diff --git a/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver-fix.patch b/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver-fix.patch
deleted file mode 100644
index c546cc472e88d..0000000000000
--- a/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver-fix.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From castet.matthieu@free.fr Mon Nov 7 15:03:36 2005
-Message-ID: <436FDD06.607@free.fr>
-Date: Tue, 08 Nov 2005 00:02:30 +0100
-From: matthieu castet <castet.matthieu@free.fr>
-To: Greg KH <greg@kroah.com>
-CC: Andrew Morton <akpm@osdl.org>, <usbatm@lists.infradead.org>
-Subject: USB: Eagle and ADI 930 usb adsl modem driver fix
-
-More care on loading firmware, take into account fw->size can't be zero.
-
-Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/atm/ueagle-atm.c | 28 ++++++++++++++++++----------
- 1 file changed, 18 insertions(+), 10 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/atm/ueagle-atm.c
-+++ gregkh-2.6/drivers/usb/atm/ueagle-atm.c
-@@ -426,14 +426,14 @@ static void uea_upload_pre_firmware(cons
-
- pfw = fw_entry->data;
- size = fw_entry->size;
-+ if (size < 4)
-+ goto err_fw_corrupted;
-
- crc = FW_GET_LONG(pfw);
- pfw += 4;
- size -= 4;
-- if (crc32_be(0, pfw, size) != crc) {
-- uea_err(usb, "firmware is corrupted\n");
-- goto err;
-- }
-+ if (crc32_be(0, pfw, size) != crc)
-+ goto err_fw_corrupted;
-
- /*
- * Start to upload formware : send reset
-@@ -446,9 +446,14 @@ static void uea_upload_pre_firmware(cons
- goto err;
- }
-
-- while (size > 0) {
-+ while (size > 3) {
- u8 len = FW_GET_BYTE(pfw);
- u16 add = FW_GET_WORD(pfw + 1);
-+
-+ size -= len + 3;
-+ if (size < 0)
-+ goto err_fw_corrupted;
-+
- ret = uea_send_modem_cmd(usb, add, len, pfw + 3);
- if (ret < 0) {
- uea_err(usb, "uploading firmware data failed "
-@@ -456,9 +461,11 @@ static void uea_upload_pre_firmware(cons
- goto err;
- }
- pfw += len + 3;
-- size -= len + 3;
- }
-
-+ if (size != 0)
-+ goto err_fw_corrupted;
-+
- /*
- * Tell the modem we finish : de-assert reset
- */
-@@ -469,6 +476,11 @@ static void uea_upload_pre_firmware(cons
- else
- uea_info(usb, "firmware uploaded\n");
-
-+ uea_leaves(usb);
-+ return;
-+
-+err_fw_corrupted:
-+ uea_err(usb, "firmware is corrupted\n");
- err:
- uea_leaves(usb);
- }
-@@ -522,10 +534,6 @@ static int check_dsp(u8 *dsp, unsigned i
- u32 pageoffset;
- unsigned int i, j, p, pp;
-
-- /* enough space for pagecount? */
-- if (len < 1)
-- return 1;
--
- pagecount = FW_GET_BYTE(dsp);
- p = 1;
-
diff --git a/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver.patch b/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver.patch
deleted file mode 100644
index ac8c77d317539..0000000000000
--- a/usb/usb-eagle-and-adi-930-usb-adsl-modem-driver.patch
+++ /dev/null
@@ -1,1906 +0,0 @@
-From castet.matthieu@free.fr Mon Nov 7 14:32:45 2005
-Message-ID: <436FD4C1.8020402@free.fr>
-Date: Mon, 07 Nov 2005 23:27:13 +0100
-From: matthieu castet <castet.matthieu@free.fr>
-To: Greg KH <greg@kroah.com>, Andrew Morton <akpm@osdl.org>
-CC: <usbatm@lists.infradead.org>
-Subject: USB: Eagle and ADI 930 usb adsl modem driver
-
-A driver for USB ADSL modems based on the ADI eagle chipset using the
-usb_atm infrastructure.
-
-The managing part was taken from bsd ueagle driver, other parts were
-written from scratch.
-
-The driver uses the in-kernel firmware loader :
-- to load a first usb firmware when the modem is in pre-firmware state
-- to load the dsp firmware that are swapped in host memory.
-- to load CMV (configuration and management variables) when the modem
-boot. (We can't use options or sysfs for this as there many possible
-values. See
-https://mail.gna.org/public/eagleusb-dev/2005-04/msg00031.html for a
-description of some)
-- to load fpga code for 930 chipset.
-
-The device had 4 endpoints :
-* 2 for data (use by usbatm). The incoming
-endpoint could be iso or bulk. The modem seems buggy and produce lot's
-of atm errors when using it in bulk mode for speed > 3Mbps, so iso
-endpoint is need for speed > 3Mbps. At the moment iso endpoint need a
-patched usbatm library and for this reason is not included in this patch.
-
-* One bulk endpoint for uploading dsp firmware
-
-* One irq endpoint that notices the driver
- - if we need to upload a page of the dsp firmware
- - an ack for read or write CMV and the value (for the read case).
-
-If order to make the driver cleaner, we design synchronous
-(read|write)_cmv :
--send a synchronous control message to the modem
--wait for an ack or a timeout
--return the value if needed.
-
-In order to run these synchronous usb messages we need a kernel thread.
-
-The driver has been tested with sagem fast 800 modems with different
-eagle chipset revision and with ADI 930 since April 2005.
-
-Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
-Signed-off-by: Andrew Morton <akpm@osdl.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/atm/Kconfig | 13
- drivers/usb/atm/Makefile | 1
- drivers/usb/atm/ueagle-atm.c | 1813 +++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 1827 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/atm/Kconfig
-+++ gregkh-2.6/drivers/usb/atm/Kconfig
-@@ -44,6 +44,19 @@ config USB_CXACRU
- To compile this driver as a module, choose M here: the
- module will be called cxacru.
-
-+config USB_UEAGLEATM
-+ tristate "ADI 930 and eagle USB DSL modem"
-+ depends on USB_ATM
-+ select FW_LOADER
-+ help
-+ Say Y here if you have an ADSL USB modem based on the ADI 930
-+ or eagle chipset. In order to use your modem you will need to
-+ install firmwares and CMV (Command Management Variables); see
-+ <https://gna.org/projects/ueagleatm/> for details.
-+
-+ To compile this driver as a module, choose M here: the
-+ module will be called ueagle-atm.
-+
- config USB_XUSBATM
- tristate "Other USB DSL modem support"
- depends on USB_ATM
---- gregkh-2.6.orig/drivers/usb/atm/Makefile
-+++ gregkh-2.6/drivers/usb/atm/Makefile
-@@ -4,6 +4,7 @@
-
- obj-$(CONFIG_USB_CXACRU) += cxacru.o
- obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o
-+obj-$(CONFIG_USB_UEAGLEATM) += ueagle-atm.o
- obj-$(CONFIG_USB_ATM) += usbatm.o
- obj-$(CONFIG_USB_XUSBATM) += xusbatm.o
-
---- /dev/null
-+++ gregkh-2.6/drivers/usb/atm/ueagle-atm.c
-@@ -0,0 +1,1813 @@
-+/*-
-+ * Copyright (c) 2003, 2004
-+ * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
-+ *
-+ * Copyright (c) 2005 Matthieu Castet <castet.matthieu@free.fr>
-+ *
-+ * This software is available to you under a choice of one of two
-+ * licenses. You may choose to be licensed under the terms of the GNU
-+ * General Public License (GPL) Version 2, available from the file
-+ * COPYING in the main directory of this source tree, or the
-+ * BSD license below:
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice unmodified, this list of conditions, and the following
-+ * disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ *
-+ * GPL license :
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ * HISTORY : some part of the code was base on ueagle 1.3 BSD driver,
-+ * Damien Bergamini agree to put his code under a DUAL GPL/BSD license.
-+ *
-+ * The rest of the code was was rewritten from scratch.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/moduleparam.h>
-+#include <linux/init.h>
-+#include <linux/crc32.h>
-+#include <linux/usb.h>
-+#include <linux/firmware.h>
-+#include <linux/ctype.h>
-+#include <linux/kthread.h>
-+#include <linux/version.h>
-+#include <asm/unaligned.h>
-+
-+#include "usbatm.h"
-+
-+#define EAGLEUSBVERSION "ueagle 1.1"
-+
-+
-+/*
-+ * Debug macros
-+ */
-+#define uea_dbg(usb_dev, format, args...) \
-+ do { \
-+ if (debug >= 1) \
-+ dev_dbg(&(usb_dev)->dev, \
-+ "[ueagle-atm dbg] %s: " format, \
-+ __FUNCTION__, ##args); \
-+ } while (0)
-+
-+#define uea_vdbg(usb_dev, format, args...) \
-+ do { \
-+ if (debug >= 2) \
-+ dev_dbg(&(usb_dev)->dev, \
-+ "[ueagle-atm vdbg] " format, ##args); \
-+ } while (0)
-+
-+#define uea_enters(usb_dev) \
-+ uea_vdbg(usb_dev, "entering %s\n", __FUNCTION__)
-+
-+#define uea_leaves(usb_dev) \
-+ uea_vdbg(usb_dev, "leaving %s\n", __FUNCTION__)
-+
-+#define uea_err(usb_dev, format,args...) \
-+ dev_err(&(usb_dev)->dev ,"[UEAGLE-ATM] " format , ##args)
-+
-+#define uea_warn(usb_dev, format,args...) \
-+ dev_warn(&(usb_dev)->dev ,"[Ueagle-atm] " format, ##args)
-+
-+#define uea_info(usb_dev, format,args...) \
-+ dev_info(&(usb_dev)->dev ,"[ueagle-atm] " format, ##args)
-+
-+struct uea_cmvs {
-+ u32 address;
-+ u16 offset;
-+ u32 data;
-+} __attribute__ ((packed));
-+
-+struct uea_softc {
-+ struct usb_device *usb_dev;
-+ struct usbatm_data *usbatm;
-+
-+ int modem_index;
-+ unsigned int driver_info;
-+
-+ int booting;
-+ int reset;
-+
-+ wait_queue_head_t sync_q;
-+
-+ struct task_struct *kthread;
-+ u32 data;
-+ wait_queue_head_t cmv_ack_wait;
-+ int cmv_ack;
-+
-+ struct work_struct task;
-+ u16 pageno;
-+ u16 ovl;
-+
-+ const struct firmware *dsp_firm;
-+ struct urb *urb_int;
-+
-+ u8 cmv_function;
-+ u16 cmv_idx;
-+ u32 cmv_address;
-+ u16 cmv_offset;
-+
-+ /* keep in sync with eaglectl */
-+ struct uea_stats {
-+ struct {
-+ u32 state;
-+ u32 flags;
-+ u32 mflags;
-+ u32 vidcpe;
-+ u32 vidco;
-+ u32 dsrate;
-+ u32 usrate;
-+ u32 dsunc;
-+ u32 usunc;
-+ u32 dscorr;
-+ u32 uscorr;
-+ u32 txflow;
-+ u32 rxflow;
-+ u32 usattenuation;
-+ u32 dsattenuation;
-+ u32 dsmargin;
-+ u32 usmargin;
-+ u32 firmid;
-+ } phy;
-+ } stats;
-+};
-+
-+/*
-+ * Elsa IDs
-+ */
-+#define ELSA_VID 0x05CC
-+#define ELSA_PID_PSTFIRM 0x3350
-+#define ELSA_PID_PREFIRM 0x3351
-+
-+/*
-+ * Sagem USB IDs
-+ */
-+#define EAGLE_VID 0x1110
-+#define EAGLE_I_PID_PREFIRM 0x9010 /* Eagle I */
-+#define EAGLE_I_PID_PSTFIRM 0x900F /* Eagle I */
-+
-+#define EAGLE_IIC_PID_PREFIRM 0x9024 /* Eagle IIC */
-+#define EAGLE_IIC_PID_PSTFIRM 0x9023 /* Eagle IIC */
-+
-+#define EAGLE_II_PID_PREFIRM 0x9022 /* Eagle II */
-+#define EAGLE_II_PID_PSTFIRM 0x9021 /* Eagle II */
-+
-+/*
-+ * Eagle III Pid
-+ */
-+#define EAGLE_III_PID_PREFIRM 0x9032 /* Eagle III */
-+#define EAGLE_III_PID_PSTFIRM 0x9031 /* Eagle III */
-+
-+/*
-+ * USR USB IDs
-+ */
-+#define USR_VID 0x0BAF
-+#define MILLER_A_PID_PREFIRM 0x00F2
-+#define MILLER_A_PID_PSTFIRM 0x00F1
-+#define MILLER_B_PID_PREFIRM 0x00FA
-+#define MILLER_B_PID_PSTFIRM 0x00F9
-+#define HEINEKEN_A_PID_PREFIRM 0x00F6
-+#define HEINEKEN_A_PID_PSTFIRM 0x00F5
-+#define HEINEKEN_B_PID_PREFIRM 0x00F8
-+#define HEINEKEN_B_PID_PSTFIRM 0x00F7
-+
-+#define PREFIRM 0
-+#define PSTFIRM (1<<7)
-+enum {
-+ ADI930 = 0,
-+ EAGLE_I,
-+ EAGLE_II,
-+ EAGLE_III
-+};
-+
-+/* macros for both struct usb_device_id and struct uea_softc */
-+#define UEA_IS_PREFIRM(x) \
-+ (!((x)->driver_info & PSTFIRM))
-+#define UEA_CHIP_VERSION(x) \
-+ ((x)->driver_info & 0xf)
-+
-+#define IS_ISDN(sc) \
-+ (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80)
-+
-+#define INS_TO_USBDEV(ins) ins->usb_dev
-+
-+#define GET_STATUS(data) \
-+ ((data >> 8) & 0xf)
-+#define IS_OPERATIONAL(sc) \
-+ (GET_STATUS(sc->stats.phy.state) == 2)
-+
-+/*
-+ * Set of macros to handle unaligned data in the firmware blob.
-+ * The FW_GET_BYTE() macro is provided only for consistency.
-+ */
-+
-+#define FW_GET_BYTE(p) *((__u8 *) (p))
-+#define FW_GET_WORD(p) le16_to_cpu(get_unaligned((__le16 *) (p)))
-+#define FW_GET_LONG(p) le32_to_cpu(get_unaligned((__le32 *) (p)))
-+
-+#define FW_DIR "ueagle-atm/"
-+#define NB_MODEM 4
-+
-+#define BULK_TIMEOUT 300
-+#define CTRL_TIMEOUT 1000
-+
-+#define ACK_TIMEOUT msecs_to_jiffies(1500)
-+
-+#define UEA_INTR_IFACE_NO 0
-+#define UEA_US_IFACE_NO 1
-+#define UEA_DS_IFACE_NO 2
-+
-+#define FASTEST_ISO_INTF 8
-+
-+#define UEA_BULK_DATA_PIPE 0x02
-+#define UEA_IDMA_PIPE 0x04
-+#define UEA_INTR_PIPE 0x04
-+#define UEA_ISO_DATA_PIPE 0x08
-+
-+#define UEA_SET_BLOCK 0x0001
-+#define UEA_SET_MODE 0x0003
-+#define UEA_SET_2183_DATA 0x0004
-+#define UEA_SET_TIMEOUT 0x0011
-+
-+#define UEA_LOOPBACK_OFF 0x0002
-+#define UEA_LOOPBACK_ON 0x0003
-+#define UEA_BOOT_IDMA 0x0006
-+#define UEA_START_RESET 0x0007
-+#define UEA_END_RESET 0x0008
-+
-+#define UEA_SWAP_MAILBOX (0x3fcd | 0x4000)
-+#define UEA_MPTX_START (0x3fce | 0x4000)
-+#define UEA_MPTX_MAILBOX (0x3fd6 | 0x4000)
-+#define UEA_MPRX_MAILBOX (0x3fdf | 0x4000)
-+
-+/* structure describing a block within a DSP page */
-+struct block_info {
-+ __le16 wHdr;
-+#define UEA_BIHDR 0xabcd
-+ __le16 wAddress;
-+ __le16 wSize;
-+ __le16 wOvlOffset;
-+ __le16 wOvl; /* overlay */
-+ __le16 wLast;
-+} __attribute__ ((packed));
-+#define BLOCK_INFO_SIZE 12
-+
-+/* structure representing a CMV (Configuration and Management Variable) */
-+struct cmv {
-+ __le16 wPreamble;
-+#define PREAMBLE 0x535c
-+ __u8 bDirection;
-+#define MODEMTOHOST 0x01
-+#define HOSTTOMODEM 0x10
-+ __u8 bFunction;
-+#define FUNCTION_TYPE(f) ((f) >> 4)
-+#define MEMACCESS 0x1
-+#define ADSLDIRECTIVE 0x7
-+
-+#define FUNCTION_SUBTYPE(f) ((f) & 0x0f)
-+/* for MEMACCESS */
-+#define REQUESTREAD 0x0
-+#define REQUESTWRITE 0x1
-+#define REPLYREAD 0x2
-+#define REPLYWRITE 0x3
-+/* for ADSLDIRECTIVE */
-+#define KERNELREADY 0x0
-+#define MODEMREADY 0x1
-+
-+#define MAKEFUNCTION(t, s) (((t) & 0xf) << 4 | ((s) & 0xf))
-+ __le16 wIndex;
-+ __le32 dwSymbolicAddress;
-+#define MAKESA(a, b, c, d) \
-+ (((c) & 0xff) << 24 | \
-+ ((d) & 0xff) << 16 | \
-+ ((a) & 0xff) << 8 | \
-+ ((b) & 0xff))
-+
-+#define SA_CNTL MAKESA('C', 'N', 'T', 'L')
-+#define SA_DIAG MAKESA('D', 'I', 'A', 'G')
-+#define SA_INFO MAKESA('I', 'N', 'F', 'O')
-+#define SA_OPTN MAKESA('O', 'P', 'T', 'N')
-+#define SA_RATE MAKESA('R', 'A', 'T', 'E')
-+#define SA_STAT MAKESA('S', 'T', 'A', 'T')
-+ __le16 wOffsetAddress;
-+ __le32 dwData;
-+} __attribute__ ((packed));
-+#define CMV_SIZE 16
-+
-+/* structure representing swap information */
-+struct swap_info {
-+ __u8 bSwapPageNo;
-+ __u8 bOvl; /* overlay */
-+} __attribute__ ((packed));
-+
-+/* structure representing interrupt data */
-+struct intr_pkt {
-+ __u8 bType;
-+ __u8 bNotification;
-+ __le16 wValue;
-+ __le16 wIndex;
-+ __le16 wLength;
-+ __le16 wInterrupt;
-+#define INT_LOADSWAPPAGE 0x0001
-+#define INT_INCOMINGCMV 0x0002
-+ union {
-+ struct {
-+ struct swap_info swapinfo;
-+ __le16 wDataSize;
-+ } __attribute__ ((packed)) s1;
-+
-+ struct {
-+ struct cmv cmv;
-+ __le16 wDataSize;
-+ } __attribute__ ((packed)) s2;
-+ } __attribute__ ((packed)) u;
-+#define bSwapPageNo u.s1.swapinfo.bSwapPageNo
-+#define bOvl u.s1.swapinfo.bOvl
-+} __attribute__ ((packed));
-+#define INTR_PKT_SIZE 28
-+
-+static struct usb_driver uea_driver;
-+static DECLARE_MUTEX(uea_semaphore);
-+static const char *chip_name[] = {"ADI930", "Eagle I", "Eagle II", "Eagle III"};
-+
-+static int modem_index;
-+static unsigned int debug;
-+static int sync_wait[NB_MODEM];
-+static char *cmv_file[NB_MODEM];
-+
-+module_param(debug, uint, 0644);
-+MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)");
-+module_param_array(sync_wait, bool, NULL, 0644);
-+MODULE_PARM_DESC(sync_wait, "wait the synchronisation before starting ATM");
-+module_param_array(cmv_file, charp, NULL, 0644);
-+MODULE_PARM_DESC(cmv_file,
-+ "file name with configuration and management variables");
-+
-+#define UPDATE_ATM_STAT(type, val) \
-+ do { \
-+ if (sc->usbatm->atm_dev) \
-+ sc->usbatm->atm_dev->type = val; \
-+ } while (0)
-+
-+/* Firmware loading */
-+#define LOAD_INTERNAL 0xA0
-+#define F8051_USBCS 0x7f92
-+
-+/**
-+ * uea_send_modem_cmd - Send a command for pre-firmware devices.
-+ */
-+static int uea_send_modem_cmd(struct usb_device *usb,
-+ u16 addr, u16 size, u8 * buff)
-+{
-+ int ret = -ENOMEM;
-+ u8 *xfer_buff;
-+
-+ xfer_buff = kmalloc(size, GFP_KERNEL);
-+ if (xfer_buff) {
-+ memcpy(xfer_buff, buff, size);
-+ ret = usb_control_msg(usb,
-+ usb_sndctrlpipe(usb, 0),
-+ LOAD_INTERNAL,
-+ USB_DIR_OUT | USB_TYPE_VENDOR |
-+ USB_RECIP_DEVICE, addr, 0, xfer_buff,
-+ size, CTRL_TIMEOUT);
-+ kfree(xfer_buff);
-+ }
-+
-+ if (ret < 0)
-+ return ret;
-+
-+ return (ret == size) ? 0 : -EIO;
-+}
-+
-+static void uea_upload_pre_firmware(const struct firmware *fw_entry, void *context)
-+{
-+ struct usb_device *usb = context;
-+ u8 *pfw, value;
-+ u32 crc = 0;
-+ int ret, size;
-+
-+ uea_enters(usb);
-+ if (!fw_entry) {
-+ uea_err(usb, "firmware is not available\n");
-+ goto err;
-+ }
-+
-+ pfw = fw_entry->data;
-+ size = fw_entry->size;
-+
-+ crc = FW_GET_LONG(pfw);
-+ pfw += 4;
-+ size -= 4;
-+ if (crc32_be(0, pfw, size) != crc) {
-+ uea_err(usb, "firmware is corrupted\n");
-+ goto err;
-+ }
-+
-+ /*
-+ * Start to upload formware : send reset
-+ */
-+ value = 1;
-+ ret = uea_send_modem_cmd(usb, F8051_USBCS, sizeof(value), &value);
-+
-+ if (ret < 0) {
-+ uea_err(usb, "modem reset failed with error %d\n", ret);
-+ goto err;
-+ }
-+
-+ while (size > 0) {
-+ u8 len = FW_GET_BYTE(pfw);
-+ u16 add = FW_GET_WORD(pfw + 1);
-+ ret = uea_send_modem_cmd(usb, add, len, pfw + 3);
-+ if (ret < 0) {
-+ uea_err(usb, "uploading firmware data failed "
-+ "with error %d\n", ret);
-+ goto err;
-+ }
-+ pfw += len + 3;
-+ size -= len + 3;
-+ }
-+
-+ /*
-+ * Tell the modem we finish : de-assert reset
-+ */
-+ value = 0;
-+ ret = uea_send_modem_cmd(usb, F8051_USBCS, 1, &value);
-+ if (ret < 0)
-+ uea_err(usb, "modem de-assert failed with error %d\n", ret);
-+ else
-+ uea_info(usb, "firmware uploaded\n");
-+
-+err:
-+ uea_leaves(usb);
-+}
-+
-+/**
-+ * uea_load_firmware - Load usb firmware for pre-firmware devices.
-+ */
-+static int uea_load_firmware(struct usb_device *usb, unsigned int ver)
-+{
-+ int ret;
-+ char *fw_name = FW_DIR "eagle.fw";
-+
-+ uea_enters(usb);
-+ uea_info(usb, "pre-firmware device, uploading firmware\n");
-+
-+ switch (ver) {
-+ case ADI930:
-+ fw_name = FW_DIR "adi930.fw";
-+ break;
-+ case EAGLE_I:
-+ fw_name = FW_DIR "eagleI.fw";
-+ break;
-+ case EAGLE_II:
-+ fw_name = FW_DIR "eagleII.fw";
-+ break;
-+ case EAGLE_III:
-+ fw_name = FW_DIR "eagleIII.fw";
-+ break;
-+ }
-+
-+ ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev, usb, uea_upload_pre_firmware);
-+ if (ret)
-+ uea_err(usb, "firmware %s is not available\n", fw_name);
-+ else
-+ uea_info(usb, "loading firmware %s\n", fw_name);
-+
-+ uea_leaves(usb);
-+ return ret;
-+}
-+
-+/* modem management : dsp firmware, send/read CMV, monitoring statistic
-+ */
-+
-+/*
-+ * Make sure that the DSP code provided is safe to use.
-+ */
-+static int check_dsp(u8 *dsp, unsigned int len)
-+{
-+ u8 pagecount, blockcount;
-+ u16 blocksize;
-+ u32 pageoffset;
-+ unsigned int i, j, p, pp;
-+
-+ /* enough space for pagecount? */
-+ if (len < 1)
-+ return 1;
-+
-+ pagecount = FW_GET_BYTE(dsp);
-+ p = 1;
-+
-+ /* enough space for page offsets? */
-+ if (p + 4 * pagecount > len)
-+ return 1;
-+
-+ for (i = 0; i < pagecount; i++) {
-+
-+ pageoffset = FW_GET_LONG(dsp + p);
-+ p += 4;
-+
-+ if (pageoffset == 0)
-+ continue;
-+
-+ /* enough space for blockcount? */
-+ if (pageoffset >= len)
-+ return 1;
-+
-+ pp = pageoffset;
-+ blockcount = FW_GET_BYTE(dsp + pp);
-+ pp += 1;
-+
-+ for (j = 0; j < blockcount; j++) {
-+
-+ /* enough space for block header? */
-+ if (pp + 4 > len)
-+ return 1;
-+
-+ pp += 2; /* skip blockaddr */
-+ blocksize = FW_GET_WORD(dsp + pp);
-+ pp += 2;
-+
-+ /* enough space for block data? */
-+ if (pp + blocksize > len)
-+ return 1;
-+
-+ pp += blocksize;
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * send data to the idma pipe
-+ * */
-+static int uea_idma_write(struct uea_softc *sc, void *data, u32 size)
-+{
-+ int ret = -ENOMEM;
-+ u8 *xfer_buff;
-+ int bytes_read;
-+
-+ xfer_buff = kmalloc(size, GFP_KERNEL);
-+ if (!xfer_buff) {
-+ uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n");
-+ return ret;
-+ }
-+
-+ memcpy(xfer_buff, data, size);
-+
-+ ret = usb_bulk_msg(sc->usb_dev,
-+ usb_sndbulkpipe(sc->usb_dev, UEA_IDMA_PIPE),
-+ xfer_buff, size, &bytes_read, BULK_TIMEOUT);
-+
-+ kfree(xfer_buff);
-+ if (ret < 0)
-+ return ret;
-+ if (size != bytes_read) {
-+ uea_err(INS_TO_USBDEV(sc), "size != bytes_read %d %d\n", size,
-+ bytes_read);
-+ return -EIO;
-+ }
-+
-+ return 0;
-+}
-+
-+static int request_dsp(struct uea_softc *sc)
-+{
-+ int ret;
-+ char *dsp_name;
-+
-+ if (UEA_CHIP_VERSION(sc) == ADI930) {
-+ if (IS_ISDN(sc))
-+ dsp_name = FW_DIR "DSP9i.bin";
-+ else
-+ dsp_name = FW_DIR "DSP9p.bin";
-+ } else {
-+ if (IS_ISDN(sc))
-+ dsp_name = FW_DIR "DSPei.bin";
-+ else
-+ dsp_name = FW_DIR "DSPep.bin";
-+ }
-+
-+ ret = request_firmware(&sc->dsp_firm,
-+ dsp_name, &sc->usb_dev->dev);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "requesting firmware %s failed with error %d\n",
-+ dsp_name, ret);
-+ return ret;
-+ }
-+
-+ if (check_dsp(sc->dsp_firm->data, sc->dsp_firm->size)) {
-+ uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n",
-+ dsp_name);
-+ release_firmware(sc->dsp_firm);
-+ sc->dsp_firm = NULL;
-+ return -EILSEQ;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * The uea_load_page() function must be called within a process context
-+ */
-+static void uea_load_page(void *xsc)
-+{
-+ struct uea_softc *sc = xsc;
-+ u16 pageno = sc->pageno;
-+ u16 ovl = sc->ovl;
-+ struct block_info bi;
-+
-+ u8 *p;
-+ u8 pagecount, blockcount;
-+ u16 blockaddr, blocksize;
-+ u32 pageoffset;
-+ int i;
-+
-+ /* reload firmware when reboot start and it's loaded already */
-+ if (ovl == 0 && pageno == 0 && sc->dsp_firm) {
-+ release_firmware(sc->dsp_firm);
-+ sc->dsp_firm = NULL;
-+ }
-+
-+ if (sc->dsp_firm == NULL && request_dsp(sc) < 0)
-+ return;
-+
-+ p = sc->dsp_firm->data;
-+ pagecount = FW_GET_BYTE(p);
-+ p += 1;
-+
-+ if (pageno >= pagecount)
-+ goto bad1;
-+
-+ p += 4 * pageno;
-+ pageoffset = FW_GET_LONG(p);
-+
-+ if (pageoffset == 0)
-+ goto bad1;
-+
-+ p = sc->dsp_firm->data + pageoffset;
-+ blockcount = FW_GET_BYTE(p);
-+ p += 1;
-+
-+ uea_dbg(INS_TO_USBDEV(sc),
-+ "sending %u blocks for DSP page %u\n", blockcount, pageno);
-+
-+ bi.wHdr = cpu_to_le16(UEA_BIHDR);
-+ bi.wOvl = cpu_to_le16(ovl);
-+ bi.wOvlOffset = cpu_to_le16(ovl | 0x8000);
-+
-+ for (i = 0; i < blockcount; i++) {
-+ blockaddr = FW_GET_WORD(p);
-+ p += 2;
-+
-+ blocksize = FW_GET_WORD(p);
-+ p += 2;
-+
-+ bi.wSize = cpu_to_le16(blocksize);
-+ bi.wAddress = cpu_to_le16(blockaddr);
-+ bi.wLast = cpu_to_le16((i == blockcount - 1) ? 1 : 0);
-+
-+ /* send block info through the IDMA pipe */
-+ if (uea_idma_write(sc, &bi, BLOCK_INFO_SIZE))
-+ goto bad2;
-+
-+ /* send block data through the IDMA pipe */
-+ if (uea_idma_write(sc, p, blocksize))
-+ goto bad2;
-+
-+ p += blocksize;
-+ }
-+
-+ return;
-+
-+bad2:
-+ uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i);
-+ return;
-+bad1:
-+ uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n",pageno);
-+}
-+
-+static inline void wake_up_cmv_ack(struct uea_softc *sc)
-+{
-+ sc->cmv_ack = 1;
-+ wake_up(&sc->cmv_ack_wait);
-+}
-+
-+static inline int wait_cmv_ack(struct uea_softc *sc)
-+{
-+ int ret = wait_event_timeout(sc->cmv_ack_wait,
-+ sc->cmv_ack, ACK_TIMEOUT);
-+ sc->cmv_ack = 0;
-+
-+ if (ret < 0)
-+ return ret;
-+
-+ return (ret == 0) ? -ETIMEDOUT : 0;
-+
-+}
-+
-+#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
-+
-+static int uea_request(struct uea_softc *sc,
-+ u16 value, u16 index, u16 size, void *data)
-+{
-+ u8 *xfer_buff;
-+ int ret = -ENOMEM;
-+
-+ xfer_buff = kmalloc(size, GFP_KERNEL);
-+ if (!xfer_buff) {
-+ uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n");
-+ return ret;
-+ }
-+ memcpy(xfer_buff, data, size);
-+
-+ ret = usb_control_msg(sc->usb_dev, usb_sndctrlpipe(sc->usb_dev, 0),
-+ UCDC_SEND_ENCAPSULATED_COMMAND,
-+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-+ value, index, xfer_buff, size, CTRL_TIMEOUT);
-+
-+ kfree(xfer_buff);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc), "usb_control_msg error %d\n", ret);
-+ return ret;
-+ }
-+
-+ if (ret != size) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "usb_control_msg send only %d bytes (instead of %d)\n",
-+ ret, size);
-+ return -EIO;
-+ }
-+
-+ return 0;
-+}
-+
-+static int uea_cmv(struct uea_softc *sc,
-+ u8 function, u32 address, u16 offset, u32 data)
-+{
-+ struct cmv cmv;
-+ int ret;
-+
-+ /* we send a request, but we expect a reply */
-+ sc->cmv_function = function | 0x2;
-+ sc->cmv_idx++;
-+ sc->cmv_address = address;
-+ sc->cmv_offset = offset;
-+
-+ cmv.wPreamble = cpu_to_le16(PREAMBLE);
-+ cmv.bDirection = HOSTTOMODEM;
-+ cmv.bFunction = function;
-+ cmv.wIndex = cpu_to_le16(sc->cmv_idx);
-+ put_unaligned(cpu_to_le32(address), &cmv.dwSymbolicAddress);
-+ cmv.wOffsetAddress = cpu_to_le16(offset);
-+ put_unaligned(cpu_to_le32(data >> 16 | data << 16), &cmv.dwData);
-+
-+ ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv);
-+ if (ret < 0)
-+ return ret;
-+ return wait_cmv_ack(sc);
-+}
-+
-+static inline int uea_read_cmv(struct uea_softc *sc,
-+ u32 address, u16 offset, u32 *data)
-+{
-+ int ret = uea_cmv(sc, MAKEFUNCTION(MEMACCESS, REQUESTREAD),
-+ address, offset, 0);
-+ if (ret < 0)
-+ uea_err(INS_TO_USBDEV(sc),
-+ "reading cmv failed with error %d\n", ret);
-+ else
-+ *data = sc->data;
-+
-+ return ret;
-+}
-+
-+static inline int uea_write_cmv(struct uea_softc *sc,
-+ u32 address, u16 offset, u32 data)
-+{
-+ int ret = uea_cmv(sc, MAKEFUNCTION(MEMACCESS, REQUESTWRITE),
-+ address, offset, data);
-+ if (ret < 0)
-+ uea_err(INS_TO_USBDEV(sc),
-+ "writing cmv failed with error %d\n", ret);
-+
-+ return ret;
-+}
-+
-+/*
-+ * Monitor the modem and update the stat
-+ * return 0 if everything is ok
-+ * return < 0 if an error occurs (-EAGAIN reboot needed)
-+ */
-+static int uea_stat(struct uea_softc *sc)
-+{
-+ u32 data;
-+ int ret;
-+
-+ uea_enters(INS_TO_USBDEV(sc));
-+ data = sc->stats.phy.state;
-+
-+ ret = uea_read_cmv(sc, SA_STAT, 0, &sc->stats.phy.state);
-+ if (ret < 0)
-+ return ret;
-+
-+ switch (GET_STATUS(sc->stats.phy.state)) {
-+ case 0: /* not yet synchronized */
-+ uea_dbg(INS_TO_USBDEV(sc),
-+ "modem not yet synchronized\n");
-+ return 0;
-+
-+ case 1: /* initialization */
-+ uea_dbg(INS_TO_USBDEV(sc), "modem initializing\n");
-+ return 0;
-+
-+ case 2: /* operational */
-+ uea_vdbg(INS_TO_USBDEV(sc), "modem operational\n");
-+ break;
-+
-+ case 3: /* fail ... */
-+ uea_info(INS_TO_USBDEV(sc), "modem synchronization failed\n");
-+ return -EAGAIN;
-+
-+ case 4 ... 6: /* test state */
-+ uea_warn(INS_TO_USBDEV(sc),
-+ "modem in test mode - not supported\n");
-+ return -EAGAIN;
-+
-+ case 7: /* fast-retain ... */
-+ uea_info(INS_TO_USBDEV(sc), "modem in fast-retain mode\n");
-+ return 0;
-+ default:
-+ uea_err(INS_TO_USBDEV(sc), "modem invalid SW mode %d\n",
-+ GET_STATUS(sc->stats.phy.state));
-+ return -EAGAIN;
-+ }
-+
-+ if (GET_STATUS(data) != 2) {
-+ uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_OFF, 0, NULL);
-+ uea_info(INS_TO_USBDEV(sc), "modem operational\n");
-+
-+ /* release the dsp firmware as it is not needed until
-+ * the next failure
-+ */
-+ if (sc->dsp_firm) {
-+ release_firmware(sc->dsp_firm);
-+ sc->dsp_firm = NULL;
-+ }
-+
-+ ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid);
-+ if (ret < 0)
-+ return ret;
-+ uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n",
-+ sc->stats.phy.firmid);
-+ }
-+
-+ /* always update it as atm layer could not be init when we switch to
-+ * operational state
-+ */
-+ UPDATE_ATM_STAT(signal, ATM_PHY_SIG_FOUND);
-+
-+ /* wake up processes waiting for synchronization */
-+ wake_up(&sc->sync_q);
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 2, &sc->stats.phy.flags);
-+ if (ret < 0)
-+ return ret;
-+ sc->stats.phy.mflags |= sc->stats.phy.flags;
-+
-+ /* in case of a flags ( for example delineation LOSS (& 0x10)),
-+ * we check the status again in order to detect the failure earlier
-+ */
-+ if (sc->stats.phy.flags) {
-+ uea_dbg(INS_TO_USBDEV(sc), "Stat flag = %d\n",
-+ sc->stats.phy.flags);
-+ return 0;
-+ }
-+
-+ ret = uea_read_cmv(sc, SA_RATE, 0, &data);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* in bulk mode the modem have problem with high rate
-+ * changing internal timing could improve things, but the
-+ * value is misterious.
-+ * ADI930 don't support it (-EPIPE error).
-+ */
-+ if (UEA_CHIP_VERSION(sc) != ADI930
-+ && sc->stats.phy.dsrate != (data >> 16) * 32) {
-+ /* Original timming from ADI(used in windows driver)
-+ * 0x20ffff>>16 * 32 = 32 * 32 = 1Mbits
-+ */
-+ u16 timeout = (data <= 0x20ffff) ? 0 : 1;
-+ ret = uea_request(sc, UEA_SET_TIMEOUT, timeout, 0, NULL);
-+ uea_info(INS_TO_USBDEV(sc),
-+ "setting new timeout %d%s\n", timeout,
-+ ret < 0?" failed":"");
-+ }
-+ sc->stats.phy.dsrate = (data >> 16) * 32;
-+ sc->stats.phy.usrate = (data & 0xffff) * 32;
-+ UPDATE_ATM_STAT(link_rate, sc->stats.phy.dsrate * 1000 / 424);
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 23, &data);
-+ if (ret < 0)
-+ return ret;
-+ sc->stats.phy.dsattenuation = (data & 0xff) / 2;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 47, &data);
-+ if (ret < 0)
-+ return ret;
-+ sc->stats.phy.usattenuation = (data & 0xff) / 2;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 25, &sc->stats.phy.dsmargin);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 49, &sc->stats.phy.usmargin);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 51, &sc->stats.phy.rxflow);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 52, &sc->stats.phy.txflow);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 54, &sc->stats.phy.dsunc);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* only for atu-c */
-+ ret = uea_read_cmv(sc, SA_DIAG, 58, &sc->stats.phy.usunc);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_DIAG, 53, &sc->stats.phy.dscorr);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* only for atu-c */
-+ ret = uea_read_cmv(sc, SA_DIAG, 57, &sc->stats.phy.uscorr);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_INFO, 8, &sc->stats.phy.vidco);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = uea_read_cmv(sc, SA_INFO, 13, &sc->stats.phy.vidcpe);
-+ if (ret < 0)
-+ return ret;
-+
-+ return 0;
-+}
-+
-+static int request_cmvs(struct uea_softc *sc,
-+ struct uea_cmvs **cmvs, const struct firmware **fw)
-+{
-+ int ret, size;
-+ u8 *data;
-+ char *file;
-+ static char cmv_name[256] = FW_DIR;
-+
-+ if (cmv_file[sc->modem_index] == NULL) {
-+ if (UEA_CHIP_VERSION(sc) == ADI930)
-+ file = (IS_ISDN(sc)) ? "CMV9i.bin" : "CMV9p.bin";
-+ else
-+ file = (IS_ISDN(sc)) ? "CMVei.bin" : "CMVep.bin";
-+ } else
-+ file = cmv_file[sc->modem_index];
-+
-+ strcpy(cmv_name, FW_DIR);
-+ strlcat(cmv_name, file, sizeof(cmv_name));
-+
-+ ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "requesting firmware %s failed with error %d\n",
-+ cmv_name, ret);
-+ return ret;
-+ }
-+
-+ data = (u8 *) (*fw)->data;
-+ size = *data * sizeof(struct uea_cmvs) + 1;
-+ if (size != (*fw)->size) {
-+ uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n",
-+ cmv_name);
-+ release_firmware(*fw);
-+ return -EILSEQ;
-+ }
-+
-+ *cmvs = (struct uea_cmvs *)(data + 1);
-+ return *data;
-+}
-+
-+/* Start boot post firmware modem:
-+ * - send reset commands through usb control pipe
-+ * - start workqueue for DSP loading
-+ * - send CMV options to modem
-+ */
-+
-+static int uea_start_reset(struct uea_softc *sc)
-+{
-+ u16 zero = 0; /* ;-) */
-+ int i, len, ret;
-+ struct uea_cmvs *cmvs;
-+ const struct firmware *cmvs_fw;
-+
-+ uea_enters(INS_TO_USBDEV(sc));
-+ uea_info(INS_TO_USBDEV(sc), "(re)booting started\n");
-+
-+ sc->booting = 1;
-+ UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST);
-+
-+ /* reset statistics */
-+ memset(&sc->stats, 0, sizeof(struct uea_stats));
-+
-+ /* tell the modem that we want to boot in IDMA mode */
-+ uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_ON, 0, NULL);
-+ uea_request(sc, UEA_SET_MODE, UEA_BOOT_IDMA, 0, NULL);
-+
-+ /* enter reset mode */
-+ uea_request(sc, UEA_SET_MODE, UEA_START_RESET, 0, NULL);
-+
-+ /* original driver use 200ms, but windows driver use 100ms */
-+ msleep(100);
-+
-+ /* leave reset mode */
-+ uea_request(sc, UEA_SET_MODE, UEA_END_RESET, 0, NULL);
-+
-+ /* clear tx and rx mailboxes */
-+ uea_request(sc, UEA_SET_2183_DATA, UEA_MPTX_MAILBOX, 2, &zero);
-+ uea_request(sc, UEA_SET_2183_DATA, UEA_MPRX_MAILBOX, 2, &zero);
-+ uea_request(sc, UEA_SET_2183_DATA, UEA_SWAP_MAILBOX, 2, &zero);
-+
-+ msleep(1000);
-+ sc->cmv_function = MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY);
-+ sc->booting = 0;
-+
-+ /* start loading DSP */
-+ sc->pageno = 0;
-+ sc->ovl = 0;
-+ schedule_work(&sc->task);
-+
-+ /* wait for modem ready CMV */
-+ ret = wait_cmv_ack(sc);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* Enter in R-IDLE (cmv) until instructed otherwise */
-+ ret = uea_write_cmv(sc, SA_CNTL, 0, 1);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* get options */
-+ ret = len = request_cmvs(sc, &cmvs, &cmvs_fw);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* send options */
-+ for (i = 0; i < len; i++) {
-+ ret = uea_write_cmv(sc, FW_GET_LONG(&cmvs[i].address),
-+ FW_GET_WORD(&cmvs[i].offset),
-+ FW_GET_LONG(&cmvs[i].data));
-+ if (ret < 0)
-+ goto out;
-+ }
-+ /* Enter in R-ACT-REQ */
-+ ret = uea_write_cmv(sc, SA_CNTL, 0, 2);
-+out:
-+ release_firmware(cmvs_fw);
-+ sc->reset = 0;
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return ret;
-+}
-+
-+/*
-+ * In case of an error wait 1s before rebooting the modem
-+ * if the modem don't request reboot (-EAGAIN).
-+ * Monitor the modem every 1s.
-+ */
-+
-+static int uea_kthread(void *data)
-+{
-+ struct uea_softc *sc = data;
-+ int ret = -EAGAIN;
-+
-+ uea_enters(INS_TO_USBDEV(sc));
-+ while (!kthread_should_stop()) {
-+ if (ret < 0 || sc->reset)
-+ ret = uea_start_reset(sc);
-+ if (!ret)
-+ ret = uea_stat(sc);
-+ if (ret != -EAGAIN)
-+ msleep(1000);
-+ }
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return ret;
-+}
-+
-+/* Load second usb firmware for ADI930 chip */
-+static int load_XILINX_firmware(struct uea_softc *sc)
-+{
-+ const struct firmware *fw_entry;
-+ int ret, size, u, ln;
-+ u8 *pfw, value;
-+ char *fw_name = FW_DIR "930-fpga.bin";
-+
-+ uea_enters(INS_TO_USBDEV(sc));
-+
-+ ret = request_firmware(&fw_entry, fw_name, &sc->usb_dev->dev);
-+ if (ret) {
-+ uea_err(INS_TO_USBDEV(sc), "firmware %s is not available\n",
-+ fw_name);
-+ goto err0;
-+ }
-+
-+ pfw = fw_entry->data;
-+ size = fw_entry->size;
-+ if (size != 0x577B) {
-+ uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n",
-+ fw_name);
-+ ret = -EILSEQ;
-+ goto err1;
-+ }
-+ for (u = 0; u < size; u += ln) {
-+ ln = min(size - u, 64);
-+ ret = uea_request(sc, 0xe, 0, ln, pfw + u);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "elsa download data failed (%d)\n", ret);
-+ goto err1;
-+ }
-+ }
-+
-+ /* finish to send the fpga
-+ */
-+ ret = uea_request(sc, 0xe, 1, 0, NULL);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "elsa download data failed (%d)\n", ret);
-+ goto err1;
-+ }
-+
-+ /*
-+ * Tell the modem we finish : de-assert reset
-+ */
-+ value = 0;
-+ ret = uea_send_modem_cmd(sc->usb_dev, 0xe, 1, &value);
-+ if (ret < 0)
-+ uea_err(sc->usb_dev, "elsa de-assert failed with error %d\n", ret);
-+
-+
-+err1:
-+ release_firmware(fw_entry);
-+err0:
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return ret;
-+}
-+
-+static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv)
-+{
-+ uea_enters(INS_TO_USBDEV(sc));
-+ if (le16_to_cpu(cmv->wPreamble) != PREAMBLE)
-+ goto bad1;
-+
-+ if (cmv->bDirection != MODEMTOHOST)
-+ goto bad1;
-+
-+ /* FIXME : ADI930 reply wrong preambule (func = 2, sub = 2) to
-+ * the first MEMACESS cmv. Ignore it...
-+ */
-+ if (cmv->bFunction != sc->cmv_function) {
-+ if (UEA_CHIP_VERSION(sc) == ADI930
-+ && cmv->bFunction == MAKEFUNCTION(2, 2)) {
-+ cmv->wIndex = cpu_to_le16(sc->cmv_idx);
-+ put_unaligned(cpu_to_le32(sc->cmv_address), &cmv->dwSymbolicAddress);
-+ cmv->wOffsetAddress = cpu_to_le16(sc->cmv_offset);
-+ }
-+ else
-+ goto bad2;
-+ }
-+
-+ if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) {
-+ wake_up_cmv_ack(sc);
-+ return;
-+ }
-+
-+ /* in case of MEMACCESS */
-+ if (le16_to_cpu(cmv->wIndex) != sc->cmv_idx ||
-+ le32_to_cpu(get_unaligned(&cmv->dwSymbolicAddress)) !=
-+ sc->cmv_address
-+ || le16_to_cpu(cmv->wOffsetAddress) != sc->cmv_offset)
-+ goto bad2;
-+
-+ sc->data = le32_to_cpu(get_unaligned(&cmv->dwData));
-+ sc->data = sc->data << 16 | sc->data >> 16;
-+
-+ wake_up_cmv_ack(sc);
-+ return;
-+
-+bad2:
-+ uea_err(INS_TO_USBDEV(sc), "unexpected cmv received,"
-+ "Function : %d, Subfunction : %d\n",
-+ FUNCTION_TYPE(cmv->bFunction),
-+ FUNCTION_SUBTYPE(cmv->bFunction));
-+ return;
-+
-+bad1:
-+ uea_err(INS_TO_USBDEV(sc), "invalid cmv received, "
-+ "wPreamble %d, bDirection %d\n",
-+ le16_to_cpu(cmv->wPreamble), cmv->bDirection);
-+}
-+
-+/*
-+ * interrupt handler
-+ */
-+static void uea_intr(struct urb *urb, struct pt_regs *regs)
-+{
-+ struct uea_softc *sc = (struct uea_softc *)urb->context;
-+ struct intr_pkt *intr;
-+ uea_enters(INS_TO_USBDEV(sc));
-+
-+ if (urb->status < 0) {
-+ uea_err(INS_TO_USBDEV(sc), "uea_intr() failed with %d\n",
-+ urb->status);
-+ return;
-+ }
-+
-+ intr = (struct intr_pkt *) urb->transfer_buffer;
-+
-+ /* device-to-host interrupt */
-+ if (intr->bType != 0x08 || sc->booting) {
-+ uea_err(INS_TO_USBDEV(sc), "wrong intr\n");
-+ // rebooting ?
-+ // sc->reset = 1;
-+ goto resubmit;
-+ }
-+
-+ switch (le16_to_cpu(intr->wInterrupt)) {
-+ case INT_LOADSWAPPAGE:
-+ sc->pageno = intr->bSwapPageNo;
-+ sc->ovl = intr->bOvl >> 4 | intr->bOvl << 4;
-+ schedule_work(&sc->task);
-+ break;
-+
-+ case INT_INCOMINGCMV:
-+ uea_dispatch_cmv(sc, &intr->u.s2.cmv);
-+ break;
-+
-+ default:
-+ uea_err(INS_TO_USBDEV(sc), "unknown intr %u\n",
-+ le16_to_cpu(intr->wInterrupt));
-+ }
-+
-+resubmit:
-+ usb_submit_urb(sc->urb_int, GFP_ATOMIC);
-+}
-+
-+/*
-+ * Start the modem : init the data and start kernel thread
-+ */
-+static int uea_boot(struct uea_softc *sc)
-+{
-+ int ret;
-+ struct intr_pkt *intr;
-+
-+ uea_enters(INS_TO_USBDEV(sc));
-+
-+ INIT_WORK(&sc->task, uea_load_page, sc);
-+ init_waitqueue_head(&sc->sync_q);
-+ init_waitqueue_head(&sc->cmv_ack_wait);
-+
-+ if (UEA_CHIP_VERSION(sc) == ADI930)
-+ load_XILINX_firmware(sc);
-+
-+ intr = kmalloc(INTR_PKT_SIZE, GFP_KERNEL);
-+ if (!intr) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "cannot allocate interrupt package\n");
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return -ENOMEM;
-+ }
-+
-+ sc->urb_int = usb_alloc_urb(0, GFP_KERNEL);
-+ if (!sc->urb_int) {
-+ uea_err(INS_TO_USBDEV(sc), "cannot allocate interrupt URB\n");
-+ goto err;
-+ }
-+
-+ usb_fill_int_urb(sc->urb_int, sc->usb_dev,
-+ usb_rcvintpipe(sc->usb_dev, UEA_INTR_PIPE),
-+ intr, INTR_PKT_SIZE, uea_intr, sc,
-+ sc->usb_dev->actconfig->interface[0]->altsetting[0].
-+ endpoint[0].desc.bInterval);
-+
-+ ret = usb_submit_urb(sc->urb_int, GFP_KERNEL);
-+ if (ret < 0) {
-+ uea_err(INS_TO_USBDEV(sc),
-+ "urb submition failed with error %d\n", ret);
-+ goto err1;
-+ }
-+
-+ sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm");
-+ if (sc->kthread == ERR_PTR(-ENOMEM)) {
-+ uea_err(INS_TO_USBDEV(sc), "failed to create thread\n");
-+ goto err2;
-+ }
-+
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return 0;
-+
-+err2:
-+ usb_kill_urb(sc->urb_int);
-+err1:
-+ kfree(intr);
-+err:
-+ usb_free_urb(sc->urb_int);
-+ uea_leaves(INS_TO_USBDEV(sc));
-+ return -ENOMEM;
-+}
-+
-+/*
-+ * Stop the modem : kill kernel thread and free data
-+ */
-+static void uea_stop(struct uea_softc *sc)
-+{
-+ int ret;
-+ uea_enters(INS_TO_USBDEV(sc));
-+ ret = kthread_stop(sc->kthread);
-+ uea_info(INS_TO_USBDEV(sc), "kthread finish with status %d\n", ret);
-+
-+ /* stop any pending boot process */
-+ flush_scheduled_work();
-+
-+ uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_ON, 0, NULL);
-+
-+ usb_kill_urb(sc->urb_int);
-+ kfree(sc->urb_int->transfer_buffer);
-+ usb_free_urb(sc->urb_int);
-+
-+ if (sc->dsp_firm)
-+ release_firmware(sc->dsp_firm);
-+ uea_leaves(INS_TO_USBDEV(sc));
-+}
-+
-+/* syfs interface */
-+static struct uea_softc *dev_to_uea(struct device *dev)
-+{
-+ struct usb_interface *intf;
-+ struct usbatm_data *usbatm;
-+
-+ intf = to_usb_interface(dev);
-+ if (!intf)
-+ return NULL;
-+
-+ usbatm = usb_get_intfdata(intf);
-+ if (!usbatm)
-+ return NULL;
-+
-+ return usbatm->driver_data;
-+}
-+
-+static ssize_t read_status(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ int ret = -ENODEV;
-+ struct uea_softc *sc;
-+
-+ down(&uea_semaphore);
-+ sc = dev_to_uea(dev);
-+ if (!sc)
-+ goto out;
-+ ret = snprintf(buf, 10, "%08x\n", sc->stats.phy.state);
-+out:
-+ up(&uea_semaphore);
-+ return ret;
-+}
-+
-+static ssize_t reboot(struct device *dev, struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ int ret = -ENODEV;
-+ struct uea_softc *sc;
-+
-+ down(&uea_semaphore);
-+ sc = dev_to_uea(dev);
-+ if (!sc)
-+ goto out;
-+ sc->reset = 1;
-+ ret = count;
-+out:
-+ up(&uea_semaphore);
-+ return ret;
-+}
-+
-+static DEVICE_ATTR(stat_status, S_IWUGO | S_IRUGO, read_status, reboot);
-+
-+static ssize_t read_human_status(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ int ret = -ENODEV;
-+ struct uea_softc *sc;
-+
-+ down(&uea_semaphore);
-+ sc = dev_to_uea(dev);
-+ if (!sc)
-+ goto out;
-+
-+ switch (GET_STATUS(sc->stats.phy.state)) {
-+ case 0:
-+ ret = sprintf(buf, "Modem is booting\n");
-+ break;
-+ case 1:
-+ ret = sprintf(buf, "Modem is initializing\n");
-+ break;
-+ case 2:
-+ ret = sprintf(buf, "Modem is operational\n");
-+ break;
-+ default:
-+ ret = sprintf(buf, "Modem synchronization failed\n");
-+ break;
-+ }
-+out:
-+ up(&uea_semaphore);
-+ return ret;
-+}
-+
-+static DEVICE_ATTR(stat_human_status, S_IWUGO | S_IRUGO, read_human_status, NULL);
-+
-+static ssize_t read_delin(struct device *dev, struct device_attribute *attr,
-+ char *buf)
-+{
-+ int ret = -ENODEV;
-+ struct uea_softc *sc;
-+
-+ down(&uea_semaphore);
-+ sc = dev_to_uea(dev);
-+ if (!sc)
-+ goto out;
-+
-+ if (sc->stats.phy.flags & 0x0C00)
-+ ret = sprintf(buf, "ERROR\n");
-+ else if (sc->stats.phy.flags & 0x0030)
-+ ret = sprintf(buf, "LOSS\n");
-+ else
-+ ret = sprintf(buf, "GOOD\n");
-+out:
-+ up(&uea_semaphore);
-+ return ret;
-+}
-+
-+static DEVICE_ATTR(stat_delin, S_IWUGO | S_IRUGO, read_delin, NULL);
-+
-+#define UEA_ATTR(name, reset) \
-+ \
-+static ssize_t read_##name(struct device *dev, \
-+ struct device_attribute *attr, char *buf) \
-+{ \
-+ int ret = -ENODEV; \
-+ struct uea_softc *sc; \
-+ \
-+ down(&uea_semaphore); \
-+ sc = dev_to_uea(dev); \
-+ if (!sc) \
-+ goto out; \
-+ ret = snprintf(buf, 10, "%08x\n", sc->stats.phy.name); \
-+ if (reset) \
-+ sc->stats.phy.name = 0; \
-+out: \
-+ up(&uea_semaphore); \
-+ return ret; \
-+} \
-+ \
-+static DEVICE_ATTR(stat_##name, S_IRUGO, read_##name, NULL)
-+
-+UEA_ATTR(mflags, 1);
-+UEA_ATTR(vidcpe, 0);
-+UEA_ATTR(usrate, 0);
-+UEA_ATTR(dsrate, 0);
-+UEA_ATTR(usattenuation, 0);
-+UEA_ATTR(dsattenuation, 0);
-+UEA_ATTR(usmargin, 0);
-+UEA_ATTR(dsmargin, 0);
-+UEA_ATTR(txflow, 0);
-+UEA_ATTR(rxflow, 0);
-+UEA_ATTR(uscorr, 0);
-+UEA_ATTR(dscorr, 0);
-+UEA_ATTR(usunc, 0);
-+UEA_ATTR(dsunc, 0);
-+
-+/* Retrieve the device End System Identifier (MAC) */
-+
-+#define htoi(x) (isdigit(x) ? x-'0' : toupper(x)-'A'+10)
-+static int uea_getesi(struct uea_softc *sc, u_char * esi)
-+{
-+ unsigned char mac_str[2 * ETH_ALEN + 1];
-+ int i;
-+ if (usb_string
-+ (sc->usb_dev, sc->usb_dev->descriptor.iSerialNumber, mac_str,
-+ sizeof(mac_str)) != 2 * ETH_ALEN)
-+ return 1;
-+
-+ for (i = 0; i < ETH_ALEN; i++)
-+ esi[i] = htoi(mac_str[2 * i]) * 16 + htoi(mac_str[2 * i + 1]);
-+
-+ return 0;
-+}
-+
-+/* ATM stuff */
-+static int uea_atm_open(struct usbatm_data *usbatm, struct atm_dev *atm_dev)
-+{
-+ struct uea_softc *sc = usbatm->driver_data;
-+
-+ return uea_getesi(sc, atm_dev->esi);
-+}
-+
-+static int uea_heavy(struct usbatm_data *usbatm, struct usb_interface *intf)
-+{
-+ struct uea_softc *sc = usbatm->driver_data;
-+
-+ wait_event(sc->sync_q, IS_OPERATIONAL(sc));
-+
-+ return 0;
-+
-+}
-+
-+static int claim_interface(struct usb_device *usb_dev,
-+ struct usbatm_data *usbatm, int ifnum)
-+{
-+ int ret;
-+ struct usb_interface *intf = usb_ifnum_to_if(usb_dev, ifnum);
-+
-+ if (!intf) {
-+ uea_err(usb_dev, "interface %d not found\n", ifnum);
-+ return -ENODEV;
-+ }
-+
-+ ret = usb_driver_claim_interface(&uea_driver, intf, usbatm);
-+ if (ret != 0)
-+ uea_err(usb_dev, "can't claim interface %d, error %d\n", ifnum,
-+ ret);
-+ return ret;
-+}
-+
-+static void create_fs_entries(struct uea_softc *sc, struct usb_interface *intf)
-+{
-+ /* sysfs interface */
-+ device_create_file(&intf->dev, &dev_attr_stat_status);
-+ device_create_file(&intf->dev, &dev_attr_stat_mflags);
-+ device_create_file(&intf->dev, &dev_attr_stat_human_status);
-+ device_create_file(&intf->dev, &dev_attr_stat_delin);
-+ device_create_file(&intf->dev, &dev_attr_stat_vidcpe);
-+ device_create_file(&intf->dev, &dev_attr_stat_usrate);
-+ device_create_file(&intf->dev, &dev_attr_stat_dsrate);
-+ device_create_file(&intf->dev, &dev_attr_stat_usattenuation);
-+ device_create_file(&intf->dev, &dev_attr_stat_dsattenuation);
-+ device_create_file(&intf->dev, &dev_attr_stat_usmargin);
-+ device_create_file(&intf->dev, &dev_attr_stat_dsmargin);
-+ device_create_file(&intf->dev, &dev_attr_stat_txflow);
-+ device_create_file(&intf->dev, &dev_attr_stat_rxflow);
-+ device_create_file(&intf->dev, &dev_attr_stat_uscorr);
-+ device_create_file(&intf->dev, &dev_attr_stat_dscorr);
-+ device_create_file(&intf->dev, &dev_attr_stat_usunc);
-+ device_create_file(&intf->dev, &dev_attr_stat_dsunc);
-+}
-+
-+static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
-+ const struct usb_device_id *id, int *heavy)
-+{
-+ struct usb_device *usb = interface_to_usbdev(intf);
-+ struct uea_softc *sc;
-+ int ret, ifnum = intf->altsetting->desc.bInterfaceNumber;
-+
-+ uea_enters(usb);
-+
-+ /* interface 0 is for firmware/monitoring */
-+ if (ifnum != UEA_INTR_IFACE_NO)
-+ return -ENODEV;
-+
-+ *heavy = sync_wait[modem_index];
-+
-+ /* interface 1 is for outbound traffic */
-+ ret = claim_interface(usb, usbatm, UEA_US_IFACE_NO);
-+ if (ret < 0)
-+ return ret;
-+
-+ /* ADI930 has only 2 interfaces and inbound traffic
-+ * is on interface 1
-+ */
-+ if (UEA_CHIP_VERSION(id) != ADI930) {
-+ /* interface 2 is for inbound traffic */
-+ ret = claim_interface(usb, usbatm, UEA_DS_IFACE_NO);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL);
-+ if (!sc) {
-+ uea_err(INS_TO_USBDEV(sc), "uea_init: not enough memory !\n");
-+ return -ENOMEM;
-+ }
-+
-+ sc->usb_dev = usb;
-+ usbatm->driver_data = sc;
-+ sc->usbatm = usbatm;
-+ sc->modem_index = (modem_index < NB_MODEM) ? modem_index++ : 0;
-+ sc->driver_info = id->driver_info;
-+
-+ ret = uea_boot(sc);
-+ if (ret < 0) {
-+ kfree(sc);
-+ return ret;
-+ }
-+
-+ create_fs_entries(sc, intf);
-+ return 0;
-+}
-+
-+static void destroy_fs_entries(struct uea_softc *sc, struct usb_interface *intf)
-+{
-+ /* sysfs interface */
-+ device_remove_file(&intf->dev, &dev_attr_stat_status);
-+ device_remove_file(&intf->dev, &dev_attr_stat_mflags);
-+ device_remove_file(&intf->dev, &dev_attr_stat_human_status);
-+ device_remove_file(&intf->dev, &dev_attr_stat_delin);
-+ device_remove_file(&intf->dev, &dev_attr_stat_vidcpe);
-+ device_remove_file(&intf->dev, &dev_attr_stat_usrate);
-+ device_remove_file(&intf->dev, &dev_attr_stat_dsrate);
-+ device_remove_file(&intf->dev, &dev_attr_stat_usattenuation);
-+ device_remove_file(&intf->dev, &dev_attr_stat_dsattenuation);
-+ device_remove_file(&intf->dev, &dev_attr_stat_usmargin);
-+ device_remove_file(&intf->dev, &dev_attr_stat_dsmargin);
-+ device_remove_file(&intf->dev, &dev_attr_stat_txflow);
-+ device_remove_file(&intf->dev, &dev_attr_stat_rxflow);
-+ device_remove_file(&intf->dev, &dev_attr_stat_uscorr);
-+ device_remove_file(&intf->dev, &dev_attr_stat_dscorr);
-+ device_remove_file(&intf->dev, &dev_attr_stat_usunc);
-+ device_remove_file(&intf->dev, &dev_attr_stat_dsunc);
-+}
-+
-+static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf)
-+{
-+ struct uea_softc *sc = usbatm->driver_data;
-+
-+ destroy_fs_entries(sc, intf);
-+ uea_stop(sc);
-+ kfree(sc);
-+}
-+
-+static struct usbatm_driver uea_usbatm_driver = {
-+ .driver_name = "ueagle-atm",
-+ .owner = THIS_MODULE,
-+ .bind = uea_bind,
-+ .atm_start = uea_atm_open,
-+ .unbind = uea_unbind,
-+ .heavy_init = uea_heavy,
-+ .in = UEA_BULK_DATA_PIPE,
-+ .out = UEA_BULK_DATA_PIPE,
-+};
-+
-+static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
-+{
-+ struct usb_device *usb = interface_to_usbdev(intf);
-+
-+ uea_enters(usb);
-+ uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s\n",
-+ le16_to_cpu(usb->descriptor.idVendor),
-+ le16_to_cpu(usb->descriptor.idProduct),
-+ chip_name[UEA_CHIP_VERSION(id)]);
-+
-+ usb_reset_device(usb);
-+
-+ if (UEA_IS_PREFIRM(id))
-+ return uea_load_firmware(usb, UEA_CHIP_VERSION(id));
-+
-+ return usbatm_usb_probe(intf, id, &uea_usbatm_driver);
-+}
-+
-+static void uea_disconnect(struct usb_interface *intf)
-+{
-+ struct usb_device *usb = interface_to_usbdev(intf);
-+ int ifnum = intf->altsetting->desc.bInterfaceNumber;
-+ uea_enters(usb);
-+
-+ /* ADI930 has 2 interfaces and eagle 3 interfaces.
-+ * Pre-firmware device has one interface
-+ */
-+ if (usb->config->desc.bNumInterfaces != 1 && ifnum == 0) {
-+ down(&uea_semaphore);
-+ usbatm_usb_disconnect(intf);
-+ up(&uea_semaphore);
-+ uea_info(usb, "ADSL device removed\n");
-+ }
-+
-+ uea_leaves(usb);
-+}
-+
-+/*
-+ * List of supported VID/PID
-+ */
-+static const struct usb_device_id uea_ids[] = {
-+ {USB_DEVICE(ELSA_VID, ELSA_PID_PREFIRM), .driver_info = ADI930 | PREFIRM},
-+ {USB_DEVICE(ELSA_VID, ELSA_PID_PSTFIRM), .driver_info = ADI930 | PSTFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PREFIRM), .driver_info = EAGLE_III | PREFIRM},
-+ {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PSTFIRM), .driver_info = EAGLE_III | PSTFIRM},
-+ {USB_DEVICE(USR_VID, MILLER_A_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
-+ {USB_DEVICE(USR_VID, MILLER_A_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM},
-+ {USB_DEVICE(USR_VID, MILLER_B_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
-+ {USB_DEVICE(USR_VID, MILLER_B_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM},
-+ {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM},
-+ {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM},
-+ {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM},
-+ {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM},
-+ {}
-+};
-+
-+/*
-+ * USB driver descriptor
-+ */
-+static struct usb_driver uea_driver = {
-+ .owner = THIS_MODULE,
-+ .name = "ueagle-atm",
-+ .id_table = uea_ids,
-+ .probe = uea_probe,
-+ .disconnect = uea_disconnect,
-+};
-+
-+MODULE_DEVICE_TABLE(usb, uea_ids);
-+
-+/**
-+ * uea_init - Initialize the module.
-+ * Register to USB subsystem
-+ */
-+static int __init uea_init(void)
-+{
-+ printk(KERN_INFO "[ueagle-atm] driver " EAGLEUSBVERSION " loaded\n");
-+
-+ usb_register(&uea_driver);
-+
-+ return 0;
-+}
-+
-+module_init(uea_init);
-+
-+/**
-+ * uea_exit - Destroy module
-+ * Deregister with USB subsystem
-+ */
-+static void __exit uea_exit(void)
-+{
-+ /*
-+ * This calls automatically the uea_disconnect method if necessary:
-+ */
-+ usb_deregister(&uea_driver);
-+
-+ printk(KERN_INFO "[ueagle-atm] driver unloaded\n");
-+}
-+
-+module_exit(uea_exit);
-+
-+MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka");
-+MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver");
-+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/usb/usb-ehci-fix-driver-model-wakeup-flags.patch b/usb/usb-ehci-fix-driver-model-wakeup-flags.patch
deleted file mode 100644
index 9a592e516f586..0000000000000
--- a/usb/usb-ehci-fix-driver-model-wakeup-flags.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From david-b@pacbell.net Thu Dec 22 17:09:44 2005
-From: David Brownell <david-b@pacbell.net>
-To: Greg KH <greg@kroah.com>
-Subject: USB: ehci fix driver model wakeup flags
-Date: Thu, 22 Dec 2005 17:05:18 -0800
-Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, <gcoady@gmail.com>, Andrew Morton <akpm@osdl.org>
-Message-Id: <200512221705.18618.david-b@pacbell.net>
-
-On some systems, EHCI seems to be getting IRQs too early during driver
-setup ... before the root hub is allocated, in particular, making trouble
-for any code chasing down root hub pointers! In this case, it seems to
-be safe to just ignore the root hub setting. Thanks to Rafael J. Wysocki
-for getting this properly tested.
-
-Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/ehci-hcd.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ehci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/ehci-hcd.c
-@@ -624,7 +624,7 @@ static irqreturn_t ehci_irq (struct usb_
- }
-
- /* remote wakeup [4.3.1] */
-- if ((status & STS_PCD) && device_may_wakeup(&hcd->self.root_hub->dev)) {
-+ if (status & STS_PCD) {
- unsigned i = HCS_N_PORTS (ehci->hcs_params);
-
- /* resume root hub? */
diff --git a/usb/usb-ehci-updates-driver-model-wakeup-flags.patch b/usb/usb-ehci-updates-driver-model-wakeup-flags.patch
deleted file mode 100644
index 76b53fcb73972..0000000000000
--- a/usb/usb-ehci-updates-driver-model-wakeup-flags.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From david-b@pacbell.net Mon Nov 7 15:26:37 2005
-Message-ID: <20051107232446.79146.qmail@web80724.mail.yahoo.com>
-Date: Mon, 7 Nov 2005 15:24:46 -0800 (PST)
-From: David Brownell <david-b@pacbell.net>
-Subject: USB: EHCI updates (4/4) driver model wakeup flags
-To: greg@kroah.com
-
-
-This teaches the EHCI driver to use the new driver model wakeup flags,
-replacing the similar ones in the HCD glue. It also adds a workaround
-for the current glitch whereby PCI init doesn't init the wakeup flags
-from the PCI PM capabilities. (EHCI controllers don't worry about
-legacy mode; the PCI PM capability would always do the job.)
-
-Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/ehci-hcd.c | 2 +-
- drivers/usb/host/ehci-hub.c | 4 ++--
- drivers/usb/host/ehci-pci.c | 11 ++++++++++-
- 3 files changed, 13 insertions(+), 4 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/ehci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/ehci-hcd.c
-@@ -624,7 +624,7 @@ static irqreturn_t ehci_irq (struct usb_
- }
-
- /* remote wakeup [4.3.1] */
-- if ((status & STS_PCD) && hcd->remote_wakeup) {
-+ if ((status & STS_PCD) && device_may_wakeup(&hcd->self.root_hub->dev)) {
- unsigned i = HCS_N_PORTS (ehci->hcs_params);
-
- /* resume root hub? */
---- gregkh-2.6.orig/drivers/usb/host/ehci-hub.c
-+++ gregkh-2.6/drivers/usb/host/ehci-hub.c
-@@ -59,7 +59,7 @@ static int ehci_bus_suspend (struct usb_
-
- if ((t1 & PORT_PE) && !(t1 & PORT_OWNER))
- t2 |= PORT_SUSPEND;
-- if (hcd->remote_wakeup)
-+ if (device_may_wakeup(&hcd->self.root_hub->dev))
- t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;
- else
- t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
-@@ -517,7 +517,7 @@ static int ehci_hub_control (
- if ((temp & PORT_PE) == 0
- || (temp & PORT_RESET) != 0)
- goto error;
-- if (hcd->remote_wakeup)
-+ if (device_may_wakeup(&hcd->self.root_hub->dev))
- temp |= PORT_WAKE_BITS;
- writel (temp | PORT_SUSPEND,
- &ehci->regs->port_status [wIndex]);
---- gregkh-2.6.orig/drivers/usb/host/ehci-pci.c
-+++ gregkh-2.6/drivers/usb/host/ehci-pci.c
-@@ -210,7 +210,16 @@ static int ehci_pci_setup(struct usb_hcd
- /* Serial Bus Release Number is at PCI 0x60 offset */
- pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
-
-- /* REVISIT: per-port wake capability (PCI 0x62) currently unused */
-+ /* Workaround current PCI init glitch: wakeup bits aren't
-+ * being set from PCI PM capability.
-+ */
-+ if (!device_can_wakeup(&pdev->dev)) {
-+ u16 port_wake;
-+
-+ pci_read_config_word(pdev, 0x62, &port_wake);
-+ if (port_wake & 0x0001)
-+ device_init_wakeup(&pdev->dev, 1);
-+ }
-
- retval = ehci_pci_reinit(ehci, pdev);
- done:
diff --git a/usb/usb-export-ieee-1284-device-id-in-sysfs-for-usblp-devices.patch b/usb/usb-export-ieee-1284-device-id-in-sysfs-for-usblp-devices.patch
deleted file mode 100644
index b192bfe008a87..0000000000000
--- a/usb/usb-export-ieee-1284-device-id-in-sysfs-for-usblp-devices.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From SRS0+55afdd291c1d3a80d8b9+852+infradead.org+dwmw2@canuck.srs.infradead.org Fri Dec 23 08:44:57 2005
-From: David Woodhouse <dwmw2@infradead.org>
-Subject: USB: Export IEEE-1284 device id in sysfs for usblp devices
-To: greg@kroah.com
-Cc: <twaugh@redhat.com>, <zaitcev@redhat.com>
-Date: Fri, 23 Dec 2005 16:41:41 +0000
-Message-Id: <1135356101.6422.3.camel@pmac.infradead.org>
-
-I looked at the userspace code which uses the LPIOC_GET_DEVICE_ID ioctl
-and I almost went blind. Let's export it in sysfs instead, and just as a
-string instead of with a big-endian length at the beginning of it.
-
-This also prints the message about finding the printer _after_ we know
-the minor device number it's going to have, rather than reporting all
-printers as 'usblp0'.
-
-Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/class/usblp.c | 35 ++++++++++++++++++++++++++---------
- 1 file changed, 26 insertions(+), 9 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/class/usblp.c
-+++ gregkh-2.6/drivers/usb/class/usblp.c
-@@ -850,6 +850,20 @@ static struct usb_class_driver usblp_cla
- .minor_base = USBLP_MINOR_BASE,
- };
-
-+static ssize_t usblp_show_ieee1284_id(struct device *dev, struct device_attribute *attr, char *buf)
-+{
-+ struct usb_interface *intf = to_usb_interface(dev);
-+ struct usblp *usblp = usb_get_intfdata (intf);
-+
-+ if (usblp->device_id_string[0] == 0 &&
-+ usblp->device_id_string[1] == 0)
-+ return 0;
-+
-+ return sprintf(buf, "%s", usblp->device_id_string+2);
-+}
-+
-+static DEVICE_ATTR(ieee1284_id, S_IRUGO, usblp_show_ieee1284_id, NULL);
-+
- static int usblp_probe(struct usb_interface *intf,
- const struct usb_device_id *id)
- {
-@@ -934,20 +948,12 @@ static int usblp_probe(struct usb_interf
-
- /* Retrieve and store the device ID string. */
- usblp_cache_device_id_string(usblp);
-+ device_create_file(&intf->dev, &dev_attr_ieee1284_id);
-
- #ifdef DEBUG
- usblp_check_status(usblp, 0);
- #endif
-
-- info("usblp%d: USB %sdirectional printer dev %d "
-- "if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X",
-- usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum,
-- usblp->ifnum,
-- usblp->protocol[usblp->current_protocol].alt_setting,
-- usblp->current_protocol,
-- le16_to_cpu(usblp->dev->descriptor.idVendor),
-- le16_to_cpu(usblp->dev->descriptor.idProduct));
--
- usb_set_intfdata (intf, usblp);
-
- usblp->present = 1;
-@@ -958,11 +964,20 @@ static int usblp_probe(struct usb_interf
- goto abort_intfdata;
- }
- usblp->minor = intf->minor;
-+ info("usblp%d: USB %sdirectional printer dev %d "
-+ "if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X",
-+ usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum,
-+ usblp->ifnum,
-+ usblp->protocol[usblp->current_protocol].alt_setting,
-+ usblp->current_protocol,
-+ le16_to_cpu(usblp->dev->descriptor.idVendor),
-+ le16_to_cpu(usblp->dev->descriptor.idProduct));
-
- return 0;
-
- abort_intfdata:
- usb_set_intfdata (intf, NULL);
-+ device_remove_file(&intf->dev, &dev_attr_ieee1284_id);
- abort:
- if (usblp) {
- if (usblp->writebuf)
-@@ -1157,6 +1172,8 @@ static void usblp_disconnect(struct usb_
- BUG ();
- }
-
-+ device_remove_file(&intf->dev, &dev_attr_ieee1284_id);
-+
- down (&usblp_sem);
- down (&usblp->sem);
- usblp->present = 0;
diff --git a/usb/usb-file-storage-gadget-add-reference-count-for-children.patch b/usb/usb-file-storage-gadget-add-reference-count-for-children.patch
deleted file mode 100644
index 5eea428310ee6..0000000000000
--- a/usb/usb-file-storage-gadget-add-reference-count-for-children.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From stern@rowland.harvard.edu Wed Nov 9 14:03:45 2005
-Date: Wed, 9 Nov 2005 16:59:56 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-cc: USB development list <linux-usb-devel@lists.sourceforge.net>
-Subject: USB: file-storage gadget: Add reference count for children
-Message-ID: <Pine.LNX.4.44L0.0511091651130.4431-100000@iolanthe.rowland.org>
-
-This patch (as601) adds a proper reference count to the file-storage
-gadget's main data structure, to keep track of references held by child
-devices (LUNs in this case). Before this, the driver would wait for
-each child to be released before unbinding.
-
-While there's nothing really wrong with that (you can't create a hang by
-doing "rmmod g_file_storage </sys/.../lun0/ro" since the open file will
-prevent rmmod from running), the code might as well follow the standard
-procedures. Besides, this shrinks the size of the structure by a few
-words... :-)
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/gadget/file_storage.c | 30 +++++++++++++++++-------------
- 1 file changed, 17 insertions(+), 13 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/gadget/file_storage.c
-+++ gregkh-2.6/drivers/usb/gadget/file_storage.c
-@@ -224,6 +224,7 @@
- #include <linux/fs.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
-+#include <linux/kref.h>
- #include <linux/kthread.h>
- #include <linux/limits.h>
- #include <linux/list.h>
-@@ -631,6 +632,9 @@ struct fsg_dev {
- /* filesem protects: backing files in use */
- struct rw_semaphore filesem;
-
-+ /* reference counting: wait until all LUNs are released */
-+ struct kref ref;
-+
- struct usb_ep *ep0; // Handy copy of gadget->ep0
- struct usb_request *ep0req; // For control responses
- volatile unsigned int ep0_req_tag;
-@@ -694,7 +698,6 @@ struct fsg_dev {
- unsigned int nluns;
- struct lun *luns;
- struct lun *curlun;
-- struct completion lun_released;
- };
-
- typedef void (*fsg_routine_t)(struct fsg_dev *);
-@@ -3642,11 +3645,19 @@ static DEVICE_ATTR(file, 0444, show_file
-
- /*-------------------------------------------------------------------------*/
-
-+static void fsg_release(struct kref *ref)
-+{
-+ struct fsg_dev *fsg = container_of(ref, struct fsg_dev, ref);
-+
-+ kfree(fsg->luns);
-+ kfree(fsg);
-+}
-+
- static void lun_release(struct device *dev)
- {
- struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev);
-
-- complete(&fsg->lun_released);
-+ kref_put(&fsg->ref, fsg_release);
- }
-
- static void fsg_unbind(struct usb_gadget *gadget)
-@@ -3660,14 +3671,12 @@ static void fsg_unbind(struct usb_gadget
- clear_bit(REGISTERED, &fsg->atomic_bitflags);
-
- /* Unregister the sysfs attribute files and the LUNs */
-- init_completion(&fsg->lun_released);
- for (i = 0; i < fsg->nluns; ++i) {
- curlun = &fsg->luns[i];
- if (curlun->registered) {
- device_remove_file(&curlun->dev, &dev_attr_ro);
- device_remove_file(&curlun->dev, &dev_attr_file);
- device_unregister(&curlun->dev);
-- wait_for_completion(&fsg->lun_released);
- curlun->registered = 0;
- }
- }
-@@ -3846,6 +3855,7 @@ static int __init fsg_bind(struct usb_ga
- curlun->dev.release = lun_release;
- device_create_file(&curlun->dev, &dev_attr_ro);
- device_create_file(&curlun->dev, &dev_attr_file);
-+ kref_get(&fsg->ref);
- }
-
- if (file[i] && *file[i]) {
-@@ -4061,6 +4071,7 @@ static int __init fsg_alloc(void)
- return -ENOMEM;
- spin_lock_init(&fsg->lock);
- init_rwsem(&fsg->filesem);
-+ kref_init(&fsg->ref);
- init_waitqueue_head(&fsg->thread_wqh);
- init_completion(&fsg->thread_notifier);
-
-@@ -4069,13 +4080,6 @@ static int __init fsg_alloc(void)
- }
-
-
--static void fsg_free(struct fsg_dev *fsg)
--{
-- kfree(fsg->luns);
-- kfree(fsg);
--}
--
--
- static int __init fsg_init(void)
- {
- int rc;
-@@ -4085,7 +4089,7 @@ static int __init fsg_init(void)
- return rc;
- fsg = the_fsg;
- if ((rc = usb_gadget_register_driver(&fsg_driver)) != 0)
-- fsg_free(fsg);
-+ kref_put(&fsg->ref, fsg_release);
- return rc;
- }
- module_init(fsg_init);
-@@ -4103,6 +4107,6 @@ static void __exit fsg_cleanup(void)
- wait_for_completion(&fsg->thread_notifier);
-
- close_all_backing_files(fsg);
-- fsg_free(fsg);
-+ kref_put(&fsg->ref, fsg_release);
- }
- module_exit(fsg_cleanup);
diff --git a/usb/usb-fix-buffer-size-limiting-in-skeleton-driver.patch b/usb/usb-fix-buffer-size-limiting-in-skeleton-driver.patch
deleted file mode 100644
index 21a260b5ac170..0000000000000
--- a/usb/usb-fix-buffer-size-limiting-in-skeleton-driver.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From ok@artecdesign.ee Thu Dec 22 02:49:16 2005
-Date: Thu, 22 Dec 2005 12:44:52 +0200 (EET)
-From: Olav Kongas <ok@artecdesign.ee>
-To: Greg KH <greg@kroah.com>
-cc: Oliver Neukum <oliver@neukum.org>
-Subject: USB: fix buffer size limiting in skeleton driver
-Message-ID: <Pine.LNX.4.63.0512221242160.15800@pcy.artec.ee>
-
-Fix buffer size limiting.
-
-Signed-off-by: Olav Kongas <ok@artecdesign.ee>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/usb-skeleton.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- gregkh-2.6.orig/drivers/usb/usb-skeleton.c
-+++ gregkh-2.6/drivers/usb/usb-skeleton.c
-@@ -166,7 +166,7 @@ static ssize_t skel_write(struct file *f
- int retval = 0;
- struct urb *urb = NULL;
- char *buf = NULL;
-- size_t writesize = max(count, MAX_TRANSFER);
-+ size_t writesize = min(count, MAX_TRANSFER);
-
- dev = (struct usb_skel *)file->private_data;
-
diff --git a/usb/usb-fix-locking-for-usb-suspend-resume.patch b/usb/usb-fix-locking-for-usb-suspend-resume.patch
deleted file mode 100644
index 5ceca2672ecb3..0000000000000
--- a/usb/usb-fix-locking-for-usb-suspend-resume.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From stern@rowland.harvard.edu Mon Nov 21 08:41:04 2005
-Date: Mon, 21 Nov 2005 11:58:07 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: USB: Fix locking for USB suspend/resume
-Message-ID: <Pine.LNX.4.44L0.0511211151430.4586-100000@iolanthe.rowland.org>
-
-
-The earlier USB locking updates didn't touch the suspend/resume
-routines. They need updating as well, since now the caller holds the
-device semaphore. This patch (as608) makes the necessary changes. It
-also adds a line to store the correct power state when a device is
-resumed, something which was unaccountably missing.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/hub.c | 54 +++++++++++++++++++++++++++++++++++--------------
- 1 file changed, 39 insertions(+), 15 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/hub.c
-+++ gregkh-2.6/drivers/usb/core/hub.c
-@@ -1648,15 +1648,22 @@ static int __usb_suspend_device (struct
- int usb_suspend_device(struct usb_device *udev)
- {
- #ifdef CONFIG_USB_SUSPEND
-- int port1, status;
-+ int port1;
-
-- port1 = locktree(udev);
-- if (port1 < 0)
-- return port1;
-+ if (udev->state == USB_STATE_NOTATTACHED)
-+ return -ENODEV;
-+ if (!udev->parent)
-+ port1 = 0;
-+ else {
-+ for (port1 = udev->parent->maxchild; port1 > 0; --port1) {
-+ if (udev->parent->children[port1-1] == udev)
-+ break;
-+ }
-+ if (port1 == 0)
-+ return -ENODEV;
-+ }
-
-- status = __usb_suspend_device(udev, port1);
-- usb_unlock_device(udev);
-- return status;
-+ return __usb_suspend_device(udev, port1);
- #else
- /* NOTE: udev->state unchanged, it's not lying ... */
- udev->dev.power.power_state = PMSG_SUSPEND;
-@@ -1688,6 +1695,7 @@ static int finish_device_resume(struct u
- usb_set_device_state(udev, udev->actconfig
- ? USB_STATE_CONFIGURED
- : USB_STATE_ADDRESS);
-+ udev->dev.power.power_state = PMSG_ON;
-
- /* 10.5.4.5 says be sure devices in the tree are still there.
- * For now let's assume the device didn't go crazy on resume,
-@@ -1723,8 +1731,14 @@ static int finish_device_resume(struct u
- * may have a child resume event to deal with soon
- */
- resume = udev->dev.bus->resume;
-- for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++)
-- (void) resume(&udev->actconfig->interface[i]->dev);
-+ for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
-+ struct device *dev =
-+ &udev->actconfig->interface[i]->dev;
-+
-+ down(&dev->sem);
-+ (void) resume(dev);
-+ up(&dev->sem);
-+ }
- status = 0;
-
- } else if (udev->devnum <= 0) {
-@@ -1809,9 +1823,18 @@ int usb_resume_device(struct usb_device
- {
- int port1, status;
-
-- port1 = locktree(udev);
-- if (port1 < 0)
-- return port1;
-+ if (udev->state == USB_STATE_NOTATTACHED)
-+ return -ENODEV;
-+ if (!udev->parent)
-+ port1 = 0;
-+ else {
-+ for (port1 = udev->parent->maxchild; port1 > 0; --port1) {
-+ if (udev->parent->children[port1-1] == udev)
-+ break;
-+ }
-+ if (port1 == 0)
-+ return -ENODEV;
-+ }
-
- #ifdef CONFIG_USB_SUSPEND
- /* selective resume of one downstream hub-to-device port */
-@@ -1830,11 +1853,12 @@ int usb_resume_device(struct usb_device
- dev_dbg(&udev->dev, "can't resume, status %d\n",
- status);
-
-- usb_unlock_device(udev);
--
- /* rebind drivers that had no suspend() */
-- if (status == 0)
-+ if (status == 0) {
-+ usb_unlock_device(udev);
- bus_rescan_devices(&usb_bus_type);
-+ usb_lock_device(udev);
-+ }
- return status;
- }
-
diff --git a/usb/usb-fix-usb-skeleton-limit-resource-usage-patch.patch b/usb/usb-fix-usb-skeleton-limit-resource-usage-patch.patch
deleted file mode 100644
index 1ec556caae36e..0000000000000
--- a/usb/usb-fix-usb-skeleton-limit-resource-usage-patch.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From sam@server1.gnuconsulting.com Thu Dec 22 16:15:04 2005
-Date: Thu, 22 Dec 2005 17:11:02 -0700
-From: Sam Bishop <sam@bishop.dhs.org>
-To: Greg KH <greg@kroah.com>
-Cc: <sbishop@micron.com>
-Message-ID: <20051223001102.GA19026@server1.gnuconsulting.com>
-Content-Disposition: inline
-Subject: USB: fix usb-skeleton limit resource usage patch.
-
-From: Sam Bishop <sam@bishop.dhs.org>
-
-Prevents a compiler warning and uses down_interruptible() instead of down() in
-process context.
-
-Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/usb-skeleton.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/usb-skeleton.c
-+++ gregkh-2.6/drivers/usb/usb-skeleton.c
-@@ -166,7 +166,7 @@ static ssize_t skel_write(struct file *f
- int retval = 0;
- struct urb *urb = NULL;
- char *buf = NULL;
-- size_t writesize = min(count, MAX_TRANSFER);
-+ size_t writesize = min(count, (size_t)MAX_TRANSFER);
-
- dev = (struct usb_skel *)file->private_data;
-
-@@ -175,7 +175,10 @@ static ssize_t skel_write(struct file *f
- goto exit;
-
- /* limit the number of URBs in flight to stop a user from using up all RAM */
-- down (&dev->limit_sem);
-+ if (down_interruptible(&dev->limit_sem)) {
-+ retval = -ERESTARTSYS;
-+ goto exit;
-+ }
-
- /* create a urb, and a buffer for it, and copy the data to the urb */
- urb = usb_alloc_urb(0, GFP_KERNEL);
diff --git a/usb/usb-fix-usb_find_interface-for-ppc64.patch b/usb/usb-fix-usb_find_interface-for-ppc64.patch
deleted file mode 100644
index 4c7e5b64d0ac7..0000000000000
--- a/usb/usb-fix-usb_find_interface-for-ppc64.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From zaitcev@redhat.com Wed Dec 21 17:27:15 2005
-Date: Wed, 21 Dec 2005 17:24:54 -0800
-From: Pete Zaitcev <zaitcev@redhat.com>
-To: greg@kroah.com
-Subject: usb: fix usb_find_interface for ppc64
-Message-Id: <20051221172454.6cb3d841.zaitcev@redhat.com>
-
-Fix usb_find_interface. You cannot case pointers to int and long on
-a big-endian 64-bitter without consequences.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/usb.c | 23 +++++++++++++----------
- 1 file changed, 13 insertions(+), 10 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/usb.c
-+++ gregkh-2.6/drivers/usb/core/usb.c
-@@ -192,20 +192,23 @@ void usb_driver_release_interface(struct
- iface->condition = USB_INTERFACE_UNBOUND;
- mark_quiesced(iface);
- }
-+struct find_interface_arg {
-+ int minor;
-+ struct usb_interface *interface;
-+};
-
- static int __find_interface(struct device * dev, void * data)
- {
-- struct usb_interface ** ret = (struct usb_interface **)data;
-- struct usb_interface * intf = *ret;
-- int *minor = (int *)data;
-+ struct find_interface_arg *arg = data;
-+ struct usb_interface *intf;
-
- /* can't look at usb devices, only interfaces */
- if (dev->driver == &usb_generic_driver)
- return 0;
-
- intf = to_usb_interface(dev);
-- if (intf->minor != -1 && intf->minor == *minor) {
-- *ret = intf;
-+ if (intf->minor != -1 && intf->minor == arg->minor) {
-+ arg->interface = intf;
- return 1;
- }
- return 0;
-@@ -222,12 +225,12 @@ static int __find_interface(struct devic
- */
- struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor)
- {
-- struct usb_interface *intf = (struct usb_interface *)(long)minor;
-- int ret;
--
-- ret = driver_for_each_device(&drv->driver, NULL, &intf, __find_interface);
-+ struct find_interface_arg argb;
-
-- return ret ? intf : NULL;
-+ argb.minor = minor;
-+ argb.interface = NULL;
-+ driver_for_each_device(&drv->driver, NULL, &argb, __find_interface);
-+ return argb.interface;
- }
-
- #ifdef CONFIG_HOTPLUG
diff --git a/usb/usb-gadget-dummy_hcd-updates-to-hcd-state.patch b/usb/usb-gadget-dummy_hcd-updates-to-hcd-state.patch
deleted file mode 100644
index ef26daec330ab..0000000000000
--- a/usb/usb-gadget-dummy_hcd-updates-to-hcd-state.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From stern@rowland.harvard.edu Tue Nov 29 09:11:47 2005
-Date: Tue, 29 Nov 2005 12:08:15 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-Subject: USB Gadget: dummy_hcd: updates to hcd->state
-Message-ID: <Pine.LNX.4.44L0.0511291204270.4602-100000@iolanthe.rowland.org>
-
-This patch (as613) moves the updates to hcd->state in the dummy_hcd
-driver to where they now belong. It also uses the new
-HC_FLAG_HW_ACCESSIBLE flag in a way that simulates a real PCI
-controller, and it adds checks for attempts to resume the bus while the
-controller is suspended or to suspend the controller while the bus is
-active.
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/gadget/dummy_hcd.c | 43 +++++++++++++++++++++++++++++------------
- 1 file changed, 31 insertions(+), 12 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/gadget/dummy_hcd.c
-+++ gregkh-2.6/drivers/usb/gadget/dummy_hcd.c
-@@ -1576,7 +1576,7 @@ static int dummy_hub_status (struct usb_
- dum = hcd_to_dummy (hcd);
-
- spin_lock_irqsave (&dum->lock, flags);
-- if (hcd->state != HC_STATE_RUNNING)
-+ if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
- goto done;
-
- if (dum->resuming && time_after_eq (jiffies, dum->re_timeout)) {
-@@ -1623,7 +1623,7 @@ static int dummy_hub_control (
- int retval = 0;
- unsigned long flags;
-
-- if (hcd->state != HC_STATE_RUNNING)
-+ if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
- return -ETIMEDOUT;
-
- dum = hcd_to_dummy (hcd);
-@@ -1756,9 +1756,12 @@ static int dummy_bus_suspend (struct usb
- {
- struct dummy *dum = hcd_to_dummy (hcd);
-
-+ dev_dbg (&hcd->self.root_hub->dev, "%s\n", __FUNCTION__);
-+
- spin_lock_irq (&dum->lock);
- dum->rh_state = DUMMY_RH_SUSPENDED;
- set_link_state (dum);
-+ hcd->state = HC_STATE_SUSPENDED;
- spin_unlock_irq (&dum->lock);
- return 0;
- }
-@@ -1766,14 +1769,23 @@ static int dummy_bus_suspend (struct usb
- static int dummy_bus_resume (struct usb_hcd *hcd)
- {
- struct dummy *dum = hcd_to_dummy (hcd);
-+ int rc = 0;
-+
-+ dev_dbg (&hcd->self.root_hub->dev, "%s\n", __FUNCTION__);
-
- spin_lock_irq (&dum->lock);
-- dum->rh_state = DUMMY_RH_RUNNING;
-- set_link_state (dum);
-- if (!list_empty(&dum->urbp_list))
-- mod_timer (&dum->timer, jiffies);
-+ if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
-+ dev_warn (&hcd->self.root_hub->dev, "HC isn't running!\n");
-+ rc = -ENODEV;
-+ } else {
-+ dum->rh_state = DUMMY_RH_RUNNING;
-+ set_link_state (dum);
-+ if (!list_empty(&dum->urbp_list))
-+ mod_timer (&dum->timer, jiffies);
-+ hcd->state = HC_STATE_RUNNING;
-+ }
- spin_unlock_irq (&dum->lock);
-- return 0;
-+ return rc;
- }
-
- /*-------------------------------------------------------------------------*/
-@@ -1933,12 +1945,19 @@ static int dummy_hcd_remove (struct plat
- static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state)
- {
- struct usb_hcd *hcd;
-+ struct dummy *dum;
-+ int rc = 0;
-
- dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
-- hcd = platform_get_drvdata (pdev);
-
-- hcd->state = HC_STATE_SUSPENDED;
-- return 0;
-+ hcd = platform_get_drvdata (pdev);
-+ dum = hcd_to_dummy (hcd);
-+ if (dum->rh_state == DUMMY_RH_RUNNING) {
-+ dev_warn(&pdev->dev, "Root hub isn't suspended!\n");
-+ rc = -EBUSY;
-+ } else
-+ clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-+ return rc;
- }
-
- static int dummy_hcd_resume (struct platform_device *pdev)
-@@ -1946,9 +1965,9 @@ static int dummy_hcd_resume (struct plat
- struct usb_hcd *hcd;
-
- dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
-- hcd = platform_get_drvdata (pdev);
-- hcd->state = HC_STATE_RUNNING;
-
-+ hcd = platform_get_drvdata (pdev);
-+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
- usb_hcd_poll_rh_status (hcd);
- return 0;
- }
diff --git a/usb/usb-gadget-file_storage-remove-volatile-declarations.patch b/usb/usb-gadget-file_storage-remove-volatile-declarations.patch
deleted file mode 100644
index 1a4bdeff246ba..0000000000000
--- a/usb/usb-gadget-file_storage-remove-volatile-declarations.patch
+++ /dev/null
@@ -1,235 +0,0 @@
-From stern@rowland.harvard.edu Tue Nov 29 09:06:21 2005
-Date: Tue, 29 Nov 2005 12:04:24 -0500 (EST)
-From: Alan Stern <stern@rowland.harvard.edu>
-To: Greg KH <greg@kroah.com>
-cc: Pavel Machek <pavel@ucw.cz>
-Subject: USB Gadget: file_storage: remove "volatile" declarations
-Message-ID: <Pine.LNX.4.44L0.0511291155540.4602-100000@iolanthe.rowland.org>
-
-This patch (as612) removes the "volatile" declarations from the
-file-storage gadget. It turns out that they aren't needed for anything
-much; adding a few memory barriers does a sufficient job.
-
-The patch also removes a wait_queue. Not much point having a queue when
-only one task is ever going to be on it!
-
-Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/gadget/file_storage.c | 59 ++++++++++++++++++++++++--------------
- 1 file changed, 38 insertions(+), 21 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/gadget/file_storage.c
-+++ gregkh-2.6/drivers/usb/gadget/file_storage.c
-@@ -239,7 +239,6 @@
- #include <linux/string.h>
- #include <linux/suspend.h>
- #include <linux/utsname.h>
--#include <linux/wait.h>
-
- #include <linux/usb_ch9.h>
- #include <linux/usb_gadget.h>
-@@ -251,7 +250,7 @@
-
- #define DRIVER_DESC "File-backed Storage Gadget"
- #define DRIVER_NAME "g_file_storage"
--#define DRIVER_VERSION "20 October 2004"
-+#define DRIVER_VERSION "28 November 2005"
-
- static const char longname[] = DRIVER_DESC;
- static const char shortname[] = DRIVER_NAME;
-@@ -588,7 +587,7 @@ enum fsg_buffer_state {
- struct fsg_buffhd {
- void *buf;
- dma_addr_t dma;
-- volatile enum fsg_buffer_state state;
-+ enum fsg_buffer_state state;
- struct fsg_buffhd *next;
-
- /* The NetChip 2280 is faster, and handles some protocol faults
-@@ -597,9 +596,9 @@ struct fsg_buffhd {
- unsigned int bulk_out_intended_length;
-
- struct usb_request *inreq;
-- volatile int inreq_busy;
-+ int inreq_busy;
- struct usb_request *outreq;
-- volatile int outreq_busy;
-+ int outreq_busy;
- };
-
- enum fsg_state {
-@@ -637,11 +636,11 @@ struct fsg_dev {
-
- struct usb_ep *ep0; // Handy copy of gadget->ep0
- struct usb_request *ep0req; // For control responses
-- volatile unsigned int ep0_req_tag;
-+ unsigned int ep0_req_tag;
- const char *ep0req_name;
-
- struct usb_request *intreq; // For interrupt responses
-- volatile int intreq_busy;
-+ int intreq_busy;
- struct fsg_buffhd *intr_buffhd;
-
- unsigned int bulk_out_maxpacket;
-@@ -671,7 +670,6 @@ struct fsg_dev {
- struct fsg_buffhd *next_buffhd_to_drain;
- struct fsg_buffhd buffhds[NUM_BUFFERS];
-
-- wait_queue_head_t thread_wqh;
- int thread_wakeup_needed;
- struct completion thread_notifier;
- struct task_struct *thread_task;
-@@ -1076,11 +1074,13 @@ static int populate_config_buf(struct us
-
- /* These routines may be called in process context or in_irq */
-
-+/* Caller must hold fsg->lock */
- static void wakeup_thread(struct fsg_dev *fsg)
- {
- /* Tell the main thread that something has happened */
- fsg->thread_wakeup_needed = 1;
-- wake_up_all(&fsg->thread_wqh);
-+ if (fsg->thread_task)
-+ wake_up_process(fsg->thread_task);
- }
-
-
-@@ -1167,11 +1167,12 @@ static void bulk_in_complete(struct usb_
- usb_ep_fifo_flush(ep);
-
- /* Hold the lock while we update the request and buffer states */
-+ smp_wmb();
- spin_lock(&fsg->lock);
- bh->inreq_busy = 0;
- bh->state = BUF_STATE_EMPTY;
-- spin_unlock(&fsg->lock);
- wakeup_thread(fsg);
-+ spin_unlock(&fsg->lock);
- }
-
- static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
-@@ -1188,11 +1189,12 @@ static void bulk_out_complete(struct usb
- usb_ep_fifo_flush(ep);
-
- /* Hold the lock while we update the request and buffer states */
-+ smp_wmb();
- spin_lock(&fsg->lock);
- bh->outreq_busy = 0;
- bh->state = BUF_STATE_FULL;
-- spin_unlock(&fsg->lock);
- wakeup_thread(fsg);
-+ spin_unlock(&fsg->lock);
- }
-
-
-@@ -1209,11 +1211,12 @@ static void intr_in_complete(struct usb_
- usb_ep_fifo_flush(ep);
-
- /* Hold the lock while we update the request and buffer states */
-+ smp_wmb();
- spin_lock(&fsg->lock);
- fsg->intreq_busy = 0;
- bh->state = BUF_STATE_EMPTY;
-- spin_unlock(&fsg->lock);
- wakeup_thread(fsg);
-+ spin_unlock(&fsg->lock);
- }
-
- #else
-@@ -1264,8 +1267,8 @@ static void received_cbi_adsc(struct fsg
- fsg->cbbuf_cmnd_size = req->actual;
- memcpy(fsg->cbbuf_cmnd, req->buf, fsg->cbbuf_cmnd_size);
-
-- spin_unlock(&fsg->lock);
- wakeup_thread(fsg);
-+ spin_unlock(&fsg->lock);
- }
-
- #else
-@@ -1517,8 +1520,8 @@ static int fsg_setup(struct usb_gadget *
-
- /* Use this for bulk or interrupt transfers, not ep0 */
- static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep,
-- struct usb_request *req, volatile int *pbusy,
-- volatile enum fsg_buffer_state *state)
-+ struct usb_request *req, int *pbusy,
-+ enum fsg_buffer_state *state)
- {
- int rc;
-
-@@ -1526,8 +1529,11 @@ static void start_transfer(struct fsg_de
- dump_msg(fsg, "bulk-in", req->buf, req->length);
- else if (ep == fsg->intr_in)
- dump_msg(fsg, "intr-in", req->buf, req->length);
-+
-+ spin_lock_irq(&fsg->lock);
- *pbusy = 1;
- *state = BUF_STATE_BUSY;
-+ spin_unlock_irq(&fsg->lock);
- rc = usb_ep_queue(ep, req, GFP_KERNEL);
- if (rc != 0) {
- *pbusy = 0;
-@@ -1547,14 +1553,23 @@ static void start_transfer(struct fsg_de
-
- static int sleep_thread(struct fsg_dev *fsg)
- {
-- int rc;
-+ int rc = 0;
-
- /* Wait until a signal arrives or we are woken up */
-- rc = wait_event_interruptible(fsg->thread_wqh,
-- fsg->thread_wakeup_needed);
-+ for (;;) {
-+ try_to_freeze();
-+ set_current_state(TASK_INTERRUPTIBLE);
-+ if (signal_pending(current)) {
-+ rc = -EINTR;
-+ break;
-+ }
-+ if (fsg->thread_wakeup_needed)
-+ break;
-+ schedule();
-+ }
-+ __set_current_state(TASK_RUNNING);
- fsg->thread_wakeup_needed = 0;
-- try_to_freeze();
-- return (rc ? -EINTR : 0);
-+ return rc;
- }
-
-
-@@ -1791,6 +1806,7 @@ static int do_write(struct fsg_dev *fsg)
- if (bh->state == BUF_STATE_EMPTY && !get_some_more)
- break; // We stopped early
- if (bh->state == BUF_STATE_FULL) {
-+ smp_rmb();
- fsg->next_buffhd_to_drain = bh->next;
- bh->state = BUF_STATE_EMPTY;
-
-@@ -2359,6 +2375,7 @@ static int throw_away_data(struct fsg_de
-
- /* Throw away the data in a filled buffer */
- if (bh->state == BUF_STATE_FULL) {
-+ smp_rmb();
- bh->state = BUF_STATE_EMPTY;
- fsg->next_buffhd_to_drain = bh->next;
-
-@@ -3024,6 +3041,7 @@ static int get_next_command(struct fsg_d
- if ((rc = sleep_thread(fsg)) != 0)
- return rc;
- }
-+ smp_rmb();
- rc = received_cbw(fsg, bh);
- bh->state = BUF_STATE_EMPTY;
-
-@@ -4072,7 +4090,6 @@ static int __init fsg_alloc(void)
- spin_lock_init(&fsg->lock);
- init_rwsem(&fsg->filesem);
- kref_init(&fsg->ref);
-- init_waitqueue_head(&fsg->thread_wqh);
- init_completion(&fsg->thread_notifier);
-
- the_fsg = fsg;
diff --git a/usb/usb-hcd-uses-extra_cflags-for-ddebug.patch b/usb/usb-hcd-uses-extra_cflags-for-ddebug.patch
deleted file mode 100644
index 24bf3eeec24b4..0000000000000
--- a/usb/usb-hcd-uses-extra_cflags-for-ddebug.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From david-b@pacbell.net Mon Nov 7 20:50:45 2005
-From: David Brownell <david-b@pacbell.net>
-To: Greg KH <greg@kroah.com>
-Subject: USB: hcd uses EXTRA_CFLAGS for -DDEBUG
-Date: Mon, 7 Nov 2005 20:45:20 -0800
-Message-Id: <200511072045.20888.david-b@pacbell.net>
-
-This modifies the HCD builds to automatically "-DDEBUG" if
-CONFIG_USB_DEBUG is selected. It's just a minor source code cleanup,
-guaranteeing consistency.
-
-Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/host/Makefile | 4 ++++
- drivers/usb/host/ehci-hcd.c | 7 -------
- drivers/usb/host/ohci-hcd.c | 7 -------
- drivers/usb/host/pci-quirks.c | 6 ------
- drivers/usb/host/sl811-hcd.c | 7 -------
- drivers/usb/host/sl811_cs.c | 5 +++--
- drivers/usb/host/uhci-hcd.c | 5 -----
- 7 files changed, 7 insertions(+), 34 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/host/Makefile
-+++ gregkh-2.6/drivers/usb/host/Makefile
-@@ -2,6 +2,10 @@
- # Makefile for USB Host Controller Drivers
- #
-
-+ifeq ($(CONFIG_USB_DEBUG),y)
-+ EXTRA_CFLAGS += -DDEBUG
-+endif
-+
- obj-$(CONFIG_PCI) += pci-quirks.o
-
- obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
---- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/uhci-hcd.c
-@@ -23,11 +23,6 @@
- */
-
- #include <linux/config.h>
--#ifdef CONFIG_USB_DEBUG
--#define DEBUG
--#else
--#undef DEBUG
--#endif
- #include <linux/module.h>
- #include <linux/pci.h>
- #include <linux/kernel.h>
---- gregkh-2.6.orig/drivers/usb/host/ehci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/ehci-hcd.c
-@@ -17,13 +17,6 @@
- */
-
- #include <linux/config.h>
--
--#ifdef CONFIG_USB_DEBUG
-- #define DEBUG
--#else
-- #undef DEBUG
--#endif
--
- #include <linux/module.h>
- #include <linux/pci.h>
- #include <linux/dmapool.h>
---- gregkh-2.6.orig/drivers/usb/host/ohci-hcd.c
-+++ gregkh-2.6/drivers/usb/host/ohci-hcd.c
-@@ -75,13 +75,6 @@
- */
-
- #include <linux/config.h>
--
--#ifdef CONFIG_USB_DEBUG
--# define DEBUG
--#else
--# undef DEBUG
--#endif
--
- #include <linux/module.h>
- #include <linux/moduleparam.h>
- #include <linux/pci.h>
---- gregkh-2.6.orig/drivers/usb/host/sl811_cs.c
-+++ gregkh-2.6/drivers/usb/host/sl811_cs.c
-@@ -38,7 +38,7 @@ MODULE_LICENSE("GPL");
- /* MACROS */
- /*====================================================================*/
-
--#if defined(DEBUG) || defined(CONFIG_USB_DEBUG) || defined(PCMCIA_DEBUG)
-+#if defined(DEBUG) || defined(PCMCIA_DEBUG)
-
- static int pc_debug = 0;
- module_param(pc_debug, int, 0644);
-@@ -129,7 +129,8 @@ static int sl811_hc_init(struct device *
- resources[2].end = base_addr + 1;
-
- /* The driver core will probe for us. We know sl811-hcd has been
-- * initialized already because of the link order dependency.
-+ * initialized already because of the link order dependency created
-+ * by referencing "sl811h_driver".
- */
- platform_dev.name = sl811h_driver.name;
- return platform_device_register(&platform_dev);
---- gregkh-2.6.orig/drivers/usb/host/pci-quirks.c
-+++ gregkh-2.6/drivers/usb/host/pci-quirks.c
-@@ -9,12 +9,6 @@
- */
-
- #include <linux/config.h>
--#ifdef CONFIG_USB_DEBUG
--#define DEBUG
--#else
--#undef DEBUG
--#endif
--
- #include <linux/types.h>
- #include <linux/kernel.h>
- #include <linux/pci.h>
---- gregkh-2.6.orig/drivers/usb/host/sl811-hcd.c
-+++ gregkh-2.6/drivers/usb/host/sl811-hcd.c
-@@ -32,13 +32,6 @@
- #undef PACKET_TRACE
-
- #include <linux/config.h>
--
--#ifdef CONFIG_USB_DEBUG
--# define DEBUG
--#else
--# undef DEBUG
--#endif
--
- #include <linux/module.h>
- #include <linux/moduleparam.h>
- #include <linux/kernel.h>
diff --git a/usb/usb-input-touchkitusb-handle-multiple-packets.patch b/usb/usb-input-touchkitusb-handle-multiple-packets.patch
deleted file mode 100644
index dadc0de366c31..0000000000000
--- a/usb/usb-input-touchkitusb-handle-multiple-packets.patch
+++ /dev/null
@@ -1,218 +0,0 @@
-From daniel.ritz-ml@swissonline.ch Sun Nov 27 13:57:24 2005
-From: Daniel Ritz <daniel.ritz-ml@swissonline.ch>
-To: Greg KH <gregkh@suse.de>, Vojtech Pavlik <vojtech@suse.cz>
-Subject: usb/input/touchkitusb: handle multiple packets
-Date: Sun, 27 Nov 2005 22:23:38 +0100
-Content-Disposition: inline
-Message-Id: <200511272223.38923.daniel.ritz-ml@swissonline.ch>
-
-Some versions of the controller seem to put multiple report packet into a
-single urb. also it can happen that a packet is split across multiple urbs.
-unpatched you get a jumpy cursor on some screens.
-the patch does:
-- handle multiple packets per urb
-- handle packets split across multiple urb
-- check packet type
-- cleanups
-
-Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c
-index 7420c6b..e62586e 100644
----
- drivers/usb/input/touchkitusb.c | 148 ++++++++++++++++++++++++++++++++++------
- 1 file changed, 126 insertions(+), 22 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/input/touchkitusb.c
-+++ gregkh-2.6/drivers/usb/input/touchkitusb.c
-@@ -1,7 +1,7 @@
- /******************************************************************************
- * touchkitusb.c -- Driver for eGalax TouchKit USB Touchscreens
- *
-- * Copyright (C) 2004 by Daniel Ritz
-+ * Copyright (C) 2004-2005 by Daniel Ritz <daniel.ritz@gmx.ch>
- * Copyright (C) by Todd E. Johnson (mtouchusb.c)
- *
- * This program is free software; you can redistribute it and/or
-@@ -41,15 +41,13 @@
- #define TOUCHKIT_MAX_YC 0x07ff
- #define TOUCHKIT_YC_FUZZ 0x0
- #define TOUCHKIT_YC_FLAT 0x0
--#define TOUCHKIT_REPORT_DATA_SIZE 8
-+#define TOUCHKIT_REPORT_DATA_SIZE 16
-
- #define TOUCHKIT_DOWN 0x01
--#define TOUCHKIT_POINT_TOUCH 0x81
--#define TOUCHKIT_POINT_NOTOUCH 0x80
-
--#define TOUCHKIT_GET_TOUCHED(dat) ((((dat)[0]) & TOUCHKIT_DOWN) ? 1 : 0)
--#define TOUCHKIT_GET_X(dat) (((dat)[3] << 7) | (dat)[4])
--#define TOUCHKIT_GET_Y(dat) (((dat)[1] << 7) | (dat)[2])
-+#define TOUCHKIT_PKT_TYPE_MASK 0xFE
-+#define TOUCHKIT_PKT_TYPE_REPT 0x80
-+#define TOUCHKIT_PKT_TYPE_DIAG 0x0A
-
- #define DRIVER_VERSION "v0.1"
- #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>"
-@@ -62,6 +60,8 @@ MODULE_PARM_DESC(swap_xy, "If set X and
- struct touchkit_usb {
- unsigned char *data;
- dma_addr_t data_dma;
-+ char buffer[TOUCHKIT_REPORT_DATA_SIZE];
-+ int buf_len;
- struct urb *irq;
- struct usb_device *udev;
- struct input_dev *input;
-@@ -77,11 +77,128 @@ static struct usb_device_id touchkit_dev
- {}
- };
-
-+/* helpers to read the data */
-+static inline int touchkit_get_touched(char *data)
-+{
-+ return (data[0] & TOUCHKIT_DOWN) ? 1 : 0;
-+}
-+
-+static inline int touchkit_get_x(char *data)
-+{
-+ return ((data[3] & 0x0F) << 7) | (data[4] & 0x7F);
-+}
-+
-+static inline int touchkit_get_y(char *data)
-+{
-+ return ((data[1] & 0x0F) << 7) | (data[2] & 0x7F);
-+}
-+
-+
-+/* processes one input packet. */
-+static void touchkit_process_pkt(struct touchkit_usb *touchkit,
-+ struct pt_regs *regs, char *pkt)
-+{
-+ int x, y;
-+
-+ /* only process report packets */
-+ if ((pkt[0] & TOUCHKIT_PKT_TYPE_MASK) != TOUCHKIT_PKT_TYPE_REPT)
-+ return;
-+
-+ if (swap_xy) {
-+ y = touchkit_get_x(pkt);
-+ x = touchkit_get_y(pkt);
-+ } else {
-+ x = touchkit_get_x(pkt);
-+ y = touchkit_get_y(pkt);
-+ }
-+
-+ input_regs(touchkit->input, regs);
-+ input_report_key(touchkit->input, BTN_TOUCH, touchkit_get_touched(pkt));
-+ input_report_abs(touchkit->input, ABS_X, x);
-+ input_report_abs(touchkit->input, ABS_Y, y);
-+ input_sync(touchkit->input);
-+}
-+
-+
-+static int touchkit_get_pkt_len(char *buf)
-+{
-+ switch (buf[0] & TOUCHKIT_PKT_TYPE_MASK) {
-+ case TOUCHKIT_PKT_TYPE_REPT:
-+ return 5;
-+
-+ case TOUCHKIT_PKT_TYPE_DIAG:
-+ return buf[1] + 2;
-+ }
-+
-+ return 0;
-+}
-+
-+static void touchkit_process(struct touchkit_usb *touchkit, int len,
-+ struct pt_regs *regs)
-+{
-+ char *buffer;
-+ int pkt_len, buf_len, pos;
-+
-+ /* if the buffer contains data, append */
-+ if (unlikely(touchkit->buf_len)) {
-+ int tmp;
-+
-+ /* if only 1 byte in buffer, add another one to get length */
-+ if (touchkit->buf_len == 1)
-+ touchkit->buffer[1] = touchkit->data[0];
-+
-+ pkt_len = touchkit_get_pkt_len(touchkit->buffer);
-+
-+ /* unknown packet: drop everything */
-+ if (!pkt_len)
-+ return;
-+
-+ /* append, process */
-+ tmp = pkt_len - touchkit->buf_len;
-+ memcpy(touchkit->buffer + touchkit->buf_len, touchkit->data, tmp);
-+ touchkit_process_pkt(touchkit, regs, touchkit->buffer);
-+
-+ buffer = touchkit->data + tmp;
-+ buf_len = len - tmp;
-+ } else {
-+ buffer = touchkit->data;
-+ buf_len = len;
-+ }
-+
-+ /* only one byte left in buffer */
-+ if (unlikely(buf_len == 1)) {
-+ touchkit->buffer[0] = buffer[0];
-+ touchkit->buf_len = 1;
-+ return;
-+ }
-+
-+ /* loop over the buffer */
-+ pos = 0;
-+ while (pos < buf_len) {
-+ /* get packet len */
-+ pkt_len = touchkit_get_pkt_len(buffer + pos);
-+
-+ /* unknown packet: drop everything */
-+ if (unlikely(!pkt_len))
-+ return;
-+
-+ /* full packet: process */
-+ if (likely(pkt_len <= buf_len)) {
-+ touchkit_process_pkt(touchkit, regs, buffer + pos);
-+ } else {
-+ /* incomplete packet: save in buffer */
-+ memcpy(touchkit->buffer, buffer + pos, buf_len - pos);
-+ touchkit->buf_len = buf_len - pos;
-+ }
-+ pos += pkt_len;
-+ }
-+}
-+
-+
- static void touchkit_irq(struct urb *urb, struct pt_regs *regs)
- {
- struct touchkit_usb *touchkit = urb->context;
- int retval;
-- int x, y;
-
- switch (urb->status) {
- case 0:
-@@ -105,20 +222,7 @@ static void touchkit_irq(struct urb *urb
- goto exit;
- }
-
-- if (swap_xy) {
-- y = TOUCHKIT_GET_X(touchkit->data);
-- x = TOUCHKIT_GET_Y(touchkit->data);
-- } else {
-- x = TOUCHKIT_GET_X(touchkit->data);
-- y = TOUCHKIT_GET_Y(touchkit->data);
-- }
--
-- input_regs(touchkit->input, regs);
-- input_report_key(touchkit->input, BTN_TOUCH,
-- TOUCHKIT_GET_TOUCHED(touchkit->data));
-- input_report_abs(touchkit->input, ABS_X, x);
-- input_report_abs(touchkit->input, ABS_Y, y);
-- input_sync(touchkit->input);
-+ touchkit_process(touchkit, urb->actual_length, regs);
-
- exit:
- retval = usb_submit_urb(urb, GFP_ATOMIC);
diff --git a/usb/usb-ioctl-compat-for-usblp.c.patch b/usb/usb-ioctl-compat-for-usblp.c.patch
deleted file mode 100644
index 6975cae888e69..0000000000000
--- a/usb/usb-ioctl-compat-for-usblp.c.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From zaitcev@redhat.com Wed Dec 21 17:06:26 2005
-Date: Wed, 21 Dec 2005 17:03:24 -0800
-From: Pete Zaitcev <zaitcev@redhat.com>
-Cc: zaitcev@redhat.com, greg@kroah.com
-Subject: usb: ioctl compat for usblp.c
-Message-Id: <20051221170324.21c57242.zaitcev@redhat.com>
-
-From: David Woodhouse <dwmw2>
-
-David has a G5 with a printer. I am quite surprised that nobody else noticed
-this before. Linus has a G5. Hackers hate printing in general, maybe.
-
-We do not use BKL anymore, because one of code paths had a sleeping call,
-so we had to use a semaphore. I am sure it's safe to use unlocked_ioctl.
-
-The new ioctls return long and retval is int. It looks completely fine to me.
-We never want these extra bits, and the sign extension ought to work right.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
---
-
----
- drivers/usb/class/usblp.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/class/usblp.c
-+++ gregkh-2.6/drivers/usb/class/usblp.c
-@@ -438,7 +438,7 @@ static unsigned int usblp_poll(struct fi
- | (!usblp->wcomplete ? 0 : POLLOUT | POLLWRNORM);
- }
-
--static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-+static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- {
- struct usblp *usblp = file->private_data;
- int length, err, i;
-@@ -838,7 +838,8 @@ static struct file_operations usblp_fops
- .read = usblp_read,
- .write = usblp_write,
- .poll = usblp_poll,
-- .ioctl = usblp_ioctl,
-+ .unlocked_ioctl = usblp_ioctl,
-+ .compat_ioctl = usblp_ioctl,
- .open = usblp_open,
- .release = usblp_release,
- };
diff --git a/usb/usb-let-usbmon-collect-less-garbage.patch b/usb/usb-let-usbmon-collect-less-garbage.patch
deleted file mode 100644
index a92598af3da3b..0000000000000
--- a/usb/usb-let-usbmon-collect-less-garbage.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From zaitcev@redhat.com Sat Dec 3 21:54:59 2005
-Date: Sat, 3 Dec 2005 21:52:10 -0800
-From: Pete Zaitcev <zaitcev@redhat.com>
-To: greg@kroah.com
-Subject: USB: Let usbmon collect less garbage
-Message-Id: <20051203215210.48150824.zaitcev@redhat.com>
-
-Alan Stern pointed out that (in 2.6 kernel) one successful submission results
-in one callback, even for ISO-out transfers. Thus, the silly check can be
-removed from usbmon. This reduces the amount of garbage printed in case
-of ISO and Interrupt transfers.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/mon/mon_text.c | 19 ++++++-------------
- 1 file changed, 6 insertions(+), 13 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/mon/mon_text.c
-+++ gregkh-2.6/drivers/usb/mon/mon_text.c
-@@ -97,19 +97,12 @@ static inline char mon_text_get_data(str
- if (len >= DATA_MAX)
- len = DATA_MAX;
-
-- /*
-- * Bulk is easy to shortcut reliably.
-- * XXX Other pipe types need consideration. Currently, we overdo it
-- * and collect garbage for them: better more than less.
-- */
-- if (usb_pipebulk(pipe) || usb_pipecontrol(pipe)) {
-- if (usb_pipein(pipe)) {
-- if (ev_type == 'S')
-- return '<';
-- } else {
-- if (ev_type == 'C')
-- return '>';
-- }
-+ if (usb_pipein(pipe)) {
-+ if (ev_type == 'S')
-+ return '<';
-+ } else {
-+ if (ev_type == 'C')
-+ return '>';
- }
-
- /*
diff --git a/usb/usb-libusual.patch b/usb/usb-libusual.patch
deleted file mode 100644
index d4cc76dc8a2d5..0000000000000
--- a/usb/usb-libusual.patch
+++ /dev/null
@@ -1,914 +0,0 @@
-From zaitcev@redhat.com Sat Oct 22 20:20:03 2005
-Date: Sat, 22 Oct 2005 20:15:09 -0700
-From: Pete Zaitcev <zaitcev@redhat.com>
-To: Greg KH <greg@kroah.com>
-Cc: stern@rowland.harvard.edu, usb-storage@lists.one-eyed-alien.net, zaitcev@redhat.com
-Subject: usb: drivers/usb/storage/libusual
-Message-Id: <20051022201509.7185d7dd.zaitcev@redhat.com>
-
-This patch adds a shim driver libusual, which routes devices between
-usb-storage and ub according to the common table, based on unusual_devs.h.
-The help and example syntax is in Kconfig.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/block/Kconfig | 3
- drivers/block/ub.c | 23 +--
- drivers/usb/Makefile | 1
- drivers/usb/storage/Kconfig | 14 +
- drivers/usb/storage/Makefile | 4
- drivers/usb/storage/libusual.c | 266 +++++++++++++++++++++++++++++++++++++
- drivers/usb/storage/protocol.h | 14 -
- drivers/usb/storage/transport.h | 31 ----
- drivers/usb/storage/unusual_devs.h | 24 +++
- drivers/usb/storage/usb.c | 119 +++++-----------
- drivers/usb/storage/usb.h | 31 ----
- include/linux/usb_usual.h | 123 +++++++++++++++++
- 12 files changed, 486 insertions(+), 167 deletions(-)
-
---- gregkh-2.6.orig/drivers/block/Kconfig
-+++ gregkh-2.6/drivers/block/Kconfig
-@@ -358,7 +358,8 @@ config BLK_DEV_UB
- This driver supports certain USB attached storage devices
- such as flash keys.
-
-- Warning: Enabling this cripples the usb-storage driver.
-+ If you enable this driver, it is recommended to avoid conflicts
-+ with usb-storage by enabling USB_LIBUSUAL.
-
- If unsure, say N.
-
---- gregkh-2.6.orig/drivers/block/ub.c
-+++ gregkh-2.6/drivers/block/ub.c
-@@ -29,6 +29,7 @@
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/usb.h>
-+#include <linux/usb_usual.h>
- #include <linux/blkdev.h>
- #include <linux/devfs_fs_kernel.h>
- #include <linux/timer.h>
-@@ -107,16 +108,6 @@
- */
-
- /*
-- * Definitions which have to be scattered once we understand the layout better.
-- */
--
--/* Transport (despite PR in the name) */
--#define US_PR_BULK 0x50 /* bulk only */
--
--/* Protocol */
--#define US_SC_SCSI 0x06 /* Transparent */
--
--/*
- * This many LUNs per USB device.
- * Every one of them takes a host, see UB_MAX_HOSTS.
- */
-@@ -422,13 +413,18 @@ static int ub_probe_lun(struct ub_dev *s
-
- /*
- */
-+#ifdef CONFIG_USB_LIBUSUAL
-+
-+#define ub_usb_ids storage_usb_ids
-+#else
-+
- static struct usb_device_id ub_usb_ids[] = {
-- // { USB_DEVICE_VER(0x0781, 0x0002, 0x0009, 0x0009) }, /* SDDR-31 */
- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
- { }
- };
-
- MODULE_DEVICE_TABLE(usb, ub_usb_ids);
-+#endif /* CONFIG_USB_LIBUSUAL */
-
- /*
- * Find me a way to identify "next free minor" for add_disk(),
-@@ -2172,6 +2168,9 @@ static int ub_probe(struct usb_interface
- int rc;
- int i;
-
-+ if (usb_usual_check_type(dev_id, USB_US_TYPE_UB))
-+ return -ENXIO;
-+
- rc = -ENOMEM;
- if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
- goto err_core;
-@@ -2479,6 +2478,7 @@ static int __init ub_init(void)
- if ((rc = usb_register(&ub_driver)) != 0)
- goto err_register;
-
-+ usb_usual_set_present(USB_US_TYPE_UB);
- return 0;
-
- err_register:
-@@ -2494,6 +2494,7 @@ static void __exit ub_exit(void)
-
- devfs_remove(DEVFS_NAME);
- unregister_blkdev(UB_MAJOR, DRV_NAME);
-+ usb_usual_clear_present(USB_US_TYPE_UB);
- }
-
- module_init(ub_init);
---- gregkh-2.6.orig/drivers/usb/storage/Kconfig
-+++ gregkh-2.6/drivers/usb/storage/Kconfig
-@@ -124,3 +124,17 @@ config USB_STORAGE_ONETOUCH
- hard drive's as an input device. An action can be associated with
- this input in any keybinding software. (e.g. gnome's keyboard short-
- cuts)
-+
-+config USB_LIBUSUAL
-+ bool "The shared table of common (or usual) storage devices"
-+ depends on USB
-+ help
-+ This module contains a table of common (or usual) devices
-+ for usb-storage and ub drivers, and allows to switch binding
-+ of these devices without rebuilding modules.
-+
-+ Typical syntax of /etc/modprobe.conf is:
-+
-+ options libusual bias="ub"
-+
-+ If unsure, say N.
---- /dev/null
-+++ gregkh-2.6/drivers/usb/storage/libusual.c
-@@ -0,0 +1,266 @@
-+/*
-+ * libusual
-+ *
-+ * The libusual contains the table of devices common for ub and usb-storage.
-+ */
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/usb.h>
-+#include <linux/usb_usual.h>
-+#include <linux/vmalloc.h>
-+
-+/*
-+ */
-+#define USU_MOD_FL_THREAD 1 /* Thread is running */
-+#define USU_MOD_FL_PRESENT 2 /* The module is loaded */
-+
-+struct mod_status {
-+ unsigned long fls;
-+};
-+
-+static struct mod_status stat[3];
-+static DEFINE_SPINLOCK(usu_lock);
-+
-+/*
-+ */
-+#define USB_US_DEFAULT_BIAS USB_US_TYPE_STOR
-+
-+#define BIAS_NAME_SIZE (sizeof("usb-storage"))
-+static char bias[BIAS_NAME_SIZE];
-+static int usb_usual_bias;
-+static const char *bias_names[3] = { "none", "usb-storage", "ub" };
-+
-+static DECLARE_MUTEX_LOCKED(usu_init_notify);
-+static DECLARE_COMPLETION(usu_end_notify);
-+static atomic_t total_threads = ATOMIC_INIT(0);
-+
-+static int usu_probe_thread(void *arg);
-+static int parse_bias(const char *bias_s);
-+
-+/*
-+ * The table.
-+ */
-+#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
-+ vendorName, productName,useProtocol, useTransport, \
-+ initFunction, flags) \
-+{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \
-+ .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
-+
-+#define USUAL_DEV(useProto, useTrans, useType) \
-+{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
-+ .driver_info = ((useType)<<24) }
-+
-+struct usb_device_id storage_usb_ids [] = {
-+# include "unusual_devs.h"
-+ { } /* Terminating entry */
-+};
-+
-+#undef USUAL_DEV
-+#undef UNUSUAL_DEV
-+
-+MODULE_DEVICE_TABLE(usb, storage_usb_ids);
-+EXPORT_SYMBOL_GPL(storage_usb_ids);
-+
-+/*
-+ * @type: the module type as an integer
-+ */
-+void usb_usual_set_present(int type)
-+{
-+ struct mod_status *st;
-+ unsigned long flags;
-+
-+ if (type <= 0 || type >= 3)
-+ return;
-+ st = &stat[type];
-+ spin_lock_irqsave(&usu_lock, flags);
-+ st->fls |= USU_MOD_FL_PRESENT;
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+}
-+EXPORT_SYMBOL_GPL(usb_usual_set_present);
-+
-+void usb_usual_clear_present(int type)
-+{
-+ struct mod_status *st;
-+ unsigned long flags;
-+
-+ if (type <= 0 || type >= 3)
-+ return;
-+ st = &stat[type];
-+ spin_lock_irqsave(&usu_lock, flags);
-+ st->fls &= ~USU_MOD_FL_PRESENT;
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+}
-+EXPORT_SYMBOL_GPL(usb_usual_clear_present);
-+
-+/*
-+ * Match the calling driver type against the table.
-+ * Returns: 0 if the device matches.
-+ */
-+int usb_usual_check_type(const struct usb_device_id *id, int caller_type)
-+{
-+ int id_type = USB_US_TYPE(id->driver_info);
-+
-+ if (caller_type <= 0 || caller_type >= 3)
-+ return -EINVAL;
-+
-+ /* Drivers grab fixed assignment devices */
-+ if (id_type == caller_type)
-+ return 0;
-+ /* Drivers grab devices biased to them */
-+ if (id_type == USB_US_TYPE_NONE && caller_type == usb_usual_bias)
-+ return 0;
-+ return -ENODEV;
-+}
-+EXPORT_SYMBOL_GPL(usb_usual_check_type);
-+
-+/*
-+ */
-+static int usu_probe(struct usb_interface *intf,
-+ const struct usb_device_id *id)
-+{
-+ int type;
-+ int rc;
-+ unsigned long flags;
-+
-+ type = USB_US_TYPE(id->driver_info);
-+ if (type == 0)
-+ type = usb_usual_bias;
-+
-+ spin_lock_irqsave(&usu_lock, flags);
-+ if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) {
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+ return -ENXIO;
-+ }
-+ stat[type].fls |= USU_MOD_FL_THREAD;
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+
-+ rc = kernel_thread(usu_probe_thread, (void*)type, CLONE_VM);
-+ if (rc < 0) {
-+ printk(KERN_WARNING "libusual: "
-+ "Unable to start the thread for %s: %d\n",
-+ bias_names[type], rc);
-+ spin_lock_irqsave(&usu_lock, flags);
-+ stat[type].fls &= ~USU_MOD_FL_THREAD;
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+ return rc; /* Not being -ENXIO causes a message printed */
-+ }
-+ atomic_inc(&total_threads);
-+
-+ return -ENXIO;
-+}
-+
-+static void usu_disconnect(struct usb_interface *intf)
-+{
-+ ; /* We should not be here. */
-+}
-+
-+static struct usb_driver usu_driver = {
-+ .owner = THIS_MODULE,
-+ .name = "libusual",
-+ .probe = usu_probe,
-+ .disconnect = usu_disconnect,
-+ .id_table = storage_usb_ids,
-+};
-+
-+/*
-+ * A whole new thread for a purpose of request_module seems quite stupid.
-+ * The request_module forks once inside again. However, if we attempt
-+ * to load a storage module from our own modprobe thread, that module
-+ * references our symbols, which cannot be resolved until our module is
-+ * initialized. I wish there was a way to wait for the end of initialization.
-+ * The module notifier reports MODULE_STATE_COMING only.
-+ * So, we wait until module->init ends as the next best thing.
-+ */
-+static int usu_probe_thread(void *arg)
-+{
-+ int type = (unsigned long) arg;
-+ struct mod_status *st = &stat[type];
-+ int rc;
-+ unsigned long flags;
-+
-+ daemonize("libusual_%d", type); /* "usb-storage" is kinda too long */
-+
-+ /* A completion does not work here because it's counted. */
-+ down(&usu_init_notify);
-+ up(&usu_init_notify);
-+
-+ rc = request_module(bias_names[type]);
-+ spin_lock_irqsave(&usu_lock, flags);
-+ if (rc == 0 && (st->fls & USU_MOD_FL_PRESENT) == 0) {
-+ /*
-+ * This should not happen, but let us keep tabs on it.
-+ */
-+ printk(KERN_NOTICE "libusual: "
-+ "modprobe for %s succeeded, but module is not present\n",
-+ bias_names[type]);
-+ }
-+ st->fls &= ~USU_MOD_FL_THREAD;
-+ spin_unlock_irqrestore(&usu_lock, flags);
-+
-+ complete_and_exit(&usu_end_notify, 0);
-+}
-+
-+/*
-+ */
-+static int __init usb_usual_init(void)
-+{
-+ int rc;
-+
-+ bias[BIAS_NAME_SIZE-1] = 0;
-+ usb_usual_bias = parse_bias(bias);
-+
-+ rc = usb_register(&usu_driver);
-+ up(&usu_init_notify);
-+ return rc;
-+}
-+
-+static void __exit usb_usual_exit(void)
-+{
-+ /*
-+ * We do not check for any drivers present, because
-+ * they keep us pinned with symbol references.
-+ */
-+
-+ usb_deregister(&usu_driver);
-+
-+ while (atomic_read(&total_threads) > 0) {
-+ wait_for_completion(&usu_end_notify);
-+ atomic_dec(&total_threads);
-+ }
-+}
-+
-+/*
-+ * Validate and accept the bias parameter.
-+ * Maybe make an sysfs method later. XXX
-+ */
-+static int parse_bias(const char *bias_s)
-+{
-+ int i;
-+ int bias_n = 0;
-+
-+ if (bias_s[0] == 0 || bias_s[0] == ' ') {
-+ bias_n = USB_US_DEFAULT_BIAS;
-+ } else {
-+ for (i = 1; i < 3; i++) {
-+ if (strcmp(bias_s, bias_names[i]) == 0) {
-+ bias_n = i;
-+ break;
-+ }
-+ }
-+ if (bias_n == 0) {
-+ bias_n = USB_US_DEFAULT_BIAS;
-+ printk(KERN_INFO
-+ "libusual: unknown bias \"%s\", using \"%s\"\n",
-+ bias_s, bias_names[bias_n]);
-+ }
-+ }
-+ return bias_n;
-+}
-+
-+module_init(usb_usual_init);
-+module_exit(usb_usual_exit);
-+
-+module_param_string(bias, bias, BIAS_NAME_SIZE, S_IRUGO|S_IWUSR);
-+MODULE_PARM_DESC(bias, "Bias to usb-storage or ub");
-+
-+MODULE_LICENSE("GPL");
---- gregkh-2.6.orig/drivers/usb/storage/Makefile
-+++ gregkh-2.6/drivers/usb/storage/Makefile
-@@ -22,3 +22,7 @@ usb-storage-obj-$(CONFIG_USB_STORAGE_ONE
-
- usb-storage-objs := scsiglue.o protocol.o transport.o usb.o \
- initializers.o $(usb-storage-obj-y)
-+
-+ifneq ($(CONFIG_USB_LIBUSUAL),)
-+ obj-$(CONFIG_USB) += libusual.o
-+endif
---- gregkh-2.6.orig/drivers/usb/storage/protocol.h
-+++ gregkh-2.6/drivers/usb/storage/protocol.h
-@@ -41,20 +41,6 @@
- #ifndef _PROTOCOL_H_
- #define _PROTOCOL_H_
-
--/* Sub Classes */
--
--#define US_SC_RBC 0x01 /* Typically, flash devices */
--#define US_SC_8020 0x02 /* CD-ROM */
--#define US_SC_QIC 0x03 /* QIC-157 Tapes */
--#define US_SC_UFI 0x04 /* Floppy */
--#define US_SC_8070 0x05 /* Removable media */
--#define US_SC_SCSI 0x06 /* Transparent */
--#define US_SC_ISD200 0x07 /* ISD200 ATA */
--#define US_SC_MIN US_SC_RBC
--#define US_SC_MAX US_SC_ISD200
--
--#define US_SC_DEVICE 0xff /* Use device's value */
--
- /* Protocol handling routines */
- extern void usb_stor_ATAPI_command(struct scsi_cmnd*, struct us_data*);
- extern void usb_stor_qic157_command(struct scsi_cmnd*, struct us_data*);
---- gregkh-2.6.orig/drivers/usb/storage/transport.h
-+++ gregkh-2.6/drivers/usb/storage/transport.h
-@@ -41,39 +41,8 @@
- #ifndef _TRANSPORT_H_
- #define _TRANSPORT_H_
-
--#include <linux/config.h>
- #include <linux/blkdev.h>
-
--/* Protocols */
--
--#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */
--#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
--#define US_PR_BULK 0x50 /* bulk only */
--#ifdef CONFIG_USB_STORAGE_USBAT
--#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */
--#endif
--#ifdef CONFIG_USB_STORAGE_SDDR09
--#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
--#endif
--#ifdef CONFIG_USB_STORAGE_SDDR55
--#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
--#endif
--#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
--
--#ifdef CONFIG_USB_STORAGE_FREECOM
--#define US_PR_FREECOM 0xf1 /* Freecom */
--#endif
--
--#ifdef CONFIG_USB_STORAGE_DATAFAB
--#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
--#endif
--
--#ifdef CONFIG_USB_STORAGE_JUMPSHOT
--#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
--#endif
--
--#define US_PR_DEVICE 0xff /* Use device's value */
--
- /*
- * Bulk only data structures
- */
---- gregkh-2.6.orig/drivers/usb/storage/unusual_devs.h
-+++ gregkh-2.6/drivers/usb/storage/unusual_devs.h
-@@ -1134,3 +1134,27 @@ UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x
- US_SC_SCSI, US_PR_SDDR55, NULL,
- US_FL_SINGLE_LUN),
- #endif
-+
-+/* Control/Bulk transport for all SubClass values */
-+USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_QIC, US_PR_CB, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_UFI, US_PR_CB, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8070, US_PR_CB, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_SCSI, US_PR_CB, USB_US_TYPE_STOR),
-+
-+/* Control/Bulk/Interrupt transport for all SubClass values */
-+USUAL_DEV(US_SC_RBC, US_PR_CBI, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8020, US_PR_CBI, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_QIC, US_PR_CBI, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_UFI, US_PR_CBI, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8070, US_PR_CBI, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_SCSI, US_PR_CBI, USB_US_TYPE_STOR),
-+
-+/* Bulk-only transport for all SubClass values */
-+USUAL_DEV(US_SC_RBC, US_PR_BULK, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8020, US_PR_BULK, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_QIC, US_PR_BULK, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_UFI, US_PR_BULK, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_8070, US_PR_BULK, USB_US_TYPE_STOR),
-+USUAL_DEV(US_SC_SCSI, US_PR_BULK, 0),
---- gregkh-2.6.orig/drivers/usb/storage/usb.c
-+++ gregkh-2.6/drivers/usb/storage/usb.c
-@@ -112,49 +112,33 @@ static atomic_t total_threads = ATOMIC_I
- static DECLARE_COMPLETION(threads_gone);
-
-
--/* The entries in this table, except for final ones here
-- * (USB_MASS_STORAGE_CLASS and the empty entry), correspond,
-- * line for line with the entries of us_unsuaul_dev_list[].
-+/*
-+ * The entries in this table correspond, line for line,
-+ * with the entries of us_unusual_dev_list[].
- */
-+#ifndef CONFIG_USB_LIBUSUAL
-
- #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
- vendorName, productName,useProtocol, useTransport, \
- initFunction, flags) \
--{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax) }
-+{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \
-+ .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
-+
-+#define USUAL_DEV(useProto, useTrans, useType) \
-+{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
-+ .driver_info = (USB_US_TYPE_STOR<<24) }
-
- static struct usb_device_id storage_usb_ids [] = {
-
- # include "unusual_devs.h"
- #undef UNUSUAL_DEV
-- /* Control/Bulk transport for all SubClass values */
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_CB) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_CB) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_CB) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_CB) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_CB) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_CB) },
--
-- /* Control/Bulk/Interrupt transport for all SubClass values */
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_CBI) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_CBI) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_CBI) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_CBI) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_CBI) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_CBI) },
--
-- /* Bulk-only transport for all SubClass values */
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_BULK) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_BULK) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_BULK) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_BULK) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_BULK) },
-- { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
--
-+#undef USUAL_DEV
- /* Terminating entry */
- { }
- };
-
- MODULE_DEVICE_TABLE (usb, storage_usb_ids);
-+#endif /* CONFIG_USB_LIBUSUAL */
-
- /* This is the list of devices we recognize, along with their flag data */
-
-@@ -167,7 +151,6 @@ MODULE_DEVICE_TABLE (usb, storage_usb_id
- * are free to use as many characters as you like.
- */
-
--#undef UNUSUAL_DEV
- #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \
- vendor_name, product_name, use_protocol, use_transport, \
- init_function, Flags) \
-@@ -177,53 +160,18 @@ MODULE_DEVICE_TABLE (usb, storage_usb_id
- .useProtocol = use_protocol, \
- .useTransport = use_transport, \
- .initFunction = init_function, \
-- .flags = Flags, \
-+}
-+
-+#define USUAL_DEV(use_protocol, use_transport, use_type) \
-+{ \
-+ .useProtocol = use_protocol, \
-+ .useTransport = use_transport, \
- }
-
- static struct us_unusual_dev us_unusual_dev_list[] = {
- # include "unusual_devs.h"
- # undef UNUSUAL_DEV
-- /* Control/Bulk transport for all SubClass values */
-- { .useProtocol = US_SC_RBC,
-- .useTransport = US_PR_CB},
-- { .useProtocol = US_SC_8020,
-- .useTransport = US_PR_CB},
-- { .useProtocol = US_SC_QIC,
-- .useTransport = US_PR_CB},
-- { .useProtocol = US_SC_UFI,
-- .useTransport = US_PR_CB},
-- { .useProtocol = US_SC_8070,
-- .useTransport = US_PR_CB},
-- { .useProtocol = US_SC_SCSI,
-- .useTransport = US_PR_CB},
--
-- /* Control/Bulk/Interrupt transport for all SubClass values */
-- { .useProtocol = US_SC_RBC,
-- .useTransport = US_PR_CBI},
-- { .useProtocol = US_SC_8020,
-- .useTransport = US_PR_CBI},
-- { .useProtocol = US_SC_QIC,
-- .useTransport = US_PR_CBI},
-- { .useProtocol = US_SC_UFI,
-- .useTransport = US_PR_CBI},
-- { .useProtocol = US_SC_8070,
-- .useTransport = US_PR_CBI},
-- { .useProtocol = US_SC_SCSI,
-- .useTransport = US_PR_CBI},
--
-- /* Bulk-only transport for all SubClass values */
-- { .useProtocol = US_SC_RBC,
-- .useTransport = US_PR_BULK},
-- { .useProtocol = US_SC_8020,
-- .useTransport = US_PR_BULK},
-- { .useProtocol = US_SC_QIC,
-- .useTransport = US_PR_BULK},
-- { .useProtocol = US_SC_UFI,
-- .useTransport = US_PR_BULK},
-- { .useProtocol = US_SC_8070,
-- .useTransport = US_PR_BULK},
-- { .useProtocol = US_SC_SCSI,
-- .useTransport = US_PR_BULK},
-+# undef USUAL_DEV
-
- /* Terminating entry */
- { NULL }
-@@ -484,14 +432,20 @@ static int associate_dev(struct us_data
- return 0;
- }
-
-+/* Find an unusual_dev descriptor (always succeeds in the current code) */
-+static struct us_unusual_dev *find_unusual(const struct usb_device_id *id)
-+{
-+ const int id_index = id - storage_usb_ids;
-+ return &us_unusual_dev_list[id_index];
-+}
-+
- /* Get the unusual_devs entries and the string descriptors */
--static void get_device_info(struct us_data *us, int id_index)
-+static void get_device_info(struct us_data *us, const struct usb_device_id *id)
- {
- struct usb_device *dev = us->pusb_dev;
- struct usb_interface_descriptor *idesc =
- &us->pusb_intf->cur_altsetting->desc;
-- struct us_unusual_dev *unusual_dev = &us_unusual_dev_list[id_index];
-- struct usb_device_id *id = &storage_usb_ids[id_index];
-+ struct us_unusual_dev *unusual_dev = find_unusual(id);
-
- /* Store the entries */
- us->unusual_dev = unusual_dev;
-@@ -501,7 +455,7 @@ static void get_device_info(struct us_da
- us->protocol = (unusual_dev->useTransport == US_PR_DEVICE) ?
- idesc->bInterfaceProtocol :
- unusual_dev->useTransport;
-- us->flags = unusual_dev->flags;
-+ us->flags = USB_US_ORIG_FLAGS(id->driver_info);
-
- /*
- * This flag is only needed when we're in high-speed, so let's
-@@ -529,7 +483,7 @@ static void get_device_info(struct us_da
- if (unusual_dev->useTransport != US_PR_DEVICE &&
- us->protocol == idesc->bInterfaceProtocol)
- msg += 2;
-- if (msg >= 0 && !(unusual_dev->flags & US_FL_NEED_OVERRIDE))
-+ if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE))
- printk(KERN_NOTICE USB_STORAGE "This device "
- "(%04x,%04x,%04x S %02x P %02x)"
- " has %s in unusual_devs.h\n"
-@@ -921,10 +875,12 @@ static int storage_probe(struct usb_inte
- {
- struct Scsi_Host *host;
- struct us_data *us;
-- const int id_index = id - storage_usb_ids;
- int result;
- struct task_struct *th;
-
-+ if (usb_usual_check_type(id, USB_US_TYPE_STOR))
-+ return -ENXIO;
-+
- US_DEBUGP("USB Mass Storage device detected\n");
-
- /*
-@@ -957,7 +913,7 @@ static int storage_probe(struct usb_inte
- * of the match from the usb_device_id table, so we can find the
- * corresponding entry in the private table.
- */
-- get_device_info(us, id_index);
-+ get_device_info(us, id);
-
- #ifdef CONFIG_USB_STORAGE_SDDR09
- if (us->protocol == US_PR_EUSB_SDDR09 ||
-@@ -1062,9 +1018,10 @@ static int __init usb_stor_init(void)
-
- /* register the driver, return usb_register return code if error */
- retval = usb_register(&usb_storage_driver);
-- if (retval == 0)
-+ if (retval == 0) {
- printk(KERN_INFO "USB Mass Storage support registered.\n");
--
-+ usb_usual_set_present(USB_US_TYPE_STOR);
-+ }
- return retval;
- }
-
-@@ -1088,6 +1045,8 @@ static void __exit usb_stor_exit(void)
- wait_for_completion(&threads_gone);
- atomic_dec(&total_threads);
- }
-+
-+ usb_usual_clear_present(USB_US_TYPE_STOR);
- }
-
- module_init(usb_stor_init);
---- gregkh-2.6.orig/drivers/usb/storage/usb.h
-+++ gregkh-2.6/drivers/usb/storage/usb.h
-@@ -45,6 +45,7 @@
- #define _USB_H_
-
- #include <linux/usb.h>
-+#include <linux/usb_usual.h>
- #include <linux/blkdev.h>
- #include <linux/smp_lock.h>
- #include <linux/completion.h>
-@@ -63,38 +64,8 @@ struct us_unusual_dev {
- __u8 useProtocol;
- __u8 useTransport;
- int (*initFunction)(struct us_data *);
-- unsigned int flags;
- };
-
--/*
-- * Static flag definitions. We use this roundabout technique so that the
-- * proc_info() routine can automatically display a message for each flag.
-- */
--#define US_DO_ALL_FLAGS \
-- US_FLAG(SINGLE_LUN, 0x00000001) \
-- /* allow access to only LUN 0 */ \
-- US_FLAG(NEED_OVERRIDE, 0x00000002) \
-- /* unusual_devs entry is necessary */ \
-- US_FLAG(SCM_MULT_TARG, 0x00000004) \
-- /* supports multiple targets */ \
-- US_FLAG(FIX_INQUIRY, 0x00000008) \
-- /* INQUIRY response needs faking */ \
-- US_FLAG(FIX_CAPACITY, 0x00000010) \
-- /* READ CAPACITY response too big */ \
-- US_FLAG(IGNORE_RESIDUE, 0x00000020) \
-- /* reported residue is wrong */ \
-- US_FLAG(BULK32, 0x00000040) \
-- /* Uses 32-byte CBW length */ \
-- US_FLAG(NOT_LOCKABLE, 0x00000080) \
-- /* PREVENT/ALLOW not supported */ \
-- US_FLAG(GO_SLOW, 0x00000100) \
-- /* Need delay after Command phase */ \
-- US_FLAG(NO_WP_DETECT, 0x00000200) \
-- /* Don't check for write-protect */ \
--
--#define US_FLAG(name, value) US_FL_##name = value ,
--enum { US_DO_ALL_FLAGS };
--#undef US_FLAG
-
- /* Dynamic flag definitions: used in set_bit() etc. */
- #define US_FLIDX_URB_ACTIVE 18 /* 0x00040000 current_urb is in use */
---- /dev/null
-+++ gregkh-2.6/include/linux/usb_usual.h
-@@ -0,0 +1,123 @@
-+/*
-+ * Interface to the libusual.
-+ *
-+ * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
-+ * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
-+ * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
-+ */
-+
-+#ifndef __LINUX_USB_USUAL_H
-+#define __LINUX_USB_USUAL_H
-+
-+#include <linux/config.h>
-+
-+/* We should do this for cleanliness... But other usb_foo.h do not do this. */
-+/* #include <linux/usb.h> */
-+
-+/*
-+ * The flags field, which we store in usb_device_id.driver_info.
-+ * It is compatible with the old usb-storage flags in lower 24 bits.
-+ */
-+
-+/*
-+ * Static flag definitions. We use this roundabout technique so that the
-+ * proc_info() routine can automatically display a message for each flag.
-+ */
-+#define US_DO_ALL_FLAGS \
-+ US_FLAG(SINGLE_LUN, 0x00000001) \
-+ /* allow access to only LUN 0 */ \
-+ US_FLAG(NEED_OVERRIDE, 0x00000002) \
-+ /* unusual_devs entry is necessary */ \
-+ US_FLAG(SCM_MULT_TARG, 0x00000004) \
-+ /* supports multiple targets */ \
-+ US_FLAG(FIX_INQUIRY, 0x00000008) \
-+ /* INQUIRY response needs faking */ \
-+ US_FLAG(FIX_CAPACITY, 0x00000010) \
-+ /* READ CAPACITY response too big */ \
-+ US_FLAG(IGNORE_RESIDUE, 0x00000020) \
-+ /* reported residue is wrong */ \
-+ US_FLAG(BULK32, 0x00000040) \
-+ /* Uses 32-byte CBW length */ \
-+ US_FLAG(NOT_LOCKABLE, 0x00000080) \
-+ /* PREVENT/ALLOW not supported */ \
-+ US_FLAG(GO_SLOW, 0x00000100) \
-+ /* Need delay after Command phase */ \
-+ US_FLAG(NO_WP_DETECT, 0x00000200) \
-+ /* Don't check for write-protect */ \
-+
-+#define US_FLAG(name, value) US_FL_##name = value ,
-+enum { US_DO_ALL_FLAGS };
-+#undef US_FLAG
-+
-+/*
-+ * The bias field for libusual and friends.
-+ */
-+#define USB_US_TYPE_NONE 0
-+#define USB_US_TYPE_STOR 1 /* usb-storage */
-+#define USB_US_TYPE_UB 2 /* ub */
-+
-+#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
-+#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
-+
-+/*
-+ * This is probably not the best place to keep these constants, conceptually.
-+ * But it's the only header included into all places which need them.
-+ */
-+
-+/* Sub Classes */
-+
-+#define US_SC_RBC 0x01 /* Typically, flash devices */
-+#define US_SC_8020 0x02 /* CD-ROM */
-+#define US_SC_QIC 0x03 /* QIC-157 Tapes */
-+#define US_SC_UFI 0x04 /* Floppy */
-+#define US_SC_8070 0x05 /* Removable media */
-+#define US_SC_SCSI 0x06 /* Transparent */
-+#define US_SC_ISD200 0x07 /* ISD200 ATA */
-+#define US_SC_MIN US_SC_RBC
-+#define US_SC_MAX US_SC_ISD200
-+
-+#define US_SC_DEVICE 0xff /* Use device's value */
-+
-+/* Protocols */
-+
-+#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */
-+#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
-+#define US_PR_BULK 0x50 /* bulk only */
-+#ifdef CONFIG_USB_STORAGE_USBAT
-+#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */
-+#endif
-+#ifdef CONFIG_USB_STORAGE_SDDR09
-+#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
-+#endif
-+#ifdef CONFIG_USB_STORAGE_SDDR55
-+#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
-+#endif
-+#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
-+#ifdef CONFIG_USB_STORAGE_FREECOM
-+#define US_PR_FREECOM 0xf1 /* Freecom */
-+#endif
-+#ifdef CONFIG_USB_STORAGE_DATAFAB
-+#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
-+#endif
-+#ifdef CONFIG_USB_STORAGE_JUMPSHOT
-+#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
-+#endif
-+
-+#define US_PR_DEVICE 0xff /* Use device's value */
-+
-+/*
-+ */
-+#ifdef CONFIG_USB_LIBUSUAL
-+
-+extern struct usb_device_id storage_usb_ids[];
-+extern void usb_usual_set_present(int type);
-+extern void usb_usual_clear_present(int type);
-+extern int usb_usual_check_type(const struct usb_device_id *, int type);
-+#else
-+
-+#define usb_usual_set_present(t) do { } while(0)
-+#define usb_usual_clear_present(t) do { } while(0)
-+#define usb_usual_check_type(id, t) (0)
-+#endif /* CONFIG_USB_LIBUSUAL */
-+
-+#endif /* __LINUX_USB_USUAL_H */
---- gregkh-2.6.orig/drivers/usb/Makefile
-+++ gregkh-2.6/drivers/usb/Makefile
-@@ -22,6 +22,7 @@ obj-$(CONFIG_USB_MIDI) += class/
- obj-$(CONFIG_USB_PRINTER) += class/
-
- obj-$(CONFIG_USB_STORAGE) += storage/
-+obj-$(CONFIG_USB) += storage/
-
- obj-$(CONFIG_USB_AIPTEK) += input/
- obj-$(CONFIG_USB_ATI_REMOTE) += input/
diff --git a/usb/usb-limiting-of-resource-use-in-skeleton-driver.patch b/usb/usb-limiting-of-resource-use-in-skeleton-driver.patch
deleted file mode 100644
index 816d8321232ff..0000000000000
--- a/usb/usb-limiting-of-resource-use-in-skeleton-driver.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From oliver@neukum.org Wed Dec 21 12:26:29 2005
-From: Oliver Neukum <oliver@neukum.org>
-To: Greg KH <greg@kroah.com>
-Subject: USB: Limiting of resource use in skeleton driver
-Date: Wed, 21 Dec 2005 19:27:29 +0100
-Content-Disposition: inline
-Message-Id: <200512211927.29612.oliver@neukum.org>
-
-this introduces limits whose lack in the skeleton driver someone recently
-complained about.
-
-Signed-off-by: Oliver Neukum <oliver@neukum.name>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/usb-skeleton.c | 25 ++++++++++++++++++-------
- 1 file changed, 18 insertions(+), 7 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/usb-skeleton.c
-+++ gregkh-2.6/drivers/usb/usb-skeleton.c
-@@ -39,10 +39,15 @@ MODULE_DEVICE_TABLE (usb, skel_table);
- /* Get a minor range for your devices from the usb maintainer */
- #define USB_SKEL_MINOR_BASE 192
-
-+/* our private defines. if this grows any larger, use your own .h file */
-+#define MAX_TRANSFER ( PAGE_SIZE - 512 )
-+#define WRITES_IN_FLIGHT 8
-+
- /* Structure to hold all of our device specific stuff */
- struct usb_skel {
- struct usb_device * udev; /* the usb device for this device */
- struct usb_interface * interface; /* the interface for this device */
-+ struct semaphore limit_sem; /* limiting the number of writes in progress */
- unsigned char * bulk_in_buffer; /* the buffer to receive data */
- size_t bulk_in_size; /* the size of the receive buffer */
- __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */
-@@ -152,6 +157,7 @@ static void skel_write_bulk_callback(str
- /* free up our allocated buffer */
- usb_buffer_free(urb->dev, urb->transfer_buffer_length,
- urb->transfer_buffer, urb->transfer_dma);
-+ up(&dev->limit_sem);
- }
-
- static ssize_t skel_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos)
-@@ -160,6 +166,7 @@ static ssize_t skel_write(struct file *f
- int retval = 0;
- struct urb *urb = NULL;
- char *buf = NULL;
-+ size_t writesize = max(count, MAX_TRANSFER);
-
- dev = (struct usb_skel *)file->private_data;
-
-@@ -167,6 +174,9 @@ static ssize_t skel_write(struct file *f
- if (count == 0)
- goto exit;
-
-+ /* limit the number of URBs in flight to stop a user from using up all RAM */
-+ down (&dev->limit_sem);
-+
- /* create a urb, and a buffer for it, and copy the data to the urb */
- urb = usb_alloc_urb(0, GFP_KERNEL);
- if (!urb) {
-@@ -174,13 +184,13 @@ static ssize_t skel_write(struct file *f
- goto error;
- }
-
-- buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
-+ buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, &urb->transfer_dma);
- if (!buf) {
- retval = -ENOMEM;
- goto error;
- }
-
-- if (copy_from_user(buf, user_buffer, count)) {
-+ if (copy_from_user(buf, user_buffer, writesize)) {
- retval = -EFAULT;
- goto error;
- }
-@@ -188,7 +198,7 @@ static ssize_t skel_write(struct file *f
- /* initialize the urb properly */
- usb_fill_bulk_urb(urb, dev->udev,
- usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr),
-- buf, count, skel_write_bulk_callback, dev);
-+ buf, writesize, skel_write_bulk_callback, dev);
- urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-
- /* send the data out the bulk port */
-@@ -202,11 +212,12 @@ static ssize_t skel_write(struct file *f
- usb_free_urb(urb);
-
- exit:
-- return count;
-+ return writesize;
-
- error:
-- usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
-+ usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma);
- usb_free_urb(urb);
-+ up(&dev->limit_sem);
- return retval;
- }
-
-@@ -238,13 +249,13 @@ static int skel_probe(struct usb_interfa
- int retval = -ENOMEM;
-
- /* allocate memory for our device state and initialize it */
-- dev = kmalloc(sizeof(*dev), GFP_KERNEL);
-+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
- if (dev == NULL) {
- err("Out of memory");
- goto error;
- }
-- memset(dev, 0x00, sizeof(*dev));
- kref_init(&dev->kref);
-+ sema_init(&dev->limit_sem, WRITES_IN_FLIGHT);
-
- dev->udev = usb_get_dev(interface_to_usbdev(interface));
- dev->interface = interface;
diff --git a/usb/usb-make-bias-writeable-in-libusual.patch b/usb/usb-make-bias-writeable-in-libusual.patch
deleted file mode 100644
index 01ccf1185d555..0000000000000
--- a/usb/usb-make-bias-writeable-in-libusual.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From zaitcev@redhat.com Fri Dec 16 00:43:58 2005
-Date: Fri, 16 Dec 2005 00:39:36 -0800
-From: Pete Zaitcev <zaitcev@redhat.com>
-To: greg@kroah.com
-Subject: usb: make bias writeable in libusual
-Message-Id: <20051216003936.226e6543.zaitcev@redhat.com>
-
-Make the bias parameter writeable. Writing the parameter does not trigger
-a rebind of currently attached storage devices.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/storage/libusual.c | 53 ++++++++++++++++++++---------------------
- 1 file changed, 27 insertions(+), 26 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/storage/libusual.c
-+++ gregkh-2.6/drivers/usb/storage/libusual.c
-@@ -24,10 +24,9 @@ static DEFINE_SPINLOCK(usu_lock);
- /*
- */
- #define USB_US_DEFAULT_BIAS USB_US_TYPE_STOR
-+static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS);
-
- #define BIAS_NAME_SIZE (sizeof("usb-storage"))
--static char bias[BIAS_NAME_SIZE];
--static int usb_usual_bias;
- static const char *bias_names[3] = { "none", "usb-storage", "ub" };
-
- static DECLARE_MUTEX_LOCKED(usu_init_notify);
-@@ -35,7 +34,6 @@ static DECLARE_COMPLETION(usu_end_notify
- static atomic_t total_threads = ATOMIC_INIT(0);
-
- static int usu_probe_thread(void *arg);
--static int parse_bias(const char *bias_s);
-
- /*
- * The table.
-@@ -107,7 +105,7 @@ int usb_usual_check_type(const struct us
- if (id_type == caller_type)
- return 0;
- /* Drivers grab devices biased to them */
-- if (id_type == USB_US_TYPE_NONE && caller_type == usb_usual_bias)
-+ if (id_type == USB_US_TYPE_NONE && caller_type == atomic_read(&usu_bias))
- return 0;
- return -ENODEV;
- }
-@@ -124,7 +122,7 @@ static int usu_probe(struct usb_interfac
-
- type = USB_US_TYPE(id->driver_info);
- if (type == 0)
-- type = usb_usual_bias;
-+ type = atomic_read(&usu_bias);
-
- spin_lock_irqsave(&usu_lock, flags);
- if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) {
-@@ -205,9 +203,6 @@ static int __init usb_usual_init(void)
- {
- int rc;
-
-- bias[BIAS_NAME_SIZE-1] = 0;
-- usb_usual_bias = parse_bias(bias);
--
- rc = usb_register(&usu_driver);
- up(&usu_init_notify);
- return rc;
-@@ -230,36 +225,42 @@ static void __exit usb_usual_exit(void)
-
- /*
- * Validate and accept the bias parameter.
-- * Maybe make an sysfs method later. XXX
- */
--static int parse_bias(const char *bias_s)
-+static int usu_set_bias(const char *bias_s, struct kernel_param *kp)
- {
- int i;
-+ int len;
- int bias_n = 0;
-
-- if (bias_s[0] == 0 || bias_s[0] == ' ') {
-- bias_n = USB_US_DEFAULT_BIAS;
-- } else {
-- for (i = 1; i < 3; i++) {
-- if (strcmp(bias_s, bias_names[i]) == 0) {
-- bias_n = i;
-- break;
-- }
-- }
-- if (bias_n == 0) {
-- bias_n = USB_US_DEFAULT_BIAS;
-- printk(KERN_INFO
-- "libusual: unknown bias \"%s\", using \"%s\"\n",
-- bias_s, bias_names[bias_n]);
-+ len = strlen(bias_s);
-+ if (len == 0)
-+ return -EDOM;
-+ if (bias_s[len-1] == '\n')
-+ --len;
-+
-+ for (i = 1; i < 3; i++) {
-+ if (strncmp(bias_s, bias_names[i], len) == 0) {
-+ bias_n = i;
-+ break;
- }
- }
-- return bias_n;
-+ if (bias_n == 0)
-+ return -EINVAL;
-+
-+ atomic_set(&usu_bias, bias_n);
-+ return 0;
-+}
-+
-+static int usu_get_bias(char *buffer, struct kernel_param *kp)
-+{
-+ return strlen(strcpy(buffer, bias_names[atomic_read(&usu_bias)]));
- }
-
- module_init(usb_usual_init);
- module_exit(usb_usual_exit);
-
--module_param_string(bias, bias, BIAS_NAME_SIZE, S_IRUGO|S_IWUSR);
-+module_param_call(bias, usu_set_bias, usu_get_bias, NULL, S_IRUGO|S_IWUSR);
-+__MODULE_PARM_TYPE(bias, "string");
- MODULE_PARM_DESC(bias, "Bias to usb-storage or ub");
-
- MODULE_LICENSE("GPL");
diff --git a/usb/usb-mark-various-usb-tables-const.patch b/usb/usb-mark-various-usb-tables-const.patch
deleted file mode 100644
index abb0e42aeb5ac..0000000000000
--- a/usb/usb-mark-various-usb-tables-const.patch
+++ /dev/null
@@ -1,431 +0,0 @@
-From SRS0+5744165ee46508c39e92+828+infradead.org+arjan@pentafluge.srs.infradead.org Tue Nov 29 00:45:22 2005
-Subject: USB: mark various usb tables const
-From: Arjan van de Ven <arjan@infradead.org>
-To: Greg KH <greg@kroah.com>
-Date: Tue, 29 Nov 2005 09:43:42 +0100
-Message-Id: <1133253823.2804.27.camel@laptopd505.fenrus.org>
-
-patch below marks various USB tables and variables as const so that they
-end up in .rodata section and don't cacheline share with things that get
-written to. For the non-array variables it also allows gcc to optimize
-more.
-
-Signed-off-by: Arjan van de Ven <arjan@infradead.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-
----
- drivers/usb/class/cdc-acm.c | 4 ++--
- drivers/usb/class/usblp.c | 4 ++--
- drivers/usb/core/devices.c | 20 ++++++++++----------
- drivers/usb/host/uhci-debug.c | 2 +-
- drivers/usb/input/aiptek.c | 2 +-
- drivers/usb/input/ati_remote.c | 4 ++--
- drivers/usb/input/fixp-arith.h | 2 +-
- drivers/usb/input/hid-core.c | 2 +-
- drivers/usb/input/hid-input.c | 4 ++--
- drivers/usb/input/keyspan_remote.c | 2 +-
- drivers/usb/input/xpad.c | 6 +++---
- drivers/usb/media/konicawc.c | 6 +++---
- drivers/usb/media/ov511.c | 2 +-
- drivers/usb/media/pwc/pwc-ctrl.c | 2 +-
- drivers/usb/media/stv680.h | 6 +++---
- drivers/usb/media/usbvideo.c | 2 +-
- drivers/usb/misc/sisusbvga/sisusb.c | 4 ++--
- drivers/usb/serial/ftdi_sio.c | 2 +-
- drivers/usb/serial/io_edgeport.c | 2 +-
- drivers/usb/serial/io_fw_boot2.h | 2 +-
- drivers/usb/serial/safe_serial.c | 2 +-
- drivers/usb/storage/sddr09.c | 2 +-
- drivers/usb/storage/usb.c | 2 +-
- 23 files changed, 43 insertions(+), 43 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/class/cdc-acm.c
-+++ gregkh-2.6/drivers/usb/class/cdc-acm.c
-@@ -658,7 +658,7 @@ static int acm_tty_ioctl(struct tty_stru
- return -ENOIOCTLCMD;
- }
-
--static __u32 acm_tty_speed[] = {
-+static const __u32 acm_tty_speed[] = {
- 0, 50, 75, 110, 134, 150, 200, 300, 600,
- 1200, 1800, 2400, 4800, 9600, 19200, 38400,
- 57600, 115200, 230400, 460800, 500000, 576000,
-@@ -666,7 +666,7 @@ static __u32 acm_tty_speed[] = {
- 2500000, 3000000, 3500000, 4000000
- };
-
--static __u8 acm_tty_size[] = {
-+static const __u8 acm_tty_size[] = {
- 5, 6, 7, 8
- };
-
---- gregkh-2.6.orig/drivers/usb/class/usblp.c
-+++ gregkh-2.6/drivers/usb/class/usblp.c
-@@ -199,7 +199,7 @@ struct quirk_printer_struct {
- #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */
- #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
-
--static struct quirk_printer_struct quirk_printers[] = {
-+static const struct quirk_printer_struct quirk_printers[] = {
- { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
- { 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
- { 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
-@@ -301,7 +301,7 @@ static void usblp_bulk_write(struct urb
- * Get and print printer errors.
- */
-
--static char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" };
-+static const char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" };
-
- static int usblp_check_status(struct usblp *usblp, int err)
- {
---- gregkh-2.6.orig/drivers/usb/core/devices.c
-+++ gregkh-2.6/drivers/usb/core/devices.c
-@@ -67,45 +67,45 @@
- /* Define ALLOW_SERIAL_NUMBER if you want to see the serial number of devices */
- #define ALLOW_SERIAL_NUMBER
-
--static char *format_topo =
-+static const char *format_topo =
- /* T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd */
- "\nT: Bus=%2.2d Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%3s MxCh=%2d\n";
-
--static char *format_string_manufacturer =
-+static const char *format_string_manufacturer =
- /* S: Manufacturer=xxxx */
- "S: Manufacturer=%.100s\n";
-
--static char *format_string_product =
-+static const char *format_string_product =
- /* S: Product=xxxx */
- "S: Product=%.100s\n";
-
- #ifdef ALLOW_SERIAL_NUMBER
--static char *format_string_serialnumber =
-+static const char *format_string_serialnumber =
- /* S: SerialNumber=xxxx */
- "S: SerialNumber=%.100s\n";
- #endif
-
--static char *format_bandwidth =
-+static const char *format_bandwidth =
- /* B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd */
- "B: Alloc=%3d/%3d us (%2d%%), #Int=%3d, #Iso=%3d\n";
-
--static char *format_device1 =
-+static const char *format_device1 =
- /* D: Ver=xx.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd */
- "D: Ver=%2x.%02x Cls=%02x(%-5s) Sub=%02x Prot=%02x MxPS=%2d #Cfgs=%3d\n";
-
--static char *format_device2 =
-+static const char *format_device2 =
- /* P: Vendor=xxxx ProdID=xxxx Rev=xx.xx */
- "P: Vendor=%04x ProdID=%04x Rev=%2x.%02x\n";
-
--static char *format_config =
-+static const char *format_config =
- /* C: #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA */
- "C:%c #Ifs=%2d Cfg#=%2d Atr=%02x MxPwr=%3dmA\n";
-
--static char *format_iface =
-+static const char *format_iface =
- /* I: If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=xxxx*/
- "I: If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x Driver=%s\n";
-
--static char *format_endpt =
-+static const char *format_endpt =
- /* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */
- "E: Ad=%02x(%c) Atr=%02x(%-4s) MxPS=%4d Ivl=%d%cs\n";
-
---- gregkh-2.6.orig/drivers/usb/host/uhci-debug.c
-+++ gregkh-2.6/drivers/usb/host/uhci-debug.c
-@@ -197,7 +197,7 @@ out:
- }
-
- #ifdef CONFIG_PROC_FS
--static const char *qh_names[] = {
-+static const char * const qh_names[] = {
- "skel_int128_qh", "skel_int64_qh",
- "skel_int32_qh", "skel_int16_qh",
- "skel_int8_qh", "skel_int4_qh",
---- gregkh-2.6.orig/drivers/usb/input/aiptek.c
-+++ gregkh-2.6/drivers/usb/input/aiptek.c
-@@ -338,7 +338,7 @@ struct aiptek {
- * the bitmap which comes from the tablet. This hides the
- * issue that the F_keys are not sequentially numbered.
- */
--static int macroKeyEvents[] = {
-+static const int macroKeyEvents[] = {
- KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
- KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
- KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
---- gregkh-2.6.orig/drivers/usb/input/ati_remote.c
-+++ gregkh-2.6/drivers/usb/input/ati_remote.c
-@@ -146,7 +146,7 @@ static char init1[] = { 0x01, 0x00, 0x20
- static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
-
- /* Acceleration curve for directional control pad */
--static char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
-+static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
-
- /* Duplicate event filtering time.
- * Sequential, identical KIND_FILTERED inputs with less than
-@@ -197,7 +197,7 @@ struct ati_remote {
- #define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/
-
- /* Translation table from hardware messages to input events. */
--static struct {
-+static const struct {
- short kind;
- unsigned char data1, data2;
- int type;
---- gregkh-2.6.orig/drivers/usb/input/fixp-arith.h
-+++ gregkh-2.6/drivers/usb/input/fixp-arith.h
-@@ -38,7 +38,7 @@ typedef s16 fixp_t;
- #define FRAC_MASK ((1<<FRAC_N)-1)
-
- // Not to be used directly. Use fixp_{cos,sin}
--static fixp_t cos_table[45] = {
-+static const fixp_t cos_table[45] = {
- 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8,
- 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD,
- 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1,
---- gregkh-2.6.orig/drivers/usb/input/hid-core.c
-+++ gregkh-2.6/drivers/usb/input/hid-core.c
-@@ -1454,7 +1454,7 @@ void hid_init_reports(struct hid_device
- * Alphabetically sorted blacklist by quirk type.
- */
-
--static struct hid_blacklist {
-+static const struct hid_blacklist {
- __u16 idVendor;
- __u16 idProduct;
- unsigned quirks;
---- gregkh-2.6.orig/drivers/usb/input/hid-input.c
-+++ gregkh-2.6/drivers/usb/input/hid-input.c
-@@ -39,7 +39,7 @@
-
- #define unk KEY_UNKNOWN
-
--static unsigned char hid_keyboard[256] = {
-+static const unsigned char hid_keyboard[256] = {
- 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
- 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26,
-@@ -58,7 +58,7 @@ static unsigned char hid_keyboard[256] =
- 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk
- };
-
--static struct {
-+static const struct {
- __s32 x;
- __s32 y;
- } hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
---- gregkh-2.6.orig/drivers/usb/input/keyspan_remote.c
-+++ gregkh-2.6/drivers/usb/input/keyspan_remote.c
-@@ -95,7 +95,7 @@ struct usb_keyspan {
- * Currently there are 15 and 17 button models so RESERVED codes
- * are blank areas in the mapping.
- */
--static int keyspan_key_table[] = {
-+static const int keyspan_key_table[] = {
- KEY_RESERVED, /* 0 is just a place holder. */
- KEY_RESERVED,
- KEY_STOP,
---- gregkh-2.6.orig/drivers/usb/input/xpad.c
-+++ gregkh-2.6/drivers/usb/input/xpad.c
-@@ -70,7 +70,7 @@
-
- #define XPAD_PKT_LEN 32
-
--static struct xpad_device {
-+static const struct xpad_device {
- u16 idVendor;
- u16 idProduct;
- char *name;
-@@ -81,13 +81,13 @@ static struct xpad_device {
- { 0x0000, 0x0000, "X-Box pad" }
- };
-
--static signed short xpad_btn[] = {
-+static const signed short xpad_btn[] = {
- BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, /* "analog" buttons */
- BTN_START, BTN_BACK, BTN_THUMBL, BTN_THUMBR, /* start/back/sticks */
- -1 /* terminating entry */
- };
-
--static signed short xpad_abs[] = {
-+static const signed short xpad_abs[] = {
- ABS_X, ABS_Y, /* left stick */
- ABS_RX, ABS_RY, /* right stick */
- ABS_Z, ABS_RZ, /* triggers left/right */
---- gregkh-2.6.orig/drivers/usb/media/konicawc.c
-+++ gregkh-2.6/drivers/usb/media/konicawc.c
-@@ -77,14 +77,14 @@ static int saturation = MAX_SATURATION/2
- static int sharpness = MAX_SHARPNESS/2;
- static int whitebal = 3*(MAX_WHITEBAL/4);
-
--static int spd_to_iface[] = { 1, 0, 3, 2, 4, 5, 6 };
-+static const int spd_to_iface[] = { 1, 0, 3, 2, 4, 5, 6 };
-
- /* These FPS speeds are from the windows config box. They are
- * indexed on size (0-2) and speed (0-6). Divide by 3 to get the
- * real fps.
- */
-
--static int spd_to_fps[][7] = { { 24, 40, 48, 60, 72, 80, 100 },
-+static const int spd_to_fps[][7] = { { 24, 40, 48, 60, 72, 80, 100 },
- { 24, 40, 48, 60, 72, 80, 100 },
- { 18, 30, 36, 45, 54, 60, 75 },
- { 6, 10, 12, 15, 18, 21, 25 } };
-@@ -95,7 +95,7 @@ struct cam_size {
- u8 cmd;
- };
-
--static struct cam_size camera_sizes[] = { { 160, 120, 0x7 },
-+static const struct cam_size camera_sizes[] = { { 160, 120, 0x7 },
- { 160, 136, 0xa },
- { 176, 144, 0x4 },
- { 320, 240, 0x5 } };
---- gregkh-2.6.orig/drivers/usb/media/ov511.c
-+++ gregkh-2.6/drivers/usb/media/ov511.c
-@@ -211,7 +211,7 @@ static struct ov51x_decomp_ops *ov518_mm
-
- /* Number of times to retry a failed I2C transaction. Increase this if you
- * are getting "Failed to read sensor ID..." */
--static int i2c_detect_tries = 5;
-+static const int i2c_detect_tries = 5;
-
- /* MMX support is present in kernel and CPU. Checked upon decomp module load. */
- #if defined(__i386__) || defined(__x86_64__)
---- gregkh-2.6.orig/drivers/usb/media/pwc/pwc-ctrl.c
-+++ gregkh-2.6/drivers/usb/media/pwc/pwc-ctrl.c
-@@ -109,7 +109,7 @@
- #define PT_RESET_CONTROL_FORMATTER 0x02
- #define PT_STATUS_FORMATTER 0x03
-
--static char *size2name[PSZ_MAX] =
-+static const char *size2name[PSZ_MAX] =
- {
- "subQCIF",
- "QSIF",
---- gregkh-2.6.orig/drivers/usb/media/stv680.h
-+++ gregkh-2.6/drivers/usb/media/stv680.h
-@@ -151,7 +151,7 @@ struct usb_stv {
- };
-
-
--static unsigned char red[256] = {
-+static const unsigned char red[256] = {
- 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 25, 30, 35, 38, 42,
- 44, 47, 50, 53, 54, 57, 59, 61, 63, 65, 67, 69,
-@@ -176,7 +176,7 @@ static unsigned char red[256] = {
- 220, 220, 221, 221
- };
-
--static unsigned char green[256] = {
-+static const unsigned char green[256] = {
- 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 28, 34, 39, 43, 47,
- 50, 53, 56, 59, 61, 64, 66, 68, 71, 73, 75, 77,
-@@ -201,7 +201,7 @@ static unsigned char green[256] = {
- 245, 245, 246, 246
- };
-
--static unsigned char blue[256] = {
-+static const unsigned char blue[256] = {
- 0, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 30, 37, 42, 47, 51,
- 55, 58, 61, 64, 67, 70, 72, 74, 78, 80, 82, 84,
---- gregkh-2.6.orig/drivers/usb/media/usbvideo.c
-+++ gregkh-2.6/drivers/usb/media/usbvideo.c
-@@ -955,7 +955,7 @@ static struct file_operations usbvideo_f
- .ioctl = usbvideo_v4l_ioctl,
- .llseek = no_llseek,
- };
--static struct video_device usbvideo_template = {
-+static const struct video_device usbvideo_template = {
- .owner = THIS_MODULE,
- .type = VID_TYPE_CAPTURE,
- .hardware = VID_HARDWARE_CPIA,
---- gregkh-2.6.orig/drivers/usb/misc/sisusbvga/sisusb.c
-+++ gregkh-2.6/drivers/usb/misc/sisusbvga/sisusb.c
-@@ -2437,8 +2437,8 @@ sisusb_reset_text_mode(struct sisusb_usb
- u8 *tempbuf;
- u16 *tempbufb;
- size_t written;
-- static char bootstring[] = "SiSUSB VGA text console, (C) 2005 Thomas Winischhofer.";
-- static char bootlogo[] = "(o_ //\\ V_/_";
-+ static const char bootstring[] = "SiSUSB VGA text console, (C) 2005 Thomas Winischhofer.";
-+ static const char bootlogo[] = "(o_ //\\ V_/_";
-
- /* sisusb->lock is down */
-
---- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.c
-+++ gregkh-2.6/drivers/usb/serial/ftdi_sio.c
-@@ -491,7 +491,7 @@ static struct usb_driver ftdi_driver = {
- .no_dynamic_id = 1,
- };
-
--static char *ftdi_chip_name[] = {
-+static const char *ftdi_chip_name[] = {
- [SIO] = "SIO", /* the serial part of FT8U100AX */
- [FT8U232AM] = "FT8U232AM",
- [FT232BM] = "FT232BM",
---- gregkh-2.6.orig/drivers/usb/serial/io_edgeport.c
-+++ gregkh-2.6/drivers/usb/serial/io_edgeport.c
-@@ -184,7 +184,7 @@ struct divisor_table_entry {
- // These assume a 3.6864MHz crystal, the standard /16, and
- // MCR.7 = 0.
- //
--static struct divisor_table_entry divisor_table[] = {
-+static const struct divisor_table_entry divisor_table[] = {
- { 50, 4608},
- { 75, 3072},
- { 110, 2095}, /* 2094.545455 => 230450 => .0217 % over */
---- gregkh-2.6.orig/drivers/usb/serial/io_fw_boot2.h
-+++ gregkh-2.6/drivers/usb/serial/io_fw_boot2.h
-@@ -537,7 +537,7 @@ static unsigned char IMAGE_ARRAY_NAME[]
-
- };
-
--static struct edge_firmware_version_info IMAGE_VERSION_NAME = {
-+static const struct edge_firmware_version_info IMAGE_VERSION_NAME = {
- 2, 0, 3 }; // Major, Minor, Build
-
- #undef IMAGE_VERSION_NAME
---- gregkh-2.6.orig/drivers/usb/serial/safe_serial.c
-+++ gregkh-2.6/drivers/usb/serial/safe_serial.c
-@@ -167,7 +167,7 @@ static struct usb_driver safe_driver = {
- .no_dynamic_id = 1,
- };
-
--static __u16 crc10_table[256] = {
-+static const __u16 crc10_table[256] = {
- 0x000, 0x233, 0x255, 0x066, 0x299, 0x0aa, 0x0cc, 0x2ff, 0x301, 0x132, 0x154, 0x367, 0x198, 0x3ab, 0x3cd, 0x1fe,
- 0x031, 0x202, 0x264, 0x057, 0x2a8, 0x09b, 0x0fd, 0x2ce, 0x330, 0x103, 0x165, 0x356, 0x1a9, 0x39a, 0x3fc, 0x1cf,
- 0x062, 0x251, 0x237, 0x004, 0x2fb, 0x0c8, 0x0ae, 0x29d, 0x363, 0x150, 0x136, 0x305, 0x1fa, 0x3c9, 0x3af, 0x19c,
---- gregkh-2.6.orig/drivers/usb/storage/sddr09.c
-+++ gregkh-2.6/drivers/usb/storage/sddr09.c
-@@ -237,7 +237,7 @@ static void nand_store_ecc(unsigned char
- #define SPARE 0xfffffffe
- #define UNUSABLE 0xfffffffd
-
--static int erase_bad_lba_entries = 0;
-+static const int erase_bad_lba_entries = 0;
-
- /* send vendor interface command (0x41) */
- /* called for requests 0, 1, 8 */
---- gregkh-2.6.orig/drivers/usb/storage/usb.c
-+++ gregkh-2.6/drivers/usb/storage/usb.c
-@@ -470,7 +470,7 @@ static void get_device_info(struct us_da
- * from the unusual_devs.h table.
- */
- if (id->idVendor || id->idProduct) {
-- static char *msgs[3] = {
-+ static const char *msgs[3] = {
- "an unneeded SubClass entry",
- "an unneeded Protocol entry",
- "unneeded SubClass and Protocol entries"};
diff --git a/usb/usb-net-new-device-id-passed-through-module-parameter.patch b/usb/usb-net-new-device-id-passed-through-module-parameter.patch
deleted file mode 100644
index 16adef6df038b..0000000000000
--- a/usb/usb-net-new-device-id-passed-through-module-parameter.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From petkan@nucleusys.com Tue Nov 15 07:01:55 2005
-Date: Tue, 15 Nov 2005 09:55:18 +0200 (EET)
-From: Petko Manolov <petkan@nucleusys.com>
-To: gregkh@suse.de
-Cc: "A.YOSHIYAMA" <yosshy@debian.or.jp>
-Subject: [PATCH 2/2] usb-net: new device ID passed through module parameter
-Message-ID: <Pine.LNX.4.64.0511150948440.11138@bender.nucleusys.com>
-
-From: A.YOSHIYAMA <yosshy@debian.or.jp>
-
-adds new module parameter "devid" that points to a string with format
-"device_name:vendor_id:device_id:flags". if provided at module load
-time, this string is being parsed and a new entry is created in
-usb_dev_id[] and pegasus_ids[] so the new device can later be recognized
-by the probe routine. this might be helpful for someone who don't
-know/wish to build new module/kernel, but want to use his new usb-to-eth
-device that is not yet listed in pegasus.h
-
-Signed-off-by: Petko Manolov <petkan@nucleusys.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/net/pegasus.c | 38 ++++++++++++++++++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
-
---- gregkh-2.6.orig/drivers/usb/net/pegasus.c
-+++ gregkh-2.6/drivers/usb/net/pegasus.c
-@@ -57,12 +57,14 @@ static const char driver_name[] = "pegas
-
- static int loopback = 0;
- static int mii_mode = 0;
-+static char *devid=NULL;
-
- static struct usb_eth_dev usb_dev_id[] = {
- #define PEGASUS_DEV(pn, vid, pid, flags) \
- {.name = pn, .vendor = vid, .device = pid, .private = flags},
- #include "pegasus.h"
- #undef PEGASUS_DEV
-+ {NULL, 0, 0, 0},
- {NULL, 0, 0, 0}
- };
-
-@@ -71,6 +73,7 @@ static struct usb_device_id pegasus_ids[
- {.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = vid, .idProduct = pid},
- #include "pegasus.h"
- #undef PEGASUS_DEV
-+ {},
- {}
- };
-
-@@ -79,8 +82,10 @@ MODULE_DESCRIPTION(DRIVER_DESC);
- MODULE_LICENSE("GPL");
- module_param(loopback, bool, 0);
- module_param(mii_mode, bool, 0);
-+module_param(devid, charp, 0);
- MODULE_PARM_DESC(loopback, "Enable MAC loopback mode (bit 0)");
- MODULE_PARM_DESC(mii_mode, "Enable HomePNA mode (bit 0),default=MII mode = 0");
-+MODULE_PARM_DESC(devid, "The format is: 'DEV_name:VendorID:DeviceID:Flags'");
-
- /* use ethtool to change the level for any given device */
- static int msg_level = -1;
-@@ -1410,9 +1415,42 @@ static struct usb_driver pegasus_driver
- .resume = pegasus_resume,
- };
-
-+static void parse_id(char *id)
-+{
-+ unsigned int vendor_id=0, device_id=0, flags=0, i=0;
-+ char *token, *name=NULL;
-+
-+ if ((token = strsep(&id, ":")) != NULL)
-+ name = token;
-+ /* name now points to a null terminated string*/
-+ if ((token = strsep(&id, ":")) != NULL)
-+ vendor_id = simple_strtoul(token, NULL, 16);
-+ if ((token = strsep(&id, ":")) != NULL)
-+ device_id = simple_strtoul(token, NULL, 16);
-+ flags = simple_strtoul(id, NULL, 16);
-+ pr_info("%s: new device %s, vendor ID 0x%04x, device ID 0x%04x, flags: 0x%x\n",
-+ driver_name, name, vendor_id, device_id, flags);
-+
-+ if (vendor_id > 0x10000 || vendor_id == 0)
-+ return;
-+ if (device_id > 0x10000 || device_id == 0)
-+ return;
-+
-+ for (i=0; usb_dev_id[i].name; i++);
-+ usb_dev_id[i].name = name;
-+ usb_dev_id[i].vendor = vendor_id;
-+ usb_dev_id[i].device = device_id;
-+ usb_dev_id[i].private = flags;
-+ pegasus_ids[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
-+ pegasus_ids[i].idVendor = vendor_id;
-+ pegasus_ids[i].idProduct = device_id;
-+}
-+
- static int __init pegasus_init(void)
- {
- pr_info("%s: %s, " DRIVER_DESC "\n", driver_name, DRIVER_VERSION);
-+ if (devid)
-+ parse_id(devid);
- pegasus_workqueue = create_singlethread_workqueue("pegasus");
- if (!pegasus_workqueue)
- return -ENOMEM;
diff --git a/usb/usb-net-removes-redundant-return.patch b/usb/usb-net-removes-redundant-return.patch
deleted file mode 100644
index 8f8f3453ca5b8..0000000000000
--- a/usb/usb-net-removes-redundant-return.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-From petkan@nucleusys.com Tue Nov 15 07:01:54 2005
-Date: Tue, 15 Nov 2005 09:48:23 +0200 (EET)
-From: Petko Manolov <petkan@nucleusys.com>
-To: gregkh@suse.de
-Subject: [PATCH 1/2] usb-net: removes redundant return
-Message-ID: <Pine.LNX.4.64.0511150939220.11138@bender.nucleusys.com>
-
-From: Petko Manolov <petkan@nucleusys.com>
-
-removes all redundant collecting of the return value from
-get/set_registers() and suchlike. can't remember who put all of those
-some time ago, but they doesn't make any sense to me. where needed only
-a few references remained;
-
-Signed-off-by: Petko Manolov <petkan@nucleusys.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/net/pegasus.c | 106 ++++++++++++++++++++++------------------------
- 1 file changed, 51 insertions(+), 55 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/net/pegasus.c
-+++ gregkh-2.6/drivers/usb/net/pegasus.c
-@@ -45,7 +45,7 @@
- /*
- * Version Information
- */
--#define DRIVER_VERSION "v0.6.12 (2005/01/13)"
-+#define DRIVER_VERSION "v0.6.13 (2005/11/13)"
- #define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
- #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
-
-@@ -113,7 +113,7 @@ static void ctrl_callback(struct urb *ur
- break;
- default:
- if (netif_msg_drv(pegasus))
-- dev_err(&pegasus->intf->dev, "%s, status %d\n",
-+ dev_dbg(&pegasus->intf->dev, "%s, status %d\n",
- __FUNCTION__, urb->status);
- }
- pegasus->flags &= ~ETH_REGS_CHANGED;
-@@ -308,9 +308,9 @@ static int read_mii_word(pegasus_t * peg
- __le16 regdi;
- int ret;
-
-- ret = set_register(pegasus, PhyCtrl, 0);
-- ret = set_registers(pegasus, PhyAddr, sizeof (data), data);
-- ret = set_register(pegasus, PhyCtrl, (indx | PHY_READ));
-+ set_register(pegasus, PhyCtrl, 0);
-+ set_registers(pegasus, PhyAddr, sizeof (data), data);
-+ set_register(pegasus, PhyCtrl, (indx | PHY_READ));
- for (i = 0; i < REG_TIMEOUT; i++) {
- ret = get_registers(pegasus, PhyCtrl, 1, data);
- if (data[0] & PHY_DONE)
-@@ -319,12 +319,12 @@ static int read_mii_word(pegasus_t * peg
- if (i < REG_TIMEOUT) {
- ret = get_registers(pegasus, PhyData, 2, &regdi);
- *regd = le16_to_cpu(regdi);
-- return 1;
-+ return ret;
- }
- if (netif_msg_drv(pegasus))
- dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
-
-- return 0;
-+ return ret;
- }
-
- static int mdio_read(struct net_device *dev, int phy_id, int loc)
-@@ -344,20 +344,20 @@ static int write_mii_word(pegasus_t * pe
-
- data[1] = (u8) regd;
- data[2] = (u8) (regd >> 8);
-- ret = set_register(pegasus, PhyCtrl, 0);
-- ret = set_registers(pegasus, PhyAddr, sizeof(data), data);
-- ret = set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
-+ set_register(pegasus, PhyCtrl, 0);
-+ set_registers(pegasus, PhyAddr, sizeof(data), data);
-+ set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
- for (i = 0; i < REG_TIMEOUT; i++) {
- ret = get_registers(pegasus, PhyCtrl, 1, data);
- if (data[0] & PHY_DONE)
- break;
- }
- if (i < REG_TIMEOUT)
-- return 0;
-+ return ret;
-
- if (netif_msg_drv(pegasus))
- dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
-- return 1;
-+ return -ETIMEDOUT;
- }
-
- static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
-@@ -374,9 +374,9 @@ static int read_eprom_word(pegasus_t * p
- __le16 retdatai;
- int ret;
-
-- ret = set_register(pegasus, EpromCtrl, 0);
-- ret = set_register(pegasus, EpromOffset, index);
-- ret = set_register(pegasus, EpromCtrl, EPROM_READ);
-+ set_register(pegasus, EpromCtrl, 0);
-+ set_register(pegasus, EpromOffset, index);
-+ set_register(pegasus, EpromCtrl, EPROM_READ);
-
- for (i = 0; i < REG_TIMEOUT; i++) {
- ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
-@@ -386,12 +386,12 @@ static int read_eprom_word(pegasus_t * p
- if (i < REG_TIMEOUT) {
- ret = get_registers(pegasus, EpromData, 2, &retdatai);
- *retdata = le16_to_cpu(retdatai);
-- return 0;
-+ return ret;
- }
-
- if (netif_msg_drv(pegasus))
- dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
-- return -1;
-+ return -ETIMEDOUT;
- }
-
- #ifdef PEGASUS_WRITE_EEPROM
-@@ -400,8 +400,8 @@ static inline void enable_eprom_write(pe
- __u8 tmp;
- int ret;
-
-- ret = get_registers(pegasus, EthCtrl2, 1, &tmp);
-- ret = set_register(pegasus, EthCtrl2, tmp | EPROM_WR_ENABLE);
-+ get_registers(pegasus, EthCtrl2, 1, &tmp);
-+ set_register(pegasus, EthCtrl2, tmp | EPROM_WR_ENABLE);
- }
-
- static inline void disable_eprom_write(pegasus_t * pegasus)
-@@ -409,9 +409,9 @@ static inline void disable_eprom_write(p
- __u8 tmp;
- int ret;
-
-- ret = get_registers(pegasus, EthCtrl2, 1, &tmp);
-- ret = set_register(pegasus, EpromCtrl, 0);
-- ret = set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE);
-+ get_registers(pegasus, EthCtrl2, 1, &tmp);
-+ set_register(pegasus, EpromCtrl, 0);
-+ set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE);
- }
-
- static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
-@@ -420,11 +420,11 @@ static int write_eprom_word(pegasus_t *
- __u8 tmp, d[4] = { 0x3f, 0, 0, EPROM_WRITE };
- int ret;
-
-- ret = set_registers(pegasus, EpromOffset, 4, d);
-+ set_registers(pegasus, EpromOffset, 4, d);
- enable_eprom_write(pegasus);
-- ret = set_register(pegasus, EpromOffset, index);
-- ret = set_registers(pegasus, EpromData, 2, &data);
-- ret = set_register(pegasus, EpromCtrl, EPROM_WRITE);
-+ set_register(pegasus, EpromOffset, index);
-+ set_registers(pegasus, EpromData, 2, &data);
-+ set_register(pegasus, EpromCtrl, EPROM_WRITE);
-
- for (i = 0; i < REG_TIMEOUT; i++) {
- ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
-@@ -433,10 +433,10 @@ static int write_eprom_word(pegasus_t *
- }
- disable_eprom_write(pegasus);
- if (i < REG_TIMEOUT)
-- return 0;
-+ return ret;
- if (netif_msg_drv(pegasus))
- dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
-- return -1;
-+ return -ETIMEDOUT;
- }
- #endif /* PEGASUS_WRITE_EEPROM */
-
-@@ -454,10 +454,9 @@ static inline void get_node_id(pegasus_t
- static void set_ethernet_addr(pegasus_t * pegasus)
- {
- __u8 node_id[6];
-- int ret;
-
- get_node_id(pegasus, node_id);
-- ret = set_registers(pegasus, EthID, sizeof (node_id), node_id);
-+ set_registers(pegasus, EthID, sizeof (node_id), node_id);
- memcpy(pegasus->net->dev_addr, node_id, sizeof (node_id));
- }
-
-@@ -465,30 +464,29 @@ static inline int reset_mac(pegasus_t *
- {
- __u8 data = 0x8;
- int i;
-- int ret;
-
-- ret = set_register(pegasus, EthCtrl1, data);
-+ set_register(pegasus, EthCtrl1, data);
- for (i = 0; i < REG_TIMEOUT; i++) {
-- ret = get_registers(pegasus, EthCtrl1, 1, &data);
-+ get_registers(pegasus, EthCtrl1, 1, &data);
- if (~data & 0x08) {
- if (loopback & 1)
- break;
- if (mii_mode && (pegasus->features & HAS_HOME_PNA))
-- ret = set_register(pegasus, Gpio1, 0x34);
-+ set_register(pegasus, Gpio1, 0x34);
- else
-- ret = set_register(pegasus, Gpio1, 0x26);
-- ret = set_register(pegasus, Gpio0, pegasus->features);
-- ret = set_register(pegasus, Gpio0, DEFAULT_GPIO_SET);
-+ set_register(pegasus, Gpio1, 0x26);
-+ set_register(pegasus, Gpio0, pegasus->features);
-+ set_register(pegasus, Gpio0, DEFAULT_GPIO_SET);
- break;
- }
- }
- if (i == REG_TIMEOUT)
-- return 1;
-+ return -ETIMEDOUT;
-
- if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS ||
- usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) {
-- ret = set_register(pegasus, Gpio0, 0x24);
-- ret = set_register(pegasus, Gpio0, 0x26);
-+ set_register(pegasus, Gpio0, 0x24);
-+ set_register(pegasus, Gpio0, 0x26);
- }
- if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_ELCON) {
- __u16 auxmode;
-@@ -527,7 +525,7 @@ static int enable_net_traffic(struct net
- write_mii_word(pegasus, 0, 0x1b, auxmode | 4);
- }
-
-- return 0;
-+ return ret;
- }
-
- static void fill_skb_pool(pegasus_t * pegasus)
-@@ -881,9 +879,8 @@ static struct net_device_stats *pegasus_
- static inline void disable_net_traffic(pegasus_t * pegasus)
- {
- int tmp = 0;
-- int ret;
-
-- ret = set_registers(pegasus, EthCtrl0, 2, &tmp);
-+ set_registers(pegasus, EthCtrl0, 2, &tmp);
- }
-
- static inline void get_interrupt_interval(pegasus_t * pegasus)
-@@ -1206,18 +1203,17 @@ static __u8 mii_phy_probe(pegasus_t * pe
- static inline void setup_pegasus_II(pegasus_t * pegasus)
- {
- __u8 data = 0xa5;
-- int ret;
-
-- ret = set_register(pegasus, Reg1d, 0);
-- ret = set_register(pegasus, Reg7b, 1);
-+ set_register(pegasus, Reg1d, 0);
-+ set_register(pegasus, Reg7b, 1);
- mdelay(100);
- if ((pegasus->features & HAS_HOME_PNA) && mii_mode)
-- ret = set_register(pegasus, Reg7b, 0);
-+ set_register(pegasus, Reg7b, 0);
- else
-- ret = set_register(pegasus, Reg7b, 2);
-+ set_register(pegasus, Reg7b, 2);
-
-- ret = set_register(pegasus, 0x83, data);
-- ret = get_registers(pegasus, 0x83, 1, &data);
-+ set_register(pegasus, 0x83, data);
-+ get_registers(pegasus, 0x83, 1, &data);
-
- if (data == 0xa5) {
- pegasus->chip = 0x8513;
-@@ -1225,14 +1221,14 @@ static inline void setup_pegasus_II(pega
- pegasus->chip = 0;
- }
-
-- ret = set_register(pegasus, 0x80, 0xc0);
-- ret = set_register(pegasus, 0x83, 0xff);
-- ret = set_register(pegasus, 0x84, 0x01);
-+ set_register(pegasus, 0x80, 0xc0);
-+ set_register(pegasus, 0x83, 0xff);
-+ set_register(pegasus, 0x84, 0x01);
-
- if (pegasus->features & HAS_HOME_PNA && mii_mode)
-- ret = set_register(pegasus, Reg81, 6);
-+ set_register(pegasus, Reg81, 6);
- else
-- ret = set_register(pegasus, Reg81, 2);
-+ set_register(pegasus, Reg81, 2);
- }
-
-
diff --git a/usb/usb-pl2303_update_line_status-data-length-fix.patch b/usb/usb-pl2303_update_line_status-data-length-fix.patch
deleted file mode 100644
index 1dee29605067c..0000000000000
--- a/usb/usb-pl2303_update_line_status-data-length-fix.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From linux-kernel-owner+greg=40kroah.com-S261268AbVG1NcW@vger.kernel.org Thu Jul 28 06:34:45 2005
-Date: Thu, 28 Jul 2005 15:32:20 +0200
-From: Horst Schirmeier <horst@schirmeier.com>
-To: gregkh@suse.de
-Subject: USB: pl2303_update_line_status data length fix
-Message-ID: <20050728133220.GJ25889@quickstop.soohrt.org>
-Content-Disposition: inline
-
-Minimum data length must be UART_STATE + 1, as data[UART_STATE] is being
-accessed for the new line_state. Although PL-2303 hardware is not
-expected to send data with exactly UART_STATE length, this keeps it on
-the safe side.
-
-Signed-off-by: Horst Schirmeier <horst@schirmeier.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
----
- drivers/usb/serial/pl2303.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- gregkh-2.6.orig/drivers/usb/serial/pl2303.c
-+++ gregkh-2.6/drivers/usb/serial/pl2303.c
-@@ -810,7 +810,7 @@ static void pl2303_update_line_status(st
- struct pl2303_private *priv = usb_get_serial_port_data(port);
- unsigned long flags;
- u8 status_idx = UART_STATE;
-- u8 length = UART_STATE;
-+ u8 length = UART_STATE + 1;
-
- if ((le16_to_cpu(port->serial->dev->descriptor.idVendor) == SIEMENS_VENDOR_ID) &&
- (le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X65 ||
diff --git a/usb/usb-remove-unneeded-kmalloc-return-value-casts.patch b/usb/usb-remove-unneeded-kmalloc-return-value-casts.patch
deleted file mode 100644
index 02e6da4fee94f..0000000000000
--- a/usb/usb-remove-unneeded-kmalloc-return-value-casts.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From jesper.juhl@gmail.com Sun Dec 11 11:35:33 2005
-From: Jesper Juhl <jesper.juhl@gmail.com>
-To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
-Subject: USB: Remove unneeded kmalloc() return value casts
-Date: Sun, 11 Dec 2005 20:34:02 +0100
-Cc: "Greg Kroah-Hartman" <gregkh@suse.de>, wolfgang@iksw-muees.de, Luca Risolia <luca.risolia@studio.unibo.it>, Cesar Miquel <miquel@df.uba.ar>, Andrew Morton <akpm@osdl.org>, Jesper Juhl <jesper.juhl@gmail.com>
-Content-Disposition: inline
-Message-Id: <200512112034.02734.jesper.juhl@gmail.com>
-
-
-Remove kmalloc() return value casts that we don't need from
-drivers/usb/*
-
-
-Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
----
- drivers/usb/media/usbvideo.c | 2 +-
- drivers/usb/media/w9968cf.c | 4 ++--
- drivers/usb/misc/auerswald.c | 4 ++--
- drivers/usb/misc/rio500.c | 4 ++--
- 4 files changed, 7 insertions(+), 7 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/misc/auerswald.c
-+++ gregkh-2.6/drivers/usb/misc/auerswald.c
-@@ -767,7 +767,7 @@ static int auerbuf_setup (pauerbufctl_t
- memset (bep, 0, sizeof (auerbuf_t));
- bep->list = bcp;
- INIT_LIST_HEAD (&bep->buff_list);
-- bep->bufp = (char *) kmalloc (bufsize, GFP_KERNEL);
-+ bep->bufp = kmalloc (bufsize, GFP_KERNEL);
- if (!bep->bufp)
- goto bl_fail;
- bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL);
-@@ -1123,7 +1123,7 @@ static int auerswald_int_open (pauerswal
- }
- }
- if (!cp->intbufp) {
-- cp->intbufp = (char *) kmalloc (irqsize, GFP_KERNEL);
-+ cp->intbufp = kmalloc (irqsize, GFP_KERNEL);
- if (!cp->intbufp) {
- ret = -ENOMEM;
- goto intoend;
---- gregkh-2.6.orig/drivers/usb/misc/rio500.c
-+++ gregkh-2.6/drivers/usb/misc/rio500.c
-@@ -465,14 +465,14 @@ static int probe_rio(struct usb_interfac
-
- rio->rio_dev = dev;
-
-- if (!(rio->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) {
-+ if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) {
- err("probe_rio: Not enough memory for the output buffer");
- usb_deregister_dev(intf, &usb_rio_class);
- return -ENOMEM;
- }
- dbg("probe_rio: obuf address:%p", rio->obuf);
-
-- if (!(rio->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) {
-+ if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) {
- err("probe_rio: Not enough memory for the input buffer");
- usb_deregister_dev(intf, &usb_rio_class);
- kfree(rio->obuf);
---- gregkh-2.6.orig/drivers/usb/media/usbvideo.c
-+++ gregkh-2.6/drivers/usb/media/usbvideo.c
-@@ -725,7 +725,7 @@ int usbvideo_register(
- /* Allocate user_data separately because of kmalloc's limits */
- if (num_extra > 0) {
- up->user_size = num_cams * num_extra;
-- up->user_data = (char *) kmalloc(up->user_size, GFP_KERNEL);
-+ up->user_data = kmalloc(up->user_size, GFP_KERNEL);
- if (up->user_data == NULL) {
- err("%s: Failed to allocate user_data (%d. bytes)",
- __FUNCTION__, up->user_size);
---- gregkh-2.6.orig/drivers/usb/media/w9968cf.c
-+++ gregkh-2.6/drivers/usb/media/w9968cf.c
-@@ -3554,7 +3554,7 @@ w9968cf_usb_probe(struct usb_interface*
-
-
- /* Allocate 2 bytes of memory for camera control USB transfers */
-- if (!(cam->control_buffer = (u16*)kmalloc(2, GFP_KERNEL))) {
-+ if (!(cam->control_buffer = kmalloc(2, GFP_KERNEL))) {
- DBG(1,"Couldn't allocate memory for camera control transfers")
- err = -ENOMEM;
- goto fail;
-@@ -3562,7 +3562,7 @@ w9968cf_usb_probe(struct usb_interface*
- memset(cam->control_buffer, 0, 2);
-
- /* Allocate 8 bytes of memory for USB data transfers to the FSB */
-- if (!(cam->data_buffer = (u16*)kmalloc(8, GFP_KERNEL))) {
-+ if (!(cam->data_buffer = kmalloc(8, GFP_KERNEL))) {
- DBG(1, "Couldn't allocate memory for data "
- "transfers to the FSB")
- err = -ENOMEM;
diff --git a/usb/usb-replace-__setup-with-__module_param_call.patch b/usb/usb-replace-__setup-with-__module_param_call.patch
deleted file mode 100644
index e4166b02d2a98..0000000000000
--- a/usb/usb-replace-__setup-with-__module_param_call.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From zaitcev@redhat.com Tue Dec 20 14:19:40 2005
-Date: Tue, 20 Dec 2005 14:15:04 -0800
-From: Pete Zaitcev <zaitcev@redhat.com>
-To: greg@kroah.com
-Cc: zaitcev@redhat.com
-Subject: usb: replace __setup("nousb") with __module_param_call
-Message-Id: <20051220141504.31441a41.zaitcev@redhat.com>
-
-Fedora users complain that passing "nousbstorage" to the installer causes
-the rest of the USB support to disappear. The installer uses kernel command
-line as a way to pass options through Syslinux. The problem stems from the
-use of strncmp() in obsolete_checksetup().
-
-I used __module_param_call() instead of module_param because I wanted to
-preserve the old syntax in grub.conf, and it's the only macro which allows
-to remove the prefix.
-
-The fix is tested to accept the option "nousb" correctly now.
-
-Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/usb/core/usb.c | 13 +------------
- 1 file changed, 1 insertion(+), 12 deletions(-)
-
---- gregkh-2.6.orig/drivers/usb/core/usb.c
-+++ gregkh-2.6/drivers/usb/core/usb.c
-@@ -46,7 +46,6 @@
- const char *usbcore_name = "usbcore";
-
- static int nousb; /* Disable USB when built into kernel image */
-- /* Not honored on modular build */
-
-
- /**
-@@ -1093,18 +1092,8 @@ struct bus_type usb_bus_type = {
- .resume = usb_generic_resume,
- };
-
--#ifndef MODULE
--
--static int __init usb_setup_disable(char *str)
--{
-- nousb = 1;
-- return 1;
--}
--
- /* format to disable USB on kernel command line is: nousb */
--__setup("nousb", usb_setup_disable);
--
--#endif
-+__module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444);
-
- /*
- * for external read access to <nousb>