aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index e3d44ae8d448..ed678811e6a6 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -14,7 +14,7 @@
14 Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org> 14 Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org>
15*/ 15*/
16 16
17#define DRIVER_VERSION "v.1.2.7" 17#define DRIVER_VERSION "v.1.2.8"
18#define DRIVER_AUTHOR "Kevin Lloyd <linux@sierrawireless.com>" 18#define DRIVER_AUTHOR "Kevin Lloyd <linux@sierrawireless.com>"
19#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" 19#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
20 20
@@ -163,6 +163,7 @@ static struct usb_device_id id_table [] = {
163 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ 163 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
164 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ 164 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
165 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */ 165 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */
166 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */
166 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 167 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
167 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/ 168 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
168 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/ 169 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
@@ -196,9 +197,9 @@ struct sierra_port_private {
196 spinlock_t lock; /* lock the structure */ 197 spinlock_t lock; /* lock the structure */
197 int outstanding_urbs; /* number of out urbs in flight */ 198 int outstanding_urbs; /* number of out urbs in flight */
198 199
199 /* Input endpoints and buffer for this port */ 200 /* Input endpoints and buffers for this port */
200 struct urb *in_urbs[N_IN_URB]; 201 struct urb *in_urbs[N_IN_URB];
201 char in_buffer[N_IN_URB][IN_BUFLEN]; 202 char *in_buffer[N_IN_URB];
202 203
203 /* Settings for the port */ 204 /* Settings for the port */
204 int rts_state; /* Handshaking pins (outputs) */ 205 int rts_state; /* Handshaking pins (outputs) */
@@ -638,6 +639,15 @@ static int sierra_startup(struct usb_serial *serial)
638 return -ENOMEM; 639 return -ENOMEM;
639 } 640 }
640 spin_lock_init(&portdata->lock); 641 spin_lock_init(&portdata->lock);
642 for (j = 0; j < N_IN_URB; j++) {
643 portdata->in_buffer[j] = kmalloc(IN_BUFLEN, GFP_KERNEL);
644 if (!portdata->in_buffer[j]) {
645 for (--j; j >= 0; j--)
646 kfree(portdata->in_buffer[j]);
647 kfree(portdata);
648 return -ENOMEM;
649 }
650 }
641 651
642 usb_set_serial_port_data(port, portdata); 652 usb_set_serial_port_data(port, portdata);
643 653
@@ -681,7 +691,7 @@ static void sierra_shutdown(struct usb_serial *serial)
681 for (j = 0; j < N_IN_URB; j++) { 691 for (j = 0; j < N_IN_URB; j++) {
682 usb_kill_urb(portdata->in_urbs[j]); 692 usb_kill_urb(portdata->in_urbs[j]);
683 usb_free_urb(portdata->in_urbs[j]); 693 usb_free_urb(portdata->in_urbs[j]);
684 portdata->in_urbs[j] = NULL; 694 kfree(portdata->in_buffer[j]);
685 } 695 }
686 kfree(portdata); 696 kfree(portdata);
687 usb_set_serial_port_data(port, NULL); 697 usb_set_serial_port_data(port, NULL);