aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800pci.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/rt2800pci.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/rt2800pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c58
1 files changed, 32 insertions, 26 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 46c3e3c83e31..6f91a9ad4d31 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1117,36 +1117,36 @@ static const struct rt2x00_ops rt2800pci_ops = {
1117 */ 1117 */
1118#ifdef CONFIG_PCI 1118#ifdef CONFIG_PCI
1119static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = { 1119static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
1120 { PCI_DEVICE(0x1814, 0x0601), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1120 { PCI_DEVICE(0x1814, 0x0601) },
1121 { PCI_DEVICE(0x1814, 0x0681), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1121 { PCI_DEVICE(0x1814, 0x0681) },
1122 { PCI_DEVICE(0x1814, 0x0701), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1122 { PCI_DEVICE(0x1814, 0x0701) },
1123 { PCI_DEVICE(0x1814, 0x0781), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1123 { PCI_DEVICE(0x1814, 0x0781) },
1124 { PCI_DEVICE(0x1814, 0x3090), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1124 { PCI_DEVICE(0x1814, 0x3090) },
1125 { PCI_DEVICE(0x1814, 0x3091), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1125 { PCI_DEVICE(0x1814, 0x3091) },
1126 { PCI_DEVICE(0x1814, 0x3092), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1126 { PCI_DEVICE(0x1814, 0x3092) },
1127 { PCI_DEVICE(0x1432, 0x7708), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1127 { PCI_DEVICE(0x1432, 0x7708) },
1128 { PCI_DEVICE(0x1432, 0x7727), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1128 { PCI_DEVICE(0x1432, 0x7727) },
1129 { PCI_DEVICE(0x1432, 0x7728), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1129 { PCI_DEVICE(0x1432, 0x7728) },
1130 { PCI_DEVICE(0x1432, 0x7738), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1130 { PCI_DEVICE(0x1432, 0x7738) },
1131 { PCI_DEVICE(0x1432, 0x7748), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1131 { PCI_DEVICE(0x1432, 0x7748) },
1132 { PCI_DEVICE(0x1432, 0x7758), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1132 { PCI_DEVICE(0x1432, 0x7758) },
1133 { PCI_DEVICE(0x1432, 0x7768), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1133 { PCI_DEVICE(0x1432, 0x7768) },
1134 { PCI_DEVICE(0x1462, 0x891a), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1134 { PCI_DEVICE(0x1462, 0x891a) },
1135 { PCI_DEVICE(0x1a3b, 0x1059), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1135 { PCI_DEVICE(0x1a3b, 0x1059) },
1136#ifdef CONFIG_RT2800PCI_RT33XX 1136#ifdef CONFIG_RT2800PCI_RT33XX
1137 { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1137 { PCI_DEVICE(0x1814, 0x3390) },
1138#endif 1138#endif
1139#ifdef CONFIG_RT2800PCI_RT35XX 1139#ifdef CONFIG_RT2800PCI_RT35XX
1140 { PCI_DEVICE(0x1432, 0x7711), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1140 { PCI_DEVICE(0x1432, 0x7711) },
1141 { PCI_DEVICE(0x1432, 0x7722), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1141 { PCI_DEVICE(0x1432, 0x7722) },
1142 { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1142 { PCI_DEVICE(0x1814, 0x3060) },
1143 { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1143 { PCI_DEVICE(0x1814, 0x3062) },
1144 { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1144 { PCI_DEVICE(0x1814, 0x3562) },
1145 { PCI_DEVICE(0x1814, 0x3592), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1145 { PCI_DEVICE(0x1814, 0x3592) },
1146 { PCI_DEVICE(0x1814, 0x3593), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1146 { PCI_DEVICE(0x1814, 0x3593) },
1147#endif 1147#endif
1148#ifdef CONFIG_RT2800PCI_RT53XX 1148#ifdef CONFIG_RT2800PCI_RT53XX
1149 { PCI_DEVICE(0x1814, 0x5390), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1149 { PCI_DEVICE(0x1814, 0x5390) },
1150#endif 1150#endif
1151 { 0, } 1151 { 0, }
1152}; 1152};
@@ -1182,10 +1182,16 @@ static struct platform_driver rt2800soc_driver = {
1182#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */ 1182#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
1183 1183
1184#ifdef CONFIG_PCI 1184#ifdef CONFIG_PCI
1185static int rt2800pci_probe(struct pci_dev *pci_dev,
1186 const struct pci_device_id *id)
1187{
1188 return rt2x00pci_probe(pci_dev, &rt2800pci_ops);
1189}
1190
1185static struct pci_driver rt2800pci_driver = { 1191static struct pci_driver rt2800pci_driver = {
1186 .name = KBUILD_MODNAME, 1192 .name = KBUILD_MODNAME,
1187 .id_table = rt2800pci_device_table, 1193 .id_table = rt2800pci_device_table,
1188 .probe = rt2x00pci_probe, 1194 .probe = rt2800pci_probe,
1189 .remove = __devexit_p(rt2x00pci_remove), 1195 .remove = __devexit_p(rt2x00pci_remove),
1190 .suspend = rt2x00pci_suspend, 1196 .suspend = rt2x00pci_suspend,
1191 .resume = rt2x00pci_resume, 1197 .resume = rt2x00pci_resume,