Revert "USB: fix gregkh-usb-usb-use-menuconfig-objects"

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=773208946a132fb733ba273ee8562814f828cc28
Commit: 773208946a132fb733ba273ee8562814f828cc28
Parent: 9374430a52dfae5c013b88f7f030c04a6774d410
Author: Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 12 17:06:50 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 17:06:50 2007 -0700

Revert "USB: fix gregkh-usb-usb-use-menuconfig-objects"

This reverts commit acb11c8b8020f1f1b2545152020675ef32d09a58.

It was broken.  We most certainly *do* want the default to be the old
behaviour (and the common case!), instead of breaking everybodys
configuration and making 99% of all people have to override the default.

What were you guys thinking?

Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/usb/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 172a606..071b967 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -5,6 +5,7 @@
 menuconfig USB_SUPPORT
bool "USB support"
depends on HAS_IOMEM
+   default y
 
 if USB_SUPPORT
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: ohci-pnx4008: Remove unnecessary cast of return value of kzalloc

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13f9966b3ba5b45f47f2ea0eb0a90afceedfbb1f
Commit: 13f9966b3ba5b45f47f2ea0eb0a90afceedfbb1f
Parent: 6c59649d49df4b9084bf407890734b5965d77b41
Author: Suresh Jayaraman <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 28 11:16:30 2007 -0600
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:43 2007 -0700

USB: ohci-pnx4008: Remove unnecessary cast of return value of kzalloc

Remove unnecessary cast of return value of kzalloc() in
usb/host/ohci-pnx4008.c

