aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2011-04-18 09:32:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-19 15:39:45 -0400
commite01ae27f8ce6bd3ee26ef33c704f62449ce8233b (patch)
tree28c022b0e755e244e4834f741d2bfce600606624 /drivers/net/wireless/rt2x00/rt73usb.c
parentce2919c9fffe2aa52f9c3e327176d03764dbf9b5 (diff)
rt2x00: Allow dynamic addition of PCI/USB IDs.
Both USB and PCI drivers allow a system administrator to dynamically add USB/PCI IDs to the device table that a driver supports via the /sys/bus/{usb,pci,pci_express}/drivers/<driver-name>/new_id files. However, for the rt2x00 drivers using this method currently crashes the system with a NULL pointer failure. This is due to the set-up of rt2x00 where the probe functions require a rt2x00_ops structure in the driver_info field of the probed device. As this field is empty for the dynamically added devices this fails for these devices. Fix this by introducing driver-specific probe wrappers that do nothing but calling the bus-specific probe functions with the rt2x00_ops structure as an argument, rather than depending on the driver_info field. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c154
1 files changed, 80 insertions, 74 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index cdb026d076db..be3eb5e894ef 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2388,113 +2388,113 @@ static const struct rt2x00_ops rt73usb_ops = {
2388 */ 2388 */
2389static struct usb_device_id rt73usb_device_table[] = { 2389static struct usb_device_id rt73usb_device_table[] = {
2390 /* AboCom */ 2390 /* AboCom */
2391 { USB_DEVICE(0x07b8, 0xb21b), USB_DEVICE_DATA(&rt73usb_ops) }, 2391 { USB_DEVICE(0x07b8, 0xb21b) },
2392 { USB_DEVICE(0x07b8, 0xb21c), USB_DEVICE_DATA(&rt73usb_ops) }, 2392 { USB_DEVICE(0x07b8, 0xb21c) },
2393 { USB_DEVICE(0x07b8, 0xb21d), USB_DEVICE_DATA(&rt73usb_ops) }, 2393 { USB_DEVICE(0x07b8, 0xb21d) },
2394 { USB_DEVICE(0x07b8, 0xb21e), USB_DEVICE_DATA(&rt73usb_ops) }, 2394 { USB_DEVICE(0x07b8, 0xb21e) },
2395 { USB_DEVICE(0x07b8, 0xb21f), USB_DEVICE_DATA(&rt73usb_ops) }, 2395 { USB_DEVICE(0x07b8, 0xb21f) },
2396 /* AL */ 2396 /* AL */
2397 { USB_DEVICE(0x14b2, 0x3c10), USB_DEVICE_DATA(&rt73usb_ops) }, 2397 { USB_DEVICE(0x14b2, 0x3c10) },
2398 /* Amigo */ 2398 /* Amigo */
2399 { USB_DEVICE(0x148f, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) }, 2399 { USB_DEVICE(0x148f, 0x9021) },
2400 { USB_DEVICE(0x0eb0, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) }, 2400 { USB_DEVICE(0x0eb0, 0x9021) },
2401 /* AMIT */ 2401 /* AMIT */
2402 { USB_DEVICE(0x18c5, 0x0002), USB_DEVICE_DATA(&rt73usb_ops) }, 2402 { USB_DEVICE(0x18c5, 0x0002) },
2403 /* Askey */ 2403 /* Askey */
2404 { USB_DEVICE(0x1690, 0x0722), USB_DEVICE_DATA(&rt73usb_ops) }, 2404 { USB_DEVICE(0x1690, 0x0722) },
2405 /* ASUS */ 2405 /* ASUS */
2406 { USB_DEVICE(0x0b05, 0x1723), USB_DEVICE_DATA(&rt73usb_ops) }, 2406 { USB_DEVICE(0x0b05, 0x1723) },
2407 { USB_DEVICE(0x0b05, 0x1724), USB_DEVICE_DATA(&rt73usb_ops) }, 2407 { USB_DEVICE(0x0b05, 0x1724) },
2408 /* Belkin */ 2408 /* Belkin */
2409 { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, 2409 { USB_DEVICE(0x050d, 0x705a) },
2410 { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, 2410 { USB_DEVICE(0x050d, 0x905b) },
2411 { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) }, 2411 { USB_DEVICE(0x050d, 0x905c) },
2412 /* Billionton */ 2412 /* Billionton */
2413 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) }, 2413 { USB_DEVICE(0x1631, 0xc019) },
2414 { USB_DEVICE(0x08dd, 0x0120), USB_DEVICE_DATA(&rt73usb_ops) }, 2414 { USB_DEVICE(0x08dd, 0x0120) },
2415 /* Buffalo */ 2415 /* Buffalo */
2416 { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) }, 2416 { USB_DEVICE(0x0411, 0x00d8) },
2417 { USB_DEVICE(0x0411, 0x00d9), USB_DEVICE_DATA(&rt73usb_ops) }, 2417 { USB_DEVICE(0x0411, 0x00d9) },
2418 { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) }, 2418 { USB_DEVICE(0x0411, 0x00f4) },
2419 { USB_DEVICE(0x0411, 0x0116), USB_DEVICE_DATA(&rt73usb_ops) }, 2419 { USB_DEVICE(0x0411, 0x0116) },
2420 { USB_DEVICE(0x0411, 0x0119), USB_DEVICE_DATA(&rt73usb_ops) }, 2420 { USB_DEVICE(0x0411, 0x0119) },
2421 { USB_DEVICE(0x0411, 0x0137), USB_DEVICE_DATA(&rt73usb_ops) }, 2421 { USB_DEVICE(0x0411, 0x0137) },
2422 /* CEIVA */ 2422 /* CEIVA */
2423 { USB_DEVICE(0x178d, 0x02be), USB_DEVICE_DATA(&rt73usb_ops) }, 2423 { USB_DEVICE(0x178d, 0x02be) },
2424 /* CNet */ 2424 /* CNet */
2425 { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) }, 2425 { USB_DEVICE(0x1371, 0x9022) },
2426 { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, 2426 { USB_DEVICE(0x1371, 0x9032) },
2427 /* Conceptronic */ 2427 /* Conceptronic */
2428 { USB_DEVICE(0x14b2, 0x3c22), USB_DEVICE_DATA(&rt73usb_ops) }, 2428 { USB_DEVICE(0x14b2, 0x3c22) },
2429 /* Corega */ 2429 /* Corega */
2430 { USB_DEVICE(0x07aa, 0x002e), USB_DEVICE_DATA(&rt73usb_ops) }, 2430 { USB_DEVICE(0x07aa, 0x002e) },
2431 /* D-Link */ 2431 /* D-Link */
2432 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2432 { USB_DEVICE(0x07d1, 0x3c03) },
2433 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2433 { USB_DEVICE(0x07d1, 0x3c04) },
2434 { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) }, 2434 { USB_DEVICE(0x07d1, 0x3c06) },
2435 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, 2435 { USB_DEVICE(0x07d1, 0x3c07) },
2436 /* Edimax */ 2436 /* Edimax */
2437 { USB_DEVICE(0x7392, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) }, 2437 { USB_DEVICE(0x7392, 0x7318) },
2438 { USB_DEVICE(0x7392, 0x7618), USB_DEVICE_DATA(&rt73usb_ops) }, 2438 { USB_DEVICE(0x7392, 0x7618) },
2439 /* EnGenius */ 2439 /* EnGenius */
2440 { USB_DEVICE(0x1740, 0x3701), USB_DEVICE_DATA(&rt73usb_ops) }, 2440 { USB_DEVICE(0x1740, 0x3701) },
2441 /* Gemtek */ 2441 /* Gemtek */
2442 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, 2442 { USB_DEVICE(0x15a9, 0x0004) },
2443 /* Gigabyte */ 2443 /* Gigabyte */
2444 { USB_DEVICE(0x1044, 0x8008), USB_DEVICE_DATA(&rt73usb_ops) }, 2444 { USB_DEVICE(0x1044, 0x8008) },
2445 { USB_DEVICE(0x1044, 0x800a), USB_DEVICE_DATA(&rt73usb_ops) }, 2445 { USB_DEVICE(0x1044, 0x800a) },
2446 /* Huawei-3Com */ 2446 /* Huawei-3Com */
2447 { USB_DEVICE(0x1472, 0x0009), USB_DEVICE_DATA(&rt73usb_ops) }, 2447 { USB_DEVICE(0x1472, 0x0009) },
2448 /* Hercules */ 2448 /* Hercules */
2449 { USB_DEVICE(0x06f8, 0xe002), USB_DEVICE_DATA(&rt73usb_ops) }, 2449 { USB_DEVICE(0x06f8, 0xe002) },
2450 { USB_DEVICE(0x06f8, 0xe010), USB_DEVICE_DATA(&rt73usb_ops) }, 2450 { USB_DEVICE(0x06f8, 0xe010) },
2451 { USB_DEVICE(0x06f8, 0xe020), USB_DEVICE_DATA(&rt73usb_ops) }, 2451 { USB_DEVICE(0x06f8, 0xe020) },
2452 /* Linksys */ 2452 /* Linksys */
2453 { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, 2453 { USB_DEVICE(0x13b1, 0x0020) },
2454 { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, 2454 { USB_DEVICE(0x13b1, 0x0023) },
2455 { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, 2455 { USB_DEVICE(0x13b1, 0x0028) },
2456 /* MSI */ 2456 /* MSI */
2457 { USB_DEVICE(0x0db0, 0x4600), USB_DEVICE_DATA(&rt73usb_ops) }, 2457 { USB_DEVICE(0x0db0, 0x4600) },
2458 { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, 2458 { USB_DEVICE(0x0db0, 0x6877) },
2459 { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, 2459 { USB_DEVICE(0x0db0, 0x6874) },
2460 { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) }, 2460 { USB_DEVICE(0x0db0, 0xa861) },
2461 { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) }, 2461 { USB_DEVICE(0x0db0, 0xa874) },
2462 /* Ovislink */ 2462 /* Ovislink */
2463 { USB_DEVICE(0x1b75, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) }, 2463 { USB_DEVICE(0x1b75, 0x7318) },
2464 /* Ralink */ 2464 /* Ralink */
2465 { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) }, 2465 { USB_DEVICE(0x04bb, 0x093d) },
2466 { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) }, 2466 { USB_DEVICE(0x148f, 0x2573) },
2467 { USB_DEVICE(0x148f, 0x2671), USB_DEVICE_DATA(&rt73usb_ops) }, 2467 { USB_DEVICE(0x148f, 0x2671) },
2468 { USB_DEVICE(0x0812, 0x3101), USB_DEVICE_DATA(&rt73usb_ops) }, 2468 { USB_DEVICE(0x0812, 0x3101) },
2469 /* Qcom */ 2469 /* Qcom */
2470 { USB_DEVICE(0x18e8, 0x6196), USB_DEVICE_DATA(&rt73usb_ops) }, 2470 { USB_DEVICE(0x18e8, 0x6196) },
2471 { USB_DEVICE(0x18e8, 0x6229), USB_DEVICE_DATA(&rt73usb_ops) }, 2471 { USB_DEVICE(0x18e8, 0x6229) },
2472 { USB_DEVICE(0x18e8, 0x6238), USB_DEVICE_DATA(&rt73usb_ops) }, 2472 { USB_DEVICE(0x18e8, 0x6238) },
2473 /* Samsung */ 2473 /* Samsung */
2474 { USB_DEVICE(0x04e8, 0x4471), USB_DEVICE_DATA(&rt73usb_ops) }, 2474 { USB_DEVICE(0x04e8, 0x4471) },
2475 /* Senao */ 2475 /* Senao */
2476 { USB_DEVICE(0x1740, 0x7100), USB_DEVICE_DATA(&rt73usb_ops) }, 2476 { USB_DEVICE(0x1740, 0x7100) },
2477 /* Sitecom */ 2477 /* Sitecom */
2478 { USB_DEVICE(0x0df6, 0x0024), USB_DEVICE_DATA(&rt73usb_ops) }, 2478 { USB_DEVICE(0x0df6, 0x0024) },
2479 { USB_DEVICE(0x0df6, 0x0027), USB_DEVICE_DATA(&rt73usb_ops) }, 2479 { USB_DEVICE(0x0df6, 0x0027) },
2480 { USB_DEVICE(0x0df6, 0x002f), USB_DEVICE_DATA(&rt73usb_ops) }, 2480 { USB_DEVICE(0x0df6, 0x002f) },
2481 { USB_DEVICE(0x0df6, 0x90ac), USB_DEVICE_DATA(&rt73usb_ops) }, 2481 { USB_DEVICE(0x0df6, 0x90ac) },
2482 { USB_DEVICE(0x0df6, 0x9712), USB_DEVICE_DATA(&rt73usb_ops) }, 2482 { USB_DEVICE(0x0df6, 0x9712) },
2483 /* Surecom */ 2483 /* Surecom */
2484 { USB_DEVICE(0x0769, 0x31f3), USB_DEVICE_DATA(&rt73usb_ops) }, 2484 { USB_DEVICE(0x0769, 0x31f3) },
2485 /* Tilgin */ 2485 /* Tilgin */
2486 { USB_DEVICE(0x6933, 0x5001), USB_DEVICE_DATA(&rt73usb_ops) }, 2486 { USB_DEVICE(0x6933, 0x5001) },
2487 /* Philips */ 2487 /* Philips */
2488 { USB_DEVICE(0x0471, 0x200a), USB_DEVICE_DATA(&rt73usb_ops) }, 2488 { USB_DEVICE(0x0471, 0x200a) },
2489 /* Planex */ 2489 /* Planex */
2490 { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) }, 2490 { USB_DEVICE(0x2019, 0xab01) },
2491 { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) }, 2491 { USB_DEVICE(0x2019, 0xab50) },
2492 /* WideTell */ 2492 /* WideTell */
2493 { USB_DEVICE(0x7167, 0x3840), USB_DEVICE_DATA(&rt73usb_ops) }, 2493 { USB_DEVICE(0x7167, 0x3840) },
2494 /* Zcom */ 2494 /* Zcom */
2495 { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) }, 2495 { USB_DEVICE(0x0cde, 0x001c) },
2496 /* ZyXEL */ 2496 /* ZyXEL */
2497 { USB_DEVICE(0x0586, 0x3415), USB_DEVICE_DATA(&rt73usb_ops) }, 2497 { USB_DEVICE(0x0586, 0x3415) },
2498 { 0, } 2498 { 0, }
2499}; 2499};
2500 2500
@@ -2506,10 +2506,16 @@ MODULE_DEVICE_TABLE(usb, rt73usb_device_table);
2506MODULE_FIRMWARE(FIRMWARE_RT2571); 2506MODULE_FIRMWARE(FIRMWARE_RT2571);
2507MODULE_LICENSE("GPL"); 2507MODULE_LICENSE("GPL");
2508 2508
2509static int rt73usb_probe(struct usb_interface *usb_intf,
2510 const struct usb_device_id *id)
2511{
2512 return rt2x00usb_probe(usb_intf, &rt73usb_ops);
2513}
2514
2509static struct usb_driver rt73usb_driver = { 2515static struct usb_driver rt73usb_driver = {
2510 .name = KBUILD_MODNAME, 2516 .name = KBUILD_MODNAME,
2511 .id_table = rt73usb_device_table, 2517 .id_table = rt73usb_device_table,
2512 .probe = rt2x00usb_probe, 2518 .probe = rt73usb_probe,
2513 .disconnect = rt2x00usb_disconnect, 2519 .disconnect = rt2x00usb_disconnect,
2514 .suspend = rt2x00usb_suspend, 2520 .suspend = rt2x00usb_suspend,
2515 .resume = rt2x00usb_resume, 2521 .resume = rt2x00usb_resume,