diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-25 18:50:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-25 18:50:32 -0400 |
commit | e486463e82e4dca9e8f4413649088b21c9ff87e5 (patch) | |
tree | 3fb17b54454a101416c2b22e6b4ea5a027b3c02b /drivers/net/usb/qmi_wwan.c | |
parent | ed3b856b69a7f3748d6917e42d462c962aaa39b8 (diff) | |
parent | fa809e2fd6e317226c046202a88520962672eac0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/usb/qmi_wwan.c
net/batman-adv/translation-table.c
net/ipv6/route.c
qmi_wwan.c resolution provided by Bjørn Mork.
batman-adv conflict is dealing merely with the changes
of global function names to have a proper subsystem
prefix.
ipv6's route.c conflict is merely two side-by-side additions
of network namespace methods.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/qmi_wwan.c')
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index f1e779135899..68ca6769210f 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -269,29 +269,6 @@ err: | |||
269 | return rv; | 269 | return rv; |
270 | } | 270 | } |
271 | 271 | ||
272 | /* Gobi devices uses identical class/protocol codes for all interfaces regardless | ||
273 | * of function. Some of these are CDC ACM like and have the exact same endpoints | ||
274 | * we are looking for. This leaves two possible strategies for identifying the | ||
275 | * correct interface: | ||
276 | * a) hardcoding interface number, or | ||
277 | * b) use the fact that the wwan interface is the only one lacking additional | ||
278 | * (CDC functional) descriptors | ||
279 | * | ||
280 | * Let's see if we can get away with the generic b) solution. | ||
281 | */ | ||
282 | static int qmi_wwan_bind_gobi(struct usbnet *dev, struct usb_interface *intf) | ||
283 | { | ||
284 | int rv = -EINVAL; | ||
285 | |||
286 | /* ignore any interface with additional descriptors */ | ||
287 | if (intf->cur_altsetting->extralen) | ||
288 | goto err; | ||
289 | |||
290 | rv = qmi_wwan_bind_shared(dev, intf); | ||
291 | err: | ||
292 | return rv; | ||
293 | } | ||
294 | |||
295 | static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf) | 272 | static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf) |
296 | { | 273 | { |
297 | struct qmi_wwan_state *info = (void *)&dev->data; | 274 | struct qmi_wwan_state *info = (void *)&dev->data; |
@@ -375,15 +352,15 @@ static const struct driver_info qmi_wwan_shared = { | |||
375 | .manage_power = qmi_wwan_manage_power, | 352 | .manage_power = qmi_wwan_manage_power, |
376 | }; | 353 | }; |
377 | 354 | ||
378 | static const struct driver_info qmi_wwan_gobi = { | 355 | static const struct driver_info qmi_wwan_force_int0 = { |
379 | .description = "Qualcomm Gobi wwan/QMI device", | 356 | .description = "Qualcomm WWAN/QMI device", |
380 | .flags = FLAG_WWAN, | 357 | .flags = FLAG_WWAN, |
381 | .bind = qmi_wwan_bind_gobi, | 358 | .bind = qmi_wwan_bind_shared, |
382 | .unbind = qmi_wwan_unbind, | 359 | .unbind = qmi_wwan_unbind, |
383 | .manage_power = qmi_wwan_manage_power, | 360 | .manage_power = qmi_wwan_manage_power, |
361 | .data = BIT(0), /* interface whitelist bitmap */ | ||
384 | }; | 362 | }; |
385 | 363 | ||
386 | /* ZTE suck at making USB descriptors */ | ||
387 | static const struct driver_info qmi_wwan_force_int1 = { | 364 | static const struct driver_info qmi_wwan_force_int1 = { |
388 | .description = "Qualcomm WWAN/QMI device", | 365 | .description = "Qualcomm WWAN/QMI device", |
389 | .flags = FLAG_WWAN, | 366 | .flags = FLAG_WWAN, |
@@ -393,6 +370,15 @@ static const struct driver_info qmi_wwan_force_int1 = { | |||
393 | .data = BIT(1), /* interface whitelist bitmap */ | 370 | .data = BIT(1), /* interface whitelist bitmap */ |
394 | }; | 371 | }; |
395 | 372 | ||
373 | static const struct driver_info qmi_wwan_force_int3 = { | ||
374 | .description = "Qualcomm WWAN/QMI device", | ||
375 | .flags = FLAG_WWAN, | ||
376 | .bind = qmi_wwan_bind_shared, | ||
377 | .unbind = qmi_wwan_unbind, | ||
378 | .manage_power = qmi_wwan_manage_power, | ||
379 | .data = BIT(3), /* interface whitelist bitmap */ | ||
380 | }; | ||
381 | |||
396 | static const struct driver_info qmi_wwan_force_int4 = { | 382 | static const struct driver_info qmi_wwan_force_int4 = { |
397 | .description = "Qualcomm WWAN/QMI device", | 383 | .description = "Qualcomm WWAN/QMI device", |
398 | .flags = FLAG_WWAN, | 384 | .flags = FLAG_WWAN, |
@@ -418,16 +404,23 @@ static const struct driver_info qmi_wwan_force_int4 = { | |||
418 | static const struct driver_info qmi_wwan_sierra = { | 404 | static const struct driver_info qmi_wwan_sierra = { |
419 | .description = "Sierra Wireless wwan/QMI device", | 405 | .description = "Sierra Wireless wwan/QMI device", |
420 | .flags = FLAG_WWAN, | 406 | .flags = FLAG_WWAN, |
421 | .bind = qmi_wwan_bind_gobi, | 407 | .bind = qmi_wwan_bind_shared, |
422 | .unbind = qmi_wwan_unbind, | 408 | .unbind = qmi_wwan_unbind, |
423 | .manage_power = qmi_wwan_manage_power, | 409 | .manage_power = qmi_wwan_manage_power, |
424 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | 410 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ |
425 | }; | 411 | }; |
426 | 412 | ||
427 | #define HUAWEI_VENDOR_ID 0x12D1 | 413 | #define HUAWEI_VENDOR_ID 0x12D1 |
414 | |||
415 | /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */ | ||
416 | #define QMI_GOBI1K_DEVICE(vend, prod) \ | ||
417 | USB_DEVICE(vend, prod), \ | ||
418 | .driver_info = (unsigned long)&qmi_wwan_force_int3 | ||
419 | |||
420 | /* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */ | ||
428 | #define QMI_GOBI_DEVICE(vend, prod) \ | 421 | #define QMI_GOBI_DEVICE(vend, prod) \ |
429 | USB_DEVICE(vend, prod), \ | 422 | USB_DEVICE(vend, prod), \ |
430 | .driver_info = (unsigned long)&qmi_wwan_gobi | 423 | .driver_info = (unsigned long)&qmi_wwan_force_int0 |
431 | 424 | ||
432 | static const struct usb_device_id products[] = { | 425 | static const struct usb_device_id products[] = { |
433 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ | 426 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ |
@@ -538,20 +531,24 @@ static const struct usb_device_id products[] = { | |||
538 | .bInterfaceProtocol = 0xff, | 531 | .bInterfaceProtocol = 0xff, |
539 | .driver_info = (unsigned long)&qmi_wwan_sierra, | 532 | .driver_info = (unsigned long)&qmi_wwan_sierra, |
540 | }, | 533 | }, |
541 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 534 | |
542 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 535 | /* Gobi 1000 devices */ |
543 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 536 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
544 | {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 537 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
545 | {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 538 | {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
546 | {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 539 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
547 | {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ | 540 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
548 | {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ | 541 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
549 | {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ | 542 | {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ |
550 | {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ | 543 | {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ |
551 | {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ | 544 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ |
552 | {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ | 545 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ |
553 | {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | 546 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ |
554 | {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | 547 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ |
548 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | ||
549 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | ||
550 | |||
551 | /* Gobi 2000 and 3000 devices */ | ||
555 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 552 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
556 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | 553 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ |
557 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 554 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |