wifi: update bcmdhd.101.10.361.x version to 34. [1/1]
authorlei.chen <lei.chen@amlogic.com>
Thu, 14 Sep 2023 06:59:55 +0000 (14:59 +0800)
committerBruno Martins <bgcngm@gmail.com>
Thu, 25 Apr 2024 09:22:36 +0000 (10:22 +0100)
PD#SWPL-139664

Problem:
Connecting to web-64bits encrypted AP, connection failed

Solution:
fix it

Verify:
TL1

Change-Id: Ic8025f2e69b012de3203db7a8826c1f47979f863
Signed-off-by: lei.chen <lei.chen@amlogic.com>
29 files changed:
bcmdhd.101.10.361.x/Makefile
bcmdhd.101.10.361.x/bcm_app_utils.c
bcmdhd.101.10.361.x/bcmsdh_sdmmc.c
bcmdhd.101.10.361.x/bcmwifi_channels.c
bcmdhd.101.10.361.x/dbus_usb_linux.c
bcmdhd.101.10.361.x/dhd_config.c
bcmdhd.101.10.361.x/dhd_config.h
bcmdhd.101.10.361.x/dhd_linux.c
bcmdhd.101.10.361.x/dhd_linux_platdev.c
bcmdhd.101.10.361.x/dhd_linux_priv.h
bcmdhd.101.10.361.x/dhd_pcie.c
bcmdhd.101.10.361.x/dhd_static_buf.c
bcmdhd.101.10.361.x/include/epivers.h
bcmdhd.101.10.361.x/include/linux_osl.h
bcmdhd.101.10.361.x/include/linuxver.h
bcmdhd.101.10.361.x/linux_osl.c
bcmdhd.101.10.361.x/wl_android.c
bcmdhd.101.10.361.x/wl_android_ext.c
bcmdhd.101.10.361.x/wl_cfg80211.c
bcmdhd.101.10.361.x/wl_cfg80211.h
bcmdhd.101.10.361.x/wl_cfgnan.h
bcmdhd.101.10.361.x/wl_cfgp2p.h
bcmdhd.101.10.361.x/wl_cfgscan.c
bcmdhd.101.10.361.x/wl_cfgvendor.c
bcmdhd.101.10.361.x/wl_cfgvif.c
bcmdhd.101.10.361.x/wl_cfgvif.h
bcmdhd.101.10.361.x/wl_iapsta.c
bcmdhd.101.10.361.x/wl_iw.c
bcmdhd.101.10.361.x/wl_iw.h

index 8f8e8e5543235ceefad18493b0940a639e78a90e..67a5085a7d44d1efcd52e3afc1738565f343b122 100755 (executable)
@@ -89,6 +89,7 @@ ifneq ($(CONFIG_CFG80211),)
        DHDOFILES += wl_linux_mon.o wl_cfg_btcoex.o wl_cfgvendor.o
        DHDOFILES += dhd_cfg80211.o wl_cfgvif.o wl_roam.o
        DHDCFLAGS += -DWL_CFG80211 -DWLP2P -DWL_CFG80211_STA_EVENT
+       DHDCFLAGS += -DWL_P2P_RAND
        DHDCFLAGS += -DWL_CAP_HE
        DHDCFLAGS += -DWL_IFACE_COMB_NUM_CHANNELS
        DHDCFLAGS += -DCUSTOM_PNO_EVENT_LOCK_xTIME=10
@@ -100,6 +101,7 @@ ifneq ($(CONFIG_CFG80211),)
 #    DHDCFLAGS += -DHOSTAPD_BW_SUPPORT
        DHDCFLAGS += -DWL_VIRTUAL_APSTA -DSTA_MGMT
        DHDCFLAGS += -DPNO_SUPPORT -DEXPLICIT_DISCIF_CLEANUP
+#    DHDCFLAGS += -DWL_SCHED_SCAN
        DHDCFLAGS += -DDHD_USE_SCAN_WAKELOCK
        DHDCFLAGS += -DSPECIFIC_MAC_GEN_SCHEME
        DHDCFLAGS += -DWL_IFACE_MGMT
@@ -271,7 +273,7 @@ endif
 endif
 
 # MESH support for kernel 3.10 later
-ifeq ($(CONFIG_WL_MESH),y)
+ifeq ($(CONFIG_BCMDHD_WLMESH),y)
        DHDCFLAGS += -DWLMESH
 ifneq ($(CONFIG_CFG80211),)
        DHDCFLAGS += -DWLMESH_CFG80211
index 62d050739ea83dda18ab658ea903e505b14aa56b..3127143c81428d7aa24cacbb6756ee4f6c5b4f37 100755 (executable)
@@ -28,7 +28,9 @@
 #ifdef BCMDRIVER
 #include <osl.h>
 #define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
+#ifndef tolower
 #define tolower(c) (bcm_isupper((c)) ? ((c) + 'a' - 'A') : (c))
+#endif /* tolower */
 #else /* BCMDRIVER */
 #include <stdio.h>
 #include <string.h>
index d4b6878d306396af8df06d4a7b22bbc418a825af..741cf893f1666d2095df6c5fe82e9ee878e4117a 100755 (executable)
@@ -513,7 +513,8 @@ enum {
        IOV_HCIREGS,
        IOV_POWER,
        IOV_CLOCK,
-       IOV_RXCHAIN
+       IOV_RXCHAIN,
+       IOV_DS
 };
 
 const bcm_iovar_t sdioh_iovars[] = {
@@ -537,6 +538,7 @@ const bcm_iovar_t sdioh_iovars[] = {
 #ifdef BCMDBG
        {"sd_hciregs",  IOV_HCIREGS,    0, 0,   IOVT_BUFFER,    0 },
 #endif
+       {"sd_ds",       IOV_DS,         0, 0,   IOVT_UINT32,    0 },
        {NULL, 0, 0, 0, 0, 0 }
 };
 
@@ -751,6 +753,64 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
                int_val = (int32)0;
                bcopy(&int_val, arg, val_size);
                break;
+
+       case IOV_GVAL(IOV_DS):
+       {
+               uint8 reg2;
+               int err;
+
+               sdio_claim_host(si->func[0]);
+               reg2 = sdio_readb(si->func[0], SDIOD_CCCR_DRIVER_STRENGTH, &err);
+               if (err) {
+                       sd_err(("sd_ds error for read SDIOD_CCCR_DRIVER_STRENGTH : 0x%x\n", err));
+                       bcmerror = BCME_SDIO_ERROR;
+               } else {
+                       sd_trace(("sd_ds get cccr driver strength 0x%x\n", reg2));
+               }
+               sdio_release_host(si->func[0]);
+
+               int_val = (int)reg2;
+               bcopy(&int_val, arg, sizeof(int_val));
+               break;
+       }
+
+       case IOV_SVAL(IOV_DS):
+       {
+               uint8 reg2;
+               int err;
+
+               sdio_claim_host(si->func[0]);
+               reg2 = sdio_readb(si->func[0], SDIOD_CCCR_DRIVER_STRENGTH, &err);
+               if (err) {
+                       sd_err(("sd_ds error for read SDIOD_CCCR_DRIVER_STRENGTH : 0x%x\n", err));
+                       bcmerror = BCME_SDIO_ERROR;
+                       sdio_release_host(si->func[0]);
+                       break;
+               } else {
+                       sd_trace(("sd_ds get cccr driver strength 0x%x\n", reg2));
+               }
+
+               if (int_val == 0) {
+                       reg2 = ((reg2 & 0xf) | 0x0);
+               } else if (int_val == 1) {
+                       reg2 = ((reg2 & 0xf) | 0x10);
+               } else if (int_val == 2) {
+                       reg2 = ((reg2 & 0xf) | 0x20);
+               } else if (int_val == 3) {
+                       reg2 = ((reg2 & 0xf) | 0x30);
+               } else {
+                       bcmerror = BCME_BADARG;
+                       sdio_release_host(si->func[0]);
+                       break;
+               }
+
+               sdio_writeb(si->func[0], reg2, SDIOD_CCCR_DRIVER_STRENGTH, &err);
+               if (err) {
+                       sd_err(("sd_ds error write SDIOD_CCCR_DRIVER_STRENGTH : 0x%x\n", err));
+               }
+               sdio_release_host(si->func[0]);
+               break;
+       }
 #ifdef BCMINTERNAL
        case IOV_GVAL(IOV_HOSTREG):
        {
index 938720710a2bfe5078f981cbf1120383bf880680..1ecd311c899e4e6c96f9c2cea78d97dfc6696bb9 100755 (executable)
@@ -29,7 +29,9 @@
 #ifdef BCMDRIVER
 #include <osl.h>
 #define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
+#ifndef tolower
 #define tolower(c) (bcm_isupper((c)) ? ((c) + 'a' - 'A') : (c))
+#endif
 #else
 #include <stdio.h>
 #include <stdlib.h>
index 96a25ce86359c6f25788f6da03ed4c4242b2b654..f85d18f23e31e3660b4388d9c521c9ad81164c5e 100755 (executable)
@@ -908,7 +908,11 @@ dbus_usbos_recv_urb_submit(usbos_info_t *usbos_info, dbus_irb_rx_t *rxirb, uint3
        usb_fill_bulk_urb(req->urb, usbos_info->usb, rx_pipe,
                p,
                rxirb->buf_len,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+               (void *)dbus_usbos_recv_complete, req);
+#else
                (usb_complete_t)dbus_usbos_recv_complete, req);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) */
                req->urb->transfer_flags |= URB_QUEUE_BULK;
 
        if ((ret = USB_SUBMIT_URB(req->urb))) {
@@ -1828,7 +1832,11 @@ dbus_usbos_intf_send_irb(void *bus, dbus_irb_tx_t *txirb)
                req_zlp->buf_len = 0;
 
                usb_fill_bulk_urb(req_zlp->urb, usbos_info->usb, usbos_info->tx_pipe, NULL,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+                       0, (void *)dbus_usbos_send_complete, req_zlp);
+#else
                        0, (usb_complete_t)dbus_usbos_send_complete, req_zlp);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) */
 
                req_zlp->urb->transfer_flags |= URB_QUEUE_BULK;
        }
@@ -1883,7 +1891,11 @@ dbus_usbos_intf_send_irb(void *bus, dbus_irb_tx_t *txirb)
        }
 
        usb_fill_bulk_urb(req->urb, usbos_info->usb, usbos_info->tx_pipe, buf,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+               buffer_length, (void *)dbus_usbos_send_complete, req);
+#else
                buffer_length, (usb_complete_t)dbus_usbos_send_complete, req);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) */
 
        req->urb->transfer_flags |= URB_QUEUE_BULK;
 
@@ -2048,7 +2060,11 @@ dbus_usbos_intf_send_ctl(void *bus, uint8 *buf, int len)
                usbos_info->usb,
                usb_sndctrlpipe(usbos_info->usb, 0),
                (unsigned char *) &usbos_info->ctl_write,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+               buf, size, (void *)dbus_usbos_ctlwrite_complete, usbos_info);
+#else
                buf, size, (usb_complete_t)dbus_usbos_ctlwrite_complete, usbos_info);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) */
 
 #ifdef USBOS_TX_THREAD
        /* Enqueue CTRL request for transmission by the TX thread. The
@@ -2113,7 +2129,11 @@ dbus_usbos_intf_recv_ctl(void *bus, uint8 *buf, int len)
                usbos_info->usb,
                usb_rcvctrlpipe(usbos_info->usb, 0),
                (unsigned char *) &usbos_info->ctl_read,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+               buf, size, (void *)dbus_usbos_ctlread_complete, usbos_info);
+#else
                buf, size, (usb_complete_t)dbus_usbos_ctlread_complete, usbos_info);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) */
 
        status = USB_SUBMIT_URB(usbos_info->ctl_urb);
        if (status < 0) {
index 4df7ca30557f68ddbb63122ff5f01b8c223f7d96..32e269deaa44a8f73d04880cd50e29a4a0fea5ad 100755 (executable)
@@ -1932,24 +1932,39 @@ dhd_conf_scan_mac(dhd_pub_t * dhd, char *cmd, char *buf)
 }
 #endif
 
