aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.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/rt2500usb.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/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c70
1 files changed, 38 insertions, 32 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index dbbd8bc851f1..d88c36712ef0 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1904,54 +1904,54 @@ static const struct rt2x00_ops rt2500usb_ops = {
1904 */ 1904 */
1905static struct usb_device_id rt2500usb_device_table[] = { 1905static struct usb_device_id rt2500usb_device_table[] = {
1906 /* ASUS */ 1906 /* ASUS */
1907 { USB_DEVICE(0x0b05, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, 1907 { USB_DEVICE(0x0b05, 0x1706) },
1908 { USB_DEVICE(0x0b05, 0x1707), USB_DEVICE_DATA(&rt2500usb_ops) }, 1908 { USB_DEVICE(0x0b05, 0x1707) },
1909 /* Belkin */ 1909 /* Belkin */
1910 { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt2500usb_ops) }, 1910 { USB_DEVICE(0x050d, 0x7050) },
1911 { USB_DEVICE(0x050d, 0x7051), USB_DEVICE_DATA(&rt2500usb_ops) }, 1911 { USB_DEVICE(0x050d, 0x7051) },
1912 /* Cisco Systems */ 1912 /* Cisco Systems */
1913 { USB_DEVICE(0x13b1, 0x000d), USB_DEVICE_DATA(&rt2500usb_ops) }, 1913 { USB_DEVICE(0x13b1, 0x000d) },
1914 { USB_DEVICE(0x13b1, 0x0011), USB_DEVICE_DATA(&rt2500usb_ops) }, 1914 { USB_DEVICE(0x13b1, 0x0011) },
1915 { USB_DEVICE(0x13b1, 0x001a), USB_DEVICE_DATA(&rt2500usb_ops) }, 1915 { USB_DEVICE(0x13b1, 0x001a) },
1916 /* Conceptronic */ 1916 /* Conceptronic */
1917 { USB_DEVICE(0x14b2, 0x3c02), USB_DEVICE_DATA(&rt2500usb_ops) }, 1917 { USB_DEVICE(0x14b2, 0x3c02) },
1918 /* D-LINK */ 1918 /* D-LINK */
1919 { USB_DEVICE(0x2001, 0x3c00), USB_DEVICE_DATA(&rt2500usb_ops) }, 1919 { USB_DEVICE(0x2001, 0x3c00) },
1920 /* Gigabyte */ 1920 /* Gigabyte */
1921 { USB_DEVICE(0x1044, 0x8001), USB_DEVICE_DATA(&rt2500usb_ops) }, 1921 { USB_DEVICE(0x1044, 0x8001) },
1922 { USB_DEVICE(0x1044, 0x8007), USB_DEVICE_DATA(&rt2500usb_ops) }, 1922 { USB_DEVICE(0x1044, 0x8007) },
1923 /* Hercules */ 1923 /* Hercules */
1924 { USB_DEVICE(0x06f8, 0xe000), USB_DEVICE_DATA(&rt2500usb_ops) }, 1924 { USB_DEVICE(0x06f8, 0xe000) },
1925 /* Melco */ 1925 /* Melco */
1926 { USB_DEVICE(0x0411, 0x005e), USB_DEVICE_DATA(&rt2500usb_ops) }, 1926 { USB_DEVICE(0x0411, 0x005e) },
1927 { USB_DEVICE(0x0411, 0x0066), USB_DEVICE_DATA(&rt2500usb_ops) }, 1927 { USB_DEVICE(0x0411, 0x0066) },
1928 { USB_DEVICE(0x0411, 0x0067), USB_DEVICE_DATA(&rt2500usb_ops) }, 1928 { USB_DEVICE(0x0411, 0x0067) },
1929 { USB_DEVICE(0x0411, 0x008b), USB_DEVICE_DATA(&rt2500usb_ops) }, 1929 { USB_DEVICE(0x0411, 0x008b) },
1930 { USB_DEVICE(0x0411, 0x0097), USB_DEVICE_DATA(&rt2500usb_ops) }, 1930 { USB_DEVICE(0x0411, 0x0097) },
1931 /* MSI */ 1931 /* MSI */
1932 { USB_DEVICE(0x0db0, 0x6861), USB_DEVICE_DATA(&rt2500usb_ops) }, 1932 { USB_DEVICE(0x0db0, 0x6861) },
1933 { USB_DEVICE(0x0db0, 0x6865), USB_DEVICE_DATA(&rt2500usb_ops) }, 1933 { USB_DEVICE(0x0db0, 0x6865) },
1934 { USB_DEVICE(0x0db0, 0x6869), USB_DEVICE_DATA(&rt2500usb_ops) }, 1934 { USB_DEVICE(0x0db0, 0x6869) },
1935 /* Ralink */ 1935 /* Ralink */
1936 { USB_DEVICE(0x148f, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, 1936 { USB_DEVICE(0x148f, 0x1706) },
1937 { USB_DEVICE(0x148f, 0x2570), USB_DEVICE_DATA(&rt2500usb_ops) }, 1937 { USB_DEVICE(0x148f, 0x2570) },
1938 { USB_DEVICE(0x148f, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, 1938 { USB_DEVICE(0x148f, 0x9020) },
1939 /* Sagem */ 1939 /* Sagem */
1940 { USB_DEVICE(0x079b, 0x004b), USB_DEVICE_DATA(&rt2500usb_ops) }, 1940 { USB_DEVICE(0x079b, 0x004b) },
1941 /* Siemens */ 1941 /* Siemens */
1942 { USB_DEVICE(0x0681, 0x3c06), USB_DEVICE_DATA(&rt2500usb_ops) }, 1942 { USB_DEVICE(0x0681, 0x3c06) },
1943 /* SMC */ 1943 /* SMC */
1944 { USB_DEVICE(0x0707, 0xee13), USB_DEVICE_DATA(&rt2500usb_ops) }, 1944 { USB_DEVICE(0x0707, 0xee13) },
1945 /* Spairon */ 1945 /* Spairon */
1946 { USB_DEVICE(0x114b, 0x0110), USB_DEVICE_DATA(&rt2500usb_ops) }, 1946 { USB_DEVICE(0x114b, 0x0110) },
1947 /* SURECOM */ 1947 /* SURECOM */
1948 { USB_DEVICE(0x0769, 0x11f3), USB_DEVICE_DATA(&rt2500usb_ops) }, 1948 { USB_DEVICE(0x0769, 0x11f3) },
1949 /* Trust */ 1949 /* Trust */
1950 { USB_DEVICE(0x0eb0, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, 1950 { USB_DEVICE(0x0eb0, 0x9020) },
1951 /* VTech */ 1951 /* VTech */
1952 { USB_DEVICE(0x0f88, 0x3012), USB_DEVICE_DATA(&rt2500usb_ops) }, 1952 { USB_DEVICE(0x0f88, 0x3012) },
1953 /* Zinwell */ 1953 /* Zinwell */
1954 { USB_DEVICE(0x5a57, 0x0260), USB_DEVICE_DATA(&rt2500usb_ops) }, 1954 { USB_DEVICE(0x5a57, 0x0260) },
1955 { 0, } 1955 { 0, }
1956}; 1956};
1957 1957
@@ -1962,10 +1962,16 @@ MODULE_SUPPORTED_DEVICE("Ralink RT2570 USB chipset based cards");
1962MODULE_DEVICE_TABLE(usb, rt2500usb_device_table); 1962MODULE_DEVICE_TABLE(usb, rt2500usb_device_table);
1963MODULE_LICENSE("GPL"); 1963MODULE_LICENSE("GPL");
1964 1964
1965static int rt2500usb_probe(struct usb_interface *usb_intf,
1966 const struct usb_device_id *id)
1967{
1968 return rt2x00usb_probe(usb_intf, &rt2500usb_ops);
1969}
1970
1965static struct usb_driver rt2500usb_driver = { 1971static struct usb_driver rt2500usb_driver = {
1966 .name = KBUILD_MODNAME, 1972 .name = KBUILD_MODNAME,
1967 .id_table = rt2500usb_device_table, 1973 .id_table = rt2500usb_device_table,
1968 .probe = rt2x00usb_probe, 1974 .probe = rt2500usb_probe,
1969 .disconnect = rt2x00usb_disconnect, 1975 .disconnect = rt2x00usb_disconnect,
1970 .suspend = rt2x00usb_suspend, 1976 .suspend = rt2x00usb_suspend,
1971 .resume = rt2x00usb_resume, 1977 .resume = rt2x00usb_resume,