PD#142137 wifi: fix wifi open fail
authorRongjun Chen <rongjun.chen@amlogic.com>
Wed, 5 Apr 2017 10:06:07 +0000 (18:06 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Wed, 5 Apr 2017 10:06:07 +0000 (18:06 +0800)
Change-Id: Ide6e1a3cdbc5a46b74cfa5f90863e4033df649ec

bcmdhd.1.363.59.144.x.cn/bcmsdh_linux.c
bcmdhd.1.363.59.144.x.cn/dhd_gpio.c

index 51577f5f1ebb706c22645933ee0edf355e999fb0..5b0f5fb7336e27975838faaefce17d91732deb29 100644 (file)
@@ -324,8 +324,9 @@ static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
 {
        bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)dev_id;
        bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt;
-
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 8, 0))
        bcmsdh_oob_intr_set(bcmsdh, FALSE);
+#endif
        bcmsdh_osinfo->oob_irq_handler(bcmsdh_osinfo->oob_irq_handler_context);
 
        return IRQ_HANDLED;
index 86d01d11b3d2c1ce89969c2602c0a39235d32462..89c194e1f520bde276c66873f4e0eb8d5f208f3c 100644 (file)
 #include <linux/mmc/sdio_func.h>
 #include <linux/gpio.h>
 #endif
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
 #include <linux/amlogic/aml_gpio_consumer.h>
 extern int wifi_irq_trigger_level(void);
+#endif
 #ifdef CUSTOMER_HW_AMLOGIC
 extern  void sdio_reinit(void);
 extern void extern_wifi_set_enable(int is_on);
@@ -83,11 +84,18 @@ uint bcm_wlan_get_oob_irq_flags(void)
        uint host_oob_irq_flags = 0;
 
 #ifdef HW_OOB
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
        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
+#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
+#endif
 #else
        host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_SHAREABLE;
 #endif