|
@@ -70,6 +70,7 @@
|
|
|
#include "iwl-trans.h"
|
|
|
#include "iwl-csr.h"
|
|
|
#include "iwl-cfg.h"
|
|
|
+#include "iwl-wifi.h"
|
|
|
|
|
|
#define IWL_PCI_DEVICE(dev, subdev, cfg) \
|
|
|
.vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \
|
|
@@ -282,13 +283,23 @@ 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_bus;
|
|
|
+ goto out_free_nic;
|
|
|
}
|
|
|
|
|
|
err = iwl_probe(bus, &trans_ops_idi, cfg);
|
|
@@ -296,7 +307,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
trans(bus) = iwl_trans_pcie_alloc(bus->shrd, pdev, ent);
|
|
|
if (trans(bus) == NULL) {
|
|
|
err = -ENOMEM;
|
|
|
- goto out_free_bus;
|
|
|
+ goto out_free_nic;
|
|
|
}
|
|
|
|
|
|
err = iwl_probe(bus, &trans_ops_pcie, cfg);
|
|
@@ -309,6 +320,8 @@ 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);
|
|
@@ -325,6 +338,7 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
|
|
|
|
|
|
pci_set_drvdata(pdev, NULL);
|
|
|
|
|
|
+ kfree(bus->shrd->nic);
|
|
|
kfree(bus->shrd);
|
|
|
kfree(bus);
|
|
|
}
|