diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-02-07 13:18:40 +0100 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-27 22:25:15 +0100 |
commit | 5c58edc63edd6cd8097e2bee90e2d341e33bcd60 (patch) | |
tree | e6e1e1a03a837e8c5a9944adc3aa07275df68084 /drivers/net/wireless/iwlwifi/iwl-pci.c | |
parent | iwlwifi: move uCode flags handling to op_mode (diff) | |
download | linux-5c58edc63edd6cd8097e2bee90e2d341e33bcd60.tar.xz linux-5c58edc63edd6cd8097e2bee90e2d341e33bcd60.zip |
iwlwifi: introducing the drv object's flows
Fetch the fw and spawn the op_mode. The op_mode that we need
to fetch is determined from the fw file.
Since the fw is fetched very early in the init flow, we can
determine what op_mode to spawn.
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.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index 519067020534..e2695445dfac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c @@ -70,7 +70,7 @@ #include "iwl-trans.h" #include "iwl-csr.h" #include "iwl-cfg.h" -#include "iwl-wifi.h" +#include "iwl-drv.h" #define IWL_PCI_DEVICE(dev, subdev, cfg) \ .vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \ @@ -283,34 +283,24 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) bus->shrd->bus = bus; - /* temporarily create this here */ - bus->shrd->nic = kzalloc(sizeof(*bus->shrd->nic), GFP_KERNEL); - if (!bus->shrd->nic) { - dev_printk(KERN_ERR, &pdev->dev, - "Couldn't allocate iwl_nic"); - err = -ENOMEM; - goto out_free_bus; - } - /* and initialize it as well, temporarily */ - bus->shrd->nic->shrd = bus->shrd; pci_set_drvdata(pdev, bus); #ifdef CONFIG_IWLWIFI_IDI trans(bus) = iwl_trans_idi_alloc(bus->shrd, pdev, ent); if (trans(bus) == NULL) { err = -ENOMEM; - goto out_free_nic; + goto out_free_bus; } - err = iwl_probe(bus, &trans_ops_idi, cfg); + err = iwl_drv_start(bus->shrd, trans(bus), cfg); #else trans(bus) = iwl_trans_pcie_alloc(bus->shrd, pdev, ent); if (trans(bus) == NULL) { err = -ENOMEM; - goto out_free_nic; + goto out_free_bus; } - err = iwl_probe(bus, &trans_ops_pcie, cfg); + err = iwl_drv_start(bus->shrd, trans(bus), cfg); #endif if (err) goto out_free_trans; @@ -320,8 +310,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) out_free_trans: iwl_trans_free(trans(bus)); pci_set_drvdata(pdev, NULL); -out_free_nic: - kfree(bus->shrd->nic); out_free_bus: kfree(bus->shrd); kfree(bus); |