summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSundar Subramaniyan <subrams@qti.qualcomm.com>2013-11-07 14:34:58 +0530
committerMadan Mohan Koyyalamudi <mkoyyala@qca.qualcomm.com>2013-11-19 16:24:02 -0800
commit00ee3810e1bda60e2351927cb7a6749f3945e81a (patch)
treee25f8a932b0d02128e30d53c9f57b1e390128444
parentfc55c7eabb9514084d4f2560ff004ebfcff00f09 (diff)
qcacld-2.0: Add platform driver based driver registration
To manage the power and suspend/resume sequences properly in MSM target, the WLAN driver is registered to a platform driver instead of registering as PCI device driver with the kernel. The platform driver registers with kernel as a PCI device driver on behalf of WLAN driver. It is responsible for controlling 3.3V, WLAN_EN GPIO and PCIe link dynamically when WLAN driver is turned ON or OFF. The probe, remove, suspend and remove callbacks are piggy backed to the WLAN driver from the platform driver. Change-Id: I31f802edd00e46167f62ed0221d244144bc48e18 CRs-Fixed: 571547
-rw-r--r--CORE/SERVICES/HIF/PCIe/if_pci.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c
index ce1b91c43c00..b953187c7cf6 100644
--- a/CORE/SERVICES/HIF/PCIe/if_pci.c
+++ b/CORE/SERVICES/HIF/PCIe/if_pci.c
@@ -38,6 +38,9 @@
#include <osapi_linux.h>
#include "vos_api.h"
#include "wma_api.h"
+#ifdef CONFIG_CNSS
+#include <net/cnss.h>
+#endif
#ifdef WLAN_BTAMP_FEATURE
#include "wlan_btc_svc.h"
@@ -1008,6 +1011,18 @@ adf_os_size_t initBufferCount(adf_os_size_t maxSize)
return maxSize;
}
+#ifdef CONFIG_CNSS
+struct cnss_wlan_driver cnss_wlan_drv_id = {
+ .name = "hif_pci",
+ .id_table = hif_pci_id_table,
+ .probe = hif_pci_probe,
+ .remove = hif_pci_remove,
+#ifdef ATH_BUS_PM
+ .suspend = hif_pci_suspend,
+ .resume = hif_pci_resume,
+#endif
+};
+#else
MODULE_DEVICE_TABLE(pci, hif_pci_id_table);
struct pci_driver hif_pci_drv_id = {
.name = "hif_pci",
@@ -1019,15 +1034,24 @@ struct pci_driver hif_pci_drv_id = {
.resume = hif_pci_resume,
#endif
};
+#endif
int hif_register_driver(void)
{
+#ifdef CONFIG_CNSS
+ return cnss_wlan_register_driver(&cnss_wlan_drv_id);
+#else
return pci_register_driver(&hif_pci_drv_id);
+#endif
}
void hif_unregister_driver(void)
{
+#ifdef CONFIG_CNSS
+ cnss_wlan_unregister_driver(&cnss_wlan_drv_id);
+#else
pci_unregister_driver(&hif_pci_drv_id);
+#endif
}
void hif_init_pdev_txrx_handle(void *ol_sc, void *txrx_handle)