+bool
+dhd_conf_same_country(dhd_pub_t *dhd, char *buf)
+{
+       wl_country_t cspec = {{0}, 0, {0}};
+       wl_country_t cur_cspec = {{0}, 0, {0}};
+
+       strlcpy(cspec.country_abbrev, buf, WL_CCODE_LEN + 1);
+       strlcpy(cspec.ccode, buf, WL_CCODE_LEN + 1);
+       dhd_conf_map_country_list(dhd, &cspec);
+       dhd_conf_get_country(dhd, &cur_cspec);
+       if (!memcmp(&cspec.ccode, &cur_cspec.ccode, WL_CCODE_LEN) &&
+                       (cspec.rev == cur_cspec.rev)) {
+               CONFIG_MSG("country code = %s/%d is already configured\n",
+                       cspec.ccode, cspec.rev);
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
 int
 dhd_conf_country(dhd_pub_t *dhd, char *cmd, char *buf)
 {
        wl_country_t cspec = {{0}, 0, {0}};
-       wl_country_t cur_cspec = {{0}, 0, {0}};
        int err = 0;
 
        if (buf) {
-               dhd_conf_get_country(dhd, &cur_cspec);
+               if (dhd_conf_same_country(dhd, buf)) {
+                       return 0;
+               }
                strlcpy(cspec.country_abbrev, buf, WL_CCODE_LEN + 1);
                strlcpy(cspec.ccode, buf, WL_CCODE_LEN + 1);
                dhd_conf_map_country_list(dhd, &cspec);
-               if (!memcmp(&cspec.ccode, &cur_cspec.ccode, WL_CCODE_LEN) &&
-                               (cspec.rev == cur_cspec.rev)) {
-                       CONFIG_MSG("country code = %s/%d is already configured\n",
-                               cspec.ccode, cspec.rev);
-                       return 0;
-               }
                err = dhd_conf_set_country(dhd, &cspec);
                if (!err) {
                        dhd_conf_fix_country(dhd);
index e33e8c78b9930728372b3517a22310e1a40efc4a..21b273a65e7060c42e45ee1257ef8475c709a7d4 100755 (executable)
@@ -418,6 +418,7 @@ void dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path);
 int dhd_conf_set_intiovar(dhd_pub_t *dhd, int ifidx, uint cmd, char *name,
        int val, int def, bool down);
 int dhd_conf_get_band(dhd_pub_t *dhd);
+bool dhd_conf_same_country(dhd_pub_t *dhd, char *buf);
 int dhd_conf_country(dhd_pub_t *dhd, char *cmd, char *buf);
 int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec);
 #ifdef CCODE_LIST
index dc5f01d0567704ad80eaf76c6178cf88b9ddd9ca..31963063e61b5fff0b04e5dddfba5ab18c17cd84 100755 (executable)
@@ -3558,7 +3558,9 @@ static void
 dhd_set_mac_addr_handler(void *handle, void *event_info, u8 event)
 {
        dhd_info_t *dhd = handle;
-       dhd_if_t *ifp = event_info;
+       int ifidx = (int)((long int)event_info);
+       dhd_if_t *ifp = NULL;
+
 
        if (event != DHD_WQ_WORK_SET_MAC) {
                DHD_ERROR(("%s: unexpected event \n", __FUNCTION__));
@@ -3575,6 +3577,8 @@ dhd_set_mac_addr_handler(void *handle, void *event_info, u8 event)
        dhd_net_if_lock_local(dhd);
        DHD_OS_WAKE_LOCK(&dhd->pub);
 
+       ifp = dhd->iflist[ifidx];
+
        // terence 20160907: fix for not able to set mac when wlan0 is down
        if (ifp == NULL || !ifp->set_macaddress) {
                goto done;
@@ -3626,11 +3630,6 @@ dhd_set_mcast_list_handler(void *handle, void *event_info, u8 event)
                goto done;
        }
 
-       if (ifp == NULL || !dhd->pub.up) {
-               DHD_ERROR(("%s: interface info not available/down \n", __FUNCTION__));
-               goto done;
-       }
-
        ifidx = ifp->idx;
 
 #ifdef MCAST_LIST_ACCUMULATION
@@ -3703,8 +3702,8 @@ dhd_set_mac_address(struct net_device *dev, void *addr)
        }
 #endif /* WL_CFG80211 */
 
-       dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)dhdif, DHD_WQ_WORK_SET_MAC,
-               dhd_set_mac_addr_handler, DHD_WQ_WORK_PRIORITY_LOW);
+       dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)((long int)ifidx),
+               DHD_WQ_WORK_SET_MAC, dhd_set_mac_addr_handler, DHD_WQ_WORK_PRIORITY_LOW);
        return ret;
 }
 
@@ -3723,7 +3722,7 @@ dhd_set_multicast_list(struct net_device *dev)
                DHD_WQ_WORK_SET_MCAST_LIST, dhd_set_mcast_list_handler, DHD_WQ_WORK_PRIORITY_LOW);
 
        // terence 20160907: fix for not able to set mac when wlan0 is down
-       dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)dhd->iflist[ifidx],
+       dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)((long int)ifidx),
                DHD_WQ_WORK_SET_MAC, dhd_set_mac_addr_handler, DHD_WQ_WORK_PRIORITY_LOW);
 }
 
