diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 14:14:43 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 14:14:43 -0700 |
| commit | a11a585b76abca29967679c5390999cd25486fb6 (patch) | |
| tree | 063de60e0df13385624a7f252c5cdcf707b6d308 /usb.current | |
| parent | 06d408d7f2da2afd8e6c08f5aef681b3179bc822 (diff) | |
| download | patches-a11a585b76abca29967679c5390999cd25486fb6.tar.gz | |
more patches
Diffstat (limited to 'usb.current')
9 files changed, 460 insertions, 0 deletions
diff --git a/usb.current/usb-cdc-acm-add-another-device-quirk.patch b/usb.current/usb-cdc-acm-add-another-device-quirk.patch new file mode 100644 index 00000000000000..0cb12226e16270 --- /dev/null +++ b/usb.current/usb-cdc-acm-add-another-device-quirk.patch @@ -0,0 +1,28 @@ +From nelson@crynwr.com Mon Apr 26 13:58:57 2010 +From: Russ Nelson <nelson@crynwr.com> +Date: Wed, 21 Apr 2010 23:07:03 -0400 +Subject: USB: cdc-acm: add another device quirk +To: Greg KH <greg@kroah.com> +Message-ID: <19407.48471.369227.783932@desk.crynwr.com> + +The Maretron USB100 needs this quirk in order to work properly. + +Signed-off-by: Russ Nelson <nelson@crynwr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1542,6 +1542,9 @@ static const struct usb_device_id acm_id + { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ + .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ + }, ++ { USB_DEVICE(0x1576, 0x03b1), /* Maretron USB100 */ ++ .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ ++ }, + + /* Nokia S60 phones expose two ACM channels. The first is + * a modem and is picked up by the standard AT-command diff --git a/usb.current/usb-don-t-choose-configs-with-no-interfaces.patch b/usb.current/usb-don-t-choose-configs-with-no-interfaces.patch new file mode 100644 index 00000000000000..e0c4954e2a3d62 --- /dev/null +++ b/usb.current/usb-don-t-choose-configs-with-no-interfaces.patch @@ -0,0 +1,36 @@ +From stern@rowland.harvard.edu Mon Apr 26 14:00:33 2010 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Tue, 20 Apr 2010 10:40:59 -0400 (EDT) +Subject: USB: don't choose configs with no interfaces +To: Greg KH <greg@kroah.com> +Cc: Andrew Victor <avictor.za@gmail.com> +Message-ID: <Pine.LNX.4.44L0.1004201037590.1837-100000@iolanthe.rowland.org> + + +This patch (as1372) fixes a bug in the routine that chooses the +default configuration to install when a new USB device is detected. +The algorithm is supposed to look for a config whose first interface +is for a non-vendor-specific class. But the way it's currently +written, it will also accept a config with no interfaces at all, which +is not very useful. (Believe it or not, such things do exist.) + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Tested-by: Andrew Victor <avictor.za@gmail.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/core/generic.c ++++ b/drivers/usb/core/generic.c +@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_ + * than a vendor-specific driver. */ + else if (udev->descriptor.bDeviceClass != + USB_CLASS_VENDOR_SPEC && +- (!desc || desc->bInterfaceClass != ++ (desc && desc->bInterfaceClass != + USB_CLASS_VENDOR_SPEC)) { + best = c; + break; diff --git a/usb.current/usb-fix-testing-the-wrong-variable-in-fs_create_by_name.patch b/usb.current/usb-fix-testing-the-wrong-variable-in-fs_create_by_name.patch new file mode 100644 index 00000000000000..85cc54bdaf19b8 --- /dev/null +++ b/usb.current/usb-fix-testing-the-wrong-variable-in-fs_create_by_name.patch @@ -0,0 +1,40 @@ +From error27@gmail.com Mon Apr 26 13:58:24 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Thu, 22 Apr 2010 12:00:52 +0200 +Subject: USB: fix testing the wrong variable in fs_create_by_name() +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: Alessio Igor Bogani <abogani@texware.it>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org +Message-ID: <20100422100052.GT29647@bicker> +Content-Disposition: inline + + +There is a typo here. We should be testing "*dentry" which was just +assigned instead of "dentry". This could result in dereferencing an +ERR_PTR inside either usbfs_mkdir() or usbfs_create(). + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/inode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/core/inode.c ++++ b/drivers/usb/core/inode.c +@@ -515,13 +515,13 @@ static int fs_create_by_name (const char + *dentry = NULL; + mutex_lock(&parent->d_inode->i_mutex); + *dentry = lookup_one_len(name, parent, strlen(name)); +- if (!IS_ERR(dentry)) { ++ if (!IS_ERR(*dentry)) { + if ((mode & S_IFMT) == S_IFDIR) + error = usbfs_mkdir (parent->d_inode, *dentry, mode); + else + error = usbfs_create (parent->d_inode, *dentry, mode); + } else +- error = PTR_ERR(dentry); ++ error = PTR_ERR(*dentry); + mutex_unlock(&parent->d_inode->i_mutex); + + return error; diff --git a/usb.current/usb-ohci-don-t-look-at-the-root-hub-to-get-the-number-of-ports.patch b/usb.current/usb-ohci-don-t-look-at-the-root-hub-to-get-the-number-of-ports.patch new file mode 100644 index 00000000000000..0af05e3523d070 --- /dev/null +++ b/usb.current/usb-ohci-don-t-look-at-the-root-hub-to-get-the-number-of-ports.patch @@ -0,0 +1,33 @@ +From stern@rowland.harvard.edu Mon Apr 26 14:02:12 2010 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Tue, 20 Apr 2010 10:37:57 -0400 (EDT) +Subject: USB: OHCI: don't look at the root hub to get the number of ports +To: Greg KH <greg@kroah.com> +Message-ID: <Pine.LNX.4.44L0.1004201036020.1837-100000@iolanthe.rowland.org> + + +This patch (as1371) fixes a small bug in ohci-hcd. The HCD already +knows how many ports the controller has; there's no need to go looking +at the root hub's usb_device structure to find out. Especially since +the root hub's maxchild value is set correctly only while the root hub +is bound to the hub driver. + +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/ohci-hub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/ohci-hub.c ++++ b/drivers/usb/host/ohci-hub.c +@@ -697,7 +697,7 @@ static int ohci_hub_control ( + u16 wLength + ) { + struct ohci_hcd *ohci = hcd_to_ohci (hcd); +- int ports = hcd_to_bus (hcd)->root_hub->maxchild; ++ int ports = ohci->num_ports; + u32 temp; + int retval = 0; + diff --git a/usb.current/usb-option-add-id-for-zte-mf-330.patch b/usb.current/usb-option-add-id-for-zte-mf-330.patch new file mode 100644 index 00000000000000..8e47ade94a0286 --- /dev/null +++ b/usb.current/usb-option-add-id-for-zte-mf-330.patch @@ -0,0 +1,40 @@ +From linux@dominikbrodowski.net Mon Apr 26 14:04:36 2010 +From: Dominik Brodowski <linux@dominikbrodowski.net> +Date: Wed, 14 Apr 2010 21:36:42 +0200 +Subject: USB: option: add ID for ZTE MF 330 +To: Paweł Drobek <pawel.drobek@gmail.com>, Matthias Urlichs <smurf@smurf.noris.de>, Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20100414193642.GL30734@comet.dominikbrodowski.net> + + +Based on the information provided for by Paweł Drobek, add +a second vendor ID and the correct product ID for ZTE MF 330. + +Reported-by: Paweł Drobek <pawel.drobek@gmail.com> +Signed-off: Dominik Brodowski <linux@dominikbrodowski.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/option.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -306,6 +306,10 @@ static int option_resume(struct usb_ser + #define ZTE_PRODUCT_AC8710 0xfff1 + #define ZTE_PRODUCT_AC2726 0xfff5 + ++/* ZTE PRODUCTS -- alternate vendor ID */ ++#define ZTE_VENDOR_ID2 0x1d6b ++#define ZTE_PRODUCT_MF_330 0x0002 ++ + #define BENQ_VENDOR_ID 0x04a5 + #define BENQ_PRODUCT_H10 0x4068 + +@@ -679,6 +683,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, ++ { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, + { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, + { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, + { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ diff --git a/usb.current/usb-serial-option-zteac8710-support-with-device-id-0xffff.patch b/usb.current/usb-serial-option-zteac8710-support-with-device-id-0xffff.patch new file mode 100644 index 00000000000000..289c8f5d9c5a0e --- /dev/null +++ b/usb.current/usb-serial-option-zteac8710-support-with-device-id-0xffff.patch @@ -0,0 +1,34 @@ +From maheshkuruganti@gmail.com Mon Apr 26 14:08:10 2010 +From: Mahesh Kuruganti <maheshkuruganti@gmail.com> +Date: Mon, 12 Apr 2010 22:37:02 +0530 +Subject: USB: serial: option: ZTEAC8710 Support with Device ID 0xffff +To: Greg KH <greg@kroah.com> +Message-ID: <h2med984c71004121007s806428a9za0d724362f8cc83e@mail.gmail.com> + +PATCH TO EXTEND SUPPORT TO AC8710 WITH 0xFFFF Product ID. + +Signed-off-by: Mahesh Kuruganti <maheshkuruganti@gmail.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 +@@ -305,6 +305,7 @@ static int option_resume(struct usb_ser + #define ZTE_PRODUCT_CDMA_TECH 0xfffe + #define ZTE_PRODUCT_AC8710 0xfff1 + #define ZTE_PRODUCT_AC2726 0xfff5 ++#define ZTE_PRODUCT_AC8710T 0xffff + + /* ZTE PRODUCTS -- alternate vendor ID */ + #define ZTE_VENDOR_ID2 0x1d6b +@@ -683,6 +684,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, + { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, + { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, + { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, diff --git a/usb.current/usb-serial-pl2303-hybrid-reader-uniform-hcr331.patch b/usb.current/usb-serial-pl2303-hybrid-reader-uniform-hcr331.patch new file mode 100644 index 00000000000000..9e610ee3433337 --- /dev/null +++ b/usb.current/usb-serial-pl2303-hybrid-reader-uniform-hcr331.patch @@ -0,0 +1,43 @@ +From s.contini@oltrelinux.com Mon Apr 26 14:05:55 2010 +From: Simone Contini <s.contini@oltrelinux.com> +Date: Mon, 12 Apr 2010 23:25:10 +0200 +Subject: USB: serial: pl2303: Hybrid reader Uniform HCR331 +To: greg@kroah.com +Message-ID: <v2z6fad60871004121425kde1fb1fco8c005d55544bee8b@mail.gmail.com> + + +I tried a magnetic stripe reader +(http://www.kimaldi.com/kimaldi_eng/productos/lectores_de_tarjetas/lectores_tarjeta_chip_y_dni/lector_hibrido_uniform_hcr_331) +and I see that it is interfaced with a PL2303. I wrote a patch to use +your driver which simply adds the product ID for the device and it +seems working fine. + + +From: Simone Contini <s.contini@oltrelinux.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -59,6 +59,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, ++ { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -20,6 +20,7 @@ + #define PL2303_PRODUCT_ID_ALDIGA 0x0611 + #define PL2303_PRODUCT_ID_MMX 0x0612 + #define PL2303_PRODUCT_ID_GPRS 0x0609 ++#define PL2303_PRODUCT_ID_HCR331 0x331a + + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 diff --git a/usb.current/usb-xhci-properly-set-endpoint-context-fields-for-periodic-eps.patch b/usb.current/usb-xhci-properly-set-endpoint-context-fields-for-periodic-eps.patch new file mode 100644 index 00000000000000..d13fa353a397ff --- /dev/null +++ b/usb.current/usb-xhci-properly-set-endpoint-context-fields-for-periodic-eps.patch @@ -0,0 +1,145 @@ +From sarah.a.sharp@linux.intel.com Mon Apr 26 14:03:39 2010 +From: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Date: Fri, 16 Apr 2010 08:07:27 -0700 +Subject: USB: xhci: properly set endpoint context fields for periodic eps. +To: Greg KH <gregkh@suse.de> +Cc: <Libin.Yang@amd.com>, <Andiry.Xu@amd.com> +Message-ID: <20100416150727.GA5993@xanatos> +Content-Disposition: inline + + +For periodic endpoints, we must let the xHCI hardware know the maximum +payload an endpoint can transfer in one service interval. The xHCI +specification refers to this as the Maximum Endpoint Service Interval Time +Payload (Max ESIT Payload). This is used by the hardware for bandwidth +management and scheduling of packets. + +For SuperSpeed endpoints, the maximum is calculated by multiplying the max +packet size by the number of bursts and the number of opportunities to +transfer within a service interval (the Mult field of the SuperSpeed +Endpoint companion descriptor). Devices advertise this in the +wBytesPerInterval field of their SuperSpeed Endpoint Companion Descriptor. + +For high speed devices, this is taken by multiplying the max packet size by the +"number of additional transaction opportunities per microframe" (the high +bits of the wMaxPacketSize field in the endpoint descriptor). + +For FS/LS devices, this is just the max packet size. + +The other thing we must set in the endpoint context is the Average TRB +Length. This is supposed to be the average of the total bytes in the +transfer descriptor (TD), divided by the number of transfer request blocks +(TRBs) it takes to describe the TD. This gives the host controller an +indication of whether the driver will be enqueuing a scatter gather list +with many entries comprised of small buffers, or one contiguous buffer. + +It also takes into account the number of extra TRBs you need for every TD. +This includes No-op TRBs and Link TRBs used to link ring segments +together. Some drivers may choose to chain an Event Data TRB on the end +of every TD, thus increasing the average number of TRBs per TD. The Linux +xHCI driver does not use Event Data TRBs. + +In theory, if there was an API to allow drivers to state what their +bandwidth requirements are, we could set this field accurately. For now, +we set it to the same number as the Max ESIT payload. + +The Average TRB Length should also be set for bulk and control endpoints, +but I have no idea how to guess what it should be. + +Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/xhci-mem.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ + drivers/usb/host/xhci.h | 4 +++ + 2 files changed, 55 insertions(+) + +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -625,6 +625,36 @@ static inline u32 xhci_get_endpoint_type + return type; + } + ++/* Return the maximum endpoint service interval time (ESIT) payload. ++ * Basically, this is the maxpacket size, multiplied by the burst size ++ * and mult size. ++ */ ++static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, ++ struct usb_device *udev, ++ struct usb_host_endpoint *ep) ++{ ++ int max_burst; ++ int max_packet; ++ ++ /* Only applies for interrupt or isochronous endpoints */ ++ if (usb_endpoint_xfer_control(&ep->desc) || ++ usb_endpoint_xfer_bulk(&ep->desc)) ++ return 0; ++ ++ if (udev->speed == USB_SPEED_SUPER) { ++ if (ep->ss_ep_comp) ++ return ep->ss_ep_comp->desc.wBytesPerInterval; ++ xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); ++ /* Assume no bursts, no multiple opportunities to send. */ ++ return ep->desc.wMaxPacketSize; ++ } ++ ++ max_packet = ep->desc.wMaxPacketSize & 0x3ff; ++ max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; ++ /* A 0 in max burst means 1 transfer per ESIT */ ++ return max_packet * (max_burst + 1); ++} ++ + int xhci_endpoint_init(struct xhci_hcd *xhci, + struct xhci_virt_device *virt_dev, + struct usb_device *udev, +@@ -636,6 +666,7 @@ int xhci_endpoint_init(struct xhci_hcd * + struct xhci_ring *ep_ring; + unsigned int max_packet; + unsigned int max_burst; ++ u32 max_esit_payload; + + ep_index = xhci_get_endpoint_index(&ep->desc); + ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); +@@ -703,6 +734,26 @@ int xhci_endpoint_init(struct xhci_hcd * + default: + BUG(); + } ++ max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); ++ ep_ctx->tx_info = MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload); ++ ++ /* ++ * XXX no idea how to calculate the average TRB buffer length for bulk ++ * endpoints, as the driver gives us no clue how big each scatter gather ++ * list entry (or buffer) is going to be. ++ * ++ * For isochronous and interrupt endpoints, we set it to the max ++ * available, until we have new API in the USB core to allow drivers to ++ * declare how much bandwidth they actually need. ++ * ++ * Normally, it would be calculated by taking the total of the buffer ++ * lengths in the TD and then dividing by the number of TRBs in a TD, ++ * including link TRBs, No-op TRBs, and Event data TRBs. Since we don't ++ * use Event Data TRBs, and we don't chain in a link TRB on short ++ * transfers, we're basically dividing by 1. ++ */ ++ ep_ctx->tx_info |= AVG_TRB_LENGTH_FOR_EP(max_esit_payload); ++ + /* FIXME Debug endpoint context */ + return 0; + } +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -609,6 +609,10 @@ struct xhci_ep_ctx { + #define MAX_PACKET_MASK (0xffff << 16) + #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) + ++/* tx_info bitmasks */ ++#define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) ++#define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) ++ + + /** + * struct xhci_input_control_context diff --git a/usb.current/usb-xhci-properly-set-the-mult-field-of-the-endpoint-context.patch b/usb.current/usb-xhci-properly-set-the-mult-field-of-the-endpoint-context.patch new file mode 100644 index 00000000000000..88e95dede16d5e --- /dev/null +++ b/usb.current/usb-xhci-properly-set-the-mult-field-of-the-endpoint-context.patch @@ -0,0 +1,61 @@ +From sarah.a.sharp@linux.intel.com Mon Apr 26 14:02:36 2010 +From: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Date: Fri, 16 Apr 2010 08:07:04 -0700 +Subject: USB: xhci: properly set the "Mult" field of the endpoint context. +To: Greg KH <gregkh@suse.de> +Cc: <Libin.Yang@amd.com>, <Andiry.Xu@amd.com> +Message-ID: <20100416150704.GA5986@xanatos> +Content-Disposition: inline + + +A SuperSpeed interrupt or isochronous endpoint can define the number of +"burst transactions" it can handle in a service interval. This is +indicated by the "Mult" bits in the bmAttributes of the SuperSpeed +Endpoint Companion Descriptor. For example, if it has a max packet size +of 1024, a max burst of 11, and a mult of 3, the host may send 33 +1024-byte packets in one service interval. + +We must tell the xHCI host controller the number of multiple service +opportunities (mults) the device can handle when the endpoint is +installed. We do that by setting the Mult field of the Endpoint Context +before a configure endpoint command is sent down. The Mult field is +invalid for control or bulk SuperSpeed endpoints. + +Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/xhci-mem.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -582,6 +582,19 @@ static inline unsigned int xhci_get_endp + return EP_INTERVAL(interval); + } + ++/* The "Mult" field in the endpoint context is only set for SuperSpeed devices. ++ * High speed endpoint descriptors can define "the number of additional ++ * transaction opportunities per microframe", but that goes in the Max Burst ++ * endpoint context field. ++ */ ++static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, ++ struct usb_host_endpoint *ep) ++{ ++ if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp) ++ return 0; ++ return ep->ss_ep_comp->desc.bmAttributes; ++} ++ + static inline u32 xhci_get_endpoint_type(struct usb_device *udev, + struct usb_host_endpoint *ep) + { +@@ -644,6 +657,7 @@ int xhci_endpoint_init(struct xhci_hcd * + ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; + + ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); ++ ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep)); + + /* FIXME dig Mult and streams info out of ep companion desc */ + |
