diff options
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 176 |
1 files changed, 159 insertions, 17 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5e8bf1bc1e50..d101025a4c63 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -109,18 +109,92 @@ static int option_send_setup(struct usb_serial_port *port); | |||
109 | #define HUAWEI_PRODUCT_E600 0x1001 | 109 | #define HUAWEI_PRODUCT_E600 0x1001 |
110 | #define HUAWEI_PRODUCT_E220 0x1003 | 110 | #define HUAWEI_PRODUCT_E220 0x1003 |
111 | #define HUAWEI_PRODUCT_E220BIS 0x1004 | 111 | #define HUAWEI_PRODUCT_E220BIS 0x1004 |
112 | #define HUAWEI_PRODUCT_E1401 0x1401 | ||
113 | #define HUAWEI_PRODUCT_E1403 0x1403 | ||
114 | #define HUAWEI_PRODUCT_E1405 0x1405 | ||
115 | #define HUAWEI_PRODUCT_E1406 0x1406 | ||
116 | #define HUAWEI_PRODUCT_E1408 0x1408 | ||
117 | #define HUAWEI_PRODUCT_E1409 0x1409 | ||
118 | #define HUAWEI_PRODUCT_E1410 0x1410 | ||
119 | #define HUAWEI_PRODUCT_E1411 0x1411 | ||
120 | #define HUAWEI_PRODUCT_E1412 0x1412 | ||
121 | #define HUAWEI_PRODUCT_E1413 0x1413 | ||
122 | #define HUAWEI_PRODUCT_E1414 0x1414 | ||
123 | #define HUAWEI_PRODUCT_E1415 0x1415 | ||
124 | #define HUAWEI_PRODUCT_E1416 0x1416 | ||
125 | #define HUAWEI_PRODUCT_E1417 0x1417 | ||
126 | #define HUAWEI_PRODUCT_E1418 0x1418 | ||
127 | #define HUAWEI_PRODUCT_E1419 0x1419 | ||
112 | 128 | ||
113 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 129 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
130 | |||
131 | /* MERLIN EVDO PRODUCTS */ | ||
132 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 | ||
133 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 | ||
134 | #define NOVATELWIRELESS_PRODUCT_V740 0x1120 | ||
135 | #define NOVATELWIRELESS_PRODUCT_V720 0x1130 | ||
136 | |||
137 | /* MERLIN HSDPA/HSPA PRODUCTS */ | ||
138 | #define NOVATELWIRELESS_PRODUCT_U730 0x1400 | ||
139 | #define NOVATELWIRELESS_PRODUCT_U740 0x1410 | ||
140 | #define NOVATELWIRELESS_PRODUCT_U870 0x1420 | ||
141 | #define NOVATELWIRELESS_PRODUCT_XU870 0x1430 | ||
142 | #define NOVATELWIRELESS_PRODUCT_X950D 0x1450 | ||
143 | |||
144 | /* EXPEDITE PRODUCTS */ | ||
145 | #define NOVATELWIRELESS_PRODUCT_EV620 0x2100 | ||
146 | #define NOVATELWIRELESS_PRODUCT_ES720 0x2110 | ||
147 | #define NOVATELWIRELESS_PRODUCT_E725 0x2120 | ||
148 | #define NOVATELWIRELESS_PRODUCT_ES620 0x2130 | ||
149 | #define NOVATELWIRELESS_PRODUCT_EU730 0x2400 | ||
150 | #define NOVATELWIRELESS_PRODUCT_EU740 0x2410 | ||
151 | #define NOVATELWIRELESS_PRODUCT_EU870D 0x2420 | ||
152 | |||
153 | /* OVATION PRODUCTS */ | ||
154 | #define NOVATELWIRELESS_PRODUCT_MC727 0x4100 | ||
155 | #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 | ||
156 | |||
157 | #define NOVATELWIRELESS_PRODUCT_U727 0x5010 | ||
158 | |||
159 | /* FUTURE NOVATEL PRODUCTS */ | ||
160 | #define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000 | ||
161 | #define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000 | ||
162 | #define NOVATELWIRELESS_PRODUCT_EMBEDDED_1 0x8000 | ||
163 | #define NOVATELWIRELESS_PRODUCT_GLOBAL_1 0x9000 | ||
164 | #define NOVATELWIRELESS_PRODUCT_EVDO_2 0x6001 | ||
165 | #define NOVATELWIRELESS_PRODUCT_HSPA_2 0x7001 | ||
166 | #define NOVATELWIRELESS_PRODUCT_EMBEDDED_2 0x8001 | ||
167 | #define NOVATELWIRELESS_PRODUCT_GLOBAL_2 0x9001 | ||
168 | |||
169 | /* AMOI PRODUCTS */ | ||
170 | #define AMOI_VENDOR_ID 0x1614 | ||
171 | #define AMOI_PRODUCT_H01 0x0800 | ||
172 | #define AMOI_PRODUCT_H01A 0x7002 | ||
173 | #define AMOI_PRODUCT_H02 0x0802 | ||
174 | |||
114 | #define DELL_VENDOR_ID 0x413C | 175 | #define DELL_VENDOR_ID 0x413C |
115 | 176 | ||
177 | #define KYOCERA_VENDOR_ID 0x0c88 | ||
178 | #define KYOCERA_PRODUCT_KPC680 0x180a | ||
179 | |||
116 | #define ANYDATA_VENDOR_ID 0x16d5 | 180 | #define ANYDATA_VENDOR_ID 0x16d5 |
117 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 | 181 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 |
118 | #define ANYDATA_PRODUCT_ADU_500A 0x6502 | 182 | #define ANYDATA_PRODUCT_ADU_500A 0x6502 |
119 | 183 | ||
184 | #define AXESSTEL_VENDOR_ID 0x1726 | ||
185 | #define AXESSTEL_PRODUCT_MV110H 0x1000 | ||
186 | |||
120 | #define BANDRICH_VENDOR_ID 0x1A8D | 187 | #define BANDRICH_VENDOR_ID 0x1A8D |
121 | #define BANDRICH_PRODUCT_C100_1 0x1002 | 188 | #define BANDRICH_PRODUCT_C100_1 0x1002 |
122 | #define BANDRICH_PRODUCT_C100_2 0x1003 | 189 | #define BANDRICH_PRODUCT_C100_2 0x1003 |
123 | 190 | ||
191 | #define AMOI_VENDOR_ID 0x1614 | ||
192 | #define AMOI_PRODUCT_9508 0x0800 | ||
193 | |||
194 | #define QUALCOMM_VENDOR_ID 0x05C6 | ||
195 | |||
196 | #define MAXON_VENDOR_ID 0x16d8 | ||
197 | |||
124 | static struct usb_device_id option_ids[] = { | 198 | static struct usb_device_id option_ids[] = { |
125 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 199 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
126 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 200 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
@@ -160,32 +234,73 @@ static struct usb_device_id option_ids[] = { | |||
160 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 234 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
161 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, | 235 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, |
162 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, | 236 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, |
163 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */ | 237 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401) }, |
164 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */ | 238 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403) }, |
165 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */ | 239 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405) }, |
166 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */ | 240 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406) }, |
167 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */ | 241 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408) }, |
168 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ | 242 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409) }, |
169 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ | 243 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410) }, |
170 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | 244 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411) }, |
171 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ | 245 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412) }, |
172 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ | 246 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413) }, |
173 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ | 247 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414) }, |
174 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ | 248 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415) }, |
175 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4100) }, /* Novatel U727 */ | 249 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416) }, |
176 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4400) }, /* Novatel MC950 */ | 250 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417) }, |
251 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418) }, | ||
252 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419) }, | ||
253 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) }, | ||
254 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ | ||
255 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ | ||
256 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) }, /* Novatel Merlin EX720/V740/X720 */ | ||
257 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) }, /* Novatel Merlin V720/S720/PC720 */ | ||
258 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) }, /* Novatel U730/U740 (VF version) */ | ||
259 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) }, /* Novatel U740 */ | ||
260 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) }, /* Novatel U870 */ | ||
261 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) }, /* Novatel Merlin XU870 HSDPA/3G */ | ||
262 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) }, /* Novatel X950D */ | ||
263 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) }, /* Novatel EV620/ES620 CDMA/EV-DO */ | ||
264 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) }, /* Novatel ES620/ES720/U720/USB720 */ | ||
265 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) }, /* Novatel E725/E726 */ | ||
266 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) }, /* Novatel Merlin ES620 SM Bus */ | ||
267 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) }, /* Novatel EU730 and Vodafone EU740 */ | ||
268 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) }, /* Novatel non-Vodafone EU740 */ | ||
269 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ | ||
270 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ | ||
271 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ | ||
272 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel U727 */ | ||
273 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */ | ||
274 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */ | ||
275 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */ | ||
276 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_1) }, /* Novatel Global product */ | ||
277 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_2) }, /* Novatel EVDO product */ | ||
278 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_2) }, /* Novatel HSPA product */ | ||
279 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_2) }, /* Novatel Embedded product */ | ||
280 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_2) }, /* Novatel Global product */ | ||
281 | |||
282 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | ||
283 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | ||
284 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, | ||
285 | |||
177 | { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | 286 | { 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 */ | 287 | { 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 */ | 288 | { 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 */ | 289 | { 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 */ | 290 | { 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 */ | 291 | { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ |
292 | { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */ | ||
293 | { 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 */ | 294 | { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ |
184 | { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ | 295 | { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ |
185 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, | 296 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, |
186 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 297 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
298 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, | ||
187 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, | 299 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, |
188 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, | 300 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, |
301 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | ||
302 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | ||
303 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ | ||
189 | { } /* Terminating entry */ | 304 | { } /* Terminating entry */ |
190 | }; | 305 | }; |
191 | MODULE_DEVICE_TABLE(usb, option_ids); | 306 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -247,10 +362,10 @@ static int debug; | |||
247 | struct option_port_private { | 362 | struct option_port_private { |
248 | /* Input endpoints and buffer for this port */ | 363 | /* Input endpoints and buffer for this port */ |
249 | struct urb *in_urbs[N_IN_URB]; | 364 | struct urb *in_urbs[N_IN_URB]; |
250 | char in_buffer[N_IN_URB][IN_BUFLEN]; | 365 | u8 *in_buffer[N_IN_URB]; |
251 | /* Output endpoints and buffer for this port */ | 366 | /* Output endpoints and buffer for this port */ |
252 | struct urb *out_urbs[N_OUT_URB]; | 367 | struct urb *out_urbs[N_OUT_URB]; |
253 | char out_buffer[N_OUT_URB][OUT_BUFLEN]; | 368 | u8 *out_buffer[N_OUT_URB]; |
254 | unsigned long out_busy; /* Bit vector of URBs in use */ | 369 | unsigned long out_busy; /* Bit vector of URBs in use */ |
255 | 370 | ||
256 | /* Settings for the port */ | 371 | /* Settings for the port */ |
@@ -737,9 +852,10 @@ static int option_send_setup(struct usb_serial_port *port) | |||
737 | 852 | ||
738 | static int option_startup(struct usb_serial *serial) | 853 | static int option_startup(struct usb_serial *serial) |
739 | { | 854 | { |
740 | int i, err; | 855 | int i, j, err; |
741 | struct usb_serial_port *port; | 856 | struct usb_serial_port *port; |
742 | struct option_port_private *portdata; | 857 | struct option_port_private *portdata; |
858 | u8 *buffer; | ||
743 | 859 | ||
744 | dbg("%s", __FUNCTION__); | 860 | dbg("%s", __FUNCTION__); |
745 | 861 | ||
@@ -753,6 +869,20 @@ static int option_startup(struct usb_serial *serial) | |||
753 | return (1); | 869 | return (1); |
754 | } | 870 | } |
755 | 871 | ||
872 | for (j = 0; j < N_IN_URB; j++) { | ||
873 | buffer = (u8 *)__get_free_page(GFP_KERNEL); | ||
874 | if (!buffer) | ||
875 | goto bail_out_error; | ||
876 | portdata->in_buffer[j] = buffer; | ||
877 | } | ||
878 | |||
879 | for (j = 0; j < N_OUT_URB; j++) { | ||
880 | buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); | ||
881 | if (!buffer) | ||
882 | goto bail_out_error2; | ||
883 | portdata->out_buffer[j] = buffer; | ||
884 | } | ||
885 | |||
756 | usb_set_serial_port_data(port, portdata); | 886 | usb_set_serial_port_data(port, portdata); |
757 | 887 | ||
758 | if (! port->interrupt_in_urb) | 888 | if (! port->interrupt_in_urb) |
@@ -766,6 +896,16 @@ static int option_startup(struct usb_serial *serial) | |||
766 | option_setup_urbs(serial); | 896 | option_setup_urbs(serial); |
767 | 897 | ||
768 | return (0); | 898 | return (0); |
899 | |||
900 | bail_out_error2: | ||
901 | for (j = 0; j < N_OUT_URB; j++) | ||
902 | kfree(portdata->out_buffer[j]); | ||
903 | bail_out_error: | ||
904 | for (j = 0; j < N_IN_URB; j++) | ||
905 | if (portdata->in_buffer[j]) | ||
906 | free_page((unsigned long)portdata->in_buffer[j]); | ||
907 | kfree(portdata); | ||
908 | return 1; | ||
769 | } | 909 | } |
770 | 910 | ||
771 | static void option_shutdown(struct usb_serial *serial) | 911 | static void option_shutdown(struct usb_serial *serial) |
@@ -794,12 +934,14 @@ static void option_shutdown(struct usb_serial *serial) | |||
794 | for (j = 0; j < N_IN_URB; j++) { | 934 | for (j = 0; j < N_IN_URB; j++) { |
795 | if (portdata->in_urbs[j]) { | 935 | if (portdata->in_urbs[j]) { |
796 | usb_free_urb(portdata->in_urbs[j]); | 936 | usb_free_urb(portdata->in_urbs[j]); |
937 | free_page((unsigned long)portdata->in_buffer[j]); | ||
797 | portdata->in_urbs[j] = NULL; | 938 | portdata->in_urbs[j] = NULL; |
798 | } | 939 | } |
799 | } | 940 | } |
800 | for (j = 0; j < N_OUT_URB; j++) { | 941 | for (j = 0; j < N_OUT_URB; j++) { |
801 | if (portdata->out_urbs[j]) { | 942 | if (portdata->out_urbs[j]) { |
802 | usb_free_urb(portdata->out_urbs[j]); | 943 | usb_free_urb(portdata->out_urbs[j]); |
944 | kfree(portdata->out_buffer[j]); | ||
803 | portdata->out_urbs[j] = NULL; | 945 | portdata->out_urbs[j] = NULL; |
804 | } | 946 | } |
805 | } | 947 | } |