@@ -16993,7 +16992,8 @@ dhd_register_if(dhd_pub_t *dhdp, int ifidx, bool need_rtnl_lock)
                wl_ext_iapsta_update_net_device(net, ifidx);
 #endif /* WL_EXT_IAPSTA */
                if (dhd->pub.up == 1) {
-                       if (_dhd_set_mac_address(dhd, ifidx, net->dev_addr, FALSE) == 0)
+                       memcpy(temp_addr, net->dev_addr, ETHER_ADDR_LEN);
+                       if (_dhd_set_mac_address(dhd, ifidx, temp_addr, FALSE) == 0)
                                DHD_INFO(("%s: MACID is overwritten\n", __FUNCTION__));
                        else
                                DHD_ERROR(("%s: _dhd_set_mac_address() failed\n", __FUNCTION__));
index e296bebc90dd1529e97e4512fd23769c0a2863df..820f4e3d0e963c9d29af9741e7541c30dace05d7 100755 (executable)
@@ -158,6 +158,10 @@ wifi_adapter_info_t* dhd_wifi_platform_get_adapter(uint32 bus_type, uint32 bus_n
        return NULL;
 }
 
+#if defined(CONFIG_WIFI_CONTROL_FUNC) && defined(CONFIG_DHD_USE_STATIC_BUF)
+extern void *dhd_wlan_mem_prealloc(int section, unsigned long size);
+#endif /* CONFIG_WIFI_CONTROL_FUNC && CONFIG_DHD_USE_STATIC_BUF */
+
 void* wifi_platform_prealloc(wifi_adapter_info_t *adapter, int section, unsigned long size)
 {
        void *alloc_ptr = NULL;
@@ -169,8 +173,12 @@ void* wifi_platform_prealloc(wifi_adapter_info_t *adapter, int section, unsigned
        if (plat_data->mem_prealloc) {
 #if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
                alloc_ptr = plat_data->mem_prealloc(adapter->bus_type, adapter->index, section, size);
+#else
+#if defined(CONFIG_WIFI_CONTROL_FUNC) && defined(CONFIG_DHD_USE_STATIC_BUF)
+               alloc_ptr = dhd_wlan_mem_prealloc(section, size);
 #else
                alloc_ptr = plat_data->mem_prealloc(section, size);
+#endif
 #endif
                if (alloc_ptr) {
                        DHD_INFO(("success alloc section %d\n", section));
@@ -257,7 +265,11 @@ int wifi_platform_set_power(wifi_adapter_info_t *adapter, bool on, unsigned long
                }
 #endif /* ENABLE_4335BT_WAR */
 
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+               err = plat_data->set_power(on);
+#else
                err = plat_data->set_power(on, adapter);
+#endif
        }
 
        if (msec && !err)
@@ -307,7 +319,11 @@ int wifi_platform_get_mac_addr(wifi_adapter_info_t *adapter, unsigned char *buf,
                return -EINVAL;
        plat_data = adapter->wifi_plat_data;
        if (plat_data->get_mac_addr) {
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+               return plat_data->get_mac_addr(buf);
+#else
                return plat_data->get_mac_addr(buf, ifidx);
+#endif
        }
        return -EOPNOTSUPP;
 }
index 019884bb89fca7ea5c6317a4f04477f776b19d67..ce3aaa50b4502fc0dc56fcad8aa34cb61dc098a9 100755 (executable)
@@ -501,7 +501,7 @@ extern uint sssr_enab;
 extern uint fis_enab;
 #endif /* DHD_SSSR_DUMP */
 
-#if defined(ANDROID_VERSION) && (LINUX_VERSION_CODE  >= KERNEL_VERSION(4, 19, 0))
+#if defined(ANDROID_VERSION) && (LINUX_VERSION_CODE  >= KERNEL_VERSION(4, 14, 0))
 #define WAKELOCK_BACKPORT
 #endif
 
index ee82a99c5051be16ac4b139873127de9ec4c0641..21f5ed26d8d6606bda13f4d1b2ba628230a7e435 100755 (executable)
@@ -9454,7 +9454,7 @@ dhd_bus_hostready(struct  dhd_bus *bus)
                return;
        }
 
-       DHD_ERROR_MEM(("%s : Read PCICMD Reg: 0x%08X\n", __FUNCTION__,
+       DHD_ERROR(("%s : Read PCICMD Reg: 0x%08X\n", __FUNCTION__,
                dhd_pcie_config_read(bus, PCI_CFG_CMD, sizeof(uint32))));
 
        dhd_bus_dump_dar_registers(bus);
@@ -9464,7 +9464,7 @@ dhd_bus_hostready(struct  dhd_bus *bus)
 #endif /* defined(DHD_MMIO_TRACE) */
        si_corereg(bus->sih, bus->sih->buscoreidx, dhd_bus_db1_addr_get(bus), ~0, 0x12345678);
        bus->hostready_count ++;
-       DHD_ERROR_MEM(("%s: Ring Hostready:%d\n", __FUNCTION__, bus->hostready_count));
+       DHD_ERROR(("%s: Ring Hostready:%d\n", __FUNCTION__, bus->hostready_count));
 }
 
 /* Clear INTSTATUS */
index b565b905216e7d50403a8931c3526e345e3a31a8..ec803e6f0174cab84027dfccd025d74f3eb82ba4 100755 (executable)
@@ -48,7 +48,9 @@ do { \
 #ifndef BCMDBUS
 #define BCMDBUS
 #endif
+#ifndef DHD_USE_STATIC_MEMDUMP
 #define DHD_USE_STATIC_MEMDUMP { : = y}
+#endif
 //#define BCMDHD_UNUSE_MEM
 #endif
 
index 20617705a4f889af403d0cfc8e131eae3a09c139..68c2c6ebd864f033e874fe5ea27f4bec588f7fe4 100755 (executable)
@@ -45,7 +45,7 @@
 #elif (defined (BCMDBG_ASSERT) && !defined (BCMDBG_ASSERT_DISABLED))
 #define EPI_VERSION_STR                "101.10.361 (wlan=r892223 ASSRT)"
 #else
-#define EPI_VERSION_STR                "101.10.361.32 (wlan=r892223-20230508-1)"
+#define EPI_VERSION_STR                "101.10.361.34 (wlan=r892223-20230904-2)"
 #endif /* BCMINTERNAL */
 
 #endif /* _epivers_h_ */
index f81edab8a6955bab6c4a56faeadfa692e44085bc..db0799b274bbc4a62881b9aac1b5e8428f48b401 100755 (executable)
@@ -817,7 +817,7 @@ typedef struct osl_timer {
 
 typedef void (*linux_timer_fn)(ulong arg);
 
-extern osl_timer_t * osl_timer_init(osl_t *osh, const char *name, void (*fn)(void *arg), void *arg);
+extern osl_timer_t * osl_timer_init(osl_t *osh, const char *name, void (*fn)(ulong arg), void *arg);
 extern void osl_timer_add(osl_t *osh, osl_timer_t *t, uint32 ms, bool periodic);
 extern void osl_timer_update(osl_t *osh, osl_timer_t *t, uint32 ms, bool periodic);
 extern bool osl_timer_del(osl_t *osh, osl_timer_t *t);
index 355eacc879f31215ff5641fd2ff1c3acc069e9e0..5e4fe738715865822982fed9017d0683710eb771 100755 (executable)
@@ -941,6 +941,10 @@ int kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned lo
 #define kernel_read_compat(file, offset, addr, count) kernel_read(file, offset, addr, count)
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
+#include <linux/sched/clock.h>
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
 #define netdev_tx_t int
 #endif
index 6af48120e491afcf8ed86fe5b4072ce73adef0ba..5a7ff58c85f47b0ac4bdaecdec8267cb7571a95d 100755 (executable)
@@ -1787,7 +1787,7 @@ timer_cb_compat(struct timer_list *tl)
 /* Note: All timer api's are thread unsafe and should be protected with locks by caller */
 
 osl_timer_t *
-osl_timer_init(osl_t *osh, const char *name, void (*fn)(void *arg), void *arg)
+osl_timer_init(osl_t *osh, const char *name, void (*fn)(ulong arg), void *arg)
 {
        osl_timer_t *t;
        BCM_REFERENCE(fn);
index b108fcab53b89e204b79582c46faf5715ba6c7ce..8f66bec7344033c12bc7d0b40c870b90f7a843b4 100755 (executable)
@@ -450,6 +450,7 @@ typedef struct android_wifi_af_params {
 #define BUFSZ 8
 #define BUFSZN BUFSZ + 1
 
+#undef _S
 #define _S(x) #x
 #define S(x) _S(x)
 
index 54d85464bddcbd1b5aee3ba421118c8c9ee51996..4f45b0b2905455db32fc3f50c6ea83c2e34f5462 100755 (executable)
@@ -1720,6 +1720,7 @@ wl_ext_recal(struct net_device *dev, char *data, char *command,
        int ret = 0, i, nchan, nssid = 0;
        int params_size = WL_SCAN_PARAMS_V1_FIXED_SIZE + WL_NUMCHANNELS * sizeof(uint16);
        wl_scan_params_v1_t *params = NULL;
+       uint16 *chan_list = NULL;
        char *p;
 
        AEXT_TRACE(dev->name, "Enter\n");
@@ -1744,8 +1745,9 @@ wl_ext_recal(struct net_device *dev, char *data, char *command,
 
                params->scan_type |= WL_SCANFLAGS_PASSIVE;
                nchan = 2;
-               params->channel_list[0] = wf_channel2chspec(1, WL_CHANSPEC_BW_20);
-               params->channel_list[1] = wf_channel2chspec(2, WL_CHANSPEC_BW_20);
+               chan_list = params->channel_list;
+               chan_list[0] = wf_channel2chspec(1, WL_CHANSPEC_BW_20);
+               chan_list[1] = wf_channel2chspec(2, WL_CHANSPEC_BW_20);
 
                params->nprobes = htod32(params->nprobes);
                params->active_time = htod32(params->active_time);
index db46ac79cf11cbd62f046a6b6a4c19776b18489b..6dbdfbbb1a6e23e627b67d5925c2ae2bec712cb3 100755 (executable)
@@ -1335,9 +1335,6 @@ static const rsn_akm_wpa_auth_entry_t rsn_akm_wpa_auth_lookup_tbl[] = {
 #define BUFSZ 8
 #define BUFSZN BUFSZ + 1
 
-#define _S(x) #x
-#define S(x) _S(x)
-
 #define SOFT_AP_IF_NAME         "swlan0"
 
 /* watchdog timer for disconnecting when fw is not associated for FW_ASSOC_WATCHDOG_TIME ms */
@@ -2462,7 +2459,7 @@ _wl_cfg80211_check_axi_error(struct bcm_cfg80211 *cfg)
 struct wireless_dev *
 wl_cfg80211_add_if(struct bcm_cfg80211 *cfg,
        struct net_device *primary_ndev,
-       wl_iftype_t wl_iftype, const char *name, u8 *mac)
+       wl_iftype_t wl_iftype, const char *name, const u8 *mac)
 {
        u8 mac_addr[ETH_ALEN];
        s32 err = -ENODEV;
@@ -10673,6 +10670,11 @@ wl_is_ccode_change_required(struct net_device *net,
        s32 ret = BCME_OK;
        wl_country_t cspec = {{0}, 0, {0}};
        wl_country_t cur_cspec = {{0}, 0, {0}};
+       struct dhd_pub *dhd = dhd_get_pub(net);
+
+       if (dhd_conf_same_country(dhd, country_code)) {
+               return false;
+       }
 
        ret = wldev_iovar_getbuf(net, "country", NULL, 0, &cur_cspec,
                sizeof(cur_cspec), NULL);
@@ -14016,7 +14018,7 @@ wl_bss_roaming_done(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        return err;
 
 fail:
-#ifdef WL_EXT_IAPSTA
+#if defined(WL_EXT_IAPSTA) && !defined(WL_EXT_DISCONNECT_RECONNECT)
        if (err)
                wl_ext_in4way_sync(ndev, STA_NO_BTC_IN4WAY, WL_EXT_STATUS_DISCONNECTED, NULL);
 #endif
@@ -20664,19 +20666,28 @@ static int wl_cfg80211_update_owe_info(struct wiphy *wiphy, struct net_device *d
        int err = 0;
        struct bcm_cfg80211 *cfg = wl_get_cfg(dev);
        dhd_pub_t *dhdp = (dhd_pub_t *)(cfg->pub);
-       wl_assoc_resp_params_v1_t *assoc_resp_params;
-       uint8 resp_buf[AP_OWE_IOCTL_BUF_SIZE];
+       wl_assoc_resp_params_v1_t *assoc_resp_params = NULL;
+       uint8 *resp_buf = NULL;
        uint8 *p_resp_ies_tlv = NULL;
        uint16 assoc_params_iovsize;
 
        WL_DBG(("%s: Enter\n", __func__));
+
+       resp_buf = MALLOCZ(dhdp->osh, AP_OWE_IOCTL_BUF_SIZE);
+       if (resp_buf == NULL) {
+               WL_ERR(("error: failed to allocate %d bytes of memory\n", AP_OWE_IOCTL_BUF_SIZE));
+               err = BCME_NOMEM;
+               goto exit;
+       }
+
        assoc_params_iovsize = AP_OWE_ASSOC_RESP_PARAMS_BUFSZ +
                        OFFSETOF(wl_assoc_resp_params_v1_t, ies);
        assoc_resp_params = (wl_assoc_resp_params_v1_t *)MALLOCZ(dhdp->osh, assoc_params_iovsize);
 
        if (assoc_resp_params == NULL) {
                WL_ERR(("error: failed to allocate %d bytes of memory\n", assoc_params_iovsize));
-               return BCME_ERROR;
+               err = BCME_NOMEM;
+               goto exit;
        }
        /* setup assoc_resp_params iovar */
        assoc_resp_params->version = WL_ASSOC_RESP_PARAMS_V1;
@@ -20709,6 +20720,10 @@ static int wl_cfg80211_update_owe_info(struct wiphy *wiphy, struct net_device *d
                WL_DBG(("ap_assoc_resp_params failed, err=%d\n", err));
        }
 exit:
+       if (resp_buf)
+               MFREE(dhdp->osh, resp_buf, AP_OWE_IOCTL_BUF_SIZE);
+       if (assoc_resp_params)
+               MFREE(dhdp->osh, assoc_resp_params, assoc_params_iovsize);
        return err;
 }
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) */
@@ -22090,6 +22105,9 @@ wl_cfg80211_sup_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgde
        u32 status = ntoh32(event->status);
        struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
        u32 reason = ntoh32(event->reason);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
+       const u8 *curbssid = (const u8 *)event->addr.octet;
+#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(4, 15, 0) */
 
        if (!wl_get_drv_status(cfg, CFG80211_CONNECT, ndev)) {
                /* Join attempt via non-cfg80211 interface.
@@ -22103,17 +22121,23 @@ wl_cfg80211_sup_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgde
 
        if ((status == WLC_SUP_KEYED || status == WLC_SUP_KEYXCHANGE_WAIT_G1) &&
            reason == WLC_E_SUP_OTHER) {
-#if ((defined (AML_KERNEL_VERSION) && AML_KERNEL_VERSION >= 15) || LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
-               /* NL80211_CMD_PORT_AUTHORIZED supported above >= 4.15 */
-               cfg80211_port_authorized(ndev, (u8 *)wl_read_prof(cfg, ndev, WL_PROF_BSSID),
-                       NULL, 0, GFP_KERNEL);
-               WL_INFORM_MEM(("4way HS finished. port authorized event sent\n"));
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
-               /* NL80211_CMD_PORT_AUTHORIZED supported above >= 4.15 */
-               cfg80211_port_authorized(ndev, (u8 *)wl_read_prof(cfg, ndev, WL_PROF_BSSID),
-                       GFP_KERNEL);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
+               if (!ETHER_ISNULLADDR(curbssid)) {
+                       WL_DBG(("Authorizing Port with BSSID from FW event " MACDBG" \n",
+                               MAC2STRDBG(curbssid)));
+               } else {
+                       curbssid = wl_read_prof(cfg, ndev, WL_PROF_BSSID);
+                       WL_DBG(("Authorizing Port with BSSID from DHD profile " MACDBG" \n",
+                               MAC2STRDBG(curbssid)));
+               }
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)) || \
+               ((ANDROID_VERSION >= 13) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 94)))
+               cfg80211_port_authorized(ndev, (const u8 *)curbssid, NULL, 0, GFP_KERNEL);
+#else
+               cfg80211_port_authorized(ndev, (const u8 *)curbssid, GFP_KERNEL);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) */
                WL_INFORM_MEM(("4way HS finished. port authorized event sent\n"));
-#elif ((LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0)) || defined(WL_VENDOR_EXT_SUPPORT))
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0)) || defined(WL_VENDOR_EXT_SUPPORT)
                err = wl_cfgvendor_send_async_event(bcmcfg_to_wiphy(cfg), ndev,
                        BRCM_VENDOR_EVENT_PORT_AUTHORIZED, NULL, 0);
                WL_INFORM_MEM(("4way HS finished. port authorized event sent\n"));
index d05482b99c14e948a10bc86e954b54b620914fbc..30d45b2237023b3b74fa193111584f9269d14f74 100755 (executable)
@@ -2959,7 +2959,7 @@ int wl_set_rssi_logging(struct net_device *dev, void *param);
 int wl_get_rssi_per_ant(struct net_device *dev, char *ifname, char *peer_mac, void *param);
 #endif /* SUPPORT_RSSI_SUM_REPORT */
 struct wireless_dev * wl_cfg80211_add_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev,
-       wl_iftype_t wl_iftype, const char *name, u8 *mac);
+       wl_iftype_t wl_iftype, const char *name, const u8 *mac);
 extern s32 wl_cfg80211_del_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev,
        struct wireless_dev *wdev, char *name);
 s32 _wl_cfg80211_del_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev,
index 703e64571433aeb1889c64a35e8c0ce9f13cf5d1..d90987fd4bb4068ec4ed4aefeff2bac056767c46 100755 (executable)
@@ -90,7 +90,9 @@
 #define NAME_TO_STR(name) #name
 #define NAN_ID_CTRL_SIZE ((NAN_MAXIMUM_ID_NUMBER/8) + 1)
 
+#ifndef tolower
 #define tolower(c) bcm_tolower(c)
+#endif /* tolower */
 
 #define NMR2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5], (a)[6], (a)[7]
 #define NMRSTR "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x"
index 33a3c1fc251b3beea1011e57c5c6ae6996756488..c34d4c2287ec92d5455c69b9cfb47c145143d1b5 100755 (executable)
@@ -222,7 +222,7 @@ enum wl_cfgp2p_status {
 #endif
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0))
 #ifdef WL_CFG80211_STA_EVENT
 #undef WL_CFG80211_STA_EVENT
 #endif
index 85eb430c68d937ca7bd037afddec5b7e926dcdc5..cd700d75ae0c3ed470732b185e562085e47c83a9 100755 (executable)
@@ -4450,7 +4450,7 @@ wl_notify_sched_scan_results(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        STATIC_ASSERT(sizeof(wl_pfn_net_info_v1_t) == sizeof(wl_pfn_net_info_v2_t));
        STATIC_ASSERT(sizeof(wl_pfn_lnet_info_v1_t) == sizeof(wl_pfn_lnet_info_v2_t));
        STATIC_ASSERT(sizeof(wl_pfn_subnet_info_v1_t) == sizeof(wl_pfn_subnet_info_v2_t));
-       STATIC_ASSERT(OFFSETOF(wl_pfn_subnet_info_v1_t, SSID) ==
+       ASSERT(OFFSETOF(wl_pfn_subnet_info_v1_t, SSID) ==
                      OFFSETOF(wl_pfn_subnet_info_v2_t, u.SSID));
 
        /* Extract the version-specific items */
index 71c16f8f1c9d4fd8a6511cefa83304bb9620c5fe..bf9415bfe49dda08e1bdfde2b0ade655a6669e4d 100755 (executable)
@@ -6945,6 +6945,8 @@ static int wl_cfgvendor_lstats_get_info(struct wiphy *wiphy,
        if (err != BCME_OK && err != BCME_UNSUPPORTED) {
                WL_ERR(("error (%d) - size = %zu\n", err, sizeof(wl_pwrstats_t)));
                goto exit;
+       } else if (err == BCME_UNSUPPORTED) {
+               goto exit;
        }
 
        pwrstats = (wl_pwrstats_t *) iovar_buf;
@@ -8302,7 +8304,9 @@ static int wl_cfgvendor_nla_put_dump_data(dhd_pub_t *dhd_pub, struct sk_buff *sk
                wl_cfgvendor_nla_put_axi_error_data(skb, ndev);
        }
 #endif /* DNGL_AXI_ERROR_LOGGING */
+#if defined(DHD_FW_COREDUMP)
        if (dhd_pub->memdump_enabled || (dhd_pub->memdump_type == DUMP_TYPE_BY_SYSDUMP)) {
+#endif /* DHD_FW_COREDUMP */
                if (((ret = wl_cfgvendor_nla_put_debug_dump_data(skb, ndev)) < 0) ||
                        ((ret = wl_cfgvendor_nla_put_memdump_data(skb, ndev, fw_len)) < 0) ||
                        ((ret = wl_cfgvendor_nla_put_sssr_dump_data(skb, ndev)) < 0)) {
@@ -8313,7 +8317,9 @@ static int wl_cfgvendor_nla_put_dump_data(dhd_pub_t *dhd_pub, struct sk_buff *sk
                        goto done;
                }
 #endif /* DHD_PKT_LOGGING */
+#if defined(DHD_FW_COREDUMP)
        }
+#endif /* DHD_FW_COREDUMP */
 done:
        return ret;
 }
index 6a43073dd4ee357f2bc34022c584608a8b460e43..6297e7fd7573af4451eb4d812329a557469c8d48 100755 (executable)
@@ -879,7 +879,7 @@ wl_cfg80211_handle_if_role_conflict(struct bcm_cfg80211 *cfg,
 #endif /* WL_IFACE_MGMT */
 
 s32
-wl_release_vif_macaddr(struct bcm_cfg80211 *cfg, u8 *mac_addr, u16 wl_iftype)
+wl_release_vif_macaddr(struct bcm_cfg80211 *cfg, const u8 *mac_addr, u16 wl_iftype)
 {
        struct net_device *ndev =  bcmcfg_to_prmry_ndev(cfg);
        u16 org_toggle_bytes;
@@ -4430,7 +4430,7 @@ wl_get_auth_assoc_status(struct bcm_cfg80211 *cfg, struct net_device *ndev,
  */
 #if !defined(WL_CFG80211_STA_EVENT) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0))
 static s32
-wl_notify_connect_status_ap_legacy(struct bcm_cfg80211 *cfg, struct net_device *ndev
+wl_notify_connect_status_ap_legacy(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        const wl_event_msg_t *e, void *data)
 {
        s32 err = 0;
@@ -4438,6 +4438,8 @@ wl_notify_connect_status_ap_legacy(struct bcm_cfg80211 *cfg, struct net_device *
        u32 reason = ntoh32(e->reason);
        u32 len = ntoh32(e->datalen);
        u32 status = ntoh32(e->status);
+       chanspec_t chanspec;
+       bool retval;
 
        bool isfree = false;
        u8 *mgmt_frame;
@@ -4508,7 +4510,8 @@ wl_notify_connect_status_ap_legacy(struct bcm_cfg80211 *cfg, struct net_device *
                return err;
        }
        chanspec = wl_chspec_driver_to_host(chanspec);
-       freq = wl_channel_to_frequency(wf_chspec_ctlchan(chanspec), CHSPEC_BAND(chanspec));
+       channel = wf_chspec_ctlchan(chanspec);
+       freq = wl_channel_to_frequency(channel, CHSPEC_BAND(chanspec));
        body_len = len;
        err = wl_frame_get_mgmt(cfg, fc, &da, &e->addr, &bssid,
                &mgmt_frame, &len, body);
@@ -4519,16 +4522,44 @@ wl_notify_connect_status_ap_legacy(struct bcm_cfg80211 *cfg, struct net_device *
        if ((event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) ||
                        (event == WLC_E_DISASSOC_IND) ||
                        ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH))) {
+               if (event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) {
+                       WL_MSG(ndev->name, "new sta event for "MACDBG "\n",
+                               MAC2STRDBG(e->addr.octet));
+#ifdef WL_EXT_IAPSTA
+                       wl_ext_in4way_sync(ndev, AP_WAIT_STA_RECONNECT,
+                               WL_EXT_STATUS_STA_CONNECTED, (void *)&e->addr);
+#endif
+#ifdef STA_MGMT
+                       if (!wl_ext_add_sta_info(ndev, (u8 *)&e->addr)) {
+                               return -EINVAL;
+                       }
+#endif /* STA_MGMT */
+               } else if (event == WLC_E_DISASSOC_IND || event == WLC_E_DEAUTH_IND ||
+                               event == WLC_E_DEAUTH) {
+                       WL_MSG_RLMT(ndev->name, &e->addr, ETHER_ADDR_LEN,
+                               "del sta event for "MACDBG "\n", MAC2STRDBG(e->addr.octet));
+#ifdef WL_EXT_IAPSTA
+                       wl_ext_in4way_sync(ndev, AP_WAIT_STA_RECONNECT,
+                               WL_EXT_STATUS_STA_DISCONNECTED, (void *)&e->addr);
+#endif
+#ifdef STA_MGMT
+                       if (!wl_ext_del_sta_info(ndev, (u8 *)&e->addr)) {
+                               return -EINVAL;
+                       }
+#endif /* STA_MGMT */
+               }
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+               retval = cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+               retval = cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
                defined(WL_COMPAT_WIRELESS)
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
+               retval = cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
 #else
-               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+               retval = cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
 #endif /* LINUX_VERSION >= VERSION(3, 18,0) || WL_COMPAT_WIRELESS */
+               WL_DBG(("mgmt_frame_len (%d) , e->datalen (%d), channel (%d), freq (%d) retval (%d)\n",
+                       len, ntoh32(e->datalen), channel, freq, retval));
        }
 
 exit:
@@ -4698,8 +4729,6 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                wl_wps_session_update(ndev, WPS_STATE_LINKDOWN, e->addr.octet);
 #endif /* WL_WPS_SYNC */
        }
-
-#endif /* LINUX_VERSION < VERSION(3,2,0) && !WL_CFG80211_STA_EVENT && !WL_COMPAT_WIRELESS */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
        else if (event == WLC_E_OWE_INFO) {
                if (!data) {
@@ -4717,6 +4746,7 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                cfg80211_update_owe_info_event(ndev, &owe_info, GFP_ATOMIC);
        }
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) */
+#endif /* LINUX_VERSION < VERSION(3,2,0) && !WL_CFG80211_STA_EVENT && !WL_COMPAT_WIRELESS */
        return err;
 }
 
@@ -5337,13 +5367,14 @@ wl_cfg80211_ch_switch_notify(struct net_device *dev, uint16 chanspec, struct wip
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
        freq = chandef.chan ? chandef.chan->center_freq : chandef.center_freq1;
-#if ((defined (AML_KERNEL_VERSION) && AML_KERNEL_VERSION >= 15) || LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || \
+               ((ANDROID_VERSION >= 13) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 94)))
        cfg80211_ch_switch_notify(dev, &chandef, 0, 0);
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO)
        cfg80211_ch_switch_notify(dev, &chandef, 0);
 #else
        cfg80211_ch_switch_notify(dev, &chandef);
-#endif /* CFG80211_BKPORT_MLO */
+#endif /* LINUX_VER >= 5.19.2 || defined(CFG80211_BKPORT_MLO) */
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, 0)))
        freq = chandef.freq;
        cfg80211_ch_switch_notify(dev, freq, chandef.chan_type);
index c949c10edfdc725fea1b0eb0eb561cca9b01e380..d66579247a95600861f5896984761a064e661984 100755 (executable)
@@ -126,7 +126,7 @@ extern wl_iftype_t wl_cfg80211_get_sec_iface(struct bcm_cfg80211 *cfg);
 #endif /* WL_IFACE_MGMT */
 
 extern s32 wl_get_vif_macaddr(struct bcm_cfg80211 *cfg, u16 wl_iftype, u8 *mac_addr);
-extern s32 wl_release_vif_macaddr(struct bcm_cfg80211 *cfg, u8 *mac_addr, u16 wl_iftype);
+extern s32 wl_release_vif_macaddr(struct bcm_cfg80211 *cfg, const u8 *mac_addr, u16 wl_iftype);
 
 int wl_cfg80211_set_he_mode(struct net_device *dev, struct bcm_cfg80211 *cfg,
                s32 bssidx, u32 interface_type, bool set);
@@ -244,8 +244,6 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy,
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) */
        struct vif_params *params);
 extern s32 wl_cfg80211_del_virtual_iface(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev);
-extern s32 wl_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
-       struct cfg80211_beacon_data *info);
 
 extern s32 wl_get_auth_assoc_status(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        const wl_event_msg_t *e, void *data);
