aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-pci.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-01-08 14:19:45 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-02 17:37:34 -0500
commit99673ee556fce2fb973eaa571adb12663330caa9 (patch)
tree89666dd629df5549b246b36e8631a24a69ef2083 /drivers/net/wireless/iwlwifi/iwl-pci.c
parent9ca859615212deb7dd0aee26972799d1910d050f (diff)
iwlwifi: kill bus_get_hw_id
Get this information from the transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-pci.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-pci.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 15864760733a..3e2fce4ce00c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -71,33 +71,6 @@
71#include "iwl-csr.h" 71#include "iwl-csr.h"
72#include "iwl-cfg.h" 72#include "iwl-cfg.h"
73 73
74/* PCI registers */
75#define PCI_CFG_RETRY_TIMEOUT 0x041
76#define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01
77#define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02
78
79struct iwl_pci_bus {
80 /* basic pci-network driver stuff */
81 struct pci_dev *pci_dev;
82};
83
84#define IWL_BUS_GET_PCI_BUS(_iwl_bus) \
85 ((struct iwl_pci_bus *) ((_iwl_bus)->bus_specific))
86
87#define IWL_BUS_GET_PCI_DEV(_iwl_bus) \
88 ((IWL_BUS_GET_PCI_BUS(_iwl_bus))->pci_dev)
89
90static u32 iwl_pci_get_hw_id(struct iwl_bus *bus)
91{
92 struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
93
94 return (pci_dev->device << 16) + pci_dev->subsystem_device;
95}
96
97static const struct iwl_bus_ops bus_ops_pci = {
98 .get_hw_id = iwl_pci_get_hw_id,
99};
100
101#define IWL_PCI_DEVICE(dev, subdev, cfg) \ 74#define IWL_PCI_DEVICE(dev, subdev, cfg) \
102 .vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \ 75 .vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \
103 .subvendor = PCI_ANY_ID, .subdevice = (subdev), \ 76 .subvendor = PCI_ANY_ID, .subdevice = (subdev), \
@@ -283,14 +256,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
283}; 256};
284MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids); 257MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
285 258
259/* PCI registers */
260#define PCI_CFG_RETRY_TIMEOUT 0x041
261
286static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 262static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
287{ 263{
288 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); 264 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
289 struct iwl_bus *bus; 265 struct iwl_bus *bus;
290 struct iwl_pci_bus *pci_bus;
291 int err; 266 int err;
292 267
293 bus = kzalloc(sizeof(*bus) + sizeof(*pci_bus), GFP_KERNEL); 268 bus = kzalloc(sizeof(*bus), GFP_KERNEL);
294 if (!bus) { 269 if (!bus) {
295 dev_printk(KERN_ERR, &pdev->dev, 270 dev_printk(KERN_ERR, &pdev->dev,
296 "Couldn't allocate iwl_pci_bus"); 271 "Couldn't allocate iwl_pci_bus");
@@ -306,13 +281,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
306 } 281 }
307 282
308 bus->shrd->bus = bus; 283 bus->shrd->bus = bus;
309 pci_bus = IWL_BUS_GET_PCI_BUS(bus);
310 pci_bus->pci_dev = pdev;
311 284
312 pci_set_drvdata(pdev, bus); 285 pci_set_drvdata(pdev, bus);
313 286
314 bus->ops = &bus_ops_pci;
315
316#ifdef CONFIG_IWLWIFI_IDI 287#ifdef CONFIG_IWLWIFI_IDI
317 trans(bus) = iwl_trans_idi_alloc(bus->shrd, pdev, ent); 288 trans(bus) = iwl_trans_idi_alloc(bus->shrd, pdev, ent);
318 if (trans(bus) == NULL) { 289 if (trans(bus) == NULL) {