diff options
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 54d4148d01d1..edc64bb6f457 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Function prototypes */ | 47 | /* Function prototypes */ |
48 | static int option_probe(struct usb_serial *serial, | 48 | static int option_probe(struct usb_serial *serial, |
49 | const struct usb_device_id *id); | 49 | const struct usb_device_id *id); |
50 | static int option_attach(struct usb_serial *serial); | ||
50 | static void option_release(struct usb_serial *serial); | 51 | static void option_release(struct usb_serial *serial); |
51 | static int option_send_setup(struct usb_serial_port *port); | 52 | static int option_send_setup(struct usb_serial_port *port); |
52 | static void option_instat_callback(struct urb *urb); | 53 | static void option_instat_callback(struct urb *urb); |
@@ -157,6 +158,7 @@ static void option_instat_callback(struct urb *urb); | |||
157 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 | 158 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 |
158 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 | 159 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 |
159 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 | 160 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 |
161 | #define NOVATELWIRELESS_PRODUCT_E362 0x9010 | ||
160 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | 162 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 |
161 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | 163 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 |
162 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 164 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
@@ -192,6 +194,9 @@ static void option_instat_callback(struct urb *urb); | |||
192 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 | 194 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 |
193 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 | 195 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 |
194 | 196 | ||
197 | #define DELL_PRODUCT_5800_MINICARD_VZW 0x8195 /* Novatel E362 */ | ||
198 | #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */ | ||
199 | |||
195 | #define KYOCERA_VENDOR_ID 0x0c88 | 200 | #define KYOCERA_VENDOR_ID 0x0c88 |
196 | #define KYOCERA_PRODUCT_KPC650 0x17da | 201 | #define KYOCERA_PRODUCT_KPC650 0x17da |
197 | #define KYOCERA_PRODUCT_KPC680 0x180a | 202 | #define KYOCERA_PRODUCT_KPC680 0x180a |
@@ -282,6 +287,7 @@ static void option_instat_callback(struct urb *urb); | |||
282 | /* ALCATEL PRODUCTS */ | 287 | /* ALCATEL PRODUCTS */ |
283 | #define ALCATEL_VENDOR_ID 0x1bbb | 288 | #define ALCATEL_VENDOR_ID 0x1bbb |
284 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 | 289 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 |
290 | #define ALCATEL_PRODUCT_X220_X500D 0x0017 | ||
285 | 291 | ||
286 | #define PIRELLI_VENDOR_ID 0x1266 | 292 | #define PIRELLI_VENDOR_ID 0x1266 |
287 | #define PIRELLI_PRODUCT_C100_1 0x1002 | 293 | #define PIRELLI_PRODUCT_C100_1 0x1002 |
@@ -705,6 +711,7 @@ static const struct usb_device_id option_ids[] = { | |||
705 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | 711 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, |
706 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | 712 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ |
707 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | 713 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, |
714 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) }, | ||
708 | 715 | ||
709 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 716 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
710 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 717 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
@@ -727,6 +734,8 @@ static const struct usb_device_id option_ids[] = { | |||
727 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 734 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
728 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 735 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
729 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | 736 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ |
737 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
738 | { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, | ||
730 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ | 739 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ |
731 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 740 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
732 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | 741 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, |
@@ -1156,6 +1165,7 @@ static const struct usb_device_id option_ids[] = { | |||
1156 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), | 1165 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
1157 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist | 1166 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist |
1158 | }, | 1167 | }, |
1168 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, | ||
1159 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 1169 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
1160 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | 1170 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, |
1161 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), | 1171 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
@@ -1288,8 +1298,9 @@ static struct usb_serial_driver option_1port_device = { | |||
1288 | .tiocmget = usb_wwan_tiocmget, | 1298 | .tiocmget = usb_wwan_tiocmget, |
1289 | .tiocmset = usb_wwan_tiocmset, | 1299 | .tiocmset = usb_wwan_tiocmset, |
1290 | .ioctl = usb_wwan_ioctl, | 1300 | .ioctl = usb_wwan_ioctl, |
1291 | .attach = usb_wwan_startup, | 1301 | .attach = option_attach, |
1292 | .release = option_release, | 1302 | .release = option_release, |
1303 | .port_probe = usb_wwan_port_probe, | ||
1293 | .port_remove = usb_wwan_port_remove, | 1304 | .port_remove = usb_wwan_port_remove, |
1294 | .read_int_callback = option_instat_callback, | 1305 | .read_int_callback = option_instat_callback, |
1295 | #ifdef CONFIG_PM | 1306 | #ifdef CONFIG_PM |
@@ -1335,8 +1346,6 @@ static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, | |||
1335 | static int option_probe(struct usb_serial *serial, | 1346 | static int option_probe(struct usb_serial *serial, |
1336 | const struct usb_device_id *id) | 1347 | const struct usb_device_id *id) |
1337 | { | 1348 | { |
1338 | struct usb_wwan_intf_private *data; | ||
1339 | struct option_private *priv; | ||
1340 | struct usb_interface_descriptor *iface_desc = | 1349 | struct usb_interface_descriptor *iface_desc = |
1341 | &serial->interface->cur_altsetting->desc; | 1350 | &serial->interface->cur_altsetting->desc; |
1342 | struct usb_device_descriptor *dev_desc = &serial->dev->descriptor; | 1351 | struct usb_device_descriptor *dev_desc = &serial->dev->descriptor; |
@@ -1374,6 +1383,19 @@ static int option_probe(struct usb_serial *serial, | |||
1374 | iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) | 1383 | iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) |
1375 | return -ENODEV; | 1384 | return -ENODEV; |
1376 | 1385 | ||
1386 | /* Store device id so we can use it during attach. */ | ||
1387 | usb_set_serial_data(serial, (void *)id); | ||
1388 | |||
1389 | return 0; | ||
1390 | } | ||
1391 | |||
1392 | static int option_attach(struct usb_serial *serial) | ||
1393 | { | ||
1394 | struct usb_interface_descriptor *iface_desc; | ||
1395 | const struct usb_device_id *id; | ||
1396 | struct usb_wwan_intf_private *data; | ||
1397 | struct option_private *priv; | ||
1398 | |||
1377 | data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL); | 1399 | data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL); |
1378 | if (!data) | 1400 | if (!data) |
1379 | return -ENOMEM; | 1401 | return -ENOMEM; |
@@ -1384,6 +1406,10 @@ static int option_probe(struct usb_serial *serial, | |||
1384 | return -ENOMEM; | 1406 | return -ENOMEM; |
1385 | } | 1407 | } |
1386 | 1408 | ||
1409 | /* Retrieve device id stored at probe. */ | ||
1410 | id = usb_get_serial_data(serial); | ||
1411 | iface_desc = &serial->interface->cur_altsetting->desc; | ||
1412 | |||
1387 | priv->bInterfaceNumber = iface_desc->bInterfaceNumber; | 1413 | priv->bInterfaceNumber = iface_desc->bInterfaceNumber; |
1388 | data->private = priv; | 1414 | data->private = priv; |
1389 | 1415 | ||