diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-16 16:30:09 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-16 16:30:09 -0700 |
commit | 7c8af403d262acf6bcdc877cac53ae09d0e2ad61 (patch) | |
tree | 1528732192b748d3503ed3dba686d2f56f9a46db /usb | |
parent | ae4fdf0ab440307765180d3bf027037c8a67d0ba (diff) | |
download | patches-7c8af403d262acf6bcdc877cac53ae09d0e2ad61.tar.gz |
more patches added
Diffstat (limited to 'usb')
11 files changed, 2843 insertions, 9 deletions
diff --git a/usb/usb-gadget-allow-drivers-support-speeds-higher-than-full-speed.patch b/usb/usb-gadget-allow-drivers-support-speeds-higher-than-full-speed.patch new file mode 100644 index 0000000000000..5db38883f046c --- /dev/null +++ b/usb/usb-gadget-allow-drivers-support-speeds-higher-than-full-speed.patch @@ -0,0 +1,34 @@ +From david-b@pacbell.net Tue Jun 13 21:00:58 2006 +Date: Tue, 13 Jun 2006 20:55:44 -0700 +From: Milan Svoboda <msvoboda@ra.rockwell.com> +Message-Id: <200606132055.45525.david-b@pacbell.net> +Subject: usb gadget: allow drivers support speeds higher than full speed +Date: Monday 29 May 2006 3:34 am +To: linux-usb-devel@lists.sourceforge.net + +From: Milan Svoboda <msvoboda@ra.rockwell.com> + +This patch removes limitation which prevents use of drivers that support +speeds different that full speed. + + +Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/gadget/pxa2xx_udc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/pxa2xx_udc.c ++++ gregkh-2.6/drivers/usb/gadget/pxa2xx_udc.c +@@ -1585,7 +1585,7 @@ int usb_gadget_register_driver(struct us + int retval; + + if (!driver +- || driver->speed != USB_SPEED_FULL ++ || driver->speed < USB_SPEED_FULL + || !driver->bind + || !driver->unbind + || !driver->disconnect diff --git a/usb/usb-gadget-fix-compile-errors.patch b/usb/usb-gadget-fix-compile-errors.patch new file mode 100644 index 0000000000000..d91465efb4387 --- /dev/null +++ b/usb/usb-gadget-fix-compile-errors.patch @@ -0,0 +1,44 @@ +From david-b@pacbell.net Tue Jun 13 21:00:58 2006 +From: Milan Svoboda <msvoboda@ra.rockwell.com> +Subject: usb gadget: fix compile errors +Date: Monday 29 May 2006 3:34 am +To: linux-usb-devel@lists.sourceforge.net + +From: Milan Svoboda <msvoboda@ra.rockwell.com> + +This patch fixes compile errors when pxa2xx_udc is to be compiled +for ixp4xx platform. + +Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/pxa2xx_udc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/gadget/pxa2xx_udc.c ++++ gregkh-2.6/drivers/usb/gadget/pxa2xx_udc.c +@@ -53,7 +53,9 @@ + #include <asm/mach-types.h> + #include <asm/unaligned.h> + #include <asm/hardware.h> ++#ifdef CONFIG_ARCH_PXA + #include <asm/arch/pxa-regs.h> ++#endif + + #include <linux/usb_ch9.h> + #include <linux/usb_gadget.h> +@@ -2575,10 +2577,12 @@ static int __exit pxa2xx_udc_remove(stru + free_irq(IRQ_USB, dev); + dev->got_irq = 0; + } ++#ifdef CONFIG_ARCH_LUBBOCK + if (machine_is_lubbock()) { + free_irq(LUBBOCK_USB_DISC_IRQ, dev); + free_irq(LUBBOCK_USB_IRQ, dev); + } ++#endif + platform_set_drvdata(pdev, NULL); + the_controller = NULL; + return 0; diff --git a/usb/usb-gadget-serial-do-not-save-restore-irq-flags-in-gs_close.patch b/usb/usb-gadget-serial-do-not-save-restore-irq-flags-in-gs_close.patch index 60536f894370b..ae9e61c3e0bbc 100644 --- a/usb/usb-gadget-serial-do-not-save-restore-irq-flags-in-gs_close.patch +++ b/usb/usb-gadget-serial-do-not-save-restore-irq-flags-in-gs_close.patch @@ -15,8 +15,8 @@ Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- - drivers/usb/gadget/serial.c | 17 ++++++++--------- - 1 file changed, 8 insertions(+), 9 deletions(-) + drivers/usb/gadget/serial.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) --- gregkh-2.6.orig/drivers/usb/gadget/serial.c +++ gregkh-2.6/drivers/usb/gadget/serial.c @@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> #define GS_LONG_NAME "Gadget Serial" #define GS_SHORT_NAME "g_serial" -@@ -774,12 +774,11 @@ exit_unlock_dev: +@@ -774,18 +774,16 @@ exit_unlock_dev: #define GS_WRITE_FINISHED_EVENT_SAFELY(p) \ ({ \ @@ -46,7 +46,13 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> cond; \ }) -@@ -799,7 +798,7 @@ static void gs_close(struct tty_struct * + static void gs_close(struct tty_struct *tty, struct file *file) + { +- unsigned long flags; + struct gs_port *port = tty->driver_data; + struct semaphore *sem; + +@@ -799,7 +797,7 @@ static void gs_close(struct tty_struct * sem = &gs_open_close_sem[port->port_num]; down(sem); @@ -55,7 +61,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (port->port_open_count == 0) { printk(KERN_ERR -@@ -827,11 +826,11 @@ static void gs_close(struct tty_struct * +@@ -827,11 +825,11 @@ static void gs_close(struct tty_struct * /* wait for write buffer to drain, or */ /* at most GS_CLOSE_TIMEOUT seconds */ if (gs_buf_data_avail(port->port_write_buf) > 0) { @@ -69,7 +75,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } /* free disconnected port on final close */ -@@ -851,7 +850,7 @@ static void gs_close(struct tty_struct * +@@ -851,7 +849,7 @@ static void gs_close(struct tty_struct * port->port_num, tty, file); exit: diff --git a/usb/usb-gadget-update-pxa2xx_udc.c-driver-to-fully-support-ixp4xx-platform.patch b/usb/usb-gadget-update-pxa2xx_udc.c-driver-to-fully-support-ixp4xx-platform.patch new file mode 100644 index 0000000000000..28422d7634da0 --- /dev/null +++ b/usb/usb-gadget-update-pxa2xx_udc.c-driver-to-fully-support-ixp4xx-platform.patch @@ -0,0 +1,74 @@ +From david-b@pacbell.net Tue Jun 13 21:19:17 2006 +From: Milan Svoboda <msvoboda@ra.rockwell.com> +Subject: usb gadget: update pxa2xx_udc.c driver to fully support IXP4xx platform +Date: Monday 29 May 2006 3:34 am +To: linux-usb-devel@lists.sourceforge.net + +From: Milan Svoboda <msvoboda@ra.rockwell.com> + +This patch adds IXP465 into the list of known devices and +adds IXP425 and IXP465 to the list of devices that have cfr. This +is not described in the hardware documentation, but without +it driver won't work. + +Workaround (#if 1) that seemed to get rid of lost +status irqs is disabled for IXP4XX as it caused freezes +during testing of control messages. No lost irqs are +visible on IXP4XX. + +Driver survived tests running over night without any +visible problems. + +Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/gadget/pxa2xx_udc.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/pxa2xx_udc.c ++++ gregkh-2.6/drivers/usb/gadget/pxa2xx_udc.c +@@ -60,7 +60,7 @@ + #include <linux/usb_ch9.h> + #include <linux/usb_gadget.h> + +-#include <asm/arch/udc.h> ++#include <asm/arch/hardware/intel_udc.h> + + + /* +@@ -547,6 +547,7 @@ write_ep0_fifo (struct pxa2xx_ep *ep, st + count = req->req.length; + done (ep, req, 0); + ep0_idle(ep->dev); ++#ifndef CONFIG_ARCH_IXP4XX + #if 1 + /* This seems to get rid of lost status irqs in some cases: + * host responds quickly, or next request involves config +@@ -567,6 +568,7 @@ write_ep0_fifo (struct pxa2xx_ep *ep, st + } while (count); + } + #endif ++#endif + } else if (ep->dev->req_pending) + ep0start(ep->dev, 0, "IN"); + return is_short; +@@ -2429,6 +2431,7 @@ static struct pxa2xx_udc memory = { + #define PXA210_B1 0x00000123 + #define PXA210_B0 0x00000122 + #define IXP425_A0 0x000001c1 ++#define IXP465_AD 0x00000200 + + /* + * probe - binds to the platform device +@@ -2465,6 +2468,8 @@ static int __init pxa2xx_udc_probe(struc + break; + #elif defined(CONFIG_ARCH_IXP4XX) + case IXP425_A0: ++ case IXP465_AD: ++ dev->has_cfr = 1; + out_dma = 0; + break; + #endif diff --git a/usb/usb-move-hardware-specific-linux-usb_-.h-to-linux-usb-.h.patch b/usb/usb-move-hardware-specific-linux-usb_-.h-to-linux-usb-.h.patch new file mode 100644 index 0000000000000..cf657ca087be5 --- /dev/null +++ b/usb/usb-move-hardware-specific-linux-usb_-.h-to-linux-usb-.h.patch @@ -0,0 +1,180 @@ +From david-b@pacbell.net Tue Jun 13 10:18:16 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <greg@kroah.com> +Subject: USB: move hardware-specific <linux/usb_*.h> to <linux/usb/*.h> +Date: Tue, 13 Jun 2006 09:59:32 -0700 +Cc: linux-usb-devel@lists.sourceforge.net +Message-Id: <200606130959.33008.david-b@pacbell.net> + +This moves header files for controller-specific platform data +from <linux/usb_XXX.h> to <linux/usb/XXX.h> to start reducing +some clutter. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/isp116x-hcd.c | 2 +- + drivers/usb/host/sl811-hcd.c | 2 +- + drivers/usb/host/sl811_cs.c | 2 +- + include/linux/usb/isp116x.h | 29 +++++++++++++++++++++++++++++ + include/linux/usb/sl811.h | 26 ++++++++++++++++++++++++++ + include/linux/usb_isp116x.h | 29 ----------------------------- + include/linux/usb_sl811.h | 26 -------------------------- + 7 files changed, 58 insertions(+), 58 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/host/isp116x-hcd.c ++++ gregkh-2.6/drivers/usb/host/isp116x-hcd.c +@@ -63,7 +63,7 @@ + #include <linux/init.h> + #include <linux/list.h> + #include <linux/usb.h> +-#include <linux/usb_isp116x.h> ++#include <linux/usb/isp116x.h> + #include <linux/platform_device.h> + + #include <asm/io.h> +--- gregkh-2.6.orig/drivers/usb/host/sl811-hcd.c ++++ gregkh-2.6/drivers/usb/host/sl811-hcd.c +@@ -46,7 +46,7 @@ + #include <linux/list.h> + #include <linux/interrupt.h> + #include <linux/usb.h> +-#include <linux/usb_sl811.h> ++#include <linux/usb/sl811.h> + #include <linux/platform_device.h> + + #include <asm/io.h> +--- gregkh-2.6.orig/drivers/usb/host/sl811_cs.c ++++ gregkh-2.6/drivers/usb/host/sl811_cs.c +@@ -27,7 +27,7 @@ + #include <pcmcia/cisreg.h> + #include <pcmcia/ds.h> + +-#include <linux/usb_sl811.h> ++#include <linux/usb/sl811.h> + + MODULE_AUTHOR("Botond Botyanszki"); + MODULE_DESCRIPTION("REX-CFU1U PCMCIA driver for 2.6"); +--- /dev/null ++++ gregkh-2.6/include/linux/usb/isp116x.h +@@ -0,0 +1,29 @@ ++ ++/* ++ * Board initialization code should put one of these into dev->platform_data ++ * and place the isp116x onto platform_bus. ++ */ ++ ++struct isp116x_platform_data { ++ /* Enable internal resistors on downstream ports */ ++ unsigned sel15Kres:1; ++ /* On-chip overcurrent detection */ ++ unsigned oc_enable:1; ++ /* INT output polarity */ ++ unsigned int_act_high:1; ++ /* INT edge or level triggered */ ++ unsigned int_edge_triggered:1; ++ /* Enable wakeup by devices on usb bus (e.g. wakeup ++ by attachment/detachment or by device activity ++ such as moving a mouse). When chosen, this option ++ prevents stopping internal clock, increasing ++ thereby power consumption in suspended state. */ ++ unsigned remote_wakeup_enable:1; ++ /* Inter-io delay (ns). The chip is picky about access timings; it ++ expects at least: ++ 150ns delay between consecutive accesses to DATA_REG, ++ 300ns delay between access to ADDR_REG and DATA_REG ++ OE, WE MUST NOT be changed during these intervals ++ */ ++ void (*delay) (struct device * dev, int delay); ++}; +--- /dev/null ++++ gregkh-2.6/include/linux/usb/sl811.h +@@ -0,0 +1,26 @@ ++ ++/* ++ * board initialization should put one of these into dev->platform_data ++ * and place the sl811hs onto platform_bus named "sl811-hcd". ++ */ ++ ++struct sl811_platform_data { ++ unsigned can_wakeup:1; ++ ++ /* given port_power, msec/2 after power on till power good */ ++ u8 potpg; ++ ++ /* mA/2 power supplied on this port (max = default = 250) */ ++ u8 power; ++ ++ /* sl811 relies on an external source of VBUS current */ ++ void (*port_power)(struct device *dev, int is_on); ++ ++ /* pulse sl811 nRST (probably with a GPIO) */ ++ void (*reset)(struct device *dev); ++ ++ // some boards need something like these: ++ // int (*check_overcurrent)(struct device *dev); ++ // void (*clock_enable)(struct device *dev, int is_on); ++}; ++ +--- gregkh-2.6.orig/include/linux/usb_isp116x.h ++++ /dev/null +@@ -1,29 +0,0 @@ +- +-/* +- * Board initialization code should put one of these into dev->platform_data +- * and place the isp116x onto platform_bus. +- */ +- +-struct isp116x_platform_data { +- /* Enable internal resistors on downstream ports */ +- unsigned sel15Kres:1; +- /* On-chip overcurrent detection */ +- unsigned oc_enable:1; +- /* INT output polarity */ +- unsigned int_act_high:1; +- /* INT edge or level triggered */ +- unsigned int_edge_triggered:1; +- /* Enable wakeup by devices on usb bus (e.g. wakeup +- by attachment/detachment or by device activity +- such as moving a mouse). When chosen, this option +- prevents stopping internal clock, increasing +- thereby power consumption in suspended state. */ +- unsigned remote_wakeup_enable:1; +- /* Inter-io delay (ns). The chip is picky about access timings; it +- expects at least: +- 150ns delay between consecutive accesses to DATA_REG, +- 300ns delay between access to ADDR_REG and DATA_REG +- OE, WE MUST NOT be changed during these intervals +- */ +- void (*delay) (struct device * dev, int delay); +-}; +--- gregkh-2.6.orig/include/linux/usb_sl811.h ++++ /dev/null +@@ -1,26 +0,0 @@ +- +-/* +- * board initialization should put one of these into dev->platform_data +- * and place the sl811hs onto platform_bus named "sl811-hcd". +- */ +- +-struct sl811_platform_data { +- unsigned can_wakeup:1; +- +- /* given port_power, msec/2 after power on till power good */ +- u8 potpg; +- +- /* mA/2 power supplied on this port (max = default = 250) */ +- u8 power; +- +- /* sl811 relies on an external source of VBUS current */ +- void (*port_power)(struct device *dev, int is_on); +- +- /* pulse sl811 nRST (probably with a GPIO) */ +- void (*reset)(struct device *dev); +- +- // some boards need something like these: +- // int (*check_overcurrent)(struct device *dev); +- // void (*clock_enable)(struct device *dev, int is_on); +-}; +- diff --git a/usb/usb-move-linux-usb_cdc.h-to-linux-usb-cdc.h.patch b/usb/usb-move-linux-usb_cdc.h-to-linux-usb-cdc.h.patch new file mode 100644 index 0000000000000..2b1458b453348 --- /dev/null +++ b/usb/usb-move-linux-usb_cdc.h-to-linux-usb-cdc.h.patch @@ -0,0 +1,507 @@ +From david-b@pacbell.net Tue Jun 13 10:18:16 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <greg@kroah.com> +Subject: USB: move <linux/usb_cdc.h> to <linux/usb/cdc.h> +Date: Tue, 13 Jun 2006 09:57:47 -0700 +Cc: linux-usb-devel@lists.sourceforge.net +Message-Id: <200606130957.47887.david-b@pacbell.net> + +This moves <linux/usb_cdc.h> to <linux/usb/cdc.h> to reduce some of the +clutter of usb header files. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 2 + drivers/usb/gadget/ether.c | 2 + drivers/usb/gadget/serial.c | 2 + drivers/usb/net/cdc_ether.c | 2 + drivers/usb/net/rndis_host.c | 2 + drivers/usb/net/zaurus.c | 2 + include/linux/usb/cdc.h | 205 +++++++++++++++++++++++++++++++++++++++++++ + include/linux/usb_cdc.h | 205 ------------------------------------------- + 8 files changed, 211 insertions(+), 211 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/class/cdc-acm.c ++++ gregkh-2.6/drivers/usb/class/cdc-acm.c +@@ -63,7 +63,7 @@ + #include <linux/mutex.h> + #include <asm/uaccess.h> + #include <linux/usb.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + #include <asm/byteorder.h> + #include <asm/unaligned.h> + #include <linux/list.h> +--- gregkh-2.6.orig/drivers/usb/gadget/ether.c ++++ gregkh-2.6/drivers/usb/gadget/ether.c +@@ -49,7 +49,7 @@ + #include <asm/unaligned.h> + + #include <linux/usb_ch9.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + #include <linux/usb_gadget.h> + + #include <linux/random.h> +--- gregkh-2.6.orig/drivers/usb/gadget/serial.c ++++ gregkh-2.6/drivers/usb/gadget/serial.c +@@ -45,7 +45,7 @@ + #include <asm/uaccess.h> + + #include <linux/usb_ch9.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + #include <linux/usb_gadget.h> + + #include "gadget_chips.h" +--- gregkh-2.6.orig/drivers/usb/net/cdc_ether.c ++++ gregkh-2.6/drivers/usb/net/cdc_ether.c +@@ -31,7 +31,7 @@ + #include <linux/workqueue.h> + #include <linux/mii.h> + #include <linux/usb.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + + #include "usbnet.h" + +--- gregkh-2.6.orig/drivers/usb/net/rndis_host.c ++++ gregkh-2.6/drivers/usb/net/rndis_host.c +@@ -30,7 +30,7 @@ + #include <linux/workqueue.h> + #include <linux/mii.h> + #include <linux/usb.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + + #include "usbnet.h" + +--- gregkh-2.6.orig/drivers/usb/net/zaurus.c ++++ gregkh-2.6/drivers/usb/net/zaurus.c +@@ -30,7 +30,7 @@ + #include <linux/mii.h> + #include <linux/crc32.h> + #include <linux/usb.h> +-#include <linux/usb_cdc.h> ++#include <linux/usb/cdc.h> + + #include "usbnet.h" + +--- /dev/null ++++ gregkh-2.6/include/linux/usb/cdc.h +@@ -0,0 +1,205 @@ ++/* ++ * USB Communications Device Class (CDC) definitions ++ * ++ * CDC says how to talk to lots of different types of network adapters, ++ * notably ethernet adapters and various modems. It's used mostly with ++ * firmware based USB peripherals. ++ */ ++ ++#define USB_CDC_SUBCLASS_ACM 0x02 ++#define USB_CDC_SUBCLASS_ETHERNET 0x06 ++#define USB_CDC_SUBCLASS_WHCM 0x08 ++#define USB_CDC_SUBCLASS_DMM 0x09 ++#define USB_CDC_SUBCLASS_MDLM 0x0a ++#define USB_CDC_SUBCLASS_OBEX 0x0b ++ ++#define USB_CDC_PROTO_NONE 0 ++ ++#define USB_CDC_ACM_PROTO_AT_V25TER 1 ++#define USB_CDC_ACM_PROTO_AT_PCCA101 2 ++#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3 ++#define USB_CDC_ACM_PROTO_AT_GSM 4 ++#define USB_CDC_ACM_PROTO_AT_3G 5 ++#define USB_CDC_ACM_PROTO_AT_CDMA 6 ++#define USB_CDC_ACM_PROTO_VENDOR 0xff ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * Class-Specific descriptors ... there are a couple dozen of them ++ */ ++ ++#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ ++#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ ++#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ ++#define USB_CDC_UNION_TYPE 0x06 /* union_desc */ ++#define USB_CDC_COUNTRY_TYPE 0x07 ++#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ ++#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ ++#define USB_CDC_WHCM_TYPE 0x11 ++#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ ++#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ ++#define USB_CDC_DMM_TYPE 0x14 ++#define USB_CDC_OBEX_TYPE 0x15 ++ ++/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ ++struct usb_cdc_header_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __le16 bcdCDC; ++} __attribute__ ((packed)); ++ ++/* "Call Management Descriptor" from CDC spec 5.2.3.2 */ ++struct usb_cdc_call_mgmt_descriptor { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __u8 bmCapabilities; ++#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01 ++#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02 ++ ++ __u8 bDataInterface; ++} __attribute__ ((packed)); ++ ++/* "Abstract Control Management Descriptor" from CDC spec 5.2.3.3 */ ++struct usb_cdc_acm_descriptor { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __u8 bmCapabilities; ++} __attribute__ ((packed)); ++ ++/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ ++struct usb_cdc_union_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __u8 bMasterInterface0; ++ __u8 bSlaveInterface0; ++ /* ... and there could be other slave interfaces */ ++} __attribute__ ((packed)); ++ ++/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */ ++struct usb_cdc_network_terminal_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __u8 bEntityId; ++ __u8 iName; ++ __u8 bChannelIndex; ++ __u8 bPhysicalInterface; ++} __attribute__ ((packed)); ++ ++/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */ ++struct usb_cdc_ether_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __u8 iMACAddress; ++ __le32 bmEthernetStatistics; ++ __le16 wMaxSegmentSize; ++ __le16 wNumberMCFilters; ++ __u8 bNumberPowerFilters; ++} __attribute__ ((packed)); ++ ++/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */ ++struct usb_cdc_mdlm_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ __le16 bcdVersion; ++ __u8 bGUID[16]; ++} __attribute__ ((packed)); ++ ++/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */ ++struct usb_cdc_mdlm_detail_desc { ++ __u8 bLength; ++ __u8 bDescriptorType; ++ __u8 bDescriptorSubType; ++ ++ /* type is associated with mdlm_desc.bGUID */ ++ __u8 bGuidDescriptorType; ++ __u8 bDetailData[0]; ++} __attribute__ ((packed)); ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * Class-Specific Control Requests (6.2) ++ * ++ * section 3.6.2.1 table 4 has the ACM profile, for modems. ++ * section 3.8.2 table 10 has the ethernet profile. ++ * ++ * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant, ++ * heavily dependent on the encapsulated (proprietary) command mechanism. ++ */ ++ ++#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00 ++#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01 ++#define USB_CDC_REQ_SET_LINE_CODING 0x20 ++#define USB_CDC_REQ_GET_LINE_CODING 0x21 ++#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22 ++#define USB_CDC_REQ_SEND_BREAK 0x23 ++#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 ++#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41 ++#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 ++#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 ++#define USB_CDC_GET_ETHERNET_STATISTIC 0x44 ++ ++/* Line Coding Structure from CDC spec 6.2.13 */ ++struct usb_cdc_line_coding { ++ __le32 dwDTERate; ++ __u8 bCharFormat; ++#define USB_CDC_1_STOP_BITS 0 ++#define USB_CDC_1_5_STOP_BITS 1 ++#define USB_CDC_2_STOP_BITS 2 ++ ++ __u8 bParityType; ++#define USB_CDC_NO_PARITY 0 ++#define USB_CDC_ODD_PARITY 1 ++#define USB_CDC_EVEN_PARITY 2 ++#define USB_CDC_MARK_PARITY 3 ++#define USB_CDC_SPACE_PARITY 4 ++ ++ __u8 bDataBits; ++} __attribute__ ((packed)); ++ ++/* table 62; bits in multicast filter */ ++#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0) ++#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */ ++#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2) ++#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3) ++#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) /* filtered */ ++ ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * Class-Specific Notifications (6.3) sent by interrupt transfers ++ * ++ * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications ++ * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS ++ * RNDIS also defines its own bit-incompatible notifications ++ */ ++ ++#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00 ++#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01 ++#define USB_CDC_NOTIFY_SERIAL_STATE 0x20 ++#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a ++ ++struct usb_cdc_notification { ++ __u8 bmRequestType; ++ __u8 bNotificationType; ++ __le16 wValue; ++ __le16 wIndex; ++ __le16 wLength; ++} __attribute__ ((packed)); ++ +--- gregkh-2.6.orig/include/linux/usb_cdc.h ++++ /dev/null +@@ -1,205 +0,0 @@ +-/* +- * USB Communications Device Class (CDC) definitions +- * +- * CDC says how to talk to lots of different types of network adapters, +- * notably ethernet adapters and various modems. It's used mostly with +- * firmware based USB peripherals. +- */ +- +-#define USB_CDC_SUBCLASS_ACM 0x02 +-#define USB_CDC_SUBCLASS_ETHERNET 0x06 +-#define USB_CDC_SUBCLASS_WHCM 0x08 +-#define USB_CDC_SUBCLASS_DMM 0x09 +-#define USB_CDC_SUBCLASS_MDLM 0x0a +-#define USB_CDC_SUBCLASS_OBEX 0x0b +- +-#define USB_CDC_PROTO_NONE 0 +- +-#define USB_CDC_ACM_PROTO_AT_V25TER 1 +-#define USB_CDC_ACM_PROTO_AT_PCCA101 2 +-#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3 +-#define USB_CDC_ACM_PROTO_AT_GSM 4 +-#define USB_CDC_ACM_PROTO_AT_3G 5 +-#define USB_CDC_ACM_PROTO_AT_CDMA 6 +-#define USB_CDC_ACM_PROTO_VENDOR 0xff +- +-/*-------------------------------------------------------------------------*/ +- +-/* +- * Class-Specific descriptors ... there are a couple dozen of them +- */ +- +-#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ +-#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ +-#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ +-#define USB_CDC_UNION_TYPE 0x06 /* union_desc */ +-#define USB_CDC_COUNTRY_TYPE 0x07 +-#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ +-#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ +-#define USB_CDC_WHCM_TYPE 0x11 +-#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ +-#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ +-#define USB_CDC_DMM_TYPE 0x14 +-#define USB_CDC_OBEX_TYPE 0x15 +- +-/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ +-struct usb_cdc_header_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __le16 bcdCDC; +-} __attribute__ ((packed)); +- +-/* "Call Management Descriptor" from CDC spec 5.2.3.2 */ +-struct usb_cdc_call_mgmt_descriptor { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __u8 bmCapabilities; +-#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01 +-#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02 +- +- __u8 bDataInterface; +-} __attribute__ ((packed)); +- +-/* "Abstract Control Management Descriptor" from CDC spec 5.2.3.3 */ +-struct usb_cdc_acm_descriptor { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __u8 bmCapabilities; +-} __attribute__ ((packed)); +- +-/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ +-struct usb_cdc_union_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __u8 bMasterInterface0; +- __u8 bSlaveInterface0; +- /* ... and there could be other slave interfaces */ +-} __attribute__ ((packed)); +- +-/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */ +-struct usb_cdc_network_terminal_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __u8 bEntityId; +- __u8 iName; +- __u8 bChannelIndex; +- __u8 bPhysicalInterface; +-} __attribute__ ((packed)); +- +-/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */ +-struct usb_cdc_ether_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __u8 iMACAddress; +- __le32 bmEthernetStatistics; +- __le16 wMaxSegmentSize; +- __le16 wNumberMCFilters; +- __u8 bNumberPowerFilters; +-} __attribute__ ((packed)); +- +-/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */ +-struct usb_cdc_mdlm_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- __le16 bcdVersion; +- __u8 bGUID[16]; +-} __attribute__ ((packed)); +- +-/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */ +-struct usb_cdc_mdlm_detail_desc { +- __u8 bLength; +- __u8 bDescriptorType; +- __u8 bDescriptorSubType; +- +- /* type is associated with mdlm_desc.bGUID */ +- __u8 bGuidDescriptorType; +- __u8 bDetailData[0]; +-} __attribute__ ((packed)); +- +-/*-------------------------------------------------------------------------*/ +- +-/* +- * Class-Specific Control Requests (6.2) +- * +- * section 3.6.2.1 table 4 has the ACM profile, for modems. +- * section 3.8.2 table 10 has the ethernet profile. +- * +- * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant, +- * heavily dependent on the encapsulated (proprietary) command mechanism. +- */ +- +-#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00 +-#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01 +-#define USB_CDC_REQ_SET_LINE_CODING 0x20 +-#define USB_CDC_REQ_GET_LINE_CODING 0x21 +-#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22 +-#define USB_CDC_REQ_SEND_BREAK 0x23 +-#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 +-#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41 +-#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 +-#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 +-#define USB_CDC_GET_ETHERNET_STATISTIC 0x44 +- +-/* Line Coding Structure from CDC spec 6.2.13 */ +-struct usb_cdc_line_coding { +- __le32 dwDTERate; +- __u8 bCharFormat; +-#define USB_CDC_1_STOP_BITS 0 +-#define USB_CDC_1_5_STOP_BITS 1 +-#define USB_CDC_2_STOP_BITS 2 +- +- __u8 bParityType; +-#define USB_CDC_NO_PARITY 0 +-#define USB_CDC_ODD_PARITY 1 +-#define USB_CDC_EVEN_PARITY 2 +-#define USB_CDC_MARK_PARITY 3 +-#define USB_CDC_SPACE_PARITY 4 +- +- __u8 bDataBits; +-} __attribute__ ((packed)); +- +-/* table 62; bits in multicast filter */ +-#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0) +-#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */ +-#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2) +-#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3) +-#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) /* filtered */ +- +- +-/*-------------------------------------------------------------------------*/ +- +-/* +- * Class-Specific Notifications (6.3) sent by interrupt transfers +- * +- * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications +- * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS +- * RNDIS also defines its own bit-incompatible notifications +- */ +- +-#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00 +-#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01 +-#define USB_CDC_NOTIFY_SERIAL_STATE 0x20 +-#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a +- +-struct usb_cdc_notification { +- __u8 bmRequestType; +- __u8 bNotificationType; +- __le16 wValue; +- __le16 wIndex; +- __le16 wLength; +-} __attribute__ ((packed)); +- diff --git a/usb/usb-move-linux-usb_input.h-to-linux-usb-input.h.patch b/usb/usb-move-linux-usb_input.h-to-linux-usb-input.h.patch new file mode 100644 index 0000000000000..e02dde11dd568 --- /dev/null +++ b/usb/usb-move-linux-usb_input.h-to-linux-usb-input.h.patch @@ -0,0 +1,381 @@ +From david-b@pacbell.net Tue Jun 13 10:18:16 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <greg@kroah.com> +Subject: USB: move <linux/usb_input.h> to <linux/usb/input.h> +Date: Tue, 13 Jun 2006 10:04:34 -0700 +Cc: linux-usb-devel@lists.sourceforge.net +Message-Id: <200606131004.35715.david-b@pacbell.net> + +Move <linux/usb_input.h> to <linux/usb/input.h> and remove some +redundant includes. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/media/video/usbvideo/konicawc.c | 3 +-- + drivers/usb/input/acecad.c | 4 +--- + drivers/usb/input/aiptek.c | 4 +--- + drivers/usb/input/appletouch.c | 4 +--- + drivers/usb/input/ati_remote.c | 4 +--- + drivers/usb/input/ati_remote2.c | 2 +- + drivers/usb/input/hid-input.c | 4 +--- + drivers/usb/input/itmtouch.c | 4 +--- + drivers/usb/input/kbtab.c | 5 +---- + drivers/usb/input/keyspan_remote.c | 4 +--- + drivers/usb/input/mtouchusb.c | 4 +--- + drivers/usb/input/powermate.c | 4 +--- + drivers/usb/input/touchkitusb.c | 4 +--- + drivers/usb/input/usbkbd.c | 4 +--- + drivers/usb/input/usbmouse.c | 4 +--- + drivers/usb/input/usbtouchscreen.c | 2 +- + drivers/usb/input/wacom.c | 5 +---- + drivers/usb/input/xpad.c | 4 +--- + drivers/usb/input/yealink.c | 4 +--- + drivers/usb/storage/onetouch.c | 3 +-- + include/linux/usb/input.h | 25 +++++++++++++++++++++++++ + include/linux/usb_input.h | 25 ------------------------- + 22 files changed, 45 insertions(+), 81 deletions(-) + +--- gregkh-2.6.orig/drivers/media/video/usbvideo/konicawc.c ++++ gregkh-2.6/drivers/media/video/usbvideo/konicawc.c +@@ -15,8 +15,7 @@ + #include <linux/kernel.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/input.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #include "usbvideo.h" + +--- gregkh-2.6.orig/drivers/usb/input/acecad.c ++++ gregkh-2.6/drivers/usb/input/acecad.c +@@ -27,11 +27,9 @@ + + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + /* + * Version Information +--- gregkh-2.6.orig/drivers/usb/input/aiptek.c ++++ gregkh-2.6/drivers/usb/input/aiptek.c +@@ -73,11 +73,9 @@ + #include <linux/jiffies.h> + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + #include <linux/sched.h> + #include <asm/uaccess.h> + #include <asm/unaligned.h> +--- gregkh-2.6.orig/drivers/usb/input/appletouch.c ++++ gregkh-2.6/drivers/usb/input/appletouch.c +@@ -33,9 +33,7 @@ + #include <linux/init.h> + #include <linux/slab.h> + #include <linux/module.h> +-#include <linux/usb.h> +-#include <linux/input.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + /* Apple has powerbooks which have the keyboard with different Product IDs */ + #define APPLE_VENDOR_ID 0x05AC +--- gregkh-2.6.orig/drivers/usb/input/ati_remote.c ++++ gregkh-2.6/drivers/usb/input/ati_remote.c +@@ -92,9 +92,7 @@ + #include <linux/slab.h> + #include <linux/module.h> + #include <linux/moduleparam.h> +-#include <linux/input.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + #include <linux/wait.h> + #include <linux/jiffies.h> + +--- gregkh-2.6.orig/drivers/usb/input/ati_remote2.c ++++ gregkh-2.6/drivers/usb/input/ati_remote2.c +@@ -8,7 +8,7 @@ + * as published by the Free Software Foundation. + */ + +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define DRIVER_DESC "ATI/Philips USB RF remote driver" + #define DRIVER_VERSION "0.1" +--- gregkh-2.6.orig/drivers/usb/input/hid-input.c ++++ gregkh-2.6/drivers/usb/input/hid-input.c +@@ -29,9 +29,7 @@ + #include <linux/module.h> + #include <linux/slab.h> + #include <linux/kernel.h> +-#include <linux/input.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #undef DEBUG + +--- gregkh-2.6.orig/drivers/usb/input/itmtouch.c ++++ gregkh-2.6/drivers/usb/input/itmtouch.c +@@ -42,11 +42,9 @@ + #include <linux/config.h> + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + /* only an 8 byte buffer necessary for a single packet */ + #define ITM_BUFSIZE 8 +--- gregkh-2.6.orig/drivers/usb/input/kbtab.c ++++ gregkh-2.6/drivers/usb/input/kbtab.c +@@ -1,12 +1,9 @@ + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + #include <asm/unaligned.h> +-#include <asm/byteorder.h> + + /* + * Version Information +--- gregkh-2.6.orig/drivers/usb/input/keyspan_remote.c ++++ gregkh-2.6/drivers/usb/input/keyspan_remote.c +@@ -18,9 +18,7 @@ + #include <linux/slab.h> + #include <linux/module.h> + #include <linux/moduleparam.h> +-#include <linux/input.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define DRIVER_VERSION "v0.1" + #define DRIVER_AUTHOR "Michael Downey <downey@zymeta.com>" +--- gregkh-2.6.orig/drivers/usb/input/mtouchusb.c ++++ gregkh-2.6/drivers/usb/input/mtouchusb.c +@@ -42,11 +42,9 @@ + #include <linux/config.h> + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define MTOUCHUSB_MIN_XC 0x0 + #define MTOUCHUSB_MAX_RAW_XC 0x4000 +--- gregkh-2.6.orig/drivers/usb/input/powermate.c ++++ gregkh-2.6/drivers/usb/input/powermate.c +@@ -30,12 +30,10 @@ + + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> + #include <linux/spinlock.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define POWERMATE_VENDOR 0x077d /* Griffin Technology, Inc. */ + #define POWERMATE_PRODUCT_NEW 0x0410 /* Griffin PowerMate */ +--- gregkh-2.6.orig/drivers/usb/input/touchkitusb.c ++++ gregkh-2.6/drivers/usb/input/touchkitusb.c +@@ -27,11 +27,9 @@ + #include <linux/config.h> + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define TOUCHKIT_MIN_XC 0x0 + #define TOUCHKIT_MAX_XC 0x07ff +--- gregkh-2.6.orig/drivers/usb/input/usbkbd.c ++++ gregkh-2.6/drivers/usb/input/usbkbd.c +@@ -29,10 +29,8 @@ + #include <linux/kernel.h> + #include <linux/slab.h> + #include <linux/module.h> +-#include <linux/input.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + /* + * Version Information +--- gregkh-2.6.orig/drivers/usb/input/usbmouse.c ++++ gregkh-2.6/drivers/usb/input/usbmouse.c +@@ -28,11 +28,9 @@ + + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + /* + * Version Information +--- gregkh-2.6.orig/drivers/usb/input/usbtouchscreen.c ++++ gregkh-2.6/drivers/usb/input/usbtouchscreen.c +@@ -39,7 +39,7 @@ + #include <linux/module.h> + #include <linux/init.h> + #include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + + #define DRIVER_VERSION "v0.3" +--- gregkh-2.6.orig/drivers/usb/input/wacom.c ++++ gregkh-2.6/drivers/usb/input/wacom.c +@@ -69,13 +69,10 @@ + + #include <linux/kernel.h> + #include <linux/slab.h> +-#include <linux/input.h> + #include <linux/module.h> + #include <linux/init.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + #include <asm/unaligned.h> +-#include <asm/byteorder.h> + + /* + * Version Information +--- gregkh-2.6.orig/drivers/usb/input/xpad.c ++++ gregkh-2.6/drivers/usb/input/xpad.c +@@ -56,13 +56,11 @@ + + #include <linux/config.h> + #include <linux/kernel.h> +-#include <linux/input.h> + #include <linux/init.h> + #include <linux/slab.h> + #include <linux/module.h> + #include <linux/smp_lock.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #define DRIVER_VERSION "v0.0.5" + #define DRIVER_AUTHOR "Marko Friedemann <mfr@bmx-chemnitz.de>" +--- gregkh-2.6.orig/drivers/usb/input/yealink.c ++++ gregkh-2.6/drivers/usb/input/yealink.c +@@ -48,13 +48,11 @@ + + #include <linux/config.h> + #include <linux/kernel.h> +-#include <linux/input.h> + #include <linux/init.h> + #include <linux/slab.h> + #include <linux/module.h> + #include <linux/rwsem.h> +-#include <linux/usb.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + + #include "map_to_7segment.h" + #include "yealink.h" +--- gregkh-2.6.orig/drivers/usb/storage/onetouch.c ++++ gregkh-2.6/drivers/usb/storage/onetouch.c +@@ -34,9 +34,8 @@ + #include <linux/init.h> + #include <linux/slab.h> + #include <linux/module.h> +-#include <linux/usb.h> + #include <linux/usb_ch9.h> +-#include <linux/usb_input.h> ++#include <linux/usb/input.h> + #include "usb.h" + #include "onetouch.h" + #include "debug.h" +--- /dev/null ++++ gregkh-2.6/include/linux/usb/input.h +@@ -0,0 +1,25 @@ ++#ifndef __USB_INPUT_H ++#define __USB_INPUT_H ++ ++/* ++ * Copyright (C) 2005 Dmitry Torokhov ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published by ++ * the Free Software Foundation. ++ */ ++ ++#include <linux/usb.h> ++#include <linux/input.h> ++#include <asm/byteorder.h> ++ ++static inline void ++usb_to_input_id(const struct usb_device *dev, struct input_id *id) ++{ ++ id->bustype = BUS_USB; ++ id->vendor = le16_to_cpu(dev->descriptor.idVendor); ++ id->product = le16_to_cpu(dev->descriptor.idProduct); ++ id->version = le16_to_cpu(dev->descriptor.bcdDevice); ++} ++ ++#endif +--- gregkh-2.6.orig/include/linux/usb_input.h ++++ /dev/null +@@ -1,25 +0,0 @@ +-#ifndef __USB_INPUT_H +-#define __USB_INPUT_H +- +-/* +- * Copyright (C) 2005 Dmitry Torokhov +- * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License version 2 as published by +- * the Free Software Foundation. +- */ +- +-#include <linux/usb.h> +-#include <linux/input.h> +-#include <asm/byteorder.h> +- +-static inline void +-usb_to_input_id(const struct usb_device *dev, struct input_id *id) +-{ +- id->bustype = BUS_USB; +- id->vendor = le16_to_cpu(dev->descriptor.idVendor); +- id->product = le16_to_cpu(dev->descriptor.idProduct); +- id->version = le16_to_cpu(dev->descriptor.bcdDevice); +-} +- +-#endif diff --git a/usb/usb-serial-dynamic-id.patch b/usb/usb-serial-dynamic-id.patch index 9f2746ed4560e..fa7a146342bf3 100644 --- a/usb/usb-serial-dynamic-id.patch +++ b/usb/usb-serial-dynamic-id.patch @@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> .name = "usbserial", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, -@@ -601,6 +601,39 @@ static struct usb_serial * create_serial +@@ -599,6 +599,39 @@ static struct usb_serial * create_serial return serial; } @@ -241,7 +241,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> static struct usb_serial_driver *search_serial_device(struct usb_interface *iface) { struct list_head *p; -@@ -610,11 +643,9 @@ static struct usb_serial_driver *search_ +@@ -608,11 +641,9 @@ static struct usb_serial_driver *search_ /* Check if the usb id matches a known device */ list_for_each(p, &usb_serial_driver_list) { t = list_entry(p, struct usb_serial_driver, driver_list); @@ -255,7 +255,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } return NULL; -@@ -666,7 +697,7 @@ int usb_serial_probe(struct usb_interfac +@@ -664,7 +695,7 @@ int usb_serial_probe(struct usb_interfac return -EIO; } diff --git a/usb/usb-unusual_devs-entry-for-nokia-n80.patch b/usb/usb-unusual_devs-entry-for-nokia-n80.patch new file mode 100644 index 0000000000000..a167c928b7442 --- /dev/null +++ b/usb/usb-unusual_devs-entry-for-nokia-n80.patch @@ -0,0 +1,34 @@ +From stern@rowland.harvard.edu Tue Jun 13 06:59:40 2006 +Date: Tue, 13 Jun 2006 09:59:32 -0400 (EDT) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com>, Phil Dibowitz <phil@ipom.com> +Subject: USB: unusual_devs entry for Nokia N80 +Message-ID: <Pine.LNX.4.44L0.0606130957160.6550-100000@iolanthe.rowland.org> + +Here is a patch (as720) adding an unusual_devs entry for the Nokia N80 +mobile phone. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/storage/unusual_devs.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/storage/unusual_devs.h ++++ gregkh-2.6/drivers/usb/storage/unusual_devs.h +@@ -133,6 +133,14 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + ++/* Reported by Jiri Slaby <jirislaby@gmail.com> and ++ * Rene C. Castberg <Rene@Castberg.org> */ ++UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100, ++ "Nokia", ++ "N80", ++ US_SC_DEVICE, US_PR_DEVICE, NULL, ++ US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), ++ + /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ + UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, + "SMSC", diff --git a/usb/usb-whitespace-removal-from-usb-gadget-ether.patch b/usb/usb-whitespace-removal-from-usb-gadget-ether.patch new file mode 100644 index 0000000000000..681aee5761e67 --- /dev/null +++ b/usb/usb-whitespace-removal-from-usb-gadget-ether.patch @@ -0,0 +1,1491 @@ +From david-b@pacbell.net Tue Jun 13 10:18:06 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <greg@kroah.com> +Subject: USB: whitespace removal from usb/gadget/ether +Date: Tue, 13 Jun 2006 09:54:40 -0700 +Cc: linux-usb-devel@lists.sourceforge.net +Message-Id: <200606130954.41409.david-b@pacbell.net> + +This removes extraneous whitespace from the Ethernet/RNDIS gadget driver. +It's all space-at-EOL, spaces-before-tabs, or tabs-then-spaces. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/ether.c | 86 ++++----- + drivers/usb/gadget/rndis.c | 389 ++++++++++++++++++++++----------------------- + drivers/usb/gadget/rndis.h | 26 +-- + 3 files changed, 251 insertions(+), 250 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/ether.c ++++ gregkh-2.6/drivers/usb/gadget/ether.c +@@ -101,9 +101,9 @@ static const char driver_desc [] = DRIVE + + /* CDC and RNDIS support the same host-chosen outgoing packet filters. */ + #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ +- |USB_CDC_PACKET_TYPE_ALL_MULTICAST \ +- |USB_CDC_PACKET_TYPE_PROMISCUOUS \ +- |USB_CDC_PACKET_TYPE_DIRECTED) ++ |USB_CDC_PACKET_TYPE_ALL_MULTICAST \ ++ |USB_CDC_PACKET_TYPE_PROMISCUOUS \ ++ |USB_CDC_PACKET_TYPE_DIRECTED) + + + /*-------------------------------------------------------------------------*/ +@@ -318,7 +318,7 @@ static inline int rndis_active(struct et + #define DEFAULT_QLEN 2 /* double buffering by default */ + + /* peak bulk transfer bits-per-second */ +-#define HS_BPS (13 * 512 * 8 * 1000 * 8) ++#define HS_BPS (13 * 512 * 8 * 1000 * 8) + #define FS_BPS (19 * 64 * 1 * 1000 * 8) + + #ifdef CONFIG_USB_GADGET_DUALSPEED +@@ -466,7 +466,7 @@ eth_config = { + }; + + #ifdef CONFIG_USB_ETH_RNDIS +-static struct usb_config_descriptor ++static struct usb_config_descriptor + rndis_config = { + .bLength = sizeof rndis_config, + .bDescriptorType = USB_DT_CONFIG, +@@ -511,7 +511,7 @@ static const struct usb_interface_descri + rndis_control_intf = { + .bLength = sizeof rndis_control_intf, + .bDescriptorType = USB_DT_INTERFACE, +- ++ + .bInterfaceNumber = 0, + .bNumEndpoints = 1, + .bInterfaceClass = USB_CLASS_COMM, +@@ -545,20 +545,20 @@ static const struct usb_cdc_union_desc u + #ifdef CONFIG_USB_ETH_RNDIS + + static const struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = { +- .bLength = sizeof call_mgmt_descriptor, +- .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, ++ .bLength = sizeof call_mgmt_descriptor, ++ .bDescriptorType = USB_DT_CS_INTERFACE, ++ .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, + +- .bmCapabilities = 0x00, +- .bDataInterface = 0x01, ++ .bmCapabilities = 0x00, ++ .bDataInterface = 0x01, + }; + + static const struct usb_cdc_acm_descriptor acm_descriptor = { +- .bLength = sizeof acm_descriptor, +- .bDescriptorType = USB_DT_CS_INTERFACE, +- .bDescriptorSubType = USB_CDC_ACM_TYPE, ++ .bLength = sizeof acm_descriptor, ++ .bDescriptorType = USB_DT_CS_INTERFACE, ++ .bDescriptorSubType = USB_CDC_ACM_TYPE, + +- .bmCapabilities = 0x00, ++ .bmCapabilities = 0x00, + }; + + #endif +@@ -595,7 +595,7 @@ static const struct usb_cdc_ether_desc e + * RNDIS requires the status endpoint, since it uses that encapsulation + * mechanism for its funky RPC scheme. + */ +- ++ + #define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */ + #define STATUS_BYTECOUNT 16 /* 8 byte header + data */ + +@@ -978,7 +978,7 @@ set_ether_config (struct eth_dev *dev, g + + result = usb_ep_enable (dev->status_ep, dev->status); + if (result != 0) { +- DEBUG (dev, "enable %s --> %d\n", ++ DEBUG (dev, "enable %s --> %d\n", + dev->status_ep->name, result); + goto done; + } +@@ -1002,14 +1002,14 @@ set_ether_config (struct eth_dev *dev, g + if (!cdc_active(dev)) { + result = usb_ep_enable (dev->in_ep, dev->in); + if (result != 0) { +- DEBUG(dev, "enable %s --> %d\n", ++ DEBUG(dev, "enable %s --> %d\n", + dev->in_ep->name, result); + goto done; + } + + result = usb_ep_enable (dev->out_ep, dev->out); + if (result != 0) { +- DEBUG (dev, "enable %s --> %d\n", ++ DEBUG (dev, "enable %s --> %d\n", + dev->out_ep->name, result); + goto done; + } +@@ -1144,7 +1144,7 @@ eth_set_config (struct eth_dev *dev, uns + #ifdef CONFIG_USB_GADGET_DUALSPEED + case USB_SPEED_HIGH: speed = "high"; break; + #endif +- default: speed = "?"; break; ++ default: speed = "?"; break; + } + + dev->config = number; +@@ -1206,7 +1206,7 @@ static void issue_start_status (struct e + struct usb_request *req = dev->stat_req; + struct usb_cdc_notification *event; + int value; +- ++ + DEBUG (dev, "%s, flush old status first\n", __FUNCTION__); + + /* flush old status +@@ -1268,7 +1268,7 @@ static void rndis_command_complete (stru + { + struct eth_dev *dev = ep->driver_data; + int status; +- ++ + /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */ + spin_lock(&dev->lock); + status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf); +@@ -1472,7 +1472,7 @@ done_set_intf: + + #endif /* DEV_CONFIG_CDC */ + +-#ifdef CONFIG_USB_ETH_RNDIS ++#ifdef CONFIG_USB_ETH_RNDIS + /* RNDIS uses the CDC command encapsulation mechanism to implement + * an RPC scheme, with much getting/setting of attributes by OID. + */ +@@ -1489,7 +1489,7 @@ done_set_intf: + req->complete = rndis_command_complete; + /* later, rndis_control_ack () sends a notification */ + break; +- ++ + case USB_CDC_GET_ENCAPSULATED_RESPONSE: + if ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE) + == ctrl->bRequestType +@@ -1641,7 +1641,7 @@ rx_submit (struct eth_dev *dev, struct u + DEBUG (dev, "no rx skb\n"); + goto enomem; + } +- ++ + /* Some platforms perform better when IP packets are aligned, + * but on at least one, checksumming fails otherwise. Note: + * RNDIS headers involve variable numbers of LE32 values. +@@ -1720,7 +1720,7 @@ quiesce: + case -EOVERFLOW: + dev->stats.rx_over_errors++; + // FALLTHROUGH +- ++ + default: + dev->stats.rx_errors++; + DEBUG (dev, "rx status %d\n", status); +@@ -1915,7 +1915,7 @@ static int eth_start_xmit (struct sk_buf + sizeof (struct rndis_packet_msg_type)); + if (!skb_rndis) + goto drop; +- ++ + dev_kfree_skb_any (skb); + skb = skb_rndis; + rndis_add_hdr (skb); +@@ -2001,7 +2001,7 @@ static int rndis_control_ack (struct net + struct eth_dev *dev = netdev_priv(net); + u32 length; + struct usb_request *resp = dev->stat_req; +- ++ + /* in case RNDIS calls this after disconnect */ + if (!dev->status) { + DEBUG (dev, "status ENODEV\n"); +@@ -2021,16 +2021,16 @@ static int rndis_control_ack (struct net + resp->length = 8; + resp->complete = rndis_control_ack_complete; + resp->context = dev; +- ++ + *((__le32 *) resp->buf) = __constant_cpu_to_le32 (1); + *((__le32 *) resp->buf + 1) = __constant_cpu_to_le32 (0); +- ++ + length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC); + if (length < 0) { + resp->status = 0; + rndis_control_ack_complete (dev->status_ep, resp); + } +- ++ + return 0; + } + +@@ -2047,7 +2047,7 @@ static void eth_start (struct eth_dev *d + /* fill the rx queue */ + rx_fill (dev, gfp_flags); + +- /* and open the tx floodgates */ ++ /* and open the tx floodgates */ + atomic_set (&dev->tx_qlen, 0); + netif_wake_queue (dev->net); + if (rndis_active(dev)) { +@@ -2076,7 +2076,7 @@ static int eth_stop (struct net_device * + netif_stop_queue (net); + + DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", +- dev->stats.rx_packets, dev->stats.tx_packets, ++ dev->stats.rx_packets, dev->stats.tx_packets, + dev->stats.rx_errors, dev->stats.tx_errors + ); + +@@ -2095,7 +2095,7 @@ static int eth_stop (struct net_device * + usb_ep_enable (dev->status_ep, dev->status); + } + } +- ++ + if (rndis_active(dev)) { + rndis_set_param_medium (dev->rndis_config, + NDIS_MEDIUM_802_3, 0); +@@ -2301,7 +2301,7 @@ autoconf_fail: + return -ENODEV; + } + in_ep->driver_data = in_ep; /* claim */ +- ++ + out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc); + if (!out_ep) + goto autoconf_fail; +@@ -2374,8 +2374,8 @@ autoconf_fail: + #endif + } + +- net = alloc_etherdev (sizeof *dev); +- if (!net) ++ net = alloc_etherdev (sizeof *dev); ++ if (!net) + return status; + dev = netdev_priv(net); + spin_lock_init (&dev->lock); +@@ -2454,7 +2454,7 @@ autoconf_fail: + dev->gadget = gadget; + set_gadget_data (gadget, dev); + gadget->ep0->driver_data = dev; +- ++ + /* two kinds of host-initiated state changes: + * - iff DATA transfer is active, carrier is "on" + * - tx queueing enabled if open *and* carrier is "on" +@@ -2462,8 +2462,8 @@ autoconf_fail: + netif_stop_queue (dev->net); + netif_carrier_off (dev->net); + +- SET_NETDEV_DEV (dev->net, &gadget->dev); +- status = register_netdev (dev->net); ++ SET_NETDEV_DEV (dev->net, &gadget->dev); ++ status = register_netdev (dev->net); + if (status < 0) + goto fail1; + +@@ -2488,7 +2488,7 @@ autoconf_fail: + u32 vendorID = 0; + + /* FIXME RNDIS vendor id == "vendor NIC code" == ? */ +- ++ + dev->rndis_config = rndis_register (rndis_control_ack); + if (dev->rndis_config < 0) { + fail0: +@@ -2496,7 +2496,7 @@ fail0: + status = -ENODEV; + goto fail; + } +- ++ + /* these set up a lot of the OIDs that RNDIS needs */ + rndis_set_host_mac (dev->rndis_config, dev->host_mac); + if (rndis_set_param_dev (dev->rndis_config, dev->net, +@@ -2556,7 +2556,7 @@ static struct usb_gadget_driver eth_driv + .suspend = eth_suspend, + .resume = eth_resume, + +- .driver = { ++ .driver = { + .name = (char *) shortname, + .owner = THIS_MODULE, + }, +--- gregkh-2.6.orig/drivers/usb/gadget/rndis.c ++++ gregkh-2.6/drivers/usb/gadget/rndis.c +@@ -1,23 +1,23 @@ +-/* ++/* + * RNDIS MSG parser +- * ++ * + * Version: $Id: rndis.c,v 1.19 2004/03/25 21:33:46 robert Exp $ +- * ++ * + * Authors: Benedikt Spranger, Pengutronix +- * Robert Schwebel, Pengutronix +- * ++ * Robert Schwebel, Pengutronix ++ * + * 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. +- * ++ * version 2, as published by the Free Software Foundation. ++ * + * This software was originally developed in conformance with + * Microsoft's Remote NDIS Specification License Agreement. +- * ++ * + * 03/12/2004 Kai-Uwe Bloem <linux-development@auerswald.de> + * Fixed message length bug in init_response +- * ++ * + * 03/25/2004 Kai-Uwe Bloem <linux-development@auerswald.de> +- * Fixed rndis_rm_hdr length bug. ++ * Fixed rndis_rm_hdr length bug. + * + * Copyright (C) 2004 by David Brownell + * updates to merge with Linux 2.6, better match RNDIS spec +@@ -82,7 +82,7 @@ static rndis_resp_t *rndis_add_response + + + /* supported OIDs */ +-static const u32 oid_supported_list [] = ++static const u32 oid_supported_list [] = + { + /* the general stuff */ + OID_GEN_SUPPORTED_LIST, +@@ -103,7 +103,7 @@ static const u32 oid_supported_list [] = + #if 0 + OID_GEN_RNDIS_CONFIG_PARAMETER, + #endif +- ++ + /* the statistical stuff */ + OID_GEN_XMIT_OK, + OID_GEN_RCV_OK, +@@ -127,14 +127,14 @@ static const u32 oid_supported_list [] = + OID_GEN_TRANSMIT_QUEUE_LENGTH, + #endif /* RNDIS_OPTIONAL_STATS */ + +- /* mandatory 802.3 */ ++ /* mandatory 802.3 */ + /* the general stuff */ + OID_802_3_PERMANENT_ADDRESS, + OID_802_3_CURRENT_ADDRESS, + OID_802_3_MULTICAST_LIST, + OID_802_3_MAC_OPTIONS, + OID_802_3_MAXIMUM_LIST_SIZE, +- ++ + /* the statistical stuff */ + OID_802_3_RCV_ERROR_ALIGNMENT, + OID_802_3_XMIT_ONE_COLLISION, +@@ -172,8 +172,8 @@ static int + gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, + rndis_resp_t *r) + { +- int retval = -ENOTSUPP; +- u32 length = 4; /* usually */ ++ int retval = -ENOTSUPP; ++ u32 length = 4; /* usually */ + __le32 *outbuf; + int i, count; + rndis_query_cmplt_type *resp; +@@ -211,27 +211,27 @@ gen_ndis_query_resp (int configNr, u32 O + outbuf[i] = cpu_to_le32 (oid_supported_list[i]); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_GEN_HARDWARE_STATUS: + DEBUG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__); +- /* Bogus question! ++ /* Bogus question! + * Hardware must be ready to receive high level protocols. +- * BTW: ++ * BTW: + * reddite ergo quae sunt Caesaris Caesari + * et quae sunt Dei Deo! + */ + *outbuf = __constant_cpu_to_le32 (0); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_GEN_MEDIA_SUPPORTED: + DEBUG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__); + *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_GEN_MEDIA_IN_USE: + DEBUG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__); +@@ -239,7 +239,7 @@ gen_ndis_query_resp (int configNr, u32 O + *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_GEN_MAXIMUM_FRAME_SIZE: + DEBUG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__); +@@ -249,7 +249,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_LINK_SPEED: + if (rndis_debug > 1) +@@ -272,7 +272,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_RECEIVE_BLOCK_SIZE: + DEBUG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__); +@@ -282,7 +282,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_VENDOR_ID: + DEBUG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__); +@@ -290,7 +290,7 @@ gen_ndis_query_resp (int configNr, u32 O + rndis_per_dev_params [configNr].vendorID); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_GEN_VENDOR_DESCRIPTION: + DEBUG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __FUNCTION__); +@@ -356,7 +356,7 @@ gen_ndis_query_resp (int configNr, u32 O + DEBUG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { + *outbuf = cpu_to_le32 ( +- rndis_per_dev_params [configNr].stats->tx_packets - ++ rndis_per_dev_params [configNr].stats->tx_packets - + rndis_per_dev_params [configNr].stats->tx_errors - + rndis_per_dev_params [configNr].stats->tx_dropped); + retval = 0; +@@ -369,13 +369,13 @@ gen_ndis_query_resp (int configNr, u32 O + DEBUG("%s: OID_GEN_RCV_OK\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { + *outbuf = cpu_to_le32 ( +- rndis_per_dev_params [configNr].stats->rx_packets - ++ rndis_per_dev_params [configNr].stats->rx_packets - + rndis_per_dev_params [configNr].stats->rx_errors - + rndis_per_dev_params [configNr].stats->rx_dropped); + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_XMIT_ERROR: + if (rndis_debug > 1) +@@ -386,7 +386,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_RCV_ERROR: + if (rndis_debug > 1) +@@ -397,7 +397,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_GEN_RCV_NO_BUFFER: + DEBUG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__); +@@ -411,7 +411,7 @@ gen_ndis_query_resp (int configNr, u32 O + #ifdef RNDIS_OPTIONAL_STATS + case OID_GEN_DIRECTED_BYTES_XMIT: + DEBUG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__); +- /* ++ /* + * Aunt Tilly's size of shoes + * minus antarctica count of penguins + * divided by weight of Alpha Centauri +@@ -419,7 +419,7 @@ gen_ndis_query_resp (int configNr, u32 O + if (rndis_per_dev_params [configNr].stats) { + *outbuf = cpu_to_le32 ( + (rndis_per_dev_params [configNr] +- .stats->tx_packets - ++ .stats->tx_packets - + rndis_per_dev_params [configNr] + .stats->tx_errors - + rndis_per_dev_params [configNr] +@@ -428,14 +428,14 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_DIRECTED_FRAMES_XMIT: + DEBUG("%s: OID_GEN_DIRECTED_FRAMES_XMIT\n", __FUNCTION__); + /* dito */ + if (rndis_per_dev_params [configNr].stats) { + *outbuf = cpu_to_le32 ( + (rndis_per_dev_params [configNr] +- .stats->tx_packets - ++ .stats->tx_packets - + rndis_per_dev_params [configNr] + .stats->tx_errors - + rndis_per_dev_params [configNr] +@@ -444,7 +444,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_MULTICAST_BYTES_XMIT: + DEBUG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -453,7 +453,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_MULTICAST_FRAMES_XMIT: + DEBUG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -462,7 +462,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_BROADCAST_BYTES_XMIT: + DEBUG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -471,7 +471,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_BROADCAST_FRAMES_XMIT: + DEBUG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -480,19 +480,19 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_DIRECTED_BYTES_RCV: + DEBUG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__); + *outbuf = __constant_cpu_to_le32 (0); + retval = 0; + break; +- ++ + case OID_GEN_DIRECTED_FRAMES_RCV: + DEBUG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__); + *outbuf = __constant_cpu_to_le32 (0); + retval = 0; + break; +- ++ + case OID_GEN_MULTICAST_BYTES_RCV: + DEBUG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -501,7 +501,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_MULTICAST_FRAMES_RCV: + DEBUG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -510,7 +510,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_BROADCAST_BYTES_RCV: + DEBUG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -519,7 +519,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_BROADCAST_FRAMES_RCV: + DEBUG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -528,7 +528,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_RCV_CRC_ERROR: + DEBUG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__); + if (rndis_per_dev_params [configNr].stats) { +@@ -537,7 +537,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + case OID_GEN_TRANSMIT_QUEUE_LENGTH: + DEBUG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__); + *outbuf = __constant_cpu_to_le32 (0); +@@ -558,7 +558,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_802_3_CURRENT_ADDRESS: + DEBUG("%s: OID_802_3_CURRENT_ADDRESS\n", __FUNCTION__); +@@ -570,7 +570,7 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_802_3_MULTICAST_LIST: + DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); +@@ -578,7 +578,7 @@ gen_ndis_query_resp (int configNr, u32 O + *outbuf = __constant_cpu_to_le32 (0xE0000000); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_802_3_MAXIMUM_LIST_SIZE: + DEBUG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__); +@@ -586,7 +586,7 @@ gen_ndis_query_resp (int configNr, u32 O + *outbuf = __constant_cpu_to_le32 (1); + retval = 0; + break; +- ++ + case OID_802_3_MAC_OPTIONS: + DEBUG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__); + break; +@@ -602,56 +602,56 @@ gen_ndis_query_resp (int configNr, u32 O + retval = 0; + } + break; +- ++ + /* mandatory */ + case OID_802_3_XMIT_ONE_COLLISION: + DEBUG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__); + *outbuf = __constant_cpu_to_le32 (0); + retval = 0; + break; +- ++ + /* mandatory */ + case OID_802_3_XMIT_MORE_COLLISIONS: + DEBUG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__); + *outbuf = __constant_cpu_to_le32 (0); + retval = 0; + break; +- ++ + #ifdef RNDIS_OPTIONAL_STATS + case OID_802_3_XMIT_DEFERRED: + DEBUG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_XMIT_MAX_COLLISIONS: + DEBUG("%s: OID_802_3_XMIT_MAX_COLLISIONS\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_RCV_OVERRUN: + DEBUG("%s: OID_802_3_RCV_OVERRUN\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_XMIT_UNDERRUN: + DEBUG("%s: OID_802_3_XMIT_UNDERRUN\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_XMIT_HEARTBEAT_FAILURE: + DEBUG("%s: OID_802_3_XMIT_HEARTBEAT_FAILURE\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_XMIT_TIMES_CRS_LOST: + DEBUG("%s: OID_802_3_XMIT_TIMES_CRS_LOST\n", __FUNCTION__); + /* TODO */ + break; +- ++ + case OID_802_3_XMIT_LATE_COLLISIONS: + DEBUG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__); + /* TODO */ +- break; ++ break; + #endif /* RNDIS_OPTIONAL_STATS */ + + #ifdef RNDIS_PM +@@ -676,23 +676,23 @@ gen_ndis_query_resp (int configNr, u32 O + #endif + + default: +- printk (KERN_WARNING "%s: query unknown OID 0x%08X\n", ++ printk (KERN_WARNING "%s: query unknown OID 0x%08X\n", + __FUNCTION__, OID); + } + if (retval < 0) + length = 0; +- ++ + resp->InformationBufferLength = cpu_to_le32 (length); + r->length = length + sizeof *resp; + resp->MessageLength = cpu_to_le32 (r->length); + return retval; + } + +-static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, +- rndis_resp_t *r) ++static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, ++ rndis_resp_t *r) + { + rndis_set_cmplt_type *resp; +- int i, retval = -ENOTSUPP; ++ int i, retval = -ENOTSUPP; + struct rndis_params *params; + + if (!r) +@@ -745,9 +745,9 @@ update_linkstate: + netif_stop_queue (params->dev); + } + break; +- ++ + case OID_802_3_MULTICAST_LIST: +- /* I think we can ignore this */ ++ /* I think we can ignore this */ + DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); + retval = 0; + break; +@@ -796,29 +796,29 @@ update_linkstate: + #endif /* RNDIS_PM */ + + default: +- printk (KERN_WARNING "%s: set unknown OID 0x%08X, size %d\n", ++ printk (KERN_WARNING "%s: set unknown OID 0x%08X, size %d\n", + __FUNCTION__, OID, buf_len); + } +- ++ + return retval; + } + +-/* +- * Response Functions ++/* ++ * Response Functions + */ + + static int rndis_init_response (int configNr, rndis_init_msg_type *buf) + { +- rndis_init_cmplt_type *resp; ++ rndis_init_cmplt_type *resp; + rndis_resp_t *r; +- ++ + if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; +- ++ + r = rndis_add_response (configNr, sizeof (rndis_init_cmplt_type)); + if (!r) + return -ENOMEM; + resp = (rndis_init_cmplt_type *) r->buf; +- ++ + resp->MessageType = __constant_cpu_to_le32 ( + REMOTE_NDIS_INITIALIZE_CMPLT); + resp->MessageLength = __constant_cpu_to_le32 (52); +@@ -837,11 +837,11 @@ static int rndis_init_response (int conf + resp->PacketAlignmentFactor = __constant_cpu_to_le32 (0); + resp->AFListOffset = __constant_cpu_to_le32 (0); + resp->AFListSize = __constant_cpu_to_le32 (0); +- ++ + if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); +- ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); ++ + return 0; + } + +@@ -849,10 +849,10 @@ static int rndis_query_response (int con + { + rndis_query_cmplt_type *resp; + rndis_resp_t *r; +- ++ + // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); + if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; +- ++ + /* + * we need more memory: + * gen_ndis_query_resp expects enough space for +@@ -864,10 +864,10 @@ static int rndis_query_response (int con + if (!r) + return -ENOMEM; + resp = (rndis_query_cmplt_type *) r->buf; +- ++ + resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT); + resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ +- ++ + if (gen_ndis_query_resp (configNr, le32_to_cpu (buf->OID), + le32_to_cpu(buf->InformationBufferOffset) + + 8 + (u8 *) buf, +@@ -881,10 +881,10 @@ static int rndis_query_response (int con + resp->InformationBufferOffset = __constant_cpu_to_le32 (0); + } else + resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); +- ++ + if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); + return 0; + } + +@@ -893,7 +893,7 @@ static int rndis_set_response (int confi + u32 BufLength, BufOffset; + rndis_set_cmplt_type *resp; + rndis_resp_t *r; +- ++ + r = rndis_add_response (configNr, sizeof (rndis_set_cmplt_type)); + if (!r) + return -ENOMEM; +@@ -906,26 +906,27 @@ static int rndis_set_response (int confi + DEBUG("%s: Length: %d\n", __FUNCTION__, BufLength); + DEBUG("%s: Offset: %d\n", __FUNCTION__, BufOffset); + DEBUG("%s: InfoBuffer: ", __FUNCTION__); +- ++ + for (i = 0; i < BufLength; i++) { + DEBUG ("%02x ", *(((u8 *) buf) + i + 8 + BufOffset)); + } +- ++ + DEBUG ("\n"); + #endif +- ++ + resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT); + resp->MessageLength = __constant_cpu_to_le32 (16); + resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ +- if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID), +- ((u8 *) buf) + 8 + BufOffset, BufLength, r)) +- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED); +- else resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); +- ++ if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID), ++ ((u8 *) buf) + 8 + BufOffset, BufLength, r)) ++ resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED); ++ else ++ resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); ++ + if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); +- ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); ++ + return 0; + } + +@@ -933,27 +934,27 @@ static int rndis_reset_response (int con + { + rndis_reset_cmplt_type *resp; + rndis_resp_t *r; +- ++ + r = rndis_add_response (configNr, sizeof (rndis_reset_cmplt_type)); + if (!r) + return -ENOMEM; + resp = (rndis_reset_cmplt_type *) r->buf; +- ++ + resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT); + resp->MessageLength = __constant_cpu_to_le32 (16); + resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); + /* resent information */ + resp->AddressingReset = __constant_cpu_to_le32 (1); +- ++ + if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); + + return 0; + } + + static int rndis_keepalive_response (int configNr, +- rndis_keepalive_msg_type *buf) ++ rndis_keepalive_msg_type *buf) + { + rndis_keepalive_cmplt_type *resp; + rndis_resp_t *r; +@@ -964,48 +965,48 @@ static int rndis_keepalive_response (int + if (!r) + return -ENOMEM; + resp = (rndis_keepalive_cmplt_type *) r->buf; +- ++ + resp->MessageType = __constant_cpu_to_le32 ( + REMOTE_NDIS_KEEPALIVE_CMPLT); + resp->MessageLength = __constant_cpu_to_le32 (16); + resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ + resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); +- ++ + if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); +- ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); ++ + return 0; + } + + +-/* +- * Device to Host Comunication ++/* ++ * Device to Host Comunication + */ + static int rndis_indicate_status_msg (int configNr, u32 status) + { +- rndis_indicate_status_msg_type *resp; ++ rndis_indicate_status_msg_type *resp; + rndis_resp_t *r; +- ++ + if (rndis_per_dev_params [configNr].state == RNDIS_UNINITIALIZED) +- return -ENOTSUPP; +- +- r = rndis_add_response (configNr, ++ return -ENOTSUPP; ++ ++ r = rndis_add_response (configNr, + sizeof (rndis_indicate_status_msg_type)); + if (!r) + return -ENOMEM; + resp = (rndis_indicate_status_msg_type *) r->buf; +- ++ + resp->MessageType = __constant_cpu_to_le32 ( + REMOTE_NDIS_INDICATE_STATUS_MSG); + resp->MessageLength = __constant_cpu_to_le32 (20); + resp->Status = cpu_to_le32 (status); + resp->StatusBufferLength = __constant_cpu_to_le32 (0); + resp->StatusBufferOffset = __constant_cpu_to_le32 (0); +- +- if (rndis_per_dev_params [configNr].ack) +- rndis_per_dev_params [configNr].ack ( +- rndis_per_dev_params [configNr].dev); ++ ++ if (rndis_per_dev_params [configNr].ack) ++ rndis_per_dev_params [configNr].ack ( ++ rndis_per_dev_params [configNr].dev); + return 0; + } + +@@ -1013,7 +1014,7 @@ int rndis_signal_connect (int configNr) + { + rndis_per_dev_params [configNr].media_state + = NDIS_MEDIA_STATE_CONNECTED; +- return rndis_indicate_status_msg (configNr, ++ return rndis_indicate_status_msg (configNr, + RNDIS_STATUS_MEDIA_CONNECT); + } + +@@ -1045,26 +1046,26 @@ void rndis_set_host_mac (int configNr, c + rndis_per_dev_params [configNr].host_mac = addr; + } + +-/* +- * Message Parser ++/* ++ * Message Parser + */ + int rndis_msg_parser (u8 configNr, u8 *buf) + { + u32 MsgType, MsgLength; + __le32 *tmp; + struct rndis_params *params; +- ++ + if (!buf) + return -ENOMEM; +- +- tmp = (__le32 *) buf; ++ ++ tmp = (__le32 *) buf; + MsgType = le32_to_cpup(tmp++); + MsgLength = le32_to_cpup(tmp++); +- ++ + if (configNr >= RNDIS_MAX_CONFIGS) + return -ENOTSUPP; + params = &rndis_per_dev_params [configNr]; +- ++ + /* NOTE: RNDIS is *EXTREMELY* chatty ... Windows constantly polls for + * rx/tx statistics and link status, in addition to KEEPALIVE traffic + * and normal HC level polling to see if there's any IN traffic. +@@ -1073,12 +1074,12 @@ int rndis_msg_parser (u8 configNr, u8 *b + /* For USB: responses may take up to 10 seconds */ + switch (MsgType) { + case REMOTE_NDIS_INITIALIZE_MSG: +- DEBUG("%s: REMOTE_NDIS_INITIALIZE_MSG\n", ++ DEBUG("%s: REMOTE_NDIS_INITIALIZE_MSG\n", + __FUNCTION__ ); + params->state = RNDIS_INITIALIZED; + return rndis_init_response (configNr, +- (rndis_init_msg_type *) buf); +- ++ (rndis_init_msg_type *) buf); ++ + case REMOTE_NDIS_HALT_MSG: + DEBUG("%s: REMOTE_NDIS_HALT_MSG\n", + __FUNCTION__ ); +@@ -1088,37 +1089,37 @@ int rndis_msg_parser (u8 configNr, u8 *b + netif_stop_queue (params->dev); + } + return 0; +- ++ + case REMOTE_NDIS_QUERY_MSG: +- return rndis_query_response (configNr, +- (rndis_query_msg_type *) buf); +- ++ return rndis_query_response (configNr, ++ (rndis_query_msg_type *) buf); ++ + case REMOTE_NDIS_SET_MSG: +- return rndis_set_response (configNr, +- (rndis_set_msg_type *) buf); +- ++ return rndis_set_response (configNr, ++ (rndis_set_msg_type *) buf); ++ + case REMOTE_NDIS_RESET_MSG: +- DEBUG("%s: REMOTE_NDIS_RESET_MSG\n", ++ DEBUG("%s: REMOTE_NDIS_RESET_MSG\n", + __FUNCTION__ ); + return rndis_reset_response (configNr, +- (rndis_reset_msg_type *) buf); ++ (rndis_reset_msg_type *) buf); + + case REMOTE_NDIS_KEEPALIVE_MSG: + /* For USB: host does this every 5 seconds */ + if (rndis_debug > 1) +- DEBUG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n", ++ DEBUG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n", + __FUNCTION__ ); + return rndis_keepalive_response (configNr, +- (rndis_keepalive_msg_type *) ++ (rndis_keepalive_msg_type *) + buf); +- +- default: ++ ++ default: + /* At least Windows XP emits some undefined RNDIS messages. + * In one case those messages seemed to relate to the host + * suspending itself. + */ + printk (KERN_WARNING +- "%s: unknown RNDIS message 0x%08X len %d\n", ++ "%s: unknown RNDIS message 0x%08X len %d\n", + __FUNCTION__ , MsgType, MsgLength); + { + unsigned i; +@@ -1142,14 +1143,14 @@ int rndis_msg_parser (u8 configNr, u8 *b + } + break; + } +- ++ + return -ENOTSUPP; + } + + int rndis_register (int (* rndis_control_ack) (struct net_device *)) + { + u8 i; +- ++ + for (i = 0; i < RNDIS_MAX_CONFIGS; i++) { + if (!rndis_per_dev_params [i].used) { + rndis_per_dev_params [i].used = 1; +@@ -1159,32 +1160,32 @@ int rndis_register (int (* rndis_control + } + } + DEBUG("failed\n"); +- ++ + return -1; + } + + void rndis_deregister (int configNr) + { + DEBUG("%s: \n", __FUNCTION__ ); +- ++ + if (configNr >= RNDIS_MAX_CONFIGS) return; + rndis_per_dev_params [configNr].used = 0; +- ++ + return; + } + +-int rndis_set_param_dev (u8 configNr, struct net_device *dev, ++int rndis_set_param_dev (u8 configNr, struct net_device *dev, + struct net_device_stats *stats, + u16 *cdc_filter) + { + DEBUG("%s:\n", __FUNCTION__ ); + if (!dev || !stats) return -1; + if (configNr >= RNDIS_MAX_CONFIGS) return -1; +- ++ + rndis_per_dev_params [configNr].dev = dev; + rndis_per_dev_params [configNr].stats = stats; + rndis_per_dev_params [configNr].filter = cdc_filter; +- ++ + return 0; + } + +@@ -1193,10 +1194,10 @@ int rndis_set_param_vendor (u8 configNr, + DEBUG("%s:\n", __FUNCTION__ ); + if (!vendorDescr) return -1; + if (configNr >= RNDIS_MAX_CONFIGS) return -1; +- ++ + rndis_per_dev_params [configNr].vendorID = vendorID; + rndis_per_dev_params [configNr].vendorDescr = vendorDescr; +- ++ + return 0; + } + +@@ -1204,10 +1205,10 @@ int rndis_set_param_medium (u8 configNr, + { + DEBUG("%s: %u %u\n", __FUNCTION__, medium, speed); + if (configNr >= RNDIS_MAX_CONFIGS) return -1; +- ++ + rndis_per_dev_params [configNr].medium = medium; + rndis_per_dev_params [configNr].speed = speed; +- ++ + return 0; + } + +@@ -1229,9 +1230,9 @@ void rndis_free_response (int configNr, + { + rndis_resp_t *r; + struct list_head *act, *tmp; +- +- list_for_each_safe (act, tmp, +- &(rndis_per_dev_params [configNr].resp_queue)) ++ ++ list_for_each_safe (act, tmp, ++ &(rndis_per_dev_params [configNr].resp_queue)) + { + r = list_entry (act, rndis_resp_t, list); + if (r && r->buf == buf) { +@@ -1244,12 +1245,12 @@ void rndis_free_response (int configNr, + u8 *rndis_get_next_response (int configNr, u32 *length) + { + rndis_resp_t *r; +- struct list_head *act, *tmp; +- ++ struct list_head *act, *tmp; ++ + if (!length) return NULL; +- +- list_for_each_safe (act, tmp, +- &(rndis_per_dev_params [configNr].resp_queue)) ++ ++ list_for_each_safe (act, tmp, ++ &(rndis_per_dev_params [configNr].resp_queue)) + { + r = list_entry (act, rndis_resp_t, list); + if (!r->send) { +@@ -1258,24 +1259,24 @@ u8 *rndis_get_next_response (int configN + return r->buf; + } + } +- ++ + return NULL; + } + + static rndis_resp_t *rndis_add_response (int configNr, u32 length) + { + rndis_resp_t *r; +- ++ + /* NOTE: this gets copied into ether.c USB_BUFSIZ bytes ... */ + r = kmalloc (sizeof (rndis_resp_t) + length, GFP_ATOMIC); + if (!r) return NULL; +- ++ + r->buf = (u8 *) (r + 1); + r->length = length; + r->send = 0; +- +- list_add_tail (&r->list, +- &(rndis_per_dev_params [configNr].resp_queue)); ++ ++ list_add_tail (&r->list, ++ &(rndis_per_dev_params [configNr].resp_queue)); + return r; + } + +@@ -1301,14 +1302,14 @@ int rndis_rm_hdr(struct sk_buff *skb) + + #ifdef CONFIG_USB_GADGET_DEBUG_FILES + +-static int rndis_proc_read (char *page, char **start, off_t off, int count, int *eof, +- void *data) ++static int rndis_proc_read (char *page, char **start, off_t off, int count, int *eof, ++ void *data) + { + char *out = page; + int len; + rndis_params *param = (rndis_params *) data; +- +- out += snprintf (out, count, ++ ++ out += snprintf (out, count, + "Config Nr. %d\n" + "used : %s\n" + "state : %s\n" +@@ -1316,8 +1317,8 @@ static int rndis_proc_read (char *page, + "speed : %d\n" + "cable : %s\n" + "vendor ID : 0x%08X\n" +- "vendor : %s\n", +- param->confignr, (param->used) ? "y" : "n", ++ "vendor : %s\n", ++ param->confignr, (param->used) ? "y" : "n", + ({ char *s = "?"; + switch (param->state) { + case RNDIS_UNINITIALIZED: +@@ -1327,32 +1328,32 @@ static int rndis_proc_read (char *page, + case RNDIS_DATA_INITIALIZED: + s = "RNDIS_DATA_INITIALIZED"; break; + }; s; }), +- param->medium, +- (param->media_state) ? 0 : param->speed*100, ++ param->medium, ++ (param->media_state) ? 0 : param->speed*100, + (param->media_state) ? "disconnected" : "connected", +- param->vendorID, param->vendorDescr); +- ++ param->vendorID, param->vendorDescr); ++ + len = out - page; + len -= off; +- ++ + if (len < count) { + *eof = 1; + if (len <= 0) + return 0; + } else + len = count; +- ++ + *start = page + off; + return len; + } + +-static int rndis_proc_write (struct file *file, const char __user *buffer, +- unsigned long count, void *data) ++static int rndis_proc_write (struct file *file, const char __user *buffer, ++ unsigned long count, void *data) + { + rndis_params *p = data; + u32 speed = 0; + int i, fl_speed = 0; +- ++ + for (i = 0; i < count; i++) { + char c; + if (get_user(c, buffer)) +@@ -1379,15 +1380,15 @@ static int rndis_proc_write (struct file + case 'd': + rndis_signal_disconnect(p->confignr); + break; +- default: ++ default: + if (fl_speed) p->speed = speed; + else DEBUG ("%c is not valid\n", c); + break; + } +- ++ + buffer++; + } +- ++ + return count; + } + +@@ -1408,7 +1409,7 @@ int __init rndis_init (void) + + sprintf (name, NAME_TEMPLATE, i); + if (!(rndis_connect_state [i] +- = create_proc_entry (name, 0660, NULL))) ++ = create_proc_entry (name, 0660, NULL))) + { + DEBUG ("%s :remove entries", __FUNCTION__); + while (i) { +@@ -1432,7 +1433,7 @@ int __init rndis_init (void) + = NDIS_MEDIA_STATE_DISCONNECTED; + INIT_LIST_HEAD (&(rndis_per_dev_params [i].resp_queue)); + } +- ++ + return 0; + } + +@@ -1441,7 +1442,7 @@ void rndis_exit (void) + #ifdef CONFIG_USB_GADGET_DEBUG_FILES + u8 i; + char name [20]; +- ++ + for (i = 0; i < RNDIS_MAX_CONFIGS; i++) { + sprintf (name, NAME_TEMPLATE, i); + remove_proc_entry (name, NULL); +--- gregkh-2.6.orig/drivers/usb/gadget/rndis.h ++++ gregkh-2.6/drivers/usb/gadget/rndis.h +@@ -1,15 +1,15 @@ +-/* ++/* + * RNDIS Definitions for Remote NDIS +- * ++ * + * Version: $Id: rndis.h,v 1.15 2004/03/25 21:33:46 robert Exp $ +- * ++ * + * Authors: Benedikt Spranger, Pengutronix +- * Robert Schwebel, Pengutronix +- * +- * This program is free software; you can redistribute it and/or ++ * Robert Schwebel, Pengutronix ++ * ++ * 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. +- * ++ * version 2, as published by the Free Software Foundation. ++ * + * This software was originally developed in conformance with + * Microsoft's Remote NDIS Specification License Agreement. + */ +@@ -34,7 +34,7 @@ + #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BU /* Device connected */ + #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CU /* Device disconnected */ + /* For all not specified status messages: +- * RNDIS_STATUS_Xxx -> NDIS_STATUS_Xxx ++ * RNDIS_STATUS_Xxx -> NDIS_STATUS_Xxx + */ + + /* Message Set for Connectionless (802.3) Devices */ +@@ -69,7 +69,7 @@ + #define OID_PNP_ENABLE_WAKE_UP 0xFD010106 + + +-typedef struct rndis_init_msg_type ++typedef struct rndis_init_msg_type + { + __le32 MessageType; + __le32 MessageLength; +@@ -234,12 +234,12 @@ typedef struct rndis_params + + const u8 *host_mac; + u16 *filter; +- struct net_device *dev; ++ struct net_device *dev; + struct net_device_stats *stats; + + u32 vendorID; + const char *vendorDescr; +- int (*ack) (struct net_device *); ++ int (*ack) (struct net_device *); + struct list_head resp_queue; + } rndis_params; + +@@ -250,7 +250,7 @@ void rndis_deregister (int configNr); + int rndis_set_param_dev (u8 configNr, struct net_device *dev, + struct net_device_stats *stats, + u16 *cdc_filter); +-int rndis_set_param_vendor (u8 configNr, u32 vendorID, ++int rndis_set_param_vendor (u8 configNr, u32 vendorID, + const char *vendorDescr); + int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed); + void rndis_add_hdr (struct sk_buff *skb); diff --git a/usb/usbserial-fixes-wrong-return-values.patch b/usb/usbserial-fixes-wrong-return-values.patch new file mode 100644 index 0000000000000..fc0b471670a46 --- /dev/null +++ b/usb/usbserial-fixes-wrong-return-values.patch @@ -0,0 +1,83 @@ +From lcapitulino@mandriva.com.br Mon Jun 12 18:42:52 2006 +Date: Mon, 12 Jun 2006 22:46:20 -0300 +From: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br> +To: gregkh@suse.de +Subject: usbserial: Fixes wrong return values. +Message-ID: <20060612224620.36fa5142@home.brethil> + + +Some usbserial functions returns -EINVAL if the port doesn't exist or if +it's not opened. However, the right error code for such situations is +-ENODEV. + +Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/usb-serial.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c ++++ gregkh-2.6/drivers/usb/serial/usb-serial.c +@@ -305,7 +305,7 @@ exit: + static int serial_write_room (struct tty_struct *tty) + { + struct usb_serial_port *port = tty->driver_data; +- int retval = -EINVAL; ++ int retval = -ENODEV; + + if (!port) + goto exit; +@@ -327,7 +327,7 @@ exit: + static int serial_chars_in_buffer (struct tty_struct *tty) + { + struct usb_serial_port *port = tty->driver_data; +- int retval = -EINVAL; ++ int retval = -ENODEV; + + if (!port) + goto exit; +@@ -497,19 +497,18 @@ static int serial_tiocmget (struct tty_s + struct usb_serial_port *port = tty->driver_data; + + if (!port) +- goto exit; ++ return -ENODEV; + + dbg("%s - port %d", __FUNCTION__, port->number); + + if (!port->open_count) { + dbg("%s - port not open", __FUNCTION__); +- goto exit; ++ return -ENODEV; + } + + if (port->serial->type->tiocmget) + return port->serial->type->tiocmget(port, file); + +-exit: + return -EINVAL; + } + +@@ -519,19 +518,18 @@ static int serial_tiocmset (struct tty_s + struct usb_serial_port *port = tty->driver_data; + + if (!port) +- goto exit; ++ return -ENODEV; + + dbg("%s - port %d", __FUNCTION__, port->number); + + if (!port->open_count) { + dbg("%s - port not open", __FUNCTION__); +- goto exit; ++ return -ENODEV; + } + + if (port->serial->type->tiocmset) + return port->serial->type->tiocmset(port, file, set, clear); + +-exit: + return -EINVAL; + } + |