aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r--drivers/usb/serial/option.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 5e8bf1bc1e50..af2674c57414 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -113,6 +113,9 @@ static int option_send_setup(struct usb_serial_port *port);
113#define NOVATELWIRELESS_VENDOR_ID 0x1410 113#define NOVATELWIRELESS_VENDOR_ID 0x1410
114#define DELL_VENDOR_ID 0x413C 114#define DELL_VENDOR_ID 0x413C
115 115
116#define KYOCERA_VENDOR_ID 0x0c88
117#define KYOCERA_PRODUCT_KPC680 0x180a
118
116#define ANYDATA_VENDOR_ID 0x16d5 119#define ANYDATA_VENDOR_ID 0x16d5
117#define ANYDATA_PRODUCT_ADU_E100A 0x6501 120#define ANYDATA_PRODUCT_ADU_E100A 0x6501
118#define ANYDATA_PRODUCT_ADU_500A 0x6502 121#define ANYDATA_PRODUCT_ADU_500A 0x6502
@@ -121,6 +124,8 @@ static int option_send_setup(struct usb_serial_port *port);
121#define BANDRICH_PRODUCT_C100_1 0x1002 124#define BANDRICH_PRODUCT_C100_1 0x1002
122#define BANDRICH_PRODUCT_C100_2 0x1003 125#define BANDRICH_PRODUCT_C100_2 0x1003
123 126
127#define QUALCOMM_VENDOR_ID 0x05C6
128
124static struct usb_device_id option_ids[] = { 129static struct usb_device_id option_ids[] = {
125 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 130 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
126 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 131 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -174,18 +179,23 @@ static struct usb_device_id option_ids[] = {
174 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ 179 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */
175 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4100) }, /* Novatel U727 */ 180 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4100) }, /* Novatel U727 */
176 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4400) }, /* Novatel MC950 */ 181 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4400) }, /* Novatel MC950 */
182 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x5010) }, /* Novatel U727 */
177 { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ 183 { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
178 { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 184 { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
179 { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 185 { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
180 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ 186 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
181 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ 187 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
182 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ 188 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
189 { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
190 { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
183 { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ 191 { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
184 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ 192 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
185 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, 193 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
186 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 194 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
187 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 195 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
188 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 196 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
197 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
198 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
189 { } /* Terminating entry */ 199 { } /* Terminating entry */
190}; 200};
191MODULE_DEVICE_TABLE(usb, option_ids); 201MODULE_DEVICE_TABLE(usb, option_ids);
@@ -247,10 +257,10 @@ static int debug;
247struct option_port_private { 257struct option_port_private {
248 /* Input endpoints and buffer for this port */ 258 /* Input endpoints and buffer for this port */
249 struct urb *in_urbs[N_IN_URB]; 259 struct urb *in_urbs[N_IN_URB];
250 char in_buffer[N_IN_URB][IN_BUFLEN]; 260 u8 *in_buffer[N_IN_URB];
251 /* Output endpoints and buffer for this port */ 261 /* Output endpoints and buffer for this port */
252 struct urb *out_urbs[N_OUT_URB]; 262 struct urb *out_urbs[N_OUT_URB];
253 char out_buffer[N_OUT_URB][OUT_BUFLEN]; 263 u8 *out_buffer[N_OUT_URB];
254 unsigned long out_busy; /* Bit vector of URBs in use */ 264 unsigned long out_busy; /* Bit vector of URBs in use */
255 265
256 /* Settings for the port */ 266 /* Settings for the port */
@@ -737,9 +747,10 @@ static int option_send_setup(struct usb_serial_port *port)
737 747
738static int option_startup(struct usb_serial *serial) 748static int option_startup(struct usb_serial *serial)
739{ 749{
740 int i, err; 750 int i, j, err;
741 struct usb_serial_port *port; 751 struct usb_serial_port *port;
742 struct option_port_private *portdata; 752 struct option_port_private *portdata;
753 u8 *buffer;
743 754
744 dbg("%s", __FUNCTION__); 755 dbg("%s", __FUNCTION__);
745 756
@@ -753,6 +764,20 @@ static int option_startup(struct usb_serial *serial)
753 return (1); 764 return (1);
754 } 765 }
755 766
767 for (j = 0; j < N_IN_URB; j++) {
768 buffer = (u8 *)__get_free_page(GFP_KERNEL);
769 if (!buffer)
770 goto bail_out_error;
771 portdata->in_buffer[j] = buffer;
772 }
773
774 for (j = 0; j < N_OUT_URB; j++) {
775 buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
776 if (!buffer)
777 goto bail_out_error2;
778 portdata->out_buffer[j] = buffer;
779 }
780
756 usb_set_serial_port_data(port, portdata); 781 usb_set_serial_port_data(port, portdata);
757 782
758 if (! port->interrupt_in_urb) 783 if (! port->interrupt_in_urb)
@@ -766,6 +791,16 @@ static int option_startup(struct usb_serial *serial)
766 option_setup_urbs(serial); 791 option_setup_urbs(serial);
767 792
768 return (0); 793 return (0);
794
795bail_out_error2:
796 for (j = 0; j < N_OUT_URB; j++)
797 kfree(portdata->out_buffer[j]);
798bail_out_error:
799 for (j = 0; j < N_IN_URB; j++)
800 if (portdata->in_buffer[j])
801 free_page((unsigned long)portdata->in_buffer[j]);
802 kfree(portdata);
803 return 1;
769} 804}
770 805
771static void option_shutdown(struct usb_serial *serial) 806static void option_shutdown(struct usb_serial *serial)
@@ -794,12 +829,14 @@ static void option_shutdown(struct usb_serial *serial)
794 for (j = 0; j < N_IN_URB; j++) { 829 for (j = 0; j < N_IN_URB; j++) {
795 if (portdata->in_urbs[j]) { 830 if (portdata->in_urbs[j]) {
796 usb_free_urb(portdata->in_urbs[j]); 831 usb_free_urb(portdata->in_urbs[j]);
832 free_page((unsigned long)portdata->in_buffer[j]);
797 portdata->in_urbs[j] = NULL; 833 portdata->in_urbs[j] = NULL;
798 } 834 }
799 } 835 }
800 for (j = 0; j < N_OUT_URB; j++) { 836 for (j = 0; j < N_OUT_URB; j++) {
801 if (portdata->out_urbs[j]) { 837 if (portdata->out_urbs[j]) {
802 usb_free_urb(portdata->out_urbs[j]); 838 usb_free_urb(portdata->out_urbs[j]);
839 kfree(portdata->out_buffer[j]);
803 portdata->out_urbs[j] = NULL; 840 portdata->out_urbs[j] = NULL;
804 } 841 }
805 } 842 }