};
MODULE_DEVICE_TABLE(pci, wl_id_table);
+static void __devexit wl_remove(struct pci_dev *pdev);
#endif /* !BCMSDIO */
#ifdef BCMSDIO
#ifndef WLC_HIGH_ONLY
/* prepare ucode */
if (wl_request_fw(wl, (struct pci_dev *)btparam)) {
- printf("%s: %s driver failed\n", KBUILD_MODNAME,
- EPI_VERSION_STR);
- goto fail;
+ printf("%s: Failed to find firmware usually in %s\n",
+ KBUILD_MODNAME, "/lib/firmware/brcm");
+ wl_release_fw(wl);
+ wl_remove((struct pci_dev *)btparam);
+ goto fail1;
}
#endif
wl_release_fw(wl);
#endif
if (!wl->wlc) {
- printf("%s: %s driver failed with code %d\n", KBUILD_MODNAME,
- EPI_VERSION_STR, err);
+ printf("%s: %s wlc_attach() failed with code %d\n",
+ KBUILD_MODNAME, EPI_VERSION_STR, err);
goto fail;
}
wl->pub = wlc_pub(wl->wlc);
fail:
wl_free(wl);
+ fail1:
return NULL;
}
}
#endif /* WLC_HIGH_ONLY */
-#ifndef BCMSDIO
-static void __devexit wl_remove(struct pci_dev *pdev);
-#endif
#define CHAN2GHZ(channel, freqency, chflags) { \
.band = IEEE80211_BAND_2GHZ, \
wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0),
PCI_BUS, pdev, pdev->irq);
+ if (!wl) {
+ WL_ERROR(("%s: %s: wl_attach failed!\n",
+ KBUILD_MODNAME, __func__));
+ return -ENODEV;
+ }
return 0;
err_1:
WL_ERROR(("%s: err_1: Major hoarkage\n", __func__));
WL_ERROR(("wl: wl_remove: wlc_chipmatch failed\n"));
return;
}
-
- ieee80211_unregister_hw(hw);
-
- WL_LOCK(wl);
- wl_down(wl);
- WL_UNLOCK(wl);
- WL_NONE(("%s: Down\n", __func__));
-
+ if (wl->wlc) {
+ ieee80211_unregister_hw(hw);
+ WL_LOCK(wl);
+ wl_down(wl);
+ WL_UNLOCK(wl);
+ WL_NONE(("%s: Down\n", __func__));
+ }
pci_disable_device(pdev);
wl_free(wl);
WL_NONE(("request fw %s\n", fw_name));
status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
if (status) {
- printf("fail to request firmware %s\n", fw_name);
+ printf("%s: fail to load firmware %s\n",
+ KBUILD_MODNAME, fw_name);
wl_release_fw(wl);
return status;
}
UCODE_LOADER_API_VER);
status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
if (status) {
- printf("fail to request firmware %s\n", fw_name);
+ printf("%s: fail to load firmware %s\n",
+ KBUILD_MODNAME, fw_name);
wl_release_fw(wl);
return status;
}