wifi: add bcmdhd.1.363.59.144 driver to support kernel4.9
authorRongjun Chen <rongjun.chen@amlogic.com>
Sat, 1 Apr 2017 09:05:56 +0000 (17:05 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Sat, 1 Apr 2017 09:09:18 +0000 (17:09 +0800)
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
Change-Id: I2c26b7eded92608d73539cc0e499ac492e21ba3a

bcmdhd.1.363.59.144.x.cn/dhd_gpio.c
bcmdhd.1.363.59.144.x.cn/dhd_linux.c
bcmdhd.1.363.59.144.x.cn/linux_osl.c
bcmdhd.1.363.59.144.x.cn/wl_cfg80211.c

index ea105485c3b5477cec17251acea46cf91c01298d..86d01d11b3d2c1ce89969c2602c0a39235d32462 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/gpio.h>
 #endif
 
+#include <linux/amlogic/aml_gpio_consumer.h>
+extern int wifi_irq_trigger_level(void);
 #ifdef CUSTOMER_HW_AMLOGIC
 extern  void sdio_reinit(void);
 extern void extern_wifi_set_enable(int is_on);
@@ -81,11 +83,11 @@ uint bcm_wlan_get_oob_irq_flags(void)
        uint host_oob_irq_flags = 0;
 
 #ifdef HW_OOB
-#ifdef HW_OOB_LOW_LEVEL
-       host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_SHAREABLE;
-#else
-       host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
-#endif
+       if (wifi_irq_trigger_level() == GPIO_IRQ_LOW)
+               host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_SHAREABLE;
+       else
+               host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
+
 #else
        host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_SHAREABLE;
 #endif
index 6994c806e0ab420de0a9b14b0d88f86ab97b549c..c64f85111d846ccde686425f481b53e0144ac42c 100644 (file)
@@ -3978,10 +3978,10 @@ dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
 #ifdef PCIE_FULL_DONGLE
                dhd->pub.dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_TX;
                dhd_os_busbusy_wake(&dhd->pub);
-               DHD_GENERAL_UNLOCK(&dhd->pub, flags);
 #endif /* PCIE_FULL_DONGLE */
                DHD_PERIM_UNLOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
                DHD_OS_WAKE_UNLOCK(&dhd->pub);
+               DHD_GENERAL_UNLOCK(&dhd->pub, flags);
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20))
                return -ENODEV;
 #else
@@ -3999,10 +3999,10 @@ dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
 #ifdef PCIE_FULL_DONGLE
                dhd->pub.dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_TX;
                dhd_os_busbusy_wake(&dhd->pub);
-               DHD_GENERAL_UNLOCK(&dhd->pub, flags);
 #endif /* PCIE_FULL_DONGLE */
                DHD_PERIM_UNLOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
                DHD_OS_WAKE_UNLOCK(&dhd->pub);
+               DHD_GENERAL_UNLOCK(&dhd->pub, flags);
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20))
                return -ENODEV;
 #else
index 065286748811f326cf37219ad9cbb0892d152dfc..4da7b4fb7126942e3e4a138a22e306330e17a9a0 100644 (file)
@@ -47,7 +47,7 @@
 #include <bcmutils.h>
 #include <linux/delay.h>
 #include <pcicfg.h>
-#include <asm-generic/pci-dma-compat.h>
+/*#include <asm-generic/pci-dma-compat.h>*/
 
 
 #ifdef BCM_SECURE_DMA
index 98d5f80adcd09ed5e72d6f5dcecf8f1330405cc0..04f6633ed00a07e57ceea1f6df7c3c7034105694 100644 (file)
@@ -5547,6 +5547,9 @@ wl_cfg80211_suspend(struct wiphy *wiphy)
        struct net_info *iter, *next;
        struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
        unsigned long flags;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+       struct cfg80211_scan_info info;
+       #endif
        if (unlikely(!wl_get_drv_status(cfg, READY, ndev))) {
                WL_INFORM(("device is not ready : status (%d)\n",
                        (int)cfg->status));
@@ -5559,7 +5562,12 @@ wl_cfg80211_suspend(struct wiphy *wiphy)
                }
        spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
        if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+               info.aborted = true;
