diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:16:10 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:16:10 -0700 |
| commit | 694979daa122546f6cc04b1780861bea89481dc9 (patch) | |
| tree | 512c66b6a820bcc86afa5ce285996e056d10dedd | |
| parent | 3368273340383a657e28ba3dabeb0660fe7c189f (diff) | |
| download | patches-694979daa122546f6cc04b1780861bea89481dc9.tar.gz | |
usb patches for .31
28 files changed, 2539 insertions, 1 deletions
diff --git a/driver-core.current/firmware-firmware_class-fix-lock-imbalance.patch b/driver-core.current/firmware-firmware_class-fix-lock-imbalance.patch new file mode 100644 index 00000000000000..59b6fe6b3a4598 --- /dev/null +++ b/driver-core.current/firmware-firmware_class-fix-lock-imbalance.patch @@ -0,0 +1,33 @@ +From jirislaby@gmail.com Thu Jul 2 15:12:34 2009 +From: Jiri Slaby <jirislaby@gmail.com> +Date: Sun, 21 Jun 2009 23:57:31 +0200 +Subject: Firmware: firmware_class, fix lock imbalance +To: gregkh@suse.de +Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com> +Message-ID: <1245621451-26814-1-git-send-email-jirislaby@gmail.com> + + +Add omitted unlock in firmware_data_read. + +Signed-off-by: Jiri Slaby <jirislaby@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/firmware_class.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/base/firmware_class.c ++++ b/drivers/base/firmware_class.c +@@ -217,8 +217,10 @@ firmware_data_read(struct kobject *kobj, + ret_count = -ENODEV; + goto out; + } +- if (offset > fw->size) +- return 0; ++ if (offset > fw->size) { ++ ret_count = 0; ++ goto out; ++ } + if (count > fw->size - offset) + count = fw->size - offset; + @@ -13,6 +13,7 @@ driver-core.current/devres-warn-and-return-don-t-crash-on-device_del-of-uninitia driver-core.current/partitions-fix-broken-uevent_suppress-conversion.patch driver-core.current/sparc-remove-driver-core-bus_id_size.patch driver-core.current/driver-core-remove-bus_id_size.patch +driver-core.current/firmware-firmware_class-fix-lock-imbalance.patch # driver_data cleanups driver-core.current/sound-remove-direct-access-of-driver_data.patch @@ -34,6 +35,28 @@ usb.current/usb-option.c-to-support-qisda-h21-h20-usb-modem.patch usb.current/revert-usb-add-intel-langwell-usb-otg-transceiver-drive.patch usb.current/usb-gadget-audio-provide-correct-device-id.patch usb.current/usb-ti_usb_3410_5052-fix-duplicate-device-ids.patch +usb.current/usb-buildfix-ppc-randconfig.patch +usb.current/usb-fix-memory-leak-in-usbtmc.patch +usb.current/usb-gadget-rndis-conformance-tweak.patch +usb.current/usb-musb-davinci-dm355-updates.patch +usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch +usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch +usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch +usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch +usb.current/usb-cdc-acm-work-around-some-broken-devices.patch +usb.current/usb-option-add-novatel-ovation-mc760.patch +usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch +usb.current/usb-fix-the-clear_tt_buffer-interface.patch +usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch +usb.current/usb-ehci-check-for-stall-before-other-errors.patch +usb.current/usb-fix-memleak-in-usbfs.patch +usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch +usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch +usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch +usb.current/usb-serial-optimize-sysrq-function-calls.patch +usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch +usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch +usb.current/usb-usb.h-fix-kernel-doc-notation.patch ##################################################################### @@ -60,6 +83,9 @@ usb/usb-usbmon-end-ugly-tricks-with-dma-peeking.patch usb/usb-let-usb_sg_init-to-set-transfer_buffer-more-often.patch usb/usb-move-endpoint-sync-type-definitions-from-usb-audio.h-to-usb-ch9.h.patch +usb/usb-move-vendor-subclass-definition-from-usb-audio.h-to-usb-ch9.h.patch +usb/usb-audio-gadget-prefix-all-macro-definitions-with-uac_-in-linux-usb-audio.h.patch +usb/usb-audio-gadget-un-inline-generic_et_cmd.patch # stuff I want in my tree, but not to go into -next diff --git a/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch b/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch new file mode 100644 index 00000000000000..6b019c9c92ac89 --- /dev/null +++ b/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch @@ -0,0 +1,47 @@ +From elendil@planet.nl Thu Jul 2 15:56:46 2009 +From: Frans Pop <elendil@planet.nl> +Date: Fri, 26 Jun 2009 16:10:19 +0200 +Subject: USB: add missing class descriptions used in usb/devices file +To: linux-usb@vger.kernel.org +Message-ID: <200906261610.20075.elendil@planet.nl> + + +Added descriptions (for WIRELESS_CONTROLLER and MISC) were taken from +the usb-devices script now included in usbutils. + +Also sort the classes in the same order as in include/linux/usb/ch9.h +for easier comparison for future updates. + +Signed-off-by: Frans Pop <elendil@planet.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/devices.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/core/devices.c ++++ b/drivers/usb/core/devices.c +@@ -136,17 +136,19 @@ static const struct class_info clas_info + {USB_CLASS_AUDIO, "audio"}, + {USB_CLASS_COMM, "comm."}, + {USB_CLASS_HID, "HID"}, +- {USB_CLASS_HUB, "hub"}, + {USB_CLASS_PHYSICAL, "PID"}, ++ {USB_CLASS_STILL_IMAGE, "still"}, + {USB_CLASS_PRINTER, "print"}, + {USB_CLASS_MASS_STORAGE, "stor."}, ++ {USB_CLASS_HUB, "hub"}, + {USB_CLASS_CDC_DATA, "data"}, +- {USB_CLASS_APP_SPEC, "app."}, +- {USB_CLASS_VENDOR_SPEC, "vend."}, +- {USB_CLASS_STILL_IMAGE, "still"}, + {USB_CLASS_CSCID, "scard"}, + {USB_CLASS_CONTENT_SEC, "c-sec"}, + {USB_CLASS_VIDEO, "video"}, ++ {USB_CLASS_WIRELESS_CONTROLLER, "wlcon"}, ++ {USB_CLASS_MISC, "misc"}, ++ {USB_CLASS_APP_SPEC, "app."}, ++ {USB_CLASS_VENDOR_SPEC, "vend."}, + {-1, "unk."} /* leave as last */ + }; + diff --git a/usb.current/usb-buildfix-ppc-randconfig.patch b/usb.current/usb-buildfix-ppc-randconfig.patch new file mode 100644 index 00000000000000..e93f6b098cb3cb --- /dev/null +++ b/usb.current/usb-buildfix-ppc-randconfig.patch @@ -0,0 +1,71 @@ +From david-b@pacbell.net Thu Jul 2 15:13:30 2009 +From: David Brownell <david-b@pacbell.net> +Date: Fri, 19 Jun 2009 05:35:34 -0700 +Subject: USB: buildfix ppc randconfig +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Subrata Modak <subrata@linux.vnet.ibm.com>, Arnd Bergmann <arnd@arndb.de> +Message-ID: <200906190535.35138.david-b@pacbell.net> +Content-Disposition: inline + + +From: Arnd Bergmann <arnd@arndb.de> + +We could just make the USB_OHCI_HCD_PPC_OF option implicit +and selected only if at least one of USB_OHCI_HCD_PPC_OF_BE +and USB_OHCI_HCD_PPC_OF_LE are set. + +[ dbrownell@users.sourceforge.net: fix patch manglation and dependencies ] + +Signed-off-by: Arnd Bergmann <arnd@arndb.de> +Tested-by: Subrata Modak <subrata@linux.vnet.ibm.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/Kconfig | 29 +++++++++++++++-------------- + 1 file changed, 15 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -181,26 +181,27 @@ config USB_OHCI_HCD_PPC_SOC + Enables support for the USB controller on the MPC52xx or + STB03xxx processor chip. If unsure, say Y. + +-config USB_OHCI_HCD_PPC_OF +- bool "OHCI support for PPC USB controller on OF platform bus" +- depends on USB_OHCI_HCD && PPC_OF +- default y +- ---help--- +- Enables support for the USB controller PowerPC present on the +- OpenFirmware platform bus. +- + config USB_OHCI_HCD_PPC_OF_BE +- bool "Support big endian HC" +- depends on USB_OHCI_HCD_PPC_OF +- default y ++ bool "OHCI support for OF platform bus (big endian)" ++ depends on USB_OHCI_HCD && PPC_OF + select USB_OHCI_BIG_ENDIAN_DESC + select USB_OHCI_BIG_ENDIAN_MMIO ++ ---help--- ++ Enables support for big-endian USB controllers present on the ++ OpenFirmware platform bus. + + config USB_OHCI_HCD_PPC_OF_LE +- bool "Support little endian HC" +- depends on USB_OHCI_HCD_PPC_OF +- default n ++ bool "OHCI support for OF platform bus (little endian)" ++ depends on USB_OHCI_HCD && PPC_OF + select USB_OHCI_LITTLE_ENDIAN ++ ---help--- ++ Enables support for little-endian USB controllers present on the ++ OpenFirmware platform bus. ++ ++config USB_OHCI_HCD_PPC_OF ++ bool ++ depends on USB_OHCI_HCD && PPC_OF ++ default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE + + config USB_OHCI_HCD_PCI + bool "OHCI support for PCI-bus USB controllers" diff --git a/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch b/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch new file mode 100644 index 00000000000000..fa40f40170570a --- /dev/null +++ b/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch @@ -0,0 +1,75 @@ +From ars3n@yandex.ru Thu Jul 2 15:48:15 2009 +From: Arseniy Lartsev <ars3n@yandex.ru> +Date: Wed, 1 Jul 2009 16:27:26 +0400 +Subject: USB: cdc-acm: work around some broken devices +To: Oliver Neukum <oliver@neukum.org> +Cc: Alan Stern <stern@rowland.harvard.edu>, USB list <linux-usb@vger.kernel.org>, linux-kernel@vger.kernel.org, greg@kroah.com +Message-ID: <200907011627.31170.ars3n@yandex.ru> + +This patch introduces a work around for cdc-acm devices which are +low speed contrary to the specification, which requires bulk endpoints +which are banned in low speed and converted by usbcore to virtual +interrupt endpoints if they are used nevertheless. + +Signed-off-by: Arseniy Lartsev <ars3n@yandex.ru> +Cc: Oliver Neukum <oliver@neukum.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -387,6 +387,7 @@ static void acm_rx_tasklet(unsigned long + struct acm_ru *rcv; + unsigned long flags; + unsigned char throttled; ++ struct usb_host_endpoint *ep; + + dbg("Entering acm_rx_tasklet"); + +@@ -462,11 +463,20 @@ urbs: + + rcv->buffer = buf; + +- usb_fill_bulk_urb(rcv->urb, acm->dev, +- acm->rx_endpoint, +- buf->base, +- acm->readsize, +- acm_read_bulk, rcv); ++ ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out) ++ [usb_pipeendpoint(acm->rx_endpoint)]; ++ if (usb_endpoint_xfer_int(&ep->desc)) ++ usb_fill_int_urb(rcv->urb, acm->dev, ++ acm->rx_endpoint, ++ buf->base, ++ acm->readsize, ++ acm_read_bulk, rcv, ep->desc.bInterval); ++ else ++ 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; + +@@ -1227,9 +1237,14 @@ made_compressed_probe: + goto alloc_fail7; + } + +- usb_fill_bulk_urb(snd->urb, usb_dev, +- usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), +- NULL, acm->writesize, acm_write_bulk, snd); ++ if (usb_endpoint_xfer_int(epwrite)) ++ usb_fill_int_urb(snd->urb, usb_dev, ++ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), ++ NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval); ++ else ++ usb_fill_bulk_urb(snd->urb, usb_dev, ++ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), ++ NULL, acm->writesize, acm_write_bulk, snd); + snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + snd->instance = acm; + } diff --git a/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch b/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch new file mode 100644 index 00000000000000..b22db10bf3de8e --- /dev/null +++ b/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch @@ -0,0 +1,84 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:23 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:20 -0500 +Subject: USB: console: Fix regression in usb console on kernel boot +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-2-git-send-email-jason.wessel@windriver.com> + + +The commit 335f8514f200e63d689113d29cb7253a5c282967 introduced a +regression which stopped usb consoles from working correctly as a +kernel boot console as well as interactive login device. + +The addition of the serial_close() which in turn calls +tty_port_close_start() will change the reference count of port.count +and warn about it. The usb console code had previously incremented +the port.count to indicate it was making use of the device as a +console and the forced change causes a double open on the usb device +which leads to a non obvious kernel oops later on when the tty is +freed. + +To fix the problem instead make use of port->console to track if the +port is in fact an active console port to avoid double initialization +of the usb serial device. The port.count is incremented and +decremented only with in the scope of usb_console_setup() for the +purpose of the low level driver initialization. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Acked-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/console.c | 13 +++++++------ + drivers/usb/serial/usb-serial.c | 3 ++- + 2 files changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/usb/serial/console.c ++++ b/drivers/usb/serial/console.c +@@ -169,9 +169,11 @@ static int usb_console_setup(struct cons + kfree(tty); + } + } +- /* So we know not to kill the hardware on a hangup on this +- port. We have also bumped the use count by one so it won't go +- idle */ ++ /* Now that any required fake tty operations are completed restore ++ * the tty port count */ ++ --port->port.count; ++ /* The console is special in terms of closing the device so ++ * indicate this port is now acting as a system console. */ + port->console = 1; + retval = 0; + +@@ -204,7 +206,7 @@ static void usb_console_write(struct con + + dbg("%s - port %d, %d byte(s)", __func__, port->number, count); + +- if (!port->port.count) { ++ if (!port->console) { + dbg("%s - port not opened", __func__); + return; + } +@@ -300,8 +302,7 @@ void usb_serial_console_exit(void) + { + if (usbcons_info.port) { + unregister_console(&usbcons); +- if (usbcons_info.port->port.count) +- usbcons_info.port->port.count--; ++ usbcons_info.port->console = 0; + usbcons_info.port = NULL; + } + } +--- a/drivers/usb/serial/usb-serial.c ++++ b/drivers/usb/serial/usb-serial.c +@@ -220,7 +220,8 @@ static int serial_open (struct tty_struc + tty->driver_data = port; + tty_port_tty_set(&port->port, tty); + +- if (port->port.count == 1) { ++ /* If the console is attached, the device is already open */ ++ if (port->port.count == 1 && !port->console) { + + /* lock this module before we call it + * this may fail, which means we must bail out, diff --git a/usb.current/usb-ehci-check-for-stall-before-other-errors.patch b/usb.current/usb-ehci-check-for-stall-before-other-errors.patch new file mode 100644 index 00000000000000..d9fb02d4c0cb87 --- /dev/null +++ b/usb.current/usb-ehci-check-for-stall-before-other-errors.patch @@ -0,0 +1,78 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:55:25 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 17:36:14 -0400 (EDT) +Subject: USB: EHCI: check for STALL before other errors +To: Greg KH <greg@kroah.com> +Cc: David Brownell <david-b@pacbell.net>, USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291735260.18279-100000@iolanthe.rowland.org> + + +This patch (as1257) revises the way ehci-hcd detects STALLs. The +logic is a little peculiar because there's no hardware status bit +specifically meant to indicate a STALL. You just have to guess that a +STALL was received if the BABBLE bit (which is fatal) isn't set and +the transfer stopped before all its retries were used up. + +The existing code doesn't do this properly, because it tests for MMF +(Missed MicroFrame) and DBE (Data Buffer Error) before testing the +retry counter. Thus, if a transaction gets either MMF or DBE the +corresponding flag is set and the transaction is retried. If the +second attempt receives a STALL then -EPIPE is the correct return +value. But the existing code would see the MMF or DBE flag instead +and return -EPROTO, -ENOSR, or -ECOMM. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +CC: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-q.c | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -214,6 +214,14 @@ static int qtd_copy_status ( + if (token & QTD_STS_BABBLE) { + /* FIXME "must" disable babbling device's port too */ + status = -EOVERFLOW; ++ /* CERR nonzero + halt --> stall */ ++ } else if (QTD_CERR(token)) { ++ status = -EPIPE; ++ ++ /* In theory, more than one of the following bits can be set ++ * since they are sticky and the transaction is retried. ++ * Which to test first is rather arbitrary. ++ */ + } else if (token & QTD_STS_MMF) { + /* fs/ls interrupt xfer missed the complete-split */ + status = -EPROTO; +@@ -222,21 +230,15 @@ static int qtd_copy_status ( + ? -ENOSR /* hc couldn't read data */ + : -ECOMM; /* hc couldn't write data */ + } else if (token & QTD_STS_XACT) { +- /* timeout, bad crc, wrong PID, etc; retried */ +- if (QTD_CERR (token)) +- status = -EPIPE; +- else { +- ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", +- urb->dev->devpath, +- usb_pipeendpoint (urb->pipe), +- usb_pipein (urb->pipe) ? "in" : "out"); +- status = -EPROTO; +- } +- /* CERR nonzero + no errors + halt --> stall */ +- } else if (QTD_CERR (token)) +- status = -EPIPE; +- else /* unknown */ ++ /* timeout, bad CRC, wrong PID, etc */ ++ ehci_dbg(ehci, "devpath %s ep%d%s 3strikes\n", ++ urb->dev->devpath, ++ usb_pipeendpoint(urb->pipe), ++ usb_pipein(urb->pipe) ? "in" : "out"); ++ status = -EPROTO; ++ } else { /* unknown */ + status = -EPROTO; ++ } + + ehci_vdbg (ehci, + "dev%d ep%d%s qtd token %08x --> status %d\n", diff --git a/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch b/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch new file mode 100644 index 00000000000000..2c7f78b607285b --- /dev/null +++ b/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch @@ -0,0 +1,263 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:54:39 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 10:47:30 -0400 (EDT) +Subject: USB: EHCI: use the new clear_tt_buffer interface +To: Greg KH <greg@kroah.com> +Cc: USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291043370.16597-100000@iolanthe.rowland.org> + + +This patch (as1256) changes ehci-hcd and all the other drivers in the +EHCI family to make use of the new clear_tt_buffer callbacks. When a +Clear-TT-Buffer request is in progress for a QH, the QH is not allowed +to be linked into the async schedule until the request is finished. +At that time, if there are any URBs queued for the QH, it is linked +into the async schedule. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-au1xxx.c | 2 + drivers/usb/host/ehci-fsl.c | 2 + drivers/usb/host/ehci-hcd.c | 2 + drivers/usb/host/ehci-ixp4xx.c | 2 + drivers/usb/host/ehci-orion.c | 2 + drivers/usb/host/ehci-pci.c | 2 + drivers/usb/host/ehci-ppc-of.c | 2 + drivers/usb/host/ehci-ps3.c | 2 + drivers/usb/host/ehci-q.c | 91 ++++++++++++++++++++++++++++++----------- + drivers/usb/host/ehci.h | 2 + 10 files changed, 86 insertions(+), 23 deletions(-) + +--- a/drivers/usb/host/ehci-au1xxx.c ++++ b/drivers/usb/host/ehci-au1xxx.c +@@ -113,6 +113,8 @@ static const struct hc_driver ehci_au1xx + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci-fsl.c ++++ b/drivers/usb/host/ehci-fsl.c +@@ -325,6 +325,8 @@ static const struct hc_driver ehci_fsl_h + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ehci_fsl_drv_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci.h ++++ b/drivers/usb/host/ehci.h +@@ -354,7 +354,9 @@ struct ehci_qh { + unsigned short period; /* polling interval */ + unsigned short start; /* where polling starts */ + #define NO_FRAME ((unsigned short)~0) /* pick new start */ ++ + struct usb_device *dev; /* access to TT */ ++ unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ + } __attribute__ ((aligned (32))); + + /*-------------------------------------------------------------------------*/ +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -1003,6 +1003,8 @@ idle_timeout: + schedule_timeout_uninterruptible(1); + goto rescan; + case QH_STATE_IDLE: /* fully unlinked */ ++ if (qh->clearing_tt) ++ goto idle_timeout; + if (list_empty (&qh->qtd_list)) { + qh_put (qh); + break; +--- a/drivers/usb/host/ehci-ixp4xx.c ++++ b/drivers/usb/host/ehci-ixp4xx.c +@@ -61,6 +61,8 @@ static const struct hc_driver ixp4xx_ehc + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ixp4xx_ehci_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci-orion.c ++++ b/drivers/usb/host/ehci-orion.c +@@ -165,6 +165,8 @@ static const struct hc_driver ehci_orion + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static void __init +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -404,6 +404,8 @@ static const struct hc_driver ehci_pci_h + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + /*-------------------------------------------------------------------------*/ +--- a/drivers/usb/host/ehci-ppc-of.c ++++ b/drivers/usb/host/ehci-ppc-of.c +@@ -79,6 +79,8 @@ static const struct hc_driver ehci_ppc_o + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + +--- a/drivers/usb/host/ehci-ps3.c ++++ b/drivers/usb/host/ehci-ps3.c +@@ -75,6 +75,8 @@ static const struct hc_driver ps3_ehci_h + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev) +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -139,6 +139,55 @@ qh_refresh (struct ehci_hcd *ehci, struc + + /*-------------------------------------------------------------------------*/ + ++static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh); ++ ++static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd, ++ struct usb_host_endpoint *ep) ++{ ++ struct ehci_hcd *ehci = hcd_to_ehci(hcd); ++ struct ehci_qh *qh = ep->hcpriv; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ehci->lock, flags); ++ qh->clearing_tt = 0; ++ if (qh->qh_state == QH_STATE_IDLE && !list_empty(&qh->qtd_list) ++ && HC_IS_RUNNING(hcd->state)) ++ qh_link_async(ehci, qh); ++ spin_unlock_irqrestore(&ehci->lock, flags); ++} ++ ++static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh, ++ struct urb *urb, u32 token) ++{ ++ ++ /* If an async split transaction gets an error or is unlinked, ++ * the TT buffer may be left in an indeterminate state. We ++ * have to clear the TT buffer. ++ * ++ * Note: this routine is never called for Isochronous transfers. ++ */ ++ if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) { ++#ifdef DEBUG ++ struct usb_device *tt = urb->dev->tt->hub; ++ dev_dbg(&tt->dev, ++ "clear tt buffer port %d, a%d ep%d t%08x\n", ++ urb->dev->ttport, urb->dev->devnum, ++ usb_pipeendpoint(urb->pipe), token); ++#endif /* DEBUG */ ++ if (!ehci_is_TDI(ehci) ++ || urb->dev->tt->hub != ++ ehci_to_hcd(ehci)->self.root_hub) { ++ if (usb_hub_clear_tt_buffer(urb) == 0) ++ qh->clearing_tt = 1; ++ } else { ++ ++ /* REVISIT ARC-derived cores don't clear the root ++ * hub TT buffer in this way... ++ */ ++ } ++ } ++} ++ + static int qtd_copy_status ( + struct ehci_hcd *ehci, + struct urb *urb, +@@ -195,28 +244,6 @@ static int qtd_copy_status ( + usb_pipeendpoint (urb->pipe), + usb_pipein (urb->pipe) ? "in" : "out", + token, status); +- +- /* if async CSPLIT failed, try cleaning out the TT buffer */ +- if (status != -EPIPE +- && urb->dev->tt +- && !usb_pipeint(urb->pipe) +- && ((token & QTD_STS_MMF) != 0 +- || QTD_CERR(token) == 0) +- && (!ehci_is_TDI(ehci) +- || urb->dev->tt->hub != +- ehci_to_hcd(ehci)->self.root_hub)) { +-#ifdef DEBUG +- struct usb_device *tt = urb->dev->tt->hub; +- dev_dbg (&tt->dev, +- "clear tt buffer port %d, a%d ep%d t%08x\n", +- urb->dev->ttport, urb->dev->devnum, +- usb_pipeendpoint (urb->pipe), token); +-#endif /* DEBUG */ +- /* REVISIT ARC-derived cores don't clear the root +- * hub TT buffer in this way... +- */ +- usb_hub_clear_tt_buffer(urb); +- } + } + + return status; +@@ -407,9 +434,16 @@ qh_completions (struct ehci_hcd *ehci, s + /* qh unlinked; token in overlay may be most current */ + if (state == QH_STATE_IDLE + && cpu_to_hc32(ehci, qtd->qtd_dma) +- == qh->hw_current) ++ == qh->hw_current) { + token = hc32_to_cpu(ehci, qh->hw_token); + ++ /* An unlink may leave an incomplete ++ * async transaction in the TT buffer. ++ * We have to clear it. ++ */ ++ ehci_clear_tt_buffer(ehci, qh, urb, token); ++ } ++ + /* force halt for unlinked or blocked qh, so we'll + * patch the qh later and so that completions can't + * activate it while we "know" it's stopped. +@@ -435,6 +469,13 @@ halt: + && (qtd->hw_alt_next + & EHCI_LIST_END(ehci))) + last_status = -EINPROGRESS; ++ ++ /* As part of low/full-speed endpoint-halt processing ++ * we must clear the TT buffer (11.17.5). ++ */ ++ if (unlikely(last_status != -EINPROGRESS && ++ last_status != -EREMOTEIO)) ++ ehci_clear_tt_buffer(ehci, qh, urb, token); + } + + /* if we're removing something not at the queue head, +@@ -864,6 +905,10 @@ static void qh_link_async (struct ehci_h + __hc32 dma = QH_NEXT(ehci, qh->qh_dma); + struct ehci_qh *head; + ++ /* Don't link a QH if there's a Clear-TT-Buffer pending */ ++ if (unlikely(qh->clearing_tt)) ++ return; ++ + /* (re)start the async schedule? */ + head = ehci->async; + timer_action_done (ehci, TIMER_ASYNC_OFF); diff --git a/usb.current/usb-fix-memleak-in-usbfs.patch b/usb.current/usb-fix-memleak-in-usbfs.patch new file mode 100644 index 00000000000000..d0eab53ec09d1b --- /dev/null +++ b/usb.current/usb-fix-memleak-in-usbfs.patch @@ -0,0 +1,64 @@ +From oliver@neukum.org Thu Jul 2 15:55:58 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Sun, 28 Jun 2009 23:34:14 +0200 +Subject: USB: fix memleak in usbfs +To: Greg KH <greg@kroah.com>, USB list <linux-usb@vger.kernel.org> +Message-ID: <200906282334.15172.oliver@neukum.org> +Content-Disposition: inline + + +This patch fixes a memory leak in devio.c::processcompl + +If writing to user space fails the packet must be discarded, as it +already has been removed from the queue of completed packets. + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/devio.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -1231,22 +1231,22 @@ static int processcompl(struct async *as + if (as->userbuffer) + if (copy_to_user(as->userbuffer, urb->transfer_buffer, + urb->transfer_buffer_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(as->status, &userurb->status)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->actual_length, &userurb->actual_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->error_count, &userurb->error_count)) +- return -EFAULT; ++ goto err_out; + + if (usb_endpoint_xfer_isoc(&urb->ep->desc)) { + for (i = 0; i < urb->number_of_packets; i++) { + if (put_user(urb->iso_frame_desc[i].actual_length, + &userurb->iso_frame_desc[i].actual_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->iso_frame_desc[i].status, + &userurb->iso_frame_desc[i].status)) +- return -EFAULT; ++ goto err_out; + } + } + +@@ -1255,6 +1255,10 @@ static int processcompl(struct async *as + if (put_user(addr, (void __user * __user *)arg)) + return -EFAULT; + return 0; ++ ++err_out: ++ free_async(as); ++ return -EFAULT; + } + + static struct async *reap_as(struct dev_state *ps) diff --git a/usb.current/usb-fix-memory-leak-in-usbtmc.patch b/usb.current/usb-fix-memory-leak-in-usbtmc.patch new file mode 100644 index 00000000000000..d2d875635b79d3 --- /dev/null +++ b/usb.current/usb-fix-memory-leak-in-usbtmc.patch @@ -0,0 +1,60 @@ +From oliver@neukum.org Thu Jul 2 15:44:40 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Thu, 2 Jul 2009 16:41:39 +0200 +Subject: USB: fix memory leak in usbtmc +To: Tilman Schmidt <tilman@imap.cc>, greg@kroah.com, USB list <linux-usb@vger.kernel.org> +Message-ID: <200907021641.39562.oliver@neukum.org> +Content-Disposition: inline + + +If an error is returned kfree must also be called. + + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/usbtmc.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/class/usbtmc.c ++++ b/drivers/usb/class/usbtmc.c +@@ -751,7 +751,7 @@ static int get_capabilities(struct usbtm + { + struct device *dev = &data->usb_dev->dev; + char *buffer; +- int rv; ++ int rv = 0; + + buffer = kmalloc(0x18, GFP_KERNEL); + if (!buffer) +@@ -763,7 +763,7 @@ static int get_capabilities(struct usbtm + 0, 0, buffer, 0x18, USBTMC_TIMEOUT); + if (rv < 0) { + dev_err(dev, "usb_control_msg returned %d\n", rv); +- return rv; ++ goto err_out; + } + + dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); +@@ -773,7 +773,8 @@ static int get_capabilities(struct usbtm + dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]); + if (buffer[0] != USBTMC_STATUS_SUCCESS) { + dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); +- return -EPERM; ++ rv = -EPERM; ++ goto err_out; + } + + data->capabilities.interface_capabilities = buffer[4]; +@@ -781,8 +782,9 @@ static int get_capabilities(struct usbtm + data->capabilities.usb488_interface_capabilities = buffer[14]; + data->capabilities.usb488_device_capabilities = buffer[15]; + ++err_out: + kfree(buffer); +- return 0; ++ return rv; + } + + #define capability_attribute(name) \ diff --git a/usb.current/usb-fix-the-clear_tt_buffer-interface.patch b/usb.current/usb-fix-the-clear_tt_buffer-interface.patch new file mode 100644 index 00000000000000..8341957c35f53f --- /dev/null +++ b/usb.current/usb-fix-the-clear_tt_buffer-interface.patch @@ -0,0 +1,201 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:54:07 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 10:43:32 -0400 (EDT) +Subject: USB: fix the clear_tt_buffer interface +To: Greg KH <greg@kroah.com> +Cc: USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291040020.16597-100000@iolanthe.rowland.org> + + +This patch (as1255) updates the interface for calling +usb_hub_clear_tt_buffer(). Even the name of the function is changed! + +When an async URB (i.e., Control or Bulk) going through a high-speed +hub to a non-high-speed device is cancelled or fails, the hub's +Transaction Translator buffer may be left busy still trying to +complete the transaction. The buffer has to be cleared; that's what +usb_hub_clear_tt_buffer() does. + +It isn't safe to send any more URBs to the same endpoint until the TT +buffer is fully clear. Therefore the HCD needs to be told when the +Clear-TT-Buffer request has finished. This patch adds a callback +method to struct hc_driver for that purpose, and makes the hub driver +invoke the callback at the proper time. + +The patch also changes a couple of names; "hub_tt_kevent" and +"tt.kevent" now look rather antiquated. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/hcd.h | 4 ++++ + drivers/usb/core/hub.c | 40 ++++++++++++++++++++++++++-------------- + drivers/usb/core/hub.h | 6 ++++-- + drivers/usb/host/ehci-q.c | 2 +- + 4 files changed, 35 insertions(+), 17 deletions(-) + +--- a/drivers/usb/core/hcd.h ++++ b/drivers/usb/core/hcd.h +@@ -227,6 +227,10 @@ struct hc_driver { + /* has a port been handed over to a companion? */ + int (*port_handed_over)(struct usb_hcd *, int); + ++ /* CLEAR_TT_BUFFER completion callback */ ++ void (*clear_tt_buffer_complete)(struct usb_hcd *, ++ struct usb_host_endpoint *); ++ + /* xHCI specific functions */ + /* Called by usb_alloc_dev to alloc HC device structures */ + int (*alloc_dev)(struct usb_hcd *, struct usb_device *); +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -450,10 +450,10 @@ hub_clear_tt_buffer (struct usb_device * + * talking to TTs must queue control transfers (not just bulk and iso), so + * both can talk to the same hub concurrently. + */ +-static void hub_tt_kevent (struct work_struct *work) ++static void hub_tt_work(struct work_struct *work) + { + struct usb_hub *hub = +- container_of(work, struct usb_hub, tt.kevent); ++ container_of(work, struct usb_hub, tt.clear_work); + unsigned long flags; + int limit = 100; + +@@ -462,6 +462,7 @@ static void hub_tt_kevent (struct work_s + struct list_head *next; + struct usb_tt_clear *clear; + struct usb_device *hdev = hub->hdev; ++ const struct hc_driver *drv; + int status; + + next = hub->tt.clear_list.next; +@@ -471,21 +472,25 @@ static void hub_tt_kevent (struct work_s + /* drop lock so HCD can concurrently report other TT errors */ + spin_unlock_irqrestore (&hub->tt.lock, flags); + status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); +- spin_lock_irqsave (&hub->tt.lock, flags); +- + if (status) + dev_err (&hdev->dev, + "clear tt %d (%04x) error %d\n", + clear->tt, clear->devinfo, status); ++ ++ /* Tell the HCD, even if the operation failed */ ++ drv = clear->hcd->driver; ++ if (drv->clear_tt_buffer_complete) ++ (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep); ++ + kfree(clear); ++ spin_lock_irqsave(&hub->tt.lock, flags); + } + spin_unlock_irqrestore (&hub->tt.lock, flags); + } + + /** +- * usb_hub_tt_clear_buffer - clear control/bulk TT state in high speed hub +- * @udev: the device whose split transaction failed +- * @pipe: identifies the endpoint of the failed transaction ++ * usb_hub_clear_tt_buffer - clear control/bulk TT state in high speed hub ++ * @urb: an URB associated with the failed or incomplete split transaction + * + * High speed HCDs use this to tell the hub driver that some split control or + * bulk transaction failed in a way that requires clearing internal state of +@@ -495,8 +500,10 @@ static void hub_tt_kevent (struct work_s + * It may not be possible for that hub to handle additional full (or low) + * speed transactions until that state is fully cleared out. + */ +-void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe) ++int usb_hub_clear_tt_buffer(struct urb *urb) + { ++ struct usb_device *udev = urb->dev; ++ int pipe = urb->pipe; + struct usb_tt *tt = udev->tt; + unsigned long flags; + struct usb_tt_clear *clear; +@@ -508,7 +515,7 @@ void usb_hub_tt_clear_buffer (struct usb + if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { + dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); + /* FIXME recover somehow ... RESET_TT? */ +- return; ++ return -ENOMEM; + } + + /* info that CLEAR_TT_BUFFER needs */ +@@ -520,14 +527,19 @@ void usb_hub_tt_clear_buffer (struct usb + : (USB_ENDPOINT_XFER_BULK << 11); + if (usb_pipein (pipe)) + clear->devinfo |= 1 << 15; +- ++ ++ /* info for completion callback */ ++ clear->hcd = bus_to_hcd(udev->bus); ++ clear->ep = urb->ep; ++ + /* tell keventd to clear state for this TT */ + spin_lock_irqsave (&tt->lock, flags); + list_add_tail (&clear->clear_list, &tt->clear_list); +- schedule_work (&tt->kevent); ++ schedule_work(&tt->clear_work); + spin_unlock_irqrestore (&tt->lock, flags); ++ return 0; + } +-EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer); ++EXPORT_SYMBOL_GPL(usb_hub_clear_tt_buffer); + + /* If do_delay is false, return the number of milliseconds the caller + * needs to delay. +@@ -818,7 +830,7 @@ static void hub_quiesce(struct usb_hub * + if (hub->has_indicators) + cancel_delayed_work_sync(&hub->leds); + if (hub->tt.hub) +- cancel_work_sync(&hub->tt.kevent); ++ cancel_work_sync(&hub->tt.clear_work); + } + + /* caller has locked the hub device */ +@@ -935,7 +947,7 @@ static int hub_configure(struct usb_hub + + spin_lock_init (&hub->tt.lock); + INIT_LIST_HEAD (&hub->tt.clear_list); +- INIT_WORK (&hub->tt.kevent, hub_tt_kevent); ++ INIT_WORK(&hub->tt.clear_work, hub_tt_work); + switch (hdev->descriptor.bDeviceProtocol) { + case 0: + break; +--- a/drivers/usb/core/hub.h ++++ b/drivers/usb/core/hub.h +@@ -188,16 +188,18 @@ struct usb_tt { + /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ + spinlock_t lock; + struct list_head clear_list; /* of usb_tt_clear */ +- struct work_struct kevent; ++ struct work_struct clear_work; + }; + + struct usb_tt_clear { + struct list_head clear_list; + unsigned tt; + u16 devinfo; ++ struct usb_hcd *hcd; ++ struct usb_host_endpoint *ep; + }; + +-extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe); ++extern int usb_hub_clear_tt_buffer(struct urb *urb); + extern void usb_ep0_reinit(struct usb_device *); + + #endif /* __LINUX_HUB_H */ +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -215,7 +215,7 @@ static int qtd_copy_status ( + /* REVISIT ARC-derived cores don't clear the root + * hub TT buffer in this way... + */ +- usb_hub_tt_clear_buffer (urb->dev, urb->pipe); ++ usb_hub_clear_tt_buffer(urb); + } + } + diff --git a/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch b/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch new file mode 100644 index 00000000000000..7cd94c70f3a779 --- /dev/null +++ b/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch @@ -0,0 +1,31 @@ +From oliver@neukum.org Thu Jul 2 15:52:21 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Tue, 30 Jun 2009 09:44:24 +0200 +Subject: USB: fix uninitialised variable in ti_do_download +To: Andrew Morton <akpm@linux-foundation.org>, greg@kroah.com, USB list <linux-usb@vger.kernel.org>, stable@kernel.org +Message-ID: <200906300944.24551.oliver@neukum.org> +Content-Disposition: inline + + + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Cc: stable <stable@kernel.org> +Cc: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/serial/ti_usb_3410_5052.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/serial/ti_usb_3410_5052.c ++++ b/drivers/usb/serial/ti_usb_3410_5052.c +@@ -1657,7 +1657,7 @@ static int ti_do_download(struct usb_dev + u8 cs = 0; + int done; + struct ti_firmware_header *header; +- int status; ++ int status = 0; + int len; + + for (pos = sizeof(struct ti_firmware_header); pos < size; pos++) diff --git a/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch b/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch new file mode 100644 index 00000000000000..84922483dab67a --- /dev/null +++ b/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch @@ -0,0 +1,41 @@ +From david-b@pacbell.net Thu Jul 2 15:47:16 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:43:58 -0700 +Subject: USB: gadget: pxa25x compiler warning fix +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Philipp Zabel <philipp.zabel@gmail.com>, Eric Miao <eric.y.miao@gmail.com> +Message-ID: <200907010343.59075.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Fix config-dependent compiler warning: + + CC drivers/usb/gadget/pxa25x_udc.o +drivers/usb/gadget/pxa25x_udc.c: In function 'pxa25x_udc_irq': +drivers/usb/gadget/pxa25x_udc.c:1806: warning: array subscript is above array bounds + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/pxa25x_udc.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/pxa25x_udc.c ++++ b/drivers/usb/gadget/pxa25x_udc.c +@@ -1802,11 +1802,13 @@ pxa25x_udc_irq(int irq, void *_dev) + USIR0 |= tmp; + handled = 1; + } ++#ifndef CONFIG_USB_PXA25X_SMALL + if (usir1 & tmp) { + handle_ep(&dev->ep[i+8]); + USIR1 |= tmp; + handled = 1; + } ++#endif + } + } + diff --git a/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch b/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch new file mode 100644 index 00000000000000..593470de28d21c --- /dev/null +++ b/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch @@ -0,0 +1,116 @@ +From david-b@pacbell.net Thu Jul 2 15:46:57 2009 +From: Philipp Zabel <philipp.zabel@gmail.com> +Date: Wed, 1 Jul 2009 03:42:45 -0700 +Subject: USB: gadget: pxa25x uses gpio_is_valid +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Eric Miao <eric.y.miao@gmail.com>, Philipp Zabel <philipp.zabel@gmail.com> +Message-ID: <200907010342.45567.david-b@pacbell.net> +Content-Disposition: inline + + +From: Philipp Zabel <philipp.zabel@gmail.com> + +Use gpio_is_valid instead of assuming that every GPIO +number != 0 is valid while 0 is not. + +Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> +Acked-by: Eric Miao <eric.y.miao@gmail.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/pxa25x_udc.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/drivers/usb/gadget/pxa25x_udc.c ++++ b/drivers/usb/gadget/pxa25x_udc.c +@@ -139,7 +139,7 @@ static int is_vbus_present(void) + { + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + +- if (mach->gpio_vbus) { ++ if (gpio_is_valid(mach->gpio_vbus)) { + int value = gpio_get_value(mach->gpio_vbus); + + if (mach->gpio_vbus_inverted) +@@ -158,7 +158,7 @@ static void pullup_off(void) + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + int off_level = mach->gpio_pullup_inverted; + +- if (mach->gpio_pullup) ++ if (gpio_is_valid(mach->gpio_pullup)) + gpio_set_value(mach->gpio_pullup, off_level); + else if (mach->udc_command) + mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); +@@ -169,7 +169,7 @@ static void pullup_on(void) + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + int on_level = !mach->gpio_pullup_inverted; + +- if (mach->gpio_pullup) ++ if (gpio_is_valid(mach->gpio_pullup)) + gpio_set_value(mach->gpio_pullup, on_level); + else if (mach->udc_command) + mach->udc_command(PXA2XX_UDC_CMD_CONNECT); +@@ -1000,7 +1000,7 @@ static int pxa25x_udc_pullup(struct usb_ + udc = container_of(_gadget, struct pxa25x_udc, gadget); + + /* not all boards support pullup control */ +- if (!udc->mach->gpio_pullup && !udc->mach->udc_command) ++ if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command) + return -EOPNOTSUPP; + + udc->pullup = (is_active != 0); +@@ -2160,7 +2160,7 @@ static int __init pxa25x_udc_probe(struc + dev->dev = &pdev->dev; + dev->mach = pdev->dev.platform_data; + +- if (dev->mach->gpio_vbus) { ++ if (gpio_is_valid(dev->mach->gpio_vbus)) { + if ((retval = gpio_request(dev->mach->gpio_vbus, + "pxa25x_udc GPIO VBUS"))) { + dev_dbg(&pdev->dev, +@@ -2173,7 +2173,7 @@ static int __init pxa25x_udc_probe(struc + } else + vbus_irq = 0; + +- if (dev->mach->gpio_pullup) { ++ if (gpio_is_valid(dev->mach->gpio_pullup)) { + if ((retval = gpio_request(dev->mach->gpio_pullup, + "pca25x_udc GPIO PULLUP"))) { + dev_dbg(&pdev->dev, +@@ -2256,10 +2256,10 @@ lubbock_fail0: + #endif + free_irq(irq, dev); + err_irq1: +- if (dev->mach->gpio_pullup) ++ if (gpio_is_valid(dev->mach->gpio_pullup)) + gpio_free(dev->mach->gpio_pullup); + err_gpio_pullup: +- if (dev->mach->gpio_vbus) ++ if (gpio_is_valid(dev->mach->gpio_vbus)) + gpio_free(dev->mach->gpio_vbus); + err_gpio_vbus: + clk_put(dev->clk); +@@ -2294,11 +2294,11 @@ static int __exit pxa25x_udc_remove(stru + free_irq(LUBBOCK_USB_IRQ, dev); + } + #endif +- if (dev->mach->gpio_vbus) { ++ if (gpio_is_valid(dev->mach->gpio_vbus)) { + free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev); + gpio_free(dev->mach->gpio_vbus); + } +- if (dev->mach->gpio_pullup) ++ if (gpio_is_valid(dev->mach->gpio_pullup)) + gpio_free(dev->mach->gpio_pullup); + + clk_put(dev->clk); +@@ -2329,7 +2329,7 @@ static int pxa25x_udc_suspend(struct pla + struct pxa25x_udc *udc = platform_get_drvdata(dev); + unsigned long flags; + +- if (!udc->mach->gpio_pullup && !udc->mach->udc_command) ++ if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command) + WARNING("USB host won't detect disconnect!\n"); + udc->suspended = 1; + diff --git a/usb.current/usb-gadget-rndis-conformance-tweak.patch b/usb.current/usb-gadget-rndis-conformance-tweak.patch new file mode 100644 index 00000000000000..e9c8f92984f6f8 --- /dev/null +++ b/usb.current/usb-gadget-rndis-conformance-tweak.patch @@ -0,0 +1,42 @@ +From david-b@pacbell.net Thu Jul 2 15:45:24 2009 +From: Qiuping Chen <cqiuping@gmail.com> +Date: Wed, 1 Jul 2009 03:49:29 -0700 +Subject: USB: gadget: rndis conformance tweak +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Qiuping Chen <cqiuping@gmail.com>, Helen Chen <helen.chen@intel.com> +Message-ID: <200907010349.29608.david-b@pacbell.net> +Content-Disposition: inline + + +From: Qiuping Chen <cqiuping@gmail.com> + +Support OID_802_3_MAC_OPTIONS in gen_ndis_query_resp() of rndis.c to +make RNDIS gadget pass 1c_SetMulticast subtest in Microsoft NDISTest6: + + http://www.microsoft.com/whdc/DevTools/tools/NDIStest.mspx + +The other tests in NDISTest6 are passed. + +[ dbrownell@users.sourceforge.net: remove OID_802_3_MAXIMUM_LIST_SIZE +setting ... it was bogus, this code only handles one entry, not 32. +And we don't know what would break if we lied about that... ] + +Signed-off-by: Helen Chen <helen.chen@intel.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/rndis.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/rndis.c ++++ b/drivers/usb/gadget/rndis.c +@@ -442,6 +442,8 @@ gen_ndis_query_resp (int configNr, u32 O + + case OID_802_3_MAC_OPTIONS: + pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__); ++ *outbuf = cpu_to_le32(0); ++ retval = 0; + break; + + /* ieee802.3 statistics OIDs (table 4-4) */ diff --git a/usb.current/usb-musb-davinci-dm355-updates.patch b/usb.current/usb-musb-davinci-dm355-updates.patch new file mode 100644 index 00000000000000..d7964d279f14df --- /dev/null +++ b/usb.current/usb-musb-davinci-dm355-updates.patch @@ -0,0 +1,71 @@ +From david-b@pacbell.net Thu Jul 2 15:46:04 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:32:43 -0700 +Subject: USB: musb: davinci dm355 updates (remainder) +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Kevin Hilman <khilman@deeprootsystems.com> +Message-ID: <200907010332.43849.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Finish merging updates for DM355 chips into musb/davinci.c now +that its support is in mainline: kick in new DRVVBUS controls. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -35,6 +35,7 @@ + #include <mach/hardware.h> + #include <mach/memory.h> + #include <mach/gpio.h> ++#include <mach/cputype.h> + + #include <asm/mach-types.h> + +@@ -411,6 +412,21 @@ int __init musb_platform_init(struct mus + __raw_writel(phy_ctrl, USB_PHY_CTRL); + } + ++ /* On dm355, the default-A state machine needs DRVVBUS control. ++ * If we won't be a host, there's no need to turn it on. ++ */ ++ if (cpu_is_davinci_dm355()) { ++ u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); ++ ++ if (is_host_enabled(musb)) { ++ deepsleep &= ~DRVVBUS_OVERRIDE; ++ } else { ++ deepsleep &= ~DRVVBUS_FORCE; ++ deepsleep |= DRVVBUS_OVERRIDE; ++ } ++ __raw_writel(deepsleep, DM355_DEEPSLEEP); ++ } ++ + /* reset the controller */ + musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); + +@@ -437,6 +453,15 @@ int musb_platform_exit(struct musb *musb + if (is_host_enabled(musb)) + del_timer_sync(&otg_workaround); + ++ /* force VBUS off */ ++ if (cpu_is_davinci_dm355()) { ++ u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); ++ ++ deepsleep &= ~DRVVBUS_FORCE; ++ deepsleep |= DRVVBUS_OVERRIDE; ++ __raw_writel(deepsleep, DM355_DEEPSLEEP); ++ } ++ + davinci_source_power(musb, 0 /*off*/, 1); + + /* delay, to avoid problems with module reload */ diff --git a/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch b/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch new file mode 100644 index 00000000000000..e178505c18f1cf --- /dev/null +++ b/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch @@ -0,0 +1,39 @@ +From david-b@pacbell.net Thu Jul 2 15:46:21 2009 +From: Kevin Hilman <khilman@deeprootsystems.com> +Date: Wed, 1 Jul 2009 03:33:46 -0700 +Subject: USB: musb: davinci dm6446evm GPIO renumbering +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Kevin Hilman <khilman@deeprootsystems.com> +Message-ID: <200907010333.46803.david-b@pacbell.net> +Content-Disposition: inline + + +From: Kevin Hilman <khilman@deeprootsystems.com> + +Numbering for GPIOs on the pcf857x chips on the dm644x EVM board +changed when DaVinci chips with more GPIOs were supported. Update +the GPIO number used for nVBUS_DRV. + +Longer term, we need a better abstraction of board-specific setup in +this code so we're not hard-coding board specific GPIOs into the +driver, but for now this at least gets it back to working with +mainline davinci core code. + +Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -42,7 +42,7 @@ + #include "musb_core.h" + + #ifdef CONFIG_MACH_DAVINCI_EVM +-#define GPIO_nVBUS_DRV 87 ++#define GPIO_nVBUS_DRV 144 + #endif + + #include "davinci.h" diff --git a/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch b/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch new file mode 100644 index 00000000000000..24bbb6df95d0a9 --- /dev/null +++ b/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch @@ -0,0 +1,91 @@ +From david-b@pacbell.net Thu Jul 2 15:47:44 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:36:16 -0700 +Subject: USB: musb: silence "suspend as a_wait_vrise is_active" msgs +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org +Message-ID: <200907010336.16890.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Get rid of some obnoxious and inappropriate messaging, mostly on +DaVinci, when usbcore tries to autosuspend a root hub if just a +mini/micro-A connector is connected. Symptom: endless stream of +messages reading like: + + musb_bus_suspend 2221: trying to suspend as a_wait_vrise is_active=1 + +Improve that musb bus suspend primitive a bit. Take advantage of +this call to update the OTG state machine if appropriate, moving +the device out of the A_WAIT_VRISE state. There's basically no +timer for that state transition just now, except with tusb6010; +that can make trouble. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 5 +++-- + drivers/usb/musb/musb_host.c | 25 +++++++++++++++++++++---- + 2 files changed, 24 insertions(+), 6 deletions(-) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -330,7 +330,6 @@ static irqreturn_t davinci_interrupt(int + mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); + WARNING("VBUS error workaround (delay coming)\n"); + } else if (is_host_enabled(musb) && drvvbus) { +- musb->is_active = 1; + MUSB_HST_MODE(musb); + musb->xceiv->default_a = 1; + musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; +@@ -344,7 +343,9 @@ static irqreturn_t davinci_interrupt(int + portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); + } + +- /* NOTE: this must complete poweron within 100 msec */ ++ /* NOTE: this must complete poweron within 100 msec ++ * (OTG_TIME_A_WAIT_VRISE) but we don't check for that. ++ */ + davinci_source_power(musb, drvvbus, 0); + DBG(2, "VBUS %s (%s)%s, devctl %02x\n", + drvvbus ? "on" : "off", +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd * + static int musb_bus_suspend(struct usb_hcd *hcd) + { + struct musb *musb = hcd_to_musb(hcd); ++ u8 devctl; + +- if (musb->xceiv->state == OTG_STATE_A_SUSPEND) ++ if (!is_host_active(musb)) + return 0; + +- if (is_host_active(musb) && musb->is_active) { +- WARNING("trying to suspend as %s is_active=%i\n", +- otg_state_string(musb), musb->is_active); ++ switch (musb->xceiv->state) { ++ case OTG_STATE_A_SUSPEND: ++ return 0; ++ case OTG_STATE_A_WAIT_VRISE: ++ /* ID could be grounded even if there's no device ++ * on the other end of the cable. NOTE that the ++ * A_WAIT_VRISE timers are messy with MUSB... ++ */ ++ devctl = musb_readb(musb->mregs, MUSB_DEVCTL); ++ if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) ++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON; ++ break; ++ default: ++ break; ++ } ++ ++ if (musb->is_active) { ++ WARNING("trying to suspend as %s while active\n", ++ otg_state_string(musb)); + return -EBUSY; + } else + return 0; diff --git a/usb.current/usb-option-add-novatel-ovation-mc760.patch b/usb.current/usb-option-add-novatel-ovation-mc760.patch new file mode 100644 index 00000000000000..99b5454bb66328 --- /dev/null +++ b/usb.current/usb-option-add-novatel-ovation-mc760.patch @@ -0,0 +1,36 @@ +From dcbw@redhat.com Thu Jul 2 15:49:10 2009 +From: Dan Williams <dcbw@redhat.com> +Date: Tue, 30 Jun 2009 16:09:28 -0400 +Subject: USB: option: add Novatel Ovation MC760 +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, stable@kernel.org +Message-ID: <1246392568.31037.6.camel@localhost.localdomain> + + +Used by Virgin Mobile with the Broadband2Go service, for example. + +Signed-off-by: Dan Williams <dcbw@redhat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -206,6 +206,7 @@ static int option_resume(struct usb_ser + #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 + #define NOVATELWIRELESS_PRODUCT_U727 0x5010 + #define NOVATELWIRELESS_PRODUCT_MC760 0x6000 ++#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 + + /* FUTURE NOVATEL PRODUCTS */ + #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 +@@ -436,6 +437,7 @@ static struct usb_device_id option_ids[] + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ ++ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ diff --git a/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch b/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch new file mode 100644 index 00000000000000..c7f5cb0d9b13d3 --- /dev/null +++ b/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch @@ -0,0 +1,55 @@ +From david-b@pacbell.net Thu Jul 2 16:02:42 2009 +From: David Brownell <david-b@pacbell.net> +Date: Fri, 19 Jun 2009 03:09:04 -0700 +Subject: USB: RNDIS gadget, fix issues talking from PXA +To: Greg KH <greg@kroah.com> +Cc: "Aric D. Blumer" <aric@sdgsystems.com>, linux-usb@vger.kernel.org +Message-ID: <200906190309.04632.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +The reworked Ethernet gadget has an RNDIS interop problem when used +with the CDC subset driver ... e.g. on PXA 2xx and 3xx hardware, +which currently has a hard time talking to MS-Windows hosts. + +The issue is that Microsoft requires USB_CLASS_COMM. Fix by tweaking +the CDC subset driver to not switch to USB_CLASS_VENDOR_SPEC if RNDIS +is used in some other device configuration. + +[ UPDATED: some "statements" were comma-terminated; fix that. ] + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Cc: Aric Blumer <aric@sdgsystems.net> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/ether.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/usb/gadget/ether.c ++++ b/drivers/usb/gadget/ether.c +@@ -293,15 +293,16 @@ static int __init eth_bind(struct usb_co + /* CDC Subset */ + eth_config_driver.label = "CDC Subset/SAFE"; + +- device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM), +- device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM), +- device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; ++ device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM); ++ device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM); ++ if (!has_rndis()) ++ device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; + } + + if (has_rndis()) { + /* RNDIS plus ECM-or-Subset */ +- device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM), +- device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM), ++ device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM); ++ device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM); + device_desc.bNumConfigurations = 2; + } + diff --git a/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch b/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch new file mode 100644 index 00000000000000..b73075dc2bcca1 --- /dev/null +++ b/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch @@ -0,0 +1,48 @@ +From folkert@vanheusden.com Thu Jul 2 16:01:46 2009 +From: Folkert van Heusden <folkert@vanheusden.com> +Date: Fri, 19 Jun 2009 22:14:42 +0200 +Subject: USB: serial: FTDI with product code FB80 and vendor id 0403 +To: greg@kroah.com, bryder@sgi.com, kuba@mareimbrium.org +Cc: pawilber@gmail.com, udovdh@xs4all.nl +Message-ID: <20090619201442.GR23218@vanheusden.com> +Content-Disposition: inline + + +It seems an USB device with vendor id 0403 and product code FB80 has an +FTDI serial io chip as well: http://ftdichip.com/Drivers/D2XX.htm +This device in fact is a true random generantor by comsci: +http://comscire.com/Products/R2000KU/ +So the following patch should add support for this device if I am +correct. Not tested as I do not own this device (I would like support in +the kernel so that my entropybroker application (which distributes +entrop data (random values) between servers and clients)). + + +From: Folkert van Heusden <folkert@vanheusden.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -191,6 +191,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, +--- a/drivers/usb/serial/ftdi_sio.h ++++ b/drivers/usb/serial/ftdi_sio.h +@@ -506,6 +506,7 @@ + * + * Armin Laeuger originally sent the PID for the UM 100 module. + */ ++#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG */ + #define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */ + #define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */ + #define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */ diff --git a/usb.current/usb-serial-optimize-sysrq-function-calls.patch b/usb.current/usb-serial-optimize-sysrq-function-calls.patch new file mode 100644 index 00000000000000..e79d14618bd7aa --- /dev/null +++ b/usb.current/usb-serial-optimize-sysrq-function-calls.patch @@ -0,0 +1,103 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:51 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:22 -0500 +Subject: USB: serial: optimize sysrq function calls +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-4-git-send-email-jason.wessel@windriver.com> + + +There is no need to have external function calls for the sysrq +functions. The compiler can inline the sysrq calls such that they are +entirely a NOP if CONFIG_MAGIC_SYSRQ is not set. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/generic.c | 25 ------------------------- + include/linux/usb/serial.h | 32 ++++++++++++++++++++++++++++---- + 2 files changed, 28 insertions(+), 29 deletions(-) + +--- a/drivers/usb/serial/generic.c ++++ b/drivers/usb/serial/generic.c +@@ -535,31 +535,6 @@ void usb_serial_generic_unthrottle(struc + } + } + +-int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) +-{ +- if (port->sysrq && port->console) { +- if (ch && time_before(jiffies, port->sysrq)) { +- handle_sysrq(ch, tty_port_tty_get(&port->port)); +- port->sysrq = 0; +- return 1; +- } +- port->sysrq = 0; +- } +- return 0; +-} +-EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char); +- +-int usb_serial_handle_break(struct usb_serial_port *port) +-{ +- if (!port->sysrq) { +- port->sysrq = jiffies + HZ*5; +- return 1; +- } +- port->sysrq = 0; +- return 0; +-} +-EXPORT_SYMBOL_GPL(usb_serial_handle_break); +- + void usb_serial_generic_disconnect(struct usb_serial *serial) + { + int i; +--- a/include/linux/usb/serial.h ++++ b/include/linux/usb/serial.h +@@ -317,10 +317,6 @@ extern int usb_serial_generic_register(i + extern void usb_serial_generic_deregister(void); + extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, + gfp_t mem_flags); +-extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, +- unsigned int ch); +-extern int usb_serial_handle_break(struct usb_serial_port *port); +- + + extern int usb_serial_bus_register(struct usb_serial_driver *device); + extern void usb_serial_bus_deregister(struct usb_serial_driver *device); +@@ -329,6 +325,34 @@ extern struct usb_serial_driver usb_seri + extern struct bus_type usb_serial_bus_type; + extern struct tty_driver *usb_serial_tty_driver; + ++static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, ++ unsigned int ch) ++{ ++#ifdef CONFIG_MAGIC_SYSRQ ++ if (port->sysrq && port->console) { ++ if (ch && time_before(jiffies, port->sysrq)) { ++ handle_sysrq(ch, tty_port_tty_get(&port->port)); ++ port->sysrq = 0; ++ return 1; ++ } ++ port->sysrq = 0; ++ } ++#endif /* CONFIG_MAGIC_SYSRQ */ ++ return 0; ++} ++ ++static inline int usb_serial_handle_break(struct usb_serial_port *port) ++{ ++#ifdef CONFIG_MAGIC_SYSRQ ++ if (!port->sysrq) { ++ port->sysrq = jiffies + HZ*5; ++ return 1; ++ } ++ port->sysrq = 0; ++#endif /* CONFIG_MAGIC_SYSRQ */ ++ return 0; ++} ++ + static inline void usb_serial_debug_data(int debug, + struct device *dev, + const char *function, int size, diff --git a/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch b/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch new file mode 100644 index 00000000000000..0152a3a5ed8974 --- /dev/null +++ b/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch @@ -0,0 +1,54 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:37 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:21 -0500 +Subject: USB: serial: regression fix to move sysrq from hot path +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-3-git-send-email-jason.wessel@windriver.com> + + +A performance regression was introduced by commit: +98fcb5f78165b8a3d93870ad7afd4d9ebbb8b43a + +The sysrq handling should only get executed if the attached usb serial +device is acting as a serial system console. A serial system console +has a very low input throughput vs a 3g usb modem which pushes bytes +through the same interface at a high rate. + +Entire strings of output can be processed via the tty input when the +device is not a console. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Acked-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/generic.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/usb/serial/generic.c ++++ b/drivers/usb/serial/generic.c +@@ -425,11 +425,19 @@ static void flush_and_resubmit_read_urb( + goto done; + + /* Push data to tty */ +- for (i = 0; i < urb->actual_length; i++, ch++) { +- if (!usb_serial_handle_sysrq_char(port, *ch)) +- tty_insert_flip_char(tty, *ch, TTY_NORMAL); ++ if (unlikely(port->console)) { ++ for (i = 0; i < urb->actual_length; i++, ch++) { ++ if (!usb_serial_handle_sysrq_char(port, *ch)) ++ tty_insert_flip_char(tty, *ch, TTY_NORMAL); ++ } ++ tty_flip_buffer_push(tty); ++ } else if (urb->actual_length) { ++ i = tty_buffer_request_room(tty, urb->actual_length); ++ if (i) { ++ tty_insert_flip_string(tty, urb->transfer_buffer, i); ++ tty_flip_buffer_push(tty); ++ } + } +- tty_flip_buffer_push(tty); + tty_kref_put(tty); + done: + usb_serial_generic_resubmit_read_urb(port, GFP_ATOMIC); diff --git a/usb.current/usb-usb.h-fix-kernel-doc-notation.patch b/usb.current/usb-usb.h-fix-kernel-doc-notation.patch new file mode 100644 index 00000000000000..f6f14351f8338f --- /dev/null +++ b/usb.current/usb-usb.h-fix-kernel-doc-notation.patch @@ -0,0 +1,53 @@ +From randy.dunlap@oracle.com Thu Jul 2 16:03:51 2009 +From: Randy Dunlap <randy.dunlap@oracle.com> +Date: Thu, 18 Jun 2009 10:39:11 -0700 +Subject: USB: usb.h: fix kernel-doc notation +To: linux-usb <linux-usb@vger.kernel.org>, Greg KH <gregkh@suse.de> +Message-ID: <4A3A7BBF.1000507@oracle.com> + + +From: Randy Dunlap <randy.dunlap@oracle.com> + +Fix usb.h kernel-doc warnings: + +Warning(include/linux/usb.h:918): Excess struct/union/enum/typedef member 'nodename' description in 'usb_device_driver' +Warning(include/linux/usb.h:939): No description found for parameter 'nodename' +Warning(include/linux/usb.h:1219): No description found for parameter 'sg' +Warning(include/linux/usb.h:1219): No description found for parameter 'num_sgs' + +Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/usb.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -888,8 +888,6 @@ struct usb_driver { + * struct usb_device_driver - identifies USB device driver to usbcore + * @name: The driver name should be unique among USB drivers, + * and should normally be the same as the module name. +- * @nodename: Callback to provide a naming hint for a possible +- * device node to create. + * @probe: Called to see if the driver is willing to manage a particular + * device. If it is, probe returns zero and uses dev_set_drvdata() + * to associate driver-specific data with the device. If unwilling +@@ -924,6 +922,8 @@ extern struct bus_type usb_bus_type; + /** + * struct usb_class_driver - identifies a USB driver that wants to use the USB major number + * @name: the usb class device name for this driver. Will show up in sysfs. ++ * @nodename: Callback to provide a naming hint for a possible ++ * device node to create. + * @fops: pointer to the struct file_operations of this driver. + * @minor_base: the start of the minor range for this driver. + * +@@ -1046,6 +1046,8 @@ typedef void (*usb_complete_t)(struct ur + * the device driver is saying that it provided this DMA address, + * which the host controller driver should use in preference to the + * transfer_buffer. ++ * @sg: scatter gather buffer list ++ * @num_sgs: number of entries in the sg list + * @transfer_buffer_length: How big is transfer_buffer. The transfer may + * be broken up into chunks according to the current maximum packet + * size for the endpoint, which is a function of the configuration diff --git a/usb/usb-audio-gadget-prefix-all-macro-definitions-with-uac_-in-linux-usb-audio.h.patch b/usb/usb-audio-gadget-prefix-all-macro-definitions-with-uac_-in-linux-usb-audio.h.patch new file mode 100644 index 00000000000000..3b5ff5c83a3bfa --- /dev/null +++ b/usb/usb-audio-gadget-prefix-all-macro-definitions-with-uac_-in-linux-usb-audio.h.patch @@ -0,0 +1,643 @@ +From laurent.pinchart@skynet.be Thu Jul 2 15:12:01 2009 +From: Laurent Pinchart <laurent.pinchart@skynet.be> +Date: Sun, 21 Jun 2009 23:23:05 +0200 +Subject: USB audio gadget: Prefix all macro definitions with UAC_ in linux/usb/audio.h +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Bryan Wu <cooloney@kernel.org>, Mike Frysinger <vapier@gentoo.org> +Message-ID: <200906212323.06330.laurent.pinchart@skynet.be> +Content-Disposition: inline + + +linux/usb/audio.h is a public header file that includes definitions +exported to userspace. To avoid namespace clashes, prefix all macro +definitions with UAC_. Existing macros and structures prefixed with +USB_AC_ and USB_AS_ are renamed for consistency. + +Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/usb/gadget/audio.c | 24 ++-- + drivers/usb/gadget/f_audio.c | 80 ++++++------- + drivers/usb/gadget/gmidi.c | 8 - + include/linux/usb/audio.h | 256 ++++++++++++++++++++++--------------------- + 4 files changed, 187 insertions(+), 181 deletions(-) + +--- a/drivers/usb/gadget/audio.c ++++ b/drivers/usb/gadget/audio.c +@@ -106,20 +106,20 @@ static int audio_set_endpoint_req(struct + ctrl->bRequest, w_value, len, ep); + + switch (ctrl->bRequest) { +- case SET_CUR: ++ case UAC_SET_CUR: + value = 0; + break; + +- case SET_MIN: ++ case UAC_SET_MIN: + break; + +- case SET_MAX: ++ case UAC_SET_MAX: + break; + +- case SET_RES: ++ case UAC_SET_RES: + break; + +- case SET_MEM: ++ case UAC_SET_MEM: + break; + + default: +@@ -142,13 +142,13 @@ static int audio_get_endpoint_req(struct + ctrl->bRequest, w_value, len, ep); + + switch (ctrl->bRequest) { +- case GET_CUR: +- case GET_MIN: +- case GET_MAX: +- case GET_RES: ++ case UAC_GET_CUR: ++ case UAC_GET_MIN: ++ case UAC_GET_MAX: ++ case UAC_GET_RES: + value = 3; + break; +- case GET_MEM: ++ case UAC_GET_MEM: + break; + default: + break; +@@ -171,11 +171,11 @@ audio_setup(struct usb_configuration *c, + * Audio class messages; interface activation uses set_alt(). + */ + switch (ctrl->bRequestType) { +- case USB_AUDIO_SET_ENDPOINT: ++ case USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT: + value = audio_set_endpoint_req(c, ctrl); + break; + +- case USB_AUDIO_GET_ENDPOINT: ++ case USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_ENDPOINT: + value = audio_get_endpoint_req(c, ctrl); + break; + +--- a/drivers/usb/gadget/f_audio.c ++++ b/drivers/usb/gadget/f_audio.c +@@ -50,16 +50,16 @@ static struct usb_interface_descriptor a + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, + }; + +-DECLARE_USB_AC_HEADER_DESCRIPTOR(2); ++DECLARE_UAC_AC_HEADER_DESCRIPTOR(2); + +-#define USB_DT_AC_HEADER_LENGH USB_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES) ++#define UAC_DT_AC_HEADER_LENGTH UAC_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES) + /* B.3.2 Class-Specific AC Interface Descriptor */ +-static struct usb_ac_header_descriptor_2 ac_header_desc = { +- .bLength = USB_DT_AC_HEADER_LENGH, ++static struct uac_ac_header_descriptor_2 ac_header_desc = { ++ .bLength = UAC_DT_AC_HEADER_LENGTH, + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = HEADER, ++ .bDescriptorSubtype = UAC_HEADER, + .bcdADC = __constant_cpu_to_le16(0x0100), +- .wTotalLength = __constant_cpu_to_le16(USB_DT_AC_HEADER_LENGH), ++ .wTotalLength = __constant_cpu_to_le16(UAC_DT_AC_HEADER_LENGTH), + .bInCollection = F_AUDIO_NUM_INTERFACES, + .baInterfaceNr = { + [0] = F_AUDIO_AC_INTERFACE, +@@ -68,33 +68,33 @@ static struct usb_ac_header_descriptor_2 + }; + + #define INPUT_TERMINAL_ID 1 +-static struct usb_input_terminal_descriptor input_terminal_desc = { +- .bLength = USB_DT_AC_INPUT_TERMINAL_SIZE, ++static struct uac_input_terminal_descriptor input_terminal_desc = { ++ .bLength = UAC_DT_INPUT_TERMINAL_SIZE, + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = INPUT_TERMINAL, ++ .bDescriptorSubtype = UAC_INPUT_TERMINAL, + .bTerminalID = INPUT_TERMINAL_ID, +- .wTerminalType = USB_AC_TERMINAL_STREAMING, ++ .wTerminalType = UAC_TERMINAL_STREAMING, + .bAssocTerminal = 0, + .wChannelConfig = 0x3, + }; + +-DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(0); ++DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(0); + + #define FEATURE_UNIT_ID 2 +-static struct usb_ac_feature_unit_descriptor_0 feature_unit_desc = { +- .bLength = USB_DT_AC_FEATURE_UNIT_SIZE(0), ++static struct uac_feature_unit_descriptor_0 feature_unit_desc = { ++ .bLength = UAC_DT_FEATURE_UNIT_SIZE(0), + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = FEATURE_UNIT, ++ .bDescriptorSubtype = UAC_FEATURE_UNIT, + .bUnitID = FEATURE_UNIT_ID, + .bSourceID = INPUT_TERMINAL_ID, + .bControlSize = 2, +- .bmaControls[0] = (FU_MUTE | FU_VOLUME), ++ .bmaControls[0] = (UAC_FU_MUTE | UAC_FU_VOLUME), + }; + + static struct usb_audio_control mute_control = { + .list = LIST_HEAD_INIT(mute_control.list), + .name = "Mute Control", +- .type = MUTE_CONTROL, ++ .type = UAC_MUTE_CONTROL, + /* Todo: add real Mute control code */ + .set = generic_set_cmd, + .get = generic_get_cmd, +@@ -103,7 +103,7 @@ static struct usb_audio_control mute_con + static struct usb_audio_control volume_control = { + .list = LIST_HEAD_INIT(volume_control.list), + .name = "Volume Control", +- .type = VOLUME_CONTROL, ++ .type = UAC_VOLUME_CONTROL, + /* Todo: add real Volume control code */ + .set = generic_set_cmd, + .get = generic_get_cmd, +@@ -113,17 +113,17 @@ static struct usb_audio_control_selector + .list = LIST_HEAD_INIT(feature_unit.list), + .id = FEATURE_UNIT_ID, + .name = "Mute & Volume Control", +- .type = FEATURE_UNIT, ++ .type = UAC_FEATURE_UNIT, + .desc = (struct usb_descriptor_header *)&feature_unit_desc, + }; + + #define OUTPUT_TERMINAL_ID 3 +-static struct usb_output_terminal_descriptor output_terminal_desc = { +- .bLength = USB_DT_AC_OUTPUT_TERMINAL_SIZE, ++static struct uac_output_terminal_descriptor output_terminal_desc = { ++ .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = OUTPUT_TERMINAL, ++ .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, + .bTerminalID = OUTPUT_TERMINAL_ID, +- .wTerminalType = USB_AC_OUTPUT_TERMINAL_SPEAKER, ++ .wTerminalType = UAC_OUTPUT_TERMINAL_SPEAKER, + .bAssocTerminal = FEATURE_UNIT_ID, + .bSourceID = FEATURE_UNIT_ID, + }; +@@ -148,22 +148,22 @@ static struct usb_interface_descriptor a + }; + + /* B.4.2 Class-Specific AS Interface Descriptor */ +-static struct usb_as_header_descriptor as_header_desc = { +- .bLength = USB_DT_AS_HEADER_SIZE, ++static struct uac_as_header_descriptor as_header_desc = { ++ .bLength = UAC_DT_AS_HEADER_SIZE, + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = AS_GENERAL, ++ .bDescriptorSubtype = UAC_AS_GENERAL, + .bTerminalLink = INPUT_TERMINAL_ID, + .bDelay = 1, +- .wFormatTag = USB_AS_AUDIO_FORMAT_TYPE_I_PCM, ++ .wFormatTag = UAC_FORMAT_TYPE_I_PCM, + }; + +-DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(1); ++DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(1); + +-static struct usb_as_formate_type_i_discrete_descriptor_1 as_type_i_desc = { +- .bLength = USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1), ++static struct uac_format_type_i_discrete_descriptor_1 as_type_i_desc = { ++ .bLength = UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1), + .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubtype = FORMAT_TYPE, +- .bFormatType = USB_AS_FORMAT_TYPE_I, ++ .bDescriptorSubtype = UAC_FORMAT_TYPE, ++ .bFormatType = UAC_FORMAT_TYPE_I, + .bSubframeSize = 2, + .bBitResolution = 16, + .bSamFreqType = 1, +@@ -181,10 +181,10 @@ static struct usb_endpoint_descriptor as + }; + + /* Class-specific AS ISO OUT Endpoint Descriptor */ +-static struct usb_as_iso_endpoint_descriptor as_iso_out_desc __initdata = { +- .bLength = USB_AS_ISO_ENDPOINT_DESC_SIZE, ++static struct uac_iso_endpoint_descriptor as_iso_out_desc __initdata = { ++ .bLength = UAC_ISO_ENDPOINT_DESC_SIZE, + .bDescriptorType = USB_DT_CS_ENDPOINT, +- .bDescriptorSubtype = EP_GENERAL, ++ .bDescriptorSubtype = UAC_EP_GENERAL, + .bmAttributes = 1, + .bLockDelayUnits = 1, + .wLockDelay = __constant_cpu_to_le16(1), +@@ -456,11 +456,11 @@ f_audio_setup(struct usb_function *f, co + * Audio class messages; interface activation uses set_alt(). + */ + switch (ctrl->bRequestType) { +- case USB_AUDIO_SET_INTF: ++ case USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE: + value = audio_set_intf_req(f, ctrl); + break; + +- case USB_AUDIO_GET_INTF: ++ case USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE: + value = audio_get_intf_req(f, ctrl); + break; + +@@ -642,10 +642,10 @@ int __init control_selector_init(struct + list_add(&mute_control.list, &feature_unit.control); + list_add(&volume_control.list, &feature_unit.control); + +- volume_control.data[_CUR] = 0xffc0; +- volume_control.data[_MIN] = 0xe3a0; +- volume_control.data[_MAX] = 0xfff0; +- volume_control.data[_RES] = 0x0030; ++ volume_control.data[UAC__CUR] = 0xffc0; ++ volume_control.data[UAC__MIN] = 0xe3a0; ++ volume_control.data[UAC__MAX] = 0xfff0; ++ volume_control.data[UAC__RES] = 0x0030; + + return 0; + } +--- a/drivers/usb/gadget/gmidi.c ++++ b/drivers/usb/gadget/gmidi.c +@@ -191,7 +191,7 @@ module_param(qlen, uint, S_IRUGO); + #define GMIDI_MS_INTERFACE 1 + #define GMIDI_NUM_INTERFACES 2 + +-DECLARE_USB_AC_HEADER_DESCRIPTOR(1); ++DECLARE_UAC_AC_HEADER_DESCRIPTOR(1); + DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(1); + DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(1); + +@@ -237,12 +237,12 @@ static const struct usb_interface_descri + }; + + /* B.3.2 Class-Specific AC Interface Descriptor */ +-static const struct usb_ac_header_descriptor_1 ac_header_desc = { +- .bLength = USB_DT_AC_HEADER_SIZE(1), ++static const struct uac_ac_header_descriptor_1 ac_header_desc = { ++ .bLength = UAC_DT_AC_HEADER_SIZE(1), + .bDescriptorType = USB_DT_CS_INTERFACE, + .bDescriptorSubtype = USB_MS_HEADER, + .bcdADC = cpu_to_le16(0x0100), +- .wTotalLength = cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)), ++ .wTotalLength = cpu_to_le16(UAC_DT_AC_HEADER_SIZE(1)), + .bInCollection = 1, + .baInterfaceNr = { + [0] = GMIDI_MS_INTERFACE, +--- a/include/linux/usb/audio.h ++++ b/include/linux/usb/audio.h +@@ -25,80 +25,77 @@ + #define USB_SUBCLASS_AUDIOSTREAMING 0x02 + #define USB_SUBCLASS_MIDISTREAMING 0x03 + +-/* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ +-#define HEADER 0x01 +-#define INPUT_TERMINAL 0x02 +-#define OUTPUT_TERMINAL 0x03 +-#define MIXER_UNIT 0x04 +-#define SELECTOR_UNIT 0x05 +-#define FEATURE_UNIT 0x06 +-#define PROCESSING_UNIT 0x07 +-#define EXTENSION_UNIT 0x08 +- +-#define AS_GENERAL 0x01 +-#define FORMAT_TYPE 0x02 +-#define FORMAT_SPECIFIC 0x03 +- +-#define EP_GENERAL 0x01 +- +-#define MS_GENERAL 0x01 +-#define MIDI_IN_JACK 0x02 +-#define MIDI_OUT_JACK 0x03 +- +-/* cs endpoint attributes */ +-#define EP_CS_ATTR_SAMPLE_RATE 0x01 +-#define EP_CS_ATTR_PITCH_CONTROL 0x02 +-#define EP_CS_ATTR_FILL_MAX 0x80 +- +-/* Audio Class specific Request Codes */ +-#define USB_AUDIO_SET_INTF 0x21 +-#define USB_AUDIO_SET_ENDPOINT 0x22 +-#define USB_AUDIO_GET_INTF 0xa1 +-#define USB_AUDIO_GET_ENDPOINT 0xa2 +- +-#define SET_ 0x00 +-#define GET_ 0x80 +- +-#define _CUR 0x1 +-#define _MIN 0x2 +-#define _MAX 0x3 +-#define _RES 0x4 +-#define _MEM 0x5 +- +-#define SET_CUR (SET_ | _CUR) +-#define GET_CUR (GET_ | _CUR) +-#define SET_MIN (SET_ | _MIN) +-#define GET_MIN (GET_ | _MIN) +-#define SET_MAX (SET_ | _MAX) +-#define GET_MAX (GET_ | _MAX) +-#define SET_RES (SET_ | _RES) +-#define GET_RES (GET_ | _RES) +-#define SET_MEM (SET_ | _MEM) +-#define GET_MEM (GET_ | _MEM) +- +-#define GET_STAT 0xff +- +-#define USB_AC_TERMINAL_UNDEFINED 0x100 +-#define USB_AC_TERMINAL_STREAMING 0x101 +-#define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF ++/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ ++#define UAC_HEADER 0x01 ++#define UAC_INPUT_TERMINAL 0x02 ++#define UAC_OUTPUT_TERMINAL 0x03 ++#define UAC_MIXER_UNIT 0x04 ++#define UAC_SELECTOR_UNIT 0x05 ++#define UAC_FEATURE_UNIT 0x06 ++#define UAC_PROCESSING_UNIT 0x07 ++#define UAC_EXTENSION_UNIT 0x08 ++ ++/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ ++#define UAC_AS_GENERAL 0x01 ++#define UAC_FORMAT_TYPE 0x02 ++#define UAC_FORMAT_SPECIFIC 0x03 ++ ++/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ ++#define UAC_EP_GENERAL 0x01 ++ ++/* A.9 Audio Class-Specific Request Codes */ ++#define UAC_SET_ 0x00 ++#define UAC_GET_ 0x80 ++ ++#define UAC__CUR 0x1 ++#define UAC__MIN 0x2 ++#define UAC__MAX 0x3 ++#define UAC__RES 0x4 ++#define UAC__MEM 0x5 ++ ++#define UAC_SET_CUR (UAC_SET_ | UAC__CUR) ++#define UAC_GET_CUR (UAC_GET_ | UAC__CUR) ++#define UAC_SET_MIN (UAC_SET_ | UAC__MIN) ++#define UAC_GET_MIN (UAC_GET_ | UAC__MIN) ++#define UAC_SET_MAX (UAC_SET_ | UAC__MAX) ++#define UAC_GET_MAX (UAC_GET_ | UAC__MAX) ++#define UAC_SET_RES (UAC_SET_ | UAC__RES) ++#define UAC_GET_RES (UAC_GET_ | UAC__RES) ++#define UAC_SET_MEM (UAC_SET_ | UAC__MEM) ++#define UAC_GET_MEM (UAC_GET_ | UAC__MEM) ++ ++#define UAC_GET_STAT 0xff ++ ++/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ ++#define UAC_MS_HEADER 0x01 ++#define UAC_MIDI_IN_JACK 0x02 ++#define UAC_MIDI_OUT_JACK 0x03 ++ ++/* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ ++#define UAC_MS_GENERAL 0x01 ++ ++/* Terminals - 2.1 USB Terminal Types */ ++#define UAC_TERMINAL_UNDEFINED 0x100 ++#define UAC_TERMINAL_STREAMING 0x101 ++#define UAC_TERMINAL_VENDOR_SPEC 0x1FF + + /* Terminal Control Selectors */ + /* 4.3.2 Class-Specific AC Interface Descriptor */ +-struct usb_ac_header_descriptor { ++struct uac_ac_header_descriptor { + __u8 bLength; /* 8 + n */ + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ +- __u8 bDescriptorSubtype; /* USB_MS_HEADER */ ++ __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ + __le16 bcdADC; /* 0x0100 */ + __le16 wTotalLength; /* includes Unit and Terminal desc. */ + __u8 bInCollection; /* n */ + __u8 baInterfaceNr[]; /* [n] */ + } __attribute__ ((packed)); + +-#define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) ++#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) + + /* As above, but more useful for defining your own descriptors: */ +-#define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ +-struct usb_ac_header_descriptor_##n { \ ++#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ ++struct uac_ac_header_descriptor_##n { \ + __u8 bLength; \ + __u8 bDescriptorType; \ + __u8 bDescriptorSubtype; \ +@@ -109,7 +106,7 @@ struct usb_ac_header_descriptor_##n { + } __attribute__ ((packed)) + + /* 4.3.2.1 Input Terminal Descriptor */ +-struct usb_input_terminal_descriptor { ++struct uac_input_terminal_descriptor { + __u8 bLength; /* in bytes: 12 */ + __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ + __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ +@@ -122,18 +119,19 @@ struct usb_input_terminal_descriptor { + __u8 iTerminal; + } __attribute__ ((packed)); + +-#define USB_DT_AC_INPUT_TERMINAL_SIZE 12 ++#define UAC_DT_INPUT_TERMINAL_SIZE 12 + +-#define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 +-#define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 +-#define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 +-#define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 +-#define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 +-#define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 +-#define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 ++/* Terminals - 2.2 Input Terminal Types */ ++#define UAC_INPUT_TERMINAL_UNDEFINED 0x200 ++#define UAC_INPUT_TERMINAL_MICROPHONE 0x201 ++#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 ++#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 ++#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 ++#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 ++#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 + + /* 4.3.2.2 Output Terminal Descriptor */ +-struct usb_output_terminal_descriptor { ++struct uac_output_terminal_descriptor { + __u8 bLength; /* in bytes: 9 */ + __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ + __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ +@@ -144,23 +142,24 @@ struct usb_output_terminal_descriptor { + __u8 iTerminal; + } __attribute__ ((packed)); + +-#define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 ++#define UAC_DT_OUTPUT_TERMINAL_SIZE 9 + +-#define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 +-#define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 +-#define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 +-#define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 +-#define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 +-#define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 +-#define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 +-#define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 ++/* Terminals - 2.3 Output Terminal Types */ ++#define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 ++#define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 ++#define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 ++#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 ++#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 ++#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 ++#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 ++#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 + + /* Set bControlSize = 2 as default setting */ +-#define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) ++#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) + + /* As above, but more useful for defining your own descriptors: */ +-#define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ +-struct usb_ac_feature_unit_descriptor_##ch { \ ++#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ ++struct uac_feature_unit_descriptor_##ch { \ + __u8 bLength; \ + __u8 bDescriptorType; \ + __u8 bDescriptorSubtype; \ +@@ -172,7 +171,7 @@ struct usb_ac_feature_unit_descriptor_## + } __attribute__ ((packed)) + + /* 4.5.2 Class-Specific AS Interface Descriptor */ +-struct usb_as_header_descriptor { ++struct uac_as_header_descriptor { + __u8 bLength; /* in bytes: 7 */ + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ + __u8 bDescriptorSubtype; /* AS_GENERAL */ +@@ -181,16 +180,17 @@ struct usb_as_header_descriptor { + __le16 wFormatTag; /* The Audio Data Format */ + } __attribute__ ((packed)); + +-#define USB_DT_AS_HEADER_SIZE 7 ++#define UAC_DT_AS_HEADER_SIZE 7 + +-#define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 +-#define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 +-#define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 +-#define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 +-#define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 +-#define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 ++/* Formats - A.1.1 Audio Data Format Type I Codes */ ++#define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 ++#define UAC_FORMAT_TYPE_I_PCM 0x1 ++#define UAC_FORMAT_TYPE_I_PCM8 0x2 ++#define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 ++#define UAC_FORMAT_TYPE_I_ALAW 0x4 ++#define UAC_FORMAT_TYPE_I_MULAW 0x5 + +-struct usb_as_format_type_i_continuous_descriptor { ++struct uac_format_type_i_continuous_descriptor { + __u8 bLength; /* in bytes: 8 + (ns * 3) */ + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ + __u8 bDescriptorSubtype; /* FORMAT_TYPE */ +@@ -203,9 +203,9 @@ struct usb_as_format_type_i_continuous_d + __u8 tUpperSamFreq[3]; + } __attribute__ ((packed)); + +-#define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 ++#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 + +-struct usb_as_formate_type_i_discrete_descriptor { ++struct uac_format_type_i_discrete_descriptor { + __u8 bLength; /* in bytes: 8 + (ns * 3) */ + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ + __u8 bDescriptorSubtype; /* FORMAT_TYPE */ +@@ -217,8 +217,8 @@ struct usb_as_formate_type_i_discrete_de + __u8 tSamFreq[][3]; + } __attribute__ ((packed)); + +-#define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ +-struct usb_as_formate_type_i_discrete_descriptor_##n { \ ++#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ ++struct uac_format_type_i_discrete_descriptor_##n { \ + __u8 bLength; \ + __u8 bDescriptorType; \ + __u8 bDescriptorSubtype; \ +@@ -230,14 +230,15 @@ struct usb_as_formate_type_i_discrete_de + __u8 tSamFreq[n][3]; \ + } __attribute__ ((packed)) + +-#define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) ++#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) + +-#define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 +-#define USB_AS_FORMAT_TYPE_I 0x1 +-#define USB_AS_FORMAT_TYPE_II 0x2 +-#define USB_AS_FORMAT_TYPE_III 0x3 ++/* Formats - A.2 Format Type Codes */ ++#define UAC_FORMAT_TYPE_UNDEFINED 0x0 ++#define UAC_FORMAT_TYPE_I 0x1 ++#define UAC_FORMAT_TYPE_II 0x2 ++#define UAC_FORMAT_TYPE_III 0x3 + +-struct usb_as_iso_endpoint_descriptor { ++struct uac_iso_endpoint_descriptor { + __u8 bLength; /* in bytes: 7 */ + __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ + __u8 bDescriptorSubtype; /* EP_GENERAL */ +@@ -245,30 +246,35 @@ struct usb_as_iso_endpoint_descriptor { + __u8 bLockDelayUnits; + __le16 wLockDelay; + }; +-#define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 ++#define UAC_ISO_ENDPOINT_DESC_SIZE 7 + +-#define FU_CONTROL_UNDEFINED 0x00 +-#define MUTE_CONTROL 0x01 +-#define VOLUME_CONTROL 0x02 +-#define BASS_CONTROL 0x03 +-#define MID_CONTROL 0x04 +-#define TREBLE_CONTROL 0x05 +-#define GRAPHIC_EQUALIZER_CONTROL 0x06 +-#define AUTOMATIC_GAIN_CONTROL 0x07 +-#define DELAY_CONTROL 0x08 +-#define BASS_BOOST_CONTROL 0x09 +-#define LOUDNESS_CONTROL 0x0a +- +-#define FU_MUTE (1 << (MUTE_CONTROL - 1)) +-#define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) +-#define FU_BASS (1 << (BASS_CONTROL - 1)) +-#define FU_MID (1 << (MID_CONTROL - 1)) +-#define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) +-#define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) +-#define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) +-#define FU_DELAY (1 << (DELAY_CONTROL - 1)) +-#define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) +-#define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) ++#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 ++#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 ++#define UAC_EP_CS_ATTR_FILL_MAX 0x80 ++ ++/* A.10.2 Feature Unit Control Selectors */ ++#define UAC_FU_CONTROL_UNDEFINED 0x00 ++#define UAC_MUTE_CONTROL 0x01 ++#define UAC_VOLUME_CONTROL 0x02 ++#define UAC_BASS_CONTROL 0x03 ++#define UAC_MID_CONTROL 0x04 ++#define UAC_TREBLE_CONTROL 0x05 ++#define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06 ++#define UAC_AUTOMATIC_GAIN_CONTROL 0x07 ++#define UAC_DELAY_CONTROL 0x08 ++#define UAC_BASS_BOOST_CONTROL 0x09 ++#define UAC_LOUDNESS_CONTROL 0x0a ++ ++#define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1)) ++#define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1)) ++#define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1)) ++#define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1)) ++#define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1)) ++#define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1)) ++#define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1)) ++#define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1)) ++#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) ++#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) + + struct usb_audio_control { + struct list_head list; diff --git a/usb/usb-audio-gadget-un-inline-generic_et_cmd.patch b/usb/usb-audio-gadget-un-inline-generic_et_cmd.patch new file mode 100644 index 00000000000000..486335ac9965a9 --- /dev/null +++ b/usb/usb-audio-gadget-un-inline-generic_et_cmd.patch @@ -0,0 +1,72 @@ +From laurent.pinchart@skynet.be Thu Jul 2 15:12:15 2009 +From: Laurent Pinchart <laurent.pinchart@skynet.be> +Date: Sun, 21 Jun 2009 23:21:55 +0200 +Subject: USB audio gadget: Un-inline generic_[gs]et_cmd +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Bryan Wu <cooloney@kernel.org>, Mike Frysinger <vapier@gentoo.org> +Message-ID: <200906212321.56079.laurent.pinchart@skynet.be> +Content-Disposition: inline + + +Those functions are used only used to fill the set/get members of +usb_audio_control. It doesn't make much sense to inline them. + +Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/usb/gadget/f_audio.c | 15 +++++++++++++++ + include/linux/usb/audio.h | 12 ------------ + 2 files changed, 15 insertions(+), 12 deletions(-) + +--- a/drivers/usb/gadget/f_audio.c ++++ b/drivers/usb/gadget/f_audio.c +@@ -28,6 +28,9 @@ static int audio_buf_size = 48000; + module_param(audio_buf_size, int, S_IRUGO); + MODULE_PARM_DESC(audio_buf_size, "Audio buffer size"); + ++static int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value); ++static int generic_get_cmd(struct usb_audio_control *con, u8 cmd); ++ + /* + * DESCRIPTORS ... most are static, but strings and full + * configuration descriptors are built on demand. +@@ -632,6 +635,18 @@ f_audio_unbind(struct usb_configuration + + /*-------------------------------------------------------------------------*/ + ++static int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) ++{ ++ con->data[cmd] = value; ++ ++ return 0; ++} ++ ++static int generic_get_cmd(struct usb_audio_control *con, u8 cmd) ++{ ++ return con->data[cmd]; ++} ++ + /* Todo: add more control selecotor dynamically */ + int __init control_selector_init(struct f_audio *audio) + { +--- a/include/linux/usb/audio.h ++++ b/include/linux/usb/audio.h +@@ -285,18 +285,6 @@ struct usb_audio_control { + int (*get)(struct usb_audio_control *con, u8 cmd); + }; + +-static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) +-{ +- con->data[cmd] = value; +- +- return 0; +-} +- +-static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) +-{ +- return con->data[cmd]; +-} +- + struct usb_audio_control_selector { + struct list_head list; + struct list_head control; diff --git a/usb/usb-move-vendor-subclass-definition-from-usb-audio.h-to-usb-ch9.h.patch b/usb/usb-move-vendor-subclass-definition-from-usb-audio.h-to-usb-ch9.h.patch new file mode 100644 index 00000000000000..4af8bb5e87b96d --- /dev/null +++ b/usb/usb-move-vendor-subclass-definition-from-usb-audio.h-to-usb-ch9.h.patch @@ -0,0 +1,41 @@ +From laurent.pinchart@skynet.be Thu Jul 2 15:11:45 2009 +From: Laurent Pinchart <laurent.pinchart@skynet.be> +Date: Sun, 21 Jun 2009 23:20:39 +0200 +Subject: USB: Move vendor subclass definition from usb/audio.h to usb/ch9.h +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Bryan Wu <cooloney@kernel.org>, Mike Frysinger <vapier@gentoo.org> +Message-ID: <200906212320.39936.laurent.pinchart@skynet.be> +Content-Disposition: inline + + +USB_SUBCLASS_VENDOR_SPEC is common to several USB classes and as such belongs +to usb/ch9.h. + +Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + include/linux/usb/audio.h | 1 - + include/linux/usb/ch9.h | 2 ++ + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/include/linux/usb/audio.h ++++ b/include/linux/usb/audio.h +@@ -24,7 +24,6 @@ + #define USB_SUBCLASS_AUDIOCONTROL 0x01 + #define USB_SUBCLASS_AUDIOSTREAMING 0x02 + #define USB_SUBCLASS_MIDISTREAMING 0x03 +-#define USB_SUBCLASS_VENDOR_SPEC 0xff + + /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ + #define HEADER 0x01 +--- a/include/linux/usb/ch9.h ++++ b/include/linux/usb/ch9.h +@@ -258,6 +258,8 @@ struct usb_device_descriptor { + #define USB_CLASS_APP_SPEC 0xfe + #define USB_CLASS_VENDOR_SPEC 0xff + ++#define USB_SUBCLASS_VENDOR_SPEC 0xff ++ + /*-------------------------------------------------------------------------*/ + + /* USB_DT_CONFIG: Configuration descriptor information. diff --git a/usb/usb-usbmon-end-ugly-tricks-with-dma-peeking.patch b/usb/usb-usbmon-end-ugly-tricks-with-dma-peeking.patch index ac9105d6514a83..cd66838262de74 100644 --- a/usb/usb-usbmon-end-ugly-tricks-with-dma-peeking.patch +++ b/usb/usb-usbmon-end-ugly-tricks-with-dma-peeking.patch @@ -271,7 +271,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> * kmalloc() or equivalent. For transfers to "in" endpoints, contents * of this buffer will be modified. This buffer is used for the data * stage of control transfers. -@@ -1102,9 +1103,15 @@ typedef void (*usb_complete_t)(struct ur +@@ -1104,9 +1105,15 @@ typedef void (*usb_complete_t)(struct ur * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). * When these transfer flags are provided, host controller drivers will * attempt to use the dma addresses found in the transfer_dma and/or |
