aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-12-02 15:40:47 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-12-02 15:40:47 -0800
commit8cf54f6694c3d410561a69c38eb7aa67927b2fd6 (patch)
tree32735e7cbd0df8ed2f1dd0e2d91199bff51d4713 /usb
parent3fe941224b34a0a21f25a53ce43bc371aa1c2c99 (diff)
downloadpatches-8cf54f6694c3d410561a69c38eb7aa67927b2fd6.tar.gz
added usb patches
Diffstat (limited to 'usb')
-rw-r--r--usb/uhci-change-uhci_explen-macro.patch113
-rw-r--r--usb/usb-ati_remote-use-time_before-and-friends.patch63
-rw-r--r--usb/usb-pl2303_update_line_status-data-length-fix.patch30
-rw-r--r--usb/usb-storage-add-unusual_devs-entry-for-nikon-coolpix-2000.patch49
4 files changed, 255 insertions, 0 deletions
diff --git a/usb/uhci-change-uhci_explen-macro.patch b/usb/uhci-change-uhci_explen-macro.patch
new file mode 100644
index 0000000000000..d3312248bf86c
--- /dev/null
+++ b/usb/uhci-change-uhci_explen-macro.patch
@@ -0,0 +1,113 @@
+From stern@rowland.harvard.edu Wed Nov 30 09:00:34 2005
+Date: Wed, 30 Nov 2005 11:57:51 -0500 (EST)
+From: Alan Stern <stern@rowland.harvard.edu>
+To: Greg KH <greg@kroah.com>
+Subject: UHCI: change uhci_explen macro
+Message-ID: <Pine.LNX.4.44L0.0511301154430.4907-100000@iolanthe.rowland.org>
+
+This patch (as616) changed the uhci_explen macro in uhci-hcd.h so that
+it now accepts the desired length, rather than length - 1 with special
+handling for 0. This also fixes a minor bug that would show up only
+when a driver submits a 0-length bulk URB.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/uhci-hcd.c | 2 +-
+ drivers/usb/host/uhci-hcd.h | 8 ++++----
+ drivers/usb/host/uhci-q.c | 12 ++++++------
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/host/uhci-q.c
++++ gregkh-2.6/drivers/usb/host/uhci-q.c
+@@ -596,7 +596,7 @@ static int uhci_submit_control(struct uh
+ return -ENOMEM;
+
+ uhci_add_td_to_urb(urb, td);
+- uhci_fill_td(td, status, destination | uhci_explen(7),
++ uhci_fill_td(td, status, destination | uhci_explen(8),
+ urb->setup_dma);
+
+ /*
+@@ -628,7 +628,7 @@ static int uhci_submit_control(struct uh
+ destination ^= TD_TOKEN_TOGGLE;
+
+ uhci_add_td_to_urb(urb, td);
+- uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1),
++ uhci_fill_td(td, status, destination | uhci_explen(pktsze),
+ data);
+
+ data += pktsze;
+@@ -658,7 +658,7 @@ static int uhci_submit_control(struct uh
+
+ uhci_add_td_to_urb(urb, td);
+ uhci_fill_td(td, status | TD_CTRL_IOC,
+- destination | uhci_explen(UHCI_NULL_DATA_SIZE), 0);
++ destination | uhci_explen(0), 0);
+
+ qh = uhci_alloc_qh(uhci);
+ if (!qh)
+@@ -864,7 +864,7 @@ static int uhci_submit_common(struct uhc
+ return -ENOMEM;
+
+ uhci_add_td_to_urb(urb, td);
+- uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1) |
++ uhci_fill_td(td, status, destination | uhci_explen(pktsze) |
+ (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+ usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
+ data);
+@@ -890,7 +890,7 @@ static int uhci_submit_common(struct uhc
+ return -ENOMEM;
+
+ uhci_add_td_to_urb(urb, td);
+- uhci_fill_td(td, status, destination | uhci_explen(UHCI_NULL_DATA_SIZE) |
++ uhci_fill_td(td, status, destination | uhci_explen(0) |
+ (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+ usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
+ data);
+@@ -1092,7 +1092,7 @@ static int uhci_submit_isochronous(struc
+ return -ENOMEM;
+
+ uhci_add_td_to_urb(urb, td);
+- uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length - 1),
++ uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length),
+ urb->transfer_dma + urb->iso_frame_desc[i].offset);
+
+ if (i + 1 >= urb->number_of_packets)
+--- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.c
++++ gregkh-2.6/drivers/usb/host/uhci-hcd.c
+@@ -566,7 +566,7 @@ static int uhci_start(struct usb_hcd *hc
+ uhci->skel_bulk_qh->link = cpu_to_le32(uhci->skel_term_qh->dma_handle) | UHCI_PTR_QH;
+
+ /* This dummy TD is to work around a bug in Intel PIIX controllers */
+- uhci_fill_td(uhci->term_td, 0, (UHCI_NULL_DATA_SIZE << 21) |
++ uhci_fill_td(uhci->term_td, 0, uhci_explen(0) |
+ (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0);
+ uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle);
+
+--- gregkh-2.6.orig/drivers/usb/host/uhci-hcd.h
++++ gregkh-2.6/drivers/usb/host/uhci-hcd.h
+@@ -71,8 +71,6 @@
+ #define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */
+ #define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */
+
+-#define UHCI_NULL_DATA_SIZE 0x7FF /* for UHCI controller TD */
+-
+ #define UHCI_PTR_BITS cpu_to_le32(0x000F)
+ #define UHCI_PTR_TERM cpu_to_le32(0x0001)
+ #define UHCI_PTR_QH cpu_to_le32(0x0002)
+@@ -168,9 +166,11 @@ static __le32 inline qh_element(struct u
+ #define TD_TOKEN_EXPLEN_MASK 0x7FF /* expected length, encoded as n - 1 */
+ #define TD_TOKEN_PID_MASK 0xFF
+
+-#define uhci_explen(len) ((len) << TD_TOKEN_EXPLEN_SHIFT)
++#define uhci_explen(len) ((((len) - 1) & TD_TOKEN_EXPLEN_MASK) << \
++ TD_TOKEN_EXPLEN_SHIFT)
+
+-#define uhci_expected_length(token) ((((token) >> 21) + 1) & TD_TOKEN_EXPLEN_MASK)
++#define uhci_expected_length(token) ((((token) >> TD_TOKEN_EXPLEN_SHIFT) + \
++ 1) & TD_TOKEN_EXPLEN_MASK)
+ #define uhci_toggle(token) (((token) >> TD_TOKEN_TOGGLE_SHIFT) & 1)
+ #define uhci_endpoint(token) (((token) >> 15) & 0xf)
+ #define uhci_devaddr(token) (((token) >> TD_TOKEN_DEVADDR_SHIFT) & 0x7f)
diff --git a/usb/usb-ati_remote-use-time_before-and-friends.patch b/usb/usb-ati_remote-use-time_before-and-friends.patch
new file mode 100644
index 0000000000000..0c6c6b7d6ee4c
--- /dev/null
+++ b/usb/usb-ati_remote-use-time_before-and-friends.patch
@@ -0,0 +1,63 @@
+From adobriyan@gmail.com Wed Nov 30 13:41:31 2005
+Date: Thu, 1 Dec 2005 00:50:39 +0300
+From: Alexey Dobriyan <adobriyan@gmail.com>
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
+Subject: USB: ati_remote: use time_before() and friends
+Message-ID: <20051130215039.GF12551@mipter.zuzino.mipt.ru>
+Content-Disposition: inline
+
+From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
+
+They deal with wrapping correctly and are nicer to read.
+
+Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
+Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/usb/input/ati_remote.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/input/ati_remote.c
++++ gregkh-2.6/drivers/usb/input/ati_remote.c
+@@ -96,6 +96,7 @@
+ #include <linux/usb.h>
+ #include <linux/usb_input.h>
+ #include <linux/wait.h>
++#include <linux/jiffies.h>
+
+ /*
+ * Module and Version Information, Module Parameters
+@@ -471,7 +472,7 @@ static void ati_remote_input_report(stru
+ /* Filter duplicate events which happen "too close" together. */
+ if ((ati_remote->old_data[0] == data[1]) &&
+ (ati_remote->old_data[1] == data[2]) &&
+- ((ati_remote->old_jiffies + FILTER_TIME) > jiffies)) {
++ time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) {
+ ati_remote->repeat_count++;
+ } else {
+ ati_remote->repeat_count = 0;
+@@ -506,16 +507,16 @@ static void ati_remote_input_report(stru
+ * pad down, so we increase acceleration, ramping up over two seconds to
+ * a maximum speed. The acceleration curve is #defined above.
+ */
+- if ((jiffies - ati_remote->old_jiffies) > (HZ >> 2)) {
++ if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) {
+ acc = 1;
+ ati_remote->acc_jiffies = jiffies;
+ }
+- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 3)) acc = accel[0];
+- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 2)) acc = accel[1];
+- else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 1)) acc = accel[2];
+- else if ((jiffies - ati_remote->acc_jiffies) < HZ ) acc = accel[3];
+- else if ((jiffies - ati_remote->acc_jiffies) < HZ+(HZ>>1)) acc = accel[4];
+- else if ((jiffies - ati_remote->acc_jiffies) < (HZ << 1)) acc = accel[5];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3))) acc = accel[0];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2))) acc = accel[1];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1))) acc = accel[2];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + HZ)) acc = accel[3];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4];
++ else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1))) acc = accel[5];
+ else acc = accel[6];
+
+ input_regs(dev, regs);
diff --git a/usb/usb-pl2303_update_line_status-data-length-fix.patch b/usb/usb-pl2303_update_line_status-data-length-fix.patch
new file mode 100644
index 0000000000000..1dee29605067c
--- /dev/null
+++ b/usb/usb-pl2303_update_line_status-data-length-fix.patch
@@ -0,0 +1,30 @@
+From linux-kernel-owner+greg=40kroah.com-S261268AbVG1NcW@vger.kernel.org Thu Jul 28 06:34:45 2005
+Date: Thu, 28 Jul 2005 15:32:20 +0200
+From: Horst Schirmeier <horst@schirmeier.com>
+To: gregkh@suse.de
+Subject: USB: pl2303_update_line_status data length fix
+Message-ID: <20050728133220.GJ25889@quickstop.soohrt.org>
+Content-Disposition: inline
+
+Minimum data length must be UART_STATE + 1, as data[UART_STATE] is being
+accessed for the new line_state. Although PL-2303 hardware is not
+expected to send data with exactly UART_STATE length, this keeps it on
+the safe side.
+
+Signed-off-by: Horst Schirmeier <horst@schirmeier.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/usb/serial/pl2303.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/usb/serial/pl2303.c
++++ gregkh-2.6/drivers/usb/serial/pl2303.c
+@@ -810,7 +810,7 @@ static void pl2303_update_line_status(st
+ struct pl2303_private *priv = usb_get_serial_port_data(port);
+ unsigned long flags;
+ u8 status_idx = UART_STATE;
+- u8 length = UART_STATE;
++ u8 length = UART_STATE + 1;
+
+ if ((le16_to_cpu(port->serial->dev->descriptor.idVendor) == SIEMENS_VENDOR_ID) &&
+ (le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X65 ||
diff --git a/usb/usb-storage-add-unusual_devs-entry-for-nikon-coolpix-2000.patch b/usb/usb-storage-add-unusual_devs-entry-for-nikon-coolpix-2000.patch
new file mode 100644
index 0000000000000..2a7296d801367
--- /dev/null
+++ b/usb/usb-storage-add-unusual_devs-entry-for-nikon-coolpix-2000.patch
@@ -0,0 +1,49 @@
+From phil@ipom.com Wed Nov 30 01:20:47 2005
+Message-ID: <438D6DD0.6050901@ipom.com>
+Date: Wed, 30 Nov 2005 01:16:00 -0800
+From: fabien COSSE <fabien.cosse@wanadoo.fr>
+To: Greg KH <greg@kroah.com>
+Subject: USB Storage: add unusual_devs entry for NIKON Coolpix 2000
+
+This patch adds an unusual_devs.h entry for NIKON Coolpix 2000 camera
+wich cause error: "Not Ready: Medium not present"
+Works fine with th patched kernel...
+
+Here are the informations in /proc/bus/usb/devices:
+
+T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
+D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
+P: Vendor=04b0 ProdID=0301 Rev= 0.10
+S: Manufacturer=NIKON
+S: Product=NIKON DSC E2000
+C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
+I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50
+Driver=usb-storage
+E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
+E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
+E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=16ms
+
+Signed-off-by: Fabien COSSE <fabien.cosse@wanadoo.fr>
+Signed-off-by: Phil Dibowitz <phil@ipom.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/usb/storage/unusual_devs.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- gregkh-2.6.orig/drivers/usb/storage/unusual_devs.h
++++ gregkh-2.6/drivers/usb/storage/unusual_devs.h
+@@ -187,6 +187,14 @@ UNUSUAL_DEV( 0x04b0, 0x0405, 0x0100, 0x
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_FIX_CAPACITY),
+
++/* Patch for Nikon coolpix 2000
++ * Submitted by Fabien Cosse <fabien.cosse@wanadoo.fr>*/
++UNUSUAL_DEV( 0x04b0, 0x0301, 0x0010, 0x0010,
++ "NIKON",
++ "NIKON DSC E2000",
++ US_SC_DEVICE, US_PR_DEVICE,NULL,
++ US_FL_NOT_LOCKABLE ),
++
+ /* BENQ DC5330
+ * Reported by Manuel Fombuena <mfombuena@ya.com> and
+ * Frank Copeland <fjc@thingy.apana.org.au> */