+               cfg80211_scan_done(cfg->scan_request, &info);
+#else
                cfg80211_scan_done(cfg->scan_request, true);
+#endif
                cfg->scan_request = NULL;
        }
        for_each_ndev(cfg, iter, next) {
@@ -11083,6 +11091,9 @@ wl_notify_scan_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
        s32 err = 0;
        unsigned long flags;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+       struct cfg80211_scan_info info;
+#endif
        WL_DBG(("Enter \n"));
        if (!wl_get_drv_status(cfg, SCANNING, ndev)) {
                WL_ERR(("scan is not ready \n"));
@@ -11124,7 +11135,12 @@ scan_done_out:
        del_timer_sync(&cfg->scan_timeout);
        spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
        if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+               info.aborted = false;
+               cfg80211_scan_done(cfg->scan_request, &info);
+#else
                cfg80211_scan_done(cfg->scan_request, false);
+#endif
                cfg->scan_request = NULL;
        }
        spin_unlock_irqrestore(&cfg->cfgdrv_lock, flags);
@@ -12128,7 +12144,10 @@ static s32 wl_notify_escan_complete(struct bcm_cfg80211 *cfg,
        s32 err = BCME_OK;
        unsigned long flags;
        struct net_device *dev;
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+       struct cfg80211_scan_info info;
+       info.aborted = aborted;
+#endif
        WL_DBG(("Enter \n"));
 
        mutex_lock(&cfg->scan_complete);
@@ -12186,7 +12205,11 @@ static s32 wl_notify_escan_complete(struct bcm_cfg80211 *cfg,
        }
 #endif /* WL_SCHED_SCAN */
        if (likely(cfg->scan_request)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+               cfg80211_scan_done(cfg->scan_request, &info);
+#else
                cfg80211_scan_done(cfg->scan_request, aborted);
+#endif
                cfg->scan_request = NULL;
                DHD_OS_SCAN_WAKE_UNLOCK((dhd_pub_t *)(cfg->pub));
                DHD_ENABLE_RUNTIME_PM((dhd_pub_t *)(cfg->pub));
@@ -13997,6 +14020,11 @@ static s32 __wl_cfg80211_down(struct bcm_cfg80211 *cfg)
        dhd_pub_t *dhd =  (dhd_pub_t *)(cfg->pub);
 #endif
 #endif /* PROP_TXSTATUS_VSDB */
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+       struct cfg80211_scan_info info;
+#endif
+
        WL_DBG(("In\n"));
        /* Delete pm_enable_work */
        wl_add_remove_pm_enable_work(cfg, WL_PM_WORKQ_DEL);
@@ -14056,7 +14084,12 @@ _Pragma("GCC diagnostic pop")
 
        spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
        if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+               info.aborted = true;
+               cfg80211_scan_done(cfg->scan_request, &info);
+#else
                cfg80211_scan_done(cfg->scan_request, true);
+#endif
                cfg->scan_request = NULL;
        }
        spin_unlock_irqrestore(&cfg->cfgdrv_lock, flags);
@@ -16067,7 +16100,9 @@ int wl_cfg80211_scan_stop(bcm_struct_cfgdev *cfgdev)
        unsigned long flags;
        int clear_flag = 0;
        int ret = 0;
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+       struct cfg80211_scan_info info;
+#endif
        WL_TRACE(("Enter\n"));
 
        cfg = g_bcm_cfg;
@@ -16083,7 +16118,12 @@ int wl_cfg80211_scan_stop(bcm_struct_cfgdev *cfgdev)
        if (cfg->scan_request && cfg->scan_request->dev == cfgdev)
 #endif
        {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+               info.aborted = true;
+               cfg80211_scan_done(cfg->scan_request, &info);
+#else
                cfg80211_scan_done(cfg->scan_request, true);
+#endif
                cfg->scan_request = NULL;
                clear_flag = 1;
        }