index f6a5424793abe2d1edc706148466382858627378..b3222ca2fac79a3fa5b95a441b8f79d2241f78be 100755 (executable)
@@ -226,8 +226,8 @@ typedef struct wl_if_info {
        int transit_maxcount;
 #endif /* PROPTX_MAXCOUNT */
        uint conn_state;
-       uint16 prev_channel;
-       uint16 post_channel;
+       struct wl_chan_info prev_chan_info;
+       struct wl_chan_info post_chan_info;
        struct osl_timespec sta_disc_ts;
        struct osl_timespec sta_conn_ts;
        bool ap_recon_sta;
@@ -1412,7 +1412,7 @@ wl_mesh_update_mesh_info(struct wl_apsta_params *apsta_params,
                        WL_MSG(mesh_if->ifname, "moving channel %d -> %d\n",
                                cur_chan, peer_mesh_info.master_channel);
                        wl_ext_disable_iface(mesh_if->dev, mesh_if->ifname);
-                       mesh_if->channel = peer_mesh_info.master_channel;
+                       mesh_if->chan_info.chan = peer_mesh_info.master_channel;
                        wl_ext_enable_iface(mesh_if->dev, mesh_if->ifname, 500, TRUE);
                }
        }
@@ -1475,8 +1475,8 @@ wl_mesh_event_handler(struct wl_if_info *cur_if,
                                (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS &&
                                reason == WLC_E_REASON_INITIAL_ASSOC))) {
                        if (!wl_mesh_update_master_info(apsta_params, mesh_if)) {
-                               mesh_info->scan_channel = wl_ext_get_chan(&mesh_if->dev,
-                                       mesh_if->chan_info);
+                               mesh_info->scan_channel = wl_ext_get_chan(mesh_if->dev,
+                                       &mesh_if->chan_info);
                                wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO);
                        }
                }
