diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/Kconfig | 7 | ||||
-rw-r--r-- | drivers/usb/serial/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/serial/cp2101.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 73 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.h | 5 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.h | 7 | ||||
-rw-r--r-- | drivers/usb/serial/garmin_gps.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 16 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/navman.c | 157 | ||||
-rw-r--r-- | drivers/usb/serial/omninet.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.h | 4 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/visor.c | 3 |
22 files changed, 283 insertions, 55 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index be5dc80836c3..5a8a2c91c2b2 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -403,6 +403,13 @@ config USB_SERIAL_MCT_U232 | |||
403 | To compile this driver as a module, choose M here: the | 403 | To compile this driver as a module, choose M here: the |
404 | module will be called mct_u232. | 404 | module will be called mct_u232. |
405 | 405 | ||
406 | config USB_SERIAL_NAVMAN | ||
407 | tristate "USB Navman GPS device" | ||
408 | depends on USB_SERIAL | ||
409 | help | ||
410 | To compile this driver as a module, choose M here: the | ||
411 | module will be called navman. | ||
412 | |||
406 | config USB_SERIAL_PL2303 | 413 | config USB_SERIAL_PL2303 |
407 | tristate "USB Prolific 2303 Single Port Serial Driver" | 414 | tristate "USB Prolific 2303 Single Port Serial Driver" |
408 | depends on USB_SERIAL | 415 | depends on USB_SERIAL |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index f0b04420cea1..f7fe4172efed 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA) += keyspan_pda.o | |||
32 | obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o | 32 | obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o |
33 | obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o | 33 | obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o |
34 | obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o | 34 | obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o |
35 | obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o | ||
35 | obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o | 36 | obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o |
36 | obj-$(CONFIG_USB_SERIAL_OPTION) += option.o | 37 | obj-$(CONFIG_USB_SERIAL_OPTION) += option.o |
37 | obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o | 38 | obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index dc7a069503e0..e0c2acdb3f06 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -32,7 +32,7 @@ | |||
32 | /* | 32 | /* |
33 | * Version Information | 33 | * Version Information |
34 | */ | 34 | */ |
35 | #define DRIVER_VERSION "v0.06" | 35 | #define DRIVER_VERSION "v0.07" |
36 | #define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver" | 36 | #define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver" |
37 | 37 | ||
38 | /* | 38 | /* |
@@ -58,6 +58,7 @@ static struct usb_device_id id_table [] = { | |||
58 | { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ | 58 | { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ |
59 | { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ | 59 | { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ |
60 | { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ | 60 | { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ |
61 | { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ | ||
61 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 62 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
62 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 63 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
63 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 64 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
@@ -169,9 +170,7 @@ static int cp2101_get_config(struct usb_serial_port* port, u8 request, | |||
169 | /* Number of integers required to contain the array */ | 170 | /* Number of integers required to contain the array */ |
170 | length = (((size - 1) | 3) + 1)/4; | 171 | length = (((size - 1) | 3) + 1)/4; |
171 | 172 | ||
172 | buf = kmalloc (length * sizeof(u32), GFP_KERNEL); | 173 | buf = kcalloc(length, sizeof(u32), GFP_KERNEL); |
173 | memset(buf, 0, length * sizeof(u32)); | ||
174 | |||
175 | if (!buf) { | 174 | if (!buf) { |
176 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); | 175 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); |
177 | return -ENOMEM; | 176 | return -ENOMEM; |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 68067fe117a4..7212fbe3b6f2 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -98,10 +98,16 @@ static struct usb_device_id id_table_cyphidcomrs232 [] = { | |||
98 | { } /* Terminating entry */ | 98 | { } /* Terminating entry */ |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static struct usb_device_id id_table_nokiaca42v2 [] = { | ||
102 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, | ||
103 | { } /* Terminating entry */ | ||
104 | }; | ||
105 | |||
101 | static struct usb_device_id id_table_combined [] = { | 106 | static struct usb_device_id id_table_combined [] = { |
102 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB) }, | 107 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB) }, |
103 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, | 108 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, |
104 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | 109 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, |
110 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, | ||
105 | { } /* Terminating entry */ | 111 | { } /* Terminating entry */ |
106 | }; | 112 | }; |
107 | 113 | ||
@@ -149,6 +155,7 @@ struct cypress_buf { | |||
149 | /* function prototypes for the Cypress USB to serial device */ | 155 | /* function prototypes for the Cypress USB to serial device */ |
150 | static int cypress_earthmate_startup (struct usb_serial *serial); | 156 | static int cypress_earthmate_startup (struct usb_serial *serial); |
151 | static int cypress_hidcom_startup (struct usb_serial *serial); | 157 | static int cypress_hidcom_startup (struct usb_serial *serial); |
158 | static int cypress_ca42v2_startup (struct usb_serial *serial); | ||
152 | static void cypress_shutdown (struct usb_serial *serial); | 159 | static void cypress_shutdown (struct usb_serial *serial); |
153 | static int cypress_open (struct usb_serial_port *port, struct file *filp); | 160 | static int cypress_open (struct usb_serial_port *port, struct file *filp); |
154 | static void cypress_close (struct usb_serial_port *port, struct file *filp); | 161 | static void cypress_close (struct usb_serial_port *port, struct file *filp); |
@@ -235,6 +242,34 @@ static struct usb_serial_driver cypress_hidcom_device = { | |||
235 | .write_int_callback = cypress_write_int_callback, | 242 | .write_int_callback = cypress_write_int_callback, |
236 | }; | 243 | }; |
237 | 244 | ||
245 | static struct usb_serial_driver cypress_ca42v2_device = { | ||
246 | .driver = { | ||
247 | .owner = THIS_MODULE, | ||
248 | .name = "nokiaca42v2", | ||
249 | }, | ||
250 | .description = "Nokia CA-42 V2 Adapter", | ||
251 | .id_table = id_table_nokiaca42v2, | ||
252 | .num_interrupt_in = 1, | ||
253 | .num_interrupt_out = 1, | ||
254 | .num_bulk_in = NUM_DONT_CARE, | ||
255 | .num_bulk_out = NUM_DONT_CARE, | ||
256 | .num_ports = 1, | ||
257 | .attach = cypress_ca42v2_startup, | ||
258 | .shutdown = cypress_shutdown, | ||
259 | .open = cypress_open, | ||
260 | .close = cypress_close, | ||
261 | .write = cypress_write, | ||
262 | .write_room = cypress_write_room, | ||
263 | .ioctl = cypress_ioctl, | ||
264 | .set_termios = cypress_set_termios, | ||
265 | .tiocmget = cypress_tiocmget, | ||
266 | .tiocmset = cypress_tiocmset, | ||
267 | .chars_in_buffer = cypress_chars_in_buffer, | ||
268 | .throttle = cypress_throttle, | ||
269 | .unthrottle = cypress_unthrottle, | ||
270 | .read_int_callback = cypress_read_int_callback, | ||
271 | .write_int_callback = cypress_write_int_callback, | ||
272 | }; | ||
238 | 273 | ||
239 | /***************************************************************************** | 274 | /***************************************************************************** |
240 | * Cypress serial helper functions | 275 | * Cypress serial helper functions |
@@ -286,6 +321,12 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m | |||
286 | __FUNCTION__); | 321 | __FUNCTION__); |
287 | new_baudrate = priv->baud_rate; | 322 | new_baudrate = priv->baud_rate; |
288 | } | 323 | } |
324 | } else if (priv->chiptype == CT_CA42V2) { | ||
325 | if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { | ||
326 | err("%s - failed setting baud rate, unsupported speed", | ||
327 | __FUNCTION__); | ||
328 | new_baudrate = priv->baud_rate; | ||
329 | } | ||
289 | } else if (priv->chiptype == CT_GENERIC) { | 330 | } else if (priv->chiptype == CT_GENERIC) { |
290 | if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { | 331 | if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) { |
291 | err("%s - failed setting baud rate, unsupported speed", | 332 | err("%s - failed setting baud rate, unsupported speed", |
@@ -435,11 +476,10 @@ static int generic_startup (struct usb_serial *serial) | |||
435 | 476 | ||
436 | dbg("%s - port %d", __FUNCTION__, serial->port[0]->number); | 477 | dbg("%s - port %d", __FUNCTION__, serial->port[0]->number); |
437 | 478 | ||
438 | priv = kmalloc(sizeof (struct cypress_private), GFP_KERNEL); | 479 | priv = kzalloc(sizeof (struct cypress_private), GFP_KERNEL); |
439 | if (!priv) | 480 | if (!priv) |
440 | return -ENOMEM; | 481 | return -ENOMEM; |
441 | 482 | ||
442 | memset(priv, 0x00, sizeof (struct cypress_private)); | ||
443 | spin_lock_init(&priv->lock); | 483 | spin_lock_init(&priv->lock); |
444 | priv->buf = cypress_buf_alloc(CYPRESS_BUF_SIZE); | 484 | priv->buf = cypress_buf_alloc(CYPRESS_BUF_SIZE); |
445 | if (priv->buf == NULL) { | 485 | if (priv->buf == NULL) { |
@@ -500,6 +540,25 @@ static int cypress_hidcom_startup (struct usb_serial *serial) | |||
500 | } /* cypress_hidcom_startup */ | 540 | } /* cypress_hidcom_startup */ |
501 | 541 | ||
502 | 542 | ||
543 | static int cypress_ca42v2_startup (struct usb_serial *serial) | ||
544 | { | ||
545 | struct cypress_private *priv; | ||
546 | |||
547 | dbg("%s", __FUNCTION__); | ||
548 | |||
549 | if (generic_startup(serial)) { | ||
550 | dbg("%s - Failed setting up port %d", __FUNCTION__, | ||
551 | serial->port[0]->number); | ||
552 | return 1; | ||
553 | } | ||
554 | |||
555 | priv = usb_get_serial_port_data(serial->port[0]); | ||
556 | priv->chiptype = CT_CA42V2; | ||
557 | |||
558 | return 0; | ||
559 | } /* cypress_ca42v2_startup */ | ||
560 | |||
561 | |||
503 | static void cypress_shutdown (struct usb_serial *serial) | 562 | static void cypress_shutdown (struct usb_serial *serial) |
504 | { | 563 | { |
505 | struct cypress_private *priv; | 564 | struct cypress_private *priv; |
@@ -944,6 +1003,10 @@ static void cypress_set_termios (struct usb_serial_port *port, | |||
944 | *(tty->termios) = tty_std_termios; | 1003 | *(tty->termios) = tty_std_termios; |
945 | tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | | 1004 | tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | |
946 | CLOCAL; | 1005 | CLOCAL; |
1006 | } else if (priv->chiptype == CT_CA42V2) { | ||
1007 | *(tty->termios) = tty_std_termios; | ||
1008 | tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | | ||
1009 | CLOCAL; | ||
947 | } | 1010 | } |
948 | priv->termios_initialized = 1; | 1011 | priv->termios_initialized = 1; |
949 | } | 1012 | } |
@@ -1542,6 +1605,9 @@ static int __init cypress_init(void) | |||
1542 | retval = usb_serial_register(&cypress_hidcom_device); | 1605 | retval = usb_serial_register(&cypress_hidcom_device); |
1543 | if (retval) | 1606 | if (retval) |
1544 | goto failed_hidcom_register; | 1607 | goto failed_hidcom_register; |
1608 | retval = usb_serial_register(&cypress_ca42v2_device); | ||
1609 | if (retval) | ||
1610 | goto failed_ca42v2_register; | ||
1545 | retval = usb_register(&cypress_driver); | 1611 | retval = usb_register(&cypress_driver); |
1546 | if (retval) | 1612 | if (retval) |
1547 | goto failed_usb_register; | 1613 | goto failed_usb_register; |
@@ -1550,6 +1616,8 @@ static int __init cypress_init(void) | |||
1550 | return 0; | 1616 | return 0; |
1551 | failed_usb_register: | 1617 | failed_usb_register: |
1552 | usb_deregister(&cypress_driver); | 1618 | usb_deregister(&cypress_driver); |
1619 | failed_ca42v2_register: | ||
1620 | usb_serial_deregister(&cypress_ca42v2_device); | ||
1553 | failed_hidcom_register: | 1621 | failed_hidcom_register: |
1554 | usb_serial_deregister(&cypress_hidcom_device); | 1622 | usb_serial_deregister(&cypress_hidcom_device); |
1555 | failed_em_register: | 1623 | failed_em_register: |
@@ -1566,6 +1634,7 @@ static void __exit cypress_exit (void) | |||
1566 | usb_deregister (&cypress_driver); | 1634 | usb_deregister (&cypress_driver); |
1567 | usb_serial_deregister (&cypress_earthmate_device); | 1635 | usb_serial_deregister (&cypress_earthmate_device); |
1568 | usb_serial_deregister (&cypress_hidcom_device); | 1636 | usb_serial_deregister (&cypress_hidcom_device); |
1637 | usb_serial_deregister (&cypress_ca42v2_device); | ||
1569 | } | 1638 | } |
1570 | 1639 | ||
1571 | 1640 | ||
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h index 1fa119efe41a..e1c7c27e18b7 100644 --- a/drivers/usb/serial/cypress_m8.h +++ b/drivers/usb/serial/cypress_m8.h | |||
@@ -18,6 +18,10 @@ | |||
18 | /* Cypress HID->COM RS232 Adapter */ | 18 | /* Cypress HID->COM RS232 Adapter */ |
19 | #define VENDOR_ID_CYPRESS 0x04b4 | 19 | #define VENDOR_ID_CYPRESS 0x04b4 |
20 | #define PRODUCT_ID_CYPHIDCOM 0x5500 | 20 | #define PRODUCT_ID_CYPHIDCOM 0x5500 |
21 | |||
22 | /* Nokia CA-42 USB to serial cable */ | ||
23 | #define VENDOR_ID_DAZZLE 0x07d0 | ||
24 | #define PRODUCT_ID_CA42 0x4101 | ||
21 | /* End of device listing */ | 25 | /* End of device listing */ |
22 | 26 | ||
23 | /* Used for setting / requesting serial line settings */ | 27 | /* Used for setting / requesting serial line settings */ |
@@ -34,6 +38,7 @@ | |||
34 | 38 | ||
35 | #define CT_EARTHMATE 0x01 | 39 | #define CT_EARTHMATE 0x01 |
36 | #define CT_CYPHIDCOM 0x02 | 40 | #define CT_CYPHIDCOM 0x02 |
41 | #define CT_CA42V2 0x03 | ||
37 | #define CT_GENERIC 0x0F | 42 | #define CT_GENERIC 0x0F |
38 | /* End of chiptype definitions */ | 43 | /* End of chiptype definitions */ |
39 | 44 | ||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c145e1ed8429..f3af81b4dd29 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -492,6 +492,7 @@ static struct usb_device_id id_table_combined [] = { | |||
492 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, | 492 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, |
493 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, | 493 | { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, |
494 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, | 494 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, |
495 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, | ||
495 | { }, /* Optional parameter entry */ | 496 | { }, /* Optional parameter entry */ |
496 | { } /* Terminating entry */ | 497 | { } /* Terminating entry */ |
497 | }; | 498 | }; |
@@ -1141,12 +1142,11 @@ static int ftdi_sio_attach (struct usb_serial *serial) | |||
1141 | 1142 | ||
1142 | dbg("%s",__FUNCTION__); | 1143 | dbg("%s",__FUNCTION__); |
1143 | 1144 | ||
1144 | priv = kmalloc(sizeof(struct ftdi_private), GFP_KERNEL); | 1145 | priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); |
1145 | if (!priv){ | 1146 | if (!priv){ |
1146 | err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct ftdi_private)); | 1147 | err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct ftdi_private)); |
1147 | return -ENOMEM; | 1148 | return -ENOMEM; |
1148 | } | 1149 | } |
1149 | memset(priv, 0, sizeof(*priv)); | ||
1150 | 1150 | ||
1151 | spin_lock_init(&priv->rx_lock); | 1151 | spin_lock_init(&priv->rx_lock); |
1152 | init_waitqueue_head(&priv->delta_msr_wait); | 1152 | init_waitqueue_head(&priv->delta_msr_wait); |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index bdef3b8c731f..8da773c2744d 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -146,6 +146,13 @@ | |||
146 | #define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */ | 146 | #define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */ |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * Icom ID-1 digital transceiver | ||
150 | */ | ||
151 | |||
152 | #define ICOM_ID1_VID 0x0C26 | ||
153 | #define ICOM_ID1_PID 0x0004 | ||
154 | |||
155 | /* | ||
149 | * DSS-20 Sync Station for Sony Ericsson P800 | 156 | * DSS-20 Sync Station for Sony Ericsson P800 |
150 | */ | 157 | */ |
151 | 158 | ||
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index d6f55e9dccae..5ec9bf5bac8d 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -1422,12 +1422,11 @@ static int garmin_attach (struct usb_serial *serial) | |||
1422 | 1422 | ||
1423 | dbg("%s", __FUNCTION__); | 1423 | dbg("%s", __FUNCTION__); |
1424 | 1424 | ||
1425 | garmin_data_p = kmalloc (sizeof(struct garmin_data), GFP_KERNEL); | 1425 | garmin_data_p = kzalloc(sizeof(struct garmin_data), GFP_KERNEL); |
1426 | if (garmin_data_p == NULL) { | 1426 | if (garmin_data_p == NULL) { |
1427 | dev_err(&port->dev, "%s - Out of memory\n", __FUNCTION__); | 1427 | dev_err(&port->dev, "%s - Out of memory\n", __FUNCTION__); |
1428 | return -ENOMEM; | 1428 | return -ENOMEM; |
1429 | } | 1429 | } |
1430 | memset (garmin_data_p, 0, sizeof(struct garmin_data)); | ||
1431 | init_timer(&garmin_data_p->timer); | 1430 | init_timer(&garmin_data_p->timer); |
1432 | spin_lock_init(&garmin_data_p->lock); | 1431 | spin_lock_init(&garmin_data_p->lock); |
1433 | INIT_LIST_HEAD(&garmin_data_p->pktlist); | 1432 | INIT_LIST_HEAD(&garmin_data_p->pktlist); |
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 3f29e6b0fd19..b606c5968102 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -2725,12 +2725,11 @@ static int edge_startup (struct usb_serial *serial) | |||
2725 | dev = serial->dev; | 2725 | dev = serial->dev; |
2726 | 2726 | ||
2727 | /* create our private serial structure */ | 2727 | /* create our private serial structure */ |
2728 | edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); | 2728 | edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); |
2729 | if (edge_serial == NULL) { | 2729 | if (edge_serial == NULL) { |
2730 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); | 2730 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); |
2731 | return -ENOMEM; | 2731 | return -ENOMEM; |
2732 | } | 2732 | } |
2733 | memset (edge_serial, 0, sizeof(struct edgeport_serial)); | ||
2734 | spin_lock_init(&edge_serial->es_lock); | 2733 | spin_lock_init(&edge_serial->es_lock); |
2735 | edge_serial->serial = serial; | 2734 | edge_serial->serial = serial; |
2736 | usb_set_serial_data(serial, edge_serial); | 2735 | usb_set_serial_data(serial, edge_serial); |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index afc0f34b3a46..8e1e2253748b 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2727,12 +2727,11 @@ static int edge_startup (struct usb_serial *serial) | |||
2727 | dev = serial->dev; | 2727 | dev = serial->dev; |
2728 | 2728 | ||
2729 | /* create our private serial structure */ | 2729 | /* create our private serial structure */ |
2730 | edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); | 2730 | edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); |
2731 | if (edge_serial == NULL) { | 2731 | if (edge_serial == NULL) { |
2732 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); | 2732 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); |
2733 | return -ENOMEM; | 2733 | return -ENOMEM; |
2734 | } | 2734 | } |
2735 | memset (edge_serial, 0, sizeof(struct edgeport_serial)); | ||
2736 | sema_init(&edge_serial->es_sem, 1); | 2735 | sema_init(&edge_serial->es_sem, 1); |
2737 | edge_serial->serial = serial; | 2736 | edge_serial->serial = serial; |
2738 | usb_set_serial_data(serial, edge_serial); | 2737 | usb_set_serial_data(serial, edge_serial); |
@@ -2745,12 +2744,11 @@ static int edge_startup (struct usb_serial *serial) | |||
2745 | 2744 | ||
2746 | /* set up our port private structures */ | 2745 | /* set up our port private structures */ |
2747 | for (i = 0; i < serial->num_ports; ++i) { | 2746 | for (i = 0; i < serial->num_ports; ++i) { |
2748 | edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); | 2747 | edge_port = kzalloc(sizeof(struct edgeport_port), GFP_KERNEL); |
2749 | if (edge_port == NULL) { | 2748 | if (edge_port == NULL) { |
2750 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); | 2749 | dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); |
2751 | goto cleanup; | 2750 | goto cleanup; |
2752 | } | 2751 | } |
2753 | memset (edge_port, 0, sizeof(struct edgeport_port)); | ||
2754 | spin_lock_init(&edge_port->ep_lock); | 2752 | spin_lock_init(&edge_port->ep_lock); |
2755 | edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE); | 2753 | edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE); |
2756 | if (edge_port->ep_out_buf == NULL) { | 2754 | if (edge_port->ep_out_buf == NULL) { |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index a59010421444..426182ddc42a 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -184,10 +184,9 @@ static struct irda_class_desc *irda_usb_find_class_desc(struct usb_device *dev, | |||
184 | struct irda_class_desc *desc; | 184 | struct irda_class_desc *desc; |
185 | int ret; | 185 | int ret; |
186 | 186 | ||
187 | desc = kmalloc(sizeof (struct irda_class_desc), GFP_KERNEL); | 187 | desc = kzalloc(sizeof (struct irda_class_desc), GFP_KERNEL); |
188 | if (desc == NULL) | 188 | if (desc == NULL) |
189 | return NULL; | 189 | return NULL; |
190 | memset(desc, 0, sizeof(struct irda_class_desc)); | ||
191 | 190 | ||
192 | ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0), | 191 | ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0), |
193 | IU_REQ_GET_CLASS_DESC, | 192 | IU_REQ_GET_CLASS_DESC, |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 3b958e60f5e8..052b735c4fbd 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -2250,12 +2250,11 @@ static int keyspan_startup (struct usb_serial *serial) | |||
2250 | } | 2250 | } |
2251 | 2251 | ||
2252 | /* Setup private data for serial driver */ | 2252 | /* Setup private data for serial driver */ |
2253 | s_priv = kmalloc(sizeof(struct keyspan_serial_private), GFP_KERNEL); | 2253 | s_priv = kzalloc(sizeof(struct keyspan_serial_private), GFP_KERNEL); |
2254 | if (!s_priv) { | 2254 | if (!s_priv) { |
2255 | dbg("%s - kmalloc for keyspan_serial_private failed.", __FUNCTION__); | 2255 | dbg("%s - kmalloc for keyspan_serial_private failed.", __FUNCTION__); |
2256 | return -ENOMEM; | 2256 | return -ENOMEM; |
2257 | } | 2257 | } |
2258 | memset(s_priv, 0, sizeof(struct keyspan_serial_private)); | ||
2259 | 2258 | ||
2260 | s_priv->device_details = d_details; | 2259 | s_priv->device_details = d_details; |
2261 | usb_set_serial_data(serial, s_priv); | 2260 | usb_set_serial_data(serial, s_priv); |
@@ -2263,12 +2262,11 @@ static int keyspan_startup (struct usb_serial *serial) | |||
2263 | /* Now setup per port private data */ | 2262 | /* Now setup per port private data */ |
2264 | for (i = 0; i < serial->num_ports; i++) { | 2263 | for (i = 0; i < serial->num_ports; i++) { |
2265 | port = serial->port[i]; | 2264 | port = serial->port[i]; |
2266 | p_priv = kmalloc(sizeof(struct keyspan_port_private), GFP_KERNEL); | 2265 | p_priv = kzalloc(sizeof(struct keyspan_port_private), GFP_KERNEL); |
2267 | if (!p_priv) { | 2266 | if (!p_priv) { |
2268 | dbg("%s - kmalloc for keyspan_port_private (%d) failed!.", __FUNCTION__, i); | 2267 | dbg("%s - kmalloc for keyspan_port_private (%d) failed!.", __FUNCTION__, i); |
2269 | return (1); | 2268 | return (1); |
2270 | } | 2269 | } |
2271 | memset(p_priv, 0, sizeof(struct keyspan_port_private)); | ||
2272 | p_priv->device_details = d_details; | 2270 | p_priv->device_details = d_details; |
2273 | usb_set_serial_port_data(port, p_priv); | 2271 | usb_set_serial_port_data(port, p_priv); |
2274 | } | 2272 | } |
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index b8b213185d0f..87dfcd89ffab 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -255,11 +255,9 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | // allocate memory for transfer buffer | 257 | // allocate memory for transfer buffer |
258 | transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); | 258 | transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); |
259 | if (! transfer_buffer) { | 259 | if (! transfer_buffer) { |
260 | return -ENOMEM; | 260 | return -ENOMEM; |
261 | } else { | ||
262 | memset(transfer_buffer, 0, transfer_buffer_length); | ||
263 | } | 261 | } |
264 | 262 | ||
265 | // allocate write_urb | 263 | // allocate write_urb |
@@ -383,11 +381,10 @@ static void kobil_read_int_callback( struct urb *purb, struct pt_regs *regs) | |||
383 | 381 | ||
384 | // BEGIN DEBUG | 382 | // BEGIN DEBUG |
385 | /* | 383 | /* |
386 | dbg_data = (unsigned char *) kmalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); | 384 | dbg_data = kzalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); |
387 | if (! dbg_data) { | 385 | if (! dbg_data) { |
388 | return; | 386 | return; |
389 | } | 387 | } |
390 | memset(dbg_data, 0, (3 * purb->actual_length + 10)); | ||
391 | for (i = 0; i < purb->actual_length; i++) { | 388 | for (i = 0; i < purb->actual_length; i++) { |
392 | sprintf(dbg_data +3*i, "%02X ", data[i]); | 389 | sprintf(dbg_data +3*i, "%02X ", data[i]); |
393 | } | 390 | } |
@@ -518,11 +515,10 @@ static int kobil_tiocmget(struct usb_serial_port *port, struct file *file) | |||
518 | } | 515 | } |
519 | 516 | ||
520 | // allocate memory for transfer buffer | 517 | // allocate memory for transfer buffer |
521 | transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); | 518 | transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); |
522 | if (!transfer_buffer) { | 519 | if (!transfer_buffer) { |
523 | return -ENOMEM; | 520 | return -ENOMEM; |
524 | } | 521 | } |
525 | memset(transfer_buffer, 0, transfer_buffer_length); | ||
526 | 522 | ||
527 | result = usb_control_msg( port->serial->dev, | 523 | result = usb_control_msg( port->serial->dev, |
528 | usb_rcvctrlpipe(port->serial->dev, 0 ), | 524 | usb_rcvctrlpipe(port->serial->dev, 0 ), |
@@ -564,11 +560,10 @@ static int kobil_tiocmset(struct usb_serial_port *port, struct file *file, | |||
564 | } | 560 | } |
565 | 561 | ||
566 | // allocate memory for transfer buffer | 562 | // allocate memory for transfer buffer |
567 | transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); | 563 | transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); |
568 | if (! transfer_buffer) { | 564 | if (! transfer_buffer) { |
569 | return -ENOMEM; | 565 | return -ENOMEM; |
570 | } | 566 | } |
571 | memset(transfer_buffer, 0, transfer_buffer_length); | ||
572 | 567 | ||
573 | if (set & TIOCM_RTS) | 568 | if (set & TIOCM_RTS) |
574 | rts = 1; | 569 | rts = 1; |
@@ -655,11 +650,10 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file, | |||
655 | (struct termios __user *)arg)) | 650 | (struct termios __user *)arg)) |
656 | return -EFAULT; | 651 | return -EFAULT; |
657 | 652 | ||
658 | settings = (unsigned char *) kmalloc(50, GFP_KERNEL); | 653 | settings = kzalloc(50, GFP_KERNEL); |
659 | if (! settings) { | 654 | if (! settings) { |
660 | return -ENOBUFS; | 655 | return -ENOBUFS; |
661 | } | 656 | } |
662 | memset(settings, 0, 50); | ||
663 | 657 | ||
664 | switch (priv->internal_termios.c_cflag & CBAUD) { | 658 | switch (priv->internal_termios.c_cflag & CBAUD) { |
665 | case B1200: | 659 | case B1200: |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index b6d6cab9c859..35bd29b6c408 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -348,10 +348,9 @@ static int mct_u232_startup (struct usb_serial *serial) | |||
348 | struct mct_u232_private *priv; | 348 | struct mct_u232_private *priv; |
349 | struct usb_serial_port *port, *rport; | 349 | struct usb_serial_port *port, *rport; |
350 | 350 | ||
351 | priv = kmalloc(sizeof(struct mct_u232_private), GFP_KERNEL); | 351 | priv = kzalloc(sizeof(struct mct_u232_private), GFP_KERNEL); |
352 | if (!priv) | 352 | if (!priv) |
353 | return -ENOMEM; | 353 | return -ENOMEM; |
354 | memset(priv, 0, sizeof(struct mct_u232_private)); | ||
355 | spin_lock_init(&priv->lock); | 354 | spin_lock_init(&priv->lock); |
356 | usb_set_serial_port_data(serial->port[0], priv); | 355 | usb_set_serial_port_data(serial->port[0], priv); |
357 | 356 | ||
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c new file mode 100644 index 000000000000..7f544081032e --- /dev/null +++ b/drivers/usb/serial/navman.c | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * Navman 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 | ||
8 | * version 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/tty_flip.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/usb.h> | ||
17 | #include "usb-serial.h" | ||
18 | |||
19 | static int debug; | ||
20 | |||
21 | static struct usb_device_id id_table [] = { | ||
22 | { USB_DEVICE(0x0a99, 0x0001) }, /* Talon Technology device */ | ||
23 | { }, | ||
24 | }; | ||
25 | MODULE_DEVICE_TABLE(usb, id_table); | ||
26 | |||
27 | static struct usb_driver navman_driver = { | ||
28 | .name = "navman", | ||
29 | .probe = usb_serial_probe, | ||
30 | .disconnect = usb_serial_disconnect, | ||
31 | .id_table = id_table, | ||
32 | .no_dynamic_id = 1, | ||
33 | }; | ||
34 | |||
35 | static void navman_read_int_callback(struct urb *urb, struct pt_regs *regs) | ||
36 | { | ||
37 | struct usb_serial_port *port = urb->context; | ||
38 | unsigned char *data = urb->transfer_buffer; | ||
39 | struct tty_struct *tty; | ||
40 | int result; | ||
41 | |||
42 | switch (urb->status) { | ||
43 | case 0: | ||
44 | /* success */ | ||
45 | break; | ||
46 | case -ECONNRESET: | ||
47 | case -ENOENT: | ||
48 | case -ESHUTDOWN: | ||
49 | /* this urb is terminated, clean up */ | ||
50 | dbg("%s - urb shutting down with status: %d", | ||
51 | __FUNCTION__, urb->status); | ||
52 | return; | ||
53 | default: | ||
54 | dbg("%s - nonzero urb status received: %d", | ||
55 | __FUNCTION__, urb->status); | ||
56 | goto exit; | ||
57 | } | ||
58 | |||
59 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, | ||
60 | urb->actual_length, data); | ||
61 | |||
62 | tty = port->tty; | ||
63 | if (tty && urb->actual_length) { | ||
64 | tty_buffer_request_room(tty, urb->actual_length); | ||
65 | tty_insert_flip_string(tty, data, urb->actual_length); | ||
66 | tty_flip_buffer_push(tty); | ||
67 | } | ||
68 | |||
69 | exit: | ||
70 | result = usb_submit_urb(urb, GFP_ATOMIC); | ||
71 | if (result) | ||
72 | dev_err(&urb->dev->dev, | ||
73 | "%s - Error %d submitting interrupt urb\n", | ||
74 | __FUNCTION__, result); | ||
75 | } | ||
76 | |||
77 | static int navman_open(struct usb_serial_port *port, struct file *filp) | ||
78 | { | ||
79 | int result = 0; | ||
80 | |||
81 | dbg("%s - port %d", __FUNCTION__, port->number); | ||
82 | |||
83 | if (port->interrupt_in_urb) { | ||
84 | dbg("%s - adding interrupt input for treo", __FUNCTION__); | ||
85 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | ||
86 | if (result) | ||
87 | dev_err(&port->dev, | ||
88 | "%s - failed submitting interrupt urb, error %d\n", | ||
89 | __FUNCTION__, result); | ||
90 | } | ||
91 | return result; | ||
92 | } | ||
93 | |||
94 | static void navman_close(struct usb_serial_port *port, struct file *filp) | ||
95 | { | ||
96 | dbg("%s - port %d", __FUNCTION__, port->number); | ||
97 | |||
98 | if (port->interrupt_in_urb) | ||
99 | usb_kill_urb(port->interrupt_in_urb); | ||
100 | } | ||
101 | |||
102 | static int navman_write(struct usb_serial_port *port, | ||
103 | const unsigned char *buf, int count) | ||
104 | { | ||
105 | dbg("%s - port %d", __FUNCTION__, port->number); | ||
106 | |||
107 | /* | ||
108 | * This device can't write any data, only read from the device | ||
109 | * so we just silently eat all data sent to us and say it was | ||
110 | * successfully sent. | ||
111 | * Evil, I know, but do you have a better idea? | ||
112 | */ | ||
113 | |||
114 | return count; | ||
115 | } | ||
116 | |||
117 | static struct usb_serial_driver navman_device = { | ||
118 | .driver = { | ||
119 | .owner = THIS_MODULE, | ||
120 | .name = "navman", | ||
121 | }, | ||
122 | .id_table = id_table, | ||
123 | .num_interrupt_in = NUM_DONT_CARE, | ||
124 | .num_bulk_in = NUM_DONT_CARE, | ||
125 | .num_bulk_out = NUM_DONT_CARE, | ||
126 | .num_ports = 1, | ||
127 | .open = navman_open, | ||
128 | .close = navman_close, | ||
129 | .write = navman_write, | ||
130 | .read_int_callback = navman_read_int_callback, | ||
131 | }; | ||
132 | |||
133 | static int __init navman_init(void) | ||
134 | { | ||
135 | int retval; | ||
136 | |||
137 | retval = usb_serial_register(&navman_device); | ||
138 | if (retval) | ||
139 | return retval; | ||
140 | retval = usb_register(&navman_driver); | ||
141 | if (retval) | ||
142 | usb_serial_deregister(&navman_device); | ||
143 | return retval; | ||
144 | } | ||
145 | |||
146 | static void __exit navman_exit(void) | ||
147 | { | ||
148 | usb_deregister(&navman_driver); | ||
149 | usb_serial_deregister(&navman_device); | ||
150 | } | ||
151 | |||
152 | module_init(navman_init); | ||
153 | module_exit(navman_exit); | ||
154 | MODULE_LICENSE("GPL"); | ||
155 | |||
156 | module_param(debug, bool, S_IRUGO | S_IWUSR); | ||
157 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | ||
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 762d8ff9a1e4..4d40704dea2c 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -204,7 +204,7 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs) | |||
204 | int i; | 204 | int i; |
205 | int result; | 205 | int result; |
206 | 206 | ||
207 | // dbg("omninet_read_bulk_callback"); | 207 | dbg("%s - port %d", __FUNCTION__, port->number); |
208 | 208 | ||
209 | if (urb->status) { | 209 | if (urb->status) { |
210 | dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); | 210 | dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); |
@@ -250,7 +250,7 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf | |||
250 | 250 | ||
251 | int result; | 251 | int result; |
252 | 252 | ||
253 | // dbg("omninet_write port %d", port->number); | 253 | dbg("%s - port %d", __FUNCTION__, port->number); |
254 | 254 | ||
255 | if (count == 0) { | 255 | if (count == 0) { |
256 | dbg("%s - write request of 0 bytes", __FUNCTION__); | 256 | dbg("%s - write request of 0 bytes", __FUNCTION__); |
@@ -302,7 +302,7 @@ static int omninet_write_room (struct usb_serial_port *port) | |||
302 | if (wport->write_urb_busy) | 302 | if (wport->write_urb_busy) |
303 | room = wport->bulk_out_size - OMNINET_HEADERLEN; | 303 | room = wport->bulk_out_size - OMNINET_HEADERLEN; |
304 | 304 | ||
305 | // dbg("omninet_write_room returns %d", room); | 305 | dbg("%s - returns %d", __FUNCTION__, room); |
306 | 306 | ||
307 | return (room); | 307 | return (room); |
308 | } | 308 | } |
@@ -312,7 +312,7 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs) | |||
312 | /* struct omninet_header *header = (struct omninet_header *) urb->transfer_buffer; */ | 312 | /* struct omninet_header *header = (struct omninet_header *) urb->transfer_buffer; */ |
313 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; | 313 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; |
314 | 314 | ||
315 | // dbg("omninet_write_bulk_callback, port %0x\n", port); | 315 | dbg("%s - port %0x\n", __FUNCTION__, port->number); |
316 | 316 | ||
317 | port->write_urb_busy = 0; | 317 | port->write_urb_busy = 0; |
318 | if (urb->status) { | 318 | if (urb->status) { |
@@ -321,8 +321,6 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | schedule_work(&port->work); | 323 | schedule_work(&port->work); |
324 | |||
325 | // dbg("omninet_write_bulk_callback, tty %0x\n", tty); | ||
326 | } | 324 | } |
327 | 325 | ||
328 | 326 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 52bdf6fe46f2..a8455c9e79dd 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -631,13 +631,12 @@ static int option_startup(struct usb_serial *serial) | |||
631 | /* Now setup per port private data */ | 631 | /* Now setup per port private data */ |
632 | for (i = 0; i < serial->num_ports; i++) { | 632 | for (i = 0; i < serial->num_ports; i++) { |
633 | port = serial->port[i]; | 633 | port = serial->port[i]; |
634 | portdata = kmalloc(sizeof(*portdata), GFP_KERNEL); | 634 | portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
635 | if (!portdata) { | 635 | if (!portdata) { |
636 | dbg("%s: kmalloc for option_port_private (%d) failed!.", | 636 | dbg("%s: kmalloc for option_port_private (%d) failed!.", |
637 | __FUNCTION__, i); | 637 | __FUNCTION__, i); |
638 | return (1); | 638 | return (1); |
639 | } | 639 | } |
640 | memset(portdata, 0, sizeof(struct option_port_private)); | ||
641 | 640 | ||
642 | usb_set_serial_port_data(port, portdata); | 641 | usb_set_serial_port_data(port, portdata); |
643 | 642 | ||
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 37c81c08faad..b3014fda645c 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -77,6 +77,7 @@ static struct usb_device_id id_table [] = { | |||
77 | { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID) }, | 77 | { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID) }, |
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 | { } /* Terminating entry */ | 81 | { } /* Terminating entry */ |
81 | }; | 82 | }; |
82 | 83 | ||
@@ -218,10 +219,9 @@ static int pl2303_startup (struct usb_serial *serial) | |||
218 | dbg("device type: %d", type); | 219 | dbg("device type: %d", type); |
219 | 220 | ||
220 | for (i = 0; i < serial->num_ports; ++i) { | 221 | for (i = 0; i < serial->num_ports; ++i) { |
221 | priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL); | 222 | priv = kzalloc(sizeof(struct pl2303_private), GFP_KERNEL); |
222 | if (!priv) | 223 | if (!priv) |
223 | goto cleanup; | 224 | goto cleanup; |
224 | memset (priv, 0x00, sizeof (struct pl2303_private)); | ||
225 | spin_lock_init(&priv->lock); | 225 | spin_lock_init(&priv->lock); |
226 | priv->buf = pl2303_buf_alloc(PL2303_BUF_SIZE); | 226 | priv->buf = pl2303_buf_alloc(PL2303_BUF_SIZE); |
227 | if (priv->buf == NULL) { | 227 | if (priv->buf == NULL) { |
@@ -383,12 +383,11 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol | |||
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | buf = kmalloc (7, GFP_KERNEL); | 386 | buf = kzalloc (7, GFP_KERNEL); |
387 | if (!buf) { | 387 | if (!buf) { |
388 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); | 388 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); |
389 | return; | 389 | return; |
390 | } | 390 | } |
391 | memset (buf, 0x00, 0x07); | ||
392 | 391 | ||
393 | i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0), | 392 | i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0), |
394 | GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE, | 393 | GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE, |
@@ -828,6 +827,7 @@ static void pl2303_update_line_status(struct usb_serial_port *port, | |||
828 | spin_lock_irqsave(&priv->lock, flags); | 827 | spin_lock_irqsave(&priv->lock, flags); |
829 | priv->line_status = data[status_idx]; | 828 | priv->line_status = data[status_idx]; |
830 | spin_unlock_irqrestore(&priv->lock, flags); | 829 | spin_unlock_irqrestore(&priv->lock, flags); |
830 | wake_up_interruptible (&priv->delta_msr_wait); | ||
831 | 831 | ||
832 | exit: | 832 | exit: |
833 | return; | 833 | return; |
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 9bc4755162ad..77901d143979 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -75,3 +75,7 @@ | |||
75 | /* Leadtek GPS 9531 (ID 0413:2101) */ | 75 | /* Leadtek GPS 9531 (ID 0413:2101) */ |
76 | #define LEADTEK_VENDOR_ID 0x0413 | 76 | #define LEADTEK_VENDOR_ID 0x0413 |
77 | #define LEADTEK_9531_PRODUCT_ID 0x2101 | 77 | #define LEADTEK_9531_PRODUCT_ID 0x2101 |
78 | |||
79 | /* USB GSM cable from Speed Dragon Multimedia, Ltd */ | ||
80 | #define SPEEDDRAGON_VENDOR_ID 0x0e55 | ||
81 | #define SPEEDDRAGON_PRODUCT_ID 0x110b | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index c18db3257073..c3a2071b802d 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -416,12 +416,11 @@ static int ti_startup(struct usb_serial *serial) | |||
416 | dev->actconfig->desc.bConfigurationValue); | 416 | dev->actconfig->desc.bConfigurationValue); |
417 | 417 | ||
418 | /* create device structure */ | 418 | /* create device structure */ |
419 | tdev = kmalloc(sizeof(struct ti_device), GFP_KERNEL); | 419 | tdev = kzalloc(sizeof(struct ti_device), GFP_KERNEL); |
420 | if (tdev == NULL) { | 420 | if (tdev == NULL) { |
421 | dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); | 421 | dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); |
422 | return -ENOMEM; | 422 | return -ENOMEM; |
423 | } | 423 | } |
424 | memset(tdev, 0, sizeof(struct ti_device)); | ||
425 | sema_init(&tdev->td_open_close_sem, 1); | 424 | sema_init(&tdev->td_open_close_sem, 1); |
426 | tdev->td_serial = serial; | 425 | tdev->td_serial = serial; |
427 | usb_set_serial_data(serial, tdev); | 426 | usb_set_serial_data(serial, tdev); |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index b5c96e74a903..097f4e8488fe 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -564,12 +564,11 @@ static struct usb_serial * create_serial (struct usb_device *dev, | |||
564 | { | 564 | { |
565 | struct usb_serial *serial; | 565 | struct usb_serial *serial; |
566 | 566 | ||
567 | serial = kmalloc (sizeof (*serial), GFP_KERNEL); | 567 | serial = kzalloc(sizeof(*serial), GFP_KERNEL); |
568 | if (!serial) { | 568 | if (!serial) { |
569 | dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); | 569 | dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); |
570 | return NULL; | 570 | return NULL; |
571 | } | 571 | } |
572 | memset (serial, 0, sizeof(*serial)); | ||
573 | serial->dev = usb_get_dev(dev); | 572 | serial->dev = usb_get_dev(dev); |
574 | serial->type = driver; | 573 | serial->type = driver; |
575 | serial->interface = interface; | 574 | serial->interface = interface; |
@@ -778,10 +777,9 @@ int usb_serial_probe(struct usb_interface *interface, | |||
778 | serial->num_port_pointers = max_endpoints; | 777 | serial->num_port_pointers = max_endpoints; |
779 | dbg("%s - setting up %d port structures for this device", __FUNCTION__, max_endpoints); | 778 | dbg("%s - setting up %d port structures for this device", __FUNCTION__, max_endpoints); |
780 | for (i = 0; i < max_endpoints; ++i) { | 779 | for (i = 0; i < max_endpoints; ++i) { |
781 | port = kmalloc(sizeof(struct usb_serial_port), GFP_KERNEL); | 780 | port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); |
782 | if (!port) | 781 | if (!port) |
783 | goto probe_error; | 782 | goto probe_error; |
784 | memset(port, 0x00, sizeof(struct usb_serial_port)); | ||
785 | port->number = i + serial->minor; | 783 | port->number = i + serial->minor; |
786 | port->serial = serial; | 784 | port->serial = serial; |
787 | spin_lock_init(&port->lock); | 785 | spin_lock_init(&port->lock); |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 11a48d874752..f5c3841d4843 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -763,10 +763,9 @@ static int generic_startup(struct usb_serial *serial) | |||
763 | int i; | 763 | int i; |
764 | 764 | ||
765 | for (i = 0; i < serial->num_ports; ++i) { | 765 | for (i = 0; i < serial->num_ports; ++i) { |
766 | priv = kmalloc (sizeof(*priv), GFP_KERNEL); | 766 | priv = kzalloc (sizeof(*priv), GFP_KERNEL); |
767 | if (!priv) | 767 | if (!priv) |
768 | return -ENOMEM; | 768 | return -ENOMEM; |
769 | memset (priv, 0x00, sizeof(*priv)); | ||
770 | spin_lock_init(&priv->lock); | 769 | spin_lock_init(&priv->lock); |
771 | usb_set_serial_port_data(serial->port[i], priv); | 770 | usb_set_serial_port_data(serial->port[i], priv); |
772 | } | 771 | } |