diff options
author | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:40:16 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:54:41 -0500 |
commit | bcb628d579a61d0ab0cac4c6cc8a403de5254920 (patch) | |
tree | 800c60feb94689d85a41bb6995f0f87ba8b8b664 /drivers | |
parent | 6f6d1e9a8a7fea5e4400cad64bed717e322208e1 (diff) |
mwl8k: use integral index instead of pointer for driver_data
Use of an integral index makes adding new device IDs through sysfs more
practical.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 9fde17bb9911..2ebfee4da3fa 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3308,34 +3308,33 @@ static void mwl8k_finalize_join_worker(struct work_struct *work) | |||
3308 | priv->beacon_skb = NULL; | 3308 | priv->beacon_skb = NULL; |
3309 | } | 3309 | } |
3310 | 3310 | ||
3311 | static struct mwl8k_device_info di_8366 = { | 3311 | enum { |
3312 | .part_name = "88w8366", | 3312 | MWL8687 = 0, |
3313 | .helper_image = "mwl8k/helper_8366.fw", | 3313 | MWL8366, |
3314 | .fw_image = "mwl8k/fmimage_8366.fw", | ||
3315 | .rxd_ops = &rxd_8366_ops, | ||
3316 | .modes = 0, | ||
3317 | }; | 3314 | }; |
3318 | 3315 | ||
3319 | static struct mwl8k_device_info di_8687 = { | 3316 | static struct mwl8k_device_info mwl8k_info_tbl[] __devinitdata = { |
3320 | .part_name = "88w8687", | 3317 | { |
3321 | .helper_image = "mwl8k/helper_8687.fw", | 3318 | .part_name = "88w8687", |
3322 | .fw_image = "mwl8k/fmimage_8687.fw", | 3319 | .helper_image = "mwl8k/helper_8687.fw", |
3323 | .rxd_ops = &rxd_8687_ops, | 3320 | .fw_image = "mwl8k/fmimage_8687.fw", |
3324 | .modes = BIT(NL80211_IFTYPE_STATION), | 3321 | .rxd_ops = &rxd_8687_ops, |
3322 | .modes = BIT(NL80211_IFTYPE_STATION), | ||
3323 | }, | ||
3324 | { | ||
3325 | .part_name = "88w8366", | ||
3326 | .helper_image = "mwl8k/helper_8366.fw", | ||
3327 | .fw_image = "mwl8k/fmimage_8366.fw", | ||
3328 | .rxd_ops = &rxd_8366_ops, | ||
3329 | .modes = 0, | ||
3330 | }, | ||
3325 | }; | 3331 | }; |
3326 | 3332 | ||
3327 | static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = { | 3333 | static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = { |
3328 | { | 3334 | { PCI_VDEVICE(MARVELL, 0x2a2b), .driver_data = MWL8687, }, |
3329 | PCI_VDEVICE(MARVELL, 0x2a2b), | 3335 | { PCI_VDEVICE(MARVELL, 0x2a30), .driver_data = MWL8687, }, |
3330 | .driver_data = (unsigned long)&di_8687, | 3336 | { PCI_VDEVICE(MARVELL, 0x2a40), .driver_data = MWL8366, }, |
3331 | }, { | 3337 | { }, |
3332 | PCI_VDEVICE(MARVELL, 0x2a30), | ||
3333 | .driver_data = (unsigned long)&di_8687, | ||
3334 | }, { | ||
3335 | PCI_VDEVICE(MARVELL, 0x2a40), | ||
3336 | .driver_data = (unsigned long)&di_8366, | ||
3337 | }, { | ||
3338 | }, | ||
3339 | }; | 3338 | }; |
3340 | MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table); | 3339 | MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table); |
3341 | 3340 | ||
@@ -3379,7 +3378,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3379 | priv = hw->priv; | 3378 | priv = hw->priv; |
3380 | priv->hw = hw; | 3379 | priv->hw = hw; |
3381 | priv->pdev = pdev; | 3380 | priv->pdev = pdev; |
3382 | priv->device_info = (void *)id->driver_data; | 3381 | priv->device_info = &mwl8k_info_tbl[id->driver_data]; |
3383 | priv->rxd_ops = priv->device_info->rxd_ops; | 3382 | priv->rxd_ops = priv->device_info->rxd_ops; |
3384 | priv->sniffer_enabled = false; | 3383 | priv->sniffer_enabled = false; |
3385 | priv->wmm_enabled = false; | 3384 | priv->wmm_enabled = false; |