diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org.(none)> | 2005-04-19 07:28:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org.(none)> | 2005-04-19 07:28:57 -0700 |
commit | a9e4820c4c170b3df0d2185f7b4130b0b2daed2c (patch) | |
tree | 962bc52ba0e8e585d88e1fb9a9be9a67072767dd /drivers/usb/serial | |
parent | c0698f2f6e4839ce9463ce731c892993215ea067 (diff) | |
parent | e838a0d4d5260bce452c96914a6e86b217c53c55 (diff) |
Merge with Greg's USB tree at kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/
Yah, it does work to merge. Knock wood.
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/belkin_sa.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/empeg.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 24 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/kl5kusb105.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/omninet.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.c | 55 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.h | 3 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/visor.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/visor.h | 4 |
14 files changed, 78 insertions, 64 deletions
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 86994d117c4..abb1b2c543b 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -202,8 +202,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial) for (i=0; i < serial->num_ports; ++i) { /* My special items, the standard routines free my urbs */ priv = usb_get_serial_port_data(serial->port[i]); - if (priv) - kfree(priv); + kfree(priv); } } diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index db8f472d9e3..d165f42d560 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -1340,9 +1340,8 @@ static struct cypress_buf *cypress_buf_alloc(unsigned int size) static void cypress_buf_free(struct cypress_buf *cb) { - if (cb != NULL) { - if (cb->buf_buf != NULL) - kfree(cb->buf_buf); + if (cb) { + kfree(cb->buf_buf); kfree(cb); } } diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 25f92788a6d..a19a47f6cf1 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -568,6 +568,9 @@ static struct usb_serial_device_type digi_acceleport_4_device = { * and the sleep. In other words, spin_unlock_irqrestore and * interruptible_sleep_on_timeout are "atomic" with respect to * wake ups. This is used to implement condition variables. +* +* interruptible_sleep_on_timeout is deprecated and has been replaced +* with the equivalent code. */ static inline long cond_wait_interruptible_timeout_irqrestore( @@ -576,13 +579,12 @@ static inline long cond_wait_interruptible_timeout_irqrestore( { DEFINE_WAIT(wait); - prepare_to_wait(q, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE); spin_unlock_irqrestore(lock, flags); timeout = schedule_timeout(timeout); finish_wait(q, &wait); return timeout; - } @@ -1596,7 +1598,7 @@ dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_co dbg( "digi_close: write oob failed, ret=%d", ret ); /* wait for final commands on oob port to complete */ - prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_INTERRUPTIBLE); schedule_timeout(DIGI_CLOSE_TIMEOUT); finish_wait(&priv->dp_flush_wait, &wait); @@ -1995,7 +1997,7 @@ opcode, line, status, val ); } else if( opcode == DIGI_CMD_IFLUSH_FIFO ) { - wake_up( &priv->dp_flush_wait ); + wake_up_interruptible( &priv->dp_flush_wait ); } diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 4d46394f351..8d562ab454a 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -550,8 +550,7 @@ failed_usb_register: failed_usb_serial_register: for (i = 0; i < NUM_URBS; ++i) { if (write_urb_pool[i]) { - if (write_urb_pool[i]->transfer_buffer) - kfree(write_urb_pool[i]->transfer_buffer); + kfree(write_urb_pool[i]->transfer_buffer); usb_free_urb(write_urb_pool[i]); } } @@ -575,8 +574,7 @@ static void __exit empeg_exit (void) * the host controllers get fixed to set urb->dev = NULL after * the urb is finished. Otherwise this call oopses. */ /* usb_kill_urb(write_urb_pool[i]); */ - if (write_urb_pool[i]->transfer_buffer) - kfree(write_urb_pool[i]->transfer_buffer); + kfree(write_urb_pool[i]->transfer_buffer); usb_free_urb (write_urb_pool[i]); } } diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 4afd905fe2f..4c788c767a9 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1347,9 +1347,7 @@ static int ftdi_common_startup (struct usb_serial *serial) priv->flags = ASYNC_LOW_LATENCY; /* Increase the size of read buffers */ - if (port->bulk_in_buffer) { - kfree (port->bulk_in_buffer); - } + kfree(port->bulk_in_buffer); port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL); if (!port->bulk_in_buffer) { kfree (priv); @@ -1365,10 +1363,8 @@ static int ftdi_common_startup (struct usb_serial *serial) usb_free_urb (port->write_urb); port->write_urb = NULL; } - if (port->bulk_out_buffer) { - kfree (port->bulk_out_buffer); - port->bulk_out_buffer = NULL; - } + kfree(port->bulk_out_buffer); + port->bulk_out_buffer = NULL; usb_set_serial_port_data(serial->port[0], priv); diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index e35b5adcd5f..04bfe279d76 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -951,9 +951,7 @@ static void edge_bulk_out_cmd_callback (struct urb *urb, struct pt_regs *regs) /* clean up the transfer buffer */ - if (urb->transfer_buffer != NULL) { - kfree(urb->transfer_buffer); - } + kfree(urb->transfer_buffer); /* Free the command urb */ usb_free_urb (urb); @@ -1266,16 +1264,12 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) if (edge_port->write_urb) { /* if this urb had a transfer buffer already (old transfer) free it */ - if (edge_port->write_urb->transfer_buffer != NULL) { - kfree(edge_port->write_urb->transfer_buffer); - } - usb_free_urb (edge_port->write_urb); + kfree(edge_port->write_urb->transfer_buffer); + usb_free_urb(edge_port->write_urb); edge_port->write_urb = NULL; } - if (edge_port->txfifo.fifo) { - kfree(edge_port->txfifo.fifo); - edge_port->txfifo.fifo = NULL; - } + kfree(edge_port->txfifo.fifo); + edge_port->txfifo.fifo = NULL; dbg("%s exited", __FUNCTION__); } @@ -1419,11 +1413,9 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge // get a pointer to the write_urb urb = edge_port->write_urb; - /* if this urb had a transfer buffer already (old transfer) free it */ - if (urb->transfer_buffer != NULL) { - kfree(urb->transfer_buffer); - urb->transfer_buffer = NULL; - } + /* make sure transfer buffer is freed */ + kfree(urb->transfer_buffer); + urb->transfer_buffer = NULL; /* build the data header for the buffer and port that we are about to send out */ count = fifo->count; diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 6c96fdaec36..ebf9967f7c8 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -2845,9 +2845,8 @@ static struct edge_buf *edge_buf_alloc(unsigned int size) void edge_buf_free(struct edge_buf *eb) { - if (eb != NULL) { - if (eb->buf_buf != NULL) - kfree(eb->buf_buf); + if (eb) { + kfree(eb->buf_buf); kfree(eb); } } diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index 49c602a0b4d..a11e829e38c 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -341,8 +341,7 @@ static void klsi_105_shutdown (struct usb_serial *serial) * finished. Otherwise this call * oopses. */ /* usb_kill_urb(write_urbs[j]); */ - if (write_urbs[j]->transfer_buffer) - kfree(write_urbs[j]->transfer_buffer); + kfree(write_urbs[j]->transfer_buffer); usb_free_urb (write_urbs[j]); } } diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index a1cba4b5fa2..b5f2c06d4f3 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -178,7 +178,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp) { struct usb_serial *serial = port->serial; struct usb_serial_port *wport; - struct omninet_data *od; dbg("%s - port %d", __FUNCTION__, port->number); @@ -186,9 +185,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp) usb_kill_urb(wport->write_urb); usb_kill_urb(port->read_urb); - od = usb_get_serial_port_data(port); - if (od) - kfree(od); + kfree(usb_get_serial_port_data(port)); } diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 3368d2b0412..7eab5d4cf3a 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -94,6 +94,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) }, { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) }, { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) }, + { USB_DEVICE(SYNTECH_VENDOR_ID, SYNTECH_PRODUCT_ID) }, { } /* Terminating entry */ }; @@ -677,6 +678,9 @@ static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file, unsigned long flags; u8 control; + if (!usb_get_intfdata(port->serial->interface)) + return -ENODEV; + spin_lock_irqsave (&priv->lock, flags); if (set & TIOCM_RTS) priv->line_control |= CONTROL_RTS; @@ -702,6 +706,9 @@ static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file) dbg("%s (%d)", __FUNCTION__, port->number); + if (!usb_get_intfdata(port->serial->interface)) + return -ENODEV; + spin_lock_irqsave (&priv->lock, flags); mcr = priv->line_control; status = priv->line_status; @@ -811,15 +818,40 @@ static void pl2303_shutdown (struct usb_serial *serial) } } +static void pl2303_update_line_status(struct usb_serial_port *port, + unsigned char *data, + unsigned int actual_length) +{ + + struct pl2303_private *priv = usb_get_serial_port_data(port); + unsigned long flags; + u8 status_idx = UART_STATE; + u8 length = UART_STATE; + + if ((le16_to_cpu(port->serial->dev->descriptor.idVendor) == SIEMENS_VENDOR_ID) && + (le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X65)) { + length = 1; + status_idx = 0; + } + + if (actual_length < length) + goto exit; + + /* Save off the uart status for others to look at */ + spin_lock_irqsave(&priv->lock, flags); + priv->line_status = data[status_idx]; + spin_unlock_irqrestore(&priv->lock, flags); + +exit: + return; +} static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs) { struct usb_serial_port *port = (struct usb_serial_port *) urb->context; - struct pl2303_private *priv = usb_get_serial_port_data(port); unsigned char *data = urb->transfer_buffer; - unsigned long flags; + unsigned int actual_length = urb->actual_length; int status; - u8 uart_state; dbg("%s (%d)", __FUNCTION__, port->number); @@ -838,19 +870,9 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs) goto exit; } - usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, urb->transfer_buffer); + pl2303_update_line_status(port, data, actual_length); - if (urb->actual_length < UART_STATE) - goto exit; - - /* Save off the uart status for others to look at */ - uart_state = data[UART_STATE]; - spin_lock_irqsave(&priv->lock, flags); - uart_state |= (priv->line_status & UART_STATE_TRANSIENT_MASK); - priv->line_status = uart_state; - spin_unlock_irqrestore(&priv->lock, flags); - exit: status = usb_submit_urb (urb, GFP_ATOMIC); if (status) @@ -1022,9 +1044,8 @@ static struct pl2303_buf *pl2303_buf_alloc(unsigned int size) static void pl2303_buf_free(struct pl2303_buf *pb) { - if (pb != NULL) { - if (pb->buf_buf != NULL) - kfree(pb->buf_buf); + if (pb) { + kfree(pb->buf_buf); kfree(pb); } } diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 6c1b4712dc2..b734c4003c5 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -55,3 +55,6 @@ #define SIEMENS_VENDOR_ID 0x11f5 #define SIEMENS_PRODUCT_ID_X65 0x0003 + +#define SYNTECH_VENDOR_ID 0x0745 +#define SYNTECH_PRODUCT_ID 0x0001 diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 98054876cca..59c88de3e7a 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -517,8 +517,7 @@ static void ti_shutdown(struct usb_serial *serial) } } - if (tdev) - kfree(tdev); + kfree(tdev); usb_set_serial_data(serial, NULL); } diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 69d313e98fa..31c57adcb62 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -215,6 +215,8 @@ static struct usb_device_id id_table [] = { .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_T_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_TREO_650), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID), @@ -237,6 +239,8 @@ static struct usb_device_id id_table [] = { .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(TAPWAVE_VENDOR_ID, TAPWAVE_ZODIAC_ID), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID), @@ -273,6 +277,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(PALM_VENDOR_ID, PALM_M125_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M130_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_T_ID) }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_TREO_650) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE_ID) }, @@ -286,6 +291,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID) }, { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID) }, { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID) }, + { USB_DEVICE(TAPWAVE_VENDOR_ID, TAPWAVE_ZODIAC_ID) }, { USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID) }, { USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID) }, { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_7135_ID) }, diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h index a2fa2c61a00..b84d1cb4c69 100644 --- a/drivers/usb/serial/visor.h +++ b/drivers/usb/serial/visor.h @@ -30,6 +30,7 @@ #define PALM_M125_ID 0x0040 #define PALM_M130_ID 0x0050 #define PALM_TUNGSTEN_T_ID 0x0060 +#define PALM_TREO_650 0x0061 #define PALM_TUNGSTEN_Z_ID 0x0031 #define PALM_ZIRE31_ID 0x0061 #define PALM_ZIRE_ID 0x0070 @@ -49,6 +50,9 @@ #define SAMSUNG_SCH_I330_ID 0x8001 #define SAMSUNG_SPH_I500_ID 0x6601 +#define TAPWAVE_VENDOR_ID 0x12EF +#define TAPWAVE_ZODIAC_ID 0x0100 + #define GARMIN_VENDOR_ID 0x091E #define GARMIN_IQUE_3600_ID 0x0004 |