@@ -2432,7 +2432,7 @@ wl_ext_get_dfs_master_if(struct wl_apsta_params *apsta_params)
 
 static void
 wl_ext_save_master_channel(struct wl_apsta_params *apsta_params,
-       uint16 post_channel)
+       struct wl_chan_info *post_chan_info)
 {
        struct wl_if_info *cur_if = NULL;
        struct wl_chan_info chan_info;
@@ -2448,8 +2448,8 @@ wl_ext_save_master_channel(struct wl_apsta_params *apsta_params,
                memset(&chan_info, 0, sizeof(struct wl_chan_info));
                wl_ext_get_chan(cur_if->dev, &chan_info);
                if (chan_info.chan) {
-                       cur_if->prev_channel = chan_info.chan;
-                       cur_if->post_channel = post_channel;
+                       memcpy(&cur_if->prev_chan_info, &chan_info, sizeof(struct wl_chan_info));
+                       memcpy(&cur_if->post_chan_info, post_chan_info, sizeof(struct wl_chan_info));
                }
        }
 }
@@ -2464,16 +2464,17 @@ wl_ext_iapsta_enable_master_if(struct net_device *dev, bool post)
 
        for (i=0; i<MAX_IF_NUM; i++) {
                cur_if = &apsta_params->if_info[i];
-               if (cur_if && cur_if->post_channel) {
+               if (cur_if && cur_if->post_chan_info.chan) {
                        if (post)
-                               cur_if->chan_info.chan = cur_if->post_channel;
+                               memcpy(&cur_if->chan_info, &cur_if->post_chan_info, sizeof(struct wl_chan_info));
                        else
-                               cur_if->chan_info.chan = cur_if->prev_channel;
+                               memcpy(&cur_if->chan_info, &cur_if->prev_chan_info, sizeof(struct wl_chan_info));
                        if (wl_ext_associated(cur_if->dev))
                                wl_ext_if_down(apsta_params, cur_if);
+                       OSL_SLEEP(100);
                        wl_ext_if_up(apsta_params, cur_if, TRUE, 0);
-                       cur_if->prev_channel = 0;
-                       cur_if->post_channel = 0;
+                       memset(&cur_if->prev_chan_info, 0, sizeof(struct wl_chan_info));
+                       memset(&cur_if->post_chan_info, 0, sizeof(struct wl_chan_info));
                }
        }
 }
