aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-15 20:19:52 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-15 20:19:52 -0400
commit18594822fcb01d4b35e05b9018f770a0b4156d1a (patch)
tree38d35c38086a564beaac215f8e52694cdbfab1c3 /drivers/usb
parent5b5ffbc1e6d62d89747f3f59c09b2e488a7d7fce (diff)
parentc4694c76ce28dd7e415b4f3014d8c6e580b5f3d2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/atm/speedtch.c2
-rw-r--r--drivers/usb/atm/usbatm.c8
-rw-r--r--drivers/usb/core/hcd.c13
-rw-r--r--drivers/usb/core/hub.c23
-rw-r--r--drivers/usb/host/ohci-hcd.c2
-rw-r--r--drivers/usb/input/hid-core.c4
-rw-r--r--drivers/usb/misc/emi26.c4
-rw-r--r--drivers/usb/misc/emi62.c4
-rw-r--r--drivers/usb/net/pegasus.c20
-rw-r--r--drivers/usb/serial/Kconfig10
-rw-r--r--drivers/usb/serial/Makefile1
-rw-r--r--drivers/usb/serial/airprime.c1
-rw-r--r--drivers/usb/serial/ark3116.c465
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.h9
-rw-r--r--drivers/usb/serial/generic.c1
-rw-r--r--drivers/usb/serial/omninet.c12
-rw-r--r--drivers/usb/serial/usb-serial.c19
18 files changed, 559 insertions, 41 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 7860c8a5800d..956b7a1e8af9 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -69,7 +69,7 @@ static const char speedtch_driver_name[] = "speedtch";
69#define RESUBMIT_DELAY 1000 /* milliseconds */ 69#define RESUBMIT_DELAY 1000 /* milliseconds */
70 70
71#define DEFAULT_BULK_ALTSETTING 1 71#define DEFAULT_BULK_ALTSETTING 1
72#define DEFAULT_ISOC_ALTSETTING 2 72#define DEFAULT_ISOC_ALTSETTING 3
73#define DEFAULT_DL_512_FIRST 0 73#define DEFAULT_DL_512_FIRST 0
74#define DEFAULT_ENABLE_ISOC 0 74#define DEFAULT_ENABLE_ISOC 0
75#define DEFAULT_SW_BUFFERING 0 75#define DEFAULT_SW_BUFFERING 0
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index c1211fc037d9..546249843b8e 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -99,11 +99,11 @@ static const char usbatm_driver_name[] = "usbatm";
99 99
100#define UDSL_MAX_RCV_URBS 16 100#define UDSL_MAX_RCV_URBS 16
101#define UDSL_MAX_SND_URBS 16 101#define UDSL_MAX_SND_URBS 16
102#define UDSL_MAX_BUF_SIZE 64 * 1024 /* bytes */ 102#define UDSL_MAX_BUF_SIZE 65536
103#define UDSL_DEFAULT_RCV_URBS 4 103#define UDSL_DEFAULT_RCV_URBS 4
104#define UDSL_DEFAULT_SND_URBS 4 104#define UDSL_DEFAULT_SND_URBS 4
105#define UDSL_DEFAULT_RCV_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ 105#define UDSL_DEFAULT_RCV_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */
106#define UDSL_DEFAULT_SND_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ 106#define UDSL_DEFAULT_SND_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */
107 107
108#define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD) 108#define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD)
109 109
@@ -135,7 +135,7 @@ MODULE_PARM_DESC(rcv_buf_bytes,
135module_param(snd_buf_bytes, uint, S_IRUGO); 135module_param(snd_buf_bytes, uint, S_IRUGO);
136MODULE_PARM_DESC(snd_buf_bytes, 136MODULE_PARM_DESC(snd_buf_bytes,
137 "Size of the buffers used for transmission, in bytes (range: 1-" 137 "Size of the buffers used for transmission, in bytes (range: 1-"
138 __MODULE_STRING(UDSL_MAX_SND_BUF_SIZE) ", default: " 138 __MODULE_STRING(UDSL_MAX_BUF_SIZE) ", default: "
139 __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")"); 139 __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")");
140 140
141 141
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fbd938d4ea58..e2e00ba4e1e6 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1805,6 +1805,12 @@ int usb_add_hcd(struct usb_hcd *hcd,
1805 USB_SPEED_FULL; 1805 USB_SPEED_FULL;
1806 hcd->self.root_hub = rhdev; 1806 hcd->self.root_hub = rhdev;
1807 1807
1808 /* wakeup flag init defaults to "everything works" for root hubs,
1809 * but drivers can override it in reset() if needed, along with
1810 * recording the overall controller's system wakeup capability.
1811 */
1812 device_init_wakeup(&rhdev->dev, 1);
1813
1808 /* "reset" is misnamed; its role is now one-time init. the controller 1814 /* "reset" is misnamed; its role is now one-time init. the controller
1809 * should already have been reset (and boot firmware kicked off etc). 1815 * should already have been reset (and boot firmware kicked off etc).
1810 */ 1816 */
@@ -1813,13 +1819,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
1813 goto err_hcd_driver_setup; 1819 goto err_hcd_driver_setup;
1814 } 1820 }
1815 1821
1816 /* wakeup flag init is in transition; for now we can't rely on PCI to
1817 * initialize these bits properly, so we let reset() override it.
1818 * This init should _precede_ the reset() once PCI behaves.
1819 */
1820 device_init_wakeup(&rhdev->dev,
1821 device_can_wakeup(hcd->self.controller));
1822
1823 /* NOTE: root hub and controller capabilities may not be the same */ 1822 /* NOTE: root hub and controller capabilities may not be the same */
1824 if (device_can_wakeup(hcd->self.controller) 1823 if (device_can_wakeup(hcd->self.controller)
1825 && device_can_wakeup(&hcd->self.root_hub->dev)) 1824 && device_can_wakeup(&hcd->self.root_hub->dev))
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0c87f73f2933..90b8d43c6b33 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1168,19 +1168,9 @@ static inline const char *plural(int n)
1168static int choose_configuration(struct usb_device *udev) 1168static int choose_configuration(struct usb_device *udev)
1169{ 1169{
1170 int i; 1170 int i;
1171 u16 devstatus;
1172 int bus_powered;
1173 int num_configs; 1171 int num_configs;
1174 struct usb_host_config *c, *best; 1172 struct usb_host_config *c, *best;
1175 1173
1176 /* If this fails, assume the device is bus-powered */
1177 devstatus = 0;
1178 usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
1179 le16_to_cpus(&devstatus);
1180 bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0);
1181 dev_dbg(&udev->dev, "device is %s-powered\n",
1182 bus_powered ? "bus" : "self");
1183
1184 best = NULL; 1174 best = NULL;
1185 c = udev->config; 1175 c = udev->config;
1186 num_configs = udev->descriptor.bNumConfigurations; 1176 num_configs = udev->descriptor.bNumConfigurations;
@@ -1197,6 +1187,19 @@ static int choose_configuration(struct usb_device *udev)
1197 * similar errors in their descriptors. If the next test 1187 * similar errors in their descriptors. If the next test
1198 * were allowed to execute, such configurations would always 1188 * were allowed to execute, such configurations would always
1199 * be rejected and the devices would not work as expected. 1189 * be rejected and the devices would not work as expected.
1190 * In the meantime, we run the risk of selecting a config
1191 * that requires external power at a time when that power
1192 * isn't available. It seems to be the lesser of two evils.
1193 *
1194 * Bugzilla #6448 reports a device that appears to crash
1195 * when it receives a GET_DEVICE_STATUS request! We don't
1196 * have any other way to tell whether a device is self-powered,
1197 * but since we don't use that information anywhere but here,
1198 * the call has been removed.
1199 *
1200 * Maybe the GET_DEVICE_STATUS call and the test below can
1201 * be reinstated when device firmwares become more reliable.
1202 * Don't hold your breath.
1200 */ 1203 */
1201#if 0 1204#if 0
1202 /* Rule out self-powered configs for a bus-powered device */ 1205 /* Rule out self-powered configs for a bus-powered device */
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 544f7589912f..73f5a379d9b3 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -863,7 +863,7 @@ static int ohci_restart (struct ohci_hcd *ohci)
863 i = ohci->num_ports; 863 i = ohci->num_ports;
864 while (i--) 864 while (i--)
865 ohci_writel (ohci, RH_PS_PSS, 865 ohci_writel (ohci, RH_PS_PSS,
866 &ohci->regs->roothub.portstatus [temp]); 866 &ohci->regs->roothub.portstatus [i]);
867 ohci_dbg (ohci, "restart complete\n"); 867 ohci_dbg (ohci, "restart complete\n");
868 } 868 }
869 return 0; 869 return 0;
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index f419bd82ab7f..435273e7c85c 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1557,6 +1557,9 @@ void hid_init_reports(struct hid_device *hid)
1557#define USB_VENDOR_ID_HP 0x03f0 1557#define USB_VENDOR_ID_HP 0x03f0
1558#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c 1558#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c
1559 1559
1560#define USB_VENDOR_ID_IBM 0x04b3
1561#define USB_DEVICE_ID_IBM_USBHUB_KB 0x3005
1562
1560#define USB_VENDOR_ID_CREATIVELABS 0x062a 1563#define USB_VENDOR_ID_CREATIVELABS 0x062a
1561#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201 1564#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201
1562 1565
@@ -1681,6 +1684,7 @@ static const struct hid_blacklist {
1681 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, 1684 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET},
1682 { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET }, 1685 { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET },
1683 { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, 1686 { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET },
1687 { USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_USBHUB_KB, HID_QUIRK_NOGET },
1684 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, 1688 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
1685 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, 1689 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
1686 { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET }, 1690 { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET },
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 3824df33094e..1fd9cb85f4ca 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/usb.h> 17#include <linux/usb.h>
18#include <linux/delay.h>
18 19
19#define MAX_INTEL_HEX_RECORD_LENGTH 16 20#define MAX_INTEL_HEX_RECORD_LENGTH 16
20typedef struct _INTEL_HEX_RECORD 21typedef struct _INTEL_HEX_RECORD
@@ -114,6 +115,7 @@ static int emi26_load_firmware (struct usb_device *dev)
114 115
115 /* De-assert reset (let the CPU run) */ 116 /* De-assert reset (let the CPU run) */
116 err = emi26_set_reset(dev,0); 117 err = emi26_set_reset(dev,0);
118 msleep(250); /* let device settle */
117 119
118 /* 2. We upload the FPGA firmware into the EMI 120 /* 2. We upload the FPGA firmware into the EMI
119 * Note: collect up to 1023 (yes!) bytes and send them with 121 * Note: collect up to 1023 (yes!) bytes and send them with
@@ -150,6 +152,7 @@ static int emi26_load_firmware (struct usb_device *dev)
150 goto wraperr; 152 goto wraperr;
151 } 153 }
152 } 154 }
155 msleep(250); /* let device settle */
153 156
154 /* De-assert reset (let the CPU run) */ 157 /* De-assert reset (let the CPU run) */
155 err = emi26_set_reset(dev,0); 158 err = emi26_set_reset(dev,0);
@@ -192,6 +195,7 @@ static int emi26_load_firmware (struct usb_device *dev)
192 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 195 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
193 goto wraperr; 196 goto wraperr;
194 } 197 }
198 msleep(250); /* let device settle */
195 199
196 /* return 1 to fail the driver inialization 200 /* return 1 to fail the driver inialization
197 * and give real driver change to load */ 201 * and give real driver change to load */
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 52fea2e08db8..fe351371f274 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/usb.h> 17#include <linux/usb.h>
18#include <linux/delay.h>
18 19
19#define MAX_INTEL_HEX_RECORD_LENGTH 16 20#define MAX_INTEL_HEX_RECORD_LENGTH 16
20typedef struct _INTEL_HEX_RECORD 21typedef struct _INTEL_HEX_RECORD
@@ -123,6 +124,7 @@ static int emi62_load_firmware (struct usb_device *dev)
123 124
124 /* De-assert reset (let the CPU run) */ 125 /* De-assert reset (let the CPU run) */
125 err = emi62_set_reset(dev,0); 126 err = emi62_set_reset(dev,0);
127 msleep(250); /* let device settle */
126 128
127 /* 2. We upload the FPGA firmware into the EMI 129 /* 2. We upload the FPGA firmware into the EMI
128 * Note: collect up to 1023 (yes!) bytes and send them with 130 * Note: collect up to 1023 (yes!) bytes and send them with
@@ -166,6 +168,7 @@ static int emi62_load_firmware (struct usb_device *dev)
166 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 168 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
167 goto wraperr; 169 goto wraperr;
168 } 170 }
171 msleep(250); /* let device settle */
169 172
170 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ 173 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
171 174
@@ -228,6 +231,7 @@ static int emi62_load_firmware (struct usb_device *dev)
228 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 231 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
229 goto wraperr; 232 goto wraperr;
230 } 233 }
234 msleep(250); /* let device settle */
231 235
232 kfree(buf); 236 kfree(buf);
233 237
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index 2deb4c01539e..7683926a1b6f 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -318,6 +318,8 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
318 set_register(pegasus, PhyCtrl, (indx | PHY_READ)); 318 set_register(pegasus, PhyCtrl, (indx | PHY_READ));
319 for (i = 0; i < REG_TIMEOUT; i++) { 319 for (i = 0; i < REG_TIMEOUT; i++) {
320 ret = get_registers(pegasus, PhyCtrl, 1, data); 320 ret = get_registers(pegasus, PhyCtrl, 1, data);
321 if (ret == -ESHUTDOWN)
322 goto fail;
321 if (data[0] & PHY_DONE) 323 if (data[0] & PHY_DONE)
322 break; 324 break;
323 } 325 }
@@ -326,6 +328,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
326 *regd = le16_to_cpu(regdi); 328 *regd = le16_to_cpu(regdi);
327 return ret; 329 return ret;
328 } 330 }
331fail:
329 if (netif_msg_drv(pegasus)) 332 if (netif_msg_drv(pegasus))
330 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 333 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
331 334
@@ -354,12 +357,15 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
354 set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); 357 set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
355 for (i = 0; i < REG_TIMEOUT; i++) { 358 for (i = 0; i < REG_TIMEOUT; i++) {
356 ret = get_registers(pegasus, PhyCtrl, 1, data); 359 ret = get_registers(pegasus, PhyCtrl, 1, data);
360 if (ret == -ESHUTDOWN)
361 goto fail;
357 if (data[0] & PHY_DONE) 362 if (data[0] & PHY_DONE)
358 break; 363 break;
359 } 364 }
360 if (i < REG_TIMEOUT) 365 if (i < REG_TIMEOUT)
361 return ret; 366 return ret;
362 367
368fail:
363 if (netif_msg_drv(pegasus)) 369 if (netif_msg_drv(pegasus))
364 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 370 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
365 return -ETIMEDOUT; 371 return -ETIMEDOUT;
@@ -387,6 +393,8 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
387 ret = get_registers(pegasus, EpromCtrl, 1, &tmp); 393 ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
388 if (tmp & EPROM_DONE) 394 if (tmp & EPROM_DONE)
389 break; 395 break;
396 if (ret == -ESHUTDOWN)
397 goto fail;
390 } 398 }
391 if (i < REG_TIMEOUT) { 399 if (i < REG_TIMEOUT) {
392 ret = get_registers(pegasus, EpromData, 2, &retdatai); 400 ret = get_registers(pegasus, EpromData, 2, &retdatai);
@@ -394,6 +402,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
394 return ret; 402 return ret;
395 } 403 }
396 404
405fail:
397 if (netif_msg_drv(pegasus)) 406 if (netif_msg_drv(pegasus))
398 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 407 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
399 return -ETIMEDOUT; 408 return -ETIMEDOUT;
@@ -433,12 +442,15 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
433 442
434 for (i = 0; i < REG_TIMEOUT; i++) { 443 for (i = 0; i < REG_TIMEOUT; i++) {
435 ret = get_registers(pegasus, EpromCtrl, 1, &tmp); 444 ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
445 if (ret == -ESHUTDOWN)
446 goto fail;
436 if (tmp & EPROM_DONE) 447 if (tmp & EPROM_DONE)
437 break; 448 break;
438 } 449 }
439 disable_eprom_write(pegasus); 450 disable_eprom_write(pegasus);
440 if (i < REG_TIMEOUT) 451 if (i < REG_TIMEOUT)
441 return ret; 452 return ret;
453fail:
442 if (netif_msg_drv(pegasus)) 454 if (netif_msg_drv(pegasus))
443 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 455 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
444 return -ETIMEDOUT; 456 return -ETIMEDOUT;
@@ -1378,9 +1390,8 @@ static int pegasus_suspend (struct usb_interface *intf, pm_message_t message)
1378 struct pegasus *pegasus = usb_get_intfdata(intf); 1390 struct pegasus *pegasus = usb_get_intfdata(intf);
1379 1391
1380 netif_device_detach (pegasus->net); 1392 netif_device_detach (pegasus->net);
1393 cancel_delayed_work(&pegasus->carrier_check);
1381 if (netif_running(pegasus->net)) { 1394 if (netif_running(pegasus->net)) {
1382 cancel_delayed_work(&pegasus->carrier_check);
1383
1384 usb_kill_urb(pegasus->rx_urb); 1395 usb_kill_urb(pegasus->rx_urb);
1385 usb_kill_urb(pegasus->intr_urb); 1396 usb_kill_urb(pegasus->intr_urb);
1386 } 1397 }
@@ -1400,10 +1411,9 @@ static int pegasus_resume (struct usb_interface *intf)
1400 pegasus->intr_urb->status = 0; 1411 pegasus->intr_urb->status = 0;
1401 pegasus->intr_urb->actual_length = 0; 1412 pegasus->intr_urb->actual_length = 0;
1402 intr_callback(pegasus->intr_urb, NULL); 1413 intr_callback(pegasus->intr_urb, NULL);
1403
1404 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
1405 CARRIER_CHECK_DELAY);
1406 } 1414 }
1415 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
1416 CARRIER_CHECK_DELAY);
1407 return 0; 1417 return 0;
1408} 1418}
1409 1419
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index f96b73f54bf1..5c60be521561 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -71,6 +71,16 @@ config USB_SERIAL_ANYDATA
71 To compile this driver as a module, choose M here: the 71 To compile this driver as a module, choose M here: the
72 module will be called anydata. 72 module will be called anydata.
73 73
74config USB_SERIAL_ARK3116
75 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"
76 depends on USB_SERIAL && EXPERIMENTAL
77 help
78 Say Y here if you want to use a ARK Micro 3116 USB to Serial
79 device.
80
81 To compile this driver as a module, choose M here: the
82 module will be called ark3116
83
74config USB_SERIAL_BELKIN 84config USB_SERIAL_BELKIN
75 tristate "USB Belkin and Peracom Single Port Serial Driver" 85 tristate "USB Belkin and Peracom Single Port Serial Driver"
76 depends on USB_SERIAL 86 depends on USB_SERIAL
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index 93c21245b1af..5a0960fc9d3e 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -13,6 +13,7 @@ usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)
13 13
14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o
15obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o 15obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o
16obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o
16obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 17obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o
17obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o 18obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
18obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o 19obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index dbf1f063098c..694b205f9b73 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -18,6 +18,7 @@
18static struct usb_device_id id_table [] = { 18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */ 19 { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
20 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ 20 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
21 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */
21 { }, 22 { },
22}; 23};
23MODULE_DEVICE_TABLE(usb, id_table); 24MODULE_DEVICE_TABLE(usb, id_table);
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
new file mode 100644
index 000000000000..8dec796222a0
--- /dev/null
+++ b/drivers/usb/serial/ark3116.c
@@ -0,0 +1,465 @@
1/*
2 * ark3116
3 * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547,
4 * productid=0x0232) (used in a datacable called KQ-U8A)
5 *
6 * - based on code by krisfx -> thanks !!
7 * (see http://www.linuxquestions.org/questions/showthread.php?p=2184457#post2184457)
8 *
9 * - based on logs created by usbsnoopy
10 *
11 * Author : Simon Schulz [ark3116_driver<AT>auctionant.de]
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/tty.h>
22#include <linux/module.h>
23#include <linux/usb.h>
24#include "usb-serial.h"
25
26
27static int debug;
28
29static struct usb_device_id id_table [] = {
30 { USB_DEVICE(0x6547, 0x0232) },
31 { },
32};
33MODULE_DEVICE_TABLE(usb, id_table);
34
35struct ark3116_private {
36 spinlock_t lock;
37 u8 termios_initialized;
38};
39
40static inline void ARK3116_SND(struct usb_serial *serial, int seq,
41 __u8 request, __u8 requesttype,
42 __u16 value, __u16 index)
43{
44 int result;
45 result = usb_control_msg(serial->dev,
46 usb_sndctrlpipe(serial->dev,0),
47 request, requesttype, value, index,
48 NULL,0x00, 1000);
49 dbg("%03d > ok",seq);
50}
51
52static inline void ARK3116_RCV(struct usb_serial *serial, int seq,
53 __u8 request, __u8 requesttype,
54 __u16 value, __u16 index, __u8 expected,
55 char *buf)
56{
57 int result;
58 result = usb_control_msg(serial->dev,
59 usb_rcvctrlpipe(serial->dev,0),
60 request, requesttype, value, index,
61 buf, 0x0000001, 1000);
62 if (result)
63 dbg("%03d < %d bytes [0x%02X]",seq, result, buf[0]);
64 else
65 dbg("%03d < 0 bytes", seq);
66}
67
68
69static inline void ARK3116_RCV_QUIET(struct usb_serial *serial,
70 __u8 request, __u8 requesttype,
71 __u16 value, __u16 index, char *buf)
72{
73 usb_control_msg(serial->dev,
74 usb_rcvctrlpipe(serial->dev,0),
75 request, requesttype, value, index,
76 buf, 0x0000001, 1000);
77}
78
79
80static int ark3116_attach(struct usb_serial *serial)
81{
82 char *buf;
83 struct ark3116_private *priv;
84 int i;
85
86 for (i = 0; i < serial->num_ports; ++i) {
87 priv = kmalloc (sizeof (struct ark3116_private), GFP_KERNEL);
88 if (!priv)
89 goto cleanup;
90 memset (priv, 0x00, sizeof (struct ark3116_private));
91 spin_lock_init(&priv->lock);
92
93 usb_set_serial_port_data(serial->port[i], priv);
94 }
95
96 buf = kmalloc(1, GFP_KERNEL);
97 if (!buf) {
98 dbg("error kmalloc -> out of mem ?");
99 goto cleanup;
100 }
101
102 /* 3 */
103 ARK3116_SND(serial, 3,0xFE,0x40,0x0008,0x0002);
104 ARK3116_SND(serial, 4,0xFE,0x40,0x0008,0x0001);
105 ARK3116_SND(serial, 5,0xFE,0x40,0x0000,0x0008);
106 ARK3116_SND(serial, 6,0xFE,0x40,0x0000,0x000B);
107
108 /* <-- seq7 */
109 ARK3116_RCV(serial, 7,0xFE,0xC0,0x0000,0x0003, 0x00, buf);
110 ARK3116_SND(serial, 8,0xFE,0x40,0x0080,0x0003);
111 ARK3116_SND(serial, 9,0xFE,0x40,0x001A,0x0000);
112 ARK3116_SND(serial,10,0xFE,0x40,0x0000,0x0001);
113 ARK3116_SND(serial,11,0xFE,0x40,0x0000,0x0003);
114
115 /* <-- seq12 */
116 ARK3116_RCV(serial,12,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
117 ARK3116_SND(serial,13,0xFE,0x40,0x0000,0x0004);
118
119 /* 14 */
120 ARK3116_RCV(serial,14,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
121 ARK3116_SND(serial,15,0xFE,0x40,0x0000,0x0004);
122
123 /* 16 */
124 ARK3116_RCV(serial,16,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
125 /* --> seq17 */
126 ARK3116_SND(serial,17,0xFE,0x40,0x0001,0x0004);
127
128 /* <-- seq18 */
129 ARK3116_RCV(serial,18,0xFE,0xC0,0x0000,0x0004, 0x01, buf);
130
131 /* --> seq19 */
132 ARK3116_SND(serial,19,0xFE,0x40,0x0003,0x0004);
133
134
135 /* <-- seq20 */
136 /* seems like serial port status info (RTS, CTS,...) */
137 /* returns modem control line status ?! */
138 ARK3116_RCV(serial,20,0xFE,0xC0,0x0000,0x0006, 0xFF, buf);
139
140 /* set 9600 baud & do some init ?! */
141 ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003);
142 ARK3116_SND(serial,148,0xFE,0x40,0x0038,0x0000);
143 ARK3116_SND(serial,149,0xFE,0x40,0x0001,0x0001);
144 ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003);
145 ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf);
146 ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003);
147 ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf);
148 ARK3116_SND(serial,154,0xFE,0x40,0x0003,0x0003);
149
150 kfree(buf);
151 return(0);
152
153cleanup:
154 for (--i; i>=0; --i)
155 usb_set_serial_port_data(serial->port[i], NULL);
156 return -ENOMEM;
157}
158
159static void ark3116_set_termios(struct usb_serial_port *port,
160 struct termios *old_termios)
161{
162 struct usb_serial *serial = port->serial;
163 struct ark3116_private *priv = usb_get_serial_port_data(port);
164 unsigned int cflag = port->tty->termios->c_cflag;
165 unsigned long flags;
166 int baud;
167 int ark3116_baud;
168 char *buf;
169 char config;
170
171 config = 0;
172
173 dbg("%s - port %d", __FUNCTION__, port->number);
174
175 if ((!port->tty) || (!port->tty->termios)) {
176 dbg("%s - no tty structures", __FUNCTION__);
177 return;
178 }
179
180 spin_lock_irqsave(&priv->lock, flags);
181 if (!priv->termios_initialized) {
182 *(port->tty->termios) = tty_std_termios;
183 port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
184 priv->termios_initialized = 1;
185 }
186 spin_unlock_irqrestore(&priv->lock, flags);
187
188 cflag = port->tty->termios->c_cflag;
189
190 /* check that they really want us to change something: */
191 if (old_termios) {
192 if ((cflag == old_termios->c_cflag) &&
193 (RELEVANT_IFLAG(port->tty->termios->c_iflag) ==
194 RELEVANT_IFLAG(old_termios->c_iflag))) {
195 dbg("%s - nothing to change...", __FUNCTION__);
196 return;
197 }
198 }
199
200 buf = kmalloc(1, GFP_KERNEL);
201 if (!buf) {
202 dbg("error kmalloc");
203 return;
204 }
205
206 /* set data bit count (8/7/6/5) */
207 if (cflag & CSIZE){
208 switch (cflag & CSIZE){
209 case CS5:
210 config |= 0x00;
211 dbg("setting CS5");
212 break;
213 case CS6:
214 config |= 0x01;
215 dbg("setting CS6");
216 break;
217 case CS7:
218 config |= 0x02;
219 dbg("setting CS7");
220 break;
221 default:
222 err ("CSIZE was set but not CS5-CS8, using CS8!");
223 case CS8:
224 config |= 0x03;
225 dbg("setting CS8");
226 break;
227 }
228 }
229
230 /* set parity (NONE,EVEN,ODD) */
231 if (cflag & PARENB){
232 if (cflag & PARODD) {
233 config |= 0x08;
234 dbg("setting parity to ODD");
235 } else {
236 config |= 0x18;
237 dbg("setting parity to EVEN");
238 }
239 } else {
240 dbg("setting parity to NONE");
241 }
242
243 /* SET STOPBIT (1/2) */
244 if (cflag & CSTOPB) {
245 config |= 0x04;
246 dbg ("setting 2 stop bits");
247 } else {
248 dbg ("setting 1 stop bit");
249 }
250
251
252 /* set baudrate: */
253 baud = 0;
254 switch (cflag & CBAUD){
255 case B0:
256 err("can't set 0baud, using 9600 instead");
257 break;
258 case B75: baud = 75; break;
259 case B150: baud = 150; break;
260 case B300: baud = 300; break;
261 case B600: baud = 600; break;
262 case B1200: baud = 1200; break;
263 case B1800: baud = 1800; break;
264 case B2400: baud = 2400; break;
265 case B4800: baud = 4800; break;
266 case B9600: baud = 9600; break;
267 case B19200: baud = 19200; break;
268 case B38400: baud = 38400; break;
269 case B57600: baud = 57600; break;
270 case B115200: baud = 115200; break;
271 case B230400: baud = 230400; break;
272 case B460800: baud = 460800; break;
273 default:
274 dbg("does not support the baudrate requested (fix it)");
275 break;
276 }
277
278 /* set 9600 as default (if given baudrate is invalid for example) */
279 if (baud == 0)
280 baud = 9600;
281
282 /*
283 * found by try'n'error, be careful, maybe there are other options
284 * for multiplicator etc!
285 */
286 if (baud == 460800)
287 /* strange, for 460800 the formula is wrong
288 * (dont use round(), then 9600baud is wrong) */
289 ark3116_baud = 7;
290 else
291 ark3116_baud = 3000000 / baud;
292
293 /* ? */
294 ARK3116_RCV(serial,0,0xFE,0xC0,0x0000,0x0003, 0x03, buf);
295 /* offset = buf[0]; */
296 /* offset = 0x03; */
297 /* dbg("using 0x%04X as target for 0x0003:",0x0080+offset); */
298
299
300 /* set baudrate */
301 dbg("setting baudrate to %d (->reg=%d)",baud,ark3116_baud);
302 ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003);
303 ARK3116_SND(serial,148,0xFE,0x40,(ark3116_baud & 0x00FF) ,0x0000);
304 ARK3116_SND(serial,149,0xFE,0x40,(ark3116_baud & 0xFF00)>>8,0x0001);
305 ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003);
306
307 /* ? */
308 ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf);
309 ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003);
310
311 /* set data bit count, stop bit count & parity: */
312 dbg("updating bit count, stop bit or parity (cfg=0x%02X)", config);
313 ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf);
314 ARK3116_SND(serial,154,0xFE,0x40,config,0x0003);
315
316 if (cflag & CRTSCTS)
317 dbg("CRTSCTS not supported by chipset ?!");
318
319 /* TEST ARK3116_SND(154,0xFE,0x40,0xFFFF, 0x0006); */
320
321 kfree(buf);
322 return;
323}
324
325static int ark3116_open(struct usb_serial_port *port, struct file *filp)
326{
327 struct termios tmp_termios;
328 struct usb_serial *serial = port->serial;
329 char *buf;
330 int result = 0;
331
332 dbg("%s - port %d", __FUNCTION__, port->number);
333
334 buf = kmalloc(1, GFP_KERNEL);
335 if (!buf) {
336 dbg("error kmalloc -> out of mem ?");
337 return -ENOMEM;
338 }
339
340 result = usb_serial_generic_open(port, filp);
341 if (result)
342 return result;
343
344 /* open */
345 ARK3116_RCV(serial,111,0xFE,0xC0,0x0000,0x0003, 0x02, buf);
346
347 ARK3116_SND(serial,112,0xFE,0x40,0x0082,0x0003);
348 ARK3116_SND(serial,113,0xFE,0x40,0x001A,0x0000);
349 ARK3116_SND(serial,114,0xFE,0x40,0x0000,0x0001);
350 ARK3116_SND(serial,115,0xFE,0x40,0x0002,0x0003);
351
352 ARK3116_RCV(serial,116,0xFE,0xC0,0x0000,0x0004, 0x03, buf);
353 ARK3116_SND(serial,117,0xFE,0x40,0x0002,0x0004);
354
355 ARK3116_RCV(serial,118,0xFE,0xC0,0x0000,0x0004, 0x02, buf);
356 ARK3116_SND(serial,119,0xFE,0x40,0x0000,0x0004);
357
358 ARK3116_RCV(serial,120,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
359
360 ARK3116_SND(serial,121,0xFE,0x40,0x0001,0x0004);
361
362 ARK3116_RCV(serial,122,0xFE,0xC0,0x0000,0x0004, 0x01, buf);
363
364 ARK3116_SND(serial,123,0xFE,0x40,0x0003,0x0004);
365
366 /* returns different values (control lines ?!) */
367 ARK3116_RCV(serial,124,0xFE,0xC0,0x0000,0x0006, 0xFF, buf);
368
369 /* initialise termios: */
370 if (port->tty)
371 ark3116_set_termios(port, &tmp_termios);
372
373 kfree(buf);
374
375 return result;
376
377}
378
379static int ark3116_ioctl(struct usb_serial_port *port, struct file *file,
380 unsigned int cmd, unsigned long arg)
381{
382 dbg("ioctl not supported yet...");
383 return -ENOIOCTLCMD;
384}
385
386static int ark3116_tiocmget(struct usb_serial_port *port, struct file *file)
387{
388 struct usb_serial *serial = port->serial;
389 char *buf;
390 char temp;
391
392 /* seems like serial port status info (RTS, CTS,...) is stored
393 * in reg(?) 0x0006
394 * pcb connection point 11 = GND -> sets bit4 of response
395 * pcb connection point 7 = GND -> sets bit6 of response
396 */
397
398 buf = kmalloc(1, GFP_KERNEL);
399 if (!buf) {
400 dbg("error kmalloc");
401 return -ENOMEM;
402 }
403
404 /* read register: */
405 ARK3116_RCV_QUIET(serial,0xFE,0xC0,0x0000,0x0006,buf);
406 temp = buf[0];
407 kfree(buf);
408
409 /* i do not really know if bit4=CTS and bit6=DSR... was just a
410 * quick guess !!
411 */
412 return (temp & (1<<4) ? TIOCM_CTS : 0) |
413 (temp & (1<<6) ? TIOCM_DSR : 0);
414}
415
416static struct usb_driver ark3116_driver = {
417 .name = "ark3116",
418 .probe = usb_serial_probe,
419 .disconnect = usb_serial_disconnect,
420 .id_table = id_table,
421};
422
423static struct usb_serial_driver ark3116_device = {
424 .driver = {
425 .owner = THIS_MODULE,
426 .name = "ark3116",
427 },
428 .id_table = id_table,
429 .num_interrupt_in = 1,
430 .num_bulk_in = 1,
431 .num_bulk_out = 1,
432 .num_ports = 1,
433 .attach = ark3116_attach,
434 .set_termios = ark3116_set_termios,
435 .ioctl = ark3116_ioctl,
436 .tiocmget = ark3116_tiocmget,
437 .open = ark3116_open,
438};
439
440static int __init ark3116_init(void)
441{
442 int retval;
443
444 retval = usb_serial_register(&ark3116_device);
445 if (retval)
446 return retval;
447 retval = usb_register(&ark3116_driver);
448 if (retval)
449 usb_serial_deregister(&ark3116_device);
450 return retval;
451}
452
453static void __exit ark3116_exit(void)
454{
455 usb_deregister(&ark3116_driver);
456 usb_serial_deregister(&ark3116_device);
457}
458
459module_init(ark3116_init);
460module_exit(ark3116_exit);
461MODULE_LICENSE("GPL");
462
463module_param(debug, bool, S_IRUGO | S_IWUSR);
464MODULE_PARM_DESC(debug, "Debug enabled or not");
465
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 82151207d814..986d7622273d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -307,6 +307,7 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
307 307
308 308
309static struct usb_device_id id_table_combined [] = { 309static struct usb_device_id id_table_combined [] = {
310 { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) },
310 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 311 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
311 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 312 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
312 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 313 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
@@ -498,6 +499,7 @@ static struct usb_device_id id_table_combined [] = {
498 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 499 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
499 { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, 500 { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
500 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 501 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
502 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
501 { }, /* Optional parameter entry */ 503 { }, /* Optional parameter entry */
502 { } /* Terminating entry */ 504 { } /* Terminating entry */
503}; 505};
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 2c55a5ea9c99..d69a917e768f 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -32,6 +32,10 @@
32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */ 32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
33 33
34 34
35/* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */
36#define FTDI_ACTZWAVE_PID 0xF2D0
37
38
35/* www.irtrans.de device */ 39/* www.irtrans.de device */
36#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ 40#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
37 41
@@ -426,6 +430,11 @@
426#define PAPOUCH_VID 0x5050 /* Vendor ID */ 430#define PAPOUCH_VID 0x5050 /* Vendor ID */
427#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */ 431#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
428 432
433/*
434 * ACG Identification Technologies GmbH products (http://www.acg.de/).
435 * Submitted by anton -at- goto10 -dot- org.
436 */
437#define FTDI_ACG_HFDUAL_PID 0xDD20 /* HF Dual ISO Reader (RFID) */
429 438
430/* Commands */ 439/* Commands */
431#define FTDI_SIO_RESET 0 /* Reset the port */ 440#define FTDI_SIO_RESET 0 /* Reset the port */
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 476cda107f4f..c62cc2876519 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -138,6 +138,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
138 138
139 return result; 139 return result;
140} 140}
141EXPORT_SYMBOL_GPL(usb_serial_generic_open);
141 142
142static void generic_cleanup (struct usb_serial_port *port) 143static void generic_cleanup (struct usb_serial_port *port)
143{ 144{
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 4d40704dea2c..238033a87092 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -257,14 +257,14 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf
257 return (0); 257 return (0);
258 } 258 }
259 259
260 spin_lock(&port->lock); 260 spin_lock(&wport->lock);
261 if (port->write_urb_busy) { 261 if (wport->write_urb_busy) {
262 spin_unlock(&port->lock); 262 spin_unlock(&wport->lock);
263 dbg("%s - already writing", __FUNCTION__); 263 dbg("%s - already writing", __FUNCTION__);
264 return 0; 264 return 0;
265 } 265 }
266 port->write_urb_busy = 1; 266 wport->write_urb_busy = 1;
267 spin_unlock(&port->lock); 267 spin_unlock(&wport->lock);
268 268
269 count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count; 269 count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count;
270 270
@@ -283,7 +283,7 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf
283 wport->write_urb->dev = serial->dev; 283 wport->write_urb->dev = serial->dev;
284 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); 284 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
285 if (result) { 285 if (result) {
286 port->write_urb_busy = 0; 286 wport->write_urb_busy = 0;
287 err("%s - failed submitting write urb, error %d", __FUNCTION__, result); 287 err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
288 } else 288 } else
289 result = count; 289 result = count;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 071f86a59c08..9c36f0ece20f 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -189,11 +189,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
189 189
190 portNumber = tty->index - serial->minor; 190 portNumber = tty->index - serial->minor;
191 port = serial->port[portNumber]; 191 port = serial->port[portNumber];
192 if (!port) 192 if (!port) {
193 return -ENODEV; 193 retval = -ENODEV;
194 goto bailout_kref_put;
195 }
194 196
195 if (mutex_lock_interruptible(&port->mutex)) 197 if (mutex_lock_interruptible(&port->mutex)) {
196 return -ERESTARTSYS; 198 retval = -ERESTARTSYS;
199 goto bailout_kref_put;
200 }
197 201
198 ++port->open_count; 202 ++port->open_count;
199 203
@@ -209,7 +213,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
209 * safe because we are called with BKL held */ 213 * safe because we are called with BKL held */
210 if (!try_module_get(serial->type->driver.owner)) { 214 if (!try_module_get(serial->type->driver.owner)) {
211 retval = -ENODEV; 215 retval = -ENODEV;
212 goto bailout_kref_put; 216 goto bailout_mutex_unlock;
213 } 217 }
214 218
215 /* only call the device specific open if this 219 /* only call the device specific open if this
@@ -224,10 +228,11 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
224 228
225bailout_module_put: 229bailout_module_put:
226 module_put(serial->type->driver.owner); 230 module_put(serial->type->driver.owner);
227bailout_kref_put: 231bailout_mutex_unlock:
228 kref_put(&serial->kref, destroy_serial);
229 port->open_count = 0; 232 port->open_count = 0;
230 mutex_unlock(&port->mutex); 233 mutex_unlock(&port->mutex);
234bailout_kref_put:
235 kref_put(&serial->kref, destroy_serial);
231 return retval; 236 return retval;
232} 237}
233 238