Signed-off-by: Suresh Jayaraman <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/host/ohci-pnx4008.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
index d601bbb..ca2a6ab 100644
--- a/drivers/usb/host/ohci-pnx4008.c
+++ b/drivers/usb/host/ohci-pnx4008.c
@@ -134,7 +134,7 @@ static int isp1301_attach(struct i2c_adapter *adap, int 
addr, int kind)
 {
struct i2c_client *c;
 
-   c = (struct i2c_client *)kzalloc(sizeof(*c), GFP_KERNEL);
+   c = kzalloc(sizeof(*c), GFP_KERNEL);
 
if (!c)
return -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: additions to the quirk list

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c59649d49df4b9084bf407890734b5965d77b41
Commit: 6c59649d49df4b9084bf407890734b5965d77b41
Parent: 8dfe4b14869fd185ca25ee88b02ada58a3005eaf
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 10 14:12:08 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:43 2007 -0700

USB: additions to the quirk list

this adds some scanners reported to be crashed by autosuspend to
the quirk list.

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/quirks.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index a0fd68b..aa21b38 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -30,12 +30,20 @@
 static const struct usb_device_id usb_quirk_list[] = {
/* HP 5300/5370C scanner */
{ USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 
},
+   /* Benq S2W 3300U */
+   { USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   /* Seiko Epson Corp. Perfection 1200 */
+   { USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
/* Seiko Epson Corp - Perfection 1670 */
{ USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
/* Samsung ML-2510 Series printer */
{ USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
/* Elsa MicroLink 56k (V.250) */
{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   /* Ultima Electronics Corp.*/
+   { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   /* Umax [hex] Astra 3400U */
+   { USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
 
/* Philips PSC805 audio device */
{ USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


usb-storage: implement autosuspend

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8dfe4b14869fd185ca25ee88b02ada58a3005eaf
Commit: 8dfe4b14869fd185ca25ee88b02ada58a3005eaf
Parent: b0e2a705bffbfb70d9bed8b5f9094901f28d9563
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 6 14:24:27 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:43 2007 -0700

usb-storage: implement autosuspend

This patch (as930) implements autosuspend for usb-storage.  It is
adapted from a patch by Oliver Neukum.  Autosuspend is allowed except
during LUN scanning, resets, and command execution.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/storage/scsiglue.c |   13 +
 drivers/usb/storage/usb.c  |   27 ---
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 1ba19ea..47e5607 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -285,10 +285,15 @@ static int device_reset(struct scsi_cmnd *srb)
 
US_DEBUGP("%s called\n", __FUNCTION__);
 
-   /* lock the device pointers and do the reset */
-   mutex_lock(&(us->dev_mutex));
-   result = us->transport_reset(us);
-   mutex_unlock(&us->dev_mutex);
+   result = usb_autopm_get_interface(us->pusb_intf);
+   if (result == 0) {
+
+   /* lock the device pointers and do the reset */
+   mutex_lock(&(us->dev_mutex));
+   result = us->transport_reset(us);
+   mutex_unlock(&us->dev_mutex);
+   usb_autopm_put_interface(us->pusb_intf);
+   }
 
return result < 0 ? FAILED : SUCCESS;
 }
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index cf3fc91..bef8bcd 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -191,16 +191,14 @@ static int storage_suspend(struct usb_interface *iface, 
pm_message_t message)
 {
struct us_data *us = usb_get_intfdata(iface);
 
+   US_DEBUGP("%s\n", __FUNCTION__);
+
/* Wait until no command is running */
mutex_lock(&us->dev_mutex);
 
-   US_DEBUGP("%s\n", __FUNCTION__);
if (us->suspend_resume_hook)
(us->suspend_resume_hook)(us, US_SUSPEND);
 
-   /* When runtime PM is working, we'll set a flag to indicate
-* whether we should autoresume when a SCSI request arrives. */
-
mutex_unlock(&us->dev_mutex);
return 0;
 }
@@ -209,13 +207,11 @@ static int storage_resume(struct usb_interface *iface)
 {
struct us_data *us = usb_get_intfdata(iface);
 
-   mutex_lock(&us->dev_mutex);
-
US_DEBUGP("%s\n", __FUNCTION__);
+
if (us->suspend_resume_hook)
(us->suspend_resume_hook)(us, US_RESUME);
 
-   mutex_unlock(&us->dev_mutex);
return 0;
 }
 
@@ -313,6 +309,7 @@ static int usb_stor_control_thread(void * __us)
 {
struct us_data *us = (struct us_data *)__us;
struct Scsi_Host *host = us_to_host(us);
+   int autopm_rc;
 
current->flags |= PF_NOFREEZE;
 
@@ -323,6 +320,9 @@ static int usb_stor_control_thread(void * __us)

US_DEBUGP("*** thread awakened.\n");
 
+   /* Autoresume the device */
+   autopm_rc = usb_autopm_get_interface(us->pusb_intf);
+
/* lock the device pointers */
mutex_lock(&(us->dev_mutex));
 
@@ -381,6 +381,12 @@ static int usb_stor_control_thread(void * __us)
us->srb->result = SAM_STAT_GOOD;
}
 
+   /* Did the autoresume fail? */
+   else if (autopm_rc < 0) {
+   US_DEBUGP("Could not wake device\n");
+   us->srb->result = DID_ERROR << 16;
+   }
+
/* we've got a command, let's do it! */
else {
US_DEBUG(usb_stor_show_command(us->srb));
@@ -423,6 +429,10 @@ SkipForAbort:
 
/* unlock the device pointers */
mutex_unlock(&us->dev_mutex);
+
+   /* Start an autosuspend */
+   if (autopm_rc == 0)
+   usb_autopm_put_interface(us->pusb_intf);
} /* for (;;) */
 
/* Wait until we are told to stop */
@@ -939,6 +949,7 @@ retry:
}
 
scsi_host_put(us_to_host(us));
+   usb_autopm_put_interface(us->pusb_intf);
complete_and_exit(&threads_gone, 0);
 }
 
@@ -1028,6 +1039,7 @@ static int storage_probe(struct usb_interface *intf,
 * start it up. */
scsi_host_get(us_to_host(us));
atomic_inc(&total_threads);
+   usb_autopm_get_interface(intf); /* dropped in the scanning thread */
wake_up_process(th);
 
return 0;
@@ -1065,6 +1077,7 @@ static struct usb_driver

USB: cdc-acm: add new device id to option driver

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0e2a705bffbfb70d9bed8b5f9094901f28d9563
Commit: b0e2a705bffbfb70d9bed8b5f9094901f28d9563
Parent: 2d70c99b9340fa6c834fa6e32209e153f35a3e20
Author: Andrey Arapov <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 4 17:11:42 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:43 2007 -0700

USB: cdc-acm: add new device id to option driver

USB: add new device id to option driver
device is Samsung X180 China cellphone

Signed-off-by: Andrey Arapov <[EMAIL PROTECTED]>
Acked-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/class/cdc-acm.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 0081c1d..cd51520 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1157,6 +1157,9 @@ static struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
+   { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; [EMAIL 
PROTECTED] */
+   .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
+   },
{ USB_DEVICE(0x0482, 0x0203), /* KYOCERA AH-K3001V */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: goku_udc trivial cleanups

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d70c99b9340fa6c834fa6e32209e153f35a3e20
Commit: 2d70c99b9340fa6c834fa6e32209e153f35a3e20
Parent: 70790f6339a868e2a0d643f44899418f64a95943
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 1 17:55:50 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:43 2007 -0700

USB: goku_udc trivial cleanups

Minor fixes to goku_udc ... whitespace, let -DDEBUG do its thing,
check the return value of device_register(), sparse tweaks.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/goku_udc.c |   36 +---
 drivers/usb/gadget/goku_udc.h |   10 ++
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index dfadb64..d6c5f11 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -20,7 +20,6 @@
  *  - DMA works with ep1 (OUT transfers) and ep2 (IN transfers).
  */
 
-#undef DEBUG
 // #define VERBOSE /* extra debug messages (success too) */
 // #define USB_TRACE   /* packet-level success messages */
 
@@ -440,7 +439,7 @@ top:
/* use ep1/ep2 double-buffering for OUT */
if (!(size & PACKET_ACTIVE))
size = readl(®s->EPxSizeLB[ep->num]);
-   if (!(size & PACKET_ACTIVE))// "can't happen"
+   if (!(size & PACKET_ACTIVE))/* "can't happen" */
break;
size &= DATASIZE;   /* EPxSizeH == 0 */
 
@@ -1092,17 +1091,17 @@ udc_proc_read(char *buffer, char **start, off_t off, 
int count,
is_usb_connected
? ((tmp & PW_PULLUP) ? "full speed" : "powered")
: "disconnected",
-   ({char *tmp;
+   ({char *state;
switch(dev->ep0state){
-   case EP0_DISCONNECT:tmp = "ep0_disconnect"; break;
-   case EP0_IDLE:  tmp = "ep0_idle"; break;
-   case EP0_IN:tmp = "ep0_in"; break;
-   case EP0_OUT:   tmp = "ep0_out"; break;
-   case EP0_STATUS:tmp = "ep0_status"; break;
-   case EP0_STALL: tmp = "ep0_stall"; break;
-   case EP0_SUSPEND:   tmp = "ep0_suspend"; break;
-   default:tmp = "ep0_?"; break;
-   } tmp; })
+   case EP0_DISCONNECT:state = "ep0_disconnect"; break;
+   case EP0_IDLE:  state = "ep0_idle"; break;
+   case EP0_IN:state = "ep0_in"; break;
+   case EP0_OUT:   state = "ep0_out"; break;
+   case EP0_STATUS:state = "ep0_status"; break;
+   case EP0_STALL: state = "ep0_stall"; break;
+   case EP0_SUSPEND:   state = "ep0_suspend"; break;
+   default:state = "ep0_?"; break;
+   } state; })
);
size -= t;
next += t;
@@ -1147,7 +1146,6 @@ udc_proc_read(char *buffer, char **start, off_t off, int 
count,
for (i = 0; i < 4; i++) {
struct goku_ep  *ep = &dev->ep [i];
struct goku_request *req;
-   int t;
 
if (i && !ep->desc)
continue;
@@ -1235,7 +1233,7 @@ done:
 static void udc_reinit (struct goku_udc *dev)
 {
static char *names [] = { "ep0", "ep1-bulk", "ep2-bulk", "ep3-bulk" };
-   
+
unsigned i;
 
INIT_LIST_HEAD (&dev->gadget.ep_list);
@@ -1848,9 +1846,9 @@ static int goku_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
 
/* done */
the_controller = dev;
-   device_register(&dev->gadget.dev);
-
-   return 0;
+   retval = device_register(&dev->gadget.dev);
+   if (retval == 0)
+   return 0;
 
 done:
if (dev)
@@ -1862,8 +1860,8 @@ done:
 /*-*/
 
 static struct pci_device_id pci_ids [] = { {
-   .class =((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
-   .class_mask =   ~0,
+   .class =((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+   .class_mask =   ~0,
.vendor =   0x102f, /* Toshiba */
.device =   0x0107, /* this UDC */
.subvendor =PCI_ANY_ID,
diff --git a/drivers/usb/gadget/goku_udc.h b/drivers/usb/gadget/goku_udc.h
index ea8c8e5..bc4eb1e 100644
--- a/drivers/usb/gadget/goku_udc.h
+++ b/drivers/usb/gadget/goku_udc.h
@@ -41,8 +41,10 @@ struct goku_udc_regs {
 #define INT_SYSERROR   0x4
 #define INT_PWRDETECT  

USB: usb gadget stack can now -DDEBUG with Kconfig

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70790f6339a868e2a0d643f44899418f64a95943
Commit: 70790f6339a868e2a0d643f44899418f64a95943
Parent: c67ab134ba9f83f9de86e58adfeaa14a9efa6e00
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 1 17:35:28 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

USB: usb gadget stack can now -DDEBUG with Kconfig

Although the other USB driver directories got taught how use Kconfig
and the Makefile to enable the debugging messages enabled by -DDEBUG,
the gadget stack was overlooked.

This patch remedies that omission, but doesn't update any drivers to
remove previous idiosyncracies in this area ... other than the RNDIS
code, which defined its own DEBUG() macro in a broken way.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/Kconfig  |   14 
 drivers/usb/gadget/Makefile |4 +
 drivers/usb/gadget/rndis.c  |  164 +-
 3 files changed, 100 insertions(+), 82 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 74eaa7d..45e01e2 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -42,6 +42,20 @@ config USB_GADGET
   For more information, see  and
   the kernel DocBook documentation for this API.
 
+config USB_GADGET_DEBUG
+   boolean "Debugging messages"
+   depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
+   help
+  Many controller and gadget drivers will print some debugging
+  messages if you use this option to ask for those messages.
+
+  Avoid enabling these messages, even if you're actively
+  debugging such a driver.  Many drivers will emit so many
+  messages that the driver timings are affected, which will
+  either create new failure modes or remove the one you're
+  trying to track down.  Never enable these messages for a
+  production build.
+
 config USB_GADGET_DEBUG_FILES
boolean "Debugging information files"
depends on USB_GADGET && PROC_FS
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index bff2783..8ae76f7 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -1,6 +1,10 @@
 #
 # USB peripheral controller drivers
 #
+ifeq ($(CONFIG_USB_GADGET_DEBUG),y)
+   EXTRA_CFLAGS+= -DDEBUG
+endif
+
 obj-$(CONFIG_USB_DUMMY_HCD)+= dummy_hcd.o
 obj-$(CONFIG_USB_NET2280)  += net2280.o
 obj-$(CONFIG_USB_PXA2XX)   += pxa2xx_udc.o
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 708657c..db1b2bf 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -53,7 +53,7 @@
  */
 
 #if 0
-#define DEBUG(str,args...) do { \
+#define DBG(str,args...) do { \
if (rndis_debug) \
printk(KERN_DEBUG str , ## args ); \
} while (0)
@@ -65,7 +65,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
 #else
 
 #define rndis_debug0
-#define DEBUG(str,args...) do{}while(0)
+#define DBG(str,args...)   do{}while(0)
 #endif
 
 #define RNDIS_MAX_CONFIGS  1
@@ -183,9 +183,9 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, 
unsigned buf_len,
if (!resp) return -ENOMEM;
 
if (buf_len && rndis_debug > 1) {
-   DEBUG("query OID %08x value, len %d:\n", OID, buf_len);
+   DBG("query OID %08x value, len %d:\n", OID, buf_len);
for (i = 0; i < buf_len; i += 16) {
-   DEBUG ("%03d: %08x %08x %08x %08x\n", i,
+   DBG("%03d: %08x %08x %08x %08x\n", i,
le32_to_cpu(get_unaligned((__le32 *)
&buf[i])),
le32_to_cpu(get_unaligned((__le32 *)
@@ -207,7 +207,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, 
unsigned buf_len,
 
/* mandatory */
case OID_GEN_SUPPORTED_LIST:
-   DEBUG ("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__);
+   DBG("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__);
length = sizeof (oid_supported_list);
count  = length / sizeof (u32);
for (i = 0; i < count; i++)
@@ -217,7 +217,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, 
unsigned buf_len,
 
/* mandatory */
case OID_GEN_HARDWARE_STATUS:
-   DEBUG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__);
+   DBG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__);
/* Bogus question!
 * Hardware must be ready to receive high level protocols.
 * BTW:
@@ -230,14 +230,14 @@ gen_ndis_query_resp (int configNr, u32 

usb gadget stack: remove usb_ep_*_buffer(), part 2

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c67ab134ba9f83f9de86e58adfeaa14a9efa6e00
Commit: c67ab134ba9f83f9de86e58adfeaa14a9efa6e00
Parent: 9d8bab58b758cd5a96d368a8cc64111c9ab50407
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 1 12:21:00 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

usb gadget stack: remove usb_ep_*_buffer(), part 2

This patch removes controller driver infrastructure which supported
the now-removed usb_ep_{alloc,free}_buffer() calls.

As can be seen, many of the implementations of this were broken to
various degrees.  Many didn't properly return dma-coherent mappings;
those which did so were necessarily ugly because of bogosity in the
underlying dma_free_coherent() calls ... which on many platforms
can't be called from the same contexts (notably in_irq) from which
their dma_alloc_coherent() sibling can be called.

The main potential downside of removing this is that gadget drivers
wouldn't have specific knowledge that the controller drivers have:
endpoints that aren't dma-capable don't need any dma mappings at all.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/at91_udc.c |   21 ---
 drivers/usb/gadget/dummy_hcd.c|   36 
 drivers/usb/gadget/fsl_usb2_udc.c |   36 
 drivers/usb/gadget/goku_udc.c |   48 
 drivers/usb/gadget/lh7a40x_udc.c  |   27 -
 drivers/usb/gadget/net2280.c  |   97 -
 drivers/usb/gadget/omap_udc.c |  108 -
 drivers/usb/gadget/pxa2xx_udc.c   |   23 
 drivers/usb/gadget/s3c2410_udc.c  |   33 ---
 include/linux/usb_gadget.h|7 ---
 10 files changed, 0 insertions(+), 436 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index ba163f3..63d7d65 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -601,25 +601,6 @@ static void at91_ep_free_request(struct usb_ep *_ep, 
struct usb_request *_req)
kfree(req);
 }
 
-static void *at91_ep_alloc_buffer(
-   struct usb_ep *_ep,
-   unsigned bytes,
-   dma_addr_t *dma,
-   gfp_t gfp_flags)
-{
-   *dma = ~0;
-   return kmalloc(bytes, gfp_flags);
-}
-
-static void at91_ep_free_buffer(
-   struct usb_ep *ep,
-   void *buf,
-   dma_addr_t dma,
-   unsigned bytes)
-{
-   kfree(buf);
-}
-
 static int at91_ep_queue(struct usb_ep *_ep,
struct usb_request *_req, gfp_t gfp_flags)
 {
@@ -788,8 +769,6 @@ static const struct usb_ep_ops at91_ep_ops = {
.disable= at91_ep_disable,
.alloc_request  = at91_ep_alloc_request,
.free_request   = at91_ep_free_request,
-   .alloc_buffer   = at91_ep_alloc_buffer,
-   .free_buffer= at91_ep_free_buffer,
.queue  = at91_ep_queue,
.dequeue= at91_ep_dequeue,
.set_halt   = at91_ep_set_halt,
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 9040b50..f2fbdc7 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -497,38 +497,6 @@ dummy_free_request (struct usb_ep *_ep, struct usb_request 
*_req)
kfree (req);
 }
 
-static void *
-dummy_alloc_buffer (
-   struct usb_ep *_ep,
-   unsigned bytes,
-   dma_addr_t *dma,
-   gfp_t mem_flags
-) {
-   char*retval;
-   struct dummy_ep *ep;
-   struct dummy*dum;
-
-   ep = usb_ep_to_dummy_ep (_ep);
-   dum = ep_to_dummy (ep);
-
-   if (!dum->driver)
-   return NULL;
-   retval = kmalloc (bytes, mem_flags);
-   *dma = (dma_addr_t) retval;
-   return retval;
-}
-
-static void
-dummy_free_buffer (
-   struct usb_ep *_ep,
-   void *buf,
-   dma_addr_t dma,
-   unsigned bytes
-) {
-   if (bytes)
-   kfree (buf);
-}
-
 static void
 fifo_complete (struct usb_ep *ep, struct usb_request *req)
 {
@@ -659,10 +627,6 @@ static const struct usb_ep_ops dummy_ep_ops = {
.alloc_request  = dummy_alloc_request,
.free_request   = dummy_free_request,
 
-   .alloc_buffer   = dummy_alloc_buffer,
-   .free_buffer= dummy_free_buffer,
-   /* map, unmap, ... eventually hook the "generic" dma calls */
-
.queue  = dummy_queue,
.dequeue= dummy_dequeue,
 
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c 
b/drivers/usb/gadget/fsl_usb2_udc.c
index 4e14bcd..10b2b33 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -601,39 +601,6 @@ static void fsl_free_request(struct usb_ep *_ep, struct 
usb_request *_req)
kfree(req);
 }

usb gadget stack: remove usb_ep_*_buffer(), part 1

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d8bab58b758cd5a96d368a8cc64111c9ab50407
Commit: 9d8bab58b758cd5a96d368a8cc64111c9ab50407
Parent: ad8c623f4f48085edd51c7f4cdfd10295547bf45
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 1 11:04:54 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

usb gadget stack: remove usb_ep_*_buffer(), part 1

Remove usb_ep_{alloc,free}_buffer() calls, for small dma-coherent buffers.
This patch just removes the interface and its users; later patches will
remove controller driver support.

  - This interface is invariably not implemented correctly in the
controller drivers (e.g. using dma pools, a mechanism which
post-dates the interface by several years).

  - At this point no gadget driver really *needs* to use it.  In
current kernels, any driver that needs such a mechanism could
allocate a dma pool themselves.

Removing this interface is thus a simplification and improvement.

Note that the gmidi.c driver had a bug in this area; fixed.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/file_storage.c |   19 
 drivers/usb/gadget/gmidi.c|8 +--
 drivers/usb/gadget/inode.c|4 +-
 drivers/usb/gadget/zero.c |9 ++-
 include/linux/usb_gadget.h|   41 -
 5 files changed, 11 insertions(+), 70 deletions(-)

diff --git a/drivers/usb/gadget/file_storage.c 
b/drivers/usb/gadget/file_storage.c
index 7e650d0..8712ef9 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3733,19 +3733,12 @@ static void /* __init_or_exit */ fsg_unbind(struct 
usb_gadget *gadget)
}
 
/* Free the data buffers */
-   for (i = 0; i < NUM_BUFFERS; ++i) {
-   struct fsg_buffhd   *bh = &fsg->buffhds[i];
-
-   if (bh->buf)
-   usb_ep_free_buffer(fsg->bulk_in, bh->buf, bh->dma,
-   mod_data.buflen);
-   }
+   for (i = 0; i < NUM_BUFFERS; ++i)
+   kfree(fsg->buffhds[i].buf);
 
/* Free the request and buffer for endpoint 0 */
if (req) {
-   if (req->buf)
-   usb_ep_free_buffer(fsg->ep0, req->buf,
-   req->dma, EP0_BUFSIZE);
+   kfree(req->buf);
usb_ep_free_request(fsg->ep0, req);
}
 
@@ -3972,8 +3965,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL);
if (!req)
goto out;
-   req->buf = usb_ep_alloc_buffer(fsg->ep0, EP0_BUFSIZE,
-   &req->dma, GFP_KERNEL);
+   req->buf = kmalloc(EP0_BUFSIZE, GFP_KERNEL);
if (!req->buf)
goto out;
req->complete = ep0_complete;
@@ -3985,8 +3977,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
/* Allocate for the bulk-in endpoint.  We assume that
 * the buffer will also work with the bulk-out (and
 * interrupt-in) endpoint. */
-   bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen,
-   &bh->dma, GFP_KERNEL);
+   bh->buf = kmalloc(mod_data.buflen, GFP_KERNEL);
if (!bh->buf)
goto out;
bh->next = bh + 1;
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index d08a8d0..1c5aa49 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -1248,17 +1248,11 @@ autoconf_fail:
tasklet_init(&dev->tasklet, gmidi_in_tasklet, (unsigned long)dev);
 
/* preallocate control response and buffer */
-   dev->req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
+   dev->req = alloc_ep_req(gadget->ep0, USB_BUFSIZ);
if (!dev->req) {
err = -ENOMEM;
goto fail;
}
-   dev->req->buf = usb_ep_alloc_buffer(gadget->ep0, USB_BUFSIZ,
-   &dev->req->dma, GFP_KERNEL);
-   if (!dev->req->buf) {
-   err = -ENOMEM;
-   goto fail;
-   }
 
dev->req->complete = gmidi_setup_complete;
 
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index f723e08..e60745f 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -923,7 +923,7 @@ static void clean_req (struct usb_ep *ep, struct 
usb_request *req)
struct dev_data *dev = ep->driver_data;
 
if (req->buf != dev->rbuf) {
-   usb_ep_free_buffer (ep, req->buf, req->dma, req->length);
+   kfree(req->buf);

USB: pxa2xx_udc -- cleanups, mostly removing dma hooks

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad8c623f4f48085edd51c7f4cdfd10295547bf45
Commit: ad8c623f4f48085edd51c7f4cdfd10295547bf45
Parent: 9068a4c6467986e8fda5bdb29bd5f10c6788e2ff
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 30 06:30:04 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

USB: pxa2xx_udc -- cleanups, mostly removing dma hooks

Cleanups to the pxa2xx_udc code:

  - Primarily removing unused DMA hooks.
  - One "sparse" warning removed
  - Remove some Lubbock-only LED hooks (for debugging)

That DMA code was never really completed.  It worked, mostly, for IN
transfers (to the host) if they were fortuitously aligned, but that
code was never fully tested.  And it was never coded for OUT transfers
(which is where DMA would really help) ... because of chip errata on
essentially every chip other than the pxa255, and because of design
botches (nothing automated data toggle).  So it's effectively been
dead code for several years now ... no point in keeping it around.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/pxa2xx_udc.c |  387 +++
 drivers/usb/gadget/pxa2xx_udc.h |   42 +
 2 files changed, 25 insertions(+), 404 deletions(-)

diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index c9ec0b3..484de6e 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -24,7 +24,6 @@
  *
  */
 
-#undef DEBUG
 // #define VERBOSE DBG_VERBOSE
 
 #include 
@@ -75,9 +74,17 @@
  * it constrains the sorts of USB configuration change events that work.
  * The errata for these chips are misleading; some "fixed" bugs from
  * pxa250 a0/a1 b0/b1/b2 sure act like they're still there.
+ *
+ * Note that the UDC hardware supports DMA (except on IXP) but that's
+ * not used here.  IN-DMA (to host) is simple enough, when the data is
+ * suitably aligned (16 bytes) ... the network stack doesn't do that,
+ * other software can.  OUT-DMA is buggy in most chip versions, as well
+ * as poorly designed (data toggle not automatic).  So this driver won't
+ * bother using DMA.  (Mostly-working IN-DMA support was available in
+ * kernels before 2.6.23, but was never enabled or well tested.)
  */
 
-#defineDRIVER_VERSION  "4-May-2005"
+#defineDRIVER_VERSION  "30-June-2007"
 #defineDRIVER_DESC "PXA 25x USB Device Controller driver"
 
 
@@ -86,12 +93,9 @@ static const char driver_name [] = "pxa2xx_udc";
 static const char ep0name [] = "ep0";
 
 
-// #define USE_DMA
-// #define USE_OUT_DMA
 // #define DISABLE_TEST_MODE
 
 #ifdef CONFIG_ARCH_IXP4XX
-#undef USE_DMA
 
 /* cpu-specific register addresses are compiled in to this code */
 #ifdef CONFIG_ARCH_PXA
@@ -103,25 +107,6 @@ static const char ep0name [] = "ep0";
 #include "pxa2xx_udc.h"
 
 
-#ifdef USE_DMA
-static int use_dma = 1;
-module_param(use_dma, bool, 0);
-MODULE_PARM_DESC (use_dma, "true to use dma");
-
-static void dma_nodesc_handler (int dmach, void *_ep);
-static void kick_dma(struct pxa2xx_ep *ep, struct pxa2xx_request *req);
-
-#ifdef USE_OUT_DMA
-#defineDMASTR " (dma support)"
-#else
-#defineDMASTR " (dma in)"
-#endif
-
-#else  /* !USE_DMA */
-#defineDMASTR " (pio only)"
-#undef USE_OUT_DMA
-#endif
-
 #ifdef CONFIG_USB_PXA2XX_SMALL
 #define SIZE_STR   " (small)"
 #else
@@ -280,9 +265,8 @@ static int pxa2xx_ep_enable (struct usb_ep *_ep,
}
 
ep->desc = desc;
-   ep->dma = -1;
ep->stopped = 0;
-   ep->pio_irqs = ep->dma_irqs = 0;
+   ep->pio_irqs = 0;
ep->ep.maxpacket = le16_to_cpu (desc->wMaxPacketSize);
 
/* flush fifo (mostly for OUT buffers) */
@@ -290,30 +274,6 @@ static int pxa2xx_ep_enable (struct usb_ep *_ep,
 
/* ... reset halt state too, if we could ... */
 
-#ifdef USE_DMA
-   /* for (some) bulk and ISO endpoints, try to get a DMA channel and
-* bind it to the endpoint.  otherwise use PIO.
-*/
-   switch (ep->bmAttributes) {
-   case USB_ENDPOINT_XFER_ISOC:
-   if (le16_to_cpu(desc->wMaxPacketSize) % 32)
-   break;
-   // fall through
-   case USB_ENDPOINT_XFER_BULK:
-   if (!use_dma || !ep->reg_drcmr)
-   break;
-   ep->dma = pxa_request_dma ((char *)_ep->name,
-   (le16_to_cpu (desc->wMaxPacketSize) > 64)
-   ? DMA_PRIO_MEDIUM /* some iso */
-   : DMA_PRIO_LOW,
-   dma_nodesc_handler, ep);
-   if (ep->dma >= 0) {
-   *ep->reg_drcmr = DRCMR_MAPVLD | ep->dma;
-  

USB: pxa2xx_udc: use generic gpio layer

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9068a4c6467986e8fda5bdb29bd5f10c6788e2ff
Commit: 9068a4c6467986e8fda5bdb29bd5f10c6788e2ff
Parent: e4f747373cd96c86db3c64c21710748c6889c03c
Author: Milan Svoboda <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 30 06:25:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

USB: pxa2xx_udc: use generic gpio layer

This patch lets the pxa2xx_udc use the generic gpio layer,
on the relevant PXA and IXP systems.

Signed-off-by: Milan Svoboda <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/pxa2xx_udc.c   |   63 
 include/asm-arm/arch-ixp4xx/udc.h |   22 -
 include/asm-arm/arch-pxa/udc.h|   33 ---
 3 files changed, 49 insertions(+), 69 deletions(-)

diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 84392e8..c9ec0b3 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -27,6 +27,7 @@
 #undef DEBUG
 // #define VERBOSE DBG_VERBOSE
 
+#include 
 #include 
 #include 
 #include 
@@ -46,19 +47,17 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#ifdef CONFIG_ARCH_PXA
-#include 
-#endif
 
 #include 
 #include 
 
-#include 
+#include 
 
 
 /*
@@ -155,7 +154,7 @@ static int is_vbus_present(void)
struct pxa2xx_udc_mach_info *mach = the_controller->mach;
 
if (mach->gpio_vbus)
-   return udc_gpio_get(mach->gpio_vbus);
+   return gpio_get_value(mach->gpio_vbus);
if (mach->udc_is_connected)
return mach->udc_is_connected();
return 1;
@@ -167,7 +166,7 @@ static void pullup_off(void)
struct pxa2xx_udc_mach_info *mach = the_controller->mach;
 
if (mach->gpio_pullup)
-   udc_gpio_set(mach->gpio_pullup, 0);
+   gpio_set_value(mach->gpio_pullup, 0);
else if (mach->udc_command)
mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
 }
@@ -177,7 +176,7 @@ static void pullup_on(void)
struct pxa2xx_udc_mach_info *mach = the_controller->mach;
 
if (mach->gpio_pullup)
-   udc_gpio_set(mach->gpio_pullup, 1);
+   gpio_set_value(mach->gpio_pullup, 1);
else if (mach->udc_command)
mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
 }
@@ -1742,7 +1741,7 @@ lubbock_vbus_irq(int irq, void *_dev)
 static irqreturn_t udc_vbus_irq(int irq, void *_dev)
 {
struct pxa2xx_udc   *dev = _dev;
-   int vbus = udc_gpio_get(dev->mach->gpio_vbus);
+   int vbus = gpio_get_value(dev->mach->gpio_vbus);
 
pxa2xx_udc_vbus_session(&dev->gadget, vbus);
return IRQ_HANDLED;
@@ -2535,14 +2534,33 @@ static int __init pxa2xx_udc_probe(struct 
platform_device *pdev)
/* other non-static parts of init */
dev->dev = &pdev->dev;
dev->mach = pdev->dev.platform_data;
+
if (dev->mach->gpio_vbus) {
-   udc_gpio_init_vbus(dev->mach->gpio_vbus);
-   vbus_irq = udc_gpio_to_irq(dev->mach->gpio_vbus);
+   if ((retval = gpio_request(dev->mach->gpio_vbus,
+   "pxa2xx_udc GPIO VBUS"))) {
+   dev_dbg(&pdev->dev,
+   "can't get vbus gpio %d, err: %d\n",
+   dev->mach->gpio_vbus, retval);
+   return -EBUSY;
+   }
+   gpio_direction_input(dev->mach->gpio_vbus);
+   vbus_irq = gpio_to_irq(dev->mach->gpio_vbus);
set_irq_type(vbus_irq, IRQT_BOTHEDGE);
} else
vbus_irq = 0;
-   if (dev->mach->gpio_pullup)
-   udc_gpio_init_pullup(dev->mach->gpio_pullup);
+
+   if (dev->mach->gpio_pullup) {
+   if ((retval = gpio_request(dev->mach->gpio_pullup,
+   "pca2xx_udc GPIO PULLUP"))) {
+   dev_dbg(&pdev->dev,
+   "can't get pullup gpio %d, err: %d\n",
+   dev->mach->gpio_pullup, retval);
+   if (dev->mach->gpio_vbus)
+   gpio_free(dev->mach->gpio_vbus);
+   return -EBUSY;
+   }
+   gpio_direction_output(dev->mach->gpio_pullup, 0);
+   }
 
init_timer(&dev->timer);
dev->timer.function = udc_watchdog;
@@ -2566,6 +2584,10 @@ static int __init pxa2xx_udc_probe(struct 
platform_device *pdev)
if (retval != 0) {
printk(KERN_ERR "%s: can't get irq %d, err %d\n",
driver_name, irq, retval);
+   if (dev->mac

USB: quirk for samsung printer

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e4f747373cd96c86db3c64c21710748c6889c03c
Commit: e4f747373cd96c86db3c64c21710748c6889c03c
Parent: fbf54dd32001359ccda6a9d8577f7b00e67357c7
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 29 08:44:37 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

USB: quirk for samsung printer

this printer does not survive suspension.

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/quirks.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 1cfc87b..a0fd68b 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -32,6 +32,8 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 
},
/* Seiko Epson Corp - Perfection 1670 */
{ USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   /* Samsung ML-2510 Series printer */
+   { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
/* Elsa MicroLink 56k (V.250) */
{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb/dma doc updates

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbf54dd32001359ccda6a9d8577f7b00e67357c7
Commit: fbf54dd32001359ccda6a9d8577f7b00e67357c7
Parent: c0e0c19cc9d899da0ee15104907ac158eb94365b
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 1 23:33:12 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:42 2007 -0700

USB: usb/dma doc updates

This patch updates some of the documentation about DMA buffer management
for USB, and ways to avoid extra copying.  Our understanding of the issues
has improved over time.

 - Most drivers should *avoid* the dma-coherent allocators.  There are
   a few exceptions (like the HID driver).

 - Some methods are currently commented out; it seems folk writing
   USB drivers aren't doing performance tuning at that level yet.

 - Just avoid highmem; there's no good way to pass an "I can do highmem
   DMA" capability through a driver stack.  This is easy, everything
   already avoids highmem.  But it'd be nice if x86_32 systems with much
   physical memory could use it directly with network adapters and mass
   storage devices.  (Patch, anyone?)

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 Documentation/usb/dma.txt |   52 -
 drivers/usb/core/usb.c|   11 +
 2 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
index 62844ae..e8b50b7 100644
--- a/Documentation/usb/dma.txt
+++ b/Documentation/usb/dma.txt
@@ -32,12 +32,15 @@ ELIMINATING COPIES
 It's good to avoid making CPUs copy data needlessly.  The costs can add up,
 and effects like cache-trashing can impose subtle penalties.
 
-- When you're allocating a buffer for DMA purposes anyway, use the buffer
-  primitives.  Think of them as kmalloc and kfree that give you the right
-  kind of addresses to store in urb->transfer_buffer and urb->transfer_dma,
-  while guaranteeing that no hidden copies through DMA "bounce" buffers will
-  slow things down.  You'd also set URB_NO_TRANSFER_DMA_MAP in
-  urb->transfer_flags:
+- If you're doing lots of small data transfers from the same buffer all
+  the time, that can really burn up resources on systems which use an
+  IOMMU to manage the DMA mappings.  It can cost MUCH more to set up and
+  tear down the IOMMU mappings with each request than perform the I/O!
+
+  For those specific cases, USB has primitives to allocate less expensive
+  memory.  They work like kmalloc and kfree versions that give you the right
+  kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
+  You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
 
void *usb_buffer_alloc (struct usb_device *dev, size_t size,
int mem_flags, dma_addr_t *dma);
@@ -45,6 +48,10 @@ and effects like cache-trashing can impose subtle penalties.
void usb_buffer_free (struct usb_device *dev, size_t size,
void *addr, dma_addr_t dma);
 
+  Most drivers should *NOT* be using these primitives; they don't need
+  to use this type of memory ("dma-coherent"), and memory returned from
+  kmalloc() will work just fine.
+
   For control transfers you can use the buffer primitives or not for each
   of the transfer buffer and setup buffer independently.  Set the flag bits
   URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP to indicate which
@@ -54,29 +61,39 @@ and effects like cache-trashing can impose subtle penalties.
   The memory buffer returned is "dma-coherent"; sometimes you might need to
   force a consistent memory access ordering by using memory barriers.  It's
   not using a streaming DMA mapping, so it's good for small transfers on
-  systems where the I/O would otherwise tie up an IOMMU mapping.  (See
+  systems where the I/O would otherwise thrash an IOMMU mapping.  (See
   Documentation/DMA-mapping.txt for definitions of "coherent" and "streaming"
   DMA mappings.)
 
   Asking for 1/Nth of a page (as well as asking for N pages) is reasonably
   space-efficient.
 
+  On most systems the memory returned will be uncached, because the
+  semantics of dma-coherent memory require either bypassing CPU caches
+  or using cache hardware with bus-snooping support.  While x86 hardware
+  has such bus-snooping, many other systems use software to flush cache
+  lines to prevent DMA conflicts.
+
 - Devices on some EHCI controllers could handle DMA to/from high memory.
-  Driver probe() routines can notice this using a generic DMA call, then
-  tell higher level code (network, scsi, etc) about it like this:
 
-   if (dma_supported (&intf->dev, 0xULL))
-   net->features |= NETIF_F_HIGHDMA;
+  Unfortunately, the current Linux DMA infrastructure doesn't have a sane
+  way to expose t

USB: drivers/usb/storage/unusual_devs.h whitespace cleanup

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0e0c19cc9d899da0ee15104907ac158eb94365b
Commit: c0e0c19cc9d899da0ee15104907ac158eb94365b
Parent: a603c665516a3cb9df6abafad491bef24cc87aa5
Author: S.Caglar Onur <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 4 13:52:47 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: drivers/usb/storage/unusual_devs.h whitespace cleanup

Following patch removes trailing whitespaces at the ends of lines and 
converts
smarttabs/whitespaces into real tabs.

Signed-off-by: S.Caglar Onur <[EMAIL PROTECTED]>
Signed-off-by: Phil Dibowitz <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/storage/unusual_devs.h |  188 ++--
 1 files changed, 94 insertions(+), 94 deletions(-)

diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index 54979c2..b6bf31a 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -50,10 +50,10 @@
 /* patch submitted by Vivian Bregier <[EMAIL PROTECTED]>
  */
 UNUSUAL_DEV(  0x03eb, 0x2002, 0x0100, 0x0100,
-"ATMEL",
-"SND1 Storage",
-US_SC_DEVICE, US_PR_DEVICE, NULL,
-US_FL_IGNORE_RESIDUE),
+   "ATMEL",
+   "SND1 Storage",
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_IGNORE_RESIDUE),
 
 /* modified by Tobias Lorenz <[EMAIL PROTECTED]> */
 UNUSUAL_DEV(  0x03ee, 0x6901, 0x, 0x0200,
@@ -69,18 +69,18 @@ UNUSUAL_DEV(  0x03ee, 0x6906, 0x0003, 0x0003,
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_IGNORE_RESIDUE ),
 
-UNUSUAL_DEV(  0x03f0, 0x0107, 0x0200, 0x0200, 
+UNUSUAL_DEV(  0x03f0, 0x0107, 0x0200, 0x0200,
"HP",
"CD-Writer+",
-   US_SC_8070, US_PR_CB, NULL, 0), 
+   US_SC_8070, US_PR_CB, NULL, 0),
 
 #ifdef CONFIG_USB_STORAGE_USBAT
-UNUSUAL_DEV(  0x03f0, 0x0207, 0x0001, 0x0001, 
+UNUSUAL_DEV(  0x03f0, 0x0207, 0x0001, 0x0001,
"HP",
"CD-Writer+ 8200e",
US_SC_8070, US_PR_USBAT, init_usbat_cd, 0),
 
-UNUSUAL_DEV(  0x03f0, 0x0307, 0x0001, 0x0001, 
+UNUSUAL_DEV(  0x03f0, 0x0307, 0x0001, 0x0001,
"HP",
"CD-Writer+ CD-4e",
US_SC_8070, US_PR_USBAT, init_usbat_cd, 0),
@@ -115,10 +115,10 @@ UNUSUAL_DEV(  0x0411, 0x001c, 0x0113, 0x0113,
 
 /* Submitted by Ernestas Vaiciukevicius <[EMAIL PROTECTED]> */
 UNUSUAL_DEV(  0x0419, 0x0100, 0x0100, 0x0100,
-"Samsung Info. Systems America, Inc.",
-"MP3 Player",
-US_SC_DEVICE, US_PR_DEVICE, NULL,
-US_FL_IGNORE_RESIDUE ),
+   "Samsung Info. Systems America, Inc.",
+   "MP3 Player",
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_IGNORE_RESIDUE ),
 
 /* Reported by Orgad Shaneh <[EMAIL PROTECTED]> */
 UNUSUAL_DEV(  0x0419, 0xaace, 0x0100, 0x0100,
@@ -256,10 +256,10 @@ UNUSUAL_DEV(  0x0457, 0x0150, 0x0100, 0x0100,
 * the revision to my model only
 */
 UNUSUAL_DEV(  0x0457, 0x0151, 0x0100, 0x0100,
-"USB 2.0",
-"Flash Disk",
-US_SC_DEVICE, US_PR_DEVICE, NULL,
-US_FL_NOT_LOCKABLE ),
+   "USB 2.0",
+   "Flash Disk",
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_NOT_LOCKABLE ),
 
 #ifdef CONFIG_USB_STORAGE_KARMA
 UNUSUAL_DEV(  0x045a, 0x5210, 0x0101, 0x0101,
@@ -408,19 +408,19 @@ UNUSUAL_DEV(  0x04da, 0x2373, 0x, 0x,
 /* Most of the following entries were developed with the help of
  * Shuttle/SCM directly.
  */
-UNUSUAL_DEV(  0x04e6, 0x0001, 0x0200, 0x0200, 
+UNUSUAL_DEV(  0x04e6, 0x0001, 0x0200, 0x0200,
"Matshita",
"LS-120",
US_SC_8020, US_PR_CB, NULL, 0),
 
-UNUSUAL_DEV(  0x04e6, 0x0002, 0x0100, 0x0100, 
+UNUSUAL_DEV(  0x04e6, 0x0002, 0x0100, 0x0100,
"Shuttle",
"eUSCSI Bridge",
US_SC_DEVICE, US_PR_DEVICE, usb_stor_euscsi_init, 
-   US_FL_SCM_MULT_TARG ), 
+   US_FL_SCM_MULT_TARG ),
 
 #ifdef CONFIG_USB_STORAGE_SDDR09
-UNUSUAL_DEV(  0x04e6, 0x0003, 0x, 0x, 
+UNUSUAL_DEV(  0x04e6, 0x0003, 0x, 0x,
"Sandisk",
"ImageMate SDDR09",
US_SC_SCSI, US_PR_EUSB_SDDR09, usb_stor_sddr09_init,
@@ -431,52 +431,52 @@ UNUSUAL_DEV(  0x04e6, 0x0005, 0x0100, 0x0208,
"SCM Microsystems",
"eUSB SmartMedia / CompactFlash Adapter",
US_SC_SCSI, US_PR_DPCM_USB, usb_stor_sddr09_dpcm_init,
-   0), 
+   0),
 #endif
 
 /* Reported by Markus Demleitner <[EMAIL PROTECTED]> */
-UNUSUAL_DEV(  0x04e6, 0x0006, 0x0100, 0x0100, 
+UNU

USB: remove Makefile reference to obsolete OHCI_AT91

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a603c665516a3cb9df6abafad491bef24cc87aa5
Commit: a603c665516a3cb9df6abafad491bef24cc87aa5
Parent: 6dc731024347ab499c3fc0347ab90d972771b8a1
Author: Robert P. J. Day <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: remove Makefile reference to obsolete OHCI_AT91

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/Makefile |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index b33aae5..befff5f 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_USB_OHCI_HCD)+= host/
 obj-$(CONFIG_USB_UHCI_HCD) += host/
 obj-$(CONFIG_USB_SL811_HCD)+= host/
 obj-$(CONFIG_USB_U132_HCD) += host/
-obj-$(CONFIG_USB_OHCI_AT91)+= host/
 obj-$(CONFIG_USB_R8A66597_HCD) += host/
 
 obj-$(CONFIG_USB_ACM)  += class/
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: io_*: remove bogus termios no change checks

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6dc731024347ab499c3fc0347ab90d972771b8a1
Commit: 6dc731024347ab499c3fc0347ab90d972771b8a1
Parent: eb58c0c5f2b3cf6306a184cdf1c751155b7ddb3b
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:12 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: io_*: remove bogus termios no change checks

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/io_edgeport.c |9 -
 drivers/usb/serial/io_ti.c   |8 
 2 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index cebb32f..dd42f57 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1513,15 +1513,6 @@ static void edge_set_termios (struct usb_serial_port 
*port, struct ktermios *old
}
 
cflag = tty->termios->c_cflag;
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if (cflag == old_termios->c_cflag &&
-   tty->termios->c_iflag == old_termios->c_iflag) {
-   dbg("%s - nothing to change", __FUNCTION__);
-   return;
-   }
-   }
-
dbg("%s - clfag %08x iflag %08x", __FUNCTION__, 
tty->termios->c_cflag, tty->termios->c_iflag);
if (old_termios) {
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 1c6850a..0d39036 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2544,14 +2544,6 @@ static void edge_set_termios (struct usb_serial_port 
*port, struct ktermios *old
}
 
cflag = tty->termios->c_cflag;
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if (cflag == old_termios->c_cflag &&
-   tty->termios->c_iflag == old_termios->c_iflag) {
-   dbg ("%s - nothing to change", __FUNCTION__);
-   return;
-   }
-   }
 
dbg("%s - clfag %08x iflag %08x", __FUNCTION__, 
tty->termios->c_cflag, tty->termios->c_iflag);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: mos7720: remove bogus no termios change check

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb58c0c5f2b3cf6306a184cdf1c751155b7ddb3b
Commit: eb58c0c5f2b3cf6306a184cdf1c751155b7ddb3b
Parent: 9a64f251326154dcd40b21a6980fe2ab9537dde7
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:12 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: mos7720: remove bogus no termios change check

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mos7720.c |   10 --
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index da60c30..231b584 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1238,16 +1238,6 @@ static void mos7720_set_termios(struct usb_serial_port 
*port,
return;
}
 
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(tty->termios->c_iflag) ==
-RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("Nothing to change");
-   return;
-   }
-   }
-
dbg("%s - clfag %08x iflag %08x", __FUNCTION__,
tty->termios->c_cflag,
RELEVANT_IFLAG(tty->termios->c_iflag));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: visor and whiteheat: remove bogus termios change checks

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a64f251326154dcd40b21a6980fe2ab9537dde7
Commit: 9a64f251326154dcd40b21a6980fe2ab9537dde7
Parent: e0c79f512cf469bc11fe9d53a4dcc5d0c39a3b79
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:11 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: visor and whiteheat: remove bogus termios change checks

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/visor.c |8 
 drivers/usb/serial/whiteheat.c |9 -
 2 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index acd0eae..7d84a76 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -948,14 +948,6 @@ static void visor_set_termios (struct usb_serial_port 
*port, struct ktermios *ol
}
 
cflag = port->tty->termios->c_cflag;
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(port->tty->termios->c_iflag) == 
RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   return;
-   }
-   }
 
/* get the byte size */
switch (cflag & CSIZE) {
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 8611ee5..cc8b44c 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -891,15 +891,6 @@ static void whiteheat_set_termios(struct usb_serial_port 
*port, struct ktermios
goto exit;
}

-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((port->tty->termios->c_cflag == old_termios->c_cflag) &&
-   (port->tty->termios->c_iflag == old_termios->c_iflag)) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   goto exit;
-   }
-   }
-
firm_setup_port(port);
 
 exit:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate()

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0c79f512cf469bc11fe9d53a4dcc5d0c39a3b79
Commit: e0c79f512cf469bc11fe9d53a4dcc5d0c39a3b79
Parent: 31473aae5afb11f0c5217dafdbc9df8a470071aa
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:10 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: pl2303: remove bogus checks and fix speed support to use 
tty_get_baud_rate()

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/pl2303.c |   33 +
 1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 4348c1f..f9f85f5 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -484,15 +484,6 @@ static void pl2303_set_termios(struct usb_serial_port 
*port,
spin_unlock_irqrestore(&priv->lock, flags);
 
cflag = port->tty->termios->c_cflag;
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(port->tty->termios->c_iflag) ==
-RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   return;
-   }
-   }
 
buf = kzalloc(7, GFP_KERNEL);
if (!buf) {
@@ -517,29 +508,7 @@ static void pl2303_set_termios(struct usb_serial_port 
*port,
dbg("%s - data bits = %d", __FUNCTION__, buf[6]);
}
 
-   baud = 0;
-   switch (cflag & CBAUD) {
-   case B0:baud = 0;   break;
-   case B75:   baud = 75;  break;
-   case B150:  baud = 150; break;
-   case B300:  baud = 300; break;
-   case B600:  baud = 600; break;
-   case B1200: baud = 1200;break;
-   case B1800: baud = 1800;break;
-   case B2400: baud = 2400;break;
-   case B4800: baud = 4800;break;
-   case B9600: baud = 9600;break;
-   case B19200:baud = 19200;   break;
-   case B38400:baud = 38400;   break;
-   case B57600:baud = 57600;   break;
-   case B115200:   baud = 115200;  break;
-   case B230400:   baud = 230400;  break;
-   case B460800:   baud = 460800;  break;
-   default:
-   dev_err(&port->dev, "pl2303 driver does not support"
-   " the baudrate requested (fix it)\n");
-   break;
-   }
+   baud = tty_get_baud_rate(port->tty);;
dbg("%s - baud = %d", __FUNCTION__, baud);
if (baud) {
buf[0] = baud & 0xff;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: mos7840.c: turn this into a serial driver

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31473aae5afb11f0c5217dafdbc9df8a470071aa
Commit: 31473aae5afb11f0c5217dafdbc9df8a470071aa
Parent: 70f458f668aa09cc45384728dec434f2975a3947
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:10 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: mos7840.c: turn this into a serial driver

The MOS driver is "interesting", in a bad kind of 'how the hell did this
get merged' kind of way

- Remove the bogus termios change check
- Remove the duplicate code for half the ioctls
- Remove the supporting code to duplicate the ioctl code

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mos7840.c |   72 --
 1 files changed, 0 insertions(+), 72 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index a667882..37f41f5 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2189,16 +2189,6 @@ static void mos7840_set_termios(struct usb_serial_port 
*port,
return;
}
 
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(tty->termios->c_iflag) ==
-RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s\n", "Nothing to change");
-   return;
-   }
-   }
-
dbg("%s - clfag %08x iflag %08x", __FUNCTION__,
tty->termios->c_cflag, RELEVANT_IFLAG(tty->termios->c_iflag));
 
@@ -2258,30 +2248,6 @@ static int mos7840_get_lsr_info(struct moschip_port 
*mos7840_port,
 }
 
 /*
- * mos7840_get_bytes_avail - get number of bytes available
- *
- * Purpose: Let user call ioctl to get the count of number of bytes available.
- */
-
-static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port,
-  unsigned int __user *value)
-{
-   unsigned int result = 0;
-   struct tty_struct *tty = mos7840_port->port->tty;
-
-   if (!tty)
-   return -ENOIOCTLCMD;
-
-   result = tty->read_cnt;
-
-   dbg("%s(%d) = %d", __FUNCTION__, mos7840_port->port->number, result);
-   if (copy_to_user(value, &result, sizeof(int)))
-   return -EFAULT;
-
-   return -ENOIOCTLCMD;
-}
-
-/*
  * mos7840_set_modem_info
  *  function to set modem info
  */
@@ -2429,8 +2395,6 @@ static int mos7840_ioctl(struct usb_serial_port *port, 
struct file *file,
struct async_icount cprev;
struct serial_icounter_struct icount;
int mosret = 0;
-   int retval;
-   struct tty_ldisc *ld;
 
if (mos7840_port_paranoia_check(port, __FUNCTION__)) {
dbg("%s", "Invalid port \n");
@@ -2449,42 +2413,6 @@ static int mos7840_ioctl(struct usb_serial_port *port, 
struct file *file,
switch (cmd) {
/* return number of bytes available */
 
-   case TIOCINQ:
-   dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number);
-   return mos7840_get_bytes_avail(mos7840_port, argp);
-
-   case TIOCOUTQ:
-   dbg("%s (%d) TIOCOUTQ", __FUNCTION__, port->number);
-   return put_user(tty->driver->chars_in_buffer ?
-   tty->driver->chars_in_buffer(tty) : 0,
-   (int __user *)arg);
-
-   case TCFLSH:
-   retval = tty_check_change(tty);
-   if (retval)
-   return retval;
-
-   ld = tty_ldisc_ref(tty);
-   switch (arg) {
-   case TCIFLUSH:
-   if (ld && ld->flush_buffer)
-   ld->flush_buffer(tty);
-   break;
-   case TCIOFLUSH:
-   if (ld && ld->flush_buffer)
-   ld->flush_buffer(tty);
-   /* fall through */
-   case TCOFLUSH:
-   if (tty->driver->flush_buffer)
-   tty->driver->flush_buffer(tty);
-   break;
-   default:
-   tty_ldisc_deref(ld);
-   return -EINVAL;
-   }
-   tty_ldisc_deref(ld);
-   return 0;
-
case TIOCSERGETLSR:
dbg("%s (%d) TIOCSERGETLSR", _

USB: make the usb_device numa_node get assigned from controller

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70f458f668aa09cc45384728dec434f2975a3947
Commit: 70f458f668aa09cc45384728dec434f2975a3947
Parent: 0ffbbe25a73db12792a05f725aa39f8a5de2c882
Author: Yinghai Lu <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:09 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:41 2007 -0700

USB: make the usb_device numa_node get assigned from controller

So we can use dev_to_node(&usb_dev->dev) later in kmalloc_node to dma buffer

Signed-off-by: Yinghai Lu <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Acked-by: Christoph Lameter <[EMAIL PROTECTED]>
Cc: David Rientjes <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/usb.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 4a6299b..c611b3c 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -253,6 +253,7 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus 
*bus, unsigned port1)
dev->dev.bus = &usb_bus_type;
dev->dev.type = &usb_device_type;
dev->dev.dma_mask = bus->controller->dma_mask;
+   set_dev_node(&dev->dev, dev_to_node(bus->controller));
dev->state = USB_STATE_ATTACHED;
 
INIT_LIST_HEAD(&dev->ep0.urb_list);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: ftdi_sio: fix oops due to processing workarounds too early

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ffbbe25a73db12792a05f725aa39f8a5de2c882
Commit: 0ffbbe25a73db12792a05f725aa39f8a5de2c882
Parent: a69228deefea57ca27c17a196e5727b091c6d323
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:08 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: ftdi_sio: fix oops due to processing workarounds too early

Fix an oops that happens in relation with applying work arounds for buggy
ftdi_sio devices.  The quirks were handled too early because due to changes 
in
the initialisation of usb serial devices the device was not fully 
initialised
when the old hook was called.

Addresses bug 8564

Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ftdi_sio.c |  104 +---
 1 files changed, 44 insertions(+), 60 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4066a46..7b1673a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -271,26 +271,58 @@ static int debug;
 static __u16 vendor = FTDI_VID;
 static __u16 product;
 
+struct ftdi_private {
+   ftdi_chip_type_t chip_type;
+   /* type of the device, either SIO or FT8U232AM 
*/
+   int baud_base;  /* baud base clock for divisor setting */
+   int custom_divisor; /* custom_divisor kludge, this is for baud_base 
(different from what goes to the chip!) */
+   __u16 last_set_data_urb_value ;
+   /* the last data state set - needed for doing a 
break */
+int write_offset;   /* This is the offset in the usb data block to 
write the serial data -
+* it is different between devices
+*/
+   int flags;  /* some ASYNC_ flags are supported */
+   unsigned long last_dtr_rts; /* saved modem control outputs */
+wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
+   char prev_status, diff_status;/* Used for TIOCMIWAIT */
+   __u8 rx_flags;  /* receive state flags (throttling) */
+   spinlock_t rx_lock; /* spinlock for receive state */
+   struct delayed_work rx_work;
+   struct usb_serial_port *port;
+   int rx_processed;
+   unsigned long rx_bytes;
+
+   __u16 interface;/* FT2232C port interface (0 for FT232/245) */
+
+   int force_baud; /* if non-zero, force the baud rate to this 
value */
+   int force_rtscts;   /* if non-zero, force RTS-CTS to always be 
enabled */
+
+   spinlock_t tx_lock; /* spinlock for transmit state */
+   unsigned long tx_bytes;
+   unsigned long tx_outstanding_bytes;
+   unsigned long tx_outstanding_urbs;
+};
+
 /* struct ftdi_sio_quirk is used by devices requiring special attention. */
 struct ftdi_sio_quirk {
int (*probe)(struct usb_serial *);
-   void (*setup)(struct usb_serial *); /* Special settings during startup. 
*/
+   void (*port_probe)(struct ftdi_private *); /* Special settings for 
probed ports. */
 };
 
 static int   ftdi_olimex_probe (struct usb_serial *serial);
-static void  ftdi_USB_UIRT_setup   (struct usb_serial *serial);
-static void  ftdi_HE_TIRA1_setup   (struct usb_serial *serial);
+static void  ftdi_USB_UIRT_setup   (struct ftdi_private *priv);
+static void  ftdi_HE_TIRA1_setup   (struct ftdi_private *priv);
 
 static struct ftdi_sio_quirk ftdi_olimex_quirk = {
.probe  = ftdi_olimex_probe,
 };
 
 static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
-   .setup = ftdi_USB_UIRT_setup,
+   .port_probe = ftdi_USB_UIRT_setup,
 };
 
 static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
-   .setup = ftdi_HE_TIRA1_setup,
+   .port_probe = ftdi_HE_TIRA1_setup,
 };
 
 /*
@@ -567,38 +599,6 @@ static const char *ftdi_chip_name[] = {
 #define THROTTLED  0x01
 #define ACTUALLY_THROTTLED 0x02
 
-struct ftdi_private {
-   ftdi_chip_type_t chip_type;
-   /* type of the device, either SIO or FT8U232AM 
*/
-   int baud_base;  /* baud base clock for divisor setting */
-   int custom_divisor; /* custom_divisor kludge, this is for baud_base 
(different from what goes to the chip!) */
-   __u16 last_set_data_urb_value ;
-   /* the last data state set - needed for doing a 
break */
-int write_offset;   /* This is the offset in the usb data block to 
write the serial data -
-* it is different between devices
-*/
-   int flags;  /* some ASYNC_ flags are supported */
-   uns

USB: drivers/block/ub.c: use list_for_each_entry()

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a69228deefea57ca27c17a196e5727b091c6d323
Commit: a69228deefea57ca27c17a196e5727b091c6d323
Parent: acb11c8b8020f1f1b2545152020675ef32d09a58
Author: Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:07 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: drivers/block/ub.c: use list_for_each_entry()

Low performance USB storage driver: Use list_for_each_entry() instead
of list_for_each()

Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
Cc: Pete Zaitcev <[EMAIL PROTECTED]>
Cc: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/block/ub.c |   12 +++-
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 746a118..18c8b6c 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -1547,10 +1547,8 @@ static void ub_reset_enter(struct ub_dev *sc, int try)
 #endif
 
 #if 0 /* We let them stop themselves. */
-   struct list_head *p;
struct ub_lun *lun;
-   list_for_each(p, &sc->luns) {
-   lun = list_entry(p, struct ub_lun, link);
+   list_for_each_entry(lun, &sc->luns, link) {
blk_stop_queue(lun->disk->queue);
}
 #endif
@@ -1562,7 +1560,6 @@ static void ub_reset_task(struct work_struct *work)
 {
struct ub_dev *sc = container_of(work, struct ub_dev, reset_work);
unsigned long flags;
-   struct list_head *p;
struct ub_lun *lun;
int lkr, rc;
 
@@ -1608,8 +1605,7 @@ static void ub_reset_task(struct work_struct *work)
spin_lock_irqsave(sc->lock, flags);
sc->reset = 0;
tasklet_schedule(&sc->tasklet);
-   list_for_each(p, &sc->luns) {
-   lun = list_entry(p, struct ub_lun, link);
+   list_for_each_entry(lun, &sc->luns, link) {
blk_start_queue(lun->disk->queue);
}
wake_up(&sc->reset_wait);
@@ -2348,7 +2344,6 @@ err_alloc:
 static void ub_disconnect(struct usb_interface *intf)
 {
struct ub_dev *sc = usb_get_intfdata(intf);
-   struct list_head *p;
struct ub_lun *lun;
unsigned long flags;
 
@@ -2403,8 +2398,7 @@ static void ub_disconnect(struct usb_interface *intf)
/*
 * Unregister the upper layer.
 */
-   list_for_each (p, &sc->luns) {
-   lun = list_entry(p, struct ub_lun, link);
+   list_for_each_entry(lun, &sc->luns, link) {
del_gendisk(lun->disk);
/*
 * I wish I could do:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Make usb-autosuspend timer 1 sec jiffy aligned

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d6d5fd05088c023bb8b22a4bd0067c21f9c5f18
Commit: 8d6d5fd05088c023bb8b22a4bd0067c21f9c5f18
Parent: 8e80e753ea654ae0a66b33e404c0a517b34cb6e1
Author: Venki Pallipadi <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:06 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: Make usb-autosuspend timer 1 sec jiffy aligned

Make usb autosuspend timers 1sec jiffy aligned.

This helps to reduce the frequency at which the CPU must be taken out of a
lower-power state.

Signed-off-by: Venkatesh Pallipadi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/driver.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index a3aed8d..73c4936 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1010,7 +1010,7 @@ static int autosuspend_check(struct usb_device *udev)
 * or for the past.
 */
queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend,
-   suspend_time - jiffies);
+   round_jiffies_relative(suspend_time - jiffies));
}
return -EAGAIN;
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: fix gregkh-usb-usb-use-menuconfig-objects

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=acb11c8b8020f1f1b2545152020675ef32d09a58
Commit: acb11c8b8020f1f1b2545152020675ef32d09a58
Parent: 8d6d5fd05088c023bb8b22a4bd0067c21f9c5f18
Author: Jan Engelhardt <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:06 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: fix gregkh-usb-usb-use-menuconfig-objects

Generally, Jens Axboe was against 'default y', so I'll have some patches to
remove it.

Cc: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/Kconfig |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 071b967..172a606 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -5,7 +5,6 @@
 menuconfig USB_SUPPORT
bool "USB support"
depends on HAS_IOMEM
-   default y
 
 if USB_SUPPORT
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Don't autosuspend Blackberry devices.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8e80e753ea654ae0a66b33e404c0a517b34cb6e1
Commit: 8e80e753ea654ae0a66b33e404c0a517b34cb6e1
Parent: 49bb607fa0bd94e4855ee695f9ed3ecee7579cc6
Author: Jeremy Katz <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 19 17:16:10 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: Don't autosuspend Blackberry devices.

Blackberry devices charge over USB.  By autosuspending the port, they are
not able to charge reliably.

Signed-off-by: Jeremy Katz <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/quirks.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index f37fa01..1cfc87b 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -38,6 +38,11 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Philips PSC805 audio device */
{ USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
 
+   /* RIM Blackberry */
+   { USB_DEVICE(0x0fca, 0x0001), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+   { USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+
{ }  /* terminating entry must be last */
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Support Blackberry Pearl with berry_charge

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49bb607fa0bd94e4855ee695f9ed3ecee7579cc6
Commit: 49bb607fa0bd94e4855ee695f9ed3ecee7579cc6
Parent: 165fe97ed6107d3cde63592d5ac36400a5eb9f6f
Author: Jeremy Katz <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 19 17:15:38 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: Support Blackberry Pearl with berry_charge

The Blackberry Pearl (8100) needs similar tweaks as older Blackberry models
to be able to charge when connected via USB.  The Pearl also adds an
additional need to go into a separate mode for fully accessing the device;
do that by default as well.

Changes based on the changes from bcharge in the barry project
(http://barry.sf.net)

Signed-off-by: Jeremy Katz <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/misc/berry_charge.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c
index b15f2fd..92c1d27 100644
--- a/drivers/usb/misc/berry_charge.c
+++ b/drivers/usb/misc/berry_charge.c
@@ -26,8 +26,11 @@
 
 #define RIM_VENDOR 0x0fca
 #define BLACKBERRY 0x0001
+#define BLACKBERRY_PEARL_DUAL   0x0004
+#define BLACKBERRY_PEARL0x0006
 
 static int debug;
+static int pearl_dual_mode = 1;
 
 #ifdef dbg
 #undef dbg
@@ -38,6 +41,8 @@ static int debug;
 
 static struct usb_device_id id_table [] = {
{ USB_DEVICE(RIM_VENDOR, BLACKBERRY) },
+   { USB_DEVICE(RIM_VENDOR, BLACKBERRY_PEARL) },
+   { USB_DEVICE(RIM_VENDOR, BLACKBERRY_PEARL_DUAL) },
{ },/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, id_table);
@@ -86,6 +91,30 @@ static int magic_charge(struct usb_device *udev)
return retval;
 }
 
+static int magic_dual_mode(struct usb_device *udev)
+{
+   char *dummy_buffer = kzalloc(2, GFP_KERNEL);
+   int retval;
+
+   if (!dummy_buffer)
+   return -ENOMEM;
+
+   /* send magic command so that the Blackberry Pearl device exposes
+* two interfaces: both the USB mass-storage one and one which can
+* be used for database access. */
+   dbg(&udev->dev, "Sending magic pearl command\n");
+   retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+0xa9, 0xc0, 1, 1, dummy_buffer, 2, 100);
+   dbg(&udev->dev, "Magic pearl command returned %d\n", retval);
+
+   dbg(&udev->dev, "Calling set_configuration\n");
+   retval = usb_driver_set_configuration(udev, 1);
+   if (retval)
+   dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
+
+   return retval;
+}
+
 static int berry_probe(struct usb_interface *intf,
   const struct usb_device_id *id)
 {
@@ -105,6 +134,10 @@ static int berry_probe(struct usb_interface *intf,
/* turn the power on */
magic_charge(udev);
 
+   if ((le16_to_cpu(udev->descriptor.idProduct) == BLACKBERRY_PEARL) &&
+   (pearl_dual_mode))
+   magic_dual_mode(udev);
+
/* we don't really want to bind to the device, userspace programs can
 * handle the syncing just fine, so get outta here. */
return -ENODEV;
@@ -138,3 +171,5 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Greg Kroah-Hartman <[EMAIL PROTECTED]>");
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
+module_param(pearl_dual_mode, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(pearl_dual_mode, "Change Blackberry Pearl to run in dual 
mode");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: add IAD support to usbfs and sysfs

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=165fe97ed6107d3cde63592d5ac36400a5eb9f6f
Commit: 165fe97ed6107d3cde63592d5ac36400a5eb9f6f
Parent: 50d2dc7266573dfbdc84fc207494dd21315782ef
Author: Craig W. Nadler <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 23:14:35 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: add IAD support to usbfs and sysfs

USB_IAD: Adds support for USB Interface Association Descriptors.

This patch adds support to the USB host stack for parsing, storing, and
displaying Interface Association Descriptors. In /proc/bus/usb/devices
lines starting with A: show the fields in an IAD. In sysfs if an
interface on a USB device is referenced by an IAD the following files
will be added to the sysfs directory for that interface:
iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and
iad_bFunctionSubClass, iad_bFunctionProtocol

Signed-off-by: Craig W. Nadler <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/config.c  |   15 +++
 drivers/usb/core/devices.c |   26 ++
 drivers/usb/core/message.c |   31 +++
 drivers/usb/core/sysfs.c   |   34 ++
 include/linux/usb.h|   10 ++
 5 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 5e113db..cb69aa1 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -295,6 +295,7 @@ static int usb_parse_configuration(struct device *ddev, int 
cfgidx,
struct usb_descriptor_header *header;
int len, retval;
u8 inums[USB_MAXINTERFACES], nalts[USB_MAXINTERFACES];
+   unsigned iad_num = 0;
 
memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
if (config->desc.bDescriptorType != USB_DT_CONFIG ||
@@ -372,6 +373,20 @@ static int usb_parse_configuration(struct device *ddev, 
int cfgidx,
++n;
}
 
+   } else if (header->bDescriptorType ==
+   USB_DT_INTERFACE_ASSOCIATION) {
+   if (iad_num == USB_MAXIADS) {
+   dev_warn(ddev, "found more Interface "
+  "Association Descriptors "
+  "than allocated for in "
+  "configuration %d\n", cfgno);
+   } else {
+   config->intf_assoc[iad_num] =
+   (struct usb_interface_assoc_descriptor
+   *)header;
+   iad_num++;
+   }
+
} else if (header->bDescriptorType == USB_DT_DEVICE ||
header->bDescriptorType == USB_DT_CONFIG)
dev_warn(ddev, "config %d contains an unexpected "
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 6753ca0..87c794d 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -102,6 +102,10 @@ static const char *format_config =
 /* C:  #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA */
   "C:%c #Ifs=%2d Cfg#=%2d Atr=%02x MxPwr=%3dmA\n";
   
+static const char *format_iad =
+/* A:  FirstIf#=dd IfCount=dd Cls=xx(s) Sub=xx Prot=xx */
+  "A:  FirstIf#=%2d IfCount=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x\n";
+
 static const char *format_iface =
 /* I:  If#=dd Alt=dd #EPs=dd Cls=xx(s) Sub=xx Prot=xx Driver=*/
   "I:%c If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x 
Driver=%s\n";
@@ -146,6 +150,7 @@ static const struct class_info clas_info[] =
{USB_CLASS_STILL_IMAGE, "still"},
{USB_CLASS_CSCID,   "scard"},
{USB_CLASS_CONTENT_SEC, "c-sec"},
+   {USB_CLASS_VIDEO,   "video"},
{-1,"unk."} /* leave as last */
 };
 
@@ -286,6 +291,21 @@ static char *usb_dump_interface(
return start;
 }
 
+static char *usb_dump_iad_descriptor(char *start, char *end,
+   const struct usb_interface_assoc_descriptor *iad)
+{
+   if (start > end)
+   return start;
+   start += sprintf(start, format_iad,
+iad->bFirstInterface,
+iad->bInterfaceCount,
+iad->bFunctionClass,
+class_decode(iad->bFunctionClass),
+iad->bFunctionSubClass,
+iad->bFunctionProtocol);
+   return start;
+}
+
 /* TBD:
  * 0. TBDs
  * 1. marking active interface altsettings (code lists all, but should mark
@@ -322,6 +342,12 @@ static char *usb_dump_config (
if (!config) 

USB: mos7720: change developer email addresses

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50d2dc7266573dfbdc84fc207494dd21315782ef
Commit: 50d2dc7266573dfbdc84fc207494dd21315782ef
Parent: 8ccef0df54642f0f72f922d8aa57e8b290e31671
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 25 01:08:01 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:40 2007 -0700

USB: mos7720: change developer email addresses

Update the original developer's email addresses at their request.


Cc: Vijaya Kumar <[EMAIL PROTECTED]>
Cc: Ajay Kumar <[EMAIL PROTECTED]>
Cc: Gurudeva <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mos7720.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 5a4c33c..da60c30 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -9,9 +9,9 @@
  * the Free Software Foundation, version 2 of the License.
  *
  * Developed by:
- * VijayaKumar.G.N. <[EMAIL PROTECTED]>
- * AjayKumar <[EMAIL PROTECTED]>
- * Gurudeva.N. <[EMAIL PROTECTED]>
+ * Vijaya Kumar <[EMAIL PROTECTED]>
+ * Ajay Kumar <[EMAIL PROTECTED]>
+ * Gurudeva <[EMAIL PROTECTED]>
  *
  * Cleaned up from the original by:
  * Greg Kroah-Hartman <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Fix off-by-1 error in the scatter-gather library

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ccef0df54642f0f72f922d8aa57e8b290e31671
Commit: 8ccef0df54642f0f72f922d8aa57e8b290e31671
Parent: cfa59dab27d1b282886e7772a8f9548236883892
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 21 16:26:46 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:39 2007 -0700

USB: Fix off-by-1 error in the scatter-gather library

The loop in usb_sg_wait() is structured in a way that makes it hard to
tell, when the loop exits, whether or not the last URB submission
succeeded.  This patch (as928) changes it from a "for" loop to a
"while" loop and keeps "i" always equal to the number of successful
submissions.  This fixes an off-by-one error which can show up when
the first URB submission fails.

The patch also removes a couple of lines that initialize fields which
don't need to be initialized.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/message.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index f9fed34..4c14323 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -404,8 +404,6 @@ int usb_sg_init (
 
io->urbs [i]->complete = sg_complete;
io->urbs [i]->context = io;
-   io->urbs [i]->status = -EINPROGRESS;
-   io->urbs [i]->actual_length = 0;
 
/*
 * Some systems need to revert to PIO when DMA is temporarily
@@ -499,7 +497,8 @@ void usb_sg_wait (struct usb_sg_request *io)
 
/* queue the urbs.  */
spin_lock_irq (&io->lock);
-   for (i = 0; i < entries && !io->status; i++) {
+   i = 0;
+   while (i < entries && !io->status) {
int retval;
 
io->urbs [i]->dev = io->dev;
@@ -516,7 +515,6 @@ void usb_sg_wait (struct usb_sg_request *io)
case -ENOMEM:
io->urbs[i]->dev = NULL;
retval = 0;
-   i--;
yield ();
break;
 
@@ -527,6 +525,7 @@ void usb_sg_wait (struct usb_sg_request *io)
 * URBs are queued at once; N milliseconds?
 */
case 0:
+   ++i;
cpu_relax ();
break;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Don't resume root hub if the controller is suspended

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfa59dab27d1b282886e7772a8f9548236883892
Commit: cfa59dab27d1b282886e7772a8f9548236883892
Parent: e7e6da9eb189dfa221e3bf9c21d58f02adc8983c
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 21 16:25:35 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:39 2007 -0700

USB: Don't resume root hub if the controller is suspended

Root hubs can't be resumed if their parent controller device is still
suspended.  This patch (as925) adds a check for that condition in
hcd_bus_resume() and prevents it from being treated as a fatal
controller failure.

ehci-hcd is updated to add the corresponding test.  Unnecessary
debugging messages are removed from uhci-hcd and dummy-hcd.  The
error return code from dummy-hcd is changed to -ESHUTDOWN, the same as
the others.  ohci-hcd doesn't need any changes.

Suspend handling in the non-PCI host drivers is somewhat hit-and-miss.
This patch shouldn't have any effect on them.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/hcd.c |5 -
 drivers/usb/gadget/dummy_hcd.c |3 +--
 drivers/usb/host/ehci-hub.c|4 
 drivers/usb/host/uhci-hcd.c|5 ++---
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 5254c50..963520f 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1291,6 +1291,7 @@ int hcd_bus_resume(struct usb_device *rhdev)
 {
struct usb_hcd  *hcd = container_of(rhdev->bus, struct usb_hcd, self);
int status;
+   int old_state = hcd->state;
 
dev_dbg(&rhdev->dev, "usb %s%s\n",
rhdev->auto_pm ? "auto-" : "", "resume");
@@ -1309,9 +1310,11 @@ int hcd_bus_resume(struct usb_device *rhdev)
: USB_STATE_ADDRESS);
hcd->state = HC_STATE_RUNNING;
} else {
+   hcd->state = old_state;
dev_dbg(&rhdev->dev, "bus %s fail, err %d\n",
"resume", status);
-   usb_hc_died(hcd);
+   if (status != -ESHUTDOWN)
+   usb_hc_died(hcd);
}
return status;
 }
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index fcb5526..9040b50 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1784,8 +1784,7 @@ static int dummy_bus_resume (struct usb_hcd *hcd)
 
spin_lock_irq (&dum->lock);
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
-   dev_warn (&hcd->self.root_hub->dev, "HC isn't running!\n");
-   rc = -ENODEV;
+   rc = -ESHUTDOWN;
} else {
dum->rh_state = DUMMY_RH_RUNNING;
set_link_state (dum);
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 71aeca0..0dcb416 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -199,6 +199,10 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
if (time_before (jiffies, ehci->next_statechange))
msleep(5);
spin_lock_irq (&ehci->lock);
+   if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+   spin_unlock_irq(&ehci->lock);
+   return -ESHUTDOWN;
+   }
 
/* Ideally and we've got a real resume here, and no port's power
 * was lost.  (For PCI, that means Vaux was maintained.)  But we
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index d22da26..76c555a 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -730,10 +730,9 @@ static int uhci_rh_resume(struct usb_hcd *hcd)
int rc = 0;
 
spin_lock_irq(&uhci->lock);
-   if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
-   dev_warn(&hcd->self.root_hub->dev, "HC isn't running!\n");
+   if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
rc = -ESHUTDOWN;
-   } else if (!uhci->dead)
+   else if (!uhci->dead)
wakeup_rh(uhci);
spin_unlock_irq(&uhci->lock);
return rc;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Remove usages of dev->power.power_state

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7e6da9eb189dfa221e3bf9c21d58f02adc8983c
Commit: e7e6da9eb189dfa221e3bf9c21d58f02adc8983c
Parent: 317c67b8f7092db325a3df825646eb26982908c6
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 21 16:25:17 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:39 2007 -0700

USB: Remove usages of dev->power.power_state

This patch (as922) removes all but one of the remaining vestiges of
dev->power.power_state from usbcore.  The only usage left must remain
until the deprecated "power/state" sysfs attribute is gone.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/driver.c |6 +-
 drivers/usb/core/hcd.c|   10 --
 2 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 3cd9af2..a3aed8d 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1196,11 +1196,7 @@ static int usb_resume_both(struct usb_device *udev)
/* We can't progagate beyond the USB subsystem,
 * so if a root hub's controller is suspended
 * then we're stuck. */
-   if (udev->dev.parent->power.power_state.event !=
-   PM_EVENT_ON)
-   status = -EHOSTUNREACH;
-   else
-   status = usb_resume_device(udev);
+   status = usb_resume_device(udev);
}
} else {
 
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 3df5385..5254c50 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -965,19 +965,9 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
else switch (hcd->state) {
case HC_STATE_RUNNING:
case HC_STATE_RESUMING:
-doit:
list_add_tail (&urb->urb_list, &ep->urb_list);
status = 0;
break;
-   case HC_STATE_SUSPENDED:
-   /* HC upstream links (register access, wakeup signaling) can 
work
-* even when the downstream links (and DMA etc) are quiesced; 
let
-* usbcore talk to the root hub.
-*/
-   if (hcd->self.controller->power.power_state.event == PM_EVENT_ON
-   && urb->dev->parent == NULL)
-   goto doit;
-   /* FALL THROUGH */
default:
status = -ESHUTDOWN;
break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usblp: add dynamic URBs, fix races

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=317c67b8f7092db325a3df825646eb26982908c6
Commit: 317c67b8f7092db325a3df825646eb26982908c6
Parent: 73e4fb3f70987b36fd0f16b5f762b2018ab84e4f
Author: Pete Zaitcev <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 21 12:44:56 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:39 2007 -0700

USB: usblp: add dynamic URBs, fix races

This patch's main bulk aims to make usblp the premier driver for code
pillaging once again. The code is as streamlined as possible and is bug-free
as possible. The usb-skeleton performs the same function, but is somewhat
abstract. The usblp is usb-skeleton which is actually used by many.

Since I combed a few small bugs away, this also fixes the small races we
had in usblp for a while. For example, now it's possible for several threads
to make write(2) calls (sounds silly, but consider a printer for paper
record, where every line of text is self-contained and thus it's all right
to have them interleaved). Also gone are issues with interrupts using
barriers dangerously.

This patch makes use of Oliver's anchor, and so it must trail the anchor
patch on the way to Linus.

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/class/usblp.c |  618 +++--
 1 files changed, 376 insertions(+), 242 deletions(-)

diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 6778f9a..9a14789 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1,5 +1,5 @@
 /*
- * usblp.c  Version 0.13
+ * usblp.c
  *
  * Copyright (c) 1999 Michael Gee  <[EMAIL PROTECTED]>
  * Copyright (c) 1999 Pavel Machek <[EMAIL PROTECTED]>
@@ -61,11 +61,11 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.13"
 #define DRIVER_AUTHOR "Michael Gee, Pavel Machek, Vojtech Pavlik, Randy 
Dunlap, Pete Zaitcev, David Paschal"
 #define DRIVER_DESC "USB Printer Device Class driver"
 
 #define USBLP_BUF_SIZE 8192
+#define USBLP_BUF_SIZE_IN  1024
 #define USBLP_DEVICE_ID_SIZE   1024
 
 /* ioctls: */
@@ -127,14 +127,22 @@ MFG:HEWLETT-PACKARD;MDL:DESKJET 
970C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:H
  */
 #define STATUS_BUF_SIZE8
 
+/*
+ * Locks down the locking order:
+ * ->wmut locks wstatus.
+ * ->mut locks the whole usblp, except [rw]complete, and thus, by indirection,
+ * [rw]status. We only touch status when we know the side idle.
+ * ->lock locks what interrupt accesses.
+ */
 struct usblp {
struct usb_device   *dev;   /* USB device */
-   struct mutexmut;/* locks this struct, 
especially "dev" */
-   char*writebuf;  /* write 
transfer_buffer */
+   struct mutexwmut;
+   struct mutexmut;
+   spinlock_t  lock;   /* locks rcomplete, wcomplete */
char*readbuf;   /* read transfer_buffer 
*/
char*statusbuf; /* status 
transfer_buffer */
-   struct urb  *readurb, *writeurb;/* The urbs */
-   wait_queue_head_t   wait;   /* Z ... */
+   struct usb_anchor   urbs;
+   wait_queue_head_t   rwait, wwait;
int readcount;  /* Counter for reads */
int ifnum;  /* Interface number */
struct usb_interface*intf;  /* The interface */
@@ -147,8 +155,9 @@ struct usblp {
}   protocol[USBLP_MAX_PROTOCOLS];
int current_protocol;
int minor;  /* minor number of 
device */
-   int wcomplete;  /* writing is completed 
*/
-   int rcomplete;  /* reading is completed 
*/
+   int wcomplete, rcomplete;
+   int wstatus;/* bytes written or error */
+   int rstatus;/* bytes ready or error */
unsigned intquirks; /* quirks flags */
unsigned char   used;   /* True if open */
unsigned char   present;/* True if not 
disconnected */
@@ -166,9 +175,6 @@ static void usblp_dump(struct usblp *usblp) {
dbg("dev=0x%p", usblp->dev);
dbg("present=%d", usblp->present);
dbg("readbuf=0x%p", usblp->readbuf);
-   dbg("writebuf=0x%p", usblp->writebuf);
-   dbg("readurb=0x%p", usblp->readurb);
-   dbg("writeurb=0x%p", usblp->writeurb);
dbg("readcount=%d", usblp->readcount);
dbg("ifnum=%d

USB: Pete's taking over usblp

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73e4fb3f70987b36fd0f16b5f762b2018ab84e4f
Commit: 73e4fb3f70987b36fd0f16b5f762b2018ab84e4f
Parent: 7542548fd843f3d49068f17a082069319f19992a
Author: Pete Zaitcev <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 21 15:18:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:38 2007 -0700

USB: Pete's taking over usblp

Vojtech agreed to pass usblp over to me, so if you find bugs don't bug him.

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
Signed-off-by: Vojtech Pavlik <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 MAINTAINERS |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 228a45b..83e9195 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3723,12 +3723,12 @@ L:  [EMAIL PROTECTED]
 W: http://pegasus2.sourceforge.net/
 S: Maintained
 
-USB PRINTER DRIVER
-P: Vojtech Pavlik
-M: [EMAIL PROTECTED]
+USB PRINTER DRIVER (usblp)
+P: Pete Zaitcev
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
-S: Maintained
+S: Supported
 
 USB RTL8150 DRIVER
 P: Petko Manolov
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


usb gadget: Rename husb2dev -> usba

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55b3fd41b0846929f68b5fb1058ad8077289f584
Commit: 55b3fd41b0846929f68b5fb1058ad8077289f584
Parent: 8b3b01c898a44c2fc7217eb579982b9d132113f5
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 14 18:01:45 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:38 2007 -0700

usb gadget: Rename husb2dev -> usba

husb2dev was the internal name of the USB Device Controller on
AT32AP7000. Rename it to "atmel_usba", which is closer to the official
name used in documentation and marketing material.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/ether.c|2 +-
 drivers/usb/gadget/gadget_chips.h |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 78e2402..dbaf867 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -277,7 +277,7 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
 #define DEV_CONFIG_CDC
 #endif
 
-#ifdef CONFIG_USB_GADGET_HUSB2DEV
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
 #define DEV_CONFIG_CDC
 #endif
 
diff --git a/drivers/usb/gadget/gadget_chips.h 
b/drivers/usb/gadget/gadget_chips.h
index 9c84b38..53e9139 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -82,10 +82,10 @@
 #definegadget_is_pxa27x(g) 0
 #endif
 
-#ifdef CONFIG_USB_GADGET_HUSB2DEV
-#define gadget_is_husb2dev(g)  !strcmp("husb2_udc", (g)->name)
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+#define gadget_is_atmel_usba(g)!strcmp("atmel_usba_udc", (g)->name)
 #else
-#define gadget_is_husb2dev(g)  0
+#define gadget_is_atmel_usba(g)0
 #endif
 
 #ifdef CONFIG_USB_GADGET_S3C2410
@@ -198,7 +198,7 @@ static inline int usb_gadget_controller_number(struct 
usb_gadget *gadget)
return 0x16;
else if (gadget_is_mpc8272(gadget))
return 0x17;
-   else if (gadget_is_husb2dev(gadget))
+   else if (gadget_is_atmel_usba(gadget))
return 0x18;
else if (gadget_is_fsl_usb2(gadget))
return 0x19;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: autosuspend for usblcd

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7bbe990c989ee16f2c1be3e4ae28f8004bec788c
Commit: 7bbe990c989ee16f2c1be3e4ae28f8004bec788c
Parent: 55b3fd41b0846929f68b5fb1058ad8077289f584
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 13 17:13:31 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:38 2007 -0700

USB: autosuspend for usblcd

this patch implements autosuspend for the usblcd driver. It uses
the new usb_anchor infrastructure. Many thanks to Georges for testing.

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Cc: Georges Toth <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/misc/usblcd.c |   46 ++--
 1 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 6e093c2..504f722 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -45,6 +45,7 @@ struct usb_lcd {
struct kref kref;
struct semaphorelimit_sem;  /* to stop writes at 
full throttle from
 * using up all RAM */
+   struct usb_anchor   submitted;  /* URBs to wait for 
before suspend */
 };
 #define to_lcd_dev(d) container_of(d, struct usb_lcd, kref)
 
@@ -67,7 +68,7 @@ static int lcd_open(struct inode *inode, struct file *file)
 {
struct usb_lcd *dev;
struct usb_interface *interface;
-   int subminor;
+   int subminor, r;
 
subminor = iminor(inode);
 
@@ -85,6 +86,13 @@ static int lcd_open(struct inode *inode, struct file *file)
/* increment our usage count for the device */
kref_get(&dev->kref);
 
+   /* grab a power reference */
+   r = usb_autopm_get_interface(interface);
+   if (r < 0) {
+   kref_put(&dev->kref, lcd_delete);
+   return r;
+   }
+
/* save our object in the file's private structure */
file->private_data = dev;
 
@@ -100,6 +108,7 @@ static int lcd_release(struct inode *inode, struct file 
*file)
return -ENODEV;
 
/* decrement the count on our device */
+   usb_autopm_put_interface(dev->interface);
kref_put(&dev->kref, lcd_delete);
return 0;
 }
@@ -225,12 +234,14 @@ static ssize_t lcd_write(struct file *file, const char 
__user * user_buffer, siz
  usb_sndbulkpipe(dev->udev, 
dev->bulk_out_endpointAddr),
  buf, count, lcd_write_bulk_callback, dev);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+   usb_anchor_urb(urb, &dev->submitted);

/* send the data out the bulk port */
retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) {
err("USBLCD: %s - failed submitting write urb, error %d", 
__FUNCTION__, retval);
-   goto error;
+   goto error_unanchor;
}

/* release our reference to this urb, the USB core will eventually free 
it entirely */
@@ -238,7 +249,8 @@ static ssize_t lcd_write(struct file *file, const char 
__user * user_buffer, siz
 
 exit:
return count;
-
+error_unanchor:
+   usb_unanchor_urb(urb);
 error:
usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
usb_free_urb(urb);
@@ -283,6 +295,7 @@ static int lcd_probe(struct usb_interface *interface, const 
struct usb_device_id
}
kref_init(&dev->kref);
sema_init(&dev->limit_sem, USB_LCD_CONCURRENT_WRITES);
+   init_usb_anchor(&dev->submitted);
 
dev->udev = usb_get_dev(interface_to_usbdev(interface));
dev->interface = interface;
@@ -350,6 +363,30 @@ error:
return retval;
 }
 
+static void lcd_draw_down(struct usb_lcd *dev)
+{
+   int time;
+
+   time = usb_wait_anchor_empty_timeout(&dev->submitted, 1000);
+   if (!time)
+   usb_kill_anchored_urbs(&dev->submitted);
+}
+
+static int lcd_suspend(struct usb_interface *intf, pm_message_t message)
+{
+   struct usb_lcd *dev = usb_get_intfdata(intf);
+
+   if (!dev)
+   return 0;
+   lcd_draw_down(dev);
+   return 0;
+}
+
+static int lcd_resume (struct usb_interface *intf)
+{
+   return 0;
+}
+
 static void lcd_disconnect(struct usb_interface *interface)
 {
struct usb_lcd *dev;
@@ -371,7 +408,10 @@ static struct usb_driver lcd_driver = {
.name = "usblcd",
.probe =lcd_probe,
.disconnect =   lcd_disconnect,
+   .suspend =  lcd_suspend,
+   .resume =   lcd_resume,
.id_table = id_table,
+   .supports_autosuspend = 1,
 };
 
 static int __init usb_lcd_init(void)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]

USB: fsl_usb2_udc: fix bug for portsc bit masking

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7542548fd843f3d49068f17a082069319f19992a
Commit: 7542548fd843f3d49068f17a082069319f19992a
Parent: 7bbe990c989ee16f2c1be3e4ae28f8004bec788c
Author: Li Yang <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 19 17:33:48 2007 +0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:38 2007 -0700

USB: fsl_usb2_udc: fix bug for portsc bit masking

Fix a bug that PORT_TYPE and PORT_WIDTH aren't masked correctly in portsc.

Signed-off-by: Christopher Cason <[EMAIL PROTECTED]>
Signed-off-by: Li Yang <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/fsl_usb2_udc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/fsl_usb2_udc.c 
b/drivers/usb/gadget/fsl_usb2_udc.c
index e4aa29f..4e14bcd 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -228,7 +228,7 @@ static int dr_controller_setup(struct fsl_udc *udc)
 
/* Config PHY interface */
portctrl = fsl_readl(&dr_regs->portsc1);
-   portctrl &= ~(PORTSCX_PHY_TYPE_SEL & PORTSCX_PORT_WIDTH);
+   portctrl &= ~(PORTSCX_PHY_TYPE_SEL | PORTSCX_PORT_WIDTH);
switch (udc->phy_mode) {
case FSL_USB2_PHY_ULPI:
portctrl |= PORTSCX_PTS_ULPI;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Add URB_FREE_BUFFER flag and the logic behind it

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b3b01c898a44c2fc7217eb579982b9d132113f5
Commit: 8b3b01c898a44c2fc7217eb579982b9d132113f5
Parent: 300871cd963e24a68aaa9b762f4a10403697d9be
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 13 08:02:11 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:38 2007 -0700

USB: Add URB_FREE_BUFFER flag and the logic behind it

USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer

In some cases it is not needed that the driver keeps track of the
transfer buffer of an URB. It can be simply freed along with the
URB itself when the reference count goes down to zero. The new
flag URB_FREE_BUFFER enables this behavior.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/urb.c |3 +++
 include/linux/usb.h|1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index ac4273d..52ec44b 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -13,6 +13,9 @@ static void urb_destroy(struct kref *kref)
 {
struct urb *urb = to_urb(kref);
 
+   if (urb->transfer_flags & URB_FREE_BUFFER)
+   kfree(urb->transfer_buffer);
+
kfree(urb);
 }
 
diff --git a/include/linux/usb.h b/include/linux/usb.h
index efce9a4..533c323 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -994,6 +994,7 @@ extern int usb_disabled(void);
 #define URB_ZERO_PACKET0x0040  /* Finish bulk OUT with short 
packet */
 #define URB_NO_INTERRUPT   0x0080  /* HINT: no non-error interrupt
 * needed */
+#define URB_FREE_BUFFER0x0100  /* Free transfer buffer with 
the URB */
 
 struct usb_iso_packet_descriptor {
unsigned int offset;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: Fix up full-speed bInterval values in high-speed interrupt descriptor

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=300871cd963e24a68aaa9b762f4a10403697d9be
Commit: 300871cd963e24a68aaa9b762f4a10403697d9be
Parent: 87d093e25d73249ae92b28ae88db92eaea7df70f
Author: Laurent Pinchart <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 12 21:47:17 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: Fix up full-speed bInterval values in high-speed interrupt descriptor

Many device manufacturers are using full-speed bInterval values in 
high-speed
interrupt endpoint descriptors. If the bInterval value is greater than 16,
assume the device uses full-speed descriptors and fix the value accordingly.

Signed-off-by: Laurent Pinchart <[EMAIL PROTECTED]>
Acked-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/config.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 9152e12..5e113db 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -85,15 +85,21 @@ static int usb_parse_endpoint(struct device *ddev, int 
cfgno, int inum,
memcpy(&endpoint->desc, d, n);
INIT_LIST_HEAD(&endpoint->urb_list);
 
-   /* If the bInterval value is outside the legal range,
-* set it to a default value: 32 ms */
+   /* Fix up bInterval values outside the legal range. Use 32 ms if no
+* proper value can be guessed. */
i = 0;  /* i = min, j = max, n = default */
j = 255;
if (usb_endpoint_xfer_int(d)) {
i = 1;
switch (to_usb_device(ddev)->speed) {
case USB_SPEED_HIGH:
-   n = 9;  /* 32 ms = 2^(9-1) uframes */
+   /* Many device manufacturers are using full-speed
+* bInterval values in high-speed interrupt endpoint
+* descriptors. Try to fix those and fall back to a
+* 32 ms default value otherwise. */
+   n = fls(d->bInterval*8);
+   if (n == 0)
+   n = 9;  /* 32 ms = 2^(9-1) uframes */
j = 16;
break;
default:/* USB_SPEED_FULL or _LOW */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb-skeleton: use anchors in pre/post reset

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=87d093e25d73249ae92b28ae88db92eaea7df70f
Commit: 87d093e25d73249ae92b28ae88db92eaea7df70f
Parent: 758f7e161b1da3039368bf7180b9d9f4c33453da
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 11 14:55:51 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: usb-skeleton: use anchors in pre/post reset

use anchors in pre/post_reset

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/usb-skeleton.c |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 59973ae..8de11de 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -467,12 +467,35 @@ static int skel_resume (struct usb_interface *intf)
return 0;
 }
 
+static int skel_pre_reset(struct usb_interface *intf)
+{
+   struct usb_skel *dev = usb_get_intfdata(intf);
+
+   mutex_lock(&dev->io_mutex);
+   skel_draw_down(dev);
+
+   return 0;
+}
+
+static int skel_post_reset(struct usb_interface *intf)
+{
+   struct usb_skel *dev = usb_get_intfdata(intf);
+
+   /* we are sure no URBs are active - no locking needed */
+   dev->errors = -EPIPE;
+   mutex_unlock(&dev->io_mutex);
+
+   return 0;
+}
+
 static struct usb_driver skel_driver = {
.name = "skeleton",
.probe =skel_probe,
.disconnect =   skel_disconnect,
.suspend =  skel_suspend,
.resume =   skel_resume,
+   .pre_reset =skel_pre_reset,
+   .post_reset =   skel_post_reset,
.id_table = skel_table,
.supports_autosuspend = 1,
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb-skeleton" use anchors in suspend/resume handling

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=758f7e161b1da3039368bf7180b9d9f4c33453da
Commit: 758f7e161b1da3039368bf7180b9d9f4c33453da
Parent: e73c7247b8e10a74cbf6b7430585e02c7cc05444
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 11 14:55:08 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: usb-skeleton" use anchors in suspend/resume handling

use anchors in suspend/resume handling

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/usb-skeleton.c |   42 +-
 1 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 1b1e669..59973ae 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -57,6 +57,7 @@ struct usb_skel {
__u8bulk_in_endpointAddr;   /* the address of the 
bulk in endpoint */
__u8bulk_out_endpointAddr;  /* the address of the 
bulk out endpoint */
int errors; /* the last request 
tanked */
+   int open_count; /* count the number of 
openers */
spinlock_t  err_lock;   /* lock for errors */
struct kref kref;
struct mutexio_mutex;   /* synchronize I/O with 
disconnect */
@@ -101,12 +102,26 @@ static int skel_open(struct inode *inode, struct file 
*file)
/* increment our usage count for the device */
kref_get(&dev->kref);
 
-   /* prevent the device from being autosuspended */
-   retval = usb_autopm_get_interface(interface);
-   if (retval) {
+   /* lock the device to allow correctly handling errors
+* in resumption */
+   mutex_lock(&dev->io_mutex);
+
+   if (!dev->open_count++) {
+   retval = usb_autopm_get_interface(interface);
+   if (retval) {
+   dev->open_count--;
+   mutex_unlock(&dev->io_mutex);
+   kref_put(&dev->kref, skel_delete);
+   goto exit;
+   }
+   } /* else { //uncomment this block if you want exclusive open
+   retval = -EBUSY;
+   dev->open_count--;
+   mutex_unlock(&dev->io_mutex);
kref_put(&dev->kref, skel_delete);
goto exit;
-   }
+   } */
+   /* prevent the device from being autosuspended */
 
/* save our object in the file's private structure */
file->private_data = dev;
@@ -125,7 +140,7 @@ static int skel_release(struct inode *inode, struct file 
*file)
 
/* allow the device to be autosuspended */
mutex_lock(&dev->io_mutex);
-   if (dev->interface)
+   if (!--dev->open_count && dev->interface)
usb_autopm_put_interface(dev->interface);
mutex_unlock(&dev->io_mutex);
 
@@ -437,10 +452,27 @@ static void skel_draw_down(struct usb_skel *dev)
usb_kill_anchored_urbs(&dev->submitted);
 }
 
+static int skel_suspend(struct usb_interface *intf, pm_message_t message)
+{
+   struct usb_skel *dev = usb_get_intfdata(intf);
+
+   if (!dev)
+   return 0;
+   skel_draw_down(dev);
+   return 0;
+}
+
+static int skel_resume (struct usb_interface *intf)
+{
+   return 0;
+}
+
 static struct usb_driver skel_driver = {
.name = "skeleton",
.probe =skel_probe,
.disconnect =   skel_disconnect,
+   .suspend =  skel_suspend,
+   .resume =   skel_resume,
.id_table = skel_table,
.supports_autosuspend = 1,
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb-skeleton: use anchors in disconnect handling

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e73c7247b8e10a74cbf6b7430585e02c7cc05444
Commit: e73c7247b8e10a74cbf6b7430585e02c7cc05444
Parent: a6ea438b6d38689b7f876093bcba4505fe1995d1
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 11 14:54:02 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: usb-skeleton: use anchors in disconnect handling

use anchors in disconnect handling

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/usb-skeleton.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index a31fcfd..1b1e669 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -420,6 +420,8 @@ static void skel_disconnect(struct usb_interface *interface)
dev->interface = NULL;
mutex_unlock(&dev->io_mutex);
 
+   usb_kill_anchored_urbs(&dev->submitted);
+
/* decrement our usage count */
kref_put(&dev->kref, skel_delete);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: ir_usb: Clean up the worst of it, remove exciting 'crash on open' feature

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a6ea438b6d38689b7f876093bcba4505fe1995d1
Commit: a6ea438b6d38689b7f876093bcba4505fe1995d1
Parent: 9a8baec77205dfe14f98a4e291c830a311125a8b
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 22 14:44:54 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: serial: ir_usb: Clean up the worst of it, remove exciting 'crash on 
open' feature

- Drivers don't call ldisc termios methods. They certainly don't call
them the way this one does - remove wrong call
- The tty buffer code isn't designed to be abused from IRQ handlers and
the new buffering removes the need for the uglies involved - fix them
- Style
- Remove incorrect baud and change handling for termios changes

The driver now has some style, but not a lot - it goes insane if you have
two dongles for example as it continues to use global variables for per
dongle state. That bit isn't my problem.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ir-usb.c |  142 ++-
 1 files changed, 60 insertions(+), 82 deletions(-)

diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 8cec5e5..5ab6a0c 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -21,6 +21,10 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this 
driver
  *
+ * 2007_Jun_21  Alan Cox <[EMAIL PROTECTED]>
+ * Minimal cleanups for some of the driver problens and tty layer abuse.
+ * Still needs fixing to allow multiple dongles.
+ *
  * 2002_Mar_07 greg kh
  * moved some needed structures and #define values from the
  * net/irda/irda-usb.h file into our file, as we don't want to depend on
@@ -109,6 +113,7 @@ static void ir_write_bulk_callback (struct urb *urb);
 static void ir_read_bulk_callback (struct urb *urb);
 static void ir_set_termios (struct usb_serial_port *port, struct ktermios 
*old_termios);
 
+/* Not that this lot means you can only have one per system */
 static u8 ir_baud = 0;
 static u8 ir_xbof = 0;
 static u8 ir_add_bof = 0;
@@ -446,22 +451,12 @@ static void ir_read_bulk_callback (struct urb *urb)
urb->actual_length,
data);
 
-   /*
-* Bypass flip-buffers, and feed the ldisc directly
-* due to our potentially large buffer size.  Since we
-* used to set low_latency, this is exactly what the
-* tty layer did anyway :)
-*/
tty = port->tty;
 
-   /*
-*  FIXME: must not do this in IRQ context
-*/
-   tty->ldisc.receive_buf(
-   tty,
-   data+1,
-   NULL,
-   urb->actual_length-1);
+   if (tty_buffer_request_room(tty, urb->actual_length - 
1)) {
+   tty_insert_flip_string(tty, data+1, 
urb->actual_length - 1);
+   tty_flip_buffer_push(tty);
+   }
 
/*
 * No break here.
@@ -503,8 +498,9 @@ static void ir_read_bulk_callback (struct urb *urb)
 static void ir_set_termios (struct usb_serial_port *port, struct ktermios 
*old_termios)
 {
unsigned char *transfer_buffer;
-   unsigned int cflag;
int result;
+   speed_t baud;
+   int ir_baud;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -513,77 +509,59 @@ static void ir_set_termios (struct usb_serial_port *port, 
struct ktermios *old_t
return;
}
 
-   cflag = port->tty->termios->c_cflag;
-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(port->tty->termios->c_iflag) == 
RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   return;
-   }
+   baud = tty_get_baud_rate(port->tty);
+
+   /*
+* FIXME, we should compare the baud request against the
+* capability stated in the IR header that we got in the
+* startup function.
+*/
+
+   switch (baud) {
+   case 2400:  ir_baud = SPEED_2400; break;
+   case 9600:  ir_baud = SPEED_9600; break;
+   case 19200: ir_baud = SPEED_19200; break;
+   case 38400: ir_baud = SPEED_38400; break;
+   case 57600: ir_bau

USB: serial: belkin_sa: Various needed fixes

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a8baec77205dfe14f98a4e291c830a311125a8b
Commit: 9a8baec77205dfe14f98a4e291c830a311125a8b
Parent: 568c24adeaa4d9ec2fd04c6ae226eeb673a385db
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 22 14:40:18 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: serial: belkin_sa: Various needed fixes

Use the baud rate stuff from the kernel don't parse CBAUD directly
Remove pointless and wrong 'no change' check

Could do with some good testing as well but again better than adding &&
BROKEN

(The use of BELKIN_SA_BAUD() might seem a bit odd but x/a = b and x/b =
a (rounded for integers)).



Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/belkin_sa.c |   69 +++
 1 files changed, 27 insertions(+), 42 deletions(-)

diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 50194ee..e67ce25 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -349,6 +349,7 @@ static void belkin_sa_set_termios (struct usb_serial_port 
*port, struct ktermios
unsigned long flags;
unsigned long control_state;
int bad_flow_control;
+   speed_t baud;

if ((!port->tty) || (!port->tty->termios)) {
dbg ("%s - no tty or termios structure", __FUNCTION__);
@@ -364,16 +365,8 @@ static void belkin_sa_set_termios (struct usb_serial_port 
*port, struct ktermios
bad_flow_control = priv->bad_flow_control;
spin_unlock_irqrestore(&priv->lock, flags);

-   /* check that they really want us to change something */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(port->tty->termios->c_iflag) == 
RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   return;
-   }
-   old_iflag = old_termios->c_iflag;
-   old_cflag = old_termios->c_cflag;
-   }
+   old_iflag = old_termios->c_iflag;
+   old_cflag = old_termios->c_cflag;
 
/* Set the baud rate */
if( (cflag&CBAUD) != (old_cflag&CBAUD) ) {
@@ -387,38 +380,30 @@ static void belkin_sa_set_termios (struct usb_serial_port 
*port, struct ktermios
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 1) < 
0)
err("Set RTS error");
}
+   }
 
-   switch(cflag & CBAUD) {
-   case B0: /* handled below */ break;
-   case B300: urb_value = BELKIN_SA_BAUD(300); break;
-   case B600: urb_value = BELKIN_SA_BAUD(600); break;
-   case B1200: urb_value = BELKIN_SA_BAUD(1200); break;
-   case B2400: urb_value = BELKIN_SA_BAUD(2400); break;
-   case B4800: urb_value = BELKIN_SA_BAUD(4800); break;
-   case B9600: urb_value = BELKIN_SA_BAUD(9600); break;
-   case B19200: urb_value = BELKIN_SA_BAUD(19200); break;
-   case B38400: urb_value = BELKIN_SA_BAUD(38400); break;
-   case B57600: urb_value = BELKIN_SA_BAUD(57600); break;
-   case B115200: urb_value = BELKIN_SA_BAUD(115200); break;
-   case B230400: urb_value = BELKIN_SA_BAUD(230400); break;
-   default: err("BELKIN USB Serial Adapter: unsupported 
baudrate request, using default of 9600");
-   urb_value = BELKIN_SA_BAUD(9600); break;
-   }
-   if ((cflag & CBAUD) != B0 ) {
-   if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, 
urb_value) < 0)
-   err("Set baudrate error");
-   } else {
-   /* Disable flow control */
-   if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, 
BELKIN_SA_FLOW_NONE) < 0)
-   err("Disable flowcontrol error");
-
-   /* Drop RTS and DTR */
-   control_state &= ~(TIOCM_DTR | TIOCM_RTS);
-   if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
-   err("DTR LOW error");
-   if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
-   err("RTS LOW error");
-   }
+   baud = tty_get_baud_rate(port->tty);
+   urb_value = BELKIN_SA_BAUD(baud);
+   /* Clip to maximum speed */
+   if (urb_value == 0)
+   urb_value = 1;
+   /* Turn it back into a resulting real baud rate */
+   baud = BELK

USB: serial: ark3116.c: Mixed fixups

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=568c24adeaa4d9ec2fd04c6ae226eeb673a385db
Commit: 568c24adeaa4d9ec2fd04c6ae226eeb673a385db
Parent: 9e85c5f63268a5700860f53e52b090973652a5b2
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 22 14:36:29 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: serial: ark3116.c: Mixed fixups

o   Don't parse the cflag for baud rates, its not valid to do so
any more and this driver got it wrong anyway
o   Don't do clever termios change checks in drivers and get them
wrong (arguably we should do some smart ones in the tty core but
stty to change nothing is *not* a common or critical path

I don't have the hardware so if you can test this carefully please do. I
thought fixing it up this far was better than marking it and other bits of
USB serial && BROKEN

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ark3116.c |   61 --
 1 files changed, 23 insertions(+), 38 deletions(-)

diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index fe43712..c9fd486 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -172,7 +172,7 @@ static void ark3116_set_termios(struct usb_serial_port 
*port,
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if ((!port->tty) || (!port->tty->termios)) {
+   if (!port->tty || !port->tty->termios) {
dbg("%s - no tty structures", __FUNCTION__);
return;
}
@@ -188,16 +188,6 @@ static void ark3116_set_termios(struct usb_serial_port 
*port,
 
cflag = port->tty->termios->c_cflag;
 
-   /* check that they really want us to change something: */
-   if (old_termios) {
-   if ((cflag == old_termios->c_cflag) &&
-   (RELEVANT_IFLAG(port->tty->termios->c_iflag) ==
-RELEVANT_IFLAG(old_termios->c_iflag))) {
-   dbg("%s - nothing to change...", __FUNCTION__);
-   return;
-   }
-   }
-
buf = kmalloc(1, GFP_KERNEL);
if (!buf) {
dbg("error kmalloc");
@@ -220,7 +210,7 @@ static void ark3116_set_termios(struct usb_serial_port 
*port,
dbg("setting CS7");
break;
default:
-   err("CSIZE was set but not CS5-CS8, using CS8!");
+   dbg("CSIZE was set but not CS5-CS8, using CS8!");
/* fall through */
case CS8:
config |= 0x03;
@@ -251,38 +241,33 @@ static void ark3116_set_termios(struct usb_serial_port 
*port,
}
 
/* set baudrate */
-   baud = 0;
-   switch (cflag & CBAUD) {
-   case B0:
-   err("can't set 0 baud, using 9600 instead");
+   baud = tty_get_baud_rate(port->tty);
+
+   switch (baud) {
+   case 75:
+   case 150:
+   case 300:
+   case 600:
+   case 1200:
+   case 1800:
+   case 2400:
+   case 4800:
+   case 9600:
+   case 19200:
+   case 38400:
+   case 57600:
+   case 115200:
+   case 230400:
+   case 460800:
break;
-   case B75:   baud = 75;  break;
-   case B150:  baud = 150; break;
-   case B300:  baud = 300; break;
-   case B600:  baud = 600; break;
-   case B1200: baud = 1200;break;
-   case B1800: baud = 1800;break;
-   case B2400: baud = 2400;break;
-   case B4800: baud = 4800;break;
-   case B9600: baud = 9600;break;
-   case B19200:baud = 19200;   break;
-   case B38400:baud = 38400;   break;
-   case B57600:baud = 57600;   break;
-   case B115200:   baud = 115200;  break;
-   case B230400:   baud = 230400;  break;
-   case B460800:   baud = 460800;  break;
+   /* set 9600 as default (if given baudrate is invalid for 
example) */
default:
-   dbg("does not support the baudrate requested (fix it)");
-   break;
+   baud = 9600;
}
 
-   /* set 9600 as default (if given baudrate is invalid for example) */
-   if (baud == 0)
-   baud = 9600;
-
/*
 * found by try'n'error, be careful, maybe there are other options
-* for multiplicator etc!
+* for multiplicator etc! (3.5 for exa

USB: sierra: cleanup the startup and shutdown path

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e85c5f63268a5700860f53e52b090973652a5b2
Commit: 9e85c5f63268a5700860f53e52b090973652a5b2
Parent: 17c2327419a889293fb955baf0c69a7d38c5809c
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 20 14:22:23 2007 +0900
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: sierra: cleanup the startup and shutdown path

This removes the ugly code that was copied from the keyspan driver and
allocates the in urbs in a much shorter code path that can be understood
easier.

Also turned off the interrupt urb when no port was open as it's not nice
to keep the bus busy for no good reason at all (this should be a power
savings.)

All in all, this saved over 40 lines of code and cleaned things up
better.

Cc: Kevin Lloyd <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/sierra.c |  130 ++-
 1 files changed, 41 insertions(+), 89 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 551c6ce..e7db203 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -418,7 +418,7 @@ static int sierra_open(struct usb_serial_port *port, struct 
file *filp)
 {
struct sierra_port_private *portdata;
struct usb_serial *serial = port->serial;
-   int i, err;
+   int i;
struct urb *urb;
int result;
__u16 set_mode_dzero = 0x;
@@ -434,7 +434,7 @@ static int sierra_open(struct usb_serial_port *port, struct 
file *filp)
/* Reset low level data toggle and start reading from endpoints */
for (i = 0; i < N_IN_URB; i++) {
urb = portdata->in_urbs[i];
-   if (! urb)
+   if (!urb)
continue;
if (urb->dev != serial->dev) {
dbg("%s: dev %p != %p", __FUNCTION__,
@@ -448,11 +448,10 @@ static int sierra_open(struct usb_serial_port *port, 
struct file *filp)
 */
usb_clear_halt(urb->dev, urb->pipe);
 
-   err = usb_submit_urb(urb, GFP_KERNEL);
-   if (err) {
-   dbg("%s: submit urb %d failed (%d) %d",
-   __FUNCTION__, i, err,
-   urb->transfer_buffer_length);
+   result = usb_submit_urb(urb, GFP_KERNEL);
+   if (result) {
+   dev_err(&port->dev, "submit urb %d failed (%d) %d",
+   i, result, urb->transfer_buffer_length);
}
}
 
@@ -466,7 +465,14 @@ static int sierra_open(struct usb_serial_port *port, 
struct file *filp)
 
sierra_send_setup(port);
 
-   return (0);
+   /* start up the interrupt endpoint if we have one */
+   if (port->interrupt_in_urb) {
+   result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+   if (result)
+   dev_err(&port->dev, "submit irq_in urb failed %d",
+   result);
+   }
+   return 0;
 }
 
 static void sierra_close(struct usb_serial_port *port, struct file *filp)
@@ -486,62 +492,21 @@ static void sierra_close(struct usb_serial_port *port, 
struct file *filp)
 
/* Stop reading/writing urbs */
for (i = 0; i < N_IN_URB; i++)
-   usb_unlink_urb(portdata->in_urbs[i]);
-   }
-   port->tty = NULL;
-}
-
-/* Helper functions used by sierra_setup_urbs */
-static struct urb *sierra_setup_urb(struct usb_serial *serial, int endpoint,
-   int dir, void *ctx, char *buf, int len,
-   usb_complete_t callback)
-{
-   struct urb *urb;
-
-   if (endpoint == -1)
-   return NULL;/* endpoint not needed */
-
-   urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
-   if (urb == NULL) {
-   dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, 
endpoint);
-   return NULL;
+   usb_kill_urb(portdata->in_urbs[i]);
}
 
-   /* Fill URB using supplied data. */
-   usb_fill_bulk_urb(urb, serial->dev,
- usb_sndbulkpipe(serial->dev, endpoint) | dir,
- buf, len, callback, ctx);
-
-   return urb;
-}
+   usb_kill_urb(port->interrupt_in_urb);
 
-/* Setup urbs */
-static void sierra_setup_urbs(struct usb_serial *serial)
-{
-   int i,j;
-   struct usb_serial_port *port;
-   struct sierra_port_private *portdata;
-
-   dbg("%s", __FUNCTION__);
-
-   for (i = 0; i < serial->num_ports; i++) {
-   port = serial->port[i];
-   portdata = usb_get_serial_port_data(port);
-
-   /* Do indat

USB: sierra: remove incorrect usage of the urb status field

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17c2327419a889293fb955baf0c69a7d38c5809c
Commit: 17c2327419a889293fb955baf0c69a7d38c5809c
Parent: 05400013698776a71b1e401ceacf709bda3d1517
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 20 14:22:23 2007 +0900
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

USB: sierra: remove incorrect usage of the urb status field

You can't rely on the fact that the status really is correct like it was.

Also simplified the write path and now we allocate the urb and data on
the fly, instead of trying to do that really odd timeout check which I
am guessing doesn't really work properly.  This should speed up the
device by keeping the hardware queue full easier.

As a benefit, this reduces the size of the driver.

Cc: Kevin Lloyd <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/sierra.c |  221 +--
 1 files changed, 107 insertions(+), 114 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 6ee0b89..551c6ce 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -86,15 +86,14 @@ static int debug;
 #define N_IN_URB   4
 #define N_OUT_URB  4
 #define IN_BUFLEN  4096
-#define OUT_BUFLEN 128
 
 struct sierra_port_private {
+   spinlock_t lock;/* lock the structure */
+   int outstanding_urbs;   /* number of out urbs in flight */
+
/* Input endpoints and buffer for this port */
struct urb *in_urbs[N_IN_URB];
char in_buffer[N_IN_URB][IN_BUFLEN];
-   /* Output endpoints and buffer for this port */
-   struct urb *out_urbs[N_OUT_URB];
-   char out_buffer[N_OUT_URB][OUT_BUFLEN];
 
/* Settings for the port */
int rts_state;  /* Handshaking pins (outputs) */
@@ -103,8 +102,6 @@ struct sierra_port_private {
int dsr_state;
int dcd_state;
int ri_state;
-
-   unsigned long tx_start_time[N_OUT_URB];
 };
 
 static int sierra_send_setup(struct usb_serial_port *port)
@@ -197,61 +194,98 @@ static int sierra_ioctl(struct usb_serial_port *port, 
struct file *file,
return -ENOIOCTLCMD;
 }
 
+static void sierra_outdat_callback(struct urb *urb)
+{
+   struct usb_serial_port *port = urb->context;
+   struct sierra_port_private *portdata = usb_get_serial_port_data(port);
+   int status = urb->status;
+   unsigned long flags;
+
+   dbg("%s - port %d", __FUNCTION__, port->number);
+
+   /* free up the transfer buffer, as usb_free_urb() does not do this */
+   kfree(urb->transfer_buffer);
+
+   if (status)
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
+
+   spin_lock_irqsave(&portdata->lock, flags);
+   --portdata->outstanding_urbs;
+   spin_unlock_irqrestore(&portdata->lock, flags);
+
+   usb_serial_port_softint(port);
+}
+
 /* Write */
 static int sierra_write(struct usb_serial_port *port,
const unsigned char *buf, int count)
 {
-   struct sierra_port_private *portdata;
-   int i;
-   int left, todo;
-   struct urb *this_urb = NULL; /* spurious */
-   int err;
+   struct sierra_port_private *portdata = usb_get_serial_port_data(port);
+   struct usb_serial *serial = port->serial;
+   unsigned long flags;
+   unsigned char *buffer;
+   struct urb *urb;
+   int status;
 
portdata = usb_get_serial_port_data(port);
 
dbg("%s: write (%d chars)", __FUNCTION__, count);
 
-   i = 0;
-   left = count;
-   for (i=0; left > 0 && i < N_OUT_URB; i++) {
-   todo = left;
-   if (todo > OUT_BUFLEN)
-   todo = OUT_BUFLEN;
-
-   this_urb = portdata->out_urbs[i];
-   if (this_urb->status == -EINPROGRESS) {
-   if (time_before(jiffies,
-   portdata->tx_start_time[i] + 10 * HZ))
-   continue;
-   usb_unlink_urb(this_urb);
-   continue;
-   }
-   if (this_urb->status != 0)
-   dbg("usb_write %p failed (err=%d)",
-   this_urb, this_urb->status);
+   spin_lock_irqsave(&portdata->lock, flags);
+   if (portdata->outstanding_urbs > N_OUT_URB) {
+   spin_unlock_irqrestore(&portdata->lock, flags);
+   dbg("%s - write limit hit\n", __FUNCTION__);
+   return 0;
+   }
+   portdata->outstanding_urbs++;
+   spin_unlock_irqrestore(&portdata->lock, flags);
+
+   buffer = kmalloc(count, GFP_ATOMIC);
+   if (!buffer) {
+   dev_err(&port->dev, "out of memory\n");
+  

USB: serial: whiteheat: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05400013698776a71b1e401ceacf709bda3d1517
Commit: 05400013698776a71b1e401ceacf709bda3d1517
Parent: 38e8c910ff7a1aafe2923f085df0f74a60f9de3c
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: whiteheat: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/whiteheat.c |   25 -
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 8fd976d..8611ee5 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -974,10 +974,12 @@ static void whiteheat_unthrottle (struct usb_serial_port 
*port)
  */
 static void command_port_write_callback(struct urb *urb)
 {
+   int status = urb->status;
+
dbg("%s", __FUNCTION__);
 
-   if (urb->status) {
-   dbg ("nonzero urb status: %d", urb->status);
+   if (status) {
+   dbg("nonzero urb status: %d", status);
return;
}
 }
@@ -987,6 +989,7 @@ static void command_port_read_callback(struct urb *urb)
 {
struct usb_serial_port *command_port = (struct usb_serial_port 
*)urb->context;
struct whiteheat_command_private *command_info;
+   int status = urb->status;
unsigned char *data = urb->transfer_buffer;
int result;
 
@@ -997,9 +1000,9 @@ static void command_port_read_callback(struct urb *urb)
dbg ("%s - command_info is NULL, exiting.", __FUNCTION__);
return;
}
-   if (urb->status) {
-   dbg("%s - nonzero urb status: %d", __FUNCTION__, urb->status);
-   if (urb->status != -ENOENT)
+   if (status) {
+   dbg("%s - nonzero urb status: %d", __FUNCTION__, status);
+   if (status != -ENOENT)
command_info->command_finished = WHITEHEAT_CMD_FAILURE;
wake_up(&command_info->wait_command);
return;
@@ -1038,6 +1041,7 @@ static void whiteheat_read_callback(struct urb *urb)
struct whiteheat_urb_wrap *wrap;
unsigned char *data = urb->transfer_buffer;
struct whiteheat_private *info = usb_get_serial_port_data(port);
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -1051,8 +1055,9 @@ static void whiteheat_read_callback(struct urb *urb)
list_del(&wrap->list);
spin_unlock(&info->lock);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
spin_lock(&info->lock);
list_add(&wrap->list, &info->rx_urbs_free);
spin_unlock(&info->lock);
@@ -1079,6 +1084,7 @@ static void whiteheat_write_callback(struct urb *urb)
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct whiteheat_private *info = usb_get_serial_port_data(port);
struct whiteheat_urb_wrap *wrap;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -1092,8 +1098,9 @@ static void whiteheat_write_callback(struct urb *urb)
list_move(&wrap->list, &info->tx_urbs_free);
spin_unlock(&info->lock);
 
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: visor: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38e8c910ff7a1aafe2923f085df0f74a60f9de3c
Commit: 38e8c910ff7a1aafe2923f085df0f74a60f9de3c
Parent: 52171b480865985c060a58fa3cbcd31ba6e13f75
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: visor: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/visor.c |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 81ae76f..acd0eae 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -485,16 +485,17 @@ static void visor_write_bulk_callback (struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct visor_private *priv = usb_get_serial_port_data(port);
+   int status = urb->status;
unsigned long flags;
 
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
 
dbg("%s - port %d", __FUNCTION__, port->number);
-   
-   if (urb->status)
+
+   if (status)
dbg("%s - nonzero write bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
 
spin_lock_irqsave(&priv->lock, flags);
--priv->outstanding_urbs;
@@ -509,14 +510,16 @@ static void visor_read_bulk_callback (struct urb *urb)
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct visor_private *priv = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
struct tty_struct *tty;
int result;
int available_room;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -556,9 +559,10 @@ static void visor_read_bulk_callback (struct urb *urb)
 static void visor_read_int_callback (struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+   int status = urb->status;
int result;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -567,11 +571,11 @@ static void visor_read_int_callback (struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
return;
default:
dbg("%s - nonzero urb status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
goto exit;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: ti_usb_3410_5052: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=52171b480865985c060a58fa3cbcd31ba6e13f75
Commit: 52171b480865985c060a58fa3cbcd31ba6e13f75
Parent: 17dd2215adee8c988b88308671cc20a69839a850
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: ti_usb_3410_5052: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Al Borchers <[EMAIL PROTECTED]>
Cc: Peter Berger <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ti_usb_3410_5052.c |   46 +++-
 1 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c 
b/drivers/usb/serial/ti_usb_3410_5052.c
index 3d505fd..f98626a 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1112,22 +1112,24 @@ static void ti_interrupt_callback(struct urb *urb)
int length = urb->actual_length;
int port_number;
int function;
-   int status;
+   int status = urb->status;
+   int retval;
__u8 msr;
 
dbg("%s", __FUNCTION__);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
-   dbg("%s - urb shutting down, %d", __FUNCTION__, urb->status);
+   dbg("%s - urb shutting down, %d", __FUNCTION__, status);
tdev->td_urb_error = 1;
return;
default:
-   dev_err(dev, "%s - nonzero urb status, %d\n", __FUNCTION__, 
urb->status);
+   dev_err(dev, "%s - nonzero urb status, %d\n",
+   __FUNCTION__, status);
tdev->td_urb_error = 1;
goto exit;
}
@@ -1175,9 +1177,10 @@ static void ti_interrupt_callback(struct urb *urb)
}
 
 exit:
-   status = usb_submit_urb(urb, GFP_ATOMIC);
-   if (status)
-   dev_err(dev, "%s - resubmit interrupt urb failed, %d\n", 
__FUNCTION__, status);
+   retval = usb_submit_urb(urb, GFP_ATOMIC);
+   if (retval)
+   dev_err(dev, "%s - resubmit interrupt urb failed, %d\n",
+   __FUNCTION__, retval);
 }
 
 
@@ -1186,30 +1189,32 @@ static void ti_bulk_in_callback(struct urb *urb)
struct ti_port *tport = (struct ti_port *)urb->context;
struct usb_serial_port *port = tport->tp_port;
struct device *dev = &urb->dev->dev;
-   int status = 0;
+   int status = urb->status;
+   int retval = 0;
 
dbg("%s", __FUNCTION__);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
-   dbg("%s - urb shutting down, %d", __FUNCTION__, urb->status);
+   dbg("%s - urb shutting down, %d", __FUNCTION__, status);
tport->tp_tdev->td_urb_error = 1;
wake_up_interruptible(&tport->tp_write_wait);
return;
default:
-   dev_err(dev, "%s - nonzero urb status, %d\n", __FUNCTION__, 
urb->status );
+   dev_err(dev, "%s - nonzero urb status, %d\n",
+   __FUNCTION__, status );
tport->tp_tdev->td_urb_error = 1;
wake_up_interruptible(&tport->tp_write_wait);
}
 
-   if (urb->status == -EPIPE)
+   if (status == -EPIPE)
goto exit;
 
-   if (urb->status) {
+   if (status) {
dev_err(dev, "%s - stopping read!\n", __FUNCTION__);
return;
}
@@ -1234,13 +1239,14 @@ exit:
spin_lock(&tport->tp_lock);
if (tport->tp_read_urb_state == TI_READ_URB_RUNNING) {
urb->dev = port->serial->dev;
-   status = usb_submit_urb(urb, GFP_ATOMIC);
+   retval = usb_submit_urb(urb, GFP_ATOMIC);
} else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING) {
tport->tp_read_urb_state = TI_READ_URB_STOPPED;
}
spin_unlock(&tport->tp_lock);
-   if (status)
-   dev_err(dev, "%s - resubmit read urb failed, %d\n", 
__FUNCTION__, status);
+   if (retval)
+   dev_err(dev, "%s - resubmit read urb failed, %d\n",
+   __FUNCTION__, retval);
 }
 
 
@@ -1249,23 +1255,25 @@ static void ti_bulk_out_callback(struct urb *urb)
struct ti_port *tport = (struct ti_port *)urb->context;
struct usb_serial_port *port = tport->tp_port;
struct device *dev = &urb->dev->dev;
+   int status = urb->status;
 
dbg("%s - po

USB: serial: sierra: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17dd2215adee8c988b88308671cc20a69839a850
Commit: 17dd2215adee8c988b88308671cc20a69839a850
Parent: 3a75ab943688d765cdb60b33f3f9db72c752c521
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: sierra: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Kevin Lloyd <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/sierra.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index ac1829c..6ee0b89 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -262,15 +262,16 @@ static void sierra_indat_callback(struct urb *urb)
struct usb_serial_port *port;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg("%s: %p", __FUNCTION__, urb);
 
endpoint = usb_pipeendpoint(urb->pipe);
port = (struct usb_serial_port *) urb->context;
 
-   if (urb->status) {
+   if (status) {
dbg("%s: nonzero status: %d on endpoint %02x.",
-   __FUNCTION__, urb->status, endpoint);
+   __FUNCTION__, status, endpoint);
} else {
tty = port->tty;
if (urb->actual_length) {
@@ -282,7 +283,7 @@ static void sierra_indat_callback(struct urb *urb)
}
 
/* Resubmit urb so we continue receiving */
-   if (port->open_count && urb->status != -ESHUTDOWN) {
+   if (port->open_count && status != -ESHUTDOWN) {
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err)
printk(KERN_ERR "%s: resubmit read urb failed. "
@@ -306,6 +307,7 @@ static void sierra_outdat_callback(struct urb *urb)
 static void sierra_instat_callback(struct urb *urb)
 {
int err;
+   int status = urb->status;
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct sierra_port_private *portdata = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
@@ -313,7 +315,7 @@ static void sierra_instat_callback(struct urb *urb)
dbg("%s", __FUNCTION__);
dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
 
-   if (urb->status == 0) {
+   if (status == 0) {
struct usb_ctrlrequest *req_pkt =
(struct usb_ctrlrequest *)urb->transfer_buffer;
 
@@ -344,10 +346,10 @@ static void sierra_instat_callback(struct urb *urb)
req_pkt->bRequestType,req_pkt->bRequest);
}
} else
-   dbg("%s: error %d", __FUNCTION__, urb->status);
+   dbg("%s: error %d", __FUNCTION__, status);
 
/* Resubmit urb so we continue receiving IRQ data */
-   if (urb->status != -ESHUTDOWN) {
+   if (status != -ESHUTDOWN) {
urb->dev = serial->dev;
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: safe_serial: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a75ab943688d765cdb60b33f3f9db72c752c521
Commit: 3a75ab943688d765cdb60b33f3f9db72c752c521
Parent: 461d696aeeae294ad22dfcaae462d1757f955778
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: safe_serial: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Stuart Lynne <[EMAIL PROTECTED]>
Cc: Tom Rushworth <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/safe_serial.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index 5a03a3f..86899d5 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -211,11 +211,13 @@ static void safe_read_bulk_callback (struct urb *urb)
unsigned char length = urb->actual_length;
int i;
int result;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__);
 
-   if (urb->status) {
-   dbg ("%s - nonzero read bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: pl2303: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=461d696aeeae294ad22dfcaae462d1757f955778
Commit: 461d696aeeae294ad22dfcaae462d1757f955778
Parent: 78c26aebd9f4d29f9bd163c7c47f2c89991fcdb1
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: pl2303: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/pl2303.c |   42 ++
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 3022d65..4348c1f 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -961,11 +961,12 @@ static void pl2303_read_int_callback(struct urb *urb)
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
unsigned char *data = urb->transfer_buffer;
unsigned int actual_length = urb->actual_length;
-   int status;
+   int status = urb->status;
+   int retval;
 
dbg("%s (%d)", __FUNCTION__, port->number);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -974,11 +975,11 @@ static void pl2303_read_int_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-   urb->status);
+   status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-   urb->status);
+   status);
goto exit;
}
 
@@ -988,11 +989,11 @@ static void pl2303_read_int_callback(struct urb *urb)
pl2303_update_line_status(port, data, actual_length);
 
 exit:
-   status = usb_submit_urb(urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb(urb, GFP_ATOMIC);
+   if (retval)
dev_err(&urb->dev->dev,
"%s - usb_submit_urb failed with result %d\n",
-   __FUNCTION__, status);
+   __FUNCTION__, retval);
 }
 
 static void pl2303_read_bulk_callback(struct urb *urb)
@@ -1004,23 +1005,23 @@ static void pl2303_read_bulk_callback(struct urb *urb)
unsigned long flags;
int i;
int result;
-   u8 status;
+   int status = urb->status;
+   u8 line_status;
char tty_flag;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - urb status = %d", __FUNCTION__, status);
if (!port->open_count) {
dbg("%s - port is closed, exiting.", __FUNCTION__);
return;
}
-   if (urb->status == -EPROTO) {
+   if (status == -EPROTO) {
/* PL2303 mysteriously fails with -EPROTO reschedule
 * the read */
dbg("%s - caught -EPROTO, resubmitting the urb",
__FUNCTION__);
-   urb->status = 0;
urb->dev = port->serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC);
if (result)
@@ -1040,18 +1041,18 @@ static void pl2303_read_bulk_callback(struct urb *urb)
tty_flag = TTY_NORMAL;
 
spin_lock_irqsave(&priv->lock, flags);
-   status = priv->line_status;
+   line_status = priv->line_status;
priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
spin_unlock_irqrestore(&priv->lock, flags);
wake_up_interruptible(&priv->delta_msr_wait);
 
/* break takes precedence over parity, */
/* which takes precedence over framing errors */
-   if (status & UART_BREAK_ERROR )
+   if (line_status & UART_BREAK_ERROR )
tty_flag = TTY_BREAK;
-   else if (status & UART_PARITY_ERROR)
+   else if (line_status & UART_PARITY_ERROR)
tty_flag = TTY_PARITY;
-   else if (status & UART_FRAME_ERROR)
+   else if (line_status & UART_FRAME_ERROR)
tty_flag = TTY_FRAME;
dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag);
 
@@ -1059,7 +1060,7 @@ static void pl2303_read_bulk_callback(struct urb *urb)
if (tty && urb->actual_length) {
tty_buffer_request_room(tty, urb->actual_length + 1);
/* overrun is special, not associated with a char */
- 

USB: serial: oti6858: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78c26aebd9f4d29f9bd163c7c47f2c89991fcdb1
Commit: 78c26aebd9f4d29f9bd163c7c47f2c89991fcdb1
Parent: d6977b51d5faa8649bbab0e53455e8421d425ce1
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: oti6858: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/oti6858.c |   35 ++-
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 2a60992..d7db71e 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -916,11 +916,12 @@ static void oti6858_read_int_callback(struct urb *urb)
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct oti6858_private *priv = usb_get_serial_port_data(port);
int transient = 0, can_recv = 0, resubmit = 1;
+   int status = urb->status;
 
-   dbg("%s(port = %d, urb->status = %d)",
-   __FUNCTION__, port->number, urb->status);
+   dbg("%s(port = %d, status = %d)",
+   __FUNCTION__, port->number, status);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -929,15 +930,15 @@ static void oti6858_read_int_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s(): urb shutting down with status: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
return;
default:
dbg("%s(): nonzero urb status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
break;
}
 
-   if (urb->status == 0 && urb->actual_length == OTI6858_CTRL_PKT_SIZE) {
+   if (status == 0 && urb->actual_length == OTI6858_CTRL_PKT_SIZE) {
struct oti6858_control_pkt *xs = urb->transfer_buffer;
unsigned long flags;
 
@@ -1032,26 +1033,25 @@ static void oti6858_read_bulk_callback(struct urb *urb)
unsigned char *data = urb->transfer_buffer;
unsigned long flags;
int i, result;
+   int status = urb->status;
char tty_flag;
 
-   dbg("%s(port = %d, urb->status = %d)",
-   __FUNCTION__, port->number, urb->status);
+   dbg("%s(port = %d, status = %d)",
+   __FUNCTION__, port->number, status);
 
spin_lock_irqsave(&priv->lock, flags);
priv->flags.read_urb_in_use = 0;
spin_unlock_irqrestore(&priv->lock, flags);
 
-   if (urb->status != 0) {
+   if (status != 0) {
if (!port->open_count) {
dbg("%s(): port is closed, exiting", __FUNCTION__);
return;
}
/*
-   if (urb->status == -EPROTO) {
+   if (status == -EPROTO) {
// PL2303 mysteriously fails with -EPROTO reschedule 
the read
dbg("%s - caught -EPROTO, resubmitting the urb", 
__FUNCTION__);
-   urb->status = 0;
-   urb->dev = port->serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC);
if (result)
dev_err(&urb->dev->dev, "%s - failed 
resubmitting read urb, error %d\n", __FUNCTION__, result);
@@ -1101,12 +1101,13 @@ static void oti6858_write_bulk_callback(struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct oti6858_private *priv = usb_get_serial_port_data(port);
+   int status = urb->status;
int result;
 
-   dbg("%s(port = %d, urb->status = %d)",
-   __FUNCTION__, port->number, urb->status);
+   dbg("%s(port = %d, status = %d)",
+   __FUNCTION__, port->number, status);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -1115,13 +1116,13 @@ static void oti6858_write_bulk_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s(): urb shutting down with status: %d",
-   __FUNCTION__, urb->status);
+ 

USB: serial: option: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6977b51d5faa8649bbab0e53455e8421d425ce1
Commit: d6977b51d5faa8649bbab0e53455e8421d425ce1
Parent: fdc2deb3892e802e916d1df7b1587aa0dbf3b271
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:36 2007 -0700

USB: serial: option: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Matthias Urlichs <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/option.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index b37d65f..84c12b5 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -416,15 +416,16 @@ static void option_indat_callback(struct urb *urb)
struct usb_serial_port *port;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg("%s: %p", __FUNCTION__, urb);
 
endpoint = usb_pipeendpoint(urb->pipe);
port = (struct usb_serial_port *) urb->context;
 
-   if (urb->status) {
+   if (status) {
dbg("%s: nonzero status: %d on endpoint %02x.",
-   __FUNCTION__, urb->status, endpoint);
+   __FUNCTION__, status, endpoint);
} else {
tty = port->tty;
if (urb->actual_length) {
@@ -436,7 +437,7 @@ static void option_indat_callback(struct urb *urb)
}
 
/* Resubmit urb so we continue receiving */
-   if (port->open_count && urb->status != -ESHUTDOWN) {
+   if (port->open_count && status != -ESHUTDOWN) {
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err)
printk(KERN_ERR "%s: resubmit read urb failed. "
@@ -471,6 +472,7 @@ static void option_outdat_callback(struct urb *urb)
 static void option_instat_callback(struct urb *urb)
 {
int err;
+   int status = urb->status;
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct option_port_private *portdata = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
@@ -478,7 +480,7 @@ static void option_instat_callback(struct urb *urb)
dbg("%s", __FUNCTION__);
dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
 
-   if (urb->status == 0) {
+   if (status == 0) {
struct usb_ctrlrequest *req_pkt =
(struct usb_ctrlrequest *)urb->transfer_buffer;
 
@@ -509,10 +511,10 @@ static void option_instat_callback(struct urb *urb)
req_pkt->bRequestType,req_pkt->bRequest);
}
} else
-   dbg("%s: error %d", __FUNCTION__, urb->status);
+   dbg("%s: error %d", __FUNCTION__, status);
 
/* Resubmit urb so we continue receiving IRQ data */
-   if (urb->status != -ESHUTDOWN) {
+   if (status != -ESHUTDOWN) {
urb->dev = serial->dev;
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: omninet: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fdc2deb3892e802e916d1df7b1587aa0dbf3b271
Commit: fdc2deb3892e802e916d1df7b1587aa0dbf3b271
Parent: 9965d612631c62c2018973080fa03396f49fce59
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: omninet: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/omninet.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 48094d1..ee94d96 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -200,14 +200,15 @@ static void omninet_read_bulk_callback (struct urb *urb)
struct usb_serial_port  *port   = (struct usb_serial_port 
*)urb->context;
unsigned char   *data   = urb->transfer_buffer;
struct omninet_header   *header = (struct omninet_header *) &data[0];
-
+   int status = urb->status;
int i;
int result;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -311,12 +312,14 @@ static void omninet_write_bulk_callback (struct urb *urb)
 {
 /* struct omninet_header   *header = (struct omninet_header  *) 
urb->transfer_buffer; */
struct usb_serial_port  *port   = (struct usb_serial_port *) 
urb->context;
+   int status = urb->status;
 
dbg("%s - port %0x\n", __FUNCTION__, port->number);
 
port->write_urb_busy = 0;
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: navman: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9965d612631c62c2018973080fa03396f49fce59
Commit: 9965d612631c62c2018973080fa03396f49fce59
Parent: 0643c72435bcd36980314de825773989d4dca97f
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: navman: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/navman.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index 9070111..7f337c9 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -37,9 +37,10 @@ static void navman_read_int_callback(struct urb *urb)
struct usb_serial_port *port = urb->context;
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
+   int status = urb->status;
int result;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -48,11 +49,11 @@ static void navman_read_int_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
return;
default:
dbg("%s - nonzero urb status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
goto exit;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: mos7840: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0643c72435bcd36980314de825773989d4dca97f
Commit: 0643c72435bcd36980314de825773989d4dca97f
Parent: 81105984848481d8876e454e3c503dbd0e8e4dce
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: mos7840: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Paul Schroeder <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mos7840.c |   34 +++---
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 36620c6..a667882 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -434,6 +434,7 @@ static void mos7840_control_callback(struct urb *urb)
struct moschip_port *mos7840_port;
__u8 regval = 0x0;
int result = 0;
+   int status = urb->status;
 
if (!urb) {
dbg("%s", "Invalid Pointer :\n");
@@ -442,7 +443,7 @@ static void mos7840_control_callback(struct urb *urb)
 
mos7840_port = (struct moschip_port *)urb->context;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -451,11 +452,11 @@ static void mos7840_control_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-   urb->status);
+   status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-   urb->status);
+   status);
goto exit;
}
 
@@ -521,6 +522,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
__u8 sp[5], st;
int i, rv = 0;
__u16 wval, wreg = 0;
+   int status = urb->status;
 
dbg("%s", " : Entering\n");
if (!urb) {
@@ -528,7 +530,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
return;
}
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -537,11 +539,11 @@ static void mos7840_interrupt_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-   urb->status);
+   status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-   urb->status);
+   status);
goto exit;
}
 
@@ -666,20 +668,21 @@ static struct usb_serial *mos7840_get_usb_serial(struct 
usb_serial_port *port,
 
 static void mos7840_bulk_in_callback(struct urb *urb)
 {
-   int status;
+   int retval;
unsigned char *data;
struct usb_serial *serial;
struct usb_serial_port *port;
struct moschip_port *mos7840_port;
struct tty_struct *tty;
+   int status = urb->status;
 
if (!urb) {
dbg("%s", "Invalid Pointer :\n");
return;
}
 
-   if (urb->status) {
-   dbg("nonzero read bulk status received: %d", urb->status);
+   if (status) {
+   dbg("nonzero read bulk status received: %d", status);
return;
}
 
@@ -729,11 +732,11 @@ static void mos7840_bulk_in_callback(struct urb *urb)
 
mos7840_port->read_urb->dev = serial->dev;
 
-   status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
+   retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
 
-   if (status) {
-   dbg(" usb_submit_urb(read bulk) failed, status = %d",
-status);
+   if (retval) {
+   dbg(" usb_submit_urb(read bulk) failed, retval = %d",
+retval);
}
 }
 
@@ -747,6 +750,7 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
 {
struct moschip_port *mos7840_port;
struct tty_struct *tty;
+   int status = urb->status;
int i;
 
if (!urb) {
@@ -764,8 +768,8 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
}
spin_unlock(&mos7840_port->pool_lock);
 
-   if (urb->status) {
-   dbg("nonzero write bulk status received:%d\n", urb->status);
+   if (status) {
+   dbg("nonzero write bulk status received:%d\n", status);
return;
}
 
-
To unsubs

USB: serial: mos7720: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81105984848481d8876e454e3c503dbd0e8e4dce
Commit: 81105984848481d8876e454e3c503dbd0e8e4dce
Parent: e96da398ce32c0e2af5eee772feb112323f027b4
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: mos7720: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: VijayaKumar G.N. <[EMAIL PROTECTED]>
Cc: AjayKumar <[EMAIL PROTECTED]>
Cc: Gurudeva N. <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mos7720.c |   27 +++
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index b563e2a..5a4c33c 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -103,6 +103,7 @@ static void mos7720_interrupt_callback(struct urb *urb)
 {
int result;
int length;
+   int status = urb->status;
__u8 *data;
__u8 sp1;
__u8 sp2;
@@ -114,7 +115,7 @@ static void mos7720_interrupt_callback(struct urb *urb)
return;
}
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -123,11 +124,11 @@ static void mos7720_interrupt_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
-   urb->status);
+   status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
-   urb->status);
+   status);
goto exit;
}
 
@@ -198,14 +199,15 @@ exit:
  */
 static void mos7720_bulk_in_callback(struct urb *urb)
 {
-   int status;
+   int retval;
unsigned char *data ;
struct usb_serial_port *port;
struct moschip_port *mos7720_port;
struct tty_struct *tty;
+   int status = urb->status;
 
-   if (urb->status) {
-   dbg("nonzero read bulk status received: %d",urb->status);
+   if (status) {
+   dbg("nonzero read bulk status received: %d", status);
return;
}
 
@@ -236,10 +238,10 @@ static void mos7720_bulk_in_callback(struct urb *urb)
if (port->read_urb->status != -EINPROGRESS) {
port->read_urb->dev = port->serial->dev;
 
-   status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-   if (status)
-   dbg("usb_submit_urb(read bulk) failed, status = %d",
-   status);
+   retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+   if (retval)
+   dbg("usb_submit_urb(read bulk) failed, retval = %d",
+   retval);
}
 }
 
@@ -252,9 +254,10 @@ static void mos7720_bulk_out_data_callback(struct urb *urb)
 {
struct moschip_port *mos7720_port;
struct tty_struct *tty;
+   int status = urb->status;
 
-   if (urb->status) {
-   dbg("nonzero write bulk status received:%d", urb->status);
+   if (status) {
+   dbg("nonzero write bulk status received:%d", status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: mct_u232: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e96da398ce32c0e2af5eee772feb112323f027b4
Commit: e96da398ce32c0e2af5eee772feb112323f027b4
Parent: 6fcdcf04e391c033eb9a558a744d8729d52e646e
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: mct_u232: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Wolfgang Grandegger <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/mct_u232.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 204f0f9..2a3fabc 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -516,10 +516,11 @@ static void mct_u232_read_int_callback (struct urb *urb)
struct usb_serial *serial = port->serial;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
-   int status;
+   int retval;
+   int status = urb->status;
unsigned long flags;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -527,10 +528,12 @@ static void mct_u232_read_int_callback (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
-   dbg("%s - nonzero urb status received: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - nonzero urb status received: %d",
+   __FUNCTION__, status);
goto exit;
}
 
@@ -594,10 +597,10 @@ static void mct_u232_read_int_callback (struct urb *urb)
 #endif
spin_unlock_irqrestore(&priv->lock, flags);
 exit:
-   status = usb_submit_urb (urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb (urb, GFP_ATOMIC);
+   if (retval)
err ("%s - usb_submit_urb failed with result %d",
-__FUNCTION__, status);
+__FUNCTION__, retval);
 } /* mct_u232_read_int_callback */
 
 static void mct_u232_set_termios (struct usb_serial_port *port,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: kobil_sct: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6fcdcf04e391c033eb9a558a744d8729d52e646e
Commit: 6fcdcf04e391c033eb9a558a744d8729d52e646e
Parent: 17c1b35a469b5e518b88cc509562ccfb44950145
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: kobil_sct: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Thomas Wahrenbruch <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/kobil_sct.c |   26 ++
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 0683b51..02a86db 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -358,24 +358,26 @@ static void kobil_close (struct usb_serial_port *port, 
struct file *filp)
 }
 
 
-static void kobil_read_int_callback( struct urb *purb)
+static void kobil_read_int_callback(struct urb *urb)
 {
int result;
-   struct usb_serial_port *port = (struct usb_serial_port *) purb->context;
+   struct usb_serial_port *port = urb->context;
struct tty_struct *tty;
-   unsigned char *data = purb->transfer_buffer;
+   unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
 // char *dbg_data;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (purb->status) {
-   dbg("%s - port %d Read int status not zero: %d", __FUNCTION__, 
port->number, purb->status);
+   if (status) {
+   dbg("%s - port %d Read int status not zero: %d",
+   __FUNCTION__, port->number, status);
return;
}
-   
-   tty = port->tty; 
-   if (purb->actual_length) {
-   
+
+   tty = port->tty;
+   if (urb->actual_length) {
+
// BEGIN DEBUG
/*
  dbg_data = kzalloc((3 *  purb->actual_length + 10) * 
sizeof(char), GFP_KERNEL);
@@ -390,15 +392,15 @@ static void kobil_read_int_callback( struct urb *purb)
*/
// END DEBUG
 
-   tty_buffer_request_room(tty, purb->actual_length);
-   tty_insert_flip_string(tty, data, purb->actual_length);
+   tty_buffer_request_room(tty, urb->actual_length);
+   tty_insert_flip_string(tty, data, urb->actual_length);
tty_flip_buffer_push(tty);
}
 
// someone sets the dev to 0 if the close method has been called
port->interrupt_in_urb->dev = port->serial->dev;
 
-   result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 
+   result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, 
port->number, result);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: kl5kusb105: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17c1b35a469b5e518b88cc509562ccfb44950145
Commit: 17c1b35a469b5e518b88cc509562ccfb44950145
Parent: 23189aee76c3297c7ff797ca8bc8e314783039ef
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: kl5kusb105: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Utz-Uwe Haus <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/kl5kusb105.c |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 7b085f3..5a4127e 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -567,12 +567,13 @@ exit:
 static void klsi_105_write_bulk_callback ( struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
-   
-   if (urb->status) {
+
+   if (status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
-   urb->status);
+   status);
return;
}
 
@@ -631,16 +632,17 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int rc;
+   int status = urb->status;
 
-dbg("%s - port %d", __FUNCTION__, port->number);
+   dbg("%s - port %d", __FUNCTION__, port->number);
 
/* The urb might have been killed. */
-if (urb->status) {
-dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
-   urb->status);
-return;
-}
-   
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
+   status);
+   return;
+   }
+
/* The data received is again preceded by a length double-byte in LSB-
 * first order (see klsi_105_write() )
 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: keyspan_pda: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23189aee76c3297c7ff797ca8bc8e314783039ef
Commit: 23189aee76c3297c7ff797ca8bc8e314783039ef
Parent: 95b934548049e2fd6a67853c6b5055c073bf6961
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: keyspan_pda: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/keyspan_pda.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index dd0b66a..be9ac20 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -218,11 +218,12 @@ static void keyspan_pda_rx_interrupt (struct urb *urb)
struct tty_struct *tty = port->tty;
unsigned char *data = urb->transfer_buffer;
int i;
-   int status;
+   int retval;
+   int status = urb->status;
struct keyspan_pda_private *priv;
priv = usb_get_serial_port_data(port);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -230,10 +231,12 @@ static void keyspan_pda_rx_interrupt (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
-   dbg("%s - nonzero urb status received: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - nonzero urb status received: %d",
+   __FUNCTION__, status);
goto exit;
}
 
@@ -268,10 +271,10 @@ static void keyspan_pda_rx_interrupt (struct urb *urb)
}
 
 exit:
-   status = usb_submit_urb (urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb (urb, GFP_ATOMIC);
+   if (retval)
err ("%s - usb_submit_urb failed with result %d",
-__FUNCTION__, status);
+__FUNCTION__, retval);
 }
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: keyspan: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=95b934548049e2fd6a67853c6b5055c073bf6961
Commit: 95b934548049e2fd6a67853c6b5055c073bf6961
Parent: 3152b74f92048223263c54383b3639a2939d853a
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:35 2007 -0700

USB: serial: keyspan: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/keyspan.c |   50 +
 1 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index fa91dde..f2a6fce 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -427,14 +427,15 @@ static void   usa26_indat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct tty_struct   *tty;
unsigned char   *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__); 
 
endpoint = usb_pipeendpoint(urb->pipe);
 
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero status: %x on endpoint %d.",
-   __FUNCTION__, urb->status, endpoint);
+   __FUNCTION__, status, endpoint);
return;
}
 
@@ -519,11 +520,12 @@ static void   usa26_instat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct keyspan_port_private *p_priv;
int old_dcd_state, err;
+   int status = urb->status;
 
serial = (struct usb_serial *) urb->context;
 
-   if (urb->status) {
-   dbg("%s - nonzero status: %x", __FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero status: %x", __FUNCTION__, status);
return;
}
if (urb->actual_length != 9) {
@@ -587,6 +589,7 @@ static void usa28_indat_callback(struct urb *urb)
struct tty_struct   *tty;
unsigned char   *data;
struct keyspan_port_private *p_priv;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__);
 
@@ -598,9 +601,9 @@ static void usa28_indat_callback(struct urb *urb)
return;
 
do {
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero status: %x on endpoint %d.",
-   __FUNCTION__, urb->status, 
usb_pipeendpoint(urb->pipe));
+   __FUNCTION__, status, usb_pipeendpoint(urb->pipe));
return;
}
 
@@ -656,11 +659,12 @@ static void   usa28_instat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct keyspan_port_private *p_priv;
int old_dcd_state;
+   int status = urb->status;
 
serial = (struct usb_serial *) urb->context;
 
-   if (urb->status) {
-   dbg("%s - nonzero status: %x", __FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero status: %x", __FUNCTION__, status);
return;
}
 
@@ -747,13 +751,14 @@ static void   usa49_instat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct keyspan_port_private *p_priv;
int old_dcd_state;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__);
 
serial = (struct usb_serial *) urb->context;
 
-   if (urb->status) {
-   dbg("%s - nonzero status: %x", __FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero status: %x", __FUNCTION__, status);
return;
}
 
@@ -813,14 +818,15 @@ static void   usa49_indat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct tty_struct   *tty;
unsigned char   *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__);
 
endpoint = usb_pipeendpoint(urb->pipe);
 
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero status: %x on endpoint %d.", __FUNCTION__,
-   urb->status, endpoint);
+   status, endpoint);
return;
}
 
@@ -865,13 +871,14 @@ static void usa49wg_indat_callback(struct urb *urb)
struct usb_serial_port  *port;
struct tty_struct   *tty;
unsigned char   *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg ("%s", __FUNCTION__);
 
serial = urb->context;
 
-   if (urb->status) {
-  

USB: serial: ir-usb: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3152b74f92048223263c54383b3639a2939d853a
Commit: 3152b74f92048223263c54383b3639a2939d853a
Parent: b4a1579772667f9ebc0c9e26ed0b674966085e85
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: ir-usb: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Gary Brubaker <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ir-usb.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 9d847f6..8cec5e5 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -392,12 +392,14 @@ static int ir_write (struct usb_serial_port *port, const 
unsigned char *buf, int
 static void ir_write_bulk_callback (struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
port->write_urb_busy = 0;
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -417,6 +419,7 @@ static void ir_read_bulk_callback (struct urb *urb)
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -425,8 +428,7 @@ static void ir_read_bulk_callback (struct urb *urb)
return;
}
 
-   switch (urb->status) {
-
+   switch (status) {
case 0: /* Successful */
 
/*
@@ -490,7 +492,7 @@ static void ir_read_bulk_callback (struct urb *urb)
default:
dbg("%s - nonzero read bulk status received: %d",
__FUNCTION__, 
-   urb->status);
+   status);
break ;
 
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: ipw: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4a1579772667f9ebc0c9e26ed0b674966085e85
Commit: b4a1579772667f9ebc0c9e26ed0b674966085e85
Parent: 2362deb5782d9861a0dade72e2e29114652c69a3
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: ipw: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Roelf Diedericks <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ipw.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 1bc5860..1b94daa 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -167,11 +167,13 @@ static void ipw_read_bulk_callback(struct urb *urb)
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -369,13 +371,15 @@ static void ipw_close(struct usb_serial_port *port, 
struct file * filp)
 static void ipw_write_bulk_callback(struct urb *urb)
 {
struct usb_serial_port *port = urb->context;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
port->write_urb_busy = 0;
 
-   if (urb->status)
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status)
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
 
usb_serial_port_softint(port);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: ipaq: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2362deb5782d9861a0dade72e2e29114652c69a3
Commit: 2362deb5782d9861a0dade72e2e29114652c69a3
Parent: ee337c212ad5d61fd58cfa6a4e48a84497495ebc
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: ipaq: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Ganesh Varadarajan <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ipaq.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 4df0ec7..0455c15 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -732,11 +732,13 @@ static void ipaq_read_bulk_callback(struct urb *urb)
struct tty_struct   *tty;
unsigned char   *data = urb->transfer_buffer;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -870,11 +872,13 @@ static void ipaq_write_bulk_callback(struct urb *urb)
struct ipaq_private *priv = usb_get_serial_port_data(port);
unsigned long   flags;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
-   
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: io_ti: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ee337c212ad5d61fd58cfa6a4e48a84497495ebc
Commit: ee337c212ad5d61fd58cfa6a4e48a84497495ebc
Parent: 2a393f5fd872fad99d639812087383111074cfeb
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: io_ti: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Al Borchers <[EMAIL PROTECTED]>
Cc: Peter Berger <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/io_ti.c |   47 +--
 1 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index fbc2e02..1c6850a 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1719,13 +1719,14 @@ static void edge_interrupt_callback (struct urb *urb)
int length = urb->actual_length;
int port_number;
int function;
-   int status;
+   int retval;
__u8 lsr;
__u8 msr;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -1733,10 +1734,12 @@ static void edge_interrupt_callback (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
-   dev_err(&urb->dev->dev, "%s - nonzero urb status received: 
%d\n", __FUNCTION__, urb->status);
+   dev_err(&urb->dev->dev, "%s - nonzero urb status received: "
+   "%d\n", __FUNCTION__, status);
goto exit;
}
 
@@ -1794,10 +1797,10 @@ static void edge_interrupt_callback (struct urb *urb)
}
 
 exit:
-   status = usb_submit_urb (urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb (urb, GFP_ATOMIC);
+   if (retval)
dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with 
result %d\n",
-__FUNCTION__, status);
+__FUNCTION__, retval);
 }
 
 static void edge_bulk_in_callback (struct urb *urb)
@@ -1805,12 +1808,13 @@ static void edge_bulk_in_callback (struct urb *urb)
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
-   int status = 0;
+   int retval = 0;
int port_number;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -1818,17 +1822,18 @@ static void edge_bulk_in_callback (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
dev_err (&urb->dev->dev,"%s - nonzero read bulk status 
received: %d\n",
-__FUNCTION__, urb->status );
+__FUNCTION__, status);
}
 
-   if (urb->status == -EPIPE)
+   if (status == -EPIPE)
goto exit;
 
-   if (urb->status) {
+   if (status) {
dev_err(&urb->dev->dev,"%s - stopping read!\n", __FUNCTION__);
return;
}
@@ -1862,14 +1867,14 @@ exit:
spin_lock(&edge_port->ep_lock);
if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) {
urb->dev = edge_port->port->serial->dev;
-   status = usb_submit_urb(urb, GFP_ATOMIC);
+   retval = usb_submit_urb(urb, GFP_ATOMIC);
} else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) {
edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED;
}
spin_unlock(&edge_port->ep_lock);
-   if (status)
+   if (retval)
dev_err (&urb->dev->dev, "%s - usb_submit_urb failed with 
result %d\n",
-__FUNCTION__, status);
+__FUNCTION__, retval);
 }
 
 static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned 
char *data, int length)
@@ -1896,12 +1901,13 @@ static void edge_bulk_out_callback (stru

USB: serial: io_edgeport: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a393f5fd872fad99d639812087383111074cfeb
Commit: 2a393f5fd872fad99d639812087383111074cfeb
Parent: fbd272254b034e22a5157af51c8c5907a8f69614
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: io_edgeport: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Al Borchers <[EMAIL PROTECTED]>
Cc: Peter Berger <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/io_edgeport.c |   31 ---
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 056e192..cebb32f 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -599,10 +599,11 @@ static void edge_interrupt_callback (struct urb *urb)
int txCredits;
int portNumber;
int result;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -610,10 +611,12 @@ static void edge_interrupt_callback (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
-   dbg("%s - nonzero urb status received: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - nonzero urb status received: %d",
+   __FUNCTION__, status);
goto exit;
}
 
@@ -688,13 +691,15 @@ static void edge_bulk_in_callback (struct urb *urb)
 {
struct edgeport_serial  *edge_serial = (struct edgeport_serial 
*)urb->context;
unsigned char   *data = urb->transfer_buffer;
-   int status;
+   int retval;
__u16   raw_data_length;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
edge_serial->read_in_progress = false;
return;
}
@@ -722,9 +727,11 @@ static void edge_bulk_in_callback (struct urb *urb)
if (edge_serial->rxBytesAvail > 0) {
dbg("%s - posting a read", __FUNCTION__);
edge_serial->read_urb->dev = edge_serial->serial->dev;
-   status = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
-   if (status) {
-   dev_err(&urb->dev->dev, "%s - usb_submit_urb(read bulk) 
failed, status = %d\n", __FUNCTION__, status);
+   retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
+   if (retval) {
+   dev_err(&urb->dev->dev,
+   "%s - usb_submit_urb(read bulk) failed, "
+   "retval = %d\n", __FUNCTION__, retval);
edge_serial->read_in_progress = false;
}
} else {
@@ -744,11 +751,13 @@ static void edge_bulk_out_data_callback (struct urb *urb)
 {
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
struct tty_struct *tty;
+   int status = urb->status;
 
dbg("%s", __FUNCTION__);
 
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
}
 
tty = edge_port->port->tty;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: garmin_gps: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9feb517faf03ee85de6e2467f7fcb87c1af2258
Commit: f9feb517faf03ee85de6e2467f7fcb87c1af2258
Parent: 0fb0aa188d0e61d58485288071e73d3766513f2a
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: garmin_gps: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Hermann Kneissel <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/garmin_gps.c |   47 --
 1 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 74660a3..04bd3b7 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -1036,15 +1036,16 @@ static void garmin_write_bulk_callback (struct urb *urb)
unsigned long flags;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct garmin_data * garmin_data_p = usb_get_serial_port_data(port);
+   int status = urb->status;
 
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero write bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
spin_lock_irqsave(&garmin_data_p->lock, flags);
garmin_data_p->flags |= CLEAR_HALT_REQUIRED;
spin_unlock_irqrestore(&garmin_data_p->lock, flags);
@@ -1281,7 +1282,8 @@ static void garmin_read_bulk_callback (struct urb *urb)
struct usb_serial *serial =  port->serial;
struct garmin_data * garmin_data_p = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
-   int status;
+   int status = urb->status;
+   int retval;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -1290,9 +1292,9 @@ static void garmin_read_bulk_callback (struct urb *urb)
return;
}
 
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero read bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
return;
}
 
@@ -1306,19 +1308,19 @@ static void garmin_read_bulk_callback (struct urb *urb)
spin_lock_irqsave(&garmin_data_p->lock, flags);
garmin_data_p->flags &= ~FLAGS_BULK_IN_RESTART;
spin_unlock_irqrestore(&garmin_data_p->lock, flags);
-   status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+   if (retval)
dev_err(&port->dev,
"%s - failed resubmitting read urb, error %d\n",
-   __FUNCTION__, status);
+   __FUNCTION__, retval);
} else if (urb->actual_length > 0) {
/* Continue trying to read until nothing more is received  */
if (0 == (garmin_data_p->flags & FLAGS_THROTTLED)) {
-   status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-   if (status)
+   retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+   if (retval)
dev_err(&port->dev,
-   "%s - failed resubmitting read urb, 
error %d\n",
-   __FUNCTION__, status);
+   "%s - failed resubmitting read urb, "
+   "error %d\n", __FUNCTION__, retval);
}
} else {
dbg("%s - end of bulk data", __FUNCTION__);
@@ -1333,13 +1335,14 @@ static void garmin_read_bulk_callback (struct urb *urb)
 static void garmin_read_int_callback (struct urb *urb)
 {
unsigned long flags;
-   int status;
+   int retval;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial *serial = port->serial;
struct garmin_data * garmin_data_p = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -1348,11 +1351,11 @@ static void garmin_read_int_callback (str

USB: serial: generic: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbd272254b034e22a5157af51c8c5907a8f69614
Commit: fbd272254b034e22a5157af51c8c5907a8f69614
Parent: f9feb517faf03ee85de6e2467f7fcb87c1af2258
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:33 2007 -0700

USB: serial: generic: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/generic.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index b09bed4..88a2c7d 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -325,11 +325,13 @@ void usb_serial_generic_read_bulk_callback (struct urb 
*urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (unlikely(urb->status != 0)) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (unlikely(status != 0)) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -347,12 +349,14 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
 void usb_serial_generic_write_bulk_callback (struct urb *urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
port->write_urb_busy = 0;
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: ftdi_sio: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0fb0aa188d0e61d58485288071e73d3766513f2a
Commit: 0fb0aa188d0e61d58485288071e73d3766513f2a
Parent: 335202f44a9a68902a80e09ba33aa4eaddc9c8ed
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: ftdi_sio: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Kuba Ober <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/ftdi_sio.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 3edd13f..4066a46 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1576,14 +1576,15 @@ static void ftdi_write_bulk_callback (struct urb *urb)
struct ftdi_private *priv;
int data_offset;   /* will be 1 for the SIO and 0 otherwise */
unsigned long countback;
+   int status = urb->status;
 
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("nonzero write bulk status received: %d", urb->status);
+   if (status) {
+   dbg("nonzero write bulk status received: %d", status);
return;
}
 
@@ -1659,6 +1660,7 @@ static void ftdi_read_bulk_callback (struct urb *urb)
struct ftdi_private *priv;
unsigned long countread;
unsigned long flags;
+   int status = urb->status;
 
if (urb->number_of_packets > 0) {
err("%s transfer_buffer_length %d actual_length %d number of 
packets %d",__FUNCTION__,
@@ -1687,9 +1689,10 @@ static void ftdi_read_bulk_callback (struct urb *urb)
err("%s - Not my urb!", __FUNCTION__);
}
 
-   if (urb->status) {
+   if (status) {
/* This will happen at close every time so it is a dbg not an 
err */
-   dbg("(this is ok on close) nonzero read bulk status received: 
%d", urb->status);
+   dbg("(this is ok on close) nonzero read bulk status received: "
+   "%d", status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: empeg: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=335202f44a9a68902a80e09ba33aa4eaddc9c8ed
Commit: 335202f44a9a68902a80e09ba33aa4eaddc9c8ed
Parent: 85d75107117eca0e29ac3da8cb82b45f9cd3a7fa
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: empeg: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Gary Brubaker <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/empeg.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 4703c8f..050fcc9 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -326,12 +326,14 @@ static int empeg_chars_in_buffer (struct usb_serial_port 
*port)
 
 static void empeg_write_bulk_callback (struct urb *urb)
 {
-   struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+   struct usb_serial_port *port = urb->context;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -345,11 +347,13 @@ static void empeg_read_bulk_callback (struct urb *urb)
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: digi_acceleport: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85d75107117eca0e29ac3da8cb82b45f9cd3a7fa
Commit: 85d75107117eca0e29ac3da8cb82b45f9cd3a7fa
Parent: 8d7bc55ecf86d1488996c4619642b4557e5e42f1
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: digi_acceleport: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Peter Berger <[EMAIL PROTECTED]>
Cc: Al Borchers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/digi_acceleport.c |   43 -
 1 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/serial/digi_acceleport.c 
b/drivers/usb/serial/digi_acceleport.c
index d67d397..976f54e 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1324,19 +1324,21 @@ static void digi_write_bulk_callback( struct urb *urb )
struct digi_port *priv;
struct digi_serial *serial_priv;
int ret = 0;
+   int status = urb->status;
 
 
-dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
+   dbg("digi_write_bulk_callback: TOP, urb status=%d", status);
 
/* port and serial sanity check */
if( port == NULL || (priv=usb_get_serial_port_data(port)) == NULL ) {
-   err("%s: port or port->private is NULL, status=%d", 
__FUNCTION__,
-   urb->status );
+   err("%s: port or port->private is NULL, status=%d",
+   __FUNCTION__, status);
return;
}
serial = port->serial;
if( serial == NULL || (serial_priv=usb_get_serial_data(serial)) == NULL 
) {
-   err("%s: serial or serial->private is NULL, status=%d", 
__FUNCTION__, urb->status );
+   err("%s: serial or serial->private is NULL, status=%d",
+   __FUNCTION__, status);
return;
}
 
@@ -1740,25 +1742,28 @@ static void digi_read_bulk_callback( struct urb *urb )
struct digi_port *priv;
struct digi_serial *serial_priv;
int ret;
+   int status = urb->status;
 
 
 dbg( "digi_read_bulk_callback: TOP" );
 
/* port sanity check, do not resubmit if port is not valid */
if( port == NULL || (priv=usb_get_serial_port_data(port)) == NULL ) {
-   err("%s: port or port->private is NULL, status=%d", 
__FUNCTION__,
-   urb->status );
+   err("%s: port or port->private is NULL, status=%d",
+   __FUNCTION__, status);
return;
}
if( port->serial == NULL
|| (serial_priv=usb_get_serial_data(port->serial)) == NULL ) {
-   err("%s: serial is bad or serial->private is NULL, status=%d", 
__FUNCTION__, urb->status );
+   err("%s: serial is bad or serial->private is NULL, status=%d",
+   __FUNCTION__, status);
return;
}
 
/* do not resubmit urb if it has any status error */
-   if( urb->status ) {
-   err("%s: nonzero read bulk status: status=%d, port=%d", 
__FUNCTION__, urb->status, priv->dp_port_num );
+   if (status) {
+   err("%s: nonzero read bulk status: status=%d, port=%d",
+   __FUNCTION__, status, priv->dp_port_num);
return;
}
 
@@ -1799,10 +1804,11 @@ static int digi_read_inb_callback( struct urb *urb )
struct digi_port *priv = usb_get_serial_port_data(port);
int opcode = ((unsigned char *)urb->transfer_buffer)[0];
int len = ((unsigned char *)urb->transfer_buffer)[1];
-   int status = ((unsigned char *)urb->transfer_buffer)[2];
+   int port_status = ((unsigned char *)urb->transfer_buffer)[2];
unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
int flag,throttled;
int i;
+   int status = urb->status;
 
/* do not process callbacks on closed ports */
/* but do continue the read chain */
@@ -1811,7 +1817,10 @@ static int digi_read_inb_callback( struct urb *urb )
 
/* short/multiple packet check */
if( urb->actual_length != len + 2 ) {
-   err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, 
port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", __FUNCTION__, 
urb->status, priv->dp_port_num, opcode, len, urb->actual_length, status );
+   err("%s: INCOMPLETE OR MULTIPLE PACKET, urb status=%d, "
+   "port=%d, opcode=%d, len=%d, actual_length=%d, "
+   "port_status=%d", __FUNCTION__, status, priv->dp_port_num,
+   opcode, len, urb->actual

USB: serial: cypress_m8: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d7bc55ecf86d1488996c4619642b4557e5e42f1
Commit: 8d7bc55ecf86d1488996c4619642b4557e5e42f1
Parent: 7dcc85cd9b7134bbcdc50dc14ccfc7c49f092506
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: cypress_m8: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: Lonnie Mendez <[EMAIL PROTECTED]>
Cc: Neil Whelchel <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/cypress_m8.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 57b8e27..1633863 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1275,10 +1275,11 @@ static void cypress_read_int_callback(struct urb *urb)
int bytes = 0;
int result;
int i = 0;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   switch (urb->status) {
+   switch (status) {
case 0: /* success */
break;
case -ECONNRESET:
@@ -1292,7 +1293,7 @@ static void cypress_read_int_callback(struct urb *urb)
default:
/* something ugly is going on... */
dev_err(&urb->dev->dev,"%s - unexpected nonzero read status 
received: %d\n",
-   __FUNCTION__,urb->status);
+   __FUNCTION__, status);
cypress_set_dead(port);
return;
}
@@ -1419,10 +1420,11 @@ static void cypress_write_int_callback(struct urb *urb)
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cypress_private *priv = usb_get_serial_port_data(port);
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
-   
-   switch (urb->status) {
+
+   switch (status) {
case 0:
/* success */
break;
@@ -1430,7 +1432,8 @@ static void cypress_write_int_callback(struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", 
__FUNCTION__, urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
priv->write_urb_in_use = 0;
return;
case -EPIPE: /* no break needed; clear halt and resubmit */
@@ -1438,7 +1441,8 @@ static void cypress_write_int_callback(struct urb *urb)
break;
usb_clear_halt(port->serial->dev, 0x02);
/* error in the urb, so we have to resubmit it */
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
port->interrupt_out_urb->transfer_buffer_length = 1;
port->interrupt_out_urb->dev = port->serial->dev;
result = usb_submit_urb(port->interrupt_out_urb, 
GFP_ATOMIC);
@@ -1450,7 +1454,7 @@ static void cypress_write_int_callback(struct urb *urb)
break;
default:
dev_err(&urb->dev->dev,"%s - unexpected nonzero write 
status received: %d\n",
-   __FUNCTION__,urb->status);
+   __FUNCTION__, status);
cypress_set_dead(port);
break;
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: cyberjack: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7dcc85cd9b7134bbcdc50dc14ccfc7c49f092506
Commit: 7dcc85cd9b7134bbcdc50dc14ccfc7c49f092506
Parent: f26aad25d2c336a1efd393aff17bfe975b04fed5
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: cyberjack: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/cyberjack.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 4167753..4353df9 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -305,12 +305,13 @@ static void cyberjack_read_int_callback( struct urb *urb )
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
+   int status = urb->status;
int result;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
/* the urb might have been killed. */
-   if (urb->status)
+   if (status)
return;
 
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, 
urb->actual_length, data);
@@ -365,12 +366,14 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
unsigned char *data = urb->transfer_buffer;
short todo;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
-   
+
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, 
urb->actual_length, data);
-   if (urb->status) {
-   dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, 
urb->status);
+   if (status) {
+   dbg("%s - nonzero read bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
@@ -411,12 +414,14 @@ static void cyberjack_write_bulk_callback (struct urb 
*urb)
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
port->write_urb_busy = 0;
-   if (urb->status) {
-   dbg("%s - nonzero write bulk status received: %d", 
__FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - nonzero write bulk status received: %d",
+   __FUNCTION__, status);
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: belkin_sa: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f26aad25d2c336a1efd393aff17bfe975b04fed5
Commit: f26aad25d2c336a1efd393aff17bfe975b04fed5
Parent: d3434cf6916d9014d7906b3b2513f8fe325a6d5c
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: belkin_sa: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/belkin_sa.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 3b800d2..50194ee 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -255,9 +255,10 @@ static void belkin_sa_read_int_callback (struct urb *urb)
struct belkin_sa_private *priv;
unsigned char *data = urb->transfer_buffer;
int retval;
+   int status = urb->status;
unsigned long flags;
 
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -265,10 +266,12 @@ static void belkin_sa_read_int_callback (struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
-   dbg("%s - urb shutting down with status: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - urb shutting down with status: %d",
+   __FUNCTION__, status);
return;
default:
-   dbg("%s - nonzero urb status received: %d", __FUNCTION__, 
urb->status);
+   dbg("%s - nonzero urb status received: %d",
+   __FUNCTION__, status);
goto exit;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: airprime: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d3434cf6916d9014d7906b3b2513f8fe325a6d5c
Commit: d3434cf6916d9014d7906b3b2513f8fe325a6d5c
Parent: 1373dbbca55503804ed191ba3914af68ce01e4bc
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:32 2007 -0700

USB: serial: airprime: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/airprime.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 39a4983..cff6fd1 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -82,12 +82,13 @@ static void airprime_read_bulk_callback(struct urb *urb)
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
int result;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
+   if (status) {
dbg("%s - nonzero read bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
return;
}
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, 
urb->actual_length, data);
@@ -109,6 +110,7 @@ static void airprime_write_bulk_callback(struct urb *urb)
 {
struct usb_serial_port *port = urb->context;
struct airprime_private *priv = usb_get_serial_port_data(port);
+   int status = urb->status;
unsigned long flags;
 
dbg("%s - port %d", __FUNCTION__, port->number);
@@ -116,9 +118,9 @@ static void airprime_write_bulk_callback(struct urb *urb)
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
 
-   if (urb->status)
+   if (status)
dbg("%s - nonzero write bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
spin_lock_irqsave(&priv->lock, flags);
--priv->outstanding_urbs;
spin_unlock_irqrestore(&priv->lock, flags);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: serial: aircable: clean up urb->status usage

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1373dbbca55503804ed191ba3914af68ce01e4bc
Commit: 1373dbbca55503804ed191ba3914af68ce01e4bc
Parent: 4d0dce3e0b794942407391c52f8dd2760802f391
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 15:44:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: serial: aircable: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/aircable.c |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index fbc8c27..1cd29cd 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -411,12 +411,13 @@ static int aircable_write(struct usb_serial_port *port,
 static void aircable_write_bulk_callback(struct urb *urb)
 {
struct usb_serial_port *port = urb->context;
+   int status = urb->status;
int result;
 
-   dbg("%s - urb->status: %d", __FUNCTION__ , urb->status);
+   dbg("%s - urb status: %d", __FUNCTION__ , status);
 
/* This has been taken from cypress_m8.c cypress_write_int_callback */
-   switch (urb->status) {
+   switch (status) {
case 0:
/* success */
break;
@@ -425,14 +426,14 @@ static void aircable_write_bulk_callback(struct urb *urb)
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
port->write_urb_busy = 0;
return;
default:
/* error in the urb, so we have to resubmit it */
dbg("%s - Overflow in write", __FUNCTION__);
dbg("%s - nonzero write bulk status received: %d",
-   __FUNCTION__, urb->status);
+   __FUNCTION__, status);
port->write_urb->transfer_buffer_length = 1;
port->write_urb->dev = port->serial->dev;
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
@@ -457,16 +458,17 @@ static void aircable_read_bulk_callback(struct urb *urb)
unsigned long no_packages, remaining, package_length, i;
int result, shift = 0;
unsigned char *temp;
+   int status = urb->status;
 
dbg("%s - port %d", __FUNCTION__, port->number);
 
-   if (urb->status) {
-   dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
+   if (status) {
+   dbg("%s - urb status = %d", __FUNCTION__, status);
if (!port->open_count) {
dbg("%s - port is closed, exiting.", __FUNCTION__);
return;
}
-   if (urb->status == -EPROTO) {
+   if (status == -EPROTO) {
dbg("%s - caught -EPROTO, resubmitting the urb",
__FUNCTION__);
usb_fill_bulk_urb(port->read_urb, port->serial->dev,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: fix up license wording on some of my usb-serial drivers

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d0dce3e0b794942407391c52f8dd2760802f391
Commit: 4d0dce3e0b794942407391c52f8dd2760802f391
Parent: 9f6a93f7bbb6d73ca0e43c000f3bbf521cd4f782
Author: Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 12 11:43:37 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: fix up license wording on some of my usb-serial drivers

Also update the copyright date on the pl2303 driver, as it was out of date.

Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/omninet.c |7 +++
 drivers/usb/serial/pl2303.c  |8 
 drivers/usb/serial/visor.c   |6 +++---
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 00afc17..48094d1 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -1,10 +1,9 @@
 /*
  * USB ZyXEL omni.net LCD PLUS driver
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
  *
  * See Documentation/usb/usb-serial.txt for more information on using this 
driver
  *
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 5027ae9..3022d65 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -1,14 +1,14 @@
 /*
  * Prolific PL2303 USB to serial adaptor driver
  *
- * Copyright (C) 2001-2004 Greg Kroah-Hartman ([EMAIL PROTECTED])
+ * Copyright (C) 2001-2007 Greg Kroah-Hartman ([EMAIL PROTECTED])
  * Copyright (C) 2003 IBM Corp.
  *
  * Original driver for 2.2.x by anonymous
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
  *
  * See Documentation/usb/usb-serial.txt for more information on using this 
driver
  *
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index ca826b9..81ae76f 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -5,9 +5,9 @@
  * Copyright (C) 1999 - 2004
  * Greg Kroah-Hartman ([EMAIL PROTECTED])
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
  *
  * See Documentation/usb/usb-serial.txt for more information on using this 
driver
  *
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


usb: free DMA mappings if enqueue fails

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9f6a93f7bbb6d73ca0e43c000f3bbf521cd4f782
Commit: 9f6a93f7bbb6d73ca0e43c000f3bbf521cd4f782
Parent: 60aac1ec26b960fe77bf600457bc6c06f8aa7db4
Author: Pete Zaitcev <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 8 13:37:49 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

usb: free DMA mappings if enqueue fails

This patch releases DMA resources if enqueue fails in the HCD.

Linux had this bug ever since we converted from virt_to_bus for 2.4.
It is difficult to hit. A user would need a significant memory pressure
or some other unusual condition.

It was reported to me by IBM. They ran a management application for
RSA II adapters which sent Bulk requests to an Interrupt endpoint.
Submissions got rejected by HCD due to an invalid interval value
and the swiotlb pool became depleted in the matter of hours.

We fixed the invalid interval issue in devio.c separately, but this
seems to be a bug worth fixing as well.

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/hcd.c |   47 ---
 1 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index e5058fb..3df5385 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -903,17 +903,32 @@ EXPORT_SYMBOL (usb_calc_bus_time);
 
 /*-*/
 
-static void urb_unlink (struct urb *urb)
+static void urb_unlink(struct usb_hcd *hcd, struct urb *urb)
 {
unsigned long   flags;
+   int at_root_hub = (urb->dev == hcd->self.root_hub);
 
/* clear all state linking urb to this dev (and hcd) */
-
spin_lock_irqsave (&hcd_data_lock, flags);
list_del_init (&urb->urb_list);
spin_unlock_irqrestore (&hcd_data_lock, flags);
-}
 
+   if (hcd->self.uses_dma && !at_root_hub) {
+   if (usb_pipecontrol (urb->pipe)
+   && !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP))
+   dma_unmap_single (hcd->self.controller, urb->setup_dma,
+   sizeof (struct usb_ctrlrequest),
+   DMA_TO_DEVICE);
+   if (urb->transfer_buffer_length != 0
+   && !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP))
+   dma_unmap_single (hcd->self.controller,
+   urb->transfer_dma,
+   urb->transfer_buffer_length,
+   usb_pipein (urb->pipe)
+   ? DMA_FROM_DEVICE
+   : DMA_TO_DEVICE);
+   }
+}
 
 /* may be called in any context with a valid urb->dev usecount
  * caller surrenders "ownership" of urb
@@ -1016,7 +1031,7 @@ doit:
status = hcd->driver->urb_enqueue (hcd, ep, urb, mem_flags);
 done:
if (unlikely (status)) {
-   urb_unlink (urb);
+   urb_unlink(hcd, urb);
atomic_dec (&urb->use_count);
if (urb->reject)
wake_up (&usb_kill_urb_queue);
@@ -1400,29 +1415,7 @@ EXPORT_SYMBOL (usb_bus_start_enum);
  */
 void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb)
 {
-   int at_root_hub;
-
-   at_root_hub = (urb->dev == hcd->self.root_hub);
-   urb_unlink (urb);
-
-   /* lower level hcd code should use *_dma exclusively if the
-* host controller does DMA */
-   if (hcd->self.uses_dma && !at_root_hub) {
-   if (usb_pipecontrol (urb->pipe)
-   && !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP))
-   dma_unmap_single (hcd->self.controller, urb->setup_dma,
-   sizeof (struct usb_ctrlrequest),
-   DMA_TO_DEVICE);
-   if (urb->transfer_buffer_length != 0
-   && !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP))
-   dma_unmap_single (hcd->self.controller, 
-   urb->transfer_dma,
-   urb->transfer_buffer_length,
-   usb_pipein (urb->pipe)
-   ? DMA_FROM_DEVICE
-   : DMA_TO_DEVICE);
-   }
-
+   urb_unlink(hcd, urb);
usbmon_urb_complete (&hcd->self, urb);
usb_unanchor_urb(urb);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-inf

USB: Handle bogus low-speed Bulk endpoints

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=60aac1ec26b960fe77bf600457bc6c06f8aa7db4
Commit: 60aac1ec26b960fe77bf600457bc6c06f8aa7db4
Parent: 52f6b5e1f15fa8c06efa69a4b5faa69c04707c92
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 8 15:25:02 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: Handle bogus low-speed Bulk endpoints

A noticeable number of low-speed devices mistakenly include
descriptors for Bulk endpoints, which is forbidden by the USB spec.
In an attempt to make such devices more usable, this patch (as924)
converts the descriptors to Interrupt with an interval of 1 ms.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/config.c |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index dd34823..9152e12 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -124,6 +124,21 @@ static int usb_parse_endpoint(struct device *ddev, int 
cfgno, int inum,
endpoint->desc.bInterval = n;
}
 
+   /* Some buggy low-speed devices have Bulk endpoints, which is
+* explicitly forbidden by the USB spec.  In an attempt to make
+* them usable, we will try treating them as Interrupt endpoints.
+*/
+   if (to_usb_device(ddev)->speed == USB_SPEED_LOW &&
+   usb_endpoint_xfer_bulk(d)) {
+   dev_warn(ddev, "config %d interface %d altsetting %d "
+   "endpoint 0x%X is Bulk; changing to Interrupt\n",
+   cfgno, inum, asnum, d->bEndpointAddress);
+   endpoint->desc.bmAttributes = USB_ENDPOINT_XFER_INT;
+   endpoint->desc.bInterval = 1;
+   if (le16_to_cpu(endpoint->desc.wMaxPacketSize) > 8)
+   endpoint->desc.wMaxPacketSize = cpu_to_le16(8);
+   }
+
/* Skip over any Class Specific or Vendor Specific descriptors;
 * find the next endpoint or interface descriptor */
endpoint->extra = buffer;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


synchronization in usb_serial_put

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=52f6b5e1f15fa8c06efa69a4b5faa69c04707c92
Commit: 52f6b5e1f15fa8c06efa69a4b5faa69c04707c92
Parent: efdff60885e36b5091cdc47742dd5768ff4119be
Author: Benny Halevy <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 11:15:27 2007 +0300
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

synchronization in usb_serial_put

I think there is a race between usb_serial_put() and
usb_serial_get_by_index() (and get_free_serial()) with regards
to handling the serial port refcount.

usb_serial_get_by_index() gets a reference on the serial port under
table_lock while return_serial releases all the returned ports
from the table under the same lock.  However, the table_lock is not
taken around the call to kref_put, theoretically allowing to sneak
in and grab a reference after kref_put has already determined that
the reference count is zero (and before calling destroy_serial)
causing use after free.

Signed-off-by: Benny Halevy <[EMAIL PROTECTED]>
Cc: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/usb-serial.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index e3e3728..a366565 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -122,11 +122,9 @@ static void return_serial(struct usb_serial *serial)
if (serial == NULL)
return;
 
-   spin_lock(&table_lock);
for (i = 0; i < serial->num_ports; ++i) {
serial_table[serial->minor + i] = NULL;
}
-   spin_unlock(&table_lock);
 }
 
 static void destroy_serial(struct kref *kref)
@@ -174,7 +172,9 @@ static void destroy_serial(struct kref *kref)
 
 void usb_serial_put(struct usb_serial *serial)
 {
+   spin_lock(&table_lock);
kref_put(&serial->kref, destroy_serial);
+   spin_unlock(&table_lock);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ehci-hub: improved over-current recovery

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=756aa6b3d536afe85e151138cb03a293998887b3
Commit: 756aa6b3d536afe85e151138cb03a293998887b3
Parent: 648dcfc805ea1308552225e96113dc60e054f2f0
Author: Christian Engelmayer <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 11:04:48 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

ehci-hub: improved over-current recovery

According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some root
hubs need port power to be cycled by software in order to get back
to normal functionality after an over-current condition ... like
the EHCI implementation on an MPC8343E.

Signed-off-by: Christian Engelmayer <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/host/ehci-hub.c |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 27291f5..71aeca0 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -647,9 +647,24 @@ static int ehci_hub_control (
status |= 1 << USB_PORT_FEAT_C_CONNECTION;
if (temp & PORT_PEC)
status |= 1 << USB_PORT_FEAT_C_ENABLE;
-   if ((temp & PORT_OCC) && !ignore_oc)
+
+   if ((temp & PORT_OCC) && !ignore_oc){
status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT;
 
+   /*
+* Hubs should disable port power on over-current.
+* However, not all EHCI implementations do this
+* automatically, even if they _do_ support per-port
+* power switching; they're allowed to just limit the
+* current.  khubd will turn the power back on.
+*/
+   if (HCS_PPC (ehci->hcs_params)){
+   ehci_writel(ehci,
+   temp & ~(PORT_RWC_BITS | PORT_POWER),
+   status_reg);
+   }
+   }
+
/* whoever resumes must GetPortStatus to complete it!! */
if (temp & PORT_RESUME) {
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: io_ti: sleep with spinlock held detected by automatic tool

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=efdff60885e36b5091cdc47742dd5768ff4119be
Commit: efdff60885e36b5091cdc47742dd5768ff4119be
Parent: 756aa6b3d536afe85e151138cb03a293998887b3
Author: Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 10:50:48 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: io_ti: sleep with spinlock held detected by automatic tool

this fixes the sleep found with the automatic tool.

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/io_ti.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 0bd34f8..fbc2e02 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2364,7 +2364,7 @@ static int restart_read(struct edgeport_port *edge_port)
urb->complete = edge_bulk_in_callback;
urb->context = edge_port;
urb->dev = edge_port->port->serial->dev;
-   status = usb_submit_urb(urb, GFP_KERNEL);
+   status = usb_submit_urb(urb, GFP_ATOMIC);
}
edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING;
edge_port->shadow_mcr |= MCR_RTS;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb host side can be configured given PCMCIA

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=648dcfc805ea1308552225e96113dc60e054f2f0
Commit: 648dcfc805ea1308552225e96113dc60e054f2f0
Parent: ed76cacbea08ebfdb678c8687f98237cb7c67bb6
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 7 14:13:26 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: usb host side can be configured given PCMCIA

Platforms with PCMCIA support can implement host-side USB with "sl811_cs",
so make sure this menu shows up on platforms with PCMCIA.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 7ee61f5..071b967 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -16,6 +16,7 @@ config USB_ARCH_HAS_HCD
boolean
default y if USB_ARCH_HAS_OHCI
default y if USB_ARCH_HAS_EHCI
+   default y if PCMCIA # sl811_cs
default y if ARM# SL-811
default PCI
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: usb-storage: use kthread_stop() for the control thread

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed76cacbea08ebfdb678c8687f98237cb7c67bb6
Commit: ed76cacbea08ebfdb678c8687f98237cb7c67bb6
Parent: 3fc154b6b8134b98bb94d60cad9a46ec1ffbe372
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 7 17:12:25 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

USB: usb-storage: use kthread_stop() for the control thread

This patch (as923) makes usb-storage's control thread use
kthread_should_stop()/kthread_stop().  The scanning thread can't be
similarly converted until the core kthread implementation allows
threads to call do_exit().

The advantage of this change is that we can now be certain the control
thread has terminated before storage_disconnect() returns.  This will
simplify the locking requirements when autosuspend support is added.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Matthew Dharm <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/storage/usb.c |   38 +-
 drivers/usb/storage/usb.h |1 +
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 00521f1..cf3fc91 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -425,23 +425,15 @@ SkipForAbort:
mutex_unlock(&us->dev_mutex);
} /* for (;;) */
 
-   scsi_host_put(host);
-
-   /* notify the exit routine that we're actually exiting now 
-*
-* complete()/wait_for_completion() is similar to up()/down(),
-* except that complete() is safe in the case where the structure
-* is getting deleted in a parallel mode of execution (i.e. just
-* after the down() -- that's necessary for the thread-shutdown
-* case.
-*
-* complete_and_exit() goes even further than this -- it is safe in
-* the case that the thread of the caller is going away (not just
-* the structure) -- this is necessary for the module-remove case.
-* This is important in preemption kernels, which transfer the flow
-* of execution immediately upon a complete().
-*/
-   complete_and_exit(&threads_gone, 0);
+   /* Wait until we are told to stop */
+   for (;;) {
+   set_current_state(TASK_INTERRUPTIBLE);
+   if (kthread_should_stop())
+   break;
+   schedule();
+   }
+   __set_current_state(TASK_RUNNING);
+   return 0;
 }  
 
 /***
@@ -809,19 +801,13 @@ static int usb_stor_acquire_resources(struct us_data *us)
}
 
/* Start up our control thread */
-   th = kthread_create(usb_stor_control_thread, us, "usb-storage");
+   th = kthread_run(usb_stor_control_thread, us, "usb-storage");
if (IS_ERR(th)) {
printk(KERN_WARNING USB_STORAGE 
   "Unable to start control thread\n");
return PTR_ERR(th);
}
-
-   /* Take a reference to the host for the control thread and
-* count it among all the threads we have launched.  Then
-* start it up. */
-   scsi_host_get(us_to_host(us));
-   atomic_inc(&total_threads);
-   wake_up_process(th);
+   us->ctl_thread = th;
 
return 0;
 }
@@ -838,6 +824,8 @@ static void usb_stor_release_resources(struct us_data *us)
US_DEBUGP("-- sending exit command to thread\n");
set_bit(US_FLIDX_DISCONNECTING, &us->flags);
up(&us->sema);
+   if (us->ctl_thread)
+   kthread_stop(us->ctl_thread);
 
/* Call the destructor routine, if it exists */
if (us->extra_destructor) {
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 6dac1ff..6445665 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -144,6 +144,7 @@ struct us_data {
unsigned char   *sensebuf;   /* sense data buffer*/
dma_addr_t  cr_dma;  /* buffer DMA addresses */
dma_addr_t  iobuf_dma;
+   struct task_struct  *ctl_thread; /* the control thread   */
 
/* mutual exclusion and synchronization structures */
struct semaphoresema;/* to sleep thread on  */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB Gadget driver for Samsung s3c2410 ARM SoC

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3fc154b6b8134b98bb94d60cad9a46ec1ffbe372
Commit: 3fc154b6b8134b98bb94d60cad9a46ec1ffbe372
Parent: 7a4eb7fd50d4df99fc1f623e6d90680d9fca3d82
Author: Arnaud Patard <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 6 21:05:49 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB Gadget driver for Samsung s3c2410 ARM SoC

This patch adds the support for the Usb Device Controller on Samsung
S3C24xx SoCs.  This driver passes all tests from testusb (including #13)
and has been tested on S3C2410, S3C24212, and S3C2440 SoCs.

Whitespace updates, minor cleanups by David

Signed-off-by: Arnaud Patard <[EMAIL PROTECTED]>
Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Cc: Herbert Pötzl <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/Kconfig   |   21 +
 drivers/usb/gadget/Makefile  |1 +
 drivers/usb/gadget/s3c2410_udc.c | 2078 ++
 drivers/usb/gadget/s3c2410_udc.h |  110 ++
 4 files changed, 2210 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 0576888..74eaa7d 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -208,6 +208,27 @@ config USB_OTG
 
   Select this only if your OMAP board has a Mini-AB connector.
 
+config USB_GADGET_S3C2410
+   boolean "S3C2410 USB Device Controller"
+   depends on ARCH_S3C2410
+   help
+ Samsung's S3C2410 is an ARM-4 processor with an integrated
+ full speed USB 1.1 device controller.  It has 4 configurable
+ endpoints, as well as endpoint zero (for control transfers).
+
+ This driver has been tested on the S3C2410, S3C2412, and
+ S3C2440 processors.
+
+config USB_S3C2410
+   tristate
+   depends on USB_GADGET_S3C2410
+   default USB_GADGET
+   select USB_GADGET_SELECTED
+
+config USB_S3C2410_DEBUG
+   boolean "S3C2410 udc debug messages"
+   depends on USB_GADGET_S3C2410
+
 config USB_GADGET_AT91
boolean "AT91 USB Device Port"
depends on ARCH_AT91 && !ARCH_AT91SAM9RL
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 2d41e84..bff2783 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_USB_PXA2XX)+= pxa2xx_udc.o
 obj-$(CONFIG_USB_GOKU) += goku_udc.o
 obj-$(CONFIG_USB_OMAP) += omap_udc.o
 obj-$(CONFIG_USB_LH7A40X)  += lh7a40x_udc.o
+obj-$(CONFIG_USB_S3C2410)  += s3c2410_udc.o
 obj-$(CONFIG_USB_AT91) += at91_udc.o
 obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
 obj-$(CONFIG_USB_M66592)   += m66592-udc.o
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
new file mode 100644
index 000..d60748a
--- /dev/null
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -0,0 +1,2078 @@
+/*
+ * linux/drivers/usb/gadget/s3c2410_udc.c
+ *
+ * Samsung S3C24xx series on-chip full speed USB device controllers
+ *
+ * Copyright (C) 2004-2007 Herbert P�tzl - Arnaud Patard
+ * Additional cleanups by Ben Dooks <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "s3c2410_udc.h"
+
+#define DRIVER_DESC"S3C2410 USB Device Controller Gadget"
+#define DRIVER_VERSION "29 Apr 2007"
+#define DRIVER_AUTHOR  "Herbert P�tzl <[EMAIL PROTECTED]>, " \
+   "Arnaud Patard <[EMAIL PROTECTED]>"
+
+static const char  gadget_name[] = "s3c2410_udc";
+static const char  driver_desc[] = DRIVER_DESC;
+
+static struct s3c2410_udc  *the_controller;
+static struct clk  *udc_clock;
+static struct clk  *usb_bus_clock;
+static void __iomem   

USB: PS3: USB system-bus rework

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7a4eb7fd50d4df99fc1f623e6d90680d9fca3d82
Commit: 7a4eb7fd50d4df99fc1f623e6d90680d9fca3d82
Parent: 59c2afa072506aae10ef93126aab651142e0c908
Author: Geoff Levand <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 20:04:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: PS3: USB system-bus rework

USB HCD glue updates to reflect the new PS3 unifed device support.
 - Fixed remove() routine.
 - Added shutdown() routine.
 - Added request_mem_region() call.
 - Fixed MODULE_ALIAS().
 - Made a proper fix for the hack done to support muti-platform in commit
   48fda45120a819ca40cadc50144b55bff1c4c78d.

Signed-off-by: Geoff Levand <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/host/ehci-hcd.c |   22 +++---
 drivers/usb/host/ehci-ps3.c |   86 --
 drivers/usb/host/ohci-hcd.c |   20 +++---
 drivers/usb/host/ohci-ps3.c |   87 +--
 4 files changed, 162 insertions(+), 53 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a205a53..c4e15ed 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -41,10 +41,6 @@
 #include 
 #include 
 #include 
-#ifdef CONFIG_PPC_PS3
-#include 
-#endif
-
 
 /*-*/
 
@@ -1012,7 +1008,7 @@ MODULE_LICENSE ("GPL");
 
 #ifdef CONFIG_PPC_PS3
 #include "ehci-ps3.c"
-#definePS3_SYSTEM_BUS_DRIVER   ps3_ehci_sb_driver
+#definePS3_SYSTEM_BUS_DRIVER   ps3_ehci_driver
 #endif
 
 #ifdef CONFIG_440EPX
@@ -1051,18 +1047,15 @@ static int __init ehci_hcd_init(void)
 #endif
 
 #ifdef PS3_SYSTEM_BUS_DRIVER
-   if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
-   retval = ps3_system_bus_driver_register(
-   &PS3_SYSTEM_BUS_DRIVER);
-   if (retval < 0) {
+   retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER);
+   if (retval < 0) {
 #ifdef PLATFORM_DRIVER
-   platform_driver_unregister(&PLATFORM_DRIVER);
+   platform_driver_unregister(&PLATFORM_DRIVER);
 #endif
 #ifdef PCI_DRIVER
-   pci_unregister_driver(&PCI_DRIVER);
+   pci_unregister_driver(&PCI_DRIVER);
 #endif
-   return retval;
-   }
+   return retval;
}
 #endif
 
@@ -1079,8 +1072,7 @@ static void __exit ehci_hcd_cleanup(void)
pci_unregister_driver(&PCI_DRIVER);
 #endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
-   if (firmware_has_feature(FW_FEATURE_PS3_LV1))
-   ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
+   ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
 #endif
 }
 module_exit(ehci_hcd_cleanup);
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 37b83ba..829fe64 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -18,6 +18,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include 
 #include 
 
 static int ps3_ehci_hc_reset(struct usb_hcd *hcd)
@@ -73,7 +74,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
 #endif
 };
 
-static int ps3_ehci_sb_probe(struct ps3_system_bus_device *dev)
+static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
 {
int result;
struct usb_hcd *hcd;
@@ -85,13 +86,30 @@ static int ps3_ehci_sb_probe(struct ps3_system_bus_device 
*dev)
goto fail_start;
}
 
+   result = ps3_open_hv_device(dev);
+
+   if (result) {
+   dev_dbg(&dev->core, "%s:%d: ps3_open_hv_device failed\n",
+   __func__, __LINE__);
+   goto fail_open;
+   }
+
+   result = ps3_dma_region_create(dev->d_region);
+
+   if (result) {
+   dev_dbg(&dev->core, "%s:%d: ps3_dma_region_create failed: "
+   "(%d)\n", __func__, __LINE__, result);
+   BUG_ON("check region type");
+   goto fail_dma_region;
+   }
+
result = ps3_mmio_region_create(dev->m_region);
 
if (result) {
dev_dbg(&dev->core, "%s:%d: ps3_map_mmio_region failed\n",
__func__, __LINE__);
result = -EPERM;
-   goto fail_mmio;
+   goto fail_mmio_region;
}
 
dev_dbg(&dev->core, "%s:%d: mmio mapped_addr %lxh\n", __func__,
@@ -120,6 +138,11 @@ static int ps3_ehci_sb_probe(struct ps3_system_bus_device 
*dev)
 
hcd->rsrc_start = dev->m_region->lpar_addr;
hcd->rsrc_len = dev->m_region->len;
+
+   if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name))
+   dev_dbg(&de

USB: option: fix usage of urb->status abuse

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59c2afa072506aae10ef93126aab651142e0c908
Commit: 59c2afa072506aae10ef93126aab651142e0c908
Parent: 4365831dadfeeeb4c9f8c4944e48ccf78c27f845
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 16:46:26 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: option: fix usage of urb->status abuse

Might fix bug 8561

On Mon, 4 Jun 2007, Paulo Pereira wrote:

> The patch that you send is not resolving the problem... :(
> I stil have Kernel panic after 45/60 min of work with Ktorrent/Amule...
>
> The Drump is:
>
> Call Trace:
> [] usb_hcd_submit+0xb1/0x763
> [] ipt_do_table+0x2c7/0x2ef [ip_tables]
> [] nf_ct_deliver_cached_events+0x41/0x96 [nf_conntrak]
> [] ipv4_confirm+0x36/0c3b [nf_conntrack_ipv4]
> [] tcp_v4_rcv+0x827/0x899
> [] nf_hook_slow+0x4d/0xb5
> [] irq_enter+0x19/0x23
> [] irq_enter+0x19/0x23
> [] do_IRQ+0xbd/0xd1
> [] option_write+0xa7/0xef [option]

Okay, from this it looks like there's a problem in the option.c serial
driver.  Glancing at the code, it's obvious why: The thing totally
abuses the USB API.

Try applying this patch; it should help.

From: Alan Stern <[EMAIL PROTECTED]>
Cc: Paulo Pereira <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/option.c |   20 +---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 5d3999e..b37d65f 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -240,6 +241,7 @@ struct option_port_private {
/* Output endpoints and buffer for this port */
struct urb *out_urbs[N_OUT_URB];
char out_buffer[N_OUT_URB][OUT_BUFLEN];
+   unsigned long out_busy; /* Bit vector of URBs in use */
 
/* Settings for the port */
int rts_state;  /* Handshaking pins (outputs) */
@@ -370,7 +372,7 @@ static int option_write(struct usb_serial_port *port,
todo = OUT_BUFLEN;
 
this_urb = portdata->out_urbs[i];
-   if (this_urb->status == -EINPROGRESS) {
+   if (test_and_set_bit(i, &portdata->out_busy)) {
if (time_before(jiffies,
portdata->tx_start_time[i] + 10 * HZ))
continue;
@@ -394,6 +396,7 @@ static int option_write(struct usb_serial_port *port,
dbg("usb_submit_urb %p (write bulk) failed "
"(%d, has %d)", this_urb,
err, this_urb->status);
+   clear_bit(i, &portdata->out_busy);
continue;
}
portdata->tx_start_time[i] = jiffies;
@@ -446,12 +449,23 @@ static void option_indat_callback(struct urb *urb)
 static void option_outdat_callback(struct urb *urb)
 {
struct usb_serial_port *port;
+   struct option_port_private *portdata;
+   int i;
 
dbg("%s", __FUNCTION__);
 
port = (struct usb_serial_port *) urb->context;
 
usb_serial_port_softint(port);
+
+   portdata = usb_get_serial_port_data(port);
+   for (i = 0; i < N_OUT_URB; ++i) {
+   if (portdata->out_urbs[i] == urb) {
+   smp_mb__before_clear_bit();
+   clear_bit(i, &portdata->out_busy);
+   break;
+   }
+   }
 }
 
 static void option_instat_callback(struct urb *urb)
@@ -518,7 +532,7 @@ static int option_write_room(struct usb_serial_port *port)
 
for (i=0; i < N_OUT_URB; i++) {
this_urb = portdata->out_urbs[i];
-   if (this_urb && this_urb->status != -EINPROGRESS)
+   if (this_urb && !test_bit(i, &portdata->out_busy))
data_len += OUT_BUFLEN;
}
 
@@ -537,7 +551,7 @@ static int option_chars_in_buffer(struct usb_serial_port 
*port)
 
for (i=0; i < N_OUT_URB; i++) {
this_urb = portdata->out_urbs[i];
-   if (this_urb && this_urb->status == -EINPROGRESS)
+   if (this_urb && test_bit(i, &portdata->out_busy))
data_len += this_urb->transfer_buffer_length;
}
dbg("%s: %d", __FUNCTION__, data_len);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: fsl_usb2_udc: Get max ep number from DCCPARAMS register

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4365831dadfeeeb4c9f8c4944e48ccf78c27f845
Commit: 4365831dadfeeeb4c9f8c4944e48ccf78c27f845
Parent: 37b5453dd4dafccec3fad636c28f1c3e3e14354f
Author: Li Yang <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 6 21:13:44 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: fsl_usb2_udc: Get max ep number from DCCPARAMS register

Currently the driver is expecting max ep number in platform
data which isn't passing this information.  This patch fix
the problem by reading it from DCCPARAMS(Device Controller
Capability Parameters) register.  The change also need some
reordering of the probe code.

Signed-off-by: Li Yang <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/fsl_usb2_udc.c |   59 +---
 drivers/usb/gadget/fsl_usb2_udc.h |4 ++
 2 files changed, 38 insertions(+), 25 deletions(-)

diff --git a/drivers/usb/gadget/fsl_usb2_udc.c 
b/drivers/usb/gadget/fsl_usb2_udc.c
index 5ea32c3..e4aa29f 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -2189,27 +2189,19 @@ static void fsl_udc_release(struct device *dev)
  * init resource for globle controller
  * Return the udc handle on success or NULL on failure
  --*/
-static struct fsl_udc *__init struct_udc_setup(struct platform_device *pdev)
+static int __init struct_udc_setup(struct fsl_udc *udc,
+   struct platform_device *pdev)
 {
-   struct fsl_udc *udc;
struct fsl_usb2_platform_data *pdata;
size_t size;
 
-   udc = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);
-   if (udc == NULL) {
-   ERR("malloc udc failed\n");
-   return NULL;
-   }
-
pdata = pdev->dev.platform_data;
udc->phy_mode = pdata->phy_mode;
-   /* max_ep_nr is bidirectional ep number, max_ep doubles the number */
-   udc->max_ep = pdata->max_ep_nr * 2;
 
udc->eps = kzalloc(sizeof(struct fsl_ep) * udc->max_ep, GFP_KERNEL);
if (!udc->eps) {
ERR("malloc fsl_ep failed\n");
-   goto cleanup;
+   return -1;
}
 
/* initialized QHs, take care of alignment */
@@ -2225,7 +2217,7 @@ static struct fsl_udc *__init struct_udc_setup(struct 
platform_device *pdev)
if (!udc->ep_qh) {
ERR("malloc QHs for udc failed\n");
kfree(udc->eps);
-   goto cleanup;
+   return -1;
}
 
udc->ep_qh_size = size;
@@ -2244,11 +2236,7 @@ static struct fsl_udc *__init struct_udc_setup(struct 
platform_device *pdev)
udc->remote_wakeup = 0; /* default to 0 on reset */
spin_lock_init(&udc->lock);
 
-   return udc;
-
-cleanup:
-   kfree(udc);
-   return NULL;
+   return 0;
 }
 
 /*
@@ -2287,35 +2275,37 @@ static int __init struct_ep_setup(struct fsl_udc *udc, 
unsigned char index,
 }
 
 /* Driver probe function
- * all intialize operations implemented here except enabling usb_intr reg
+ * all intialization operations implemented here except enabling usb_intr reg
+ * board setup should have been done in the platform code
  */
 static int __init fsl_udc_probe(struct platform_device *pdev)
 {
struct resource *res;
int ret = -ENODEV;
unsigned int i;
+   u32 dccparams;
 
if (strcmp(pdev->name, driver_name)) {
VDBG("Wrong device\n");
return -ENODEV;
}
 
-   /* board setup should have been done in the platform code */
-
-   /* Initialize the udc structure including QH member and other member */
-   udc_controller = struct_udc_setup(pdev);
-   if (!udc_controller) {
-   VDBG("udc_controller is NULL \n");
+   udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);
+   if (udc_controller == NULL) {
+   ERR("malloc udc failed\n");
return -ENOMEM;
}
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
+   if (!res) {
+   kfree(udc_controller);
return -ENXIO;
+   }
 
if (!request_mem_region(res->start, res->end - res->start + 1,
driver_name)) {
ERR("request mem region for %s failed \n", pdev->name);
+   kfree(udc_controller);
return -EBUSY;
}
 
@@ -2328,6 +2318,17 @@ static int __init fsl_udc_probe(struct platform_device 
*pdev)
usb_sys_regs = (struct usb_sys_interface *)
((u32)dr_regs + USB_DR_SYS_OFFSET);
 
+   /* Read Device Controller Capability Paramete

USB: fsl_usb2_udc: replace deprecated irq flag

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=37b5453dd4dafccec3fad636c28f1c3e3e14354f
Commit: 37b5453dd4dafccec3fad636c28f1c3e3e14354f
Parent: b41a60eca833d76593d4dac8a59f5c38714194ee
Author: Li Yang <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 7 16:07:18 2007 +0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: fsl_usb2_udc: replace deprecated irq flag

Signed-off-by: Li Yang <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/fsl_usb2_udc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/fsl_usb2_udc.c 
b/drivers/usb/gadget/fsl_usb2_udc.c
index 3ca2b31..5ea32c3 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -2334,7 +2334,7 @@ static int __init fsl_udc_probe(struct platform_device 
*pdev)
goto err2;
}
 
-   ret = request_irq(udc_controller->irq, fsl_udc_irq, SA_SHIRQ,
+   ret = request_irq(udc_controller->irq, fsl_udc_irq, IRQF_SHARED,
driver_name, udc_controller);
if (ret != 0) {
ERR("cannot request irq %d err %d \n",
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB: add power/persist device attribute

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b41a60eca833d76593d4dac8a59f5c38714194ee
Commit: b41a60eca833d76593d4dac8a59f5c38714194ee
Parent: 54515fe528d8c6f9bfaf7d0b9fffb908deecad78
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 15:39:33 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: add power/persist device attribute

This patch (as920) adds an extra level of protection to the
USB-Persist facility.  Now it will apply by default only to hubs; for
all other devices the user must enable it explicitly by setting the
power/persist device attribute.

The disconnect_all_children() routine in hub.c has been removed and
its code placed inline.  This is the way it was originally as part of
hub_pre_reset(); the revised usage in hub_reset_resume() is
sufficiently different that the code can no longer be shared.
Likewise, mark_children_for_reset() is now inline as part of
hub_reset_resume().  The end result looks much cleaner than before.

The sysfs interface is updated to add the new attribute file, and
there are corresponding documentation updates.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 Documentation/ABI/testing/sysfs-bus-usb |   13 +
 Documentation/usb/persist.txt   |   38 ++-
 drivers/usb/core/Kconfig|   13 +++--
 drivers/usb/core/hub.c  |   78 +++---
 drivers/usb/core/sysfs.c|   75 +-
 include/linux/usb.h |1 +
 6 files changed, 149 insertions(+), 69 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-usb 
b/Documentation/ABI/testing/sysfs-bus-usb
index f9937ad..9734577 100644
--- a/Documentation/ABI/testing/sysfs-bus-usb
+++ b/Documentation/ABI/testing/sysfs-bus-usb
@@ -39,3 +39,16 @@ Description:
If you want to suspend a device immediately but leave it
free to wake up in response to I/O requests, you should
write "0" to power/autosuspend.
+
+What:  /sys/bus/usb/devices/.../power/persist
+Date:  May 2007
+KernelVersion: 2.6.23
+Contact:   Alan Stern <[EMAIL PROTECTED]>
+Description:
+   If CONFIG_USB_PERSIST is set, then each USB device directory
+   will contain a file named power/persist.  The file holds a
+   boolean value (0 or 1) indicating whether or not the
+   "USB-Persist" facility is enabled for the device.  Since the
+   facility is inherently dangerous, it is disabled by default
+   for all devices except hubs.  For more information, see
+   Documentation/usb/persist.txt.
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt
index 6dcd5f8..df54d64 100644
--- a/Documentation/usb/persist.txt
+++ b/Documentation/usb/persist.txt
@@ -2,7 +2,7 @@
 
   Alan Stern <[EMAIL PROTECTED]>
 
-September 2, 2006 (Updated March 27, 2007)
+September 2, 2006 (Updated May 29, 2007)
 
 
What is the problem?
@@ -52,9 +52,9 @@ you can convince the BIOS supplier to fix the problem (lots 
of luck!).
 
 On many systems the USB host controllers will get reset after a
 suspend-to-RAM.  On almost all systems, no suspend current is
-available during suspend-to-disk (also known as swsusp).  You can
-check the kernel log after resuming to see if either of these has
-happened; look for lines saying "root hub lost power or was reset".
+available during hibernation (also known as swsusp or suspend-to-disk).
+You can check the kernel log after resuming to see if either of these
+has happened; look for lines saying "root hub lost power or was reset".
 
 In practice, people are forced to unmount any filesystems on a USB
 device before suspending.  If the root filesystem is on a USB device,
@@ -71,15 +71,16 @@ structures are allowed to persist across a power-session 
disruption.
 It works like this.  If the kernel sees that a USB host controller is
 not in the expected state during resume (i.e., if the controller was
 reset or otherwise had lost power) then it applies a persistence check
-to each of the USB devices below that controller.  It doesn't try to
-resume the device; that can't work once the power session is gone.
-Instead it issues a USB port reset and then re-enumerates the device.
-(This is exactly the same thing that happens whenever a USB device is
-reset.)  If the re-enumeration shows that the device now attached to
-that port has the same descriptors as before, including the Vendor and
-Product IDs, then the kernel continues to use the same device
-structure.  In effect, the kernel treats the device as though it had
-merely been reset instead of unplugged.
+to each

USB: unify reset_resume and normal resume

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54515fe528d8c6f9bfaf7d0b9fffb908deecad78
Commit: 54515fe528d8c6f9bfaf7d0b9fffb908deecad78
Parent: f07600cf9eb3ee92777b2001e564faa413144a99
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 15:38:58 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: unify reset_resume and normal resume

This patch (as919) unifies the code paths used for normal resume and
for reset-resume.  Earlier I had failed to note a section in the USB
spec which requires the host to resume a suspended port before
resetting it if the attached device is enabled for remote wakeup.
Since the port has to be resumed anyway, we might as well reuse the
existing code.

The main changes are:

usb_reset_suspended_device() is eliminated.

usb_root_hub_lost_power() is moved down next to the
hub_reset_resume() routine, to which it is logically
related.

finish_port_resume() does a port reset() if the device's
reset_resume flag is set.

usb_port_resume() doesn't check whether the port is initially
enabled if this is a USB-Persist sort of resume.

Code to perform the port reset is added to the resume pathway
for the non-CONFIG_USB_SUSPEND case.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/generic.c |2 -
 drivers/usb/core/hub.c |  184 ++--
 drivers/usb/core/usb.h |1 -
 3 files changed, 93 insertions(+), 94 deletions(-)

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 4cbe7b3..b2fc2b1 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -219,8 +219,6 @@ static int generic_resume(struct usb_device *udev)
 */
if (!udev->parent)
rc = hcd_bus_resume(udev);
-   else if (udev->reset_resume)
-   rc = usb_reset_suspended_device(udev);
else
rc = usb_port_resume(udev);
return rc;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0b8ed41..c4cdb69 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -31,6 +31,12 @@
 #include "hcd.h"
 #include "hub.h"
 
+#ifdef CONFIG_USB_PERSIST
+#defineUSB_PERSIST 1
+#else
+#defineUSB_PERSIST 0
+#endif
+
 struct usb_hub {
struct device   *intfdev;   /* the "interface" device */
struct usb_device   *hdev;
@@ -1080,72 +1086,6 @@ void usb_set_device_state(struct usb_device *udev,
spin_unlock_irqrestore(&device_state_lock, flags);
 }
 
-
-#ifdef CONFIG_PM
-
-/**
- * usb_reset_suspended_device - reset a suspended device instead of resuming it
- * @udev: device to be reset instead of resumed
- *
- * If a host controller doesn't maintain VBUS suspend current during a
- * system sleep or is reset when the system wakes up, all the USB
- * power sessions below it will be broken.  This is especially troublesome
- * for mass-storage devices containing mounted filesystems, since the
- * device will appear to have disconnected and all the memory mappings
- * to it will be lost.
- *
- * As an alternative, this routine attempts to recover power sessions for
- * devices that are still present by resetting them instead of resuming
- * them.  If all goes well, the devices will appear to persist across the
- * the interruption of the power sessions.
- *
- * This facility is inherently dangerous.  Although usb_reset_device()
- * makes every effort to insure that the same device is present after the
- * reset as before, it cannot provide a 100% guarantee.  Furthermore it's
- * quite possible for a device to remain unaltered but its media to be
- * changed.  If the user replaces a flash memory card while the system is
- * asleep, he will have only himself to blame when the filesystem on the
- * new card is corrupted and the system crashes.
- */
-int usb_reset_suspended_device(struct usb_device *udev)
-{
-   int rc = 0;
-
-   dev_dbg(&udev->dev, "usb %sresume\n", "reset-");
-
-   /* After we're done the device won't be suspended any more.
-* In addition, the reset won't work if udev->state is SUSPENDED.
-*/
-   usb_set_device_state(udev, udev->actconfig
-   ? USB_STATE_CONFIGURED
-   : USB_STATE_ADDRESS);
-
-   /* Root hubs don't need to be (and can't be) reset */
-   if (udev->parent)
-   rc = usb_reset_device(udev);
-   return rc;
-}
-
-/**
- * usb_root_hub_lost_power - called by HCD if the root hub lost Vbus power
- * @rhdev: struct usb_device for the root hub
- *
- * The USB host controller driver calls this function when its root hub
- * is resumed and Vbus power has been interrup

USB: add reset_resume method

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f07600cf9eb3ee92777b2001e564faa413144a99
Commit: f07600cf9eb3ee92777b2001e564faa413144a99
Parent: 624d6c0732d2c4ac00945ad79dbb6ff39ba90ee3
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 15:38:16 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:30 2007 -0700

USB: add reset_resume method

This patch (as918) introduces a new USB driver method: reset_resume.
It is called when a device needs to be reset as part of a resume
procedure (whether because of a device quirk or because of the
USB-Persist facility), thereby taking over a role formerly assigned to
the post_reset method.  As a consequence, post_reset no longer needs
an argument indicating whether it is being called as part of a
reset-resume.  This separation of functions makes the code clearer.

In addition, the pre_reset and post_reset method return types are
changed; they now must return an error code.  The return value is
unused at present, but at some later time we may unbind drivers and
re-probe if they encounter an error during reset handling.

The existing pre_reset and post_reset methods in the usbhid,
usb-storage, and hub drivers are updated to match the new
requirements.  For usbhid the post_reset routine is also used for
reset_resume (duplicate method pointers); for the other drivers a new
reset_resume routine is added.  The change to hub.c looks bigger than
it really is, because mark_children_for_reset_resume() gets moved down
next to the new hub_reset_resume() routine.

A minor change to usb-storage makes the usb_stor_report_bus_reset()
routine acquire the host lock instead of requiring the caller to hold
it already.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]>
CC: Matthew Dharm <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/hid/usbhid/hid-core.c  |9 ++-
 drivers/usb/core/driver.c  |   51 ++
 drivers/usb/core/hub.c |  117 +--
 drivers/usb/storage/scsiglue.c |8 ++-
 drivers/usb/storage/usb.c  |   28 +++---
 include/linux/usb.h|7 ++-
 6 files changed, 140 insertions(+), 80 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index e221b0d..b2baeae 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1009,20 +1009,22 @@ static int hid_resume(struct usb_interface *intf)
 }
 
 /* Treat USB reset pretty much the same as suspend/resume */
-static void hid_pre_reset(struct usb_interface *intf)
+static int hid_pre_reset(struct usb_interface *intf)
 {
/* FIXME: What if the interface is already suspended? */
hid_suspend(intf, PMSG_ON);
+   return 0;
 }
 
-static void hid_post_reset(struct usb_interface *intf, int reset_resume)
+/* Same routine used for post_reset and reset_resume */
+static int hid_post_reset(struct usb_interface *intf)
 {
struct usb_device *dev = interface_to_usbdev (intf);
 
hid_set_idle(dev, intf->cur_altsetting->desc.bInterfaceNumber, 0, 0);
/* FIXME: Any more reinitialization needed? */
 
-   hid_resume(intf);
+   return hid_resume(intf);
 }
 
 static struct usb_device_id hid_usb_ids [] = {
@@ -1039,6 +1041,7 @@ static struct usb_driver hid_driver = {
.disconnect =   hid_disconnect,
.suspend =  hid_suspend,
.resume =   hid_resume,
+   .reset_resume = hid_post_reset,
.pre_reset =hid_pre_reset,
.post_reset =   hid_post_reset,
.id_table = hid_usb_ids,
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 6c62a6d..3cd9af2 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -915,21 +915,37 @@ static int usb_resume_interface(struct usb_interface 
*intf, int reset_resume)
}
driver = to_usb_driver(intf->dev.driver);
 
-   if (reset_resume && driver->post_reset)
-   driver->post_reset(intf, reset_resume);
-   else if (driver->resume) {
-   status = driver->resume(intf);
-   if (status)
-   dev_err(&intf->dev, "%s error %d\n",
-   "resume", status);
-   } else
-   dev_warn(&intf->dev, "no resume for driver %s?\n",
-   driver->name);
+   if (reset_resume) {
+   if (driver->reset_resume) {
+   status = driver->reset_resume(intf);
+   if (status)
+   dev_err(&intf->dev, "%s error %d\n",
+   "reset_resume", status);
+   } else {
+   // status = -

USB: remove excess code from hub.c

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=624d6c0732d2c4ac00945ad79dbb6ff39ba90ee3
Commit: 624d6c0732d2c4ac00945ad79dbb6ff39ba90ee3
Parent: 686314cfbdac21c9019c0e04487b5d940db62406
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 15:35:16 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:29 2007 -0700

USB: remove excess code from hub.c

This patch (as917) removes a now-unnecessary level of subroutine
nesting from hub.c.  Since usb_port_suspend() does nothing but call
hub_port_suspend(), and usb_port_resume() does nothing but call
hub_port_resume(), there's no reason to keep the routines separate.

Also included in the patch are a few cosmetic changes involving
whitespace and use of braces.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/hub.c |  175 +++
 1 files changed, 71 insertions(+), 104 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index ac1ef15..ca3dbf8 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1625,6 +1625,19 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
 #ifdef CONFIG_USB_SUSPEND
 
 /*
+ * usb_port_suspend - suspend a usb device's upstream port
+ * @udev: device that's no longer in active use, not a root hub
+ * Context: must be able to sleep; device not locked; pm locks held
+ *
+ * Suspends a USB device that isn't in active use, conserving power.
+ * Devices may wake out of a suspend, if anything important happens,
+ * using the remote wakeup mechanism.  They may also be taken out of
+ * suspend by the host, using usb_port_resume().  It's also routine
+ * to disconnect devices while they are suspended.
+ *
+ * This only affects the USB hardware for a device; its interfaces
+ * (and, for hubs, child devices) must already have been suspended.
+ *
  * Selective port suspend reduces power; most suspended devices draw
  * less than 500 uA.  It's also used in OTG, along with remote wakeup.
  * All devices below the suspended port are also suspended.
@@ -1633,11 +1646,35 @@ static int hub_port_reset(struct usb_hub *hub, int 
port1,
  * also support "remote wakeup", where the device can activate the USB
  * tree above them to deliver data, such as a keypress or packet.  In
  * some cases, this wakes the USB host.
+ *
+ * Suspending OTG devices may trigger HNP, if that's been enabled
+ * between a pair of dual-role devices.  That will change roles, such
+ * as from A-Host to A-Peripheral or from B-Host back to B-Peripheral.
+ *
+ * Devices on USB hub ports have only one "suspend" state, corresponding
+ * to ACPI D2, "may cause the device to lose some context".
+ * State transitions include:
+ *
+ *   - suspend, resume ... when the VBUS power link stays live
+ *   - suspend, disconnect ... VBUS lost
+ *
+ * Once VBUS drop breaks the circuit, the port it's using has to go through
+ * normal re-enumeration procedures, starting with enabling VBUS power.
+ * Other than re-initializing the hub (plug/unplug, except for root hubs),
+ * Linux (2.6) currently has NO mechanisms to initiate that:  no khubd
+ * timer, no SRP, no requests through sysfs.
+ *
+ * If CONFIG_USB_SUSPEND isn't enabled, devices only really suspend when
+ * the root hub for their bus goes into global suspend ... so we don't
+ * (falsely) update the device power state to say it suspended.
+ *
+ * Returns 0 on success, else negative errno.
  */
-static int hub_port_suspend(struct usb_hub *hub, int port1,
-   struct usb_device *udev)
+int usb_port_suspend(struct usb_device *udev)
 {
-   int status;
+   struct usb_hub  *hub = hdev_to_hub(udev->parent);
+   int port1 = udev->portnum;
+   int status;
 
// dev_dbg(hub->intfdev, "suspend port %d\n", port1);
 
@@ -1654,17 +1691,15 @@ static int hub_port_suspend(struct usb_hub *hub, int 
port1,
NULL, 0,
USB_CTRL_SET_TIMEOUT);
if (status)
-   dev_dbg(&udev->dev,
-   "won't remote wakeup, status %d\n",
-   status);
+   dev_dbg(&udev->dev, "won't remote wakeup, status %d\n",
+   status);
}
 
/* see 7.1.7.6 */
status = set_port_feature(hub->hdev, port1, USB_PORT_FEAT_SUSPEND);
if (status) {
-   dev_dbg(hub->intfdev,
-   "can't suspend port %d, status %d\n",
-   port1, status);
+   dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n",
+   port1, status);
/* paranoia:  "should not happen" */
(void) usb_control_msg(udev, usb_sndc

USB: separate root and non-root suspend/resume

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=686314cfbdac21c9019c0e04487b5d940db62406
Commit: 686314cfbdac21c9019c0e04487b5d940db62406
Parent: 4956eccdd6101c5abb71966079e8183d12796d6c
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 15:34:36 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:29 2007 -0700

USB: separate root and non-root suspend/resume

This patch (as916) completes the separation of code paths for suspend
and resume of root hubs as opposed to non-root devices.  Root hubs
will be power-managed through their bus_suspend and bus_resume
methods, whereas normal devices will use usb_port_suspend() and
usb_port_resume().

Changes to the hcd_bus_{suspend,resume} routines mostly represent
motion of code that was already present elsewhere.  They include:

Adding debugging log messages,

Setting the device state appropriately, and

Adding a resume recovery time delay.

Changes to the port-suspend and port-resume routines in hub.c include:

Removal of checks for root devices (since they will never
be triggered), and

Removal of checks for NULL or invalid device pointers (these
were left over from earlier kernel versions and aren't needed
at all).

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/generic.c |   45 +
 drivers/usb/core/hcd.c |   52 +++
 drivers/usb/core/hcd.h |   14 +--
 drivers/usb/core/hub.c |   42 ++
 4 files changed, 59 insertions(+), 94 deletions(-)

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index d363b0e..4cbe7b3 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -196,20 +196,15 @@ static int generic_suspend(struct usb_device *udev, 
pm_message_t msg)
 {
int rc;
 
-   rc = usb_port_suspend(udev);
-
-   /* Root hubs don't have upstream ports to suspend,
-* so the line above won't do much for them.  We have to
-* shut down their downstream HC-to-USB interfaces manually,
-* by doing a bus (or "global") suspend.
+   /* Normal USB devices suspend through their upstream port.
+* Root hubs don't have upstream ports to suspend,
+* so we have to shut down their downstream HC-to-USB
+* interfaces manually by doing a bus (or "global") suspend.
 */
-   if (rc == 0 && !udev->parent) {
-   rc = hcd_bus_suspend(udev->bus);
-   if (rc) {
-   dev_dbg(&udev->dev, "'global' suspend %d\n", rc);
-   usb_port_resume(udev);
-   }
-   }
+   if (!udev->parent)
+   rc = hcd_bus_suspend(udev);
+   else
+   rc = usb_port_suspend(udev);
return rc;
 }
 
@@ -217,25 +212,17 @@ static int generic_resume(struct usb_device *udev)
 {
int rc;
 
-   if (udev->reset_resume)
+   /* Normal USB devices resume/reset through their upstream port.
+* Root hubs don't have upstream ports to resume or reset,
+* so we have to start up their downstream HC-to-USB
+* interfaces manually by doing a bus (or "global") resume.
+*/
+   if (!udev->parent)
+   rc = hcd_bus_resume(udev);
+   else if (udev->reset_resume)
rc = usb_reset_suspended_device(udev);
else
rc = usb_port_resume(udev);
-
-   /* Root hubs don't have upstream ports to resume or reset,
-* so the line above won't do much for them.  We have to
-* start up their downstream HC-to-USB interfaces manually,
-* by doing a bus (or "global") resume.
-*/
-   if (rc == 0 && !udev->parent) {
-   rc = hcd_bus_resume(udev->bus);
-   if (rc)
-   dev_dbg(&udev->dev, "'global' resume %d\n", rc);
-   else {
-   /* TRSMRCY = 10 msec */
-   msleep(10);
-   }
-   }
return rc;
 }
 
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 87d6edf..e5058fb 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1257,40 +1257,54 @@ rescan:
 
 #ifdef CONFIG_PM
 
-int hcd_bus_suspend (struct usb_bus *bus)
+int hcd_bus_suspend(struct usb_device *rhdev)
 {
-   struct usb_hcd  *hcd;
-   int status;
+   struct usb_hcd  *hcd = container_of(rhdev->bus, struct usb_hcd, self);
+   int status;
+   int old_state = hcd->state;
 
-   hcd = container_of (bus, struct usb_hcd, self);
-   if (!hcd->driver->bus_suspend)
-   return -ENOENT;
- 

USB: remove __usb_port_suspend

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4956eccdd6101c5abb71966079e8183d12796d6c
Commit: 4956eccdd6101c5abb71966079e8183d12796d6c
Parent: d576bb9f2769b315a795f77f0c33322a976add7a
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 16:51:28 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:29 2007 -0700

USB: remove __usb_port_suspend

This patch (as915b) combines the public routine usb_port_suspend() and
the private routine __usb_port_suspend() into a single function.

By removing the explicit mention of otg_port in the call to
__usb_port_suspend(), we prevent a possible error in which the system
tries to perform HNP on the wrong port when a non-targeted device is
plugged into a non-OTG port.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/hub.c |   57 +++
 drivers/usb/core/usb.h |   12 -
 2 files changed, 33 insertions(+), 36 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7946d7b..04d6fde 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1333,7 +1333,6 @@ static inline void show_string(struct usb_device *udev, 
char *id, char *string)
 
 #ifdef CONFIG_USB_OTG
 #include "otg_whitelist.h"
-static int __usb_port_suspend(struct usb_device *, int port1);
 #endif
 
 /**
@@ -1439,7 +1438,7 @@ int usb_new_device(struct usb_device *udev)
 * (Includes HNP test device.)
 */
if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
-   err = __usb_port_suspend(udev, udev->bus->otg_port);
+   err = usb_port_suspend(udev);
if (err < 0)
dev_dbg(&udev->dev, "HNP fail, %d\n", err);
}
@@ -1683,6 +1682,23 @@ static int hub_port_suspend(struct usb_hub *hub, int 
port1,
 }
 
 /*
+ * usb_port_suspend - suspend a usb device's upstream port
+ * @udev: device that's no longer in active use
+ * Context: must be able to sleep; device not locked; pm locks held
+ *
+ * Suspends a USB device that isn't in active use, conserving power.
+ * Devices may wake out of a suspend, if anything important happens,
+ * using the remote wakeup mechanism.  They may also be taken out of
+ * suspend by the host, using usb_port_resume().  It's also routine
+ * to disconnect devices while they are suspended.
+ *
+ * This only affects the USB hardware for a device; its interfaces
+ * (and, for hubs, child devices) must already have been suspended.
+ *
+ * Suspending OTG devices may trigger HNP, if that's been enabled
+ * between a pair of dual-role devices.  That will change roles, such
+ * as from A-Host to A-Peripheral or from B-Host back to B-Peripheral.
+ *
  * Devices on USB hub ports have only one "suspend" state, corresponding
  * to ACPI D2, "may cause the device to lose some context".
  * State transitions include:
@@ -1699,21 +1715,19 @@ static int hub_port_suspend(struct usb_hub *hub, int 
port1,
  * If CONFIG_USB_SUSPEND isn't enabled, devices only really suspend when
  * the root hub for their bus goes into global suspend ... so we don't
  * (falsely) update the device power state to say it suspended.
+ *
+ * Returns 0 on success, else negative errno.
  */
-static int __usb_port_suspend (struct usb_device *udev, int port1)
+int usb_port_suspend(struct usb_device *udev)
 {
int status = 0;
 
-   /* caller owns the udev device lock */
-   if (port1 < 0)
-   return port1;
-
/* we change the device's upstream USB link,
 * but root hubs have no upstream USB link.
 */
if (udev->parent)
-   status = hub_port_suspend(hdev_to_hub(udev->parent), port1,
-   udev);
+   status = hub_port_suspend(hdev_to_hub(udev->parent),
+   udev->portnum, udev);
else {
dev_dbg(&udev->dev, "usb %ssuspend\n",
udev->auto_pm ? "auto-" : "");
@@ -1723,31 +1737,6 @@ static int __usb_port_suspend (struct usb_device *udev, 
int port1)
 }
 
 /*
- * usb_port_suspend - suspend a usb device's upstream port
- * @udev: device that's no longer in active use
- * Context: must be able to sleep; device not locked; pm locks held
- *
- * Suspends a USB device that isn't in active use, conserving power.
- * Devices may wake out of a suspend, if anything important happens,
- * using the remote wakeup mechanism.  They may also be taken out of
- * suspend by the host, using usb_port_resume().  It's also routine
- * to disconnect devices while they are suspended.
- *
- * This only affects the USB hardware for a device; its interfaces
- * (and, for hubs, child devices) must already have been suspended.
- *

USB: Fix NEC OHCI chip silicon bug

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d576bb9f2769b315a795f77f0c33322a976add7a
Commit: d576bb9f2769b315a795f77f0c33322a976add7a
Parent: 020363384adfb02f26c1c038a127ed3da3d5cf37
Author: Michael Hanselmann <[EMAIL PROTECTED]>
AuthorDate: Thu May 31 23:34:27 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:29 2007 -0700

USB: Fix NEC OHCI chip silicon bug

This patch fixes a silicon bug in some NEC OHCI chips. The bug appears
at random times and is very, very difficult to reproduce. Without the
following patch, Linux would shut the chip and its associated devices
down. In Apple PowerBooks this leads to an unusable keyboard and mouse
(SSH still working). The idea of restarting the chip is taken from
public Darwin code.

Signed-off-by: Michael Hanselmann <[EMAIL PROTECTED]>
Cc: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/host/ohci-hcd.c |   51 --
 drivers/usb/host/ohci-hub.c |5 ++-
 drivers/usb/host/ohci-mem.c |1 +
 drivers/usb/host/ohci-pci.c |   16 +
 drivers/usb/host/ohci.h |2 +
 5 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index ce05e5f..44717fa 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -82,6 +83,8 @@ static const char hcd_name [] = "ohci_hcd";
 static void ohci_dump (struct ohci_hcd *ohci, int verbose);
 static int ohci_init (struct ohci_hcd *ohci);
 static void ohci_stop (struct usb_hcd *hcd);
+static int ohci_restart (struct ohci_hcd *ohci);
+static void ohci_quirk_nec_worker (struct work_struct *work);
 
 #include "ohci-hub.c"
 #include "ohci-dbg.c"
@@ -651,9 +654,20 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
}
 
if (ints & OHCI_INTR_UE) {
-   disable (ohci);
-   ohci_err (ohci, "OHCI Unrecoverable Error, disabled\n");
// e.g. due to PCI Master/Target Abort
+   if (ohci->flags & OHCI_QUIRK_NEC) {
+   /* Workaround for a silicon bug in some NEC chips used
+* in Apple's PowerBooks. Adapted from Darwin code.
+*/
+   ohci_err (ohci, "OHCI Unrecoverable Error, scheduling 
NEC chip restart\n");
+
+   ohci_writel (ohci, OHCI_INTR_UE, ®s->intrdisable);
+
+   schedule_work (&ohci->nec_work);
+   } else {
+   disable (ohci);
+   ohci_err (ohci, "OHCI Unrecoverable Error, disabled\n");
+   }
 
ohci_dump (ohci, 1);
ohci_usb_reset (ohci);
@@ -755,23 +769,16 @@ static void ohci_stop (struct usb_hcd *hcd)
 /*-*/
 
 /* must not be called from interrupt context */
-
-#ifdef CONFIG_PM
-
 static int ohci_restart (struct ohci_hcd *ohci)
 {
int temp;
int i;
struct urb_priv *priv;
 
-   /* mark any devices gone, so they do nothing till khubd disconnects.
-* recycle any "live" eds/tds (and urbs) right away.
-* later, khubd disconnect processing will recycle the other state,
-* (either as disconnect/reconnect, or maybe someday as a reset).
-*/
spin_lock_irq(&ohci->lock);
disable (ohci);
-   usb_root_hub_lost_power(ohci_to_hcd(ohci)->self.root_hub);
+
+   /* Recycle any "live" eds/tds (and urbs). */
if (!list_empty (&ohci->pending))
ohci_dbg(ohci, "abort schedule...\n");
list_for_each_entry (priv, &ohci->pending, pending) {
@@ -822,7 +829,27 @@ static int ohci_restart (struct ohci_hcd *ohci)
ohci_dbg(ohci, "restart complete\n");
return 0;
 }
-#endif
+
+/*-*/
+
+/* NEC workaround */
+static void ohci_quirk_nec_worker(struct work_struct *work)
+{
+   struct ohci_hcd *ohci = container_of(work, struct ohci_hcd, nec_work);
+   int status;
+
+   status = ohci_init(ohci);
+   if (status != 0) {
+   ohci_err(ohci, "Restarting NEC controller failed "
+"in ohci_init, %d\n", status);
+   return;
+   }
+
+   status = ohci_restart(ohci);
+   if (status != 0)
+   ohci_err(ohci, "Restarting NEC controller failed "
+"in ohci_restart, %d\n", status);
+}
 
 /*-*/
 
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index bb9cc59..48e4b11 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/h

USB: Disable file_storage USB_CONFIG_ATT_WAKEUP

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=020363384adfb02f26c1c038a127ed3da3d5cf37
Commit: 020363384adfb02f26c1c038a127ed3da3d5cf37
Parent: d23a13779f14808b54181d31222e6c44532abd80
Author: Tony Lindgren <[EMAIL PROTECTED]>
AuthorDate: Tue May 29 09:57:41 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:29 2007 -0700

USB: Disable file_storage USB_CONFIG_ATT_WAKEUP

Disable file_storage USB_CONFIG_ATT_WAKEUP as it requires
user interaction during Chapter 9 tests.

Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]
Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
Acked-by: Alan Stern <[EMAIL PROTECTED]>
Acked-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/file_storage.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/file_storage.c 
b/drivers/usb/gadget/file_storage.c
index 4639b62..7e650d0 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3963,8 +3963,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
 #endif
 
if (gadget->is_otg) {
-   otg_desc.bmAttributes |= USB_OTG_HNP,
-   config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+   otg_desc.bmAttributes |= USB_OTG_HNP;
}
 
rc = -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   5   6   7   8   >