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
# 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
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
#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>
IOV_HCIREGS,
IOV_POWER,
IOV_CLOCK,
- IOV_RXCHAIN
+ IOV_RXCHAIN,
+ IOV_DS
};
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 }
};
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):
{
#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>
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))) {
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;
}
}
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;
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
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) {
}
#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);
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
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__));
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;
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
}
#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;
}
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);
}
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__));
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;
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));
}
#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)
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;
}
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
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);
#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 */
#ifndef BCMDBUS
#define BCMDBUS
#endif
+#ifndef DHD_USE_STATIC_MEMDUMP
#define DHD_USE_STATIC_MEMDUMP { : = y}
+#endif
//#define BCMDHD_UNUSE_MEM
#endif
#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_ */
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);
#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
/* 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);
#define BUFSZ 8
#define BUFSZN BUFSZ + 1
+#undef _S
#define _S(x) #x
#define S(x) _S(x)
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");
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);
#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 */
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;
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);
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
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;
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) */
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.
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"));
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,
#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"
#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
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 */
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;
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)) {
goto done;
}
#endif /* DHD_PKT_LOGGING */
+#if defined(DHD_FW_COREDUMP)
}
+#endif /* DHD_FW_COREDUMP */
done:
return ret;
}
#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;
*/
#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;
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;
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);
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:
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) {
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;
}
#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);
#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);
#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);
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;
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);
}
}
(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);
}
}
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;
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));
}
}
}
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));
}
}
}
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) {
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);
}
} 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;
}
#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 */
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;
#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)