@@ -2572,7 +2573,7 @@ wl_ext_iapsta_update_channel(struct net_device *dev, u32 chanspec)
                chan_info->chan = wl_ext_move_cur_channel(apsta_params, cur_if);
                if (chan_info->chan) {
                        if (cur_if->ifmode == ISTA_MODE && wl_ext_dfs_chan(chan_info))
-                               wl_ext_save_master_channel(apsta_params, chan_info->chan);
+                               wl_ext_save_master_channel(apsta_params, chan_info);
                        target_if = wl_ext_move_other_channel(apsta_params, cur_if);
                        if (dhd->conf->chip == BCM4359_CHIP_ID &&
                                        cur_if->ifmode == ISTA_MODE && !target_if) {
@@ -4153,13 +4154,15 @@ wl_ext_in4way_sync_sta(dhd_pub_t *dhd, struct wl_if_info *cur_if,
                        wl_timer_mod(dhd, &cur_if->reconnect_timer, 0);
 #endif /* WL_EXT_RECONNECT && WL_CFG80211 */
 #ifdef KEY_INSTALL_CHECK
-                       key_installed = wl_key_installed(cur_if);
+                       if (wpa_auth != WPA_AUTH_DISABLED && wpa_auth != WPA_AUTH_PSK) {
+                               key_installed = wl_key_installed(cur_if);
+                       }
 #endif /* KEY_INSTALL_CHECK */
                        if (key_installed)
                                conn_state = CONN_STATE_CONNECTED;
-                       wl_ext_update_conn_state(dhd, cur_if->ifidx, conn_state);
                        IAPSTA_INFO(dev->name, "WPA 4-WAY complete %d => %d\n",
                                cur_conn_state, conn_state);
+                       wl_ext_update_conn_state(dhd, cur_if->ifidx, conn_state);
 #ifdef EAPOL_RESEND
                        if (key_installed)
                                wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE);
@@ -5728,8 +5731,7 @@ wl_ext_parse_config(struct wl_if_info *cur_if, char *command, char **pick_next)
                                }
                        } else if (!strcmp(row->name, " chan ")) {
                                cur_if->chan_info.chan = (int)simple_strtol(pick_tmp, NULL, 10);
-                               if (!cur_if->chan_info.band)
-                                       cur_if->chan_info.band = WL_GET_BAND(cur_if->chan_info.chan);
+                               cur_if->chan_info.band = WL_GET_BAND(cur_if->chan_info.chan);
                        } else if (!strcmp(row->name, " amode ")) {
                                if (!strcmp(pick_tmp, "open"))
                                        cur_if->amode = AUTH_OPEN;
@@ -6847,7 +6849,7 @@ wl_ext_iapsta_postinit(struct net_device *net, struct wl_if_info *cur_if)
                }
 #ifdef WLMESH
                else if (cur_if->ifmode == IMESH_MODE) {
-                       pm = 0;
+                       int pm = 0;
                        wl_ext_ioctl(cur_if->dev, WLC_SET_PM, &pm, sizeof(pm), 1);
                }
 #endif /* WLMESH */
index 2497c1f1f0a39c13cb9e512b5ac5118300b3d896..1d0a48439a73fc28ba6d407a52deffd3d75274cc 100755 (executable)
@@ -1568,17 +1568,20 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
        if (bi->ie_length) {
                /* look for wpa/rsn ies in the ie list... */
                bcm_tlv_t *ie;
-               uint8 *ptr = ((uint8 *)bi) + bi->ie_offset;
+               uint8 *ptr = ((uint8 *)bi) + bi->ie_offset, *ie_data;
                int ptr_len = bi->ie_length;
 
                /* OSEN IE */
-               if ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_VS_ID)) &&
-                       ie->len > WFA_OUI_LEN + 1 &&
-                       !bcmp((const void *)&ie->data[0], (const void *)WFA_OUI, WFA_OUI_LEN) &&
-                       ie->data[WFA_OUI_LEN] == WFA_OUI_TYPE_OSEN) {
-                       iwe.cmd = IWEVGENIE;
-                       iwe.u.data.length = ie->len + 2;
-                       event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)ie);
+               ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_VS_ID);
+               if (ie) {
+                       ie_data = ie->data;
+                       if (ie->len > WFA_OUI_LEN + 1 &&
+                               !bcmp((const void *)&ie->data[0], (const void *)WFA_OUI, WFA_OUI_LEN) &&
+                               ie_data[WFA_OUI_LEN] == WFA_OUI_TYPE_OSEN) {
+                                       iwe.cmd = IWEVGENIE;
+                                       iwe.u.data.length = ie->len + 2;
+                                       event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)ie);
+                       }
                }
                ptr = ((uint8 *)bi) + bi->ie_offset;
 
index e161006a2bd6a7cb38baa45d581720e231b7ff50..a16265501e252d8866f76430438f07f0021bc4ac 100755 (executable)
@@ -83,7 +83,6 @@ typedef struct wl_iw_extra_params {
 #define        WL_IW_RSSI_INVALID       0      /* invalid RSSI value */
 #define MAX_WX_STRING 80
 #define SSID_FMT_BUF_LEN       ((4 * 32) + 1)
-#define isprint(c) bcm_isprint(c)
 #define WL_IW_SET_ACTIVE_SCAN  (SIOCIWFIRSTPRIV+1)
 #define WL_IW_GET_RSSI                 (SIOCIWFIRSTPRIV+3)
 #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)