From e2e66446e08a7a365a59e25bbc8dd320ab3da0a6 Mon Sep 17 00:00:00 2001 From: Matthew Dharm Date: Mon, 25 Apr 2005 21:46:29 -0700 Subject: [PATCH] USB Storage: fix compile error This patch fixes a compiler error caused by a missing prototype. It should apply directly to Greg KH's usb-2.6.git tree. Signed-off-by: Matthew Dharm Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/debug.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c index d76483706bc..5a9321705a7 100644 --- a/drivers/usb/storage/debug.c +++ b/drivers/usb/storage/debug.c @@ -47,6 +47,7 @@ #include #include #include +#include #include "debug.h" #include "scsi.h" -- cgit v1.2.3-70-g09d2 From 56c1e26d75008d39f1067f453719857a81109d9f Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 9 Apr 2005 09:00:29 -0700 Subject: [PATCH] USB: ehci power fixes Miscellaneous updates for EHCI. - Mostly updates the power switching on EHCI controllers. One routine centralizes the "power on/off all ports" logic, and the capability to do that is reported more correctly. - Courtesy Colin Leroy, a patch to always power up ports after resumes which didn't keep a USB device suspended. The reset-everything logic powers down those ports (on some hardware) so something needs to turn them back on. - Minor tweaks/bugfixes for the debug port support. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-hcd.c | 65 ++++++++++++++++++++++++++++++--------------- drivers/usb/host/ehci-hub.c | 2 ++ drivers/usb/host/ehci.h | 19 ++++++------- 3 files changed, 56 insertions(+), 30 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 84d2b93aca3..bc69bd7aceb 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -346,6 +346,22 @@ ehci_reboot (struct notifier_block *self, unsigned long code, void *null) return 0; } +static void ehci_port_power (struct ehci_hcd *ehci, int is_on) +{ + unsigned port; + + if (!HCS_PPC (ehci->hcs_params)) + return; + + ehci_dbg (ehci, "...power%s ports...\n", is_on ? "up" : "down"); + for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) + (void) ehci_hub_control(ehci_to_hcd(ehci), + is_on ? SetPortFeature : ClearPortFeature, + USB_PORT_FEAT_POWER, + port--, NULL, 0); + msleep(20); +} + /* called by khubd or root hub init threads */ @@ -362,8 +378,10 @@ static int ehci_hc_reset (struct usb_hcd *hcd) dbg_hcs_params (ehci, "reset"); dbg_hcc_params (ehci, "reset"); + /* cache this readonly data; minimize chip reads */ + ehci->hcs_params = readl (&ehci->caps->hcs_params); + #ifdef CONFIG_PCI - /* EHCI 0.96 and later may have "extended capabilities" */ if (hcd->self.controller->bus == &pci_bus_type) { struct pci_dev *pdev = to_pci_dev(hcd->self.controller); @@ -383,9 +401,30 @@ static int ehci_hc_reset (struct usb_hcd *hcd) break; } + /* optional debug port, normally in the first BAR */ + temp = pci_find_capability (pdev, 0x0a); + if (temp) { + pci_read_config_dword(pdev, temp, &temp); + temp >>= 16; + if ((temp & (3 << 13)) == (1 << 13)) { + temp &= 0x1fff; + ehci->debug = hcd->regs + temp; + temp = readl (&ehci->debug->control); + ehci_info (ehci, "debug port %d%s\n", + HCS_DEBUG_PORT(ehci->hcs_params), + (temp & DBGP_ENABLED) + ? " IN USE" + : ""); + if (!(temp & DBGP_ENABLED)) + ehci->debug = NULL; + } + } + temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params)); } else temp = 0; + + /* EHCI 0.96 and later may have "extended capabilities" */ while (temp && count--) { u32 cap; @@ -414,8 +453,7 @@ static int ehci_hc_reset (struct usb_hcd *hcd) ehci_reset (ehci); #endif - /* cache this readonly data; minimize PCI reads */ - ehci->hcs_params = readl (&ehci->caps->hcs_params); + ehci_port_power (ehci, 0); /* at least the Genesys GL880S needs fixup here */ temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params); @@ -657,16 +695,11 @@ done2: static void ehci_stop (struct usb_hcd *hcd) { struct ehci_hcd *ehci = hcd_to_ehci (hcd); - u8 rh_ports, port; ehci_dbg (ehci, "stop\n"); /* Turn off port power on all root hub ports. */ - rh_ports = HCS_N_PORTS (ehci->hcs_params); - for (port = 1; port <= rh_ports; port++) - (void) ehci_hub_control(hcd, - ClearPortFeature, USB_PORT_FEAT_POWER, - port, NULL, 0); + ehci_port_power (ehci, 0); /* no more interrupts ... */ del_timer_sync (&ehci->watchdog); @@ -748,7 +781,6 @@ static int ehci_resume (struct usb_hcd *hcd) unsigned port; struct usb_device *root = hcd->self.root_hub; int retval = -EINVAL; - int powerup = 0; // maybe restore (PCI) FLADJ @@ -766,8 +798,6 @@ static int ehci_resume (struct usb_hcd *hcd) up (&hcd->self.root_hub->serialize); break; } - if ((status & PORT_POWER) == 0) - powerup = 1; if (!root->children [port]) continue; dbg_port (ehci, __FUNCTION__, port + 1, status); @@ -794,16 +824,9 @@ static int ehci_resume (struct usb_hcd *hcd) retval = ehci_start (hcd); /* here we "know" root ports should always stay powered; - * but some controllers may lost all power. + * but some controllers may lose all power. */ - if (powerup) { - ehci_dbg (ehci, "...powerup ports...\n"); - for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) - (void) ehci_hub_control(hcd, - SetPortFeature, USB_PORT_FEAT_POWER, - port--, NULL, 0); - msleep(20); - } + ehci_port_power (ehci, 1); } return retval; diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 2373537fabe..02fefab3501 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -281,6 +281,8 @@ ehci_hub_descriptor ( temp = 0x0008; /* per-port overcurrent reporting */ if (HCS_PPC (ehci->hcs_params)) temp |= 0x0001; /* per-port power control */ + else + temp |= 0x0002; /* no power switching */ #if 0 // re-enable when we support USB_PORT_FEAT_INDICATOR below. if (HCS_INDICATOR (ehci->hcs_params)) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index e763a8399a7..4df49823175 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -47,6 +47,12 @@ struct ehci_stats { #define EHCI_MAX_ROOT_PORTS 15 /* see HCS_N_PORTS */ struct ehci_hcd { /* one per controller */ + /* glue to PCI and HCD framework */ + struct ehci_caps __iomem *caps; + struct ehci_regs __iomem *regs; + struct ehci_dbg_port __iomem *debug; + + __u32 hcs_params; /* cached register copy */ spinlock_t lock; /* async schedule support */ @@ -84,11 +90,6 @@ struct ehci_hcd { /* one per controller */ unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */ - /* glue to PCI and HCD framework */ - struct ehci_caps __iomem *caps; - struct ehci_regs __iomem *regs; - __u32 hcs_params; /* cached register copy */ - /* irq statistics */ #ifdef EHCI_STATS struct ehci_stats stats; @@ -165,7 +166,7 @@ struct ehci_caps { /* these fields are specified as 8 and 16 bit registers, * but some hosts can't perform 8 or 16 bit PCI accesses. */ - u32 hc_capbase; + u32 hc_capbase; #define HC_LENGTH(p) (((p)>>00)&0x00ff) /* bits 7:0 */ #define HC_VERSION(p) (((p)>>16)&0xffff) /* bits 31:16 */ u32 hcs_params; /* HCSPARAMS - offset 0x4 */ @@ -273,7 +274,7 @@ struct ehci_dbg_port { #define DBGP_ENABLED (1<<28) #define DBGP_DONE (1<<16) #define DBGP_INUSE (1<<10) -#define DBGP_ERRCODE(x) (((x)>>7)&0x0f) +#define DBGP_ERRCODE(x) (((x)>>7)&0x07) # define DBGP_ERR_BAD 1 # define DBGP_ERR_SIGNAL 2 #define DBGP_ERROR (1<<6) @@ -282,11 +283,11 @@ struct ehci_dbg_port { #define DBGP_LEN(x) (((x)>>0)&0x0f) u32 pids; #define DBGP_PID_GET(x) (((x)>>16)&0xff) -#define DBGP_PID_SET(data,tok) (((data)<<8)|(tok)); +#define DBGP_PID_SET(data,tok) (((data)<<8)|(tok)) u32 data03; u32 data47; u32 address; -#define DBGP_EPADDR(dev,ep) (((dev)<<8)|(ep)); +#define DBGP_EPADDR(dev,ep) (((dev)<<8)|(ep)) } __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ -- cgit v1.2.3-70-g09d2 From 3b86b2028c4de998978baae780edfc36995bebc5 Mon Sep 17 00:00:00 2001 From: Greg KH Date: Mon, 25 Apr 2005 21:46:29 -0700 Subject: [PATCH] USB: add a driver for the AirPrime CDMA Wireless PC card. Easier than trying to use the generic usb-serial driver. Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/Kconfig | 9 +++++++ drivers/usb/serial/Makefile | 1 + drivers/usb/serial/airprime.c | 63 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 drivers/usb/serial/airprime.c (limited to 'drivers') diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 0c4aa00bb39..bc798edf035 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig @@ -53,6 +53,15 @@ config USB_SERIAL_GENERIC support" be compiled as a module for this driver to be used properly. +config USB_SERIAL_AIRPRIME + tristate "USB AirPrime CDMA Wireless Driver" + depends on USB_SERIAL + help + Say Y here if you want to use a AirPrime CDMA Wireless PC card. + + To compile this driver as a module, choose M here: the + module will be called airprime. + config USB_SERIAL_BELKIN tristate "USB Belkin and Peracom Single Port Serial Driver" depends on USB_SERIAL diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index b0aac47d195..d56ff6d86cc 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile @@ -11,6 +11,7 @@ usbserial-obj-$(CONFIG_USB_EZUSB) += ezusb.o usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) +obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c new file mode 100644 index 00000000000..a4ce0008d69 --- /dev/null +++ b/drivers/usb/serial/airprime.c @@ -0,0 +1,63 @@ +/* + * AirPrime CDMA Wireless Serial USB driver + * + * Copyright (C) 2005 Greg Kroah-Hartman + * + * 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 +#include +#include +#include +#include +#include "usb-serial.h" + +static struct usb_device_id id_table [] = { + { USB_DEVICE(0xf3d, 0x0112) }, + { }, +}; +MODULE_DEVICE_TABLE(usb, id_table); + +static struct usb_driver airprime_driver = { + .owner = THIS_MODULE, + .name = "airprime", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, + .id_table = id_table, +}; + +static struct usb_serial_device_type airprime_device = { + .owner = THIS_MODULE, + .name = "airprime", + .id_table = id_table, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, +}; + +static int __init airprime_init(void) +{ + int retval; + + retval = usb_serial_register(&airprime_device); + if (retval) + return retval; + retval = usb_register(&airprime_driver); + if (retval) + usb_serial_deregister(&airprime_device); + return retval; +} + +static void __exit airprime_exit(void) +{ + usb_deregister(&airprime_driver); + usb_serial_deregister(&airprime_device); +} + +module_init(airprime_init); +module_exit(airprime_exit); +MODULE_LICENSE("GPL"); -- cgit v1.2.3-70-g09d2 From b9ab0746a53b9cd5c64e179a1c13952f0ae80e64 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Mon, 2 May 2005 22:47:55 +0200 Subject: [PATCH] USB: new usbnet device id On Thu, Apr 14, 2005 at 11:06:21PM +0400, Sergey Vlasov wrote: > http://thread.gmane.org/gmane.linux.usb.devel/32977 > > (see "[PATCH] N/3 cdc acm errors"). > > You also need this driver core fix: > > http://thread.gmane.org/gmane.linux.usb.devel/33132 I reproduced the same oops while trying to execute at+mode=99, it would be nice to get these fix merged since I believe it's still needed to connect the laptop over gprs (something I didn't test yet). This further patch will allow you to connect via usbnet, Greg could you apply? Thanks! Signed-off-by: Andrea Arcangeli Signed-off-by: Greg Kroah-Hartman --- drivers/usb/net/usbnet.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index a45ea7c9735..f6bc6b3b333 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -4070,6 +4070,9 @@ static const struct usb_device_id products [] = { }, { USB_DEVICE (0x8086, 0x07d3), // "blob" bootloader .driver_info = (unsigned long) &blob_info, +}, { + USB_DEVICE (0x22b8, 0x600c), // USBNET Motorola E680 + .driver_info = (unsigned long) &linuxdev_info, }, { // Linux Ethernet/RNDIS gadget on pxa210/25x/26x // e.g. Gumstix, current OpenZaurus, ... -- cgit v1.2.3-70-g09d2 From 6f92872cc8085b9e65a8ec07aed106ce5d24f60b Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 29 Apr 2005 16:06:14 +0100 Subject: [PATCH] USB: VID/PID updates for ftdi_sio driver Some VID/PID updates for the ftdi_sio driver: * The "Gude Analog- und Digitalsysteme GmbH" entries were missing from the "combined" table. * Replaced FTDI_8U232AM_ALT_ALT_PID with 3 PIDs for devices from 4n-galaxy.de. * Removed redundant FTDI_RM_VID and renamed FTDI_RMCANVIEW_PID to FTDI_RM_CANVIEW_PID. * Added VID/PID for serial converter in Mobility Electronics EasiDock USB 200 (mentioned by Gregory Schmitt). * Added PID for Active Robots USB comms board (mentioned by John Koch). Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman diff -ur a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c --- drivers/usb/serial/ftdi_sio.c | 38 ++++++++++++++++++++++++++++++++------ drivers/usb/serial/ftdi_sio.h | 30 +++++++++++++++++++++++++----- 2 files changed, 57 insertions(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 4c788c767a9..b31e09b099e 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -272,6 +272,7 @@ static int debug; static struct usb_device_id id_table_sio [] = { { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, + { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, { } /* Terminating entry */ }; @@ -296,7 +297,6 @@ static struct usb_device_id id_table_8U232AM [] = { { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0, 0x3ff) }, - { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0, 0x3ff) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, @@ -369,11 +369,14 @@ static struct usb_device_id id_table_8U232AM [] = { { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0, 0x3ff) }, - { USB_DEVICE_VER(FTDI_RM_VID, FTDI_RMCANVIEW_PID, 0, 0x3ff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0, 0x3ff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0, 0x3ff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0, 0x3ff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0, 0x3ff) }, { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0, 0x3ff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0, 0x3ff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0, 0x3ff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0, 0x3ff) }, { } /* Terminating entry */ }; @@ -382,7 +385,6 @@ static struct usb_device_id id_table_FT232BM [] = { { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0x400, 0xffff) }, - { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_XF_632_PID, 0x400, 0xffff) }, @@ -485,11 +487,15 @@ static struct usb_device_id id_table_FT232BM [] = { { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0x400, 0xffff) }, - { USB_DEVICE_VER(FTDI_RM_VID, FTDI_RMCANVIEW_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) }, { } /* Terminating entry */ }; @@ -517,7 +523,6 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, - { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, @@ -596,6 +601,22 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E808_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E809_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80A_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80B_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80C_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80D_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80E_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80F_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E888_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E889_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88A_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88B_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88C_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88D_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) }, { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) }, @@ -609,11 +630,16 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, - { USB_DEVICE(FTDI_RM_VID, FTDI_RMCANVIEW_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, + { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, + { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) }, { } /* Terminating entry */ }; diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index be5d60bf90b..3734b5e339a 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -26,7 +26,6 @@ #define FTDI_SIO_PID 0x8372 /* Product Id SIO application of 8U100AX */ #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ -#define FTDI_8U232AM_ALT_ALT_PID 0xf3c0 /* FTDI's second alternate PID for above */ #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ #define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ #define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ @@ -157,7 +156,8 @@ */ #define OCT_VID 0x0B39 /* OCT vendor ID */ /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */ -/* Also rebadged as SIIG Inc. model US2308 */ +/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */ +/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */ #define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */ /* an infrared receiver for user access control with IR tags */ @@ -236,10 +236,10 @@ /* * RM Michaelides CANview USB (http://www.rmcan.com) - * CAN filedbus interface adapter, addad by port GmbH www.port.de) + * CAN fieldbus interface adapter, added by port GmbH www.port.de) + * Ian Abbott changed the macro names for consistency. */ -#define FTDI_RM_VID 0x0403 /* Vendor Id */ -#define FTDI_RMCANVIEW_PID 0xfd60 /* Product Id */ +#define FTDI_RM_CANVIEW_PID 0xfd60 /* Product Id */ /* * EVER Eco Pro UPS (http://www.ever.com.pl/) @@ -247,6 +247,26 @@ #define EVER_ECO_PRO_CDS 0xe520 /* RS-232 converter */ +/* + * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485, + * USB-TTY activ, USB-TTY passiv. Some PIDs are used by several devices + * and I'm not entirely sure which are used by which. + */ +#define FTDI_4N_GALAXY_DE_0_PID 0x8372 +#define FTDI_4N_GALAXY_DE_1_PID 0xF3C0 +#define FTDI_4N_GALAXY_DE_2_PID 0xF3C1 + +/* + * Mobility Electronics products. + */ +#define MOBILITY_VID 0x1342 +#define MOBILITY_USB_SERIAL_PID 0x0202 /* EasiDock USB 200 serial */ + +/* + * Active Robots product ids. + */ +#define FTDI_ACTIVE_ROBOTS_PID 0xE548 /* USB comms board */ + /* Commands */ #define FTDI_SIO_RESET 0 /* Reset the port */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ -- cgit v1.2.3-70-g09d2 From 5e54f91d8d770c5a48da10a5c9c314c1c926536b Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 29 Apr 2005 16:09:44 +0100 Subject: [PATCH] USB: ftdi_sio redundant macro removal [ftdi_sio] Replaced redundant INTERFACE_A and INTERFACE_B macros with the equivalent PIT_SIOA and PIT_SIOB macros. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 4 ++-- drivers/usb/serial/ftdi_sio.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index b31e09b099e..0c4b4353326 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1483,10 +1483,10 @@ static int ftdi_FT2232C_startup (struct usb_serial *serial) inter = serial->interface->altsetting->desc.bInterfaceNumber; if (inter) { - priv->interface = INTERFACE_B; + priv->interface = PIT_SIOB; } else { - priv->interface = INTERFACE_A; + priv->interface = PIT_SIOA; } priv->baud_base = 48000000 / 2; /* Would be / 16, but FT2232C supports multiple of 0.125 divisor fractions! */ diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 3734b5e339a..96be3644114 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -279,10 +279,6 @@ #define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */ #define FTDI_SIO_GET_LATENCY_TIMER 10 /* Get the latency timer */ -/* Port interface code for FT2232C */ -#define INTERFACE_A 1 -#define INTERFACE_B 2 - /* * BmRequestType: 1100 0000b -- cgit v1.2.3-70-g09d2 From 8af60be9a71d2c636cd800deab63a9fadf3aee96 Mon Sep 17 00:00:00 2001 From: Vivian Bregier Date: Tue, 3 May 2005 02:16:34 +0200 Subject: [PATCH] USB: unusual_devs.h: atmel snd1 storage Signed-off-by: Phil Dibowitz Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index bbda63c24c4..cb01214251a 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -48,6 +48,14 @@ * USB development list . */ +/* patch submitted by Vivian Bregier + */ +UNUSUAL_DEV( 0x03eb, 0x2002, 0x0100, 0x0100, + "ATMEL", + "SND1 Storage", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE), + UNUSUAL_DEV( 0x03ee, 0x6901, 0x0000, 0x0100, "Mitsumi", "USB FDD", -- cgit v1.2.3-70-g09d2 From 7b1cbebaa7ced7a2029cc5b50eab60c79b24cc10 Mon Sep 17 00:00:00 2001 From: Phil Dibowitz Date: Mon, 2 May 2005 23:54:28 -0700 Subject: [PATCH] USB: unusual_devs entry for Minolta Dimage Z10 This patch adds an unusual_devs entry for the Minolta Dimage Z10. Originally reported by Vilisas Signed-off-by: Phil Dibowitz Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index cb01214251a..99e8249ca13 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -1002,6 +1002,13 @@ UNUSUAL_DEV( 0x1019, 0x0c55, 0x0000, 0x9999, US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init, 0 ), +/* Reported by Vilius Bilinkevicius */ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110, "SWISSBIT", -- cgit v1.2.3-70-g09d2 From 093cf723b2b06d774929ea07982f6a466ff22314 Mon Sep 17 00:00:00 2001 From: Steven Cole Date: Tue, 3 May 2005 19:07:24 -0600 Subject: [PATCH] USB: Spelling fixes for drivers/usb. Here are some spelling corrections for drivers/usb. cancelation -> cancellation succesful -> successful cancelation -> cancellation decriptor -> descriptor Initalize -> Initialize wierd -> weird Protocoll -> Protocol occured -> occurred successfull -> successful Procesing -> Processing devide -> divide Isochronuous -> Isochronous noticable -> noticeable Basicly -> Basically transfering -> transferring intialize -> initialize Incomming -> Incoming additionnal -> additional asume -> assume Unfortunatly -> Unfortunately retreive -> retrieve tranceiver -> transceiver Compatiblity -> Compatibility Incorprated -> Incorporated existance -> existence Ununsual -> Unusual Signed-off-by: Steven Cole Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/message.c | 4 ++-- drivers/usb/core/urb.c | 6 +++--- drivers/usb/gadget/ether.c | 2 +- drivers/usb/gadget/inode.c | 2 +- drivers/usb/gadget/lh7a40x_udc.c | 2 +- drivers/usb/gadget/serial.c | 2 +- drivers/usb/host/hc_crisv10.c | 2 +- drivers/usb/host/sl811-hcd.c | 4 ++-- drivers/usb/image/mdc800.c | 2 +- drivers/usb/input/aiptek.c | 2 +- drivers/usb/input/mtouchusb.c | 2 +- drivers/usb/media/ov511.c | 2 +- drivers/usb/media/pwc/pwc-ctrl.c | 2 +- drivers/usb/media/pwc/pwc-if.c | 6 +++--- drivers/usb/media/pwc/pwc-ioctl.h | 2 +- drivers/usb/misc/legousbtower.c | 2 +- drivers/usb/net/zd1201.c | 8 ++++---- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/ftdi_sio.c | 4 ++-- drivers/usb/serial/ftdi_sio.h | 2 +- drivers/usb/serial/io_usbvend.h | 2 +- drivers/usb/serial/keyspan_usa90msg.h | 2 +- drivers/usb/storage/shuttle_usbat.c | 2 +- drivers/usb/storage/unusual_devs.h | 2 +- 24 files changed, 34 insertions(+), 34 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index e12c5be1e0a..f50aaf25c98 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -431,7 +431,7 @@ nomem: * (2) error, where io->status is a negative errno value. The number * of io->bytes transferred before the error is usually less * than requested, and can be nonzero. - * (3) cancelation, a type of error with status -ECONNRESET that + * (3) cancellation, a type of error with status -ECONNRESET that * is initiated by usb_sg_cancel(). * * When this function returns, all memory allocated through usb_sg_init() or @@ -1282,7 +1282,7 @@ static void release_interface(struct device *dev) * bus rwsem; usb device driver probe() methods cannot use this routine. * * Returns zero on success, or else the status code returned by the - * underlying call that failed. On succesful completion, each interface + * underlying call that failed. On successful completion, each interface * in the original device configuration has been destroyed, and each one * in the new configuration has been probed by all relevant usb device * drivers currently known to the kernel. diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 16972159a57..0faf18d511d 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -121,7 +121,7 @@ struct urb * usb_get_urb(struct urb *urb) * describing that request to the USB subsystem. Request completion will * be indicated later, asynchronously, by calling the completion handler. * The three types of completion are success, error, and unlink - * (a software-induced fault, also called "request cancelation"). + * (a software-induced fault, also called "request cancellation"). * * URBs may be submitted in interrupt context. * @@ -170,7 +170,7 @@ struct urb * usb_get_urb(struct urb *urb) * As of Linux 2.6, all USB endpoint transfer queues support depths greater * than one. This was previously a HCD-specific behavior, except for ISO * transfers. Non-isochronous endpoint queues are inactive during cleanup - * after faults (transfer errors or cancelation). + * after faults (transfer errors or cancellation). * * Reserved Bandwidth Transfers: * @@ -395,7 +395,7 @@ int usb_submit_urb(struct urb *urb, int mem_flags) * * This routine cancels an in-progress request. URBs complete only * once per submission, and may be canceled only once per submission. - * Successful cancelation means the requests's completion handler will + * Successful cancellation means the requests's completion handler will * be called with a status code indicating that the request has been * canceled (rather than any other code) and will quickly be removed * from host controller data structures. diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 3993156c2e8..3f783cbdc7c 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -569,7 +569,7 @@ static const struct usb_cdc_ether_desc ether_desc = { /* include the status endpoint if we can, even where it's optional. * use wMaxPacketSize big enough to fit CDC_NOTIFY_SPEED_CHANGE in one - * packet, to simplify cancelation; and a big transfer interval, to + * packet, to simplify cancellation; and a big transfer interval, to * waste less bandwidth. * * some drivers (like Linux 2.4 cdc-ether!) "need" it to exist even diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index 2cff67ccce4..1e5e6ddef78 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c @@ -275,7 +275,7 @@ static const char *CHIP; * * After opening, configure non-control endpoints. Then use normal * stream read() and write() requests; and maybe ioctl() to get more - * precise FIFO status when recovering from cancelation. + * precise FIFO status when recovering from cancellation. */ static void epio_complete (struct usb_ep *ep, struct usb_request *req) diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index 0def9f70e88..df75ab65a5e 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c @@ -705,7 +705,7 @@ void nuke(struct lh7a40x_ep *ep, int status) done(ep, req, status); } - /* Disable IRQ if EP is enabled (has decriptor) */ + /* Disable IRQ if EP is enabled (has descriptor) */ if (ep->desc) pio_irq_disable(ep_index(ep)); } diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index f1762ed6db6..4d591c764e3 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -240,7 +240,7 @@ struct gs_dev { struct usb_ep *dev_notify_ep; /* address of notify endpoint */ struct usb_ep *dev_in_ep; /* address of in endpoint */ struct usb_ep *dev_out_ep; /* address of out endpoint */ - struct usb_endpoint_descriptor /* desciptor of notify ep */ + struct usb_endpoint_descriptor /* descriptor of notify ep */ *dev_notify_ep_desc; struct usb_endpoint_descriptor /* descriptor of in endpoint */ *dev_in_ep_desc; diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 376f8a034f6..d9883d774d3 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c @@ -4329,7 +4329,7 @@ static int __init etrax_usb_hc_init(void) bus->bus_name="ETRAX 100LX"; bus->hcpriv = hc; - /* Initalize RH to the default address. + /* Initialize RH to the default address. And make sure that we have no status change indication */ hc->rh.numports = 2; /* The RH has two ports */ hc->rh.devnum = 1; diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index d309e292198..a374b769207 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -134,7 +134,7 @@ static void port_power(struct sl811 *sl811, int is_on) /* This is a PIO-only HCD. Queueing appends URBs to the endpoint's queue, * and may start I/O. Endpoint queues are scanned during completion irq - * handlers (one per packet: ACK, NAK, faults, etc) and urb cancelation. + * handlers (one per packet: ACK, NAK, faults, etc) and urb cancellation. * * Using an external DMA engine to copy a packet at a time could work, * though setup/teardown costs may be too big to make it worthwhile. @@ -738,7 +738,7 @@ retry: } #endif - /* port status seems wierd until after reset, so + /* port status seems weird until after reset, so * force the reset and make khubd clean up later. */ sl811->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION) diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index 5791723e608..a330a4b50e1 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -23,7 +23,7 @@ * * * The driver brings the USB functions of the MDC800 to Linux. - * To use the Camera you must support the USB Protocoll of the camera + * To use the Camera you must support the USB Protocol of the camera * to the Kernel Node. * The Driver uses a misc device Node. Create it with : * mknod /dev/mustek c 180 32 diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index 2d76be62f4e..94ce2a9ad50 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c @@ -386,7 +386,7 @@ static int aiptek_convert_from_2s_complement(unsigned char c) * convention above.) I therefore have taken over REL_MISC and ABS_MISC * (for relative and absolute reports, respectively) for communicating * Proximity. Why two events? I thought it interesting to know if the - * Proximity event occured while the tablet was in absolute or relative + * Proximity event occurred while the tablet was in absolute or relative * mode. * * Other tablets use the notion of a certain minimum stylus pressure diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 6b45a66d58c..ab1a2a30ce7 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -32,7 +32,7 @@ * Changed reset from standard USB dev reset to vendor reset * Changed data sent to host from compensated to raw coordinates * Eliminated vendor/product module params - * Performed multiple successfull tests with an EXII-5010UC + * Performed multiple successful tests with an EXII-5010UC * * 1.5 02/27/2005 ddstreet@ieee.org * Added module parameter to select raw or hw-calibrated coordinate reporting diff --git a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c index d6051822416..036c485d1d1 100644 --- a/drivers/usb/media/ov511.c +++ b/drivers/usb/media/ov511.c @@ -5041,7 +5041,7 @@ ov6xx0_configure(struct usb_ov511 *ov) { OV511_I2C_BUS, 0x2a, 0x04 }, /* Disable framerate adjust */ // { OV511_I2C_BUS, 0x2b, 0xac }, /* Framerate; Set 2a[7] first */ { OV511_I2C_BUS, 0x2d, 0x99 }, - { OV511_I2C_BUS, 0x33, 0xa0 }, /* Color Procesing Parameter */ + { OV511_I2C_BUS, 0x33, 0xa0 }, /* Color Processing Parameter */ { OV511_I2C_BUS, 0x34, 0xd2 }, /* Max A/D range */ { OV511_I2C_BUS, 0x38, 0x8b }, { OV511_I2C_BUS, 0x39, 0x40 }, diff --git a/drivers/usb/media/pwc/pwc-ctrl.c b/drivers/usb/media/pwc/pwc-ctrl.c index 42352f531bc..42ec468d52d 100644 --- a/drivers/usb/media/pwc/pwc-ctrl.c +++ b/drivers/usb/media/pwc/pwc-ctrl.c @@ -1100,7 +1100,7 @@ static inline int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt) unsigned char buf[4]; /* set new relative angle; angles are expressed in degrees * 100, - but cam as .5 degree resolution, hence devide by 200. Also + but cam as .5 degree resolution, hence divide by 200. Also the angle must be multiplied by 64 before it's send to the cam (??) */ diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c index c53e2263b7f..cca47f480a8 100644 --- a/drivers/usb/media/pwc/pwc-if.c +++ b/drivers/usb/media/pwc/pwc-if.c @@ -272,7 +272,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev) return -ENXIO; } #endif - /* Allocate Isochronuous pipe buffers */ + /* Allocate Isochronous pipe buffers */ for (i = 0; i < MAX_ISO_BUFS; i++) { if (pdev->sbuf[i].data == NULL) { kbuf = kmalloc(ISO_BUFFER_SIZE, GFP_KERNEL); @@ -850,7 +850,7 @@ static int pwc_isoc_init(struct pwc_device *pdev) if (pdev->vmax_packet_size < 0 || pdev->vmax_packet_size > ISO_MAX_FRAME_SIZE) { Err("Failed to find packet size for video endpoint in current alternate setting.\n"); - return -ENFILE; /* Odd error, that should be noticable */ + return -ENFILE; /* Odd error, that should be noticeable */ } /* Set alternate interface */ @@ -2128,7 +2128,7 @@ static int __init usb_pwc_init(void) if (leds[1] >= 0) led_off = leds[1]; - /* Big device node whoopla. Basicly, it allows you to assign a + /* Big device node whoopla. Basically, it allows you to assign a device node (/dev/videoX) to a camera, based on its type & serial number. The format is [type[.serialnumber]:]node. diff --git a/drivers/usb/media/pwc/pwc-ioctl.h b/drivers/usb/media/pwc/pwc-ioctl.h index 65805eaa9a1..5f9cb08bc02 100644 --- a/drivers/usb/media/pwc/pwc-ioctl.h +++ b/drivers/usb/media/pwc/pwc-ioctl.h @@ -75,7 +75,7 @@ #define PWC_FPS_SNAPSHOT 0x00400000 -/* structure for transfering x & y coordinates */ +/* structure for transferring x & y coordinates */ struct pwc_coord { int x, y; /* guess what */ diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index dd4580cb57e..7d06105763d 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -859,7 +859,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device info ("udev is NULL."); } - /* allocate memory for our device state and intialize it */ + /* allocate memory for our device state and initialize it */ dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index f98cb2af024..341ae5f732d 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c @@ -183,7 +183,7 @@ static void zd1201_usbtx(struct urb *urb, struct pt_regs *regs) return; } -/* Incomming data */ +/* Incoming data */ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) { struct zd1201 *zd = urb->context; @@ -772,7 +772,7 @@ static int zd1201_net_stop(struct net_device *dev) /* RFC 1042 encapsulates Ethernet frames in 802.11 frames by prefixing them with 0xaa, 0xaa, 0x03) followed by a SNAP OID of 0 - (0x00, 0x00, 0x00). Zd requires an additionnal padding, copy + (0x00, 0x00, 0x00). Zd requires an additional padding, copy of ethernet addresses, length of the standard RFC 1042 packet and a command byte (which is nul for tx). @@ -1098,7 +1098,7 @@ static int zd1201_get_range(struct net_device *dev, /* Little bit of magic here: we only get the quality if we poll * for it, and we never get an actual request to trigger such - * a poll. Therefore we 'asume' that the user will soon ask for + * a poll. Therefore we 'assume' that the user will soon ask for * the stats after asking the bssid. */ static int zd1201_get_wap(struct net_device *dev, @@ -1108,7 +1108,7 @@ static int zd1201_get_wap(struct net_device *dev, unsigned char buffer[6]; if (!zd1201_getconfig(zd, ZD1201_RID_COMMSQUALITY, buffer, 6)) { - /* Unfortunatly the quality and noise reported is useless. + /* Unfortunately the quality and noise reported is useless. they seem to be accumulators that increase until you read them, unless we poll on a fixed interval we can't use them diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index d165f42d560..9db23decc5b 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -234,7 +234,7 @@ static struct usb_serial_device_type cypress_hidcom_device = { *****************************************************************************/ -/* This function can either set or retreive the current serial line settings */ +/* This function can either set or retrieve the current serial line settings */ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_mask, int data_bits, int stop_bits, int parity_enable, int parity_type, int reset, int cypress_request_type) { diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 0c4b4353326..52394f08a94 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -76,7 +76,7 @@ * Defererence pointers after any paranoid checks, not before. * * (21/Jun/2003) Erik Nygren - * Added support for Home Electronics Tira-1 IR tranceiver using FT232BM chip. + * Added support for Home Electronics Tira-1 IR transceiver using FT232BM chip. * See . Only operates properly * at 100000 and RTS-CTS, so set custom divisor mode on startup. * Also force the Tira-1 and USB-UIRT to only use their custom baud rates. @@ -91,7 +91,7 @@ * Minor whitespace and comment changes. * * (12/Jun/2003) David Norwood - * Added support for USB-UIRT IR tranceiver using 8U232AM chip. + * Added support for USB-UIRT IR transceiver using 8U232AM chip. * See . Only * operates properly at 312500, so set custom divisor mode on startup. * diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 96be3644114..a52bb13a9ce 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -136,7 +136,7 @@ /* * Home Electronics (www.home-electro.com) USB gadgets */ -#define FTDI_HE_TIRA1_PID 0xFA78 /* Tira-1 IR tranceiver */ +#define FTDI_HE_TIRA1_PID 0xFA78 /* Tira-1 IR transceiver */ /* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */ /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ diff --git a/drivers/usb/serial/io_usbvend.h b/drivers/usb/serial/io_usbvend.h index 8c1fa5e722b..f1804fd5a3d 100644 --- a/drivers/usb/serial/io_usbvend.h +++ b/drivers/usb/serial/io_usbvend.h @@ -289,7 +289,7 @@ // // -// Edgeport Compatiblity Descriptor +// Edgeport Compatibility Descriptor // // This descriptor is only returned by Edgeport-compatible devices // supporting the EPiC spec. True ION devices do not return this diff --git a/drivers/usb/serial/keyspan_usa90msg.h b/drivers/usb/serial/keyspan_usa90msg.h index dd935b62c1a..86708ecd873 100644 --- a/drivers/usb/serial/keyspan_usa90msg.h +++ b/drivers/usb/serial/keyspan_usa90msg.h @@ -19,7 +19,7 @@ This file is available under a BSD-style copyright - 2. The name of InnoSys Incorprated may not be used to endorse or promote + 2. The name of InnoSys Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c index 7eff03d9b04..f3b60288696 100644 --- a/drivers/usb/storage/shuttle_usbat.c +++ b/drivers/usb/storage/shuttle_usbat.c @@ -786,7 +786,7 @@ static int usbat_flash_check_media(struct us_data *us, if (rc != USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; - // Check for media existance + // Check for media existence rc = usbat_flash_check_media_present(uio); if (rc == USBAT_FLASH_MEDIA_NONE) { info->sense_key = 0x02; diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 99e8249ca13..d2891f47579 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -1,5 +1,5 @@ /* Driver for USB Mass Storage compliant devices - * Ununsual Devices File + * Unusual Devices File * * $Id: unusual_devs.h,v 1.32 2002/02/25 02:41:24 mdharm Exp $ * -- cgit v1.2.3-70-g09d2 From 3cb4a4f739cccdf0642fa7e3a087e0b8425ff67b Mon Sep 17 00:00:00 2001 From: Lonnie Mendez Date: Tue, 3 May 2005 17:02:20 -0500 Subject: [PATCH] USB cypress_m8: update kernel driver with current source Fixed problem where setting or retreiving the serial config would fail with EPIPE. Removed CRTS toggling so the driver behaves more like other usbserial adapters. Issued new interval of 1ms instead of the default bInterval. As a result, transfer speed has been substantially increased. From avg. 850bps to avg. 3300bps. Also added new module parameter 'interval' to tweak the interval in case this change causes problems for someone. Cleaned up code and formatting issues so source is more readable. Replaced the C++ style comments. Various other code cleanups. Signed-off-by: Lonnie Mendez Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/cypress_m8.c | 185 +++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 97 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 9db23decc5b..f34a9bb6a21 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -16,6 +16,14 @@ * See http://geocities.com/i0xox0i for information on this driver and the * earthmate usb device. * + * Lonnie Mendez + * 4-29-2005 + * Fixed problem where setting or retreiving the serial config would fail with + * EPIPE. Removed CRTS toggling so the driver behaves more like other usbserial + * adapters. Issued new interval of 1ms instead of the default 10ms. As a + * result, transfer speed has been substantially increased. From avg. 850bps to + * avg. 3300bps. initial termios has also been modified. Cleaned up code and + * formatting issues so it is more readable. Replaced the C++ style comments. * * Lonnie Mendez * 12-15-2004 @@ -32,12 +40,6 @@ * 10-2003 * Driver first released. * - * - * Long Term TODO: - * Improve transfer speeds - both read/write are somewhat slow - * at this point. - * Improve debugging. Show modem line status with debug output and - * implement filtering for certain data as a module parameter. */ /* Thanks to Neil Whelchel for writing the first cypress m8 implementation for linux. */ @@ -72,11 +74,12 @@ static int debug; #endif static int stats; +static int interval; /* * Version Information */ -#define DRIVER_VERSION "v1.08" +#define DRIVER_VERSION "v1.09" #define DRIVER_AUTHOR "Lonnie Mendez , Neil Whelchel " #define DRIVER_DESC "Cypress USB to Serial Driver" @@ -130,7 +133,6 @@ struct cypress_private { char prev_status, diff_status; /* used for TIOCMIWAIT */ /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */ struct termios tmp_termios; /* stores the old termios settings */ - char calledfromopen; /* used when issuing lines on open - fixes rts drop bug */ }; /* write buffer structure */ @@ -168,10 +170,8 @@ static void cypress_buf_free(struct cypress_buf *cb); static void cypress_buf_clear(struct cypress_buf *cb); static unsigned int cypress_buf_data_avail(struct cypress_buf *cb); static unsigned int cypress_buf_space_avail(struct cypress_buf *cb); -static unsigned int cypress_buf_put(struct cypress_buf *cb, const char *buf, - unsigned int count); -static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, - unsigned int count); +static unsigned int cypress_buf_put(struct cypress_buf *cb, const char *buf, unsigned int count); +static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigned int count); static struct usb_serial_device_type cypress_earthmate_device = { @@ -238,10 +238,9 @@ static struct usb_serial_device_type cypress_hidcom_device = { static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_mask, int data_bits, int stop_bits, int parity_enable, int parity_type, int reset, int cypress_request_type) { - int i, n_baud_rate = 0, retval = 0; + int new_baudrate = 0, retval = 0, tries = 0; struct cypress_private *priv; - __u8 feature_buffer[5]; - __u8 config; + __u8 feature_buffer[8]; unsigned long flags; dbg("%s", __FUNCTION__); @@ -256,7 +255,8 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m * of 57600bps (I have no idea whether DeLorme chose to use the general purpose * firmware or not), if you need to modify this speed setting for your own * project please add your own chiptype and modify the code likewise. The - * Cypress HID->COM device will work successfully up to 115200bps. + * Cypress HID->COM device will work successfully up to 115200bps (but the + * actual throughput is around 3kBps). */ if (baud_mask != priv->cbr_mask) { dbg("%s - baud rate is changing", __FUNCTION__); @@ -265,109 +265,114 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m * but are not used with NMEA and SiRF protocols */ if ( (baud_mask == B300) || (baud_mask == B600) ) { - err("%s - failed setting baud rate, unsupported speed (default to 4800)", + err("%s - failed setting baud rate, unsupported speed", __FUNCTION__); - n_baud_rate = 4800; - } else if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) { - err("%s - failed setting baud rate, unsupported speed (default to 4800)", + new_baudrate = priv->baud_rate; + } else if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { + err("%s - failed setting baud rate, unsupported speed", __FUNCTION__); - n_baud_rate = 4800; + new_baudrate = priv->baud_rate; } } else if (priv->chiptype == CT_CYPHIDCOM) { - if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) { - err("%s - failed setting baud rate, unsupported speed (default to 4800)", + if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { + err("%s - failed setting baud rate, unsupported speed", __FUNCTION__); - n_baud_rate = 4800; + new_baudrate = priv->baud_rate; } } else if (priv->chiptype == CT_GENERIC) { - if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) { - err("%s - failed setting baud rate, unsupported speed (default to 4800)", + if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { + err("%s - failed setting baud rate, unsupported speed", __FUNCTION__); - n_baud_rate = 4800; + new_baudrate = priv->baud_rate; } } else { - info("%s - please define your chiptype, using 4800bps default", __FUNCTION__); - n_baud_rate = 4800; + info("%s - please define your chiptype", __FUNCTION__); + new_baudrate = priv->baud_rate; } } else { /* baud rate not changing, keep the old */ - n_baud_rate = priv->baud_rate; + new_baudrate = priv->baud_rate; } - dbg("%s - baud rate is being sent as %d", __FUNCTION__, n_baud_rate); - + dbg("%s - baud rate is being sent as %d", __FUNCTION__, new_baudrate); - /* - * This algorithm accredited to Jiang Jay Zhang... thanks for all the help! - */ - for (i = 0; i < 4; ++i) { - feature_buffer[i] = ( n_baud_rate >> (i*8) & 0xFF ); - } + memset(feature_buffer, 0, 8); + /* fill the feature_buffer with new configuration */ + *((u_int32_t *)feature_buffer) = new_baudrate; - config = 0; // reset config byte - config |= data_bits; // assign data bits in 2 bit space ( max 3 ) + feature_buffer[4] |= data_bits; /* assign data bits in 2 bit space ( max 3 ) */ /* 1 bit gap */ - config |= (stop_bits << 3); // assign stop bits in 1 bit space - config |= (parity_enable << 4); // assign parity flag in 1 bit space - config |= (parity_type << 5); // assign parity type in 1 bit space + feature_buffer[4] |= (stop_bits << 3); /* assign stop bits in 1 bit space */ + feature_buffer[4] |= (parity_enable << 4); /* assign parity flag in 1 bit space */ + feature_buffer[4] |= (parity_type << 5); /* assign parity type in 1 bit space */ /* 1 bit gap */ - config |= (reset << 7); // assign reset at end of byte, 1 bit space - - feature_buffer[4] = config; + feature_buffer[4] |= (reset << 7); /* assign reset at end of byte, 1 bit space */ dbg("%s - device is being sent this feature report:", __FUNCTION__); dbg("%s - %02X - %02X - %02X - %02X - %02X", __FUNCTION__, feature_buffer[0], feature_buffer[1], feature_buffer[2], feature_buffer[3], feature_buffer[4]); + do { retval = usb_control_msg (port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0), HID_REQ_SET_REPORT, USB_DIR_OUT | USB_RECIP_INTERFACE | USB_TYPE_CLASS, - 0x0300, 0, feature_buffer, 5, 500); + 0x0300, 0, feature_buffer, 8, 500); + + if (tries++ >= 3) + break; - if (retval != 5) + if (retval == EPIPE) + usb_clear_halt(port->serial->dev, 0x00); + } while (retval != 8 && retval != ENODEV); + + if (retval != 8) err("%s - failed sending serial line settings - %d", __FUNCTION__, retval); else { spin_lock_irqsave(&priv->lock, flags); - priv->baud_rate = n_baud_rate; + priv->baud_rate = new_baudrate; priv->cbr_mask = baud_mask; - priv->current_config = config; - ++priv->cmd_count; + priv->current_config = feature_buffer[4]; spin_unlock_irqrestore(&priv->lock, flags); } break; case CYPRESS_GET_CONFIG: dbg("%s - retreiving serial line settings", __FUNCTION__); - /* reset values in feature buffer */ - memset(feature_buffer, 0, 5); + /* set initial values in feature buffer */ + memset(feature_buffer, 0, 8); + do { retval = usb_control_msg (port->serial->dev, usb_rcvctrlpipe(port->serial->dev, 0), HID_REQ_GET_REPORT, USB_DIR_IN | USB_RECIP_INTERFACE | USB_TYPE_CLASS, - 0x0300, 0, feature_buffer, 5, 500); + 0x0300, 0, feature_buffer, 8, 500); + + if (tries++ >= 3) + break; + + if (retval == EPIPE) + usb_clear_halt(port->serial->dev, 0x00); + } while (retval != 5 && retval != ENODEV); + if (retval != 5) { err("%s - failed to retreive serial line settings - %d", __FUNCTION__, retval); return retval; } else { spin_lock_irqsave(&priv->lock, flags); + /* store the config in one byte, and later use bit masks to check values */ priv->current_config = feature_buffer[4]; - /* reverse the process above to get the baud_mask value */ - n_baud_rate = 0; // reset bits - for (i = 0; i < 4; ++i) { - n_baud_rate |= ( feature_buffer[i] << (i*8) ); - } + priv->baud_rate = *((u_int32_t *)feature_buffer); - priv->baud_rate = n_baud_rate; - if ( (priv->cbr_mask = rate_to_mask(n_baud_rate)) == 0x40) + if ( (priv->cbr_mask = rate_to_mask(priv->baud_rate)) == 0x40) dbg("%s - failed setting the baud mask (not defined)", __FUNCTION__); - ++priv->cmd_count; spin_unlock_irqrestore(&priv->lock, flags); } - break; - default: - err("%s - unsupported serial control command issued", __FUNCTION__); } + spin_lock_irqsave(&priv->lock, flags); + ++priv->cmd_count; + spin_unlock_irqrestore(&priv->lock, flags); + return retval; } /* cypress_serial_control */ -/* given a baud mask, it will return speed on success */ +/* given a baud mask, it will return integer baud on success */ static int mask_to_rate (unsigned mask) { int rate; @@ -438,11 +443,12 @@ static int generic_startup (struct usb_serial *serial) usb_reset_configuration (serial->dev); + interval = 1; priv->cmd_ctrl = 0; priv->line_control = 0; priv->termios_initialized = 0; - priv->calledfromopen = 0; priv->rx_flags = 0; + priv->cbr_mask = B300; usb_set_serial_port_data(serial->port[0], priv); return (0); @@ -513,7 +519,6 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp) dbg("%s - port %d", __FUNCTION__, port->number); /* clear halts before open */ - usb_clear_halt(serial->dev, 0x00); usb_clear_halt(serial->dev, 0x81); usb_clear_halt(serial->dev, 0x02); @@ -531,7 +536,6 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp) /* raise both lines and set termios */ spin_lock_irqsave(&priv->lock, flags); priv->line_control = CONTROL_DTR | CONTROL_RTS; - priv->calledfromopen = 1; priv->cmd_ctrl = 1; spin_unlock_irqrestore(&priv->lock, flags); result = cypress_write(port, NULL, 0); @@ -553,7 +557,7 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp) usb_fill_int_urb(port->interrupt_in_urb, serial->dev, usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress), port->interrupt_in_urb->transfer_buffer, port->interrupt_in_urb->transfer_buffer_length, - cypress_read_int_callback, port, port->interrupt_in_urb->interval); + cypress_read_int_callback, port, interval); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (result){ @@ -680,12 +684,12 @@ static void cypress_send(struct usb_serial_port *port) spin_lock_irqsave(&priv->lock, flags); switch (port->interrupt_out_size) { case 32: - // this is for the CY7C64013... + /* this is for the CY7C64013... */ offset = 2; port->interrupt_out_buffer[0] = priv->line_control; break; case 8: - // this is for the CY7C63743... + /* this is for the CY7C63743... */ offset = 1; port->interrupt_out_buffer[0] = priv->line_control; break; @@ -738,6 +742,7 @@ send: port->interrupt_out_urb->transfer_buffer_length = actual_size; port->interrupt_out_urb->dev = port->serial->dev; + port->interrupt_out_urb->interval = interval; result = usb_submit_urb (port->interrupt_out_urb, GFP_ATOMIC); if (result) { dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, @@ -910,7 +915,7 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o unsigned cflag, iflag, baud_mask; unsigned long flags; __u8 oldlines; - int linechange; + int linechange = 0; dbg("%s - port %d", __FUNCTION__, port->number); @@ -996,15 +1001,7 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o case B115200: dbg("%s - setting baud 115200bps", __FUNCTION__); break; default: dbg("%s - unknown masked baud rate", __FUNCTION__); } - priv->line_control |= CONTROL_DTR; - - /* toggle CRTSCTS? - don't do this if being called from cypress_open */ - if (!priv->calledfromopen) { - if (cflag & CRTSCTS) - priv->line_control |= CONTROL_RTS; - else - priv->line_control &= ~CONTROL_RTS; - } + priv->line_control = (CONTROL_DTR | CONTROL_RTS); } spin_unlock_irqrestore(&priv->lock, flags); @@ -1014,8 +1011,6 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o cypress_serial_control(port, baud_mask, data_bits, stop_bits, parity_enable, parity_type, 0, CYPRESS_SET_CONFIG); - msleep(50); /* give some time between change and read (50ms) */ - /* we perform a CYPRESS_GET_CONFIG so that the current settings are filled into the private structure * this should confirm that all is working if it returns what we just set */ cypress_serial_control(port, 0, 0, 0, 0, 0, 0, CYPRESS_GET_CONFIG); @@ -1031,7 +1026,6 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o dbg("Using custom termios settings for a baud rate of 4800bps."); /* define custom termios settings for NMEA protocol */ - tty->termios->c_iflag /* input modes - */ &= ~(IGNBRK /* disable ignore break */ | BRKINT /* disable break causes interrupt */ @@ -1052,23 +1046,16 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o | ISIG /* disable interrupt, quit, and suspend special characters */ | IEXTEN); /* disable non-POSIX special characters */ - } else if (priv->chiptype == CT_CYPHIDCOM) { - - // Software app handling it for device... + } /* CT_CYPHIDCOM: Application should handle this for device */ - } linechange = (priv->line_control != oldlines); spin_unlock_irqrestore(&priv->lock, flags); /* if necessary, set lines */ - if (!priv->calledfromopen && linechange) { + if (linechange) { priv->cmd_ctrl = 1; cypress_write(port, NULL, 0); } - - if (priv->calledfromopen) - priv->calledfromopen = 0; - } /* cypress_set_termios */ @@ -1164,7 +1151,7 @@ static void cypress_read_int_callback(struct urb *urb, struct pt_regs *regs) spin_lock_irqsave(&priv->lock, flags); switch(urb->actual_length) { case 32: - // This is for the CY7C64013... + /* This is for the CY7C64013... */ priv->current_status = data[0] & 0xF8; bytes = data[1]+2; i=2; @@ -1172,7 +1159,7 @@ static void cypress_read_int_callback(struct urb *urb, struct pt_regs *regs) havedata = 1; break; case 8: - // This is for the CY7C63743... + /* This is for the CY7C63743... */ priv->current_status = data[0] & 0xF8; bytes = (data[0] & 0x07)+1; i=1; @@ -1245,7 +1232,7 @@ continue_read: port->interrupt_in_urb->transfer_buffer, port->interrupt_in_urb->transfer_buffer_length, cypress_read_int_callback, port, - port->interrupt_in_urb->interval); + interval); result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); if (result) dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); @@ -1274,6 +1261,8 @@ static void cypress_write_int_callback(struct urb *urb, struct pt_regs *regs) dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); priv->write_urb_in_use = 0; return; + case -EPIPE: /* no break needed */ + usb_clear_halt(port->serial->dev, 0x02); default: /* error in the urb, so we have to resubmit it */ dbg("%s - Overflow in write", __FUNCTION__); @@ -1535,3 +1524,5 @@ module_param(debug, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "Debug enabled or not"); module_param(stats, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(stats, "Enable statistics or not"); +module_param(interval, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(interval, "Overrides interrupt interval"); -- cgit v1.2.3-70-g09d2