From ce3b8cf9f02c0b37f6acd7d8b8422c096c2dd3a9 Mon Sep 17 00:00:00 2001 From: Rongjun Chen Date: Thu, 20 Dec 2018 16:21:30 +0800 Subject: [PATCH] wifi: change usb wifi fw load [1/1] PD#SWPL-3082 Problem: dumpsys usb fail with ap62x8 Solution: change the usb fw load Verify: verify by r311 Change-Id: I36785ea060ec0e4abcc9e19fc58796188760b906 Signed-off-by: Rongjun Chen --- bcmdhd.1.579.77.41.1.cn/Makefile | 2 +- bcmdhd.1.579.77.41.1.cn/dbus.c | 6 +++--- bcmdhd.1.579.77.41.1.cn/dhd_gpio.c | 15 +++++++++++++++ bcmdhd.100.10.315.x/Makefile | 2 +- bcmdhd.100.10.315.x/dbus.c | 4 +++- bcmdhd.100.10.315.x/dhd_gpio.c | 17 +++++++++++++++-- 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/bcmdhd.1.579.77.41.1.cn/Makefile b/bcmdhd.1.579.77.41.1.cn/Makefile index 5669d5c..352b9ad 100644 --- a/bcmdhd.1.579.77.41.1.cn/Makefile +++ b/bcmdhd.1.579.77.41.1.cn/Makefile @@ -77,7 +77,7 @@ ifneq ($(CONFIG_BCMDHD_USB),) DHDCFLAGS += -DUSBOS_TX_THREAD -DBCMDBUS -DBCMTRXV2 -DDBUS_USB_LOOPBACK \ -DBDC DHDCFLAGS += -DBCM_REQUEST_FW -DEXTERNAL_FW_PATH -#DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) +DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) ifneq ($(CONFIG_BCMDHD_CUSB),) DHDCFLAGS += -DBCMUSBDEV_COMPOSITE DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) diff --git a/bcmdhd.1.579.77.41.1.cn/dbus.c b/bcmdhd.1.579.77.41.1.cn/dbus.c index 7c77bbe..beeecd7 100644 --- a/bcmdhd.1.579.77.41.1.cn/dbus.c +++ b/bcmdhd.1.579.77.41.1.cn/dbus.c @@ -644,10 +644,10 @@ dbus_get_fw_nvram(dhd_bus_t *dhd_bus, char *pfw_path, char *pnv_path) bcmerror = DBUS_ERR_NVRAM; goto err; } - if (nv_image) + if (nv_image) { dhd_os_close_image(nv_image); - - nv_image = NULL; + nv_image = NULL; + } /* For Get first block of fw to calculate total_len */ file_exists = ((pfw_path != NULL) && (pfw_path[0] != '\0')); diff --git a/bcmdhd.1.579.77.41.1.cn/dhd_gpio.c b/bcmdhd.1.579.77.41.1.cn/dhd_gpio.c index d2b53b1..a120bd3 100644 --- a/bcmdhd.1.579.77.41.1.cn/dhd_gpio.c +++ b/bcmdhd.1.579.77.41.1.cn/dhd_gpio.c @@ -30,6 +30,7 @@ static int gpio_wl_host_wake = -1; // WL_HOST_WAKE is output pin of WLAN module extern int wifi_irq_trigger_level(void); extern u8 *wifi_get_mac(void); #endif +extern void set_usb_bt_power(int is_power); extern void sdio_reinit(void); extern void extern_wifi_set_enable(int is_on); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) @@ -56,12 +57,20 @@ dhd_wlan_set_power(int on } } #ifdef CUSTOMER_HW_AMLOGIC +#ifdef BCMSDIO extern_wifi_set_enable(0); mdelay(200); extern_wifi_set_enable(1); mdelay(200); // sdio_reinit(); #endif +#ifdef BCMDBUS + set_usb_bt_power(0); + mdelay(200); + set_usb_bt_power(1); + mdelay(200); +#endif +#endif #if defined(BUS_POWER_RESTORE) #if defined(BCMSDIO) if (adapter->sdio_func && adapter->sdio_func->card && adapter->sdio_func->card->host) { @@ -112,8 +121,14 @@ dhd_wlan_set_power(int on } } #ifdef CUSTOMER_HW_AMLOGIC +#ifdef BCMSDIO extern_wifi_set_enable(0); mdelay(200); +#endif +#ifdef BCMDBUS + set_usb_bt_power(0); + mdelay(200); +#endif #endif } diff --git a/bcmdhd.100.10.315.x/Makefile b/bcmdhd.100.10.315.x/Makefile index f0839b0..3c964b1 100644 --- a/bcmdhd.100.10.315.x/Makefile +++ b/bcmdhd.100.10.315.x/Makefile @@ -74,7 +74,7 @@ ifneq ($(CONFIG_BCMDHD_USB),) DHDCFLAGS += -DUSBOS_TX_THREAD -DBCMDBUS -DBCMTRXV2 -DDBUS_USB_LOOPBACK \ -DBDC DHDCFLAGS += -DBCM_REQUEST_FW -DEXTERNAL_FW_PATH -#DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) +DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) ifneq ($(CONFIG_BCMDHD_CUSB),) DHDCFLAGS += -DBCMUSBDEV_COMPOSITE DHDCFLAGS :=$(filter-out -DENABLE_INSMOD_NO_FW_LOAD,$(DHDCFLAGS)) diff --git a/bcmdhd.100.10.315.x/dbus.c b/bcmdhd.100.10.315.x/dbus.c index 39feab3..4777a5b 100644 --- a/bcmdhd.100.10.315.x/dbus.c +++ b/bcmdhd.100.10.315.x/dbus.c @@ -644,8 +644,10 @@ dbus_get_fw_nvram(dhd_bus_t *dhd_bus, char *pfw_path, char *pnv_path) bcmerror = DBUS_ERR_NVRAM; goto err; } - if (nv_image) + if (nv_image) { dhd_os_close_image1(dhd_bus->dhd, nv_image); + nv_image = NULL; + } /* For Get first block of fw to calculate total_len */ file_exists = ((pfw_path != NULL) && (pfw_path[0] != '\0')); diff --git a/bcmdhd.100.10.315.x/dhd_gpio.c b/bcmdhd.100.10.315.x/dhd_gpio.c index 54d02d4..3bd8c59 100644 --- a/bcmdhd.100.10.315.x/dhd_gpio.c +++ b/bcmdhd.100.10.315.x/dhd_gpio.c @@ -31,6 +31,7 @@ extern int wifi_irq_trigger_level(void); extern u8 *wifi_get_mac(void); #endif extern void sdio_reinit(void); +extern void set_usb_bt_power(int is_power); extern void extern_wifi_set_enable(int is_on); extern void pci_remove_reinit(unsigned int vid, unsigned int pid, int delBus); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) @@ -64,6 +65,12 @@ dhd_wlan_set_power(int on mdelay(200); // sdio_reinit(); #endif +#ifdef BCMDBUS + set_usb_bt_power(0); + mdelay(200); + set_usb_bt_power(1); + mdelay(200); +#endif #endif #if defined(BUS_POWER_RESTORE) #if defined(BCMSDIO) @@ -115,8 +122,14 @@ dhd_wlan_set_power(int on } } #ifdef CUSTOMER_HW_AMLOGIC -// extern_wifi_set_enable(0); -// mdelay(200); +#ifdef BCMSIDO + extern_wifi_set_enable(0); + mdelay(200); +#endif +#ifdef BCMDBUS + set_usb_bt_power(0); + mdelay(200); +#endif #endif } -- 2.20.1