diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/Kconfig | 9 | ||||
-rw-r--r-- | drivers/usb/serial/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/serial/console.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.h | 15 | ||||
-rw-r--r-- | drivers/usb/serial/funsoft.c | 65 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.h | 4 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 16 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.h | 6 |
11 files changed, 112 insertions, 14 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 5a8a2c91c2b2..f96b73f54bf1 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -158,6 +158,15 @@ config USB_SERIAL_FTDI_SIO | |||
158 | To compile this driver as a module, choose M here: the | 158 | To compile this driver as a module, choose M here: the |
159 | module will be called ftdi_sio. | 159 | module will be called ftdi_sio. |
160 | 160 | ||
161 | config USB_SERIAL_FUNSOFT | ||
162 | tristate "USB Fundamental Software Dongle Driver" | ||
163 | depends on USB_SERIAL | ||
164 | ---help--- | ||
165 | Say Y here if you want to use the Fundamental Software dongle. | ||
166 | |||
167 | To compile this driver as a module, choose M here: the | ||
168 | module will be called funsoft. | ||
169 | |||
161 | config USB_SERIAL_VISOR | 170 | config USB_SERIAL_VISOR |
162 | tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver" | 171 | tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver" |
163 | depends on USB_SERIAL | 172 | depends on USB_SERIAL |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index f7fe4172efed..93c21245b1af 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
@@ -22,6 +22,7 @@ obj-$(CONFIG_USB_SERIAL_EDGEPORT) += io_edgeport.o | |||
22 | obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o | 22 | obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o |
23 | obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o | 23 | obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o |
24 | obj-$(CONFIG_USB_SERIAL_FTDI_SIO) += ftdi_sio.o | 24 | obj-$(CONFIG_USB_SERIAL_FTDI_SIO) += ftdi_sio.o |
25 | obj-$(CONFIG_USB_SERIAL_FUNSOFT) += funsoft.o | ||
25 | obj-$(CONFIG_USB_SERIAL_GARMIN) += garmin_gps.o | 26 | obj-$(CONFIG_USB_SERIAL_GARMIN) += garmin_gps.o |
26 | obj-$(CONFIG_USB_SERIAL_HP4X) += hp4x.o | 27 | obj-$(CONFIG_USB_SERIAL_HP4X) += hp4x.o |
27 | obj-$(CONFIG_USB_SERIAL_IPAQ) += ipaq.o | 28 | obj-$(CONFIG_USB_SERIAL_IPAQ) += ipaq.o |
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 167f8ec56131..8023bb7279b1 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -54,7 +54,7 @@ static struct console usbcons; | |||
54 | * serial.c code, except that the specifier is "ttyUSB" instead | 54 | * serial.c code, except that the specifier is "ttyUSB" instead |
55 | * of "ttyS". | 55 | * of "ttyS". |
56 | */ | 56 | */ |
57 | static int __init usb_console_setup(struct console *co, char *options) | 57 | static int usb_console_setup(struct console *co, char *options) |
58 | { | 58 | { |
59 | struct usbcons_info *info = &usbcons_info; | 59 | struct usbcons_info *info = &usbcons_info; |
60 | int baud = 9600; | 60 | int baud = 9600; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index f3af81b4dd29..f5851db67f5b 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -489,10 +489,12 @@ static struct usb_device_id id_table_combined [] = { | |||
489 | { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, | 489 | { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, |
490 | { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, | 490 | { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, |
491 | { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, | 491 | { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, |
492 | { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, | ||
492 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, | 493 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, |
493 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, | 494 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, |
494 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, | 495 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, |
495 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, | 496 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, |
497 | { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, | ||
496 | { }, /* Optional parameter entry */ | 498 | { }, /* Optional parameter entry */ |
497 | { } /* Terminating entry */ | 499 | { } /* Terminating entry */ |
498 | }; | 500 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 8da773c2744d..2155f0e4a378 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -399,6 +399,21 @@ | |||
399 | #define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ | 399 | #define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ |
400 | #define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */ | 400 | #define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */ |
401 | 401 | ||
402 | /* | ||
403 | * Eclo (http://www.eclo.pt/) product IDs. | ||
404 | * PID 0xEA90 submitted by Martin Grill. | ||
405 | */ | ||
406 | #define FTDI_ECLO_COM_1WIRE_PID 0xEA90 /* COM to 1-Wire USB adaptor */ | ||
407 | |||
408 | /* | ||
409 | * Papouch products (http://www.papouch.com/) | ||
410 | * Submitted by Folkert van Heusden | ||
411 | */ | ||
412 | |||
413 | #define PAPOUCH_VID 0x5050 /* Vendor ID */ | ||
414 | #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */ | ||
415 | |||
416 | |||
402 | /* Commands */ | 417 | /* Commands */ |
403 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 418 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
404 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 419 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c new file mode 100644 index 000000000000..803721b97e2e --- /dev/null +++ b/drivers/usb/serial/funsoft.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * Funsoft Serial USB driver | ||
3 | * | ||
4 | * Copyright (C) 2006 Greg Kroah-Hartman <gregkh@suse.de> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License version | ||
8 | * 2 as published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/tty.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/usb.h> | ||
16 | #include "usb-serial.h" | ||
17 | |||
18 | static struct usb_device_id id_table [] = { | ||
19 | { USB_DEVICE(0x1404, 0xcddc) }, | ||
20 | { }, | ||
21 | }; | ||
22 | MODULE_DEVICE_TABLE(usb, id_table); | ||
23 | |||
24 | static struct usb_driver funsoft_driver = { | ||
25 | .name = "funsoft", | ||
26 | .probe = usb_serial_probe, | ||
27 | .disconnect = usb_serial_disconnect, | ||
28 | .id_table = id_table, | ||
29 | .no_dynamic_id = 1, | ||
30 | }; | ||
31 | |||
32 | static struct usb_serial_driver funsoft_device = { | ||
33 | .driver = { | ||
34 | .owner = THIS_MODULE, | ||
35 | .name = "funsoft", | ||
36 | }, | ||
37 | .id_table = id_table, | ||
38 | .num_interrupt_in = NUM_DONT_CARE, | ||
39 | .num_bulk_in = NUM_DONT_CARE, | ||
40 | .num_bulk_out = NUM_DONT_CARE, | ||
41 | .num_ports = 1, | ||
42 | }; | ||
43 | |||
44 | static int __init funsoft_init(void) | ||
45 | { | ||
46 | int retval; | ||
47 | |||
48 | retval = usb_serial_register(&funsoft_device); | ||
49 | if (retval) | ||
50 | return retval; | ||
51 | retval = usb_register(&funsoft_driver); | ||
52 | if (retval) | ||
53 | usb_serial_deregister(&funsoft_device); | ||
54 | return retval; | ||
55 | } | ||
56 | |||
57 | static void __exit funsoft_exit(void) | ||
58 | { | ||
59 | usb_deregister(&funsoft_driver); | ||
60 | usb_serial_deregister(&funsoft_device); | ||
61 | } | ||
62 | |||
63 | module_init(funsoft_init); | ||
64 | module_exit(funsoft_exit); | ||
65 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 495db5755df9..5cf2b80add7a 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard | 28 | 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard |
29 | 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes | 29 | 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes |
30 | wants to send >2000 bytes. | 30 | wants to send >2000 bytes. |
31 | 2006-04-10 v0.4.2 fixed two array overrun errors :-/ | ||
31 | 32 | ||
32 | Work sponsored by: Sigos GmbH, Germany <info@sigos.de> | 33 | Work sponsored by: Sigos GmbH, Germany <info@sigos.de> |
33 | 34 | ||
@@ -582,14 +583,14 @@ static void option_setup_urbs(struct usb_serial *serial) | |||
582 | portdata = usb_get_serial_port_data(port); | 583 | portdata = usb_get_serial_port_data(port); |
583 | 584 | ||
584 | /* Do indat endpoints first */ | 585 | /* Do indat endpoints first */ |
585 | for (j = 0; j <= N_IN_URB; ++j) { | 586 | for (j = 0; j < N_IN_URB; ++j) { |
586 | portdata->in_urbs[j] = option_setup_urb (serial, | 587 | portdata->in_urbs[j] = option_setup_urb (serial, |
587 | port->bulk_in_endpointAddress, USB_DIR_IN, port, | 588 | port->bulk_in_endpointAddress, USB_DIR_IN, port, |
588 | portdata->in_buffer[j], IN_BUFLEN, option_indat_callback); | 589 | portdata->in_buffer[j], IN_BUFLEN, option_indat_callback); |
589 | } | 590 | } |
590 | 591 | ||
591 | /* outdat endpoints */ | 592 | /* outdat endpoints */ |
592 | for (j = 0; j <= N_OUT_URB; ++j) { | 593 | for (j = 0; j < N_OUT_URB; ++j) { |
593 | portdata->out_urbs[j] = option_setup_urb (serial, | 594 | portdata->out_urbs[j] = option_setup_urb (serial, |
594 | port->bulk_out_endpointAddress, USB_DIR_OUT, port, | 595 | port->bulk_out_endpointAddress, USB_DIR_OUT, port, |
595 | portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback); | 596 | portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback); |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index b3014fda645c..ccf746b27d4e 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -78,6 +78,7 @@ static struct usb_device_id id_table [] = { | |||
78 | { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) }, | 78 | { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) }, |
79 | { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, | 79 | { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, |
80 | { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, | 80 | { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, |
81 | { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, | ||
81 | { } /* Terminating entry */ | 82 | { } /* Terminating entry */ |
82 | }; | 83 | }; |
83 | 84 | ||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 77901d143979..09f379b19e98 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -79,3 +79,7 @@ | |||
79 | /* USB GSM cable from Speed Dragon Multimedia, Ltd */ | 79 | /* USB GSM cable from Speed Dragon Multimedia, Ltd */ |
80 | #define SPEEDDRAGON_VENDOR_ID 0x0e55 | 80 | #define SPEEDDRAGON_VENDOR_ID 0x0e55 |
81 | #define SPEEDDRAGON_PRODUCT_ID 0x110b | 81 | #define SPEEDDRAGON_PRODUCT_ID 0x110b |
82 | |||
83 | /* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */ | ||
84 | #define OTI_VENDOR_ID 0x0ea0 | ||
85 | #define OTI_PRODUCT_ID 0x6858 | ||
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 097f4e8488fe..071f86a59c08 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -27,10 +27,10 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/moduleparam.h> | 28 | #include <linux/moduleparam.h> |
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | #include <linux/mutex.h> | ||
30 | #include <linux/list.h> | 31 | #include <linux/list.h> |
31 | #include <linux/smp_lock.h> | 32 | #include <linux/smp_lock.h> |
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include <asm/semaphore.h> | ||
34 | #include <linux/usb.h> | 34 | #include <linux/usb.h> |
35 | #include "usb-serial.h" | 35 | #include "usb-serial.h" |
36 | #include "pl2303.h" | 36 | #include "pl2303.h" |
@@ -192,7 +192,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) | |||
192 | if (!port) | 192 | if (!port) |
193 | return -ENODEV; | 193 | return -ENODEV; |
194 | 194 | ||
195 | if (down_interruptible(&port->sem)) | 195 | if (mutex_lock_interruptible(&port->mutex)) |
196 | return -ERESTARTSYS; | 196 | return -ERESTARTSYS; |
197 | 197 | ||
198 | ++port->open_count; | 198 | ++port->open_count; |
@@ -219,7 +219,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) | |||
219 | goto bailout_module_put; | 219 | goto bailout_module_put; |
220 | } | 220 | } |
221 | 221 | ||
222 | up(&port->sem); | 222 | mutex_unlock(&port->mutex); |
223 | return 0; | 223 | return 0; |
224 | 224 | ||
225 | bailout_module_put: | 225 | bailout_module_put: |
@@ -227,7 +227,7 @@ bailout_module_put: | |||
227 | bailout_kref_put: | 227 | bailout_kref_put: |
228 | kref_put(&serial->kref, destroy_serial); | 228 | kref_put(&serial->kref, destroy_serial); |
229 | port->open_count = 0; | 229 | port->open_count = 0; |
230 | up(&port->sem); | 230 | mutex_unlock(&port->mutex); |
231 | return retval; | 231 | return retval; |
232 | } | 232 | } |
233 | 233 | ||
@@ -240,10 +240,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp) | |||
240 | 240 | ||
241 | dbg("%s - port %d", __FUNCTION__, port->number); | 241 | dbg("%s - port %d", __FUNCTION__, port->number); |
242 | 242 | ||
243 | down(&port->sem); | 243 | mutex_lock(&port->mutex); |
244 | 244 | ||
245 | if (port->open_count == 0) { | 245 | if (port->open_count == 0) { |
246 | up(&port->sem); | 246 | mutex_unlock(&port->mutex); |
247 | return; | 247 | return; |
248 | } | 248 | } |
249 | 249 | ||
@@ -262,7 +262,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp) | |||
262 | module_put(port->serial->type->driver.owner); | 262 | module_put(port->serial->type->driver.owner); |
263 | } | 263 | } |
264 | 264 | ||
265 | up(&port->sem); | 265 | mutex_unlock(&port->mutex); |
266 | kref_put(&port->serial->kref, destroy_serial); | 266 | kref_put(&port->serial->kref, destroy_serial); |
267 | } | 267 | } |
268 | 268 | ||
@@ -783,7 +783,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
783 | port->number = i + serial->minor; | 783 | port->number = i + serial->minor; |
784 | port->serial = serial; | 784 | port->serial = serial; |
785 | spin_lock_init(&port->lock); | 785 | spin_lock_init(&port->lock); |
786 | sema_init(&port->sem, 1); | 786 | mutex_init(&port->mutex); |
787 | INIT_WORK(&port->work, usb_serial_port_softint, port); | 787 | INIT_WORK(&port->work, usb_serial_port_softint, port); |
788 | serial->port[i] = port; | 788 | serial->port[i] = port; |
789 | } | 789 | } |
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h index d7d27c3385b3..dc89d8710460 100644 --- a/drivers/usb/serial/usb-serial.h +++ b/drivers/usb/serial/usb-serial.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/config.h> | 17 | #include <linux/config.h> |
18 | #include <linux/kref.h> | 18 | #include <linux/kref.h> |
19 | #include <asm/semaphore.h> | 19 | #include <linux/mutex.h> |
20 | 20 | ||
21 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 21 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
22 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ | 22 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ |
@@ -31,7 +31,7 @@ | |||
31 | * @serial: pointer back to the struct usb_serial owner of this port. | 31 | * @serial: pointer back to the struct usb_serial owner of this port. |
32 | * @tty: pointer to the corresponding tty for this port. | 32 | * @tty: pointer to the corresponding tty for this port. |
33 | * @lock: spinlock to grab when updating portions of this structure. | 33 | * @lock: spinlock to grab when updating portions of this structure. |
34 | * @sem: semaphore used to synchronize serial_open() and serial_close() | 34 | * @mutex: mutex used to synchronize serial_open() and serial_close() |
35 | * access for this port. | 35 | * access for this port. |
36 | * @number: the number of the port (the minor number). | 36 | * @number: the number of the port (the minor number). |
37 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | 37 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. |
@@ -63,7 +63,7 @@ struct usb_serial_port { | |||
63 | struct usb_serial * serial; | 63 | struct usb_serial * serial; |
64 | struct tty_struct * tty; | 64 | struct tty_struct * tty; |
65 | spinlock_t lock; | 65 | spinlock_t lock; |
66 | struct semaphore sem; | 66 | struct mutex mutex; |
67 | unsigned char number; | 67 | unsigned char number; |
68 | 68 | ||
69 | unsigned char * interrupt_in_buffer; | 69 | unsigned char * interrupt_in_buffer; |