int __devinit
dhdpcie_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
-#ifdef BUS_POWER_RESTORE
- wifi_adapter_info_t *adapter = NULL;
-#endif
+ DHD_MUTEX_LOCK();
if (dhdpcie_chipmatch (pdev->vendor, pdev->device)) {
DHD_ERROR(("%s: chipmatch failed!!\n", __FUNCTION__));
device_disable_async_suspend(&pdev->dev);
#endif /* BCMPCIE_DISABLE_ASYNC_SUSPEND */
-#ifdef BUS_POWER_RESTORE
- adapter = dhd_wifi_platform_get_adapter(PCI_BUS, pdev->bus->number,
- PCI_SLOT(pdev->devfn));
-
- if (adapter != NULL)
- adapter->pci_dev = pdev;
-#endif
-
DHD_TRACE(("%s: PCIe Enumeration done!!\n", __FUNCTION__));
+ DHD_MUTEX_UNLOCK();
return 0;
}
DHD_TRACE(("%s Enter\n", __FUNCTION__));
-#if defined(MULTIPLE_SUPPLICANT)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
- if (mutex_is_locked(&_dhd_sdio_mutex_lock_) == 0) {
- DHD_ERROR(("%s : no mutex held. set lock\n", __FUNCTION__));
- }
- else {
- DHD_ERROR(("%s : mutex is locked!. wait for unlocking\n", __FUNCTION__));
- }
- mutex_lock(&_dhd_sdio_mutex_lock_);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) */
-#endif
+ DHD_MUTEX_LOCK();
pch = pci_get_drvdata(pdev);
bus = pch->bus;
dhdpcie_init_succeeded = FALSE;
-#if defined(MULTIPLE_SUPPLICANT)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
- mutex_unlock(&_dhd_sdio_mutex_lock_);
- DHD_ERROR(("%s : the lock is released.\n", __FUNCTION__));
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) */
-#endif /* LINUX */
+ DHD_MUTEX_UNLOCK();
DHD_TRACE(("%s Exit\n", __FUNCTION__));
*/
#endif /* SUPPORT_LINKDOWN_RECOVERY */
-#if defined(MULTIPLE_SUPPLICANT)
-extern void wl_android_post_init(void); // terence 20120530: fix critical section in dhd_open and dhdsdio_probe
-#endif
-
int dhdpcie_init(struct pci_dev *pdev)
{
dhdpcie_smmu_info_t *dhdpcie_smmu_info = NULL;
#endif /* USE_SMMU_ARCH_MSM */
-#if defined(MULTIPLE_SUPPLICANT)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
- if (mutex_is_locked(&_dhd_sdio_mutex_lock_) == 0) {
- DHD_ERROR(("%s : no mutex held. set lock\n", __FUNCTION__));
- }
- else {
- DHD_ERROR(("%s : mutex is locked!. wait for unlocking\n", __FUNCTION__));
- }
- mutex_lock(&_dhd_sdio_mutex_lock_);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) */
-#endif
-
do {
/* osl attach */
if (!(osh = osl_attach(pdev, PCI_BUS, FALSE))) {
/* initialize static buffer */
adapter = dhd_wifi_platform_get_adapter(PCI_BUS, pdev->bus->number,
PCI_SLOT(pdev->devfn));
- if (adapter != NULL)
+ if (adapter != NULL) {
DHD_ERROR(("%s: found adapter info '%s'\n", __FUNCTION__, adapter->name));
- else
+#ifdef BUS_POWER_RESTORE
+ adapter->pci_dev = pdev;
+#endif
+ } else
DHD_ERROR(("%s: can't find adapter info for this chip\n", __FUNCTION__));
osl_static_mem_init(osh, adapter);
#if defined(MULTIPLE_SUPPLICANT)
wl_android_post_init(); // terence 20120530: fix critical section in dhd_open and dhdsdio_probe
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
- mutex_unlock(&_dhd_sdio_mutex_lock_);
- DHD_ERROR(("%s : the lock is released.\n", __FUNCTION__));
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
-#endif
+#endif /* MULTIPLE_SUPPLICANT */
DHD_TRACE(("%s:Exit - SUCCESS \n", __FUNCTION__));
return 0; /* return SUCCESS */
osl_detach(osh);
dhdpcie_init_succeeded = FALSE;
-#if defined(MULTIPLE_SUPPLICANT)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
- mutex_unlock(&_dhd_sdio_mutex_lock_);
- DHD_ERROR(("%s : the lock is released.\n", __FUNCTION__));
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
-#endif
DHD_TRACE(("%s:Exit - FAILURE \n", __FUNCTION__));
return bus->runtime_resume_done;
}
#endif /* DHD_PCIE_RUNTIMEPM */
+
struct device * dhd_bus_to_dev(dhd_bus_t *bus)
{
struct pci_dev *pdev;
else
return NULL;
}
+
#ifdef HOFFLOAD_MODULES
void
dhd_free_module_memory(struct dhd_bus *bus, struct module_metadata *hmem)