Driver commit for release MM6X18537_2025-04-22-00-42-38

This commit is contained in:
Vinoba Jadhav 2025-04-22 00:42:38 -07:00 • committed by Meet Patel
parent 0ea4f2ff50
commit 32e3210500
73 changed files with 12560 additions and 2237 deletions

View file

@ -175,7 +175,7 @@ APPDIR= $(shell if test -d "mapp"; then echo mapp; fi)
#############################################################################
ccflags-y += -I$(KERNELDIR)/include
ccflags-y += -DMLAN_RELEASE_VERSION='"505.p14"'
ccflags-y += -DMLAN_RELEASE_VERSION='"537"'
ccflags-y += -DFPNUM='"92"'

23
README
View file

@ -3,7 +3,7 @@
===============================================================================
U S E R M A N U A L
Copyright 2008-2024 NXP
Copyright 2008-2025 NXP
1) FOR DRIVER BUILD
@ -11,7 +11,7 @@
Goto source code directory.
make [clean] build
The driver and utility binaries can be found in bin_wlan directory.
The driver code supports Linux kernel from 2.6.32 to 6.11.0.
The driver source code is compatible with hosts running Linux kernel versions ranging from 2.6.32 to 6.13.1.
2) FOR DRIVER INSTALL
@ -103,7 +103,8 @@
req_fw_nowait=0|1 <use request_firmware API (default) | use request_firmware_nowait API>
dfs53cfg=0|1|2 <use Fw Default | New W53 | Old W53>
mcs32=0|1 <disable HT MCS32 support | enable HT MCS32 (default)>
For 9097/9098/IW624/AW693: antcfg=0x101|0x303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G>
For 9097/9098: antcfg=0x101|0x303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G>
For IW624/AW693: antcfg=0x10101|0x30303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G, Bit16: Tx/Rx Path A for 6G, Bit17: Tx/Rx Path B for 6G>
For AW693, it's recommended to use mod_para configuration file for antcfg as MAC1 supports 2x2 and MAC2 supports only 1x1.
For 8897/8997: antcfg=0x11|0x13|0x33 <Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B>
For others: antcfg=0|1|2|0xffff <default | Tx/Rx antenna 1 | Tx/Rx antenna 2 | enable antenna diversity>
@ -142,7 +143,7 @@
must be 0. wq_sched_prio should be 1 to 99 otherwise.
rx_work=0|1|2 <default (enabled for multi-core) | Enable rx_work_queue | Disable rx_work_queue>
tx_work=0|1 <Disable tx_work_queue | Enable tx_work_queue (default on iMX)>
tx_skb_clone=0|1 <Disable tx_skb_clone | Enable tx_skb_clone (default on iMX)>
tx_skb_clone=0|1 <Disable tx_skb_clone | Enable tx_skb_clone (default)>
pmqos=0|1 <Disable pmqos | Enable pmqos (default on iMX)>
rps=0|x <Disables rps (default) | bit0-bit4 (0x1-0xf) Enables rps on specific cpu>
intmode=0|1 <SDIO Interrupt Mode (default) | GPIO Interrupt Mode>
@ -367,6 +368,9 @@
cat /proc/mwlan/adapter0/drv_dump > file_drv_dump #save the drv dump to file_drv_dump
cat /proc/mwlan/adapter0/fw_dump > file_fw_dump #save the fw dump to file_fw_dump
cat /proc/mwlan/adapter1/drv_dump > file_drv_dump_2 #save the adapter1 drv dump to file_drv_dump_2
To print fw dump on dmesg log, please enable 21'b bit (MFWDP_D) in drvdbg
insmod mlan.ko
insmod moal.ko mod_para=nxp/wifi_mod_para.conf [drvdbg=0x200000]
Use dmesg or cat /var/log/debug to check driver debug messages.
@ -598,6 +602,16 @@
Bit 8 -- Rx Path B
Bit 8-9 -- Rx Path A+B
For 9097/9098/IW624/AW693, HIGH BYTE for 5G setting
where value of o is:
For IW624/AW693, 6G setting
Bit 0 -- Tx Path A
Bit 1 -- Tx Path B
Bit 0-1 -- Tx Path A+B
where value of p is:
For IW624/AW693, 6G setting
Bit 0 -- Rx Path A
Bit 1 -- Rx Path B
Bit 0-1 -- Rx Path A+B
The Tx path setting (m) is used for both Tx and Rx if Rx path (n) is not provided.
Examples:
@ -607,6 +621,7 @@
echo "antcfg=0x103" > /proc/mwlan/adapter0/config : Set Tx and Rx path to A+B on 2G and Tx and Rx path to A on 5G
echo "antcfg=0x103 0x103" > /proc/mwlan/adapter0/config : Set Tx path to A+B and Rx path to A+B on 2G, and Tx and Rx path to A on 5G
echo "antcfg=0x103 0x103 2 2" > /proc/mwlan/adapter0/config : Set both Tx and Rx path to A+B on 2G, both Tx and Rx path to A on 5G, both Tx and Rx path to B on 6G
echo "antcfg=0x202" > /proc/mwlan/adapter0/config : Use 5GHz path B pin for 5G TX/RX and 2GHz path B pin for 2G TX/RX

View file

@ -56,62 +56,14 @@ t_u16 wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands,
t_u8 wlan_get_center_freq_idx(mlan_private *pmpriv, t_u16 band, t_u32 pri_chan,
t_u8 chan_bw)
{
struct center_freq_desc {
t_u8 pri_chan;
t_u8 ch_40;
t_u8 ch_80;
t_u8 ch_160;
};
static const struct center_freq_desc center_freq_idx_map_5g[] = {
{.pri_chan = 36, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 40, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 44, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 48, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 52, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 56, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 60, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 64, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 68, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 72, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 76, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 80, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 84, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 88, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 92, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 96, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 100, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 104, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 108, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 112, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 116, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 120, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 124, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 128, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 132, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 136, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 140, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 144, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 149, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 153, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 157, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 161, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 165, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 169, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 173, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 177, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 184, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 188, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 192, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 196, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 0,
.ch_40 = 42 /* terminator with default cfreq */}};
const struct center_freq_desc *map = MNULL;
if (band == BAND_5GHZ)
map = center_freq_idx_map_5g;
if (band == BAND_6GHZ)
map = center_freq_idx_map_6g;
for (; map != MNULL; map++) {
/* reached end of map, return default value for that map */
if (map->pri_chan == 0)
@ -1456,6 +1408,8 @@ void wlan_update_11ac_cap(mlan_private *pmpriv)
*/
t_u8 wlan_11ac_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
{
if (bss_band & BAND_6G)
return 0;
{
if (bss_band & BAND_G)
return (pmpriv->config_bands & BAND_GAC);

View file

@ -3,7 +3,7 @@
* @brief This file contains the functions for 11ax related features.
*
*
* Copyright 2018-2022, 2024 NXP
* Copyright 2018-2022, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -99,7 +99,7 @@ t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
(MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
MrvlIEtypes_He_cap_t *hw_he_cap =
(MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap;
t_u16 band_selected = BAND_A;
t_u16 band_selected = BAND_A | BAND_6G;
if (pbss_desc && !wlan_check_ap_11ax_twt_supported(pbss_desc)) {
PRINTM(MINFO, "AP don't support twt feature\n");
@ -415,7 +415,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u16 cfg_value = 0;
t_u16 hw_value = 0;
MrvlIEtypes_He_cap_t *phw_hecap = MNULL;
t_u16 band_selected = BAND_A;
t_u16 band_selected = BAND_A | BAND_6G;
ENTER();
@ -625,6 +625,225 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter,
return;
}
#define HE_OP_INFO_IE_FIX_LEN 7
/**
* @brief This function get the channel bandwidth from he_6g_op_info
*
* @param pbss_desc A pointer to BSSDescriptor_t
*
* @return band_width
*/
t_u8 wlan_get_6g_ap_bandconfig(BSSDescriptor_t *pbss_desc,
Band_Config_t *bandcfg)
{
t_u8 band_width = CHAN_BW_20MHZ;
IEEEtypes_HeOp_t *phe_op_info;
IEEEtypes_He6GOpInfo_t *phe_6g_op_info;
t_u8 ie_len = HE_OP_INFO_IE_FIX_LEN;
if (!pbss_desc->phe_oprat)
return band_width;
phe_op_info = (IEEEtypes_HeOp_t *)pbss_desc->phe_oprat;
if (!phe_op_info->he_op_param.he_6g_op_info_present)
return band_width;
if (phe_op_info->he_op_param.vht_op_info_present)
ie_len += 3;
if (phe_op_info->he_op_param.co_located_bss)
ie_len += 1;
if (phe_op_info->ieee_hdr.len != (ie_len + 5)) {
PRINTM(MERROR, "Invalid he_op_info len %d, expect %d\n",
phe_op_info->ieee_hdr.len, ie_len);
return band_width;
}
phe_6g_op_info =
(IEEEtypes_He6GOpInfo_t *)((t_u8 *)phe_op_info +
sizeof(IEEEtypes_Header_t) + ie_len);
switch (phe_6g_op_info->control.channel_width) {
case BW_20MHZ:
band_width = CHAN_BW_20MHZ;
break;
case BW_40MHZ:
band_width = CHAN_BW_40MHZ;
if (phe_6g_op_info->primary_channel <
phe_6g_op_info->channel_center_freq0) {
bandcfg->chan2Offset = SEC_CHAN_ABOVE;
} else {
bandcfg->chan2Offset = SEC_CHAN_BELOW;
}
break;
case BW_80MHZ:
/* TODO: Use CHAN_BW_80MHZ until the support for 160MHz gets added */
case BW_160MHZ:
band_width = CHAN_BW_80MHZ;
break;
default:
break;
}
return band_width;
}
/**
* @brief This function save the 11ax 6g cap from FW.
*
* @param pmadapater A pointer to mlan_adapter
* @param hw_he_6g_cap A pointer to MrvlIEtypes_Extension_t
*
* @return N/A
*/
void wlan_update_11ax_6g_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t *hw_he_6g_cap)
{
MrvlIEtypes_He_6g_cap_t *phe_6g_cap = MNULL;
t_u8 i;
ENTER();
if ((hw_he_6g_cap->len + sizeof(MrvlIEtypesHeader_t)) !=
sizeof(MrvlIEtypes_He_6g_cap_t)) {
PRINTM(MERROR, "invalid hw_he_6g_cap, len=%d\n",
hw_he_6g_cap->len);
LEAVE();
return;
}
pmadapter->fw_bands |= BAND_6G;
pmadapter->config_bands |= BAND_6G;
phe_6g_cap = (MrvlIEtypes_He_6g_cap_t *)hw_he_6g_cap;
pmadapter->hw_he_6g_cap = wlan_le16_to_cpu(phe_6g_cap->capa);
for (i = 0; i < pmadapter->priv_num; i++) {
if (pmadapter->priv[i]) {
pmadapter->priv[i]->config_bands =
pmadapter->config_bands;
pmadapter->priv[i]->user_he_6g_cap =
pmadapter->hw_he_6g_cap;
}
}
pmadapter->wifi_6g_scan_split = MTRUE;
pmadapter->wifi_6g_scan_coloc_ap = MTRUE;
LEAVE();
return;
}
/**
* @brief This function fills the HE 6G cap tlv out put format is LE, not CPU
*
* @param priv A pointer to mlan_private structure
* @param phe_6g_cap A pointer to MrvlIEtypes_He_6g_cap_t structure
*
* @return N/A
*/
void wlan_fill_he_6g_cap_tlv(mlan_private *pmpriv,
MrvlIEtypes_He_6g_cap_t *phe_6g_cap)
{
if (!phe_6g_cap) {
LEAVE();
return;
}
phe_6g_cap->header.type = wlan_cpu_to_le16(EXTENSION);
phe_6g_cap->header.len =
sizeof(MrvlIEtypes_He_6g_cap_t) - sizeof(MrvlIEtypesHeader_t);
phe_6g_cap->header.len = wlan_cpu_to_le16(phe_6g_cap->header.len);
phe_6g_cap->ext_id = HE_6G_CAPABILITY;
phe_6g_cap->capa = wlan_cpu_to_le16(pmpriv->user_he_6g_cap);
PRINTM(MCMND, "Set: HE 6G CAP 0x%x\n", pmpriv->user_he_6g_cap);
LEAVE();
return;
}
/**
* @brief This function check if 11AX is allowed in bandcfg
*
* @param pmpriv A pointer to mlan_private structure
* @param pbss_desc A pointer to BSSDescriptor_t
*
* @return 0--not allowed, other value allowed
*/
t_u16 wlan_116e_bandconfig_allowed(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
t_u16 bss_band = pbss_desc->bss_band;
if (bss_band & BAND_6G)
return (pmpriv->config_bands & BAND_6G);
return MFALSE;
}
/**
* @brief This function append the 11ax HE 6g capability tlv
*
* @param pmpriv A pointer to mlan_private structure
* @param pbss_desc A pointer to BSSDescriptor_t structure
* @param ppbuffer A Pointer to command buffer pointer
*
* @return bytes added to the buffer
*/
int wlan_cmd_append_116e_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer)
{
MrvlIEtypes_He_6g_cap_t *phe_6g_cap = MNULL;
MrvlIETypes_ExtCap_t *pext_cap;
pmlan_adapter pmadapter = pmpriv->adapter;
int ret_len = 0;
ENTER();
/* Null Checks */
if (ppbuffer == MNULL) {
LEAVE();
return 0;
}
if (*ppbuffer == MNULL) {
LEAVE();
return 0;
}
/** check if AP support HE 6G, if not return right away */
if (!pbss_desc || !pbss_desc->phe_6g_cap) {
LEAVE();
return 0;
}
phe_6g_cap = (MrvlIEtypes_He_6g_cap_t *)*ppbuffer;
phe_6g_cap->header.type = wlan_cpu_to_le16(EXTENSION);
phe_6g_cap->header.len =
sizeof(MrvlIEtypes_He_6g_cap_t) - sizeof(MrvlIEtypesHeader_t);
phe_6g_cap->header.len = wlan_cpu_to_le16(phe_6g_cap->header.len);
phe_6g_cap->ext_id = HE_6G_CAPABILITY;
phe_6g_cap->capa = wlan_cpu_to_le16(pmpriv->user_he_6g_cap);
*ppbuffer += sizeof(MrvlIEtypes_He_6g_cap_t);
ret_len += sizeof(MrvlIEtypes_He_6g_cap_t);
DBG_HEXDUMP(MCMD_D, "append_11ax_tlv", (t_u8 *)phe_6g_cap,
sizeof(MrvlIEtypes_He_6g_cap_t));
/* Add Extended Cap IE for 6E */
if (pbss_desc->pext_cap) {
pext_cap = (MrvlIETypes_ExtCap_t *)*ppbuffer;
memset(pmadapter, pext_cap, 0, sizeof(MrvlIETypes_ExtCap_t));
pext_cap->header.type = wlan_cpu_to_le16(EXT_CAPABILITY);
pext_cap->header.len = sizeof(ExtCap_t);
memcpy_ext(pmadapter,
(t_u8 *)pext_cap + sizeof(MrvlIEtypesHeader_t),
(t_u8 *)&pmpriv->ext_cap, sizeof(ExtCap_t),
pext_cap->header.len);
if (pbss_desc && pbss_desc->multi_bssid_ap)
SET_EXTCAP_MULTI_BSSID(pext_cap->ext_cap);
if (!pmadapter->ecsa_enable)
RESET_EXTCAP_EXT_CHANNEL_SWITCH(pext_cap->ext_cap);
else
SET_EXTCAP_EXT_CHANNEL_SWITCH(pext_cap->ext_cap);
HEXDUMP("Extended Capabilities IE", (t_u8 *)pext_cap,
sizeof(MrvlIETypes_ExtCap_t));
*ppbuffer += sizeof(MrvlIETypes_ExtCap_t);
ret_len += sizeof(MrvlIETypes_ExtCap_t);
pext_cap->header.len = wlan_cpu_to_le16(pext_cap->header.len);
}
LEAVE();
return ret_len;
}
/**
* @brief This function check if 11AX is allowed in bandcfg
*
@ -637,6 +856,8 @@ t_u16 wlan_11ax_bandconfig_allowed(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
t_u16 bss_band = pbss_desc->bss_band;
if (bss_band & BAND_6G)
return MTRUE;
if (pbss_desc->disable_11n)
return MFALSE;
{
@ -678,6 +899,11 @@ static mlan_status wlan_11ax_ioctl_hecfg(pmlan_adapter pmadapter,
PRINTM(MERROR, "FW don't support 5G AX\n");
return MLAN_STATUS_FAILURE;
}
if ((cfg->param.he_cfg.band & MBIT(2)) &&
!(pmadapter->fw_bands & BAND_6G)) {
PRINTM(MERROR, "FW don't support 6E AX\n");
return MLAN_STATUS_FAILURE;
}
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
else
@ -745,28 +971,62 @@ mlan_status wlan_cmd_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_11AX_CFG *axcfg = &cmd->params.axcfg;
mlan_ds_11ax_he_cfg *hecfg = (mlan_ds_11ax_he_cfg *)pdata_buf;
mlan_ds_11ax_he_capa *hecap;
MrvlIEtypes_Extension_t *tlv = MNULL;
t_u8 *pos = MNULL;
ENTER();
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_11AX_CFG);
cmd->size = sizeof(HostCmd_DS_11AX_CFG) + S_DS_GEN;
axcfg->action = wlan_cpu_to_le16(cmd_action);
axcfg->band_config = hecfg->band & 0xFF;
pos = (t_u8 *)axcfg->val;
pos = (t_u8 *)&cmd->params + sizeof(HostCmd_DS_11AX_CFG);
/**HE Capability */
if (hecfg->he_cap.len && (hecfg->he_cap.ext_id == HE_CAPABILITY)) {
if (hecfg->he_cap.len && ((hecfg->he_cap.ext_id == HE_CAPABILITY) ||
(hecfg->he_cap.ext_id == HE_6G_CAPABILITY))) {
tlv = (MrvlIEtypes_Extension_t *)pos;
tlv->type = wlan_cpu_to_le16(hecfg->he_cap.id);
hecfg->he_cap.len = MIN(hecfg->he_cap.len,
MRVDRV_SIZE_OF_CMD_BUFFER - cmd->size);
tlv->len = wlan_cpu_to_le16(hecfg->he_cap.len);
// coverity[cert_arr30_c_violation:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
// coverity[overrun-buffer-arg:SUPPRESS]
memcpy_ext(pmadapter, &tlv->ext_id, &hecfg->he_cap.ext_id,
hecfg->he_cap.len,
MRVDRV_SIZE_OF_CMD_BUFFER - cmd->size);
hecfg->he_cap.len, hecfg->he_cap.len);
cmd->size += hecfg->he_cap.len + sizeof(MrvlIEtypesHeader_t);
pos += hecfg->he_cap.len + sizeof(MrvlIEtypesHeader_t);
}
hecap = (mlan_ds_11ax_he_capa *)((t_u8 *)&hecfg->he_cap +
hecfg->he_cap.len +
sizeof(MrvlIEtypesHeader_t));
/* hecap will not access memory beyond cmd size */
// coverity[cert_arr30_c_violation:SUPPRESS]
// coverity[overrun-local:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
if (hecap->len && ((hecap->ext_id == HE_CAPABILITY) ||
(hecap->ext_id == HE_6G_CAPABILITY))) {
tlv = (MrvlIEtypes_Extension_t *)pos;
tlv->type = wlan_cpu_to_le16(hecap->id);
hecap->len =
MIN(hecap->len, MRVDRV_SIZE_OF_CMD_BUFFER - cmd->size);
tlv->len = wlan_cpu_to_le16(hecap->len);
// coverity[cert_arr30_c_violation:SUPPRESS]
// coverity[overrun-buffer-arg:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter, &tlv->ext_id, &hecap->ext_id, hecap->len,
hecap->len);
cmd->size += hecap->len + sizeof(MrvlIEtypesHeader_t);
pos += hecap->len + sizeof(MrvlIEtypesHeader_t);
}
cmd->size = wlan_cpu_to_le16(cmd->size);
LEAVE();
@ -790,6 +1050,8 @@ mlan_status wlan_ret_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
HostCmd_DS_11AX_CFG *axcfg = &resp->params.axcfg;
MrvlIEtypes_Extension_t *tlv = MNULL;
t_u16 left_len = 0, tlv_type = 0, tlv_len = 0;
/** mlan_ds_11ax_he_6g_capa */
mlan_ds_11ax_he_6g_capa *he_6g_cap = MNULL;
ENTER();
@ -816,7 +1078,8 @@ mlan_status wlan_ret_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
(t_u8 *)&tlv->ext_id, tlv_len,
sizeof(mlan_ds_11ax_he_capa) -
sizeof(MrvlIEtypesHeader_t));
if (cfg->param.he_cfg.band & MBIT(1)) {
if (cfg->param.he_cfg.band & MBIT(1) ||
cfg->param.he_cfg.band & MBIT(2)) {
memcpy_ext(
pmadapter,
(t_u8 *)&pmpriv->user_he_cap,
@ -846,6 +1109,28 @@ mlan_status wlan_ret_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
pmpriv->user_2g_hecap_len);
}
break;
case HE_6G_CAPABILITY:
he_6g_cap =
(mlan_ds_11ax_he_6g_capa
*)((t_u8 *)hecap + hecap->len +
sizeof(MrvlIEtypesHeader_t));
he_6g_cap->id = tlv_type;
he_6g_cap->len = MIN(
tlv_len,
sizeof(mlan_ds_11ax_he_capa) -
sizeof(MrvlIEtypesHeader_t));
// coverity[cert_arr30_c_violation:SUPPRESS]
// coverity[overrun-buffer-arg:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter,
(t_u8 *)&he_6g_cap->ext_id,
(t_u8 *)&tlv->ext_id, tlv_len,
he_6g_cap->len);
pmpriv->user_he_6g_cap =
wlan_le16_to_cpu(he_6g_cap->capa);
PRINTM(MCMND, "user_he_6g_cap=0x%x\n",
pmpriv->user_he_6g_cap);
break;
default:
break;
}

View file

@ -52,6 +52,24 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
void wlan_update_11ax_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t *hw_he_cap);
/** GET 6G Band CapInfo : MAX MPDU Length */
#define GET_6G_BAND_CAP_MAXMPDULEN(BandCapInfo) ((BandCapInfo >> 6) & 0x3)
#define IS_116E_ENABLED(priv) \
((priv->config_bands & BAND_6G) && \
priv->curr_bss_params.bss_descriptor.phe_cap && \
priv->curr_bss_params.bss_descriptor.phe_6g_cap)
void wlan_update_11ax_6g_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t *hw_he_6g_cap);
void wlan_fill_he_6g_cap_tlv(mlan_private *pmpriv,
MrvlIEtypes_He_6g_cap_t *phe_6g_cap);
t_u16 wlan_116e_bandconfig_allowed(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc);
int wlan_cmd_append_116e_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer);
t_u8 wlan_get_6g_ap_bandconfig(BSSDescriptor_t *pbss_desc,
Band_Config_t *bandcfg);
int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer);
t_u16 wlan_11ax_bandconfig_allowed(mlan_private *pmpriv,

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for 802.11D.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2022, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -122,6 +122,67 @@ static chan_freq_power_t channel_freq_power_UN_AJ[] = {
{252, 4980, TX_PWR_DEFAULT},
channels for 11J JP 10M channel gap */
};
/** Channels for 802.116G */
static chan_freq_power_t channel_freq_power_UN_6G[] = {
{1, 5955, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{5, 5975, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{9, 5995, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{13, 6015, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{17, 6035, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{21, 6055, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{25, 6075, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{29, 6095, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{33, 6115, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{37, 6135, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{41, 6155, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{45, 6175, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{49, 6195, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{53, 6215, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{57, 6235, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{61, 6255, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{65, 6275, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{69, 6295, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{73, 6315, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{77, 6335, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{81, 6355, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{85, 6375, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{89, 6395, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{94, 6415, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{97, 6435, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{101, 6455, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{105, 6475, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{109, 6495, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{113, 6515, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{117, 6535, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{121, 6555, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{125, 6575, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{129, 6595, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{133, 6615, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{137, 6635, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{141, 6655, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{145, 6675, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{149, 6695, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{153, 6715, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{157, 6735, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{161, 6755, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{165, 6775, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{169, 6795, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{173, 6815, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{177, 6835, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{181, 6855, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{185, 6875, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{189, 6895, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{193, 6915, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{197, 6935, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{201, 6955, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{205, 6975, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{209, 6995, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{213, 7015, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{217, 7035, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{221, 7055, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{225, 7075, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{229, 7095, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{233, 7115, TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}}};
/********************************************************
Global Variables
********************************************************/
@ -437,6 +498,9 @@ static t_u8 wlan_11d_get_chan(pmlan_adapter pmadapter, t_u16 band,
} else if (band & (BAND_A | BAND_AN | BAND_AAC)) {
cfp = channel_freq_power_UN_AJ;
cfp_no = NELEMENTS(channel_freq_power_UN_AJ);
} else if (band & BAND_6G) {
cfp = channel_freq_power_UN_6G;
cfp_no = NELEMENTS(channel_freq_power_UN_6G);
} else {
PRINTM(MERROR, "11D: Wrong Band[%d]\n", band);
LEAVE();
@ -855,6 +919,7 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
t_u8 no_of_sub_band = pmadapter->domain_reg.no_of_sub_band;
MrvlIEtypes_Rgn_dom_code_t *rgn = MNULL;
t_u8 *tlv = MNULL;
MrvlIEtypes_channel_band_t *tlv_chan_band = MNULL;
t_u8 i;
@ -920,6 +985,15 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
tlv += sizeof(MrvlIEtypes_Rgn_dom_code_t);
}
tlv_chan_band = (MrvlIEtypes_channel_band_t *)tlv;
tlv_chan_band->header.type =
wlan_cpu_to_le16(TLV_TYPE_UAP_CHAN_BAND_CONFIG);
tlv_chan_band->header.len =
wlan_cpu_to_le16(sizeof(MrvlIEtypes_channel_band_t) -
sizeof(MrvlIEtypesHeader_t));
tlv_chan_band->bandcfg.chanBand = pmadapter->domain_reg.band;
tlv_chan_band->channel = 0;
pcmd->size += sizeof(MrvlIEtypes_channel_band_t);
} else {
pcmd->size = sizeof(pdomain_info->action) + S_DS_GEN;
}
@ -986,6 +1060,135 @@ mlan_status wlan_ret_802_11d_domain_info(mlan_private *pmpriv,
return ret;
}
#ifdef UAP_SUPPORT
/**
* @brief This function implements command HostCmd_CMD_802_CUSTOM_BEACON_IE
*
* @param pmpriv A pointer to mlan_private structure
* @param pcmd A pointer to HostCmd_DS_COMMAND structure of
* command buffer
* @param pioctl_buf A pointer to ioctl buffer
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_cmd_802_11d_custom_bcn_country_ie_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd,
pmlan_ioctl_req pioctl_buf)
{
mlan_adapter *pmadapter = pmpriv->adapter;
HostCmd_DS_802_11D_DOMAIN_INFO *pdomain_info =
&pcmd->params.domain_info;
MrvlIEtypes_DomainParamSet_t *domain = &pdomain_info->domain;
t_u8 no_of_sub_band = 0;
t_u8 *tlv = MNULL;
t_u8 i;
mlan_ds_11d_cfg *cfg_11d = MNULL;
ENTER();
if (!pioctl_buf) {
PRINTM(MERROR, "BCN Country IE: pioctl_buf is NULL\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
cfg_11d = (mlan_ds_11d_cfg *)pioctl_buf->pbuf;
if (!cfg_11d) {
PRINTM(MERROR, "BCN Country IE: cfg_11d is NULL\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
no_of_sub_band = cfg_11d->param.domain_info.no_of_sub_band;
PRINTM(MCMND, "BCN Country IE:Country=%c%c sub-band=%d sub-cmd=0x%x\n",
cfg_11d->param.domain_info.country_code[0],
cfg_11d->param.domain_info.country_code[1], no_of_sub_band,
cfg_11d->sub_command);
for (i = 0; i < no_of_sub_band; i++) {
PRINTM(MCMND,
"BCN Country IE: first chan=%d no_of_chan=%d, max_tx_pwr=%d\n",
cfg_11d->param.domain_info.sub_band[i].first_chan,
cfg_11d->param.domain_info.sub_band[i].no_of_chan,
cfg_11d->param.domain_info.sub_band[i].max_tx_pwr);
}
pcmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_CUSTOM_BEACON_IE);
pdomain_info->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
tlv = (t_u8 *)&pdomain_info->domain;
/* Set domain info fields */
domain = (MrvlIEtypes_DomainParamSet_t *)tlv;
domain->header.type = wlan_cpu_to_le16(TLV_TYPE_DOMAIN);
memcpy_ext(pmadapter, domain->country_code,
cfg_11d->param.domain_info.country_code,
sizeof(domain->country_code), sizeof(domain->country_code));
domain->header.len =
((no_of_sub_band * sizeof(IEEEtypes_SubbandSet_t)) +
sizeof(domain->country_code));
if (no_of_sub_band) {
memcpy_ext(pmadapter, domain->sub_band,
cfg_11d->param.domain_info.sub_band,
no_of_sub_band * sizeof(IEEEtypes_SubbandSet_t),
MRVDRV_MAX_SUBBAND_802_11D *
sizeof(IEEEtypes_SubbandSet_t));
pcmd->size += sizeof(pdomain_info->action) +
domain->header.len + sizeof(MrvlIEtypesHeader_t) +
S_DS_GEN;
tlv += domain->header.len + sizeof(MrvlIEtypesHeader_t);
} else {
pcmd->size = sizeof(pdomain_info->action) + S_DS_GEN;
}
pcmd->size = wlan_cpu_to_le16(pcmd->size);
HEXDUMP("BCN Country IE: INFO", (t_u8 *)pcmd,
wlan_le16_to_cpu(pcmd->size));
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handle response of HostCmd_CMD_802_CUSTOM_BEACON_IE
*
* @param pmpriv A pointer to mlan_private structure
* @param resp Pointer to command response buffer
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_ret_802_11d_custom_bcn_country_ie_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *resp)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
HostCmd_DS_802_11D_DOMAIN_INFO_RSP *domain_info =
&resp->params.domain_info_resp;
MrvlIEtypes_DomainParamSet_t *domain = &domain_info->domain;
t_u8 no_of_sub_band = 0;
ENTER();
/* Dump domain info response data */
HEXDUMP("BCN Country ie: Info Rsp Data", (t_u8 *)resp, resp->size);
no_of_sub_band = (t_u8)((wlan_le16_to_cpu(domain->header.len) -
COUNTRY_CODE_LEN) /
sizeof(IEEEtypes_SubbandSet_t));
PRINTM(MINFO, "BCN Country ie Resp: number of sub-band=%d\n",
no_of_sub_band);
if (no_of_sub_band > MRVDRV_MAX_SUBBAND_802_11D) {
PRINTM(MWARN,
"BCN Country ie: Invalid number of subbands %d returned!!\n",
no_of_sub_band);
ret = MLAN_STATUS_FAILURE;
}
LEAVE();
return ret;
}
#endif //#ifdef UAP_SUPPORT
/**
* @brief This function converts channel to frequency
*
@ -1012,6 +1215,9 @@ t_u32 wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u16 band)
else if (band & (BAND_A | BAND_AN | BAND_AAC)) {
cf = channel_freq_power_UN_AJ;
cnt = NELEMENTS(channel_freq_power_UN_AJ);
} else if (band & BAND_6G) {
cf = channel_freq_power_UN_6G;
cnt = NELEMENTS(channel_freq_power_UN_6G);
} else {
PRINTM(MERROR, "11D: Wrong Band [%d]\n", band);
LEAVE();
@ -1182,6 +1388,26 @@ mlan_status wlan_11d_set_universaltable(mlan_private *pmpriv, t_u16 band)
pmadapter->universal_channel[i].band = BAND_A;
i++;
}
if (band & BAND_6G) {
/* If band 6G */
/* Set channel-frequency-power */
pmadapter->universal_channel[i].num_cfp =
NELEMENTS(channel_freq_power_UN_6G);
PRINTM(MINFO, "11D: 6G-band num_cfp=%d\n",
pmadapter->universal_channel[i].num_cfp);
pmadapter->universal_channel[i].pcfp = channel_freq_power_UN_6G;
pmadapter->universal_channel[i].valid = MTRUE;
/* Set region code */
pmadapter->universal_channel[i].region = UNIVERSAL_REGION_CODE;
/* Set band */
pmadapter->universal_channel[i].band = BAND_6G;
i++;
}
LEAVE();
return MLAN_STATUS_SUCCESS;
@ -1288,6 +1514,14 @@ mlan_status wlan_11d_create_dnld_countryinfo(mlan_private *pmpriv, t_u16 band)
continue;
}
break;
case BAND_6G:
switch (band) {
case BAND_6G:
break;
default:
continue;
}
break;
case BAND_B:
case BAND_G:
switch (band) {
@ -1507,7 +1741,45 @@ static t_u8 *wlan_11d_map_country_code(pmlan_adapter pmadapter,
else
return pcountry_code;
}
#ifdef UAP_SUPPORT
/**
* @brief This function sets up BCN country ie and downloads CMD to FW
* Should be called when 11D support is enabled.
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req Pointer to the IOCTL request buffer
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status wlan_11d_bcn_country_ie_info(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_private *pmpriv = MNULL;
ENTER();
pmpriv = pmadapter->priv[pioctl_req->bss_index];
if (!pmpriv) {
PRINTM(MERROR, "[%s] ERR: pmpriv is NULL\n", __func__);
LEAVE();
return MLAN_STATUS_FAILURE;
}
PRINTM(MCMND, "BCN Country IE: sending cmd to FW\n");
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_CUSTOM_BEACON_IE,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
MNULL);
if (ret) {
PRINTM(MERROR, "BCN Country IE: Failed to download\n");
}
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
#endif
/**
* @brief This function sets up domain_reg and downloads CMD to FW
*

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for 802.11H.
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -466,7 +466,7 @@ wlan_11h_set_supp_channels_ie(mlan_private *priv, t_u16 band,
*/
static mlan_status wlan_11h_cmd_tpc_request(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf)
t_void *pinfo_buf)
{
ENTER();
@ -499,7 +499,7 @@ static mlan_status wlan_11h_cmd_tpc_request(mlan_private *priv,
*/
static mlan_status wlan_11h_cmd_tpc_info(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf)
t_void *pinfo_buf)
{
HostCmd_DS_802_11_TPC_INFO *ptpc_info = &pcmd_ptr->params.tpc_info;
MrvlIEtypes_LocalPowerConstraint_t *pconstraint =
@ -543,7 +543,7 @@ static mlan_status wlan_11h_cmd_tpc_info(mlan_private *priv,
*/
static mlan_status wlan_11h_cmd_chan_sw_ann(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf)
t_void *pinfo_buf)
{
const HostCmd_DS_802_11_CHAN_SW_ANN *pch_sw_ann =
(HostCmd_DS_802_11_CHAN_SW_ANN *)pinfo_buf;
@ -580,7 +580,7 @@ static mlan_status wlan_11h_cmd_chan_sw_ann(mlan_private *priv,
*/
static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf)
t_void *pinfo_buf)
{
HostCmd_DS_CHAN_RPT_REQ *pchan_rpt_req =
(HostCmd_DS_CHAN_RPT_REQ *)pinfo_buf;
@ -708,6 +708,7 @@ static t_u32 wlan_11h_set_local_power_constraint_tlv(
MrvlIEtypes_PowerCapability_t *pcap;
MrvlIEtypes_LocalPowerConstraint_t *pconstraint;
t_u8 *start_ptr = MNULL;
t_u32 ret_len = 0;
ENTER();
@ -737,9 +738,10 @@ static t_u32 wlan_11h_set_local_power_constraint_tlv(
pconstraint->chan = channel;
pconstraint->constraint = power_constraint;
*ppbuffer += sizeof(MrvlIEtypesHeader_t) + 2;
ret_len = *ppbuffer - start_ptr;
LEAVE();
return (t_u32)(*ppbuffer - start_ptr);
return ret_len;
}
/**
@ -2533,7 +2535,7 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
*/
mlan_status wlan_11h_cmd_process(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf)
t_void *pinfo_buf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -2651,7 +2653,7 @@ mlan_status wlan_11h_process_bss_elem(mlan_adapter *pmadapter,
const t_u8 *pelement)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u8 element_len = *((t_u8 *)pelement + 1);
t_u8 element_len = *((const t_u8 *)pelement + 1);
ENTER();
switch (*pelement) {

View file

@ -4,7 +4,7 @@
* function declarations of 802.11h
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -123,7 +123,7 @@ extern t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
/** Complete the firmware command preparation for an 11h command function */
extern mlan_status wlan_11h_cmd_process(mlan_private *priv,
HostCmd_DS_COMMAND *pcmd_ptr,
const t_void *pinfo_buf);
t_void *pinfo_buf);
/** Process the response of an 11h firmware command */
extern mlan_status wlan_11h_cmdresp_process(mlan_private *priv,

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for 11n handling.
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -511,7 +511,9 @@ static mlan_status wlan_11n_ioctl_addba_param(pmlan_adapter pmadapter,
cfg->param.addba_param.rxamsdu = pmpriv->add_ba_param.rx_amsdu;
} else {
timeout = pmpriv->add_ba_param.timeout;
if (pmadapter->tx_ba_timeout_support) {
/* WACP supports the MAX TX ba timeout */
if (pmadapter->tx_ba_timeout_support ||
pmadapter->init_para.wacp_mode) {
pmpriv->add_ba_param.timeout =
cfg->param.addba_param.timeout;
} else {
@ -2966,6 +2968,10 @@ int wlan_send_addba(mlan_private *priv, int tid, t_u8 *peer_mac)
ENTER();
if (tid < 0) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
PRINTM(MCMND, "Send addba: TID %d, " MACSTR "\n", tid,
MAC2STR(peer_mac));
@ -3180,6 +3186,9 @@ int wlan_get_txbastream_tbl(mlan_private *priv, tx_ba_stream_tbl *buf)
*/
t_u8 wlan_11n_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
{
if (bss_band & BAND_6G)
return 0;
{
if (bss_band & BAND_G)
return (pmpriv->config_bands & BAND_GN);

View file

@ -6,7 +6,7 @@
* implemented in mlan_11n.c.
*
*
* Copyright 2008-2021 NXP
* Copyright 2008-2021,2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -178,6 +178,9 @@ static INLINE t_u8 is_station_ampdu_allowed(mlan_private *priv, raListTbl *ptr,
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, ptr->ra);
if (tid < 0 || tid >= MAX_NUM_TID) {
return MFALSE;
}
if (sta_ptr) {
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
if (priv->sec_info.wapi_enabled &&
@ -238,6 +241,8 @@ static INLINE void reset_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
static INLINE t_u8 wlan_is_ampdu_allowed(mlan_private *priv, raListTbl *ptr,
int tid)
{
if (tid < 0)
return MFALSE;
if (ptr->is_tdls_link)
return is_station_ampdu_allowed(priv, ptr, tid);
if (priv->adapter->tdls_status != TDLS_NOT_SETUP && !priv->txaggrctrl)
@ -297,7 +302,7 @@ static INLINE t_u8 wlan_is_amsdu_allowed(mlan_private *priv, raListTbl *ptr,
#ifdef UAP_SUPPORT
sta_node *sta_ptr = MNULL;
#endif
if (priv->amsdu_disable || !ptr->max_amsdu)
if (priv->amsdu_disable || !ptr->max_amsdu || tid < 0)
return MFALSE;
#ifdef UAP_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
@ -389,7 +394,7 @@ static INLINE t_u8 wlan_find_stream_to_delete(mlan_private *priv,
ptx_tbl = (TxBAStreamTbl *)util_peek_list(priv->adapter->pmoal_handle,
&priv->tx_ba_stream_tbl_ptr,
MNULL, MNULL);
if (!ptx_tbl) {
if (!ptx_tbl || ptr_tid < 0) {
LEAVE();
return ret;
}
@ -398,6 +403,7 @@ static INLINE t_u8 wlan_find_stream_to_delete(mlan_private *priv,
while (ptx_tbl != (TxBAStreamTbl *)&priv->tx_ba_stream_tbl_ptr) {
if ((ptx_tbl->ba_status == BA_STREAM_SETUP_COMPLETE) &&
(ptx_tbl->tid >= 0) &&
(tid > priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user)) {
tid = priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user;
*ptid = ptx_tbl->tid;

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for 11n Aggregation.
*
*
* Copyright 2008-2021, 2024-2025 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -183,13 +183,15 @@ static t_u16 wlan_form_amsdu_txpd(mlan_private *priv, mlan_buffer *pmbuf,
TxPD *ptx_pd;
t_u8 *head_ptr = MNULL;
t_u32 data_len = pmbuf->data_len;
t_u16 len = 0;
t_s32 offset = 0;
ENTER();
head_ptr = pmbuf->pbuf + pmbuf->data_offset - Tx_PD_SIZEOF(pmadapter) -
priv->intf_hr_len;
/*making data buffer 8 ytes aligned for increasing TP with PCIE Scatter
* Gather*/
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(8 - 1)));
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(7)));
ptx_pd = (TxPD *)(head_ptr + priv->intf_hr_len);
// coverity[bad_memset:SUPPRESS]
memset(pmadapter, ptx_pd, 0, Tx_PD_SIZEOF(pmadapter));
@ -219,15 +221,17 @@ static t_u16 wlan_form_amsdu_txpd(mlan_private *priv, mlan_buffer *pmbuf,
/* Adjust the data offset and length to include TxPD in pmbuf */
pmbuf->data_len += pmbuf->data_offset;
pmbuf->data_offset = (t_u32)(head_ptr - pmbuf->pbuf);
pmbuf->data_len -= pmbuf->data_offset;
PRINTM(MDATA, "amsdu_pkt_len=%d, extra_len=%d\n", amsdu_pkt_len,
pmbuf->data_len - data_len);
offset = head_ptr - pmbuf->pbuf;
pmbuf->data_offset = (t_u32)offset;
if (pmbuf->data_len > pmbuf->data_offset)
pmbuf->data_len -= pmbuf->data_offset;
if (pmbuf->data_len > data_len)
len = (t_u16)(pmbuf->data_len - data_len);
PRINTM(MDATA, "amsdu_pkt_len=%d, extra_len=%d\n", amsdu_pkt_len, len);
DBG_HEXDUMP(MDAT_D, "AMSDU TxPD", ptx_pd, Tx_PD_SIZEOF(pmadapter));
LEAVE();
return (pmbuf->data_len - data_len);
return len;
}
/**
@ -257,10 +261,14 @@ static int wlan_form_amsdu_subframe(pmlan_adapter pmadapter, mlan_buffer *pmbuf,
t_u8 *amsdu_buf = MNULL;
t_u8 *data = pmbuf->pbuf + pmbuf->data_offset;
int pkt_len = pmbuf->data_len;
t_u16 total_len;
ENTER();
pmbuf->data_offset -= sizeof(Rfc1042Hdr_t);
if (pmbuf->data_offset >= sizeof(Rfc1042Hdr_t))
pmbuf->data_offset -= sizeof(Rfc1042Hdr_t);
else
PRINTM(MERROR,
"Truncated value assigned to pmbuf->data_offset");
pmbuf->data_len += sizeof(Rfc1042Hdr_t);
amsdu_buf = pmbuf->pbuf + pmbuf->data_offset;
@ -271,9 +279,11 @@ static int wlan_form_amsdu_subframe(pmlan_adapter pmadapter, mlan_buffer *pmbuf,
snap.snap_type = *(t_u16 *)(data + dt_offset);
dt_offset += sizeof(t_u16);
*(t_u16 *)(amsdu_buf + amsdu_buf_offset) =
mlan_htons(pkt_len + LLC_SNAP_LEN -
((2 * MLAN_MAC_ADDR_LENGTH) + sizeof(t_u16)));
total_len = (t_u16)(pkt_len + LLC_SNAP_LEN -
((2 * MLAN_MAC_ADDR_LENGTH) + sizeof(t_u16)));
*(t_u16 *)(amsdu_buf + amsdu_buf_offset) = mlan_htons(total_len);
amsdu_buf_offset += sizeof(t_u16);
memcpy_ext(pmadapter, amsdu_buf + amsdu_buf_offset, &snap, LLC_SNAP_LEN,
LLC_SNAP_LEN);
@ -287,6 +297,8 @@ static int wlan_form_amsdu_subframe(pmlan_adapter pmadapter, mlan_buffer *pmbuf,
MIN(pmbuf->data_len, MAX_DATA_DUMP_LEN));
PRINTM(MDATA, "AMSDU subframe len=%d\n", pkt_len + LLC_SNAP_LEN + *pad);
LEAVE();
/* pkt_len is limited by MLAN_TX_DATA_BUF_SIZE */
// coverity[overflow_sink:SUPPRESS]
return pkt_len + LLC_SNAP_LEN + *pad;
}
#endif
@ -498,6 +510,8 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
goto done;
}
}
/* total_pkt_len is limited up to MLAN_RX_DATA_BUF_SIZE */
// coverity[misra_c_2012_directive_4_14_violation:SUPPRESS]
while (total_pkt_len >= hdr_len) {
prx_pkt = (RxPacketHdr_t *)data;
/* Length will be in network format, change it to host */
@ -521,7 +535,12 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
sizeof(rfc1042_eth_hdr)) == 0) {
memmove(pmadapter, data + LLC_SNAP_LEN, data,
(2 * MLAN_MAC_ADDR_LENGTH));
data += LLC_SNAP_LEN;
if (!wlan_secure_add(&data, LLC_SNAP_LEN, &data,
TYPE_PTR)) {
PRINTM(MERROR, "rx amsdu pkt data overflow\n");
ret = MLAN_STATUS_FAILURE;
break;
}
pkt_len += sizeof(Eth803Hdr_t) - LLC_SNAP_LEN;
} else {
*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH)) =
@ -559,10 +578,10 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
pmadapter->pmoal_handle, &out_copy_ts_sec,
&out_copy_ts_usec);
copy_delay +=
(t_s32)(out_copy_ts_sec - in_copy_ts_sec) *
(t_u32)(out_copy_ts_sec - in_copy_ts_sec) *
1000000;
copy_delay +=
(t_s32)(out_copy_ts_usec - in_copy_ts_usec);
(t_u32)(out_copy_ts_usec - in_copy_ts_usec);
}
#ifdef UAP_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
@ -589,7 +608,13 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_free_mlan_buffer(pmadapter, daggr_mbuf);
data += pkt_len + pad;
if (!wlan_secure_add(&data, pkt_len + pad,
&data, TYPE_PTR)) {
PRINTM(MERROR,
"rx amsdu pkt data overflow\n");
ret = MLAN_STATUS_FAILURE;
break;
}
continue;
}
/**process tdls packet*/
@ -626,13 +651,17 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
break;
}
data += pkt_len + pad;
if (!wlan_secure_add(&data, pkt_len + pad, &data, TYPE_PTR)) {
PRINTM(MERROR, "rx amsdu pkt data overflow\n");
ret = MLAN_STATUS_FAILURE;
break;
}
}
if (pmadapter->tp_state_on) {
pmadapter->callbacks.moal_get_system_time(
pmadapter->pmoal_handle, &out_ts_sec, &out_ts_usec);
delay += (t_s32)(out_ts_sec - in_ts_sec) * 1000000;
delay += (t_s32)(out_ts_usec - in_ts_usec);
delay += (t_u32)(out_ts_sec - in_ts_sec) * 1000000;
delay += (t_u32)(out_ts_usec - in_ts_usec);
// coverity[misra_c_2012_directive_4_14_violation:SUPPRESS]
pmadapter->callbacks.moal_amsdu_tp_accounting(
pmadapter->pmoal_handle, delay, copy_delay);
@ -679,6 +708,11 @@ static int wlan_send_amsdu_subframe_list(mlan_private *priv,
t_u32 msdu_in_tx_amsdu_cnt = 0;
ENTER();
if (ptrindex < 0) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
max_msdu_count = pmadapter->ops.get_max_msdu_cnt(pmadapter);
pmbuf_src = (pmlan_buffer)util_peek_list(
pmadapter->pmoal_handle, &pra_list->buf_head, MNULL, MNULL);

View file

@ -4,7 +4,7 @@
* driver.
*
*
* Copyright 2008-2021, 2024-2025 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -203,8 +203,12 @@ static mlan_status wlan_11n_dispatch_pkt_until_start_win(
*/
xchg = rx_reor_tbl_ptr->win_size - no_pkt_to_send;
for (i = 0; i < xchg; ++i) {
/* no_pkt_to_send is bound by the rx_reor_tbl_ptr->start_win and
* win_size */
// coverity[overflow_sink:SUPPRESS]
rx_reor_tbl_ptr->rx_reorder_ptr[i] =
rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i];
// coverity[overflow_sink:SUPPRESS]
rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i] = MNULL;
}
@ -668,12 +672,14 @@ mlan_status wlan_11n_add_bastream(mlan_private *priv, t_u8 *addba)
DBG_HEXDUMP(MCMD_D, "addba req", (t_u8 *)addba,
sizeof(HostCmd_DS_11N_ADDBA_REQ));
if (priv->adapter->scan_processing) {
if (!IS_FW_SUPPORT_ALLOW_ADDBA_RESP_ON_SCAN(priv->adapter) &&
priv->adapter->scan_processing) {
PRINTM(MERROR,
"Scan in progress, ignore ADDBA Request event\n");
LEAVE();
return ret;
}
block_ack_param_set =
wlan_le16_to_cpu(pevt_addba_req->block_ack_param_set);
tid = (block_ack_param_set & BLOCKACKPARAM_TID_MASK) >>
@ -1328,10 +1334,22 @@ void wlan_11n_rxba_sync_event(mlan_private *priv, t_u8 *event_buf, t_u16 len)
while (tlv_buf_left >= (int)sizeof(MrvlIEtypes_RxBaSync_t)) {
tlv_type = wlan_le16_to_cpu(tlv_rxba->header.type);
tlv_len = wlan_le16_to_cpu(tlv_rxba->header.len);
if (tlv_buf_left < (sizeof(MrvlIEtypesHeader_t) + tlv_len)) {
PRINTM(MERROR,
"11n rxba sync event: incorrect tlv, tlv->len=%d tlv_buf_left=%d\n",
tlv_len, tlv_buf_left);
break;
}
if (tlv_type != TLV_TYPE_RXBA_SYNC) {
PRINTM(MERROR, "Wrong TLV id=0x%x\n", tlv_type);
goto done;
}
if (tlv_buf_left < (sizeof(MrvlIEtypesHeader_t) + tlv_len)) {
PRINTM(MERROR,
"11n rxba sync event: wrong tlv, tlv_len=%d, tlv_buf_left=%d\n",
tlv_len, tlv_buf_left);
break;
}
tlv_rxba->seq_num = wlan_le16_to_cpu(tlv_rxba->seq_num);
tlv_rxba->bitmap_len = wlan_le16_to_cpu(tlv_rxba->bitmap_len);
PRINTM(MEVENT, MACSTR " tid=%d seq_num=%d bitmap_len=%d\n",

View file

@ -5,7 +5,7 @@
* related code
*
*
* Copyright 2009-2024 NXP
* Copyright 2009-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -42,8 +42,8 @@
#define WLAN_TX_PWR_DEFAULT 20
/** 100mW */
#define WLAN_TX_PWR_00_DEFAULT 20
/** 100mW */
#define WLAN_TX_PWR_US_DEFAULT 20
/** 1000mW */
#define WLAN_TX_PWR_US_DEFAULT 30
/** 100mW */
#define WLAN_TX_PWR_JP_BG_DEFAULT 20
/** 200mW */
@ -692,6 +692,248 @@ static cfp_table_t cfp_table_A[] = {
/** Number of the CFP tables for 5GHz */
#define MLAN_CFP_TABLE_SIZE_A (NELEMENTS(cfp_table_A))
static chan_freq_power_t channel_freq_power_NULL_6G[] = {};
/* Format { Channel, Frequency (MHz), MaxTxPower, DFS } */
/** Band: '6G', Region: JP OperClass 131*/
static chan_freq_power_t channel_freq_power_131_JP_6G[] = {
{1, 5955, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{5, 5975, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{9, 5995, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{13, 6015, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{17, 6035, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{21, 6055, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{25, 6075, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{29, 6095, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{33, 6115, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{37, 6135, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{41, 6155, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{45, 6175, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{49, 6195, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{53, 6215, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{57, 6235, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{61, 6255, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{65, 6275, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{69, 6295, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{73, 6315, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{77, 6335, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{81, 6355, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{85, 6375, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{89, 6395, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
{93, 6415, WLAN_TX_PWR_JP_A_DEFAULT, MFALSE, {0x10, 0, 0}},
};
/** Band: '6G', Region: EU OperClass 131*/
static chan_freq_power_t channel_freq_power_131_EU_6G[] = {
{1, 5955, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{5, 5975, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{9, 5995, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{13, 6015, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{17, 6035, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{21, 6055, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{25, 6075, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{29, 6095, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{33, 6115, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{37, 6135, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{41, 6155, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{45, 6175, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{49, 6195, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{53, 6215, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{57, 6235, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{61, 6255, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{65, 6275, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{69, 6295, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{73, 6315, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{77, 6335, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{81, 6355, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{85, 6375, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{89, 6395, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{93, 6415, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
};
/** Band: '6G', Region: US OperClass 131*/
static chan_freq_power_t channel_freq_power_131_US_6G[] = {
{1, 5955, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{5, 5975, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{9, 5995, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{13, 6015, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{17, 6035, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{21, 6055, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{25, 6075, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{29, 6095, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{33, 6115, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{37, 6135, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{41, 6155, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{45, 6175, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{49, 6195, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{53, 6215, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{57, 6235, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{61, 6255, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{65, 6275, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{69, 6295, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{73, 6315, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{77, 6335, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{81, 6355, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{85, 6375, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{89, 6395, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{93, 6415, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{97, 6435, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{101, 6455, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{105, 6475, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{109, 6495, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{113, 6515, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{117, 6535, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{121, 6555, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{125, 6575, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{129, 6595, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{133, 6615, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{137, 6635, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{141, 6655, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{145, 6675, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{149, 6695, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{153, 6715, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{157, 6735, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{161, 6755, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{165, 6775, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{169, 6795, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{173, 6815, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{177, 6835, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{181, 6855, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{185, 6875, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{189, 6895, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{193, 6915, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{197, 6935, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{201, 6955, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{205, 6975, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{209, 6995, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{213, 7015, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{217, 7035, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{221, 7055, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{225, 7075, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{229, 7095, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{233, 7115, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}};
/** Band: '6G', Region: OperClass 131*/
static chan_freq_power_t channel_freq_power_131_WW_6G[] = {
{1, 5955, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{5, 5975, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{9, 5995, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{13, 6015, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{17, 6035, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{21, 6055, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{25, 6075, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{29, 6095, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{33, 6115, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{37, 6135, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{41, 6155, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{45, 6175, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{49, 6195, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{53, 6215, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{57, 6235, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{61, 6255, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{65, 6275, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{69, 6295, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{73, 6315, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{77, 6335, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{81, 6355, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{85, 6375, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{89, 6395, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{93, 6415, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{97, 6435, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{101, 6455, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{105, 6475, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{109, 6495, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{113, 6515, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{117, 6535, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{121, 6555, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{125, 6575, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{129, 6595, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{133, 6615, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{137, 6635, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{141, 6655, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{145, 6675, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{149, 6695, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{153, 6715, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{157, 6735, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{161, 6755, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{165, 6775, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{169, 6795, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{173, 6815, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{177, 6835, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{181, 6855, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{185, 6875, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{189, 6895, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{193, 6915, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{197, 6935, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{201, 6955, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{205, 6975, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{209, 6995, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{213, 7015, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{217, 7035, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{221, 7055, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{225, 7075, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{229, 7095, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}},
{233, 7115, WLAN_TX_PWR_US_DEFAULT, MFALSE, {0x10, 0, 0}}};
/**
* The 6GHz CFP tables
*/
static cfp_table_t cfp_table_6G[] = {
{
0xFF, /* Any region */
channel_freq_power_131_WW_6G,
NELEMENTS(channel_freq_power_131_WW_6G),
},
{
0x00, /* World region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
{
0x10, /* US region */
channel_freq_power_131_US_6G,
NELEMENTS(channel_freq_power_131_US_6G),
},
{
0x20, /* canada region same as US region channel*/
channel_freq_power_131_US_6G,
NELEMENTS(channel_freq_power_131_US_6G),
},
{
0x30, /* EU region */
channel_freq_power_131_EU_6G,
NELEMENTS(channel_freq_power_131_EU_6G),
},
{
0x40, /* JAPAN region */
channel_freq_power_131_JP_6G,
NELEMENTS(channel_freq_power_131_JP_6G),
},
{
0x50, /* China region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
{
0x06, /* Malaysia region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
{
0x07, /* Mexico region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
{
0x09, /* Brazil region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
{
0x0f, /* Russia region */
channel_freq_power_NULL_6G,
NELEMENTS(channel_freq_power_NULL_6G),
},
};
#define MLAN_CFP_TABLE_SIZE_6G (NELEMENTS(cfp_table_6G))
enum {
RATEID_DBPSK1Mbps, //(0)
RATEID_DQPSK2Mbps, //(1)
@ -1139,7 +1381,7 @@ t_u16 ax_tone_ru_rate_nss2[9][MCS_NUM_AX + 4] = {
*/
static void *wlan_memchr(pmlan_adapter pmadapter, void *s, int c, int n)
{
const t_u8 *p = (t_u8 *)s;
t_u8 *p = (t_u8 *)s;
ENTER();
@ -1231,6 +1473,29 @@ static chan_freq_power_t *wlan_get_region_cfp_table(pmlan_adapter pmadapter,
}
}
}
if (band & BAND_6G) {
/* Return the FW cfp table for requested region code */
if (pmadapter->otp_region && pmadapter->cfp_otp_6g) {
if (pmadapter->otp_region->force_reg ||
(cfp_a ==
(t_u8)pmadapter->otp_region->region_code)) {
*cfp_no = pmadapter->tx_power_table_6g_rows;
LEAVE();
return pmadapter->cfp_otp_6g;
}
}
for (i = 0; i < MLAN_CFP_TABLE_SIZE_6G; i++) {
PRINTM(MINFO, "cfp_table_6G[%d].code=%d\n", i,
cfp_table_6G[i].code);
/* Check if region/code matches for 6G bands */
if (cfp_table_6G[i].code == cfp_a) {
/* Select by band */
*cfp_no = cfp_table_6G[i].cfp_no;
LEAVE();
return cfp_table_6G[i].cfp;
}
}
}
if (!region)
PRINTM(MERROR, "Error Band[0x%x] or code[BG:%#x, A:%#x]\n",
band, cfp_bg, cfp_a);
@ -1810,14 +2075,17 @@ t_u32 wlan_index_to_data_rate(pmlan_adapter pmadapter, t_u8 index,
t_u8 wlan_data_rate_to_index(pmlan_adapter pmadapter, t_u32 rate)
{
t_u16 *ptr;
t_s8 index = 0;
ENTER();
if (rate) {
ptr = wlan_memchr(pmadapter, WlanDataRates, (t_u8)rate,
sizeof(WlanDataRates));
if (ptr) {
index = ptr - WlanDataRates;
LEAVE();
return (t_u8)(ptr - WlanDataRates);
return (t_u8)index;
}
}
LEAVE();
@ -1922,6 +2190,30 @@ t_u8 wlan_get_txpwr_of_chan_from_cfp(mlan_private *pmpriv, t_u16 band,
}
}
}
if (band & BAND_6G) {
chan_freq_power_t *cfp_6g = MNULL;
t_u32 cfp_no_6g;
for (i = 0; i < MLAN_CFP_TABLE_SIZE_6G; i++) {
/* Get CFP */
cfp_6g = cfp_table_6G[i].cfp;
cfp_no_6g = cfp_table_6G[i].cfp_no;
for (j = 0; j < cfp_no_6g; j++) {
if ((cfp_6g + j)->channel == channel) {
if (tx_power != 0)
tx_power = MIN(
tx_power,
(cfp_6g + j)
->max_tx_power);
else
tx_power =
(t_u8)((cfp_6g + j)
->max_tx_power);
break;
}
}
}
}
LEAVE();
return tx_power;
@ -1989,6 +2281,14 @@ wlan_get_cfp_by_band_and_channel(pmlan_adapter pmadapter, t_u16 band,
continue;
}
break;
case BAND_6G:
switch (band) {
case BAND_6G:
break;
default:
continue;
}
break;
default:
continue;
}
@ -2104,6 +2404,14 @@ chan_freq_power_t *wlan_find_cfp_by_band_and_freq(mlan_adapter *pmadapter,
continue;
}
break;
case BAND_6G:
switch (band) {
case BAND_6G:
break;
default:
continue;
}
break;
default:
continue;
}
@ -2191,7 +2499,8 @@ static t_u16 wlan_convert_config_bands(t_u16 config_bands)
config_bands & BAND_GAC || config_bands & BAND_GAX)
bands |= BAND_G;
if (config_bands & BAND_A || config_bands & BAND_AN ||
config_bands & BAND_AAC || config_bands & BAND_AAX)
config_bands & BAND_AAC || config_bands & BAND_AAX ||
config_bands & BAND_6G)
bands |= BAND_A;
return bands;
}
@ -2367,7 +2676,7 @@ static oper_bw_chan oper_bw_chan_cn[] = {
* @return A pointer to oper_bw_chan
*/
static oper_bw_chan *wlan_get_nonglobal_operclass_table(mlan_private *pmpriv,
int *arraysize)
unsigned int *arraysize)
{
t_u8 country_code[][COUNTRY_CODE_LEN] = {"US", "JP", "CN"};
int country_id = 0;
@ -2421,13 +2730,36 @@ static oper_bw_chan *wlan_get_nonglobal_operclass_table(mlan_private *pmpriv,
mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
t_u8 oper_class, t_u8 bandwidth)
{
int arraysize = 0, i = 0, channum = 0;
unsigned int arraysize = 0, i = 0, channum = 0;
oper_bw_chan *poper_bw_chan = MNULL;
t_u8 center_freq_idx = 0;
t_u8 center_freqs[] = {42, 50, 58, 106, 114, 122, 138, 155};
ENTER();
if (oper_class == 131 && bandwidth != CHAN_BW_20MHZ) {
PRINTM(MERROR, "Invalid operclass=%d channel=%d bw=%d\n",
oper_class, channel, bandwidth);
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (oper_class == 132 && bandwidth != CHAN_BW_40MHZ) {
PRINTM(MERROR, "Invalid operclass=%d channel=%d bw=%d\n",
oper_class, channel, bandwidth);
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (oper_class == 133 && bandwidth != CHAN_BW_80MHZ) {
PRINTM(MERROR, "Invalid operclass=%d channel=%d bw=%d\n",
oper_class, channel, bandwidth);
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (oper_class == 131 || oper_class == 132 || oper_class == 133) {
LEAVE();
return MLAN_STATUS_SUCCESS;
}
for (i = 0; i < (int)sizeof(center_freqs); i++) {
if (channel == center_freqs[i]) {
PRINTM(MERROR, "Invalid channel number %d!\n", channel);
@ -2453,7 +2785,7 @@ mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
return MLAN_STATUS_FAILURE;
}
for (i = 0; i < (int)(arraysize / sizeof(oper_bw_chan)); i++) {
for (i = 0; i < (arraysize / sizeof(oper_bw_chan)); i++) {
if (poper_bw_chan[i].oper_class == oper_class ||
poper_bw_chan[i].global_oper_class == oper_class) {
for (channum = 0;
@ -2492,7 +2824,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
oper_bw_chan *poper_bw_chan = MNULL;
t_u8 center_freq_idx = 0;
t_u8 center_freqs[] = {42, 50, 58, 106, 114, 122, 138, 155};
int i = 0, arraysize = 0, channum = 0;
unsigned int i = 0, arraysize = 0, channum = 0;
ENTER();
@ -2516,7 +2848,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
channel = center_freq_idx;
}
for (i = 0; i < (int)(arraysize / sizeof(oper_bw_chan)); i++) {
for (i = 0; i < (arraysize / sizeof(oper_bw_chan)); i++) {
if (poper_bw_chan[i].bandwidth == bw) {
for (channum = 0;
channum <
@ -2711,6 +3043,38 @@ mlan_status wlan_set_regiontable(mlan_private *pmpriv, t_u8 region, t_u16 band)
}
i++;
}
if (band & BAND_6G) {
if (pmadapter->cfp_code_a)
cfp_code_a = pmadapter->cfp_code_a;
PRINTM(MCMND, "%s: 6G 0x%x\n", __func__, cfp_code_a);
cfp = wlan_get_region_cfp_table(pmadapter, cfp_code_a, BAND_6G,
&cfp_no);
if (cfp) {
pmadapter->region_channel[i].num_cfp = (t_u8)cfp_no;
pmadapter->region_channel[i].pcfp = cfp;
} else {
PRINTM(MERROR, "wrong region code %#x in Band 6G\n",
region);
LEAVE();
return MLAN_STATUS_FAILURE;
}
pmadapter->region_channel[i].valid = MTRUE;
pmadapter->region_channel[i].region = region;
pmadapter->region_channel[i].band = BAND_6G;
for (j = 0; j < MAX_REGION_CHANNEL_NUM; j++) {
if (region_chan_old[j].band & BAND_6G)
break;
}
if ((j < MAX_REGION_CHANNEL_NUM) && region_chan_old[j].valid) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
region_chan_old[j].pcfp,
region_chan_old[j].num_cfp);
} else if (cfp) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
MNULL, 0);
}
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
@ -3354,6 +3718,57 @@ table_a:
bonded_chan_count = 0;
}
}
if (is6g && pmadapter->cfp_otp_6g && pmadapter->tx_power_table_6g) {
rows = pmadapter->tx_power_table_6g_rows;
cols = pmadapter->tx_power_table_6g_cols;
if (pmadapter->tx_power_table_6g_size < (rows * cols))
return;
max = 0;
bonded_chan_count = 0;
for (i = 0; i < rows; i++) {
if ((pmadapter->cfp_otp_6g + i)->dynamic.flags &
NXP_CHANNEL_DISABLED)
continue;
/* Get the max value among all mod groups for this chan
*/
for (j = 1; j < cols; j++)
max = MAX(
max,
pmadapter->tx_power_table_6g[i * cols +
j]);
bonded_chan_count++;
if ((i < (rows - 1)) &&
!((pmadapter->cfp_otp_6g + i + 1)->dynamic.flags &
NXP_CHANNEL_DISABLED)) {
/* Compare the max power value with the next
* chan in this bonded group, unless this is the
* last or the next one is disabled
*/
if (!((pmadapter->cfp_otp_6g + i)->dynamic.flags &
NXP_CHANNEL_NOHT80)) {
if (bonded_chan_count < 4)
continue;
} else if (!((pmadapter->cfp_otp_6g + i)
->dynamic.flags &
NXP_CHANNEL_NOHT40)) {
if (bonded_chan_count < 2)
continue;
}
}
/* Apply the max power value to all channels in this
* bonded group
*/
for (k = 0; k < bonded_chan_count; k++)
(pmadapter->cfp_otp_6g + i - k)->max_tx_power =
max;
max = 0;
bonded_chan_count = 0;
}
}
}
/**
@ -3732,6 +4147,197 @@ out:
LEAVE();
}
/**
* @brief Update 6GHz CFP table and power table from FW
*
* @param priv Private driver information structure
* @param buf Pointer to the buffer holding TLV data
* from 0x242 command response.
* @param buf_left bufsize
*
* @return
* None
*/
void wlan_add_fw_6g_cfp_tables(pmlan_private pmpriv, t_u8 *buf, t_u16 buf_left)
{
mlan_adapter *pmadapter = pmpriv->adapter;
mlan_callbacks *pcb = (mlan_callbacks *)&pmadapter->callbacks;
MrvlIEtypesHeader_t *head;
t_u16 tlv;
t_u16 tlv_buf_len;
t_u16 tlv_buf_left;
t_u16 i;
t_u16 max_tx_pwr_6g = WLAN_TX_PWR_DEFAULT;
t_u8 *tlv_buf;
t_u8 *data;
mlan_status ret;
ENTER();
if (!buf) {
PRINTM(MERROR, "6GHz CFP table update failed!\n");
goto out;
}
/* Clean up allocated 6G CFP tables and data */
wlan_free_fw_6g_cfp_tables(pmadapter);
if (!IS_FW_SUPPORT_6G(pmadapter)) {
PRINTM(MERROR, "FW doesn't support 6GHz CFP table!\n");
goto out;
}
pmadapter->tx_power_table_6g_rows = FW_CFP_TABLE_MAX_ROWS_6G;
pmadapter->tx_power_table_6g_cols = FW_CFP_TABLE_MAX_COLS_6G;
for (i = 0; i < MLAN_CFP_TABLE_SIZE_6G; i++) {
if (cfp_table_6G[i].code == pmadapter->region_code) {
max_tx_pwr_6g = (cfp_table_6G[i].cfp)->max_tx_power;
break;
}
}
tlv_buf = (t_u8 *)buf;
tlv_buf_left = buf_left;
while (tlv_buf_left >= sizeof(*head)) {
head = (MrvlIEtypesHeader_t *)tlv_buf;
tlv = wlan_le16_to_cpu(head->type);
tlv_buf_len = wlan_le16_to_cpu(head->len);
if (tlv_buf_left < (sizeof(*head) + tlv_buf_len))
break;
data = (t_u8 *)head + sizeof(*head);
switch (tlv) {
case TLV_TYPE_POWER_TABLE_ATTR:
pmadapter->tx_power_table_6g_rows =
((power_table_attr_t *)data)->rows_6g;
pmadapter->tx_power_table_6g_cols =
((power_table_attr_t *)data)->cols_6g;
PRINTM(MCMD_D, "OTP region: 6g_row=%d,6g_cols=%d\n",
pmadapter->tx_power_table_6g_rows,
pmadapter->tx_power_table_6g_cols);
break;
case TLV_TYPE_CHAN_ATTR_CFG:
/* Skip adding fw cfp tables if they already exist or
* if this TLV has no set data
*/
if (*data == 0)
break;
if (pmadapter->cfp_otp_6g)
break;
ret = pcb->moal_malloc(
pmadapter->pmoal_handle,
pmadapter->tx_power_table_6g_rows *
sizeof(chan_freq_power_t),
MLAN_MEM_DEF, (t_u8 **)&pmadapter->cfp_otp_6g);
if (ret != MLAN_STATUS_SUCCESS ||
!pmadapter->cfp_otp_6g) {
PRINTM(MERROR,
"Memory allocation for storing 6G chan attr table failed!\n");
break;
}
/* Save channel usability flags from OTP data in the fw
* cfp 6g table and set frequency and max_tx_power
* values
*/
for (i = 0; i < pmadapter->tx_power_table_6g_rows;
i++) {
(pmadapter->cfp_otp_6g + i)->channel = *data;
(pmadapter->cfp_otp_6g + i)->freq =
5955 + 20 * i;
(pmadapter->cfp_otp_6g + i)->max_tx_power =
max_tx_pwr_6g;
data++;
(pmadapter->cfp_otp_6g + i)->dynamic.flags =
*data;
(pmadapter->cfp_otp_6g + i)->dynamic.dfs_state =
DFS_USABLE;
if (*data & NXP_CHANNEL_DFS)
(pmadapter->cfp_otp_6g + i)
->passive_scan_or_radar_detect =
MTRUE;
PRINTM(MCMD_D,
"OTP Region (6G): chan=%d flags=0x%x\n",
(pmadapter->cfp_otp_6g + i)->channel,
(pmadapter->cfp_otp_6g + i)
->dynamic.flags);
data++;
}
break;
case TLV_TYPE_POWER_TABLE:
/* Skip adding fw power tables if this TLV has no data
* or if they already exists but force reg rule is set
* in the otp
*/
if (*data == 0)
break;
if (pmadapter->otp_region &&
pmadapter->otp_region->force_reg &&
pmadapter->tx_power_table_6g)
break;
/* Save the tlv data in power tables for band 6G */
i = 0;
while ((i <
pmadapter->tx_power_table_6g_rows *
pmadapter->tx_power_table_6g_cols) &&
(i < tlv_buf_len)) {
i++;
}
if (!pmadapter->tx_power_table_6g) {
ret = pcb->moal_malloc(
pmadapter->pmoal_handle, i,
MLAN_MEM_DEF,
(t_u8 **)&pmadapter->tx_power_table_6g);
if (ret != MLAN_STATUS_SUCCESS ||
!pmadapter->tx_power_table_6g) {
PRINTM(MERROR,
"Memory allocation for the 6G power table failed!\n");
break;
}
}
memcpy_ext(pmadapter, pmadapter->tx_power_table_6g,
data, i, i);
pmadapter->tx_power_table_6g_size = i;
break;
default:
break;
}
tlv_buf += (sizeof(*head) + tlv_buf_len);
tlv_buf_left -= (sizeof(*head) + tlv_buf_len);
}
// *pmadapter->tx_power_table_6g is already allocated
// coverity[cert_exp33_c_violation:SUPPRESS]
wlan_set_otp_cfp_max_tx_pwr(pmadapter, MTRUE);
out:
LEAVE();
}
/**
* @brief This function deallocates 6G otp cfp and power tables memory.
*
* @param pmadapter A pointer to mlan_adapter structure
*/
void wlan_free_fw_6g_cfp_tables(mlan_adapter *pmadapter)
{
pmlan_callbacks pcb;
ENTER();
pcb = &pmadapter->callbacks;
if (pmadapter->cfp_otp_6g)
pcb->moal_mfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->cfp_otp_6g);
if (pmadapter->tx_power_table_6g)
pcb->moal_mfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->tx_power_table_6g);
pmadapter->cfp_otp_6g = MNULL;
pmadapter->tx_power_table_6g = MNULL;
pmadapter->tx_power_table_6g_size = 0;
LEAVE();
}
/**
* @brief This function deallocates otp cfp and power tables memory.
*
@ -3806,6 +4412,87 @@ mlan_status wlan_get_cfp_table(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Get 6G power tables and cfp tables for set region code
* into the IOCTL request buffer
*
* @param pmadapter Private mlan adapter structure
* @param pioctl_req Pointer to the IOCTL request structure
*
* @return success, otherwise fail
*
*/
static mlan_status wlan_get_6g_cfpinfo(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
t_u8 cfp_code = pmadapter->region_code;
chan_freq_power_t *cfp_6g = MNULL;
t_u32 cfp_no_6g = 0;
t_u32 len = 0, size = 0;
t_u8 *req_buf;
mlan_cfpinfo c = {0};
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
if (!IS_FW_SUPPORT_6G(pmadapter)) {
PRINTM(MERROR, "cfpinfo: FW doesn't support 6GHz\n");
ret = MLAN_STATUS_FAILURE;
goto out;
}
/* Calculate the total response size required to return cfp tables
* and power tables
*/
size = sizeof(mlan_cfpinfo);
if (pmadapter->fw_bands & BAND_6G) {
if (pmadapter->cfp_code_a)
cfp_code = pmadapter->cfp_code_a;
cfp_6g = wlan_get_region_cfp_table(pmadapter, cfp_code, BAND_6G,
&cfp_no_6g);
size += cfp_no_6g * sizeof(chan_freq_power_t);
c.is6g_present = 1;
c.rows_6g = cfp_no_6g;
c.cols_6g = pmadapter->tx_power_table_6g_cols;
size += pmadapter->tx_power_table_6g_size;
}
/* Check information buffer length of MLAN IOCTL */
if (pioctl_req->buf_len < size) {
PRINTM(MWARN,
"MLAN IOCTL information buffer length is too short.\n");
pioctl_req->buf_len_needed = size;
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
ret = MLAN_STATUS_RESOURCE;
goto out;
}
req_buf = (t_u8 *)pioctl_req->pbuf;
/* copy the mlan_cfpinfo struct at the start of req_buf */
memcpy_ext(pmadapter, req_buf, &c, sizeof(mlan_cfpinfo),
sizeof(mlan_cfpinfo));
len += sizeof(mlan_cfpinfo);
/* copy the cfp table */
if (cfp_6g) {
size = cfp_no_6g * sizeof(chan_freq_power_t);
memcpy_ext(pmadapter, req_buf + len, cfp_6g, size, size);
len += size;
}
/* Copy the power table */
if (pmadapter->tx_power_table_6g) {
memcpy_ext(pmadapter, req_buf + len,
pmadapter->tx_power_table_6g,
pmadapter->tx_power_table_6g_size,
pmadapter->tx_power_table_6g_size);
len += pmadapter->tx_power_table_6g_size;
}
out:
if (pioctl_req)
pioctl_req->data_read_written = len;
LEAVE();
return ret;
}
/**
* @brief Get power tables and cfp tables for set region code
* into the IOCTL request buffer
@ -3844,6 +4531,15 @@ mlan_status wlan_get_cfpinfo(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto out;
}
if (pioctl_req->action == MLAN_ACT_GET_6G_CFP_TBL) {
if (!IS_FW_SUPPORT_6G(pmadapter)) {
ret = MLAN_STATUS_FAILURE;
goto out;
}
ret = wlan_get_6g_cfpinfo(pmadapter, pioctl_req);
LEAVE();
return ret;
}
/* Calculate the total response size required to return region,
* country codes, cfp tables and power tables
*/

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
* @brief This file declares the generic data structures and APIs.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2022, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -345,9 +345,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/* We support up to 480-byte block size due to FW buffer limitation. */
#define MLAN_SDIO_BLOCK_SIZE 256
/** define SDIO block size for firmware download */
#define MLAN_SDIO_BLOCK_SIZE_FW_DNLD MLAN_SDIO_BLOCK_SIZE
/** define allocated buffer size */
#define ALLOC_BUF_SIZE MLAN_RX_DATA_BUF_SIZE
/** SDIO MP aggr pkt limit */
@ -677,7 +674,9 @@ typedef enum {
#define MEVT_D MBIT(18)
#define MFW_D MBIT(19)
#define MIF_D MBIT(20)
#ifdef FWDUMP_VIA_PRINT
#define MFWDP_D MBIT(21)
#endif /*FWDUMP_VIA_PRINT*/
#define MSCH_D MBIT(22)
#define MENTRY MBIT(28)
#define MWARN MBIT(29)
@ -913,6 +912,9 @@ typedef enum _mlan_event_id {
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE = 0x80000036,
#endif
MLAN_EVENT_ID_DRV_RGPWR_KEY_MISMATCH = 0x80000037,
#if defined(STA_SUPPORT)
MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO = 0x80000038,
#endif
MLAN_EVENT_ID_DRV_ASSOC_FAILURE = 0x80000039,
} mlan_event_id;
@ -920,7 +922,7 @@ typedef enum _mlan_event_id {
/** mlan_image data structure */
typedef struct _mlan_fw_image {
/** Firmware image buffer pointer */
t_u8 *pfw_buf;
const t_u8 *pfw_buf;
/** Firmware image length */
t_u32 fw_len;
/** Firmware reload flag */
@ -1096,6 +1098,30 @@ typedef MLAN_PACK_START struct _chan_band_info {
t_u8 is_dfs_chan;
} MLAN_PACK_END chan_band_info;
#if defined(STA_SUPPORT)
/** MrvlIEtypes_chan_band_reginfo_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_chan_band_reginfo_t {
/** Header */
MrvlIEtypesHeader_t header;
/** Band Configuration */
Band_Config_t bandcfg;
/** channel */
t_u8 channel;
/** Reg Info */
t_u8 regInfo;
} MLAN_PACK_END MrvlIEtypes_chan_band_reginfo_t;
/** Structure to store 6E Channel/Band/Regulatory Info */
typedef MLAN_PACK_START struct _chan_band_reginfo_t {
/** Band Configuration */
Band_Config_t bandcfg;
/** channel */
t_u8 channel;
/** Reg Info */
t_u8 regInfo;
} MLAN_PACK_END chan_band_reginfo_t;
#endif
/** Channel usability flags */
#define NXP_CHANNEL_NO_OFDM MBIT(9)
#define NXP_CHANNEL_NO_CCK MBIT(8)
@ -1222,7 +1248,7 @@ typedef struct _mlan_ioctl_req {
/** Request id */
t_u32 req_id;
/** Action: set or get */
t_u32 action;
t_u16 action;
/** Pointer to buffer */
t_u8 *pbuf;
/** Length of buffer */
@ -1252,6 +1278,36 @@ typedef MLAN_PACK_START struct _mix_rate_info {
t_u8 dcm;
} MLAN_PACK_END mix_rate_info, *pmix_rate_info;
typedef MLAN_PACK_START struct _radiotap_timestamp {
/* device timestamp */
t_u64 device_timestamp;
/* accuracy */
t_u16 accuracy;
/* unit:
* 0 milliseconds,
* 1 microseconds,
* 2 nanoseconds,
* 3-15 reserved */
// coverity[misra_c_2012_rule_6_1_violation:SUPPRESS]
t_u8 unit : 4;
/* position:
* 0 first bit (or symbol containing it) of MPDU - matches TSFT field
* 1 signal acquisition at start of PLCP
* 2 end of PPDU
* 3 end of MPDU (after FCS)
* 4-14 reserved
* 15 unknown or vendor/OOB defined
*/
// coverity[misra_c_2012_rule_6_1_violation:SUPPRESS]
t_u8 position : 4;
/* flags
* 0x01 32-bit counter (high 32 bits are unused)
* 0x02 accuracy known
* 0xFC reserved
*/
t_u8 flags;
} MLAN_PACK_END radiotap_timestamp, *pradiotap_timestamp;
typedef MLAN_PACK_START struct _rxpd_extra_info {
/** flags */
t_u8 flags;
@ -1267,6 +1323,12 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
t_u32 vht_he_sig2;
/** HE user idx */
t_u32 user_idx;
/** timestamp */
radiotap_timestamp timestamp;
/** PLCP CRC Failed */
t_u8 plcp_crc_failed;
t_u8 rssi_dbm_a;
t_u8 rssi_dbm_b;
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
typedef MLAN_PACK_START struct _radiotap_info {
@ -1281,6 +1343,8 @@ typedef MLAN_PACK_START struct _radiotap_info {
/** chan number */
t_u8 chan_num;
t_u8 antenna;
/** extra radiotap */
t_u8 radiotap_extra;
/** extra rxpd info from FW */
rxpd_extra_info extra_info;
} MLAN_PACK_END radiotap_info, *pradiotap_info;
@ -1568,6 +1632,8 @@ typedef MLAN_PACK_START struct _tlvbuf_custom_ie {
tlvbuf_max_mgmt_ie max_mgmt_ie;
} MLAN_PACK_END mlan_ds_misc_custom_ie;
#define FW_STUCK_CODE_VERSION_MISMATCH (0x90)
/** Max TDLS config data length */
#define MAX_TDLS_DATA_LEN 1024
@ -2629,6 +2695,8 @@ typedef struct _mlan_callbacks {
unsigned int rsvd1);
void (*moal_amsdu_tp_accounting)(t_void *pmoal, t_s32 delay,
t_s32 copy_delay);
mlan_status (*moal_calc_short_ssid)(t_u8 *pssid, t_u32 ssid_len,
t_u32 *pshort_ssid);
} mlan_callbacks, *pmlan_callbacks;
/** Parameter unchanged, use MLAN default setting */
@ -2711,6 +2779,10 @@ typedef struct _mlan_device {
/** SDIO MPA Rx */
t_u32 mpa_rx_cfg;
#ifdef SDIO
/** host max block num */
t_u32 max_blk_count;
/** sdio blk size */
t_u32 sdio_blk_size;
/** SDIO Single port rx aggr */
t_u8 sdio_rx_aggr_enable;
/* see blk_queue_max_segment_size */
@ -2800,6 +2872,7 @@ typedef struct _mlan_device {
t_u16 tx_budget;
t_u8 mclient_scheduling;
t_u8 disable_11h_tpc;
t_u8 tpe_ie_ignore;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */

View file

@ -3,7 +3,7 @@
* @brief This file contains FW event ID definitions.
*
*
* Copyright 2023-2024 NXP
* Copyright 2023-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -206,6 +206,8 @@ ENUM_ELEMENT(EVENT_DUMMY_HOST_WAKEUP_SIGNAL, 0x0001),
ENUM_ELEMENT(EVENT_IMD3_CAL_START, 0x00A0),
ENUM_ELEMENT(EVENT_IMD3_CAL_END, 0x00A1),
ENUM_ELEMENT(EVENT_DPD_CAL, 0x00A8),
/** Event ID: Bulk Tx status */
ENUM_ELEMENT(EVENT_TX_STATUS_BULK_REPORT, 0x00A2),
@ -213,5 +215,11 @@ ENUM_ELEMENT(EVENT_DUMMY_HOST_WAKEUP_SIGNAL, 0x0001),
ENUM_ELEMENT(EVENT_PEER_PS_MODE_CHANGE, 0x00A3),
ENUM_ELEMENT(EVENT_CHAN_SWITCH_TO_6G_BLOCK, 0x00A4),
#if defined(STA_SUPPORT)
/** Event ID: Ex-AP 6E Reg mode */
ENUM_ELEMENT(EVENT_CHANNEL_SWITCH_REGINFO, 0x00A5),
#endif
/* Always keep this last */
ENUM_ELEMENT_LAST(__HostEvent_Last)

View file

@ -5,7 +5,7 @@
* in MLAN module.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -931,6 +931,8 @@ enum host_cmd_id {
#define FW_CAPINFO_EXT_RX_SW_INT MBIT(20)
/** FW cap info bit 21: EASY_MESH_SUPPORT */
#define FW_CAPINFO_EASY_MESH MBIT(21)
/** FW cap info bit 22: ADDBA support with scan */
#define FW_CAPINFO_ALLOW_ADDBA_RESP_ON_SCAN MBIT(22)
/** Check if 5G 1x1 only is supported by firmware */
#define IS_FW_SUPPORT_5G_1X1_ONLY(_adapter) \
@ -980,6 +982,9 @@ enum host_cmd_id {
/** Check if easy mesh supported by firmware */
#define IS_FW_SUPPORT_EASY_MESH(_adapter) \
(_adapter->fw_cap_ext & FW_CAPINFO_EASY_MESH)
/** Check if ADDBA suppported with scan by firmware */
#define IS_FW_SUPPORT_ALLOW_ADDBA_RESP_ON_SCAN(_adapter) \
(_adapter->fw_cap_ext & FW_CAPINFO_ALLOW_ADDBA_RESP_ON_SCAN)
/* EASYMESH_EXTRA_BYTES = 6 Bytes of Mac address + 2 Bytes Reserved */
#define EASYMESH_EXTRA_BYTES 8
@ -1059,6 +1064,28 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_He_cap_t {
t_u8 val[20];
} MLAN_PACK_END MrvlIEtypes_He_cap_t, *pMrvlIEtypes_he_cap_t;
/** MrvlIEtypes_He_6g_cap_t*/
typedef MLAN_PACK_START struct _MrvlIEtypes_He_6g_cap_t {
/** Header */
MrvlIEtypesHeader_t header;
/** Element id extension */
t_u8 ext_id;
/** he 6g capability */
t_u16 capa;
} MLAN_PACK_END MrvlIEtypes_He_6g_cap_t, *pMrvlIEtypes_He_6g_cap_t;
/** MrvlIEtypes_6g_scan_paprams_t*/
typedef MLAN_PACK_START struct _MrvlIEtypes_6g_scan_params_t {
/** Header */
MrvlIEtypesHeader_t header;
/** bit0: short_ssid_valid, bit1: unsolicited_probe */
t_u16 flags;
/** short ssid */
t_u32 short_ssid;
/** bssid */
t_u8 bssid[6];
} MLAN_PACK_END MrvlIEtypes_6g_scan_params_t, *pMrvlIEtypes_6g_scan_params_t;
typedef MLAN_PACK_START struct _MrvlIEtypes_He_Op_t {
/** Header */
MrvlIEtypesHeader_t header;
@ -1138,6 +1165,8 @@ typedef MLAN_PACK_START struct _power_table_attr {
t_u8 cols_2g;
t_u8 rows_5g;
t_u8 cols_5g;
t_u8 rows_6g;
t_u8 cols_6g;
} MLAN_PACK_END power_table_attr_t;
#define FW_CFP_TABLE_MAX_ROWS_BG 14
@ -1146,6 +1175,9 @@ typedef MLAN_PACK_START struct _power_table_attr {
#define FW_CFP_TABLE_MAX_ROWS_A 39
#define FW_CFP_TABLE_MAX_COLS_A 29
#define FW_CFP_TABLE_MAX_ROWS_6G 59
#define FW_CFP_TABLE_MAX_COLS_6G 36
#define HostCmd_ACT_RTT_GET_RSP_INFO 0x0000
#define HostCmd_ACT_RTT_SET_RSP_EN 0x0001
#define HostCmd_ACT_RTT_SET_RSP_DIS 0x0002
@ -1190,6 +1222,10 @@ typedef enum _ENH_PS_MODES {
#define HostCmd_ACT_GEN_REMOVE 0x0004
/** General purpose action : Reset */
#define HostCmd_ACT_GEN_RESET 0x0005
/** Host command action : Get Tx 6G CFP table */
#define HostCmd_ACT_GET_6G_CFP_TBL 0x0006
/** Host command action : Set Tx 6G CFP table */
#define HostCmd_ACT_SET_6G_CFP_TBL 0x0007
/** Host command action : Set Rx */
#define HostCmd_ACT_SET_RX 0x0001
@ -1414,6 +1450,7 @@ typedef MLAN_PACK_START struct _event_nan_generic {
} MLAN_PACK_END event_nan_generic;
#define RXPD_FLAG_EXTRA_HEADER (1 << 1)
#define RXPD_FLAG_RADIOTAP_HEADER_EXTRA (1 << 5)
#define RXPD_FLAG_UCAST_PKT (1 << 3)
@ -1768,6 +1805,12 @@ typedef MLAN_PACK_START struct _IEEEtypes_Beacon_t {
/** Fixed size of station association event */
#define ASSOC_EVENT_FIX_SIZE 12
/** Fixed size of Assoc Req */
#define ASSOC_RESP_FIX_SIZE 6
/** MGMT PKT header fixed size: frame_ctrl, duration, da,sa,bssid, seq_ctrl*/
#define MGMT_PKT_HEADER_FIX_SIZE 24
/** MrvlIEtypes_channel_band_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_channel_band_t {
/** Header */
@ -3242,6 +3285,10 @@ typedef MLAN_PACK_START struct _HostCmd_DS_802_11_GET_LOG {
t_u32 gdma_abort_cnt;
/** Rx Reset MAC Count */
t_u32 g_reset_rx_mac_cnt;
/** Current SOC Temperature*/
t_u32 currTemp;
/** TX Power Control Method*/
t_u32 TXpwrMethod;
/** SDMA FSM stuck Count*/
t_u32 SdmaStuckCnt;
// Ownership error counters
@ -3699,6 +3746,8 @@ typedef enum _SNMP_MIB_INDEX {
Dot11H_fakeRadar = 45,
ChanTrackParam_i = 46,
Dot11h_disable_tpc_i = 47,
Ignore_tpe_i = 48,
User_band_config_i = 49,
} SNMP_MIB_INDEX;
/** max SNMP buf size */
@ -4105,6 +4154,11 @@ typedef MLAN_PACK_START struct _wlan_scan_cmd_config {
*/
t_u8 specific_bssid[MLAN_MAC_ADDR_LENGTH];
/**num of 6g scan params for OOB scan */
t_u8 num_6g_scan_params;
/** 6g scan params for OOB scan */
wlan_6g_scan_params scan_param_list[WLAN_MAX_6G_SCAN_PARAMS_LIST];
/**
* Length of TLVs sent in command starting at tlvBuffer
*/
@ -4291,8 +4345,10 @@ typedef MLAN_PACK_START struct _HostCmd_DS_802_11_BG_SCAN_CONFIG {
t_u8 bss_type;
/** num of channel per scan */
t_u8 chan_per_scan;
/** 11ai */
t_u8 dot11ai : 1;
/** reserved field */
t_u8 reserved;
t_u8 reserved : 7;
/** reserved field */
t_u16 reserved1;
/** interval between consecutive scans */
@ -5290,6 +5346,10 @@ typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RF_ANTENNA {
t_u16 action_rx;
/** Rx antenna mode Bit0:1, Bit1:2, Bit0-1:1+2, 0xffff: diversity */
t_u16 rx_antenna_mode;
/** Tx antenna mode Bit0:1, Bit1:2, Bit0-1:1+2, for 6G support */
t_u8 tx_antenna_mode_6g;
/** Rx antenna mode Bit0:1, Bit1:2, Bit0-1:1+2, for 6G support */
t_u8 rx_antenna_mode_6g;
} MLAN_PACK_END HostCmd_DS_802_11_RF_ANTENNA;
/** HostCmd_DS_MGMT_IE_LIST_CFG */
@ -5971,6 +6031,22 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_wmm_parameter_t {
WmmParameter_t wmm_para;
} MLAN_PACK_END MrvlIEtypes_wmm_parameter_t;
/** MrvlIEtypes_wmm_parameter_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_FILS_ip_config_t {
/** Header */
MrvlIEtypesHeader_t header;
/** IP ADDR **/
t_u32 ip_addr;
/** SUBNET Mask **/
t_u32 subnet_mask;
/** Base IP **/
t_u32 base_ip;
/** DNS IP **/
t_u32 dns_ip;
/** MAX Clients **/
t_u16 max_clients;
} MLAN_PACK_END MrvlIEtypes_FILS_ip_config_t;
/** MrvlIEtypes_wacp_mode_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_wacp_mode_t {
/** Header */
@ -7414,6 +7490,10 @@ typedef MLAN_PACK_START struct _HostCmd_DS_EDMAC_CFG {
t_u16 ed_ctrl_5g;
/** Energy detect threshold offset for 5ghz */
t_s16 ed_offset_5g;
/** EU adaptivity for 6ghz band */
t_u16 ed_ctrl_6g;
/** Energy detect threshold offset for 6ghz */
t_s16 ed_offset_6g;
t_u32 ed_bitmap_txq_lock;
} MLAN_PACK_END HostCmd_DS_EDMAC_CFG;
@ -7762,6 +7842,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
HostCmd_DS_WMM_HOST_DELTS_REQ host_del_ts;
/** Auth, (Re)Assoc timeout configuration */
HostCmd_DS_AUTH_ASSOC_TIMEOUT_CFG auth_assoc_cfg;
t_u8 assoc_rsp_buf[ASSOC_RSP_BUF_SIZE];
} params;
} MLAN_PACK_END HostCmd_DS_COMMAND, *pHostCmd_DS_COMMAND;
@ -7862,4 +7943,9 @@ typedef enum _BLOCK_6G_CHAN_SWITCH_REASON {
#pragma pack(pop)
#endif
typedef MLAN_PACK_START struct _Event_DPD_CAL_t {
t_u8 radio_id;
t_u8 sub_band;
} MLAN_PACK_END Event_DPD_CAL_t;
#endif /* !_MLAN_FW_H_ */

View file

@ -3,7 +3,7 @@
* @brief This file contains host command ID definitions.
*
*
* Copyright 2023-2024 NXP
* Copyright 2023-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -454,6 +454,10 @@ ENUM_ELEMENT(HostCmd_CMD_GET_HW_SPEC, 0x0003),
/** Host Command ID : IPS Config */
ENUM_ELEMENT(HostCmd_CMD_IPS_CONFIG, 0x0279),
ENUM_ELEMENT(HostCmd_CMD_OFDM_DESENSE_CFG, 0x027f),
#ifdef UAP_SUPPORT
/** Host Command ID : BCN country ie information */
ENUM_ELEMENT(HostCmd_CMD_802_CUSTOM_BEACON_IE, 0x0281),
#endif
ENUM_ELEMENT(HostCmd_CMD_NAV_MITIGATION_CFG, 0x0282),
/** Host Command ID: Tx Frame */

View file

@ -29,6 +29,121 @@ Change log:
#ifndef _MLAN_IEEE_H_
#define _MLAN_IEEE_H_
/* center frequency description */
struct center_freq_desc {
t_u8 pri_chan;
t_u8 ch_40;
t_u8 ch_80;
t_u8 ch_160;
};
/* List of 5GHZ channels */
static const struct center_freq_desc center_freq_idx_map_5g[] = {
{.pri_chan = 36, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 40, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 44, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 48, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 52, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 56, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 60, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 64, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 68, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 72, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 76, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 80, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 84, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 88, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 92, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 96, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 100, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 104, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 108, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 112, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 116, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 120, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 124, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 128, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 132, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 136, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 140, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 144, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 149, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 153, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 157, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 161, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 165, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 169, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 173, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 177, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 184, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 188, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 192, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 196, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 0, .ch_40 = 42 /* terminator with default cfreq */}};
/* List of 6GHZ channels */
static const struct center_freq_desc center_freq_idx_map_6g[] = {
{.pri_chan = 1, .ch_40 = 3, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 5, .ch_40 = 3, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 9, .ch_40 = 11, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 13, .ch_40 = 11, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 17, .ch_40 = 19, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 21, .ch_40 = 19, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 25, .ch_40 = 27, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 29, .ch_40 = 27, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 33, .ch_40 = 35, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 37, .ch_40 = 35, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 41, .ch_40 = 43, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 45, .ch_40 = 43, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 49, .ch_40 = 51, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 53, .ch_40 = 51, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 57, .ch_40 = 59, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 61, .ch_40 = 59, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 65, .ch_40 = 67, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 69, .ch_40 = 67, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 73, .ch_40 = 75, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 77, .ch_40 = 75, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 81, .ch_40 = 83, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 85, .ch_40 = 83, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 89, .ch_40 = 91, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 93, .ch_40 = 91, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 97, .ch_40 = 99, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 101, .ch_40 = 99, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 105, .ch_40 = 107, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 109, .ch_40 = 107, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 113, .ch_40 = 115, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 117, .ch_40 = 115, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 121, .ch_40 = 123, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 125, .ch_40 = 123, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 129, .ch_40 = 131, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 133, .ch_40 = 131, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 137, .ch_40 = 139, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 141, .ch_40 = 139, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 145, .ch_40 = 147, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 149, .ch_40 = 147, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 153, .ch_40 = 155, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 157, .ch_40 = 155, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 161, .ch_40 = 163, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 165, .ch_40 = 163, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 169, .ch_40 = 171, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 173, .ch_40 = 171, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 177, .ch_40 = 179, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 181, .ch_40 = 179, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 185, .ch_40 = 187, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 189, .ch_40 = 187, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 193, .ch_40 = 195, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 197, .ch_40 = 195, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 201, .ch_40 = 203, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 205, .ch_40 = 203, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 209, .ch_40 = 211, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 213, .ch_40 = 211, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 217, .ch_40 = 219, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 221, .ch_40 = 219, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 225, .ch_40 = 227, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 229, .ch_40 = 227, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 233, .ch_40 = 0, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 0, .ch_40 = 37 /* terminator with default cfreq */}};
/** WLAN header size */
#define IEEE80211_HEADER_SIZE 24
@ -123,6 +238,14 @@ typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
AID_INFO = 197,
QUIET_CHAN = 198,
OPER_MODE_NTF = 199,
RNR = 201,
FILS_SESSION = 210,
FILS_PMKID_LIST = 211,
FILS_IP_REQ = 212,
FILS_IP_RESP = 213,
FILS_KEY_AUTH = 214,
FILS_KEY_DELIVERY = 215,
FILS_INDICATION = 240,
ERP_INFO = 42,
@ -1507,6 +1630,52 @@ typedef MLAN_PACK_START struct _IEEEtypes_Element_t {
t_u8 data[];
} MLAN_PACK_END IEEEtypes_Element_t, *pIEEEtypes_Element_t;
typedef MLAN_PACK_START struct _IEEEtypes_6G_control_t {
#ifdef BIG_ENDIAN_SUPPORT
/** reserved */
t_u8 reserved : 2; /* bit 6-7 */
/** regulatory info */
t_u8 regulatory_info : 3; /* bit 3-5 */
/** duplicate_beacon */
t_u8 duplicate_beacon : 1; /* bit 2 */
/** channel width */
t_u8 channel_width : 2; /* bit 0-1 */
#else
/** channel width */
t_u8 channel_width : 2; /* bit 0-1 */
/** duplicate_beacon */
t_u8 duplicate_beacon : 1; /* bit 2 */
/** regulatory info */
t_u8 regulatory_info : 3; /* bit 3-5 */
/** reserved */
t_u8 reserved : 2; /* bit 6-7 */
#endif
} MLAN_PACK_END IEEEtypes_6G_control_t;
/* IEEEtypes_He6GOpInfo_t */
typedef MLAN_PACK_START struct _IEEEtypes_He6GOpInfo_t {
/** primary channel */
t_u8 primary_channel;
/** control */
IEEEtypes_6G_control_t control;
/** center freq0 */
t_u8 channel_center_freq0;
/** center freq1 */
t_u8 channel_center_freq1;
/** minimum rate */
t_u8 minimum_rate;
} MLAN_PACK_END IEEEtypes_He6GOpInfo_t, *pIEEEtypes_He6GOpInfo_t;
/* IEEEtypes_HE6GCap_t */
typedef MLAN_PACK_START struct _IEEEtypes_HE6GCap_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** Element id extension */
t_u8 ext_id;
/** he 6g capability */
t_u16 capa;
} MLAN_PACK_END IEEEtypes_HE6GCap_t, *pIEEEtypes_HE6GCap_t;
/** default channel switch count */
#define DEF_CHAN_SWITCH_COUNT 5
@ -1762,7 +1931,7 @@ typedef MLAN_PACK_START struct {
#define MAX_SCAN_RSP_BUF (16 * 1024)
/** Maximum number of channels that can be sent in user scan config */
#define WLAN_USER_SCAN_CHAN_MAX 50
#define WLAN_USER_SCAN_CHAN_MAX 109
/** Maximum length of SSID list */
#define MRVDRV_MAX_SSID_LIST_LENGTH 10
@ -1826,6 +1995,105 @@ typedef MLAN_PACK_START struct _ChanStatistics_t {
t_u8 max_rss;
} MLAN_PACK_END ChanStatistics_t;
#define MLAN_6G_CHAN_MAX 59
#define MLAN_RNR_COLOC_AP_MAX MLAN_6G_CHAN_MAX
#define WLAN_MAX_6G_SCAN_PARAMS_LIST 20
#define SHORT_SSID_VALID MBIT(0)
#define UNSOLICITED_PROBE MBIT(1)
/**
* IOCTL 6g scan params List sub-structure sent in wlan_ioctl_user_scan_cfg
*/
typedef MLAN_PACK_START struct _wlan_6g_scan_params {
/** scan channel */
t_u8 channel;
/** bit0: short_ssid_valid, bit1: unsolicited_probe */
t_u16 flags;
/** short ssid */
t_u32 short_ssid;
/** bssid */
t_u8 bssid[6];
} MLAN_PACK_END wlan_6g_scan_params;
/*
* Reduced Neighbor Report(RNR), based on 802.11ax-2021,
* section 9.4.2.170.
*/
#define IEEE80211_RNR_TBTT_INFO_OFFSET_BSSID_BSSPARAMS 9
#define IEEE80211_RNR_TBTT_INFO_OFFSET_BSSID_SSSID_BSSPARAMS 13
/** Get count of TBTT Information (bit 7:4) */
#define GET_RNR_TBTT_INFO_HDR_COUNT(hdr) ((hdr >> 4) & 0x0f)
#define GET_RNR_TBTT_INFO_BSSPARAMS_BIT(bss_params, bit) \
(bss_params >> bit) & 0x01
/** RNR BSS parameters */
typedef MLAN_PACK_START struct _IEEEtypes_RnrBssParams_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 rsrvd : 1;
/** Co-Located AP */
t_u8 colocated : 1;
/** Unsolicited Probe Responses Active */
t_u8 unsolicited_probe : 1;
/** Member Of ESS With 2.4/5 GHz Co-Located AP */
t_u8 colocated_ess : 1;
/** Transmitted BSSID */
t_u8 transmitted_bssid : 1;
/** Multiple BSSID */
t_u8 multi_bss : 1;
/** Same SSID */
t_u8 same_ssid : 1;
/** OCT Recommended */
t_u8 oct_recommended : 1;
#else
/** OCT Recommended */
t_u8 oct_recommended : 1;
/** Same SSID */
t_u8 same_ssid : 1;
/** Multiple BSSID */
t_u8 multi_bss : 1;
/** Transmitted BSSID */
t_u8 transmitted_bssid : 1;
/** Member Of ESS With 2.4/5 GHz Co-Located AP */
t_u8 colocated_ess : 1;
/** Unsolicited Probe Responses Active */
t_u8 unsolicited_probe : 1;
/** Co-Located AP */
t_u8 colocated : 1;
/** Reserved */
t_u8 rsrvd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_RnrBssParams_t, *pIEEEtypes_RnrBssParams_t;
/** structure for RNR Neighbor AP Information */
typedef MLAN_PACK_START struct _IEEEtypes_RnrNeighborApInfo_t {
/* TBTT Information Header */
t_u8 tbtt_info_hdr;
/* TBTT Information Length */
t_u8 tbtt_info_len;
/** Operating Class */
t_u8 oper_class;
/** Channel Number */
t_u8 chan_number;
} MLAN_PACK_END IEEEtypes_RnrNeighborApInfo_t, *pIEEEtypes_RnrNeighborApInfo_t;
/** structure for RNR colocated ap */
typedef MLAN_PACK_START struct _RnrColocatedAp_t {
/** BSSID */
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
/** SSID */
mlan_802_11_ssid ssid;
/** Short-SSID */
t_u32 short_ssid;
/** Operating Class */
t_u8 oper_class;
/** Channel Number */
t_u8 chan_number;
/** BSS parameters */
IEEEtypes_RnrBssParams_t bss_params;
} MLAN_PACK_END RnrColocatedAp_t, *pRnrColocatedAp_t;
/** Enhance ext scan type defination */
typedef enum _MLAN_EXT_SCAN_TYPE {
EXT_SCAN_DEFAULT,
@ -1893,6 +2161,10 @@ typedef MLAN_PACK_START struct {
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
/** use scan setting from scan_cfg only */
t_u8 scan_cfg_only;
/**num of 6g scan params for OOB scan */
t_u8 num_6g_scan_params;
/** 6g scan params for OOB scan */
wlan_6g_scan_params scan_param_list[WLAN_MAX_6G_SCAN_PARAMS_LIST];
} MLAN_PACK_END wlan_user_scan_cfg;
/** Default scan interval in millisecond*/
@ -1915,7 +2187,7 @@ typedef MLAN_PACK_START struct {
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
#define CHAN_MAX_6G 0
#define CHAN_MAX_6G 59 // reference from cfg80211_channels_6ghz table
/** max bgscan chan number */
#define WLAN_BG_SCAN_CHAN_MAX 38
@ -1923,6 +2195,9 @@ typedef MLAN_PACK_START struct {
/** max bgscan chan number, include UNII_4 channel */
#define WLAN_BG_SCAN_CHAN_MAX_UNII_4 41
/** max bgscan chan number, 3 + 38 + 59 */
#define WLAN_BG_SCAN_CHAN_MAX_6E 100
/** Enumeration definition */
/** EES MODE */
typedef enum {
@ -2019,6 +2294,8 @@ typedef MLAN_PACK_START struct {
/** Array of ees config struct */
ees_ssid_config ees_ssid_cfg[EES_MAX_SSIDS];
t_u8 random_mac[MLAN_MAC_ADDR_LENGTH];
/** 11ai indication */
t_u8 dot11ai;
} MLAN_PACK_END wlan_bgscan_cfg;
#endif /* STA_SUPPORT */
@ -2027,6 +2304,9 @@ typedef MLAN_PACK_START struct {
/** The security AP in OWE trsnsition Mode */
#define OWE_TRANS_MODE_OWE 2
#define VENDOR_OUI_LEN 4
#define MAX_VENDOR_OUI_NUM 10
#ifdef PRAGMA_PACK
#pragma pack(pop)
#endif
@ -2188,6 +2468,14 @@ typedef struct _BSSDescriptor_t {
IEEEtypes_Extension_t *phe_oprat;
/** HE operation IE offset */
t_u16 he_oprat_offset;
/** HE 6G Capability IE */
IEEEtypes_HE6GCap_t *phe_6g_cap;
/** HE 6G Capability IE offset */
t_u16 he_6g_cap_offset;
/** RNR IE */
IEEEtypes_Generic_t *prnr_ie;
/** RNR IE offset in the beacon buffer */
t_u16 rnr_offset;
#ifdef STA_SUPPORT
/** Country information set */
IEEEtypes_CountryInfoFullSet_t country_info;
@ -2231,6 +2519,10 @@ typedef struct _BSSDescriptor_t {
t_u32 beacon_buf_size_max;
/** scan age in secs */
t_u32 age_in_secs;
/** vendor oui list */
t_u8 vendor_oui[VENDOR_OUI_LEN * MAX_VENDOR_OUI_NUM];
/** vendor OUI count */
t_u8 vendor_oui_count;
} BSSDescriptor_t, *pBSSDescriptor_t;
#endif /* !_MLAN_IEEE_H_ */

View file

@ -4,7 +4,7 @@
* and HW.
*
*
* Copyright 2008-2021, 2024-2025 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -299,6 +299,7 @@ mlan_status wlan_allocate_adapter(pmlan_adapter pmadapter)
pmadapter->num_in_chan_stats = sizeof(chan_2g);
pmadapter->num_in_chan_stats += sizeof(chan_5g);
pmadapter->num_in_chan_stats += MLAN_6G_CHAN_MAX;
buf_size = sizeof(ChanStatistics_t) * pmadapter->num_in_chan_stats;
if (pmadapter->callbacks.moal_vmalloc &&
pmadapter->callbacks.moal_vfree)
@ -368,7 +369,7 @@ mlan_status wlan_allocate_adapter(pmlan_adapter pmadapter)
pmadapter->pcard_sd->mpa_buf_size =
SDIO_MP_DBG_NUM *
pmadapter->pcard_sd->mp_aggr_pkt_limit *
MLAN_SDIO_BLOCK_SIZE;
pmadapter->pcard_sd->sdio_blk_size;
if (pmadapter->callbacks.moal_vmalloc &&
pmadapter->callbacks.moal_vfree)
ret = pmadapter->callbacks.moal_vmalloc(
@ -467,6 +468,20 @@ mlan_status wlan_init_priv(pmlan_private priv)
memset(pmadapter, &priv->assoc_rsp_buf, 0, sizeof(priv->assoc_rsp_buf));
priv->assoc_rsp_size = 0;
// coverity[no_effect:SUPPRESS]
// coverity[misra_c_2012_rule_21_18_violation:SUPPRESS]
memset(pmadapter, &priv->assoc_req_buf, 0, sizeof(priv->assoc_req_buf));
priv->assoc_req_size = 0;
// coverity[no_effect:SUPPRESS]
// coverity[misra_c_2012_rule_21_18_violation:SUPPRESS]
memset(pmadapter, &priv->prior_assoc_rsp, 0,
sizeof(priv->prior_assoc_rsp));
priv->prior_assoc_rsp_size = 0;
// coverity[no_effect:SUPPRESS]
// coverity[misra_c_2012_rule_21_18_violation:SUPPRESS]
memset(pmadapter, &priv->prior_assoc_req, 0,
sizeof(priv->prior_assoc_req));
priv->prior_assoc_req_size = 0;
wlan_11d_priv_init(priv);
wlan_11h_priv_init(priv);
@ -549,6 +564,8 @@ mlan_status wlan_init_priv(pmlan_private priv)
SET_EXTCAP_OPERMODENTF(priv->ext_cap);
SET_EXTCAP_TDLS(priv->ext_cap);
SET_EXTCAP_QOS_MAP(priv->ext_cap);
/* Set FILS Capability */
SET_EXTCAP_FILS(priv->ext_cap);
/* Save default Extended Capability */
memcpy_ext(priv->adapter, &priv->def_ext_cap, &priv->ext_cap,
sizeof(priv->ext_cap), sizeof(priv->def_ext_cap));
@ -743,6 +760,10 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
pmadapter->specific_scan_time = MRVDRV_SPECIFIC_SCAN_CHAN_TIME;
pmadapter->active_scan_time = MRVDRV_ACTIVE_SCAN_CHAN_TIME;
pmadapter->passive_scan_time = MRVDRV_PASSIVE_SCAN_CHAN_TIME;
pmadapter->wifi_6g_scan_time = MRVDRV_6G_SCAN_CHAN_TIME;
pmadapter->wifi_6g_scan_split = MFALSE;
pmadapter->wifi_6g_scan_coloc_ap = MFALSE; /* configurable */
pmadapter->scan_6g = MFALSE;
if (!pmadapter->init_para.passive_to_active_scan)
pmadapter->passive_to_active_scan = MLAN_PASS_TO_ACT_SCAN_EN;
else if (pmadapter->init_para.passive_to_active_scan ==
@ -1238,7 +1259,16 @@ mlan_status wlan_init_lock_list(pmlan_adapter pmadapter)
util_init_list_head((t_void *)pmadapter->pmoal_handle,
&pmadapter->ioctl_pending_q, MTRUE,
pmadapter->callbacks.moal_init_lock);
/* Initialize coloc_ap_list */
util_init_list_head((t_void *)pmadapter->pmoal_handle,
&pmadapter->coloc_ap_list, MTRUE,
pmadapter->callbacks.moal_init_lock);
#ifdef PCIE
util_scalar_init((t_void *)pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index,
MLAN_INVALID_TXRX_INDEX_VAL, MNULL,
pmadapter->callbacks.moal_init_lock);
#endif
error:
LEAVE();
return ret;
@ -1357,6 +1387,14 @@ t_void wlan_free_lock_list(pmlan_adapter pmadapter)
&pmadapter->ioctl_pending_q,
pmadapter->callbacks.moal_free_lock);
util_free_list_head((t_void *)pmadapter->pmoal_handle,
&pmadapter->coloc_ap_list,
pmadapter->callbacks.moal_free_lock);
#ifdef PCIE
util_scalar_free((t_void *)pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index,
pcb->moal_free_lock);
#endif
for (i = 0; i < pmadapter->priv_num; i++)
util_free_list_head((t_void *)pmadapter->pmoal_handle,
&pmadapter->bssprio_tbl[i].bssprio_head,
@ -1546,6 +1584,14 @@ mlan_status wlan_init_fw(pmlan_adapter pmadapter)
goto done;
}
}
if (((pmadapter->card_type) & 0xff) == CARD_TYPE_AW693) {
ret = wlan_prepare_cmd(priv, HostCmd_CMD_FUNC_INIT,
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
if (ret) {
ret = MLAN_STATUS_FAILURE;
goto done;
}
}
#endif /* PCIE */
#endif /* MFG_CMD_SUPPORT */
if (wlan_is_cmd_pending(pmadapter)) {
@ -1703,6 +1749,18 @@ static void wlan_update_hw_spec(pmlan_adapter pmadapter)
}
}
}
if (IS_FW_SUPPORT_6G(pmadapter)) {
pmadapter->fw_bands |= BAND_6G;
pmadapter->config_bands |= BAND_6G;
for (i = 0; i < pmadapter->priv_num; i++) {
if (pmadapter->priv[i]) {
pmadapter->priv[i]->config_bands =
pmadapter->config_bands;
}
}
pmadapter->wifi_6g_scan_split = MTRUE;
pmadapter->wifi_6g_scan_coloc_ap = MTRUE;
}
LEAVE();
return;
}
@ -1841,6 +1899,7 @@ t_void wlan_free_adapter(pmlan_adapter pmadapter)
pmadapter->wakeup_fw_timer_is_set = MFALSE;
}
wlan_free_fw_cfp_tables(pmadapter);
wlan_free_fw_6g_cfp_tables(pmadapter);
#ifdef STA_SUPPORT
PRINTM(MINFO, "Free ScanTable\n");
if (pmadapter->pscan_table) {
@ -1910,6 +1969,8 @@ t_void wlan_free_adapter(pmlan_adapter pmadapter)
wlan_free_mlan_buffer(pmadapter, pmadapter->psleep_cfm);
pmadapter->psleep_cfm = MNULL;
wlan_free_rnr_coloc_ap(pmadapter);
/* Free timers */
wlan_free_timer(pmadapter);

View file

@ -3,7 +3,7 @@
* @brief This file declares the IOCTL data structures and APIs.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -220,6 +220,9 @@ enum _mlan_ioctl_req_id {
MLAN_OID_11D_DOMAIN_INFO = 0x000D0003,
#endif
MLAN_OID_11D_DOMAIN_INFO_EXT = 0x000D0004,
#ifdef UAP_SUPPORT
MLAN_OID_11D_BCN_COUNTRY_IE_INFO = 0x000D0005,
#endif
/* Register Memory Access Group */
MLAN_IOCTL_REG_MEM = 0x000E0000,
@ -310,6 +313,7 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_COALESCE_CFG = 0x0020002E,
MLAN_OID_MISC_TDLS_IDLE_TIME = 0x0020002F,
MLAN_OID_MISC_GET_SENSOR_TEMP = 0x00200030,
MLAN_OID_FILS_IP_CFG = 0x00200035,
MLAN_OID_MISC_IPV6_RA_OFFLOAD = 0x00200036,
MLAN_OID_MISC_GTK_REKEY_OFFLOAD = 0x00200037,
MLAN_OID_MISC_OPER_CLASS = 0x00200038,
@ -377,6 +381,7 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_RF_TEST_CONFIG_TRIGGER_FRAME = 0x0020008C,
MLAN_OID_MISC_OFDM_DESENSE_CFG = 0x0020008D,
MLAN_OID_MISC_TSP_CFG = 0x002008C,
MLAN_OID_SCAN_6G_CONFIG = 0x0020008E,
MLAN_OID_MISC_REORDER_FLUSH_TIME = 0x0020008F,
MLAN_OID_MISC_NAV_MITIGATION = 0x00200090,
MLAN_OID_MISC_LED_CONFIG = 0x00200091,
@ -384,9 +389,11 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_EDMAC_CONFIG = 0x00200093,
MLAN_OID_MISC_GPIO_CFG = 0x00200094,
MLAN_OID_MISC_REGION_POWER_CFG = 0x00200095,
MLAN_OID_UAP_6E_INBAND_FRAME = 0x00200096,
MLAN_OID_MISC_OTP_MAC_RD_WR = 0x00200097,
MLAN_OID_MISC_OTP_CAL_DATA_RD_WR = 0x00200098,
MLAN_OID_MISC_AUTH_ASSOC_TIMEOUT_CONFIG = 0x00200099,
MLAN_OID_MISC_PREV_ASSOC_INFO = 0x0020009A,
};
/** Sub command size */
@ -630,6 +637,15 @@ typedef struct _mlan_scan_cfg {
t_u32 scan_chan_gap;
} mlan_scan_cfg, *pmlan_scan_cfg;
/** Type definition of _mlan_scan_6g_cfg */
typedef struct _mlan_scan_6g_cfg {
/** scan 6 GHz channels flag:
* 0: scan all 6 GHz channels,
* 1: scan colocated AP channels or/and PSC channels
*/
t_u8 scan_coloc_ap;
} mlan_scan_6g_cfg, *pmlan_scan_6g_cfg;
/** Type defnition of mlan_ds_scan for MLAN_IOCTL_SCAN */
typedef struct _mlan_ds_scan {
/** Sub-command */
@ -644,6 +660,8 @@ typedef struct _mlan_ds_scan {
mlan_user_scan user_scan;
/** Scan config parameters */
mlan_scan_cfg scan_cfg;
/** 6E Scan config parameters */
mlan_scan_6g_cfg scan_6g_cfg;
} param;
} mlan_ds_scan, *pmlan_ds_scan;
@ -693,7 +711,7 @@ typedef struct _mlan_multicast_list {
} mlan_multicast_list, *pmlan_multicast_list;
/** Max channel */
#define MLAN_MAX_CHANNEL 177
#define MLAN_MAX_CHANNEL 233
/** Maximum number of channels in table */
#define MLAN_MAX_CHANNEL_NUM 128
@ -765,6 +783,8 @@ typedef struct _mlan_ds_misc_assoc_req {
/** mlan_ds_assoc_info */
typedef struct _mlan_ds_assoc_info {
/** bssid */
mlan_802_11_mac_addr bssid;
/** Associate req buffer */
t_u8 assoc_resp_buf[ASSOC_RSP_BUF_SIZE];
/** Response buffer length */
@ -1097,6 +1117,20 @@ typedef struct _wmm_parameter_t {
wmm_ac_parameters_t ac_params[MAX_AC_QUEUES];
} wmm_parameter_t, *pwmm_parameter_t;
/** IP address configuration for 11ai */
typedef struct _ip_addr_cfg_t {
/** IP ADDR **/
t_u32 ip;
/** SUBNET Mask **/
t_u32 subnetMask;
/** Base IP **/
t_u32 baseIp;
/** DNS IP **/
t_u32 dnsIp;
/** MAX Clients **/
t_u16 maxClients;
} ip_addr_cfg_t;
/** MAX BG channel */
#define MAX_BG_CHANNEL 14
/** mlan_bss_param
@ -1210,6 +1244,7 @@ typedef struct _mlan_uap_bss_param {
/** Wmm parameters */
wmm_parameter_t wmm_para;
ip_addr_cfg_t ip_cfg;
/** uap host based config */
t_u32 uap_host_based_config;
/** multi ap flag */
@ -1326,6 +1361,22 @@ typedef struct _mlan_ds_sta_info {
#define WIFI_DIRECT_MODE_STOP_FIND 5
#endif
/** 6E inband frame configuration parameters */
typedef struct inband_6e_frames_cmd_t {
/** type*/
t_u16 type;
/** length of TLV */
t_u16 len;
/** enable/diable */
t_u8 enabled;
/** frame type */
t_u8 frameType;
/** interval (TU) */
t_u16 interval;
/** frame length */
t_u16 frameLen;
} inband_6e_frames_cmd_t;
/** Type definition of mlan_ds_bss for MLAN_IOCTL_BSS */
typedef struct _mlan_ds_bss {
/** Sub-command */
@ -1390,9 +1441,16 @@ typedef struct _mlan_ds_bss {
mlan_ds_sta_info sta_info;
#endif
inband_6e_frames_cmd_t inband_6e_frame;
} param;
} mlan_ds_bss, *pmlan_ds_bss;
/** Host command action : Get Tx 6G CFP table */
#define MLAN_ACT_GET_6G_CFP_TBL 0x6
/** Host command action : Set Tx 6G CFP table */
#define MLAN_ACT_SET_6G_CFP_TBL 0x7
/* OTP Region info */
typedef MLAN_PACK_START struct _otp_region_info {
t_u8 country_code[2];
@ -1410,6 +1468,8 @@ typedef struct _mlan_ds_custom_reg_domain {
t_u8 num_bg_chan;
/** num of 5g channels in custom_reg_domain */
t_u8 num_a_chan;
/** num of 6g channels in custom_reg_domain */
t_u8 num_6g_chan;
/** cfp table */
chan_freq_power_t cfp_tbl[];
} mlan_ds_custom_reg_domain;
@ -1427,6 +1487,7 @@ enum _mlan_band_def {
BAND_AAC = 64,
BAND_GAX = 256,
BAND_AAX = 512,
BAND_6G = 1024,
};
/** Channel bandwidth */
@ -1456,6 +1517,10 @@ typedef struct _mlan_ds_ant_cfg {
t_u32 tx_antenna;
/** Rx antenna mode */
t_u32 rx_antenna;
/** Tx antenna mode 6G*/
t_u8 tx_antenna_6g;
/** Rx antenna mode 6G*/
t_u8 rx_antenna_6g;
} mlan_ds_ant_cfg, *pmlan_ds_ant_cfg;
/** Type definition of mlan_ds_mimo_switch for MLAN_OID_MIMO_SWITCH */
typedef struct _mlan_ds_mimo_switch {
@ -1767,6 +1832,10 @@ typedef struct _mlan_ds_get_stats {
t_u32 gdma_abort_cnt;
/** Rx Reset MAC Count */
t_u32 g_reset_rx_mac_cnt;
/** Current SOC Temperature*/
t_u32 currTemp;
/** TX Power Control Method*/
t_u32 TXpwrMethod;
/** SDMA FSM stuck Count*/
t_u32 SdmaStuckCnt;
// Ownership error counters
@ -1949,6 +2018,8 @@ typedef struct _mlan_fw_info {
t_u8 hw_2g_hecap_len;
/** 802.11ax 2.4G HE capability */
t_u8 hw_2g_he_cap[54];
/** 802.11ax 6G HE capability */
t_u16 hw_he_6g_cap;
/** 802.11ac device support for MIMO abstraction of MCSs */
t_u32 hw_dot_11ac_mcs_support;
/** User conf 802.11ac device support for MIMO abstraction of MCSs */
@ -1977,6 +2048,7 @@ typedef struct _mlan_fw_info {
t_u8 fw_beacon_prot;
/** FW RTT support */
t_u8 rtt_support;
t_u8 he_6g_support;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
@ -2674,6 +2746,7 @@ enum _mlan_auth_mode {
MLAN_AUTH_MODE_FT = 0x02,
MLAN_AUTH_MODE_SAE = 0x03,
MLAN_AUTH_MODE_OWE = 0x04,
MLAN_AUTH_MODE_FILS = 0x05,
MLAN_AUTH_MODE_NETWORKEAP = 0x80,
MLAN_AUTH_MODE_AUTO = 0xFF,
};
@ -2685,6 +2758,7 @@ typedef enum {
AssocAgentAuth_FastBss,
AssocAgentAuth_FastBss_Skip,
AssocAgentAuth_Network_EAP,
AssocAgentAuth_FILS = 5,
AssocAgentAuth_Wpa3Sae = 6,
AssocAgentAuth_Owe = 7,
AssocAgentAuth_Auto,
@ -4040,12 +4114,48 @@ typedef MLAN_PACK_START struct _mlan_ds_11ax_he_capa {
t_u8 val[28];
} MLAN_PACK_END mlan_ds_11ax_he_capa, *pmlan_ds_11ax_he_capa;
/** Type definition of mlan_6g_cap_t */
typedef struct _mlan_6g_cap_t {
/** Minimum MPDU Start Spacing */
t_u16 min_mpdu_start_spacing : 3;
/** Max A-MPDU length Exponent */
t_u16 max_ampdu_length_exp : 3;
/** Max MPDU length */
t_u16 max_mpdu_length : 2;
/** reserved1 */
t_u16 rsvd1 : 1;
/** SM PowerSave */
t_u16 sm_power_save : 2;
/** RD Responder */
t_u16 rd_responder : 1;
/** Rx Antenna Pattern Consistency */
t_u16 rx_ant_pat : 1;
/** Tx Antenna Pattern Consistency */
t_u16 tx_ant_pat : 1;
/** reserved2 */
t_u16 rsvd2 : 2;
} mlan_6g_cap_t;
/** Type definition of mlan_ds_11ax_6g_capa for MLAN_OID_11AX_6G_CFG */
typedef MLAN_PACK_START struct _mlan_ds_11ax_he_6g_capa {
/** tlv id of he capability */
t_u16 id;
/** length of the payload */
t_u16 len;
/** ext_id */
t_u8 ext_id;
/** capability info */
t_u16 capa;
} MLAN_PACK_END mlan_ds_11ax_he_6g_capa, *pmlan_ds_11ax_he_6g_capa;
/** Type definition of mlan_ds_11ax_he_cfg for MLAN_OID_11AX_HE_CFG */
typedef struct _mlan_ds_11ax_he_cfg {
/** band, BIT0:2.4G, BIT1:5G BIT2:6G*/
t_u8 band;
/** mlan_ds_11ax_he_capa */
mlan_ds_11ax_he_capa he_cap;
/** mlan_ds_11ax_he_6g_capa */
mlan_ds_11ax_he_6g_capa he_6g_cap;
} mlan_ds_11ax_he_cfg, *pmlan_ds_11ax_he_cfg;
/** Type definition of mlan_ds_11as_cfg for MLAN_IOCTL_11AX_CFG */
typedef struct _mlan_ds_11ax_cfg {
@ -4185,6 +4295,8 @@ typedef struct _mlan_ds_11ax_llde_cmd {
t_u16 tbppdu_datacnt;
} mlan_ds_11ax_llde_cmd, *pmlan_ds_11ax_llde_cmd;
#define MAX_SIZE_RUTX_SUB_PWR 168 /*for 2G,5G,6G subbands */
/** Type definition of mlan_ds_11ax_rutxpwr_cmd for MLAN_OID_11AX_CMD_CFG */
typedef struct _mlan_ds_11ax_rutxpwr_cmd {
/** type*/
@ -4200,7 +4312,7 @@ typedef struct _mlan_ds_11ax_rutxpwr_cmd {
* id 3 ( consider only 2G support */
t_u8 row;
/**ru tx data */
t_s8 rutxSubPwr[89];
t_s8 rutxSubPwr[MAX_SIZE_RUTX_SUB_PWR];
} mlan_ds_11ax_rutxpwr_cmd, *pmlan_ds_11ax_rutxpwr_cmd;
/** Type definition of mlan_ds_11ax_HeSuER_cmd for MLAN_11AXCMD_HESUER_SUBID */
@ -5514,7 +5626,7 @@ typedef struct _mlan_ds_misc_dfs_repeater {
#define CRITERIA_UNICAST BIT(1)
#define CRITERIA_MULTICAST BIT(3)
#define MAX_NUM_ENTRIES 8
#define MAX_NUM_ENTRIES 9
#define MAX_NUM_BYTE_SEQ 6
#define MAX_NUM_MASK_SEQ 6
@ -5612,6 +5724,7 @@ enum _mlan_act_mef_act_type {
MEF_ACT_AUTOARP,
MEF_ACT_WOWLAN,
MEF_ACT_IPV6_NS,
MEF_ACT_MDNS,
};
typedef struct _mlan_ds_sensor_temp {
@ -6412,6 +6525,10 @@ typedef struct _mlan_ds_ed_mac_cfg {
t_u16 ed_ctrl_5g;
/** Energy detect threshold offset for 5ghz */
t_s16 ed_offset_5g;
/** EU adaptivity for 6ghz band */
t_u16 ed_ctrl_6g;
/** Energy detect threshold offset for 6ghz */
t_s16 ed_offset_6g;
t_u32 ed_bitmap_txq_lock;
} mlan_ds_ed_mac_cfg;
@ -6472,6 +6589,8 @@ typedef struct _mlan_ds_misc_cfg {
mlan_ds_misc_assoc_rsp assoc_resp;
/** Get associate request for MLAN_OID_MISC_ASSOC_REQ */
mlan_ds_misc_assoc_req assoc_req;
/** Get associate info for MLAN_OID_MISC_PREV_ASSOC_INFO */
mlan_ds_assoc_info assoc_info;
/** Function init/shutdown for MLAN_OID_MISC_INIT_SHUTDOWN */
t_u32 func_init_shutdown;
/** Custom IE for MLAN_OID_MISC_CUSTOM_IE */

View file

@ -7,7 +7,7 @@
* to the firmware.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -278,6 +278,11 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
ENTER();
if (rate1_size > WLAN_SUPPORTED_RATES) {
PRINTM(MERROR, "Invalid rate buffer size\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
ret = pcb->moal_malloc(pmpriv->adapter->pmoal_handle, rate1_size,
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC, &tmp);
if (ret != MLAN_STATUS_SUCCESS || !tmp) {
@ -290,10 +295,15 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
memset(pmpriv->adapter, rate1, 0, rate1_size);
for (i = 0; rate2[i] && i < rate2_size; i++) {
/* tmp is already malloc'd above */
// coverity[cert_exp33_c_violation:SUPPRESS]
for (j = 0; tmp[j] && j < rate1_size; j++) {
/* Check common rate, excluding the bit
* for basic rate */
if ((rate2[i] & 0x7F) == (tmp[j] & 0x7F)) {
/* i & j are restricted by rate2_size and
* rate1_size resp */
// coverity[integer_overflow:SUPPRESS]
*rate1++ = tmp[j];
break;
}
@ -306,7 +316,10 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
PRINTM(MINFO, "Tx DataRate is set to 0x%X\n", pmpriv->data_rate);
if (!pmpriv->is_data_rate_auto) {
// coverity[integer_overflow:SUPPRESS]
while (rate1_size && *ptr) {
/* loop exits when rate1_size becomes 0 */
// coverity[integer_overflow:SUPPRESS]
if ((*ptr & 0x7f) == pmpriv->data_rate) {
ret = MLAN_STATUS_SUCCESS;
goto done;
@ -990,6 +1003,7 @@ static t_u8 wlan_find_ie(t_u8 *ie, t_u8 ie_len, t_u8 ie_type)
t_u8 *pos = MNULL;
t_s8 ret_len;
t_u8 ret = MFALSE;
t_u8 len = 0;
ENTER();
@ -997,8 +1011,8 @@ static t_u8 wlan_find_ie(t_u8 *ie, t_u8 ie_len, t_u8 ie_type)
ret_len = ie_len;
while (ret_len >= 2) {
pheader = (IEEEtypes_Header_t *)pos;
if ((t_s8)(pheader->len + sizeof(IEEEtypes_Header_t)) >
ret_len) {
len = pheader->len + sizeof(IEEEtypes_Header_t);
if ((t_s8)len > ret_len) {
PRINTM(MMSG, "invalid IE length = %d left len %d\n",
pheader->len, ret_len);
break;
@ -1055,11 +1069,17 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
MrvlIEtypes_PrevBssid_t *prev_bssid_tlv = MNULL;
t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0};
MrvlIEtypes_MultiAp_t *multi_ap_tlv = MNULL;
MrvlIETypes_VHTCap_t *pvhtcap = MNULL;
MrvlIEtypes_He_cap_t *phecap = MNULL;
MrvlIEtypesHeader_t *papInfo_tlv = MNULL;
MrvlIEtypesHeader_t *pvendorOUI_tlv;
t_u8 ie_len = 0;
t_s16 size = 0;
ENTER();
pbss_desc = (BSSDescriptor_t *)pdata_buf;
pos = (t_u8 *)passo;
pos = (t_u8 *)&cmd->params;
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_11_ASSOCIATE);
@ -1068,6 +1088,23 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
memcpy_ext(pmpriv->adapter, &pmpriv->curr_bss_params.attemp_bssid,
pbss_desc->mac_address, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
/* back up previous AP's assoc_resp and assoc_req buffer*/
if (pmpriv->media_connected) {
memcpy_ext(pmpriv->adapter, &pmpriv->prev_bssid,
pmpriv->curr_bss_params.bss_descriptor.mac_address,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
memcpy_ext(pmadapter, pmpriv->prior_assoc_rsp,
pmpriv->assoc_rsp_buf, pmpriv->assoc_rsp_size,
ASSOC_RSP_BUF_SIZE);
memcpy_ext(pmadapter, pmpriv->prior_assoc_req,
pmpriv->assoc_req_buf, pmpriv->assoc_req_size,
ASSOC_RSP_BUF_SIZE);
pmpriv->prior_assoc_rsp_size = pmpriv->assoc_rsp_size;
pmpriv->prior_assoc_req_size = pmpriv->assoc_req_size;
} else {
pmpriv->prior_assoc_rsp_size = 0;
pmpriv->prior_assoc_req_size = 0;
}
/* clear assoc_rsp_size */
pmpriv->assoc_rsp_size = 0;
pmpriv->assoc_req_size = 0;
@ -1146,6 +1183,10 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
MLAN_AUTH_MODE_FT)
pauth_tlv->auth_type =
wlan_cpu_to_le16(AssocAgentAuth_FastBss_Skip);
else if (pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_FILS)
pauth_tlv->auth_type =
wlan_cpu_to_le16(AssocAgentAuth_FILS);
else if (pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_SAE)
pauth_tlv->auth_type =
@ -1208,6 +1249,11 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
pchan_tlv->chan_scan_param[0].bandcfg.chanBand =
wlan_band_to_radio_type(pbss_desc->bss_band);
if (pbss_desc->bss_band == BAND_6G)
pchan_tlv->chan_scan_param[0].bandcfg.chanWidth =
wlan_get_6g_ap_bandconfig(
pbss_desc,
&pchan_tlv->chan_scan_param[0].bandcfg);
PRINTM(MINFO, "Assoc: TLV Bandcfg = %x\n",
pchan_tlv->chan_scan_param[0].bandcfg);
pos += sizeof(pchan_tlv->header) + sizeof(ChanScanParamSet_t);
@ -1446,6 +1492,9 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
IS_FW_SUPPORT_11AX(pmadapter))) {
PRINTM(MCMND, "STBC NOT supported, Will be disabled\n");
}
if ((IS_FW_SUPPORT_6G(pmadapter)) &&
wlan_116e_bandconfig_allowed(pmpriv, pbss_desc))
wlan_cmd_append_116e_tlv(pmpriv, pbss_desc, &pos);
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie);
if (pmpriv->sec_info.wapi_enabled && pmpriv->wapi_ie_len)
@ -1510,6 +1559,71 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
goto done;
}
/* pass AP's required capabilities */
if (pbss_desc->vendor_oui_count) {
papInfo_tlv = (MrvlIEtypesHeader_t *)pos;
papInfo_tlv->type = wlan_cpu_to_le16(TLV_TYPE_AP_INFO);
papInfo_tlv->len = 0;
pos += sizeof(MrvlIEtypesHeader_t);
/* append AP vht cap tlv */
if (pbss_desc->pvht_cap) {
ie_len = sizeof(MrvlIEtypesHeader_t) +
sizeof(VHT_capa_t);
papInfo_tlv->len += ie_len;
pvhtcap = (MrvlIETypes_VHTCap_t *)pos;
pvhtcap->header.type = wlan_cpu_to_le16(VHT_CAPABILITY);
pvhtcap->header.len = sizeof(VHT_capa_t);
memcpy_ext(pmadapter,
(t_u8 *)pvhtcap +
sizeof(MrvlIEtypesHeader_t),
(t_u8 *)pbss_desc->pvht_cap +
sizeof(IEEEtypes_Header_t),
sizeof(VHT_capa_t), sizeof(VHT_capa_t));
pos += ie_len;
pvhtcap->header.len =
wlan_cpu_to_le16(pvhtcap->header.len);
}
/* append AP he cap tlv */
if (pbss_desc->phe_cap) {
ie_len = sizeof(MrvlIEtypesHeader_t) +
pbss_desc->phe_cap->ieee_hdr.len;
papInfo_tlv->len += ie_len;
phecap = (MrvlIEtypes_He_cap_t *)pos;
phecap->type = wlan_cpu_to_le16(EXTENSION);
phecap->len = pbss_desc->phe_cap->ieee_hdr.len;
memcpy_ext(pmadapter,
(t_u8 *)phecap + sizeof(MrvlIEtypesHeader_t),
(t_u8 *)pbss_desc->phe_cap +
sizeof(IEEEtypes_Header_t),
pbss_desc->phe_cap->ieee_hdr.len,
pbss_desc->phe_cap->ieee_hdr.len);
pos += ie_len;
phecap->len = wlan_cpu_to_le16(phecap->len);
}
/* append AP vendor oui list tlv */
if (pbss_desc->vendor_oui_count) {
ie_len = sizeof(MrvlIEtypesHeader_t) +
pbss_desc->vendor_oui_count * VENDOR_OUI_LEN;
papInfo_tlv->len += ie_len;
pvendorOUI_tlv = (MrvlIEtypesHeader_t *)pos;
pvendorOUI_tlv->type =
wlan_cpu_to_le16(VENDOR_IE_OUIS_TLV_ID);
pvendorOUI_tlv->len =
pbss_desc->vendor_oui_count * VENDOR_OUI_LEN;
pos += sizeof(MrvlIEtypesHeader_t);
memcpy_ext(pmadapter, pos,
(t_u8 *)&pbss_desc->vendor_oui,
pvendorOUI_tlv->len, pvendorOUI_tlv->len);
pos += pvendorOUI_tlv->len;
pvendorOUI_tlv->len =
wlan_cpu_to_le16(pvendorOUI_tlv->len);
}
papInfo_tlv->len = wlan_cpu_to_le16(papInfo_tlv->len);
}
/*
* Call 11h join API after capability bits are set so adhoc/infra 11h
* behavior can be properly triggered. pos modified if data is appended
@ -1518,8 +1632,8 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
pmpriv, &pos, &passo->cap_info, (t_u8)pbss_desc->bss_band,
pbss_desc->phy_param_set.ds_param_set.current_chan,
&pbss_desc->wlan_11h_bss_info);
cmd->size = wlan_cpu_to_le16((t_u16)(pos - (t_u8 *)passo) + S_DS_GEN);
size = pos - (t_u8 *)passo;
cmd->size = wlan_cpu_to_le16((t_u16)size + S_DS_GEN);
/* Set the Capability info at last */
memcpy_ext(pmadapter, &tmp_cap, &pbss_desc->cap_info,
@ -1673,8 +1787,9 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->assoc_rsp_size =
MIN(resp->size - S_DS_GEN, sizeof(pmpriv->assoc_rsp_buf));
memcpy_ext(pmpriv->adapter, pmpriv->assoc_rsp_buf, &resp->params,
pmpriv->assoc_rsp_size, pmpriv->assoc_rsp_size);
memcpy_ext(pmpriv->adapter, pmpriv->assoc_rsp_buf,
&resp->params.assoc_rsp_buf, pmpriv->assoc_rsp_size,
pmpriv->assoc_rsp_size);
if (pioctl_req != MNULL) {
bss = (mlan_ds_bss *)pioctl_req->pbuf;
@ -1686,7 +1801,11 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
ASSOC_RSP_BUF_SIZE);
}
if (passoc_rsp->status_code) {
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_ASSOC_FAILURE, MNULL);
if (pmpriv->curr_bss_params.host_mlme &&
(pmpriv->assoc_rsp_size < (sizeof(IEEEtypes_MgmtHdr_t) +
sizeof(IEEEtypes_AssocRsp_t))))
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_ASSOC_FAILURE,
MNULL);
if (pmpriv->media_connected == MTRUE) {
if (pmpriv->port_ctrl_mode == MTRUE)
pmpriv->port_open = pmpriv->prior_port_status;
@ -1706,6 +1825,10 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv,
MLAN_EVENT_ID_DRV_ASSOC_FAILURE_REPORT,
MNULL);
// coverity[no_effect:SUPPRESS]
memset(pmpriv->adapter,
pmpriv->curr_bss_params.prev_bssid, 0,
MLAN_MAC_ADDR_LENGTH);
}
} else
wlan_reset_connect_state(pmpriv, MTRUE);
@ -1832,6 +1955,15 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->max_amsdu = MLAN_TX_DATA_BUF_SIZE_8K;
else
pmpriv->max_amsdu = MLAN_TX_DATA_BUF_SIZE_4K;
} else if (pbss_desc->phe_6g_cap) {
if (GET_6G_BAND_CAP_MAXMPDULEN(pbss_desc->phe_6g_cap->capa) ==
2)
pmpriv->max_amsdu = MLAN_TX_DATA_BUF_SIZE_12K;
else if (GET_6G_BAND_CAP_MAXMPDULEN(
pbss_desc->phe_6g_cap->capa) == 1)
pmpriv->max_amsdu = MLAN_TX_DATA_BUF_SIZE_8K;
else
pmpriv->max_amsdu = MLAN_TX_DATA_BUF_SIZE_4K;
}
wlan_save_curr_bcn(pmpriv);
@ -1960,10 +2092,6 @@ mlan_status wlan_associate(mlan_private *pmpriv, t_void *pioctl_buf,
&pmpriv->curr_bss_params.bss_descriptor.mac_address,
sizeof(current_bssid), sizeof(current_bssid));
/* Clear any past association response stored for application retrieval
*/
pmpriv->assoc_rsp_size = 0;
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_ASSOCIATE,
HostCmd_ACT_GEN_SET, 0, pioctl_buf, pbss_desc);
@ -2049,6 +2177,9 @@ t_u8 wlan_band_to_radio_type(t_u16 band)
case BAND_A | BAND_AN | BAND_AAC:
ret_radio_type = BAND_5GHZ;
break;
case BAND_6G:
ret_radio_type = BAND_6GHZ;
break;
case BAND_B:
case BAND_G:
case BAND_B | BAND_G:

View file

@ -5,7 +5,7 @@
* in MLAN module.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -525,6 +525,13 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
*/
#define MRVDRV_SPECIFIC_SCAN_CHAN_TIME 110
/** scan time for rnr channel */
#define MRVDRV_6G_RNR_SCAN_CHAN_TIME 110
/** Scan time in the channel TLV
* for each 6G channel scans
*/
#define MRVDRV_6G_SCAN_CHAN_TIME 30
/**
* Max total scan time in milliseconds
* The total scan time should be less than scan command timeout value (20s)
@ -997,7 +1004,7 @@ typedef struct _mrvl_wep_key_t {
} mrvl_wep_key_t;
/** Maximum number of region channel */
#define MAX_REGION_CHANNEL_NUM 2
#define MAX_REGION_CHANNEL_NUM 3
/** Region-band mapping table */
typedef struct _region_chan_t {
@ -1199,6 +1206,8 @@ typedef struct _mlan_private {
t_u8 user_2g_hecap_len;
/** user configured 802.11ax HE capability */
t_u8 user_2g_he_cap[54];
/** 802.11ax 6G HE capability */
t_u16 user_he_6g_cap;
/** dropped pkts */
t_u32 num_drop_pkts;
#ifdef UAP_SUPPORT
@ -1368,6 +1377,17 @@ typedef struct _mlan_private {
t_u8 assoc_req_buf[ASSOC_RSP_BUF_SIZE];
/** Length of the data stored in assoc_rsp_buf */
t_u32 assoc_req_size;
/** prev_bssid */
mlan_802_11_mac_addr prev_bssid;
/** Buffer to store the association response for application retrieval
*/
t_u8 prior_assoc_rsp[ASSOC_RSP_BUF_SIZE];
/** Length of the data stored in assoc_rsp_buf */
t_u32 prior_assoc_rsp_size;
/** Buffer to store the association req IEs */
t_u8 prior_assoc_req[ASSOC_RSP_BUF_SIZE];
/** Length of the data stored in assoc_req_buf */
t_u32 prior_assoc_req_size;
/** Generic IEEE IEs passed from the application to be inserted into the
* association request to firmware
*/
@ -1797,6 +1817,18 @@ typedef struct {
t_u32 millisec_dwell_time;
} wlan_dfs_testing_settings_t;
/* Colocated AP used for 6E out of band scanning */
typedef struct _wlan_6e_coloc_ap_t wlan_6e_coloc_ap_t;
struct _wlan_6e_coloc_ap_t {
/** Pointer to previous node */
wlan_6e_coloc_ap_t *pprev;
/** Pointer to next node */
wlan_6e_coloc_ap_t *pnext;
/* Colocated AP information */
RnrColocatedAp_t ap_info;
};
/**
* @brief Driver measurement state held in 'mlan_adapter' structure
*
@ -1940,6 +1972,8 @@ typedef struct _mef_entry {
int num_wowlan_entry;
/** Num for IPv6 neighbor solicitation message offload */
int num_ipv6_ns_offload;
/** Num for wake on mDNS entry*/
int num_mdns_entry;
int clear_mef_entry;
/** criteria*/
t_u32 criteria;
@ -1949,6 +1983,7 @@ typedef struct _mef_entry {
* Caution: 5 is for Auto Arp Entry
* Caution: 6 is for wowlan Entry
* Caution: 7 is for IPv6 Neighbor Solicitation offload Entry
* Caution: 8 is for WoWLAN by mDNS
*/
mef_entry_t entry[MAX_NUM_ENTRIES];
} mef_entry;
@ -2034,6 +2069,7 @@ typedef struct _mlan_init_para {
t_u8 mclient_scheduling;
t_u32 reject_addba_req;
t_u8 disable_11h_tpc;
t_u8 tpe_ie_ignore;
} mlan_init_para, *pmlan_init_para;
#ifdef SDIO
@ -2149,6 +2185,10 @@ typedef struct _mlan_sdio_card {
t_u8 *rx_buf;
/** allocated buf for receive */
t_u8 *rx_buffer;
/** max blk count */
t_u32 max_blk_count;
/** sdio blk size */
t_u32 sdio_blk_size;
/* see blk_queue_max_segment_size */
t_u32 max_seg_size;
/* see blk_queue_max_segments */
@ -2211,6 +2251,7 @@ typedef struct _mlan_sdio_card {
/** 8 entry will mapping to 3 */
#define EVT_NUM_DESC 3
#define MLAN_MAX_TXRX_BD MAX(ADMA_MAX_TXRX_BD, MAX_TXRX_BD)
#define MLAN_INVALID_TXRX_INDEX_VAL (MLAN_MAX_TXRX_BD + 1)
/** 8 Event buffer ring */
#define MLAN_MAX_EVT_BD 0x08
typedef struct _mlan_pcie_card_reg {
@ -2582,6 +2623,10 @@ struct _mlan_adapter {
#endif
#ifdef PCIE
pmlan_pcie_card pcard_pcie;
/* pending starting RX RD-index from which re-fill is needed*/
mlan_scalar rx_refill_start_index;
/* Last Rx RD index till the Re-fill is required */
t_s32 rx_refill_last_index;
#endif
#ifdef USB
pmlan_usb_card pcard_usb;
@ -2754,6 +2799,23 @@ struct _mlan_adapter {
t_u16 passive_scan_time;
/** Passive scan to active scan */
t_u8 passive_to_active_scan;
/** wifi 6g scan time */
t_u16 wifi_6g_scan_time;
/** 6E out of band discovery flag -
* indicate the scan request will be split
* into two, first for legacy bands and
* second for 6G band
*/
t_u8 wifi_6g_scan_split;
/** 6E out of band discovery flag -
* enable scan for colocated APs
* reported by 2.4/5 GHz APs
*/
t_u8 wifi_6g_scan_coloc_ap;
/** scan 6g request */
t_u8 scan_6g;
/** List for RNR cololcated ap */
mlan_list_head coloc_ap_list;
/** scan channel gap time */
t_u16 scan_chan_gap;
/** Scan block flag */
@ -2907,6 +2969,8 @@ struct _mlan_adapter {
t_u8 hw_2g_hecap_len;
/** 802.11ax 2.4G HE capability */
t_u8 hw_2g_he_cap[54];
/** 802.11ax 6G HE capability */
t_u16 hw_he_6g_cap;
/** max mgmt IE index in device */
t_u16 max_mgmt_ie_index;
/** Head of Rx data queue */
@ -3005,6 +3069,11 @@ struct _mlan_adapter {
t_u32 tx_power_table_a_size;
t_u8 tx_power_table_a_rows;
t_u8 tx_power_table_a_cols;
chan_freq_power_t *cfp_otp_6g;
t_u8 *tx_power_table_6g;
t_u32 tx_power_table_6g_size;
t_u8 tx_power_table_6g_rows;
t_u8 tx_power_table_6g_cols;
/**mlan adapter operations*/
mlan_adapter_operations ops;
/** TP accounting mode 1-enable 0-disable */
@ -3040,7 +3109,7 @@ struct _mlan_adapter {
/** LLDE enable/disable */
t_u8 llde_enabled;
/** LLDE modes 0 - default; 1 - carplay; 2 - gameplay; 3 - sound bar, 4
* – validation, 5- event driven */
* <EFBFBD> validation, 5- event driven */
t_u8 llde_mode;
/** high priority data packet type. 0: All traffic, 1: ping, 2: TCP ACK,
* 4: TCP Data, 8: UDP */
@ -3224,6 +3293,9 @@ mlan_status wlan_process_vdll_event(pmlan_private pmpriv, pmlan_buffer pevent);
/** Process event */
mlan_status wlan_process_event(pmlan_adapter pmadapter);
mlan_status wlan_process_dpd_cal_event(pmlan_private pmpriv,
pmlan_buffer pevent);
/** Prepare command */
mlan_status wlan_prepare_cmd(pmlan_private priv, t_u16 cmd_no, t_u16 cmd_action,
t_u32 cmd_oid, t_void *pioctl_buf,
@ -4060,6 +4132,17 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
/** Handler for 11D country info command response */
mlan_status wlan_ret_802_11d_domain_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *resp);
#ifdef UAP_SUPPORT
/** Command handler for 11D BCN country ie info */
mlan_status
wlan_cmd_802_11d_custom_bcn_country_ie_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd,
pmlan_ioctl_req pioctl_buf);
/** Handler for 11D BCN country ie info command response */
mlan_status
wlan_ret_802_11d_custom_bcn_country_ie_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *resp);
#endif
/** Convert channel to frequency */
t_u32 wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u16 band);
#ifdef STA_SUPPORT
@ -4087,6 +4170,8 @@ mlan_status wlan_11d_parse_domain_info(
mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
t_u8 *domain_tlv,
t_void *pioctl_buf);
mlan_status wlan_11d_bcn_country_ie_info(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
#endif
/** Configure 11D domain info command */
mlan_status wlan_11d_cfg_domain_info(pmlan_adapter pmadapter,
@ -4122,6 +4207,7 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
t_u8 *wlan_get_specific_ie(pmlan_private priv, t_u8 *ie_buf, t_u16 ie_len,
IEEEtypes_ElementId_e id, t_u8 ext_id);
t_u8 wlan_is_wmm_ie_present(pmlan_adapter pmadapter, t_u8 *pbuf, t_u16 buf_len);
t_void wlan_free_rnr_coloc_ap(mlan_adapter *pmadapter);
/** Ethernet II header */
typedef struct {
/** Ethernet II header destination address */
@ -4572,6 +4658,8 @@ mlan_status wlan_misc_ioctl_get_tsf(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
void wlan_add_fw_cfp_tables(pmlan_private pmpriv, t_u8 *buf, t_u16 buf_left);
void wlan_free_fw_cfp_tables(mlan_adapter *pmadapter);
void wlan_add_fw_6g_cfp_tables(pmlan_private pmpriv, t_u8 *buf, t_u16 buf_left);
void wlan_free_fw_6g_cfp_tables(mlan_adapter *pmadapter);
mlan_status wlan_misc_chan_reg_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_region_power_cfg(pmlan_adapter pmadapter,
@ -4683,6 +4771,12 @@ mlan_status wlan_misc_ioctl_country_code(pmlan_adapter pmadapter,
/** Get custom Fw data */
mlan_status wlan_get_custom_fw_data(pmlan_adapter pmadapter, t_u8 *pdata);
#ifdef PCIE
mlan_status wlan_pcie_reattach_pmbuf(mlan_adapter *pmadapter, t_u32 rd_index,
mlan_buffer **pmbuf);
mlan_status wlan_pcie_rx_ring_move_rdwrptr(mlan_adapter *pmadapter,
t_u32 rd_index, t_u8 update_action);
#endif
/**
* @brief RA based queueing

View file

@ -12,7 +12,7 @@
* - ENABLE_MEAS
*
*
* Copyright 2008-2021 NXP
* Copyright 2008-2021,2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -251,7 +251,7 @@ static int wlan_meas_cmd_request(mlan_private *pmpriv,
const void *pinfo_buf)
{
const HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req =
(HostCmd_DS_MEASUREMENT_REQUEST *)pinfo_buf;
(const HostCmd_DS_MEASUREMENT_REQUEST *)pinfo_buf;
ENTER();

View file

@ -274,7 +274,10 @@ static mlan_status wlan_custom_ioctl_auto_delete(pmlan_private pmpriv,
pmpriv->mgmt_ie[index].ie_buffer,
cnt, MAX_IE_SIZE);
if (pmpriv->mgmt_ie[index].ie_length >
(cnt + del_len))
(cnt + del_len)) {
// coverity[cert_arr30_c_violation:
// SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(
pmpriv->adapter, &ie[cnt],
&pmpriv->mgmt_ie[index].ie_buffer
@ -284,6 +287,7 @@ static mlan_status wlan_custom_ioctl_auto_delete(pmlan_private pmpriv,
.ie_length -
(cnt + del_len)),
MAX_IE_SIZE - cnt);
}
memset(pmpriv->adapter,
&pmpriv->mgmt_ie[index].ie_buffer, 0,
sizeof(pmpriv->mgmt_ie[index].ie_buffer));
@ -819,10 +823,10 @@ t_void wlan_wakeup_card_timeout_func(void *function_context)
ENTER();
PRINTM(MERROR, "%s: ps_state=%d\n", __FUNCTION__, pmadapter->ps_state);
PRINTM(MCMND, "%s: ps_state=%d\n", __FUNCTION__, pmadapter->ps_state);
if (pmadapter->ps_state != PS_STATE_AWAKE) {
PRINTM_NETINTF(MERROR, pmpriv);
PRINTM(MERROR, "Wakeup card timeout(%d)!\n",
PRINTM_NETINTF(MCMND, pmpriv);
PRINTM(MCMND, "Wakeup card timeout(%d)!\n",
pmadapter->pm_wakeup_timeout);
pmadapter->pm_wakeup_timeout++;
pmadapter->pm_wakeup_flag = MTRUE;
@ -1183,14 +1187,16 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
t_u8 *tmp_buf = MNULL;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u32 mem_flags = MLAN_MEM_DEF | MLAN_MEM_DMA;
t_s32 offset = 0;
ENTER();
#ifdef SDIO
/* make sure that the data length is at least SDIO block size */
if (IS_SD(pmadapter->card_type))
data_len = (data_len + MLAN_SDIO_BLOCK_SIZE - 1) /
MLAN_SDIO_BLOCK_SIZE * MLAN_SDIO_BLOCK_SIZE;
data_len = (data_len + pmadapter->pcard_sd->sdio_blk_size - 1) /
pmadapter->pcard_sd->sdio_blk_size *
pmadapter->pcard_sd->sdio_blk_size;
#endif
/* head_room is not implemented for malloc mlan buffer */
@ -1218,7 +1224,7 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
(t_u8 *)pmbuf + sizeof(mlan_buffer), DMA_ALIGNMENT);
pmbuf->data_offset = 0;
pmbuf->data_len = data_len;
pmbuf->flags |= MLAN_BUF_FLAG_MALLOC_BUF;
pmbuf->flags = MLAN_BUF_FLAG_MALLOC_BUF;
} else if (malloc_flag & MOAL_ALLOC_MLAN_BUFFER) {
/* use moal_alloc_mlan_buffer, head_room supported */
ret = pcb->moal_alloc_mlan_buffer(
@ -1231,8 +1237,8 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
pmbuf->data_offset = head_room;
tmp_buf = (t_u8 *)ALIGN_ADDR(pmbuf->pbuf + pmbuf->data_offset,
DMA_ALIGNMENT);
pmbuf->data_offset +=
(t_u32)(tmp_buf - (pmbuf->pbuf + pmbuf->data_offset));
offset = tmp_buf - (pmbuf->pbuf + pmbuf->data_offset);
pmbuf->data_offset += (t_u32)offset;
pmbuf->data_len = data_len;
pmbuf->flags = 0;
}
@ -3380,6 +3386,8 @@ mlan_status wlan_process_802dot11_mgmt_pkt(mlan_private *priv, t_u8 *payload,
t_u8 unicast = 0;
t_u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
IEEE80211_MGMT *mgmt = MNULL;
t_u8 band_config = (prx_pd->rx_info & 0xF);
t_u8 chan_num = (prx_pd->rx_info & RXPD_CHAN_MASK) >> 5;
t_u8 category = 0;
t_u8 action_code = 0;
#ifdef UAP_SUPPORT
@ -3644,9 +3652,9 @@ mlan_status wlan_process_802dot11_mgmt_pkt(mlan_private *priv, t_u8 *payload,
} else {
pevent->event_id = MLAN_EVENT_ID_DRV_MGMT_FRAME;
pevent->event_len = payload_len + sizeof(pevent->event_id);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
(t_u8 *)&pevent->event_id, sizeof(pevent->event_id),
pevent->event_len);
pevent->event_buf[0] = band_config;
pevent->event_buf[1] = chan_num;
// coverity[cert_arr30_c_violation: SUPPRESS]
memcpy_ext(
pmadapter,
(t_u8 *)(pevent->event_buf + sizeof(pevent->event_id)),
@ -3711,7 +3719,8 @@ t_u32 wlan_is_ext_capa_support(mlan_private *pmpriv)
ISSUPP_EXTCAP_INTERWORKING(pmpriv->ext_cap) ||
ISSUPP_EXTCAP_BSS_TRANSITION(pmpriv->ext_cap) ||
ISSUPP_EXTCAP_QOS_MAP(pmpriv->ext_cap) ||
ISSUPP_EXTCAP_OPERMODENTF(pmpriv->ext_cap)) {
ISSUPP_EXTCAP_OPERMODENTF(pmpriv->ext_cap) ||
ISSUPP_EXTCAP_FILS(pmpriv->ext_cap)) {
LEAVE();
return MTRUE;
} else {
@ -4040,11 +4049,14 @@ static void wlan_check_sta_vendor_ies(pmlan_adapter pmadapter,
}
if ((found_existing_oui == 0) &&
(sta_ptr->vendor_oui_count < MAX_VENDOR_OUI_NUM)) {
// add oui in list, sta_ptr->vendor_oui_count
// does not exceed MAX_VENDOR_OUI_NUM hence
// sta_ptr->vendor_oui buffer size does not
// exceed (MAX_VENDOR_OUI_NUM * VENDOR_OUI_LEN)
/* add oui in list, sta_ptr->vendor_oui_count
* does not exceed MAX_VENDOR_OUI_NUM hence
* sta_ptr->vendor_oui buffer size does not
* exceed (MAX_VENDOR_OUI_NUM * VENDOR_OUI_LEN)
*/
// coverity[overrun-buffer-arg: SUPPRESS]
// coverity[cert_arr30_c_violation: SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter,
(t_u8 *)&sta_ptr->vendor_oui
[sta_ptr->vendor_oui_count *
@ -4147,6 +4159,7 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
t_u8 *rate = MNULL;
t_u8 b_only = MFALSE;
#endif
IEEEtypes_HE6GCap_t *phe_6g_cap = MNULL;
t_u8 maxIPhoneEntries = MAX_IPHONE_FILTER_ENTRIES;
int tlv_buf_left = pevent->data_len - ASSOC_EVENT_FIX_SIZE;
@ -4288,6 +4301,31 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
PRINTM(MCMND,
"STA doesn't support 11ax\n");
}
if (sta_ptr->is_11ax_enabled) {
phe_6g_cap = (IEEEtypes_HE6GCap_t *)
wlan_get_specific_ie(
priv, assoc_req_ie,
ie_len, EXTENSION,
HE_6G_CAPABILITY);
if (phe_6g_cap) {
PRINTM(MCMND,
"STA supports 116e\n");
if (GET_6G_BAND_CAP_MAXMPDULEN(
phe_6g_cap->capa) ==
2)
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_12K;
else if (GET_6G_BAND_CAP_MAXMPDULEN(
phe_6g_cap
->capa) ==
1)
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_8K;
else
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_4K;
}
}
#ifdef UAP_SUPPORT
/* Note: iphone6 does not have ERP_INFO */
rate = wlan_get_specific_ie(priv, assoc_req_ie,
@ -4297,7 +4335,9 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
b_only = wlan_check_ie_11b_support_rates(
(pIEEEtypes_Generic_t)rate);
if (sta_ptr->is_11ax_enabled) {
if (priv->uap_channel <= 14)
if (phe_6g_cap) {
sta_ptr->bandmode = BAND_6G;
} else if (priv->uap_channel <= 14)
sta_ptr->bandmode = BAND_GAX;
else
sta_ptr->bandmode = BAND_AAX;
@ -4435,6 +4475,12 @@ t_u8 *wlan_get_specific_ie(pmlan_private priv, t_u8 *ie_buf, t_u16 ie_len,
ie_ptr = pcurrent_ptr;
break;
}
/*In case of 11AI, Assoc Req/Reassoc Req contains encrypted
TLV's after FILS_SESSION. To avoid InterpretIE: error skipping
TLV's after FILS_SESSION*/
if (FILS_SESSION == element_id) {
break;
}
pcurrent_ptr += element_len + 2;
/* Need to account for IE ID and IE Len */
bytes_left -= (element_len + 2);
@ -4646,11 +4692,24 @@ mlan_status wlan_radio_ioctl_ant_cfg(pmlan_adapter pmadapter,
0xFF00)
<< 8);
}
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x >rx_antenna=0x%x\n",
pmadapter->user_htstream,
ant_cfg->tx_antenna,
ant_cfg->rx_antenna);
if ((IS_CARDAW693(pmadapter->card_type)) ||
(IS_CARDIW624(pmadapter->card_type))) {
ant_cfg->tx_antenna_6g &= 0x03;
ant_cfg->rx_antenna_6g &= 0x03;
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x, tx_antenna_6g=0x%x >rx_antenna=0x%x, rx_antenna_6g=0x%x\n",
pmadapter->user_htstream,
ant_cfg->tx_antenna,
ant_cfg->tx_antenna_6g,
ant_cfg->rx_antenna,
ant_cfg->rx_antenna_6g);
} else
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x >rx_antenna=0x%x\n",
pmadapter->user_htstream,
ant_cfg->tx_antenna,
ant_cfg->rx_antenna);
} else {
#endif
@ -4667,6 +4726,8 @@ mlan_status wlan_radio_ioctl_ant_cfg(pmlan_adapter pmadapter,
(bitcount(ant_cfg->tx_antenna & 0x00FF) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg->tx_antenna & 0xFF00) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg->tx_antenna_6g & 0xFF) >
pmadapter->number_of_antenna))) {
PRINTM(MERROR,
"Invalid TX antenna setting: 0x%x\n",
@ -4681,6 +4742,8 @@ mlan_status wlan_radio_ioctl_ant_cfg(pmlan_adapter pmadapter,
if (bitcount(ant_cfg->rx_antenna & 0x00FF) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg->rx_antenna & 0xFF00) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg->rx_antenna_6g & 0xFF) >
pmadapter->number_of_antenna) {
PRINTM(MERROR,
"Invalid RX antenna setting: 0x%x\n",
@ -4752,6 +4815,8 @@ mlan_status wlan_handle_antcfg(mlan_private *pmpriv, t_u32 init_antcfg)
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDAW693(pmadapter->card_type)) {
ant_cfg.tx_antenna = ant_cfg.rx_antenna = init_antcfg;
ant_cfg.tx_antenna_6g = init_antcfg >> 16;
ant_cfg.rx_antenna_6g = init_antcfg >> 16;
} else {
ant_cfg.tx_antenna = (init_antcfg & 0x0030) >> 4;
ant_cfg.rx_antenna = init_antcfg & 0x0003;
@ -4771,6 +4836,12 @@ mlan_status wlan_handle_antcfg(mlan_private *pmpriv, t_u32 init_antcfg)
IS_CARDIW624(pmadapter->card_type)) {
ant_cfg.tx_antenna &= 0x0303;
ant_cfg.rx_antenna &= 0x0303;
/* AW693 MAC2 supports only 2G 1x1. */
if (IS_CARDAW693(pmadapter->card_type) &&
pmadapter->second_mac) {
ant_cfg.tx_antenna &= 0x1;
ant_cfg.rx_antenna &= 0x1;
}
/** 2G antcfg TX */
if (ant_cfg.tx_antenna & 0x00FF) {
pmadapter->user_htstream &= ~0xF0;
@ -4798,10 +4869,28 @@ mlan_status wlan_handle_antcfg(mlan_private *pmpriv, t_u32 init_antcfg)
(bitcount(ant_cfg.rx_antenna & 0xFF00)
<< 8);
}
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x >rx_antenna=0x%x\n",
pmadapter->user_htstream, ant_cfg.tx_antenna,
ant_cfg.rx_antenna);
if ((IS_CARDAW693(pmadapter->card_type)) ||
(IS_CARDIW624(pmadapter->card_type))) {
/* AW693 MAC2 supports only 2G 1x1. */
if (IS_CARDAW693(pmadapter->card_type) &&
pmadapter->second_mac) {
ant_cfg.tx_antenna_6g = 0;
ant_cfg.rx_antenna_6g = 0;
}
ant_cfg.tx_antenna_6g &= 0x03;
ant_cfg.rx_antenna_6g &= 0x03;
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x, tx_antenna_6g=0x%x >rx_antenna=0x%x, rx_antenna_6g=0x%x\n",
pmadapter->user_htstream,
ant_cfg.tx_antenna,
ant_cfg.tx_antenna_6g,
ant_cfg.rx_antenna,
ant_cfg.rx_antenna_6g);
} else
PRINTM(MCMND,
"user_htstream=0x%x, tx_antenna=0x%x >rx_antenna=0x%x\n",
pmadapter->user_htstream,
ant_cfg.tx_antenna, ant_cfg.rx_antenna);
} else {
#endif
ant_cfg.tx_antenna &= 0x0003;
@ -4816,6 +4905,8 @@ mlan_status wlan_handle_antcfg(mlan_private *pmpriv, t_u32 init_antcfg)
bitcount(ant_cfg.tx_antenna & 0x00FF) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg.tx_antenna & 0xFF00) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg.tx_antenna_6g & 0xFF) >
pmadapter->number_of_antenna) {
PRINTM(MERROR, "Invalid TX antenna setting: 0x%x\n",
ant_cfg.tx_antenna);
@ -4825,6 +4916,8 @@ mlan_status wlan_handle_antcfg(mlan_private *pmpriv, t_u32 init_antcfg)
if (bitcount(ant_cfg.rx_antenna & 0x00FF) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg.rx_antenna & 0xFF00) >
pmadapter->number_of_antenna ||
bitcount(ant_cfg.rx_antenna_6g & 0xFF) >
pmadapter->number_of_antenna) {
PRINTM(MERROR,
"Invalid RX antenna setting: 0x%x\n",
@ -6468,12 +6561,12 @@ done:
mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
pmlan_adapter pmadapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_status ret = MLAN_STATUS_FAILURE;
pmlan_callbacks pcb;
mef_cfg_data mef;
mef_entry_t *pentry = MNULL;
mef_entry *pmef;
t_u16 entry_num = 0;
t_s32 entry_num = 0;
ENTER();
@ -6482,11 +6575,23 @@ mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
/** check how many entries in adapter*/
pmef = &pmadapter->entry_cfg;
entry_num += pmef->enable_autoarp_entry;
entry_num += pmef->num_wowlan_entry;
entry_num += pmef->num_ipv6_ns_offload;
if (!wlan_secure_add((t_void *)&entry_num, pmef->enable_autoarp_entry,
(t_void *)&entry_num, TYPE_SINT32))
goto done;
if (!wlan_secure_add((t_void *)&entry_num,
pmef->num_wowlan_entry +
pmef->num_ipv6_ns_offload +
pmef->num_mdns_entry,
(t_void *)&entry_num, TYPE_SINT32))
goto done;
if (!entry_num && !pmef->clear_mef_entry) {
PRINTM(MIOCTL, "No filter entries\n");
ret = MLAN_STATUS_SUCCESS;
goto done;
}
if (entry_num > MAX_NUM_ENTRIES) {
PRINTM(MERROR, "Too many entries\n");
goto done;
}
if (entry_num) {
@ -6495,7 +6600,6 @@ mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
MLAN_MEM_DEF, (t_u8 **)&mef.pentry);
if (ret != MLAN_STATUS_SUCCESS || mef.pentry == MNULL) {
PRINTM(MERROR, "Failed to allocate cmd data buffer\n");
ret = MLAN_STATUS_FAILURE;
goto err_handle;
}
}
@ -6518,10 +6622,15 @@ mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
pentry += pmef->num_wowlan_entry;
}
/** Copy IPv6 NS message offload entry */
if (pmef->num_ipv6_ns_offload)
if (pmef->num_ipv6_ns_offload) {
memcpy_ext(pmadapter, pentry, &pmef->entry[7],
sizeof(mef_entry_t), sizeof(mef_entry_t));
pentry += pmef->num_ipv6_ns_offload;
}
if (pmef->num_mdns_entry)
memcpy_ext(pmadapter, pentry, &pmef->entry[8],
sizeof(mef_entry_t), sizeof(mef_entry_t));
/** Set Entries to firmware*/
ret = wlan_set_mef_entry(pmpriv, pmadapter, &mef);
if (ret != MLAN_STATUS_SUCCESS)
@ -6571,6 +6680,13 @@ mlan_status wlan_misc_ioctl_mef_flt_cfg(pmlan_adapter pmadapter,
&mef_cfg->mef_entry, sizeof(mef_entry_t),
sizeof(mef_entry_t));
}
if (mef_cfg->mef_act_type == MEF_ACT_MDNS) {
pmef->num_mdns_entry = 1;
pmef->criteria |= mef_cfg->criteria;
memcpy_ext(pmadapter, &pmef->entry[8],
&mef_cfg->mef_entry, sizeof(mef_entry_t),
sizeof(mef_entry_t));
}
/** Set AUTO ARP Entry to adapter*/
if (mef_cfg->mef_act_type == MEF_ACT_AUTOARP) {
if (mef_cfg->op_code & MLAN_IPADDR_OP_AUTO_ARP_RESP) {
@ -6599,6 +6715,9 @@ mlan_status wlan_misc_ioctl_mef_flt_cfg(pmlan_adapter pmadapter,
sizeof(mef_entry_t));
memset(pmadapter, &pmef->entry[7], 0,
sizeof(mef_entry_t));
pmef->num_mdns_entry = 0;
memset(pmadapter, &pmef->entry[8], 0,
sizeof(mef_entry_t));
if (MLAN_STATUS_SUCCESS !=
wlan_process_mef_cfg_cmd(
pmadapter
@ -6902,6 +7021,12 @@ mlan_status wlan_misc_chan_reg_cfg(pmlan_adapter pmadapter,
misc_cfg = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_GET) {
/* Send 6G CFP table request to the firmware */
if (IS_FW_SUPPORT_6G(pmadapter))
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_CHAN_REGION_CFG,
HostCmd_ACT_GET_6G_CFP_TBL, 0,
MNULL, MNULL);
cmd_action = HostCmd_ACT_GEN_GET;
if (misc_cfg &&
misc_cfg->param.custom_reg_domain.region.country_code[0] !=
@ -6925,7 +7050,10 @@ mlan_status wlan_misc_chan_reg_cfg(pmlan_adapter pmadapter,
cmd_action, 0, (t_void *)pioctl_req,
MNULL);
} else {
cmd_action = HostCmd_ACT_GEN_SET;
if (pioctl_req->action == MLAN_ACT_SET_6G_CFP_TBL)
cmd_action = HostCmd_ACT_SET_6G_CFP_TBL;
else
cmd_action = HostCmd_ACT_GEN_SET;
/* Send 2G/5G/6G CFP table to the firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_CHAN_REGION_CFG,
cmd_action, 0, (t_void *)pioctl_req,
@ -7364,6 +7492,7 @@ mlan_status wlan_radio_ioctl_band_cfg(pmlan_adapter pmadapter,
t_u32 infra_band = 0;
mlan_ds_radio_cfg *radio_cfg = MNULL;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
@ -7407,6 +7536,18 @@ mlan_status wlan_radio_ioctl_band_cfg(pmlan_adapter pmadapter,
#ifdef STA_SUPPORT
#endif
if (infra_band) {
/* update FW with user defined band config information
*/
ret = wlan_prepare_cmd(
pmpriv, HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET, User_band_config_i,
(t_void *)pioctl_req, &pmpriv->config_bands);
if (ret == MLAN_STATUS_SUCCESS)
return MLAN_STATUS_PENDING;
else
return MLAN_STATUS_FAILURE;
}
} else {
/* Infra Bands */
radio_cfg->param.band_cfg.config_bands = pmpriv->config_bands;
@ -8269,6 +8410,8 @@ mlan_status wlan_misc_ioctl_edmac_cfg(pmlan_adapter pmadapter,
misc->param.edmac_cfg.ed_offset_2g = 0x8;
misc->param.edmac_cfg.ed_ctrl_5g = 0x1;
misc->param.edmac_cfg.ed_offset_5g = 0x8;
misc->param.edmac_cfg.ed_ctrl_6g = 0x1;
misc->param.edmac_cfg.ed_offset_6g = 0x8;
misc->param.edmac_cfg.ed_bitmap_txq_lock = 0x1e00FF;
} else if (IS_CARD9177(pmadapter->card_type)) {
// from config/ed_mac_ctrl_V2_nw61x.conf
@ -8299,6 +8442,7 @@ mlan_status wlan_misc_ioctl_edmac_cfg(pmlan_adapter pmadapter,
} else {
misc->param.edmac_cfg.ed_ctrl_2g = 0x0;
misc->param.edmac_cfg.ed_ctrl_5g = 0x0;
misc->param.edmac_cfg.ed_ctrl_6g = 0x0;
}
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_EDMAC_CFG,

View file

@ -3,7 +3,7 @@
* @brief This file contains PCI-E specific code
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -668,6 +668,8 @@ static void wlan_get_adma_buf_flag_sliding(mlan_adapter *pmadapter,
t_u32 last_write_index_with_irq = invalid_index;
const t_u32 mid =
(wrindx - pcard->txbd_pending / 2) & (num_tx_buffs - 1);
/* the calling function validates bounds for num_tx_buffs and wrindx */
// coverity[integer_overflow:SUPPRESS]
const t_u32 mid_idx =
wlan_get_adma_desc_with_eop(pcard, num_tx_buffs, mid, wrindx);
@ -2075,7 +2077,8 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
pmadapter->pcard_pcie->reg->reg_txbd_rdptr,
&rdptr)) {
PRINTM(MERROR,
"SEND DATA COMP: failed to read REG_TXBD_RDPTR\n");
"func%d: SEND DATA COMP: failed to read REG_TXBD_RDPTR\n",
pmadapter->pcard_pcie->func_num);
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -2332,6 +2335,12 @@ static mlan_status wlan_pcie_send_adma_data(mlan_adapter *pmadapter,
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (num_tx_buffs == 0) {
PRINTM(MERROR, "Invalid number of tx buffers %d \n",
num_tx_buffs);
ret = MLAN_STATUS_FAILURE;
goto done;
}
PRINTM(MDATA,
"wlan_pcie_send_adma_data: len=%d flags=0x%x, pkt_size=%d\n",
pmbuf->data_len, flags, pkt_size);
@ -2542,6 +2551,12 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
goto done;
}
if (num_tx_buffs == 0) {
PRINTM(MERROR, "Invalid number of tx buffers %d \n",
num_tx_buffs);
ret = MLAN_STATUS_FAILURE;
goto done;
}
PRINTM(MINFO, "SEND DATA: <Rd: %#x, Wr: %#x>\n",
pmadapter->pcard_pcie->txbd_rdptr,
pmadapter->pcard_pcie->txbd_wrptr);
@ -2831,6 +2846,254 @@ static t_u8 wlan_is_rx_pending_full(mlan_adapter *pmadapter, t_u32 rdptr)
return MFALSE;
}
/**
* @brief This function updates allocated pmbuf to Rx BD
*
* @param pmadapter A pointer to mlan_adapter structure
* @param rd_index index of rx Ring
* @param pmbuf pmbuf to attach to rx Ring
*
*/
static void wlan_pcie_rx_ring_attach_buf(mlan_adapter *pmadapter,
t_u32 rd_index, mlan_buffer *pmbuf)
{
#if defined(PCIE8997) || defined(PCIE8897)
mlan_pcie_data_buf *prxbd_buf;
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
defined(PCIEIW624)
adma_dual_desc_buf *padma_bd_buf;
#endif
#if defined(PCIE8997) || defined(PCIE8897)
if (!pmadapter->pcard_pcie->reg->use_adma) {
prxbd_buf = (mlan_pcie_data_buf *)
pmadapter->pcard_pcie->rxbd_ring[rd_index];
if (pmbuf) {
prxbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
prxbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
prxbd_buf->flags = wlan_cpu_to_le16(MLAN_BD_FLAG_SOP |
MLAN_BD_FLAG_EOP);
prxbd_buf->offset = 0;
prxbd_buf->frag_len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
}
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
defined(PCIEIW624)
if (pmadapter->pcard_pcie->reg->use_adma) {
padma_bd_buf =
(adma_dual_desc_buf *)
pmadapter->pcard_pcie->rxbd_ring[rd_index];
if (pmbuf) {
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(pmbuf->data_len);
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
}
}
#endif
}
/**
* @brief This function updates Read, Write ptr based on update_action.
*
* @param pmadapter A pointer to mlan_adapter structure
* @param rd_index rx rd_index
* @param update_action RX_RD_UPDATE, RX_WR_UPDATE
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE;
*/
mlan_status wlan_pcie_rx_ring_move_rdwrptr(mlan_adapter *pmadapter,
t_u32 rd_index, t_u8 update_action)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u32 txbd_val = 0;
#if defined(PCIE8997) || defined(PCIE8897)
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
t_u32 txrx_rw_ptr_rollover_ind =
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
#endif
PRINTM(MINFO, "wlan_pcie_rx_ring_move_rdwrptr %d", update_action);
#if defined(PCIE8997) || defined(PCIE8897)
if (!pmadapter->pcard_pcie->reg->use_adma) {
if (update_action & RX_RD_UPDATE) {
/* update rxbd's rdptrs */
if ((++pmadapter->pcard_pcie->rxbd_rdptr &
txrx_rw_ptr_mask) ==
pmadapter->pcard_pcie->txrx_bd_size) {
pmadapter->pcard_pcie->rxbd_rdptr =
((pmadapter->pcard_pcie->rxbd_rdptr &
txrx_rw_ptr_rollover_ind) ^
txrx_rw_ptr_rollover_ind);
}
}
pcb->moal_spin_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_pcie_lock);
if (update_action & RX_WR_UPDATE) {
/* update rxbd's wrptrs */
if ((++pmadapter->pcard_pcie->rxbd_wrptr &
txrx_rw_ptr_mask) ==
pmadapter->pcard_pcie->txrx_bd_size) {
pmadapter->pcard_pcie->rxbd_wrptr =
((pmadapter->pcard_pcie->rxbd_wrptr &
txrx_rw_ptr_rollover_ind) ^
txrx_rw_ptr_rollover_ind);
}
}
txbd_val = pmadapter->pcard_pcie->txbd_wrptr &
pmadapter->pcard_pcie->reg->txrx_rw_ptr_wrap_mask;
txbd_val = txbd_val << TXBD_RW_PTR_START;
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
defined(PCIEIW624)
if (pmadapter->pcard_pcie->reg->use_adma) {
if (update_action & RX_RD_UPDATE) {
pmadapter->pcard_pcie->rxbd_rdptr++;
pmadapter->pcard_pcie->rxbd_rdptr &=
ADMA_RW_PTR_WRAP_MASK;
}
if (update_action & RX_WR_UPDATE) {
pmadapter->pcard_pcie->rxbd_wrptr++;
pmadapter->pcard_pcie->rxbd_wrptr &=
ADMA_RW_PTR_WRAP_MASK;
}
}
#endif
PRINTM(MINFO, "RECV DATA: Updated <Wr: %#x, Rd: %#x>\n",
pmadapter->pcard_pcie->rxbd_wrptr,
pmadapter->pcard_pcie->rxbd_rdptr);
/* Write the RX ring write pointer in to REG_RXBD_WRPTR */
ret = pcb->moal_write_reg(pmadapter->pmoal_handle,
pmadapter->pcard_pcie->reg->reg_rxbd_wrptr,
pmadapter->pcard_pcie->rxbd_wrptr | txbd_val);
#if defined(PCIE8997) || defined(PCIE8897)
if (!pmadapter->pcard_pcie->reg->use_adma) {
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->pmlan_pcie_lock);
}
#endif
if (ret) {
PRINTM(MERROR, "RECV DATA: failed to write REG_RXBD_WRPTR\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function gets called from Rx Interrupt, update pmbuf and
* Read/write pointer.
*
* @param pmadapter A pointer to mlan_adapter structure
* @param rd_index rx rd_index
* @param pmbuf pointer to pmbuf
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE;
*/
static mlan_status wlan_pcie_reattach_handle(mlan_adapter *pmadapter,
t_u32 rd_index,
mlan_buffer **pmbuf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u8 update_rx_action = (RX_RD_UPDATE | RX_WR_UPDATE);
mlan_private *priv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY);
/* Failing Rd-index(s), get re-filled under Main WQ */
/* Update the Current RD as Last Index for Re-fill work */
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
if (util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index, MNULL,
MNULL) != MLAN_INVALID_TXRX_INDEX_VAL) {
update_rx_action = RX_RD_UPDATE;
pmadapter->rx_refill_last_index = rd_index;
}
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
/* Default action is always RD+WR */
if (update_rx_action == (RX_RD_UPDATE | RX_WR_UPDATE)) {
ret = wlan_pcie_reattach_pmbuf(pmadapter, rd_index, pmbuf);
/* update failure RD index for Re-fill work (main WQ) */
if (ret != MLAN_STATUS_SUCCESS) {
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
update_rx_action = RX_RD_UPDATE;
util_scalar_write(pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index,
rd_index, MNULL, MNULL);
pmadapter->rx_refill_last_index = rd_index;
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
wlan_recv_event(priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
}
}
if ((MLAN_STATUS_SUCCESS !=
wlan_pcie_rx_ring_move_rdwrptr(pmadapter, rd_index,
update_rx_action))) {
ret = MLAN_STATUS_FAILURE;
}
return ret;
}
/**
* @brief This function allocates pmbuf for rx Ring..
*
* @param pmadapter A pointer to mlan_adapter structure
* @param rd_index rx rd_index
* @param pmbuf pointer to pmbuf to allocate DMA memory for Rx
* Ring.
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE;
*/
mlan_status wlan_pcie_reattach_pmbuf(mlan_adapter *pmadapter, t_u32 rd_index,
mlan_buffer **pmbuf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
/* Create new buffer and attach it to Rx Ring */
*pmbuf = wlan_alloc_mlan_buffer(pmadapter, MLAN_RX_DATA_BUF_SIZE,
MLAN_RX_HEADER_LEN,
MOAL_ALLOC_MLAN_BUFFER);
if (!(*pmbuf)) {
PRINTM(MERROR, "RECV DATA: Unable to allocate mlan_buffer %d\n",
rd_index);
ret = MLAN_STATUS_FAILURE;
pmadapter->pcard_pcie->rx_buf_list[rd_index] = MNULL;
return ret;
}
if (MLAN_STATUS_FAILURE ==
pcb->moal_map_memory(pmadapter->pmoal_handle,
(*pmbuf)->pbuf + (*pmbuf)->data_offset,
&(*pmbuf)->buf_pa, MLAN_RX_DATA_BUF_SIZE,
PCI_DMA_FROMDEVICE)) {
wlan_free_mlan_buffer(pmadapter, *pmbuf);
ret = MLAN_STATUS_FAILURE;
return ret;
}
PRINTM(MDAT_D, "RECV DATA: Attach new pmbuf %p at rx_ring[%d]\n",
*pmbuf, rd_index);
pmadapter->pcard_pcie->rx_buf_list[rd_index] = *pmbuf;
wlan_pcie_rx_ring_attach_buf(pmadapter, rd_index, *pmbuf);
return ret;
}
/**
* @brief This function handles received buffer ring and
* dispatches packets to upper
@ -2845,21 +3108,12 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u32 rdptr = 0;
t_u32 rd_index;
t_s32 size = 0;
mlan_buffer *pmbuf = MNULL;
t_u32 txbd_val = 0;
t_u16 rx_len = 0, rx_type;
const t_u32 num_rx_buffs = pmadapter->pcard_pcie->txrx_bd_size;
t_u32 reg_rxbd_rdptr = pmadapter->pcard_pcie->reg->reg_rxbd_rdptr;
#if defined(PCIE8997) || defined(PCIE8897)
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
t_u32 txrx_rw_ptr_rollover_ind =
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
mlan_pcie_data_buf *prxbd_buf;
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
defined(PCIEIW624)
adma_dual_desc_buf *padma_bd_buf;
#endif
t_u32 in_ts_sec = 0;
t_u32 in_ts_usec = 0;
@ -2868,7 +3122,9 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
/* Read the RX ring Read pointer set by firmware */
if (pcb->moal_read_reg(pmadapter->pmoal_handle, reg_rxbd_rdptr,
&rdptr)) {
PRINTM(MERROR, "RECV DATA: failed to read REG_RXBD_RDPTR\n");
PRINTM(MERROR,
"func%d: RECV DATA: failed to read REG_RXBD_RDPTR\n",
pmadapter->pcard_pcie->func_num);
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -2894,19 +3150,18 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
/* detach pmbuf (with data) from Rx Ring */
rd_index =
pmadapter->pcard_pcie->rxbd_rdptr & (num_rx_buffs - 1);
if (rd_index >
(t_u32)(pmadapter->pcard_pcie->txrx_bd_size - 1)) {
size = pmadapter->pcard_pcie->txrx_bd_size - 1;
if (rd_index > (t_u32)(size)) {
PRINTM(MERROR, "RECV DATA: Invalid Rx buffer index.\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
pmbuf = pmadapter->pcard_pcie->rx_buf_list[rd_index];
/* if in previous Interrupt, SKB allocation fails, then there
* will be no valid pmbuf in RxRing at the current index. we can
* attempt reattch a valid pmbuf at same index and continue Rx.
/* pmbuf should be always valid here.
* if not valid, it can be processed through Re-attach again.
*/
if (!pmbuf) {
PRINTM(MDAT_D, "RECV DATA: invalid pmbuf");
PRINTM(MERROR, "RECV DATA: invalid pmbuf");
goto reattach;
}
if (MLAN_STATUS_FAILURE ==
@ -2919,7 +3174,6 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
ret = MLAN_STATUS_FAILURE;
goto done;
}
pmadapter->pcard_pcie->rx_buf_list[rd_index] = MNULL;
PRINTM(MDAT_D,
"RECV DATA: Detach pmbuf %p at rx_ring[%d], pmadapter->rxbd_rdptr=0x%x\n",
pmbuf, rd_index, pmadapter->pcard_pcie->rxbd_rdptr);
@ -2936,7 +3190,8 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
pmadapter->pcard_pcie->rxbd_wrptr, rdptr, rx_len,
rx_type);
if (rx_len <= MLAN_RX_DATA_BUF_SIZE) {
if (rx_len && rx_len <= MLAN_RX_DATA_BUF_SIZE) {
pmadapter->pcard_pcie->rx_buf_list[rd_index] = MNULL;
/* send buffer to host (which will free it) */
pmbuf->data_len = rx_len - PCIE_INTF_HEADER_LEN;
pmbuf->data_offset += PCIE_INTF_HEADER_LEN;
@ -2980,121 +3235,26 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
pmadapter->data_received = MTRUE;
}
} else {
/* Queue the mlan_buffer again */
/* Queue the mlan_buffer again.
* should not hit this, unless a real bigger pkt than
* supported size. Invalid length could be due to
* corrupted buffer. better to free and re-attach a new
* pmbuf.
*/
PRINTM(MERROR, "PCIE: Drop invalid packet, length=%d",
rx_len);
wlan_free_mlan_buffer(pmadapter, pmbuf);
pmbuf = MNULL;
}
reattach:
if ((rx_len <= MLAN_RX_DATA_BUF_SIZE) || (!pmbuf)) {
/* Create new buffer and attach it to Rx Ring */
pmbuf = wlan_alloc_mlan_buffer(pmadapter,
MLAN_RX_DATA_BUF_SIZE,
MLAN_RX_HEADER_LEN,
MOAL_ALLOC_MLAN_BUFFER);
if (!pmbuf) {
PRINTM(MERROR,
"RECV DATA: Unable to allocate mlan_buffer\n");
ret = MLAN_STATUS_FAILURE;
goto done;
if (MLAN_STATUS_FAILURE ==
wlan_pcie_reattach_handle(pmadapter, rd_index,
&pmbuf)) {
PRINTM(MERROR, "RECV DATA: reattach failed\n");
}
}
if (MLAN_STATUS_FAILURE ==
pcb->moal_map_memory(pmadapter->pmoal_handle,
pmbuf->pbuf + pmbuf->data_offset,
&pmbuf->buf_pa, MLAN_RX_DATA_BUF_SIZE,
PCI_DMA_FROMDEVICE)) {
PRINTM(MERROR, "RECV DATA: moal_map_memory failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
PRINTM(MDAT_D,
"RECV DATA: Attach new pmbuf %p at rx_ring[%d]\n", pmbuf,
rd_index);
pmadapter->pcard_pcie->rx_buf_list[rd_index] = pmbuf;
#if defined(PCIE8997) || defined(PCIE8897)
if (!pmadapter->pcard_pcie->reg->use_adma) {
prxbd_buf = (mlan_pcie_data_buf *)pmadapter->pcard_pcie
->rxbd_ring[rd_index];
prxbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
prxbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
prxbd_buf->flags = wlan_cpu_to_le16(MLAN_BD_FLAG_SOP |
MLAN_BD_FLAG_EOP);
prxbd_buf->offset = 0;
prxbd_buf->frag_len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
/* update rxbd's rdptrs */
if ((++pmadapter->pcard_pcie->rxbd_rdptr &
txrx_rw_ptr_mask) ==
pmadapter->pcard_pcie->txrx_bd_size) {
pmadapter->pcard_pcie->rxbd_rdptr =
((pmadapter->pcard_pcie->rxbd_rdptr &
txrx_rw_ptr_rollover_ind) ^
txrx_rw_ptr_rollover_ind);
}
pcb->moal_spin_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_pcie_lock);
/* update rxbd's wrptrs */
if ((++pmadapter->pcard_pcie->rxbd_wrptr &
txrx_rw_ptr_mask) ==
pmadapter->pcard_pcie->txrx_bd_size) {
pmadapter->pcard_pcie->rxbd_wrptr =
((pmadapter->pcard_pcie->rxbd_wrptr &
txrx_rw_ptr_rollover_ind) ^
txrx_rw_ptr_rollover_ind);
}
txbd_val = pmadapter->pcard_pcie->txbd_wrptr &
pmadapter->pcard_pcie->reg
->txrx_rw_ptr_wrap_mask;
txbd_val = txbd_val << TXBD_RW_PTR_START;
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
defined(PCIEIW624)
if (pmadapter->pcard_pcie->reg->use_adma) {
padma_bd_buf =
(adma_dual_desc_buf *)pmadapter->pcard_pcie
->rxbd_ring[rd_index];
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(pmbuf->data_len);
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
pmadapter->pcard_pcie->rxbd_rdptr++;
pmadapter->pcard_pcie->rxbd_wrptr++;
pmadapter->pcard_pcie->rxbd_rdptr &=
ADMA_RW_PTR_WRAP_MASK;
pmadapter->pcard_pcie->rxbd_wrptr &=
ADMA_RW_PTR_WRAP_MASK;
}
#endif
PRINTM(MINFO, "RECV DATA: Updated <Wr: %#x, Rd: %#x>\n",
pmadapter->pcard_pcie->rxbd_wrptr, rdptr);
/* Write the RX ring write pointer in to REG_RXBD_WRPTR */
ret = pcb->moal_write_reg(
pmadapter->pmoal_handle,
pmadapter->pcard_pcie->reg->reg_rxbd_wrptr,
pmadapter->pcard_pcie->rxbd_wrptr | txbd_val);
#if defined(PCIE8997) || defined(PCIE8897)
if (!pmadapter->pcard_pcie->reg->use_adma) {
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->pmlan_pcie_lock);
}
#endif
if (ret) {
PRINTM(MERROR,
"RECV DATA: failed to write REG_RXBD_WRPTR\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
if ((pmadapter->ps_state == PS_STATE_SLEEP) ||
(pmadapter->ps_state == PS_STATE_SLEEP_CFM))
goto done;
@ -3103,7 +3263,8 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
if (pcb->moal_read_reg(pmadapter->pmoal_handle, reg_rxbd_rdptr,
&rdptr)) {
PRINTM(MERROR,
"RECV DATA: failed to read REG_RXBD_RDPTR\n");
"func%d: RECV DATA: failed to read REG_RXBD_RDPTR\n",
pmadapter->pcard_pcie->func_num);
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -3517,7 +3678,9 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
if (pcb->moal_read_reg(pmadapter->pmoal_handle,
pmadapter->pcard_pcie->reg->reg_evtbd_rdptr,
&rdptr)) {
PRINTM(MERROR, "EvtRdy: failed to read REG_EVTBD_RDPTR\n");
PRINTM(MERROR,
"func%d: EvtRdy: failed to read REG_EVTBD_RDPTR\n",
pmadapter->pcard_pcie->func_num);
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -3728,7 +3891,9 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
if (pcb->moal_read_reg(pmadapter->pmoal_handle,
pmadapter->pcard_pcie->reg->reg_evtbd_rdptr,
&rdptr)) {
PRINTM(MERROR, "EvtCom: failed to read REG_EVTBD_RDPTR\n");
PRINTM(MERROR,
"func%d: EvtCom: failed to read REG_EVTBD_RDPTR\n",
pmadapter->pcard_pcie->func_num);
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -3888,7 +4053,7 @@ static mlan_status wlan_pcie_prog_fw_w_helper(mlan_adapter *pmadapter,
mlan_fw_image *fw)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 *firmware = fw->pfw_buf;
const t_u8 *firmware = fw->pfw_buf;
t_u32 firmware_len = fw->fw_len;
t_u32 offset = 0;
mlan_buffer *pmbuf = MNULL;

View file

@ -4,7 +4,7 @@
* driver.
*
*
* Copyright 2008-2021 NXP
* Copyright 2008-2021, 2024 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -469,6 +469,12 @@ Change log:
/* check TX done ring on every X pushed packets */
#define TX_DONE_POLL_DISTANCE 16
/* Rx RD/WR ptr update action */
enum RX_UPDATE_ACTION {
RX_RD_UPDATE = MBIT(0),
RX_WR_UPDATE = MBIT(1),
};
extern mlan_adapter_operations mlan_pcie_ops;
/* Get pcie device from card type */

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
* @brief This file contains SDIO specific code
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -1005,12 +1005,12 @@ exit:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
t_u32 fw_len)
static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter,
const t_u8 *fw, t_u32 fw_len)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u8 *firmware = fw;
const t_u8 *firmware = fw;
t_u32 firmwarelen = fw_len;
t_u32 offset = 0;
t_u32 base0 = 0, base1 = 0;
@ -1204,8 +1204,9 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
txlen = firmwarelen - offset;
PRINTM(MINFO, ".\n");
tx_blocks = (txlen + MLAN_SDIO_BLOCK_SIZE_FW_DNLD - 1) /
MLAN_SDIO_BLOCK_SIZE_FW_DNLD;
tx_blocks = (txlen +
pmadapter->pcard_sd->sdio_blk_size - 1) /
pmadapter->pcard_sd->sdio_blk_size;
/* Copy payload to buffer */
if (firmware)
@ -1219,7 +1220,7 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
/* Send data */
memset(pmadapter, &mbuf, 0, sizeof(mlan_buffer));
mbuf.pbuf = (t_u8 *)fwbuf;
mbuf.data_len = tx_blocks * MLAN_SDIO_BLOCK_SIZE_FW_DNLD;
mbuf.data_len = tx_blocks * pmadapter->pcard_sd->sdio_blk_size;
ret = pcb->moal_write_data_sync(pmadapter->pmoal_handle, &mbuf,
pmadapter->pcard_sd->ioport, 0);
@ -2031,9 +2032,11 @@ static mlan_status wlan_host_to_card_mp_aggr(mlan_adapter *pmadapter,
(pmadapter->pcard_sd->last_mp_index *
mp_aggr_pkt_limit +
pmadapter->pcard_sd->mpa_tx.pkt_cnt) *
MLAN_SDIO_BLOCK_SIZE,
pmadapter->pcard_sd
->sdio_blk_size,
mbuf->pbuf + mbuf->data_offset,
MLAN_SDIO_BLOCK_SIZE, MLAN_SDIO_BLOCK_SIZE);
pmadapter->pcard_sd->sdio_blk_size,
pmadapter->pcard_sd->sdio_blk_size);
if (!pmadapter->pcard_sd->mpa_tx.buf) {
if (new_mode)
MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port);
@ -2099,9 +2102,10 @@ tx_curr_single:
pmadapter->pcard_sd->mpa_buf +
(pmadapter->pcard_sd->last_mp_index *
mp_aggr_pkt_limit *
MLAN_SDIO_BLOCK_SIZE),
pmadapter->pcard_sd->sdio_blk_size),
mbuf->pbuf + mbuf->data_offset,
MLAN_SDIO_BLOCK_SIZE, MLAN_SDIO_BLOCK_SIZE);
pmadapter->pcard_sd->sdio_blk_size,
pmadapter->pcard_sd->sdio_blk_size);
pmadapter->pcard_sd->last_mp_index++;
if (pmadapter->pcard_sd->last_mp_index >= SDIO_MP_DBG_NUM)
pmadapter->pcard_sd->last_mp_index = 0;
@ -2116,9 +2120,11 @@ tx_curr_single:
(pmadapter->pcard_sd->last_mp_index *
mp_aggr_pkt_limit +
pmadapter->pcard_sd->mpa_tx.pkt_cnt) *
MLAN_SDIO_BLOCK_SIZE,
pmadapter->pcard_sd
->sdio_blk_size,
mbuf->pbuf + mbuf->data_offset,
MLAN_SDIO_BLOCK_SIZE, MLAN_SDIO_BLOCK_SIZE);
pmadapter->pcard_sd->sdio_blk_size,
pmadapter->pcard_sd->sdio_blk_size);
if (!pmadapter->pcard_sd->mpa_tx.buf) {
if (new_mode)
MP_TX_AGGR_BUF_PUT_SG(pmadapter, mbuf, port);
@ -2589,16 +2595,31 @@ static mlan_status wlan_sdio_interrupt(t_u16 msg_id, pmlan_adapter pmadapter)
t_u32 sdio_ireg = 0;
t_u8 offset = 0;
t_u8 i = 0;
t_u32 host_int_status_reg_val = 0;
int max_mp_regs = pmadapter->pcard_sd->reg->max_mp_regs;
t_u8 host_int_status_reg =
pmadapter->pcard_sd->reg->host_int_status_reg;
ENTER();
if (pmadapter->ps_state == PS_STATE_SLEEP) {
pcb->moal_read_reg(pmadapter->pmoal_handle,
(t_u32)host_int_status_reg,
&host_int_status_reg_val);
if (!host_int_status_reg_val) {
/*Invalid interrupt as host_int_status_reg = 0*/
PRINTM(MINTR, "wlan_interrupt: sdio_ireg = 0x%x\n",
host_int_status_reg_val);
LEAVE();
return MLAN_STATUS_FAILURE;
}
}
while (max_mp_regs) {
memset(pmadapter, &mbuf, 0, sizeof(mlan_buffer));
mbuf.pbuf = pmadapter->pcard_sd->mp_regs + offset;
mbuf.data_len = MIN(max_mp_regs, MLAN_SDIO_BLOCK_SIZE);
mbuf.data_len =
MIN(max_mp_regs, pmadapter->pcard_sd->sdio_blk_size);
do {
ret = pcb->moal_read_data_sync(
pmadapter->pmoal_handle, &mbuf,
@ -2625,6 +2646,10 @@ static mlan_status wlan_sdio_interrupt(t_u16 msg_id, pmlan_adapter pmadapter)
}
if (i > 0)
wlan_dump_mp_registers(pmadapter);
if (host_int_status_reg_val) {
pmadapter->pcard_sd->mp_regs[host_int_status_reg] |=
host_int_status_reg_val;
}
DBG_HEXDUMP(MIF_D, "SDIO MP Registers", pmadapter->pcard_sd->mp_regs,
max_mp_regs);
@ -2774,16 +2799,18 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter,
rx_len |= (t_u16)pmadapter->pcard_sd
->mp_regs[cmd_rd_len_0];
PRINTM(MINFO, "RX: cmd port rx_len=%u\n", rx_len);
rx_blocks = (rx_len + MLAN_SDIO_BLOCK_SIZE - 1) /
MLAN_SDIO_BLOCK_SIZE;
rx_blocks = (rx_len +
pmadapter->pcard_sd->sdio_blk_size - 1) /
pmadapter->pcard_sd->sdio_blk_size;
if (rx_len <= SDIO_INTF_HEADER_LEN ||
(rx_blocks * MLAN_SDIO_BLOCK_SIZE) >
(rx_blocks * pmadapter->pcard_sd->sdio_blk_size) >
ALLOC_BUF_SIZE) {
PRINTM(MERROR, "invalid rx_len=%d\n", rx_len);
ret = MLAN_STATUS_FAILURE;
goto done;
}
rx_len = (t_u16)(rx_blocks * MLAN_SDIO_BLOCK_SIZE);
rx_len = (t_u16)(rx_blocks *
pmadapter->pcard_sd->sdio_blk_size);
pmbuf = wlan_alloc_mlan_buffer(pmadapter, rx_len, 0,
MOAL_MALLOC_BUFFER);
if (pmbuf == MNULL) {
@ -2919,16 +2946,18 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter,
rx_len |=
(t_u16)pmadapter->pcard_sd->mp_regs[len_reg_l];
PRINTM(MINFO, "RX: port=%d rx_len=%u\n", port, rx_len);
rx_blocks = (rx_len + MLAN_SDIO_BLOCK_SIZE - 1) /
MLAN_SDIO_BLOCK_SIZE;
rx_blocks = (rx_len +
pmadapter->pcard_sd->sdio_blk_size - 1) /
pmadapter->pcard_sd->sdio_blk_size;
if (rx_len <= SDIO_INTF_HEADER_LEN ||
(rx_blocks * MLAN_SDIO_BLOCK_SIZE) >
(rx_blocks * pmadapter->pcard_sd->sdio_blk_size) >
pmadapter->pcard_sd->mpa_rx.buf_size) {
PRINTM(MERROR, "invalid rx_len=%d\n", rx_len);
ret = MLAN_STATUS_FAILURE;
goto done;
}
rx_len = (t_u16)(rx_blocks * MLAN_SDIO_BLOCK_SIZE);
rx_len = (t_u16)(rx_blocks *
pmadapter->pcard_sd->sdio_blk_size);
if (!new_mode && (port == CTRL_PORT))
pmbuf = wlan_alloc_mlan_buffer(
@ -3024,7 +3053,7 @@ mlan_status wlan_sdio_host_to_card(mlan_adapter *pmadapter, t_u8 type,
ENTER();
/* Allocate buffer and copy payload */
blksz = MLAN_SDIO_BLOCK_SIZE;
blksz = pmadapter->pcard_sd->sdio_blk_size;
buf_block_len = (pmbuf->data_len + blksz - 1) / blksz;
*(t_u16 *)&payload[0] = wlan_cpu_to_le16((t_u16)pmbuf->data_len);
*(t_u16 *)&payload[2] = wlan_cpu_to_le16(type);
@ -3117,7 +3146,7 @@ static mlan_status wlan_sdio_send_vdll(mlan_adapter *pmadapter,
t_u8 *payload = pmbuf->pbuf + pmbuf->data_offset;
t_u32 cmd53_port = 0;
ENTER();
blksz = MLAN_SDIO_BLOCK_SIZE;
blksz = pmadapter->pcard_sd->sdio_blk_size;
buf_block_len = (pmbuf->data_len + blksz - 1) / blksz;
*(t_u16 *)&payload[0] = wlan_cpu_to_le16((t_u16)pmbuf->data_len);
@ -3315,7 +3344,13 @@ mlan_status wlan_alloc_sdio_mpa_buffers(mlan_adapter *pmadapter,
pmadapter->pcard_sd->mpa_tx.buf = MNULL;
}
pmadapter->pcard_sd->mpa_tx.buf_size = mpa_tx_buf_size;
if (pmadapter->pcard_sd->max_blk_count)
pmadapter->pcard_sd->mpa_tx.buf_size =
MIN(mpa_tx_buf_size,
pmadapter->pcard_sd->max_blk_count *
pmadapter->pcard_sd->sdio_blk_size);
PRINTM(MMSG, "wlan: mpa_tx.buf_size=%d\n",
pmadapter->pcard_sd->mpa_tx.buf_size);
if ((pmadapter->pcard_sd->max_segs < mp_aggr_pkt_limit) ||
(pmadapter->pcard_sd->max_seg_size <
pmadapter->pcard_sd->max_sp_rx_size)) {
@ -3540,6 +3575,10 @@ static mlan_status wlan_pm_sdio_wakeup_timeout_recovery(pmlan_adapter pmadapter)
PRINTM(MERROR,
"Register (0x%x) read failed (%d) or FW in debug mode (0x%x), reset...",
fw_stuck_reg, ret, fw_stuck);
if (fw_stuck == FW_STUCK_CODE_VERSION_MISMATCH) {
PRINTM(MERROR,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
}
pmadapter->pm_wakeup_timeout = 0xff;
ret = MLAN_STATUS_FAILURE;
} else {

View file

@ -361,6 +361,8 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
ret = MLAN_STATUS_FAILURE;
goto error;
}
pmadapter->pcard_sd->max_blk_count = pmdevice->max_blk_count;
pmadapter->pcard_sd->sdio_blk_size = pmdevice->sdio_blk_size;
pmadapter->pcard_sd->max_segs = pmdevice->max_segs;
pmadapter->pcard_sd->max_seg_size = pmdevice->max_seg_size;
@ -476,6 +478,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg;
pmadapter->init_para.dfs_offload = pmdevice->dfs_offload;
pmadapter->init_para.disable_11h_tpc = pmdevice->disable_11h_tpc;
pmadapter->init_para.tpe_ie_ignore = pmdevice->tpe_ie_ignore;
pmadapter->priv_num = 0;
pmadapter->priv[0] = MNULL;
@ -493,6 +496,8 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
}
pmadapter->priv_num++;
// memset of pmadapter->priv[0] will not nullify pmadapter->pcard_pcie
// coverity[overwrite_var:SUPPRESS]
memset(pmadapter, pmadapter->priv[0], 0, sizeof(mlan_private));
pmadapter->priv[0]->adapter = pmadapter;
@ -534,6 +539,9 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
/* init function table */
for (j = 0; mlan_ops[j]; j++) {
if (mlan_ops[j]->bss_role == GET_BSS_ROLE(pmadapter->priv[0])) {
// memset of pmadapter->priv[0] will not nullify
// pmadapter->callbacks.moal_memcpy_ext
// coverity[cert_exp34_c_violation:SUPPRESS]
memcpy_ext(pmadapter, &pmadapter->priv[0]->ops,
mlan_ops[j], sizeof(mlan_operations),
sizeof(mlan_operations));
@ -541,6 +549,9 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
}
}
/** back up bss_attr table */
// memset of pmadapter->priv[0] will not nullify
// pmadapter->callbacks.moal_memcpy_ext
// coverity[cert_exp34_c_violation:SUPPRESS]
memcpy_ext(pmadapter, pmadapter->bss_attr, pmdevice->bss_attr,
sizeof(pmadapter->bss_attr), sizeof(pmadapter->bss_attr));
@ -1145,6 +1156,65 @@ exit_rx_proc:
return ret;
}
#ifdef PCIE
/**
* @brief Re-fill PMBUF at pending RDs of PCIE Rx Ring
* @param padapter A pointer to mlan_adapter structure
*
*/
static void mlan_refill_rx_ring(t_void *padapter)
{
mlan_adapter *pmadapter = (mlan_adapter *)padapter;
mlan_buffer *pmbuf;
t_u32 reattach_fail = 0;
/* Get 1st Failure RD index */
t_s32 refill_index =
util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
while (refill_index != MLAN_INVALID_TXRX_INDEX_VAL) {
if (MLAN_STATUS_SUCCESS ==
wlan_pcie_reattach_pmbuf(pmadapter, refill_index, &pmbuf)) {
reattach_fail = 0;
/* Update WR PTR after Reattach success */
wlan_pcie_rx_ring_move_rdwrptr(pmadapter, refill_index,
RX_WR_UPDATE);
/*Re-fill till the Last (current) RD-index*/
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
if (refill_index == pmadapter->rx_refill_last_index) {
util_scalar_write(
pmadapter->pmoal_handle,
&pmadapter->rx_refill_start_index,
MLAN_INVALID_TXRX_INDEX_VAL, MNULL,
MNULL);
refill_index = MLAN_INVALID_TXRX_INDEX_VAL;
} else {
if (refill_index ==
(pmadapter->pcard_pcie->txrx_bd_size - 1))
refill_index = 0;
else
refill_index = (refill_index + 1);
}
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_refill_start_index.plock);
} else {
/* need to exit, if we just loop here - in extreme OOM
* case need to free CPU for other works. re-fill work
* can continue on next main wq schedule.
*/
reattach_fail++;
if (reattach_fail > 1500)
return;
}
}
return;
}
#endif
/**
* @brief The main process
*
@ -1232,8 +1302,11 @@ process_start:
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
pmadapter->pm_wakeup_flag) {
pmadapter->pm_wakeup_flag = MFALSE;
#ifdef SDIO
if (IS_SD(pmadapter->card_type)) {
#if defined(SD9098) || defined(SD9177) || defined(SDAW693) || defined(SDIW610)
if (IS_SD9098(pmadapter->card_type) ||
IS_SD9177(pmadapter->card_type) ||
IS_SDAW693(pmadapter->card_type) ||
IS_SDIW610(pmadapter->card_type)) {
if (pmadapter->pm_wakeup_timeout == 2) {
if (!pmadapter->ops
.wakeup_timeout_recovery(
@ -1242,12 +1315,13 @@ process_start:
}
}
#endif
if (pmadapter->pm_wakeup_timeout > 2)
if (pmadapter->pm_wakeup_timeout > 2) {
PRINTM(MERROR, "Wakeup card timeout!\n");
wlan_recv_event(
wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
else {
} else {
pmadapter->ops.wakeup_card(pmadapter, MTRUE);
pmadapter->pm_wakeup_fw_try = MTRUE;
continue;
@ -1446,6 +1520,8 @@ process_start:
MNULL);
}
}
/* Re-fill pending RDs of RxRing*/
mlan_refill_rx_ring(pmadapter);
}
#endif
} while (MTRUE);
@ -1636,29 +1712,10 @@ mlan_status mlan_send_packet(t_void *padapter, pmlan_buffer pmbuf)
}
if (eth_type == MLAN_ETHER_PKT_TYPE_1905) {
t_u16 msg_type = 0;
if (pmbuf->data_offset >
UINT32_MAX - MLAN_ETHER_PKT_TYPE_OFFSET - 4)
return MLAN_STATUS_FAILURE;
msg_type = mlan_ntohs(
*(t_u16 *)&pmbuf
->pbuf[pmbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET + 4]);
if (msg_type == 0x0007 || /* CMDU_TYPE_AP_AUTOCONFIGURATION_SEARCH
*/
msg_type == 0x0008 || /* CMDU_TYPE_AP_AUTOCONFIGURATION_RESPONSE
*/
msg_type == 0x0009) { /* CMDU_TYPE_AP_AUTOCONFIGURATION_WSC
*/
pmbuf->priority = 7;
PRINTM_NETINTF(MMSG, pmpriv);
PRINTM(MMSG,
"wlan: Send 1905.1a pkt type: 0x%04x\n",
msg_type);
}
pmbuf->priority = 7;
PRINTM_NETINTF(MINFO, pmpriv);
PRINTM(MINFO, "wlan: Send 1905.1a pkt type: 0x%04x\n",
eth_type);
}
if (pmadapter->tp_state_on)

View file

@ -122,6 +122,10 @@ static mlan_status wlan_cmd_802_11_rssi_info_ext(pmlan_private pmpriv,
rssi_info_ext_cmd->ndata = 0;
rssi_info_ext_cmd->nbcn = 0;
if (!info) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (info->param.path_id) {
pos = (t_u8 *)rssi_info_ext_cmd->tlv_buf;
signal_info_tlv = (MrvlIEtypes_RSSI_EXT_t *)pos;
@ -165,8 +169,19 @@ static mlan_status wlan_cmd_802_11_snmp_mib(pmlan_private pmpriv,
if (cmd_action == HostCmd_ACT_GEN_GET) {
psnmp_mib->query_type = wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
psnmp_mib->buf_size = wlan_cpu_to_le16(MAX_SNMP_BUF_SIZE);
cmd->size += MAX_SNMP_BUF_SIZE;
if (cmd_oid == StopDeauth_i) {
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u8));
cmd->size += sizeof(t_u8);
} else {
psnmp_mib->buf_size =
wlan_cpu_to_le16(MAX_SNMP_BUF_SIZE);
cmd->size += MAX_SNMP_BUF_SIZE;
}
}
if (cmd_action == HostCmd_ACT_GEN_SET && !pdata_buf) {
LEAVE();
return MLAN_STATUS_SUCCESS;
}
switch (cmd_oid) {
@ -254,6 +269,30 @@ static mlan_status wlan_cmd_802_11_snmp_mib(pmlan_private pmpriv,
cmd->size += sizeof(t_u16);
}
break;
case Ignore_tpe_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)Ignore_tpe_i);
if (cmd_action == HostCmd_ACT_GEN_SET) {
psnmp_mib->query_type =
wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u16));
ul_temp = *(t_u32 *)pdata_buf;
*((t_u16 *)(psnmp_mib->value)) =
wlan_cpu_to_le16((t_u16)ul_temp);
cmd->size += sizeof(t_u16);
}
break;
case User_band_config_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)User_band_config_i);
if (cmd_action == HostCmd_ACT_GEN_SET) {
psnmp_mib->query_type =
wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u16));
ul_temp = *(t_u32 *)pdata_buf;
*((t_u16 *)(psnmp_mib->value)) =
wlan_cpu_to_le16((t_u16)ul_temp);
cmd->size += sizeof(t_u16);
}
break;
case WwsMode_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)WwsMode_i);
if (cmd_action == HostCmd_ACT_GEN_SET) {
@ -313,6 +352,16 @@ static mlan_status wlan_cmd_802_11_snmp_mib(pmlan_private pmpriv,
cmd->size += sizeof(t_u8);
}
break;
case StopDeauth_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)StopDeauth_i);
if (cmd_action == HostCmd_ACT_GEN_SET) {
psnmp_mib->query_type =
wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u8));
psnmp_mib->value[0] = *((t_u8 *)pdata_buf);
cmd->size += sizeof(t_u8);
}
break;
default:
break;
}
@ -701,6 +750,10 @@ static mlan_status wlan_cmd_tx_power_cfg(pmlan_private pmpriv,
switch (cmd_action) {
case HostCmd_ACT_GEN_SET:
ptxp = (HostCmd_DS_TXPWR_CFG *)pdata_buf;
if (!ptxp) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (ptxp && ptxp->mode) {
ppg_tlv = (MrvlTypes_Power_Group_t
*)((t_u8 *)pdata_buf +
@ -711,7 +764,7 @@ static mlan_status wlan_cmd_tx_power_cfg(pmlan_private pmpriv,
ppg_tlv->length);
ppg_tlv = (MrvlTypes_Power_Group_t
*)((t_u8 *)ptxp_cfg +
*)((t_u8 *)&cmd->params +
sizeof(HostCmd_DS_TXPWR_CFG));
cmd->size += wlan_cpu_to_le16(
sizeof(MrvlTypes_Power_Group_t) +
@ -768,6 +821,10 @@ static mlan_status wlan_cmd_802_11_rf_tx_power(pmlan_private pmpriv,
break;
case HostCmd_ACT_GEN_SET:
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
prtp->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
prtp->current_level = wlan_cpu_to_le16(*((t_s16 *)pdata_buf));
break;
@ -830,7 +887,7 @@ static mlan_status wlan_cmd_802_11_hs_cfg(pmlan_private pmpriv,
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_802_11_HS_CFG_ENH *phs_cfg = &cmd->params.opt_hs_cfg;
t_u16 hs_activate = MFALSE;
t_u8 *tlv = (t_u8 *)phs_cfg + sizeof(HostCmd_DS_802_11_HS_CFG_ENH);
t_u8 *tlv = (t_u8 *)&cmd->params + sizeof(HostCmd_DS_802_11_HS_CFG_ENH);
MrvlIEtypes_HsWakeHoldoff_t *holdoff_tlv = MNULL;
MrvlIEtypes_PsParamsInHs_t *psparam_tlv = MNULL;
MrvlIEtypes_WakeupSourceGPIO_t *gpio_tlv = MNULL;
@ -851,14 +908,13 @@ static mlan_status wlan_cmd_802_11_hs_cfg(pmlan_private pmpriv,
(pmadapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
PRINTM(MINFO, "Attach %d bytes ArpFilter to HSCfg cmd\n",
pmadapter->arp_filter_size);
memcpy_ext(pmpriv->adapter,
((t_u8 *)phs_cfg) +
sizeof(HostCmd_DS_802_11_HS_CFG_ENH),
pmadapter->arp_filter, pmadapter->arp_filter_size,
memcpy_ext(pmpriv->adapter, tlv, pmadapter->arp_filter,
pmadapter->arp_filter_size,
pmadapter->arp_filter_size);
cmd->size = pmadapter->arp_filter_size +
sizeof(HostCmd_DS_802_11_HS_CFG_ENH) + S_DS_GEN;
tlv = (t_u8 *)phs_cfg + sizeof(HostCmd_DS_802_11_HS_CFG_ENH) +
tlv = (t_u8 *)&cmd->params +
sizeof(HostCmd_DS_802_11_HS_CFG_ENH) +
pmadapter->arp_filter_size;
} else
cmd->size = S_DS_GEN + sizeof(HostCmd_DS_802_11_HS_CFG_ENH);
@ -1029,9 +1085,13 @@ static mlan_status wlan_cmd_802_11_sleep_period(pmlan_private pmpriv,
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SLEEP_PERIOD);
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_802_11_SLEEP_PERIOD) +
S_DS_GEN);
if (cmd_action == HostCmd_ACT_GEN_SET)
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
pcmd_sleep_pd->sleep_pd = wlan_cpu_to_le16(*(t_u16 *)pdata_buf);
}
pcmd_sleep_pd->action = wlan_cpu_to_le16(cmd_action);
LEAVE();
@ -1062,6 +1122,10 @@ static mlan_status wlan_cmd_802_11_sleep_params(pmlan_private pmpriv,
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_802_11_SLEEP_PARAMS) +
S_DS_GEN);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!psp) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
pcmd_sp->reserved = (t_u16)psp->reserved;
pcmd_sp->error = (t_u16)psp->error;
pcmd_sp->offset = (t_u16)psp->offset;
@ -1140,6 +1204,10 @@ static mlan_status wlan_cmd_802_11_deauthenticate(pmlan_private pmpriv,
cmd->command = wlan_cpu_to_le16(cmd_no);
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_802_11_DEAUTHENTICATE) +
S_DS_GEN);
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
/* Set AP MAC address */
memcpy_ext(pmpriv->adapter, pdeauth, (t_u8 *)pdata_buf,
@ -1526,6 +1594,10 @@ static mlan_status wlan_cmd_gtk_rekey_offload(pmlan_private pmpriv,
rekey->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!data) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
memcpy_ext(pmpriv->adapter, rekey->kek, data->kek, MLAN_KEK_LEN,
MLAN_KEK_LEN);
memcpy_ext(pmpriv->adapter, rekey->kck, data->kck, MLAN_KCK_LEN,
@ -1559,6 +1631,10 @@ static mlan_status wlan_cmd_eapol_pkt(pmlan_private pmpriv,
mlan_buffer *pmbuf = (mlan_buffer *)pdata_buf;
ENTER();
if (!pmbuf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
eapol_pkt->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
cmd->size = sizeof(HostCmd_DS_EAPOL_PKT) + S_DS_GEN;
cmd->command = wlan_cpu_to_le16(cmd->command);
@ -1673,6 +1749,10 @@ static mlan_status wlan_cmd_802_11_rf_channel(pmlan_private pmpriv,
if (cmd_action == HostCmd_ACT_GEN_SET) {
prf_chan->rf_type.bandcfg.chanBand = BAND_5GHZ;
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
prf_chan->rf_type.bandcfg.chanWidth =
pmpriv->adapter->chan_bandwidth;
prf_chan->current_channel =
@ -1710,6 +1790,11 @@ static mlan_status wlan_cmd_mgmt_ie_list(pmlan_private pmpriv,
cmd->result = 0;
pmgmt_ie_list->action = wlan_cpu_to_le16(cmd_action);
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cust_ie = (mlan_ds_misc_custom_ie *)pdata_buf;
pmgmt_ie_list->ds_mgmt_ie.type = wlan_cpu_to_le16(cust_ie->type);
pmgmt_ie_list->ds_mgmt_ie.len = wlan_cpu_to_le16(cust_ie->len);
@ -1778,6 +1863,11 @@ static mlan_status wlan_cmd_tdls_config(pmlan_private pmpriv,
cmd->size = sizeof(HostCmd_DS_TDLS_CONFIG) + S_DS_GEN;
cmd->result = 0;
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
tdls_config = (mlan_ds_misc_tdls_config *)pdata_buf;
ptdls_config_data->tdls_info.tdls_action =
wlan_cpu_to_le16(tdls_config->tdls_action);
@ -1974,12 +2064,16 @@ static mlan_status wlan_cmd_tdls_oper(pmlan_private pmpriv,
cmd->size = sizeof(HostCmd_DS_TDLS_OPER) + S_DS_GEN;
cmd->result = 0;
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
tdls_oper = (mlan_ds_misc_tdls_oper *)pdata_buf;
ptdls_oper->reason = 0;
memcpy_ext(pmpriv->adapter, ptdls_oper->peer_mac, tdls_oper->peer_mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
sta_ptr = wlan_get_station_entry(pmpriv, tdls_oper->peer_mac);
pos = (t_u8 *)ptdls_oper + sizeof(HostCmd_DS_TDLS_OPER);
pos = (t_u8 *)&cmd->params + sizeof(HostCmd_DS_TDLS_OPER);
switch (tdls_oper->tdls_action) {
case WLAN_TDLS_CREATE_LINK:
if (sta_ptr)
@ -2330,6 +2424,10 @@ static mlan_status wlan_cmd_sysclock_cfg(pmlan_private pmpriv,
ENTER();
if (!clk_cfg) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_ECL_SYSTEM_CLOCK_CONFIG);
cmd->size = wlan_cpu_to_le16(
sizeof(HostCmd_DS_ECL_SYSTEM_CLOCK_CONFIG) + S_DS_GEN);
@ -2384,6 +2482,11 @@ static mlan_status wlan_cmd_subscribe_event(pmlan_private pmpriv,
cmd_size = sizeof(HostCmd_DS_SUBSCRIBE_EVENT) + S_DS_GEN;
if (cmd_action == HostCmd_ACT_GEN_GET)
goto done;
if (!sub_evt) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
evt->action = wlan_cpu_to_le16(sub_evt->evt_action);
evt->event_bitmap = wlan_cpu_to_le16(sub_evt->evt_bitmap);
tlv = (t_u8 *)cmd + cmd_size;
@ -2560,6 +2663,11 @@ static mlan_status wlan_cmd_otp_user_data(pmlan_private pmpriv,
ENTER();
if (!user_data) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_OTP_READ_USER_DATA);
cmd_size = sizeof(HostCmd_DS_OTP_USER_DATA) + S_DS_GEN - 1;
@ -2602,6 +2710,10 @@ static mlan_status wlan_cmd_fw_auto_reconnect(pmlan_private pmpriv,
fw_auto_reconnect->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!fw_auto_reconn) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
fw_auto_reconnect->reconnect_counter =
fw_auto_reconn->fw_reconn_counter;
fw_auto_reconnect->reconnect_interval =
@ -2665,6 +2777,10 @@ wlan_cmd_packet_aggr_over_host_interface(pmlan_private pmpriv,
if (cmd_action == HostCmd_ACT_GEN_SET) {
usb_aggr_param_tlv->enable = 0;
if (!usb_aggr_ctrl) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (usb_aggr_ctrl->tx_aggr_ctrl.enable)
usb_aggr_param_tlv->enable |= MBIT(1);
usb_aggr_param_tlv->tx_aggr_align = wlan_cpu_to_le16(
@ -2713,6 +2829,10 @@ static mlan_status wlan_cmd_inactivity_timeout(HostCmd_DS_COMMAND *cmd,
cmd->command = wlan_cpu_to_le16(cmd->command);
cmd_inac_to->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!inac_to) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd_inac_to->timeout_unit =
wlan_cpu_to_le16((t_u16)inac_to->timeout_unit);
cmd_inac_to->unicast_timeout =
@ -2729,6 +2849,32 @@ static mlan_status wlan_cmd_inactivity_timeout(HostCmd_DS_COMMAND *cmd,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function find 6g secondary twenty channel offset
*
* @param channel 6g channel number
* @return 6g secondary twenty channel offset
*/
static t_u8 wlan_get_6g_second_channel_offset(int channel)
{
const struct center_freq_desc *freq_map = center_freq_idx_map_6g;
t_u8 sec_chan_offset = 0;
for (; freq_map != MNULL; freq_map++) {
if (!freq_map->pri_chan)
break;
if (channel == freq_map->pri_chan) {
if (channel < freq_map->ch_40)
sec_chan_offset = SEC_CHAN_ABOVE;
else
sec_chan_offset = SEC_CHAN_BELOW;
}
}
return sec_chan_offset;
}
/**
* @brief This function prepares network monitor command
*
@ -2744,7 +2890,6 @@ mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
mlan_ds_misc_net_monitor *net_mon;
HostCmd_DS_802_11_NET_MONITOR *cmd_net_mon = &cmd->params.net_mon;
ChanBandParamSet_t *pchan_band = MNULL;
t_u8 sec_chan_offset = 0;
t_u32 bw_offset = 0;
ENTER();
@ -2756,13 +2901,19 @@ mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
sizeof(ChanBandParamSet_t));
cmd->command = wlan_cpu_to_le16(cmd->command);
cmd_net_mon->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!net_mon) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (net_mon->enable_net_mon) {
cmd_net_mon->enable_net_mon =
wlan_cpu_to_le16((t_u16)NET_MON_MODE3);
cmd_net_mon->filter_flag =
wlan_cpu_to_le16((t_u16)net_mon->filter_flag);
}
if (net_mon->enable_net_mon && net_mon->channel) {
pchan_band =
&cmd_net_mon->monitor_chan.chan_band_param[0];
@ -2771,40 +2922,29 @@ mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
cmd_net_mon->monitor_chan.header.len =
wlan_cpu_to_le16(sizeof(ChanBandParamSet_t));
pchan_band->chan_number = (t_u8)net_mon->channel;
pchan_band->bandcfg.chanBand =
wlan_band_to_radio_type((t_u16)net_mon->band);
pchan_band->bandcfg.chanBand = (t_u8)net_mon->band;
if (net_mon->band & BAND_GN ||
net_mon->band & BAND_AN ||
net_mon->band & BAND_GAC ||
net_mon->band & BAND_AAC) {
bw_offset = net_mon->chan_bandwidth;
if (bw_offset == CHANNEL_BW_40MHZ_ABOVE) {
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_ABOVE;
pchan_band->bandcfg.chanWidth =
CHAN_BW_40MHZ;
} else if (bw_offset ==
CHANNEL_BW_40MHZ_BELOW) {
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_BELOW;
pchan_band->bandcfg.chanWidth =
CHAN_BW_40MHZ;
} else if (bw_offset == CHANNEL_BW_80MHZ) {
sec_chan_offset =
wlan_get_second_channel_offset(
pmpriv,
net_mon->channel);
if (sec_chan_offset == SEC_CHAN_ABOVE)
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_ABOVE;
else if (sec_chan_offset ==
SEC_CHAN_BELOW)
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_BELOW;
pchan_band->bandcfg.chanWidth =
CHAN_BW_80MHZ;
}
bw_offset = net_mon->chan_bandwidth;
if (bw_offset == CHANNEL_BW_40MHZ_ABOVE) {
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_ABOVE;
pchan_band->bandcfg.chanWidth = CHAN_BW_40MHZ;
} else if (bw_offset == CHANNEL_BW_40MHZ_BELOW) {
pchan_band->bandcfg.chan2Offset =
SEC_CHAN_BELOW;
pchan_band->bandcfg.chanWidth = CHAN_BW_40MHZ;
} else if (net_mon->band == BAND_5GHZ &&
bw_offset == CHANNEL_BW_80MHZ) {
pchan_band->bandcfg.chan2Offset =
wlan_get_second_channel_offset(
pmpriv, net_mon->channel);
pchan_band->bandcfg.chanWidth = CHAN_BW_80MHZ;
} else if (net_mon->band == BAND_6GHZ &&
bw_offset == CHANNEL_BW_80MHZ) {
pchan_band->bandcfg.chan2Offset =
wlan_get_6g_second_channel_offset(
net_mon->channel);
pchan_band->bandcfg.chanWidth = CHAN_BW_80MHZ;
}
}
}
@ -2833,6 +2973,10 @@ static mlan_status wlan_cmd_low_pwr_mode(pmlan_private pmpriv,
ENTER();
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->size = S_DS_GEN + sizeof(HostCmd_CONFIG_LOW_PWR_MODE);
enable = (t_u8 *)pdata_buf;
@ -2872,7 +3016,7 @@ static mlan_status wlan_cmd_dfs_repeater_cfg(pmlan_private pmpriv,
cmd->command = wlan_cpu_to_le16(cmd->command);
cmd_dfs_repeater->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET)
if (cmd_action == HostCmd_ACT_GEN_SET && dfs_repeater)
cmd_dfs_repeater->mode = wlan_cpu_to_le16(dfs_repeater->mode);
LEAVE();
@ -2901,6 +3045,10 @@ static mlan_status wlan_cmd_coalesce_config(pmlan_private pmpriv,
struct coalesce_receive_filt_rule *rule;
ENTER();
if (!cfg) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->size = (sizeof(HostCmd_DS_COALESCE_CONFIG) -
sizeof(struct coalesce_receive_filt_rule)) +
@ -2991,6 +3139,10 @@ mlan_status wlan_cmd_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
cfg_cmd->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!misc_cfg) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cfg_cmd->arb_mode = wlan_cpu_to_le32(misc_cfg->arb_mode);
if (misc_cfg->arb_mode == 3) {
#define DEF_ARB_TX_WIN 4
@ -3028,13 +3180,18 @@ static mlan_status wlan_cmd_ipv6_ra_offload(mlan_private *pmpriv,
(mlan_ds_misc_ipv6_ra_offload *)pdata_buf;
MrvlIEtypesHeader_t *ie = &ipv6_ra_cfg->ipv6_addr_param.Header;
t_u8 *pipv6addrs = ipv6_ra_cfg->ipv6_addr_param.ipv6_addrs;
t_u8 *psrcipv6addr = ipv6_ra_offload->ipv6_addrs;
t_u8 *psrcipv6addr = MNULL;
ENTER();
pcmd->command = wlan_cpu_to_le16(HostCmd_CMD_IPV6_RA_OFFLOAD_CFG);
ipv6_ra_cfg->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
if (!ipv6_ra_offload) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
psrcipv6addr = ipv6_ra_offload->ipv6_addrs;
ipv6_ra_cfg->enable = ipv6_ra_offload->enable;
ie->type = wlan_cpu_to_le16(TLV_TYPE_IPV6_RA_OFFLOAD);
ipv6_ra_cfg->ipv6_addr_count =
@ -3134,6 +3291,7 @@ static t_u16 mlan_prepare_roam_offload_tlv(pmlan_private pmpriv, t_u32 type,
MrvlIEtypes_RepeatCount_t *tlv_repeat = MNULL;
t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0}, *begin;
int i = 0;
t_s64 ret_len = 0;
ENTER();
@ -3354,8 +3512,10 @@ static t_u16 mlan_prepare_roam_offload_tlv(pmlan_private pmpriv, t_u32 type,
tlv_repeat->repeat_count = wlan_cpu_to_le16(roam->repeat_count);
pos += sizeof(MrvlIEtypes_RepeatCount_t);
}
ret_len = pos - begin;
LEAVE();
return ((t_u16)(pos - begin));
return ((t_u16)ret_len);
}
/**
* @brief This function sends enable/disable roam offload command to firmware.
@ -3371,7 +3531,7 @@ static mlan_status wlan_cmd_roam_offload(pmlan_private pmpriv,
{
HostCmd_DS_ROAM_OFFLOAD *roam_cmd = &cmd->params.roam_offload;
MrvlIEtypes_roam_aplist_t *aplist = MNULL;
t_u8 *pos = (t_u8 *)roam_cmd + sizeof(roam_cmd->action);
t_u8 *pos = (t_u8 *)&cmd->params + sizeof(roam_cmd->action);
mlan_ds_misc_roam_offload *roam = MNULL;
t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0};
t_u32 type = 0;
@ -3384,6 +3544,10 @@ static mlan_status wlan_cmd_roam_offload(pmlan_private pmpriv,
roam_cmd->action = wlan_cpu_to_le16(cmd_action);
roam = (mlan_ds_misc_roam_offload *)pdata_buf;
if (!roam) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (roam->config_mode) {
switch (roam->config_mode) {
@ -3511,6 +3675,10 @@ static mlan_status wlan_cmd_auto_tx(pmlan_private pmpriv,
switch (cmd_oid) {
case OID_CLOUD_KEEP_ALIVE:
misc_keep_alive = (mlan_ds_misc_keep_alive *)pdata_buf;
if (!misc_keep_alive) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
keep_alive_tlv = (MrvlIEtypes_Cloud_Keep_Alive_t *)pos;
keep_alive_tlv->header.type =
@ -3599,6 +3767,10 @@ static mlan_status wlan_cmd_auto_tx(pmlan_private pmpriv,
break;
case OID_CLOUD_KEEP_ALIVE_ACK:
misc_keep_alive_rx = (mlan_ds_misc_keep_alive_rx *)pdata_buf;
if (!misc_keep_alive_rx) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
keep_alive_Rx_tlv = (MrvlIEtypes_Cloud_Keep_Alive_Rx_t *)pos;
keep_alive_Rx_tlv->header.type =
wlan_cpu_to_le16(TLV_TYPE_CLOUD_KEEP_ALIVE_ACK);
@ -3686,6 +3858,10 @@ static mlan_status wlan_cmd_auth_assoc_timeout_cfg(pmlan_private pmpriv,
ENTER();
if (!auth_assoc_cfg) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_AUTH_ASSOC_TIMEOUT_CFG);
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_AUTH_ASSOC_TIMEOUT_CFG) +
S_DS_GEN);

View file

@ -443,7 +443,10 @@ static mlan_status wlan_ret_802_11_rssi_info_ext(pmlan_private pmpriv,
wlan_le16_to_cpu(signal_info_tlv->data_nf_avg);
tlv_left_len -= sizeof(MrvlIEtypes_RSSI_EXT_t);
signal_info_tlv++;
if (!wlan_secure_add(&signal_info_tlv,
sizeof(MrvlIEtypes_RSSI_EXT_t),
&signal_info_tlv, TYPE_PTR))
break;
tlv_num++;
if (tlv_num > MAX_PATH_NUM)
break;
@ -615,6 +618,13 @@ static mlan_status wlan_ret_802_11_snmp_mib(pmlan_private pmpriv,
PRINTM(MINFO, "SNMP_RESP: Auto NULL Pkt Period =%u\n",
ul_temp);
break;
case StopDeauth_i:
ul_temp = psmib->value[0];
if (mib)
mib->param.deauthctrl = ul_temp;
PRINTM(MINFO, "SNMP_RESP: STA Deauth Ctrl =%d\n",
ul_temp);
break;
default:
break;
}
@ -650,6 +660,19 @@ static mlan_status wlan_ret_802_11_snmp_mib(pmlan_private pmpriv,
PRINTM(MCMND, "SNMP_RESP: Dot11h_disable_tpc_i =%u\n",
ul_temp);
}
/* Update state for Tpe Ie Ignore */
if (oid == Ignore_tpe_i) {
/* Set tpe ie ignore to private */
ul_temp = wlan_le16_to_cpu(*((t_u16 *)(psmib->value)));
PRINTM(MCMND, "SNMP_RESP: Ignore_tpe_i = %u\n",
ul_temp);
}
}
if (oid == User_band_config_i) {
ul_temp = wlan_le16_to_cpu(*((t_u16 *)(psmib->value)));
PRINTM(MCMND, "SNMP_RESP: user defined bandcfg =0x%x\n",
ul_temp);
}
if (pioctl_buf) {
@ -761,6 +784,10 @@ static mlan_status wlan_ret_get_log(pmlan_private pmpriv,
wlan_le32_to_cpu(pget_log->gdma_abort_cnt);
pget_info->param.stats.g_reset_rx_mac_cnt =
wlan_le32_to_cpu(pget_log->g_reset_rx_mac_cnt);
pget_info->param.stats.currTemp =
wlan_le32_to_cpu(pget_log->currTemp);
pget_info->param.stats.TXpwrMethod =
wlan_le32_to_cpu(pget_log->TXpwrMethod);
pget_info->param.stats.SdmaStuckCnt =
wlan_le32_to_cpu(pget_log->SdmaStuckCnt);
// Ownership error counters
@ -921,7 +948,9 @@ static mlan_status wlan_get_power_level(pmlan_private pmpriv, void *pdata_buf)
length -= sizeof(Power_Group_t);
}
while (length > 0) {
pg++;
if (!wlan_secure_add(&pg, sizeof(Power_Group_t), &pg,
TYPE_PTR))
break;
if (max_power < pg->power_max)
max_power = pg->power_max;
if (min_power > pg->power_min)
@ -971,6 +1000,13 @@ static mlan_status wlan_ret_tx_power_cfg(pmlan_private pmpriv,
switch (action) {
case HostCmd_ACT_GEN_GET:
ppg_tlv->length = wlan_le16_to_cpu(ppg_tlv->length);
if (ppg_tlv->length >
(resp->size -
(sizeof(HostCmd_DS_TXPWR_CFG) +
sizeof(MrvlTypes_Power_Group_t) + S_DS_GEN))) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
// coverity[overrun-buffer-val:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
// coverity[cert_arr30_c_violation:SUPPRESS]
@ -2084,7 +2120,6 @@ mlan_status wlan_ret_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
HostCmd_DS_802_11_NET_MONITOR *cmd_net_mon =
(HostCmd_DS_802_11_NET_MONITOR *)&resp->params.net_mon;
ChanBandParamSet_t *pchan_band = MNULL;
t_u16 band_info = 0;
ENTER();
@ -2097,22 +2132,10 @@ mlan_status wlan_ret_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
wlan_le16_to_cpu(cmd_net_mon->filter_flag);
pchan_band = &cmd_net_mon->monitor_chan.chan_band_param[0];
/* Band information in the TLV is bits[1:0] */
band_info = pchan_band->bandcfg.chanBand;
net_mon->band = pchan_band->bandcfg.chanBand;
net_mon->channel = pchan_band->chan_number;
if (band_info == BAND_2GHZ)
net_mon->band |= (BAND_B | BAND_G);
if (band_info == BAND_5GHZ)
net_mon->band |= BAND_A;
net_mon->chan_bandwidth =
GET_SECONDARYCHAN(pchan_band->bandcfg.chan2Offset);
if (band_info == BAND_2GHZ)
net_mon->band |= BAND_GN;
if (band_info == BAND_5GHZ)
net_mon->band |= BAND_AN;
if (band_info == BAND_2GHZ)
net_mon->band |= BAND_GAC;
if (band_info == BAND_5GHZ)
net_mon->band |= BAND_AAC;
}
pmpriv->adapter->enable_net_mon =
wlan_le16_to_cpu(cmd_net_mon->enable_net_mon);
@ -2245,9 +2268,9 @@ wlan_ret_packet_aggr_over_host_interface(pmlan_private pmpriv,
.packet_aggr;
MrvlIETypes_USBAggrParam_t *usb_aggr_param_tlv = MNULL;
mlan_ds_misc_usb_aggr_ctrl *usb_aggr_ctrl = MNULL;
MrvlIEtypesHeader_t *head = MNULL;
t_u8 *ptlv_buffer = (t_u8 *)packet_aggr->tlv_buf;
mlan_adapter *pmadapter = pmpriv->adapter;
t_u16 tlv = 0;
int tlv_buf_len = 0;
t_u8 changed = 0;
#if defined(USB)
@ -2264,10 +2287,18 @@ wlan_ret_packet_aggr_over_host_interface(pmlan_private pmpriv,
LEAVE();
return MLAN_STATUS_SUCCESS;
}
while (tlv_buf_len > 0) {
while (tlv_buf_len >= sizeof(MrvlIEtypesHeader_t)) {
head = (MrvlIEtypesHeader_t *)ptlv_buffer;
head->len = wlan_le16_to_cpu(head->len);
head->type = wlan_le16_to_cpu(head->type);
changed = 0;
tlv = (*ptlv_buffer) | (*(ptlv_buffer + 1) << 8);
switch (tlv) {
if (sizeof(MrvlIEtypesHeader_t) + head->len > tlv_buf_len) {
PRINTM(MERROR,
"packet aggr: incorrect tlv, tlv_len=%d tlv_buf_len=%d\n",
head->len, tlv_buf_len);
break;
}
switch (head->type) {
case NXP_USB_AGGR_PARAM_TLV_ID:
usb_aggr_param_tlv =
(MrvlIETypes_USBAggrParam_t *)ptlv_buffer;
@ -3455,9 +3486,10 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
(t_u16)wlan_le16_to_cpu(resp->params.tx_buf.buff_size);
#ifdef SDIO
if (IS_SD(pmadapter->card_type)) {
pmadapter->tx_buf_size = (pmadapter->tx_buf_size /
MLAN_SDIO_BLOCK_SIZE) *
MLAN_SDIO_BLOCK_SIZE;
pmadapter->tx_buf_size =
(pmadapter->tx_buf_size /
pmadapter->pcard_sd->sdio_blk_size) *
pmadapter->pcard_sd->sdio_blk_size;
pmadapter->pcard_sd->mp_end_port = wlan_le16_to_cpu(
resp->params.tx_buf.mp_end_port);
pmadapter->pcard_sd->mp_data_port_mask =
@ -3491,9 +3523,13 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
ret = wlan_ret_amsdu_aggr_ctrl(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_WMM_GET_STATUS:
ret = wlan_ret_wmm_get_status(
pmpriv, resp->params.get_wmm_status.queue_status_tlv,
resp->size - S_DS_GEN);
if (resp->size > S_DS_GEN)
ret = wlan_ret_wmm_get_status(
pmpriv,
resp->params.get_wmm_status.queue_status_tlv,
resp->size - S_DS_GEN);
else
ret = MLAN_STATUS_FAILURE;
break;
case HostCmd_CMD_WMM_ADDTS_REQ:
ret = wlan_ret_wmm_addts_req(pmpriv, resp, pioctl_buf);

View file

@ -731,6 +731,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
chan_band_info *pchan_band_info = MNULL;
t_u8 radar_chan;
t_u8 bandwidth;
chan_band_reginfo_t *psta_info = MNULL;
chan_band_reginfo_t *psta_reg_info = MNULL;
t_u16 enable = 0;
Event_Link_Lost *link_lost_evt = MNULL;
@ -1084,7 +1086,7 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
/* Send as passthru first, this event can cause other events */
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1117,6 +1119,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
/* Also send this event as passthru */
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1317,7 +1321,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
eventcause);
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1338,7 +1343,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
wlan_parse_tdls_event(pmpriv, pmbuf);
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1369,7 +1375,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
PRINTM(MINFO, "EVENT: Dump FW info\n");
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_DUMP_INFO;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1379,7 +1386,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
PRINTM(MINFO, "EVENT: TX_STATUS\n");
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_TX_STATUS;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len = MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
@ -1491,7 +1499,9 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pmbuf->data_len, pevent);
else {
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
// Ensure event_len does not exceed buffer size
pevent->event_len =
MIN(pmbuf->data_len, MAX_EVENT_SIZE);
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset,
pevent->event_len, pevent->event_len);
@ -1521,6 +1531,11 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
case EVENT_IMD3_CAL_END:
PRINTM(MEVENT, "EVENT: EVENT_IMD3_CAL_END\n");
break;
case EVENT_DPD_CAL:
wlan_process_dpd_cal_event(pmpriv, pmbuf);
break;
case EVENT_CHAN_LOAD: {
t_u8 *ptr = MNULL;
HostCmd_DS_GET_CH_LOAD *cfg_cmd = MNULL;
@ -1532,6 +1547,32 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pmpriv->rx_quality = wlan_le16_to_cpu(cfg_cmd->rx_quality);
break;
}
case EVENT_CHANNEL_SWITCH_REGINFO:
PRINTM(MEVENT, "EVENT: Channel Switch Reginfo (%#x)\n",
eventcause);
psta_info = (chan_band_reginfo_t *)(pmadapter->event_body);
DBG_HEXDUMP(MCMD_D, "chan band reginfo", (t_u8 *)psta_info,
sizeof(chan_band_reginfo_t));
/* Setup event buffer */
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO;
pevent->event_len = sizeof(chan_band_reginfo_t);
psta_reg_info = (chan_band_reginfo_t *)pevent->event_buf;
/* Copy event data */
if (psta_reg_info->bandcfg.chanBand == BAND_6GHZ) {
memcpy_ext(pmadapter, (t_u8 *)&psta_reg_info->bandcfg,
(t_u8 *)&psta_info->bandcfg,
sizeof(psta_info->bandcfg),
sizeof(psta_reg_info->bandcfg));
psta_reg_info->channel = psta_info->channel;
psta_reg_info->regInfo = psta_info->regInfo;
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO,
pevent);
} else
PRINTM(MEVENT,
"Ignoring the Channel Switch Reg Info Event\n");
break;
default:
PRINTM(MEVENT, "EVENT: unknown event id: %#x\n", eventcause);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_UNKNOWN, MNULL);

View file

@ -3,7 +3,7 @@
* @brief This file contains the functions for station ioctl.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -456,6 +456,7 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
memcpy_ext(pmadapter, pget_info->param.fw_info.hw_2g_he_cap,
pmadapter->hw_2g_he_cap, pmadapter->hw_2g_hecap_len,
sizeof(pget_info->param.fw_info.hw_2g_he_cap));
pget_info->param.fw_info.hw_he_6g_cap = pmadapter->hw_he_6g_cap;
pget_info->param.fw_info.fw_supplicant_support =
IS_FW_SUPPORT_SUPPLICANT(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.antinfo = pmadapter->antinfo;
@ -468,6 +469,8 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
IS_FW_SUPPORT_BEACON_PROT(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.rtt_support =
IS_FW_SUPPORT_RTT(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.he_6g_support =
IS_FW_SUPPORT_6G(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.cmd_tx_data =
IS_FW_SUPPORT_CMD_TX_DATA(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.sec_rgpower =
@ -559,6 +562,10 @@ static mlan_status wlan_snmp_mib_ioctl(pmlan_adapter pmadapter,
value = mib->param.chan_track;
cmd_oid = ChanTrackParam_i;
break;
case MLAN_OID_SNMP_MIB_CTRL_DEAUTH:
value = mib->param.deauthctrl;
cmd_oid = StopDeauth_i;
break;
}
/* Send request to firmware */
@ -1066,9 +1073,6 @@ static mlan_status wlan_bss_ioctl_start(pmlan_adapter pmadapter,
&pmpriv->curr_bss_params.prev_bssid,
&bss->param.ssid_bssid.prev_bssid,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
/* Clear any past association response stored for
* application retrieval */
pmpriv->assoc_rsp_size = 0;
pmpriv->curr_chan_flags =
bss->param.ssid_bssid.channel_flags;
if (IS_FW_SUPPORT_NO_80MHZ(pmadapter))
@ -1353,8 +1357,10 @@ static mlan_status wlan_bss_ioctl(pmlan_adapter pmadapter,
&bss->param.bssid, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
/* clear assoc_rsp_size */
pmpriv->assoc_rsp_size = 0;
pmpriv->assoc_req_size = 0;
if (!pmpriv->media_connected) {
pmpriv->assoc_rsp_size = 0;
pmpriv->assoc_req_size = 0;
}
break;
case MLAN_OID_BSS_START:
status = wlan_bss_ioctl_start(pmadapter, pioctl_req);
@ -2841,7 +2847,8 @@ static mlan_status wlan_sec_ioctl_set_wep_key(pmlan_adapter pmadapter,
sec->param.encrypt_key.key_index =
pwep_key->key_index;
sec->param.encrypt_key.key_len =
pwep_key->key_length;
MIN(pwep_key->key_length,
sizeof(pwep_key->key_material));
memcpy_ext(pmadapter,
sec->param.encrypt_key.key_material,
pwep_key->key_material,
@ -2942,6 +2949,8 @@ static mlan_status wlan_sec_ioctl_get_key(pmlan_adapter pmadapter,
index = pmpriv->wep_key_curr_index;
sec->param.encrypt_key.key_index =
pmpriv->wep_key[index].key_index;
// coverity[cert_arr30_c_violation: SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter,
sec->param.encrypt_key.key_material,
pmpriv->wep_key[index].key_material,
@ -2971,6 +2980,8 @@ static mlan_status wlan_sec_ioctl_get_key(pmlan_adapter pmadapter,
if (pmpriv->wep_key[index].key_length) {
sec->param.encrypt_key.key_index =
pmpriv->wep_key[index].key_index;
// coverity[cert_arr30_c_violation: SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter,
sec->param.encrypt_key.key_material,
pmpriv->wep_key[index].key_material,
@ -3897,11 +3908,18 @@ static mlan_status wlan_misc_ioctl_sdio_mpa_ctrl(pmlan_adapter pmadapter,
if (mpa_ctrl->tx_buf_size || mpa_ctrl->rx_buf_size) {
wlan_free_sdio_mpa_buffers(pmadapter);
if (mpa_ctrl->tx_buf_size > 0)
if (mpa_ctrl->tx_buf_size > 0) {
pmadapter->pcard_sd->mpa_tx.buf_size =
mpa_ctrl->tx_buf_size;
if (pmadapter->pcard_sd->max_blk_count)
pmadapter->pcard_sd->mpa_tx
.buf_size = MIN(
mpa_ctrl->tx_buf_size,
pmadapter->pcard_sd
->max_blk_count *
pmadapter->pcard_sd
->sdio_blk_size);
}
if (mpa_ctrl->rx_buf_size > 0)
pmadapter->pcard_sd->mpa_rx.buf_size =
mpa_ctrl->rx_buf_size;
@ -4046,6 +4064,51 @@ static mlan_status wlan_misc_ioctl_get_assoc_req(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Get prev associate info
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_SUCCESS --success
*/
static mlan_status
wlan_misc_ioctl_get_prev_assoc_info(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_ds_misc_cfg *misc = MNULL;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 fixed_size = 0;
ENTER();
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_GET) {
memcpy_ext(pmpriv->adapter, &misc->param.assoc_info.bssid,
&pmpriv->prev_bssid, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
fixed_size = MGMT_PKT_HEADER_FIX_SIZE + ASSOC_RESP_FIX_SIZE;
if (pmpriv->prior_assoc_rsp_size > fixed_size) {
misc->param.assoc_info.assoc_resp_len =
pmpriv->prior_assoc_rsp_size - fixed_size;
memcpy_ext(pmadapter,
misc->param.assoc_info.assoc_resp_buf,
pmpriv->prior_assoc_rsp + fixed_size,
misc->param.assoc_info.assoc_resp_len,
ASSOC_RSP_BUF_SIZE - fixed_size);
}
memcpy_ext(pmadapter, misc->param.assoc_info.assoc_req_buf,
pmpriv->prior_assoc_req,
pmpriv->prior_assoc_req_size, ASSOC_RSP_BUF_SIZE);
misc->param.assoc_info.assoc_req_len =
MIN(ASSOC_RSP_BUF_SIZE, pmpriv->prior_assoc_req_size);
}
LEAVE();
return ret;
}
/**
* @brief Send function softreset command to firmware
*
@ -4999,6 +5062,10 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_ASSOC_REQ:
status = wlan_misc_ioctl_get_assoc_req(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_PREV_ASSOC_INFO:
status = wlan_misc_ioctl_get_prev_assoc_info(pmadapter,
pioctl_req);
break;
case MLAN_OID_MISC_INIT_SHUTDOWN:
status = wlan_misc_ioctl_init_shutdown(pmadapter, pioctl_req);
break;
@ -5375,6 +5442,51 @@ static mlan_status wlan_set_get_scan_cfg(pmlan_adapter pmadapter,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Set/Get scan 6 GHz configuration parameter
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
* @param action Set/Get
*
* @return MLAN_STATUS_SUCCESS --success
*/
static mlan_status wlan_set_get_scan_6g_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req,
t_u32 action)
{
mlan_ds_scan *scan = MNULL;
ENTER();
if (!IS_FW_SUPPORT_6G(pmadapter)) {
PRINTM(MERROR, "Set/Get scan 6G configuration parameter failed "
"(6 GHz band is not supported).\n");
pioctl_req->data_read_written = 0;
pioctl_req->buf_len_needed = sizeof(mlan_ds_scan);
pioctl_req->status_code = MLAN_ERROR_CMD_INVALID;
LEAVE();
return MLAN_STATUS_RESOURCE;
}
scan = (mlan_ds_scan *)pioctl_req->pbuf;
if (action == MLAN_ACT_SET) {
if (scan->param.scan_6g_cfg.scan_coloc_ap)
pmadapter->wifi_6g_scan_coloc_ap = MTRUE;
else
pmadapter->wifi_6g_scan_coloc_ap = MFALSE;
}
scan->param.scan_6g_cfg.scan_coloc_ap =
pmadapter->wifi_6g_scan_coloc_ap;
pioctl_req->data_read_written =
sizeof(mlan_scan_6g_cfg) + MLAN_SUB_COMMAND_SIZE;
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Set/Get scan
*
@ -5394,7 +5506,8 @@ mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
pscan = (mlan_ds_scan *)pioctl_req->pbuf;
if (pscan->sub_command == MLAN_OID_SCAN_CONFIG ||
pscan->sub_command == MLAN_OID_SCAN_BGSCAN_CONFIG)
pscan->sub_command == MLAN_OID_SCAN_BGSCAN_CONFIG ||
pscan->sub_command == MLAN_OID_SCAN_6G_CONFIG)
goto start_config;
if (pmadapter->scan_processing && pioctl_req->action == MLAN_ACT_SET &&
pscan->sub_command != MLAN_OID_SCAN_CANCEL) {
@ -5422,14 +5535,17 @@ start_config:
if (pioctl_req->action == MLAN_ACT_SET) {
switch (pscan->sub_command) {
case MLAN_OID_SCAN_NORMAL:
pmadapter->scan_6g = MFALSE;
status = wlan_scan_networks(pmpriv, pioctl_req, MNULL);
break;
case MLAN_OID_SCAN_SPECIFIC_SSID:
pmadapter->scan_6g = MFALSE;
status = wlan_scan_specific_ssid(
pmpriv, pioctl_req,
&pscan->param.scan_req.scan_ssid);
break;
case MLAN_OID_SCAN_USER_CONFIG:
pmadapter->scan_6g = MFALSE;
status = wlan_scan_networks(
pmpriv, pioctl_req,
(wlan_user_scan_cfg *)
@ -5439,6 +5555,10 @@ start_config:
status = wlan_set_get_scan_cfg(pmadapter, pioctl_req,
MLAN_ACT_SET);
break;
case MLAN_OID_SCAN_6G_CONFIG:
status = wlan_set_get_scan_6g_cfg(pmadapter, pioctl_req,
MLAN_ACT_SET);
break;
case MLAN_OID_SCAN_CANCEL:
status = wlan_cancel_pending_scan_cmd(pmadapter,
pioctl_req);
@ -5462,7 +5582,8 @@ start_config:
if ((status == MLAN_STATUS_SUCCESS) &&
(pscan->sub_command != MLAN_OID_SCAN_TABLE_FLUSH) &&
(pscan->sub_command != MLAN_OID_SCAN_CANCEL) &&
(pscan->sub_command != MLAN_OID_SCAN_CONFIG)) {
(pscan->sub_command != MLAN_OID_SCAN_CONFIG) &&
(pscan->sub_command != MLAN_OID_SCAN_6G_CONFIG)) {
PRINTM(MINFO,
"wlan_scan_ioctl: return MLAN_STATUS_PENDING\n");
status = MLAN_STATUS_PENDING;
@ -5473,6 +5594,9 @@ start_config:
if (pscan->sub_command == MLAN_OID_SCAN_CONFIG) {
status = wlan_set_get_scan_cfg(pmadapter, pioctl_req,
MLAN_ACT_GET);
} else if (pscan->sub_command == MLAN_OID_SCAN_6G_CONFIG) {
status = wlan_set_get_scan_6g_cfg(pmadapter, pioctl_req,
MLAN_ACT_GET);
} else if (pscan->sub_command ==
MLAN_OID_SCAN_GET_CURRENT_BSS) {
pscan->param.scan_resp.num_in_scan_table =

View file

@ -4,7 +4,7 @@
* module.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2022, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -362,7 +362,6 @@ void wlan_rxpdinfo_to_radiotapinfo(pmlan_private priv, RxPD *prx_pd,
rt_info_tmp.band_config = (prx_pd->rx_info & 0xf);
rt_info_tmp.chan_num = (prx_pd->rx_info & RXPD_CHAN_MASK) >> 5;
ext_rate_info = (t_u8)(prx_pd->rx_info >> 16);
rt_info_tmp.antenna = prx_pd->antenna;
rx_rate_info = prx_pd->rate_info;
if ((rx_rate_info & 0x3) == MLAN_RATE_FORMAT_HE) {
@ -424,6 +423,9 @@ void wlan_rxpdinfo_to_radiotapinfo(pmlan_private priv, RxPD *prx_pd,
sizeof(rt_info_tmp.extra_info),
sizeof(rt_info_tmp.extra_info));
if (prx_pd->flags & RXPD_FLAG_RADIOTAP_HEADER_EXTRA)
rt_info_tmp.radiotap_extra = 1;
memset(priv->adapter, prt_info, 0x00, sizeof(radiotap_info));
memcpy_ext(priv->adapter, prt_info, &rt_info_tmp, sizeof(rt_info_tmp),
sizeof(radiotap_info));
@ -446,7 +448,7 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
pmlan_private priv = pmadapter->priv[pmbuf->bss_index];
RxPacketHdr_t *prx_pkt;
RxPD *prx_pd;
int hdr_chop;
t_u16 hdr_chop;
EthII_Hdr_t *peth_hdr;
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = {0xaa, 0xaa, 0x03,
0x00, 0x00, 0x00};
@ -526,7 +528,15 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
/* Chop off the RxPD + the excess memory from the 802.2/llc/snap
* header that was removed.
*/
hdr_chop = (t_u32)((t_ptr)peth_hdr - (t_ptr)prx_pd);
if ((t_ptr)peth_hdr < (t_ptr)prx_pd ||
((t_ptr)peth_hdr - (t_ptr)prx_pd) > UINT16_MAX) {
pmbuf->status_code = MLAN_ERROR_PKT_INVALID;
PRINTM(MERROR, "STA Rx Error: no hdr space\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
hdr_chop = (t_u16)((t_ptr)peth_hdr - (t_ptr)prx_pd);
} else {
HEXDUMP("RX Data: LLC/SNAP", (t_u8 *)&prx_pkt->rfc1042_hdr,
sizeof(prx_pkt->rfc1042_hdr));
@ -543,13 +553,27 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
priv, ((t_u8 *)prx_pd + prx_pd->rx_pkt_offset),
prx_pd->rx_pkt_length);
}
if (((t_ptr)&prx_pkt->eth803_hdr < (t_ptr)prx_pd) ||
(((t_ptr)&prx_pkt->eth803_hdr - (t_ptr)prx_pd) >
UINT16_MAX)) {
pmbuf->status_code = MLAN_ERROR_PKT_INVALID;
PRINTM(MERROR, "STA Rx Error: no hdr space\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/* Chop off the RxPD */
hdr_chop = (t_u32)((t_ptr)&prx_pkt->eth803_hdr - (t_ptr)prx_pd);
hdr_chop = (t_u16)((t_ptr)&prx_pkt->eth803_hdr - (t_ptr)prx_pd);
}
/* Chop off the leading header bytes so the it points to the start of
* either the reconstructed EthII frame or the 802.2/llc/snap frame
*/
if (pmbuf->data_len < hdr_chop) {
PRINTM(MERROR, "%s(): invalid eth/eth803 header len\n",
__FUNCTION__);
ret = MLAN_STATUS_FAILURE;
goto done;
}
pmbuf->data_len -= hdr_chop;
pmbuf->data_offset += hdr_chop;
pmbuf->pparent = MNULL;
@ -567,6 +591,7 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
PRINTM(MDATA, "%lu.%06lu : Data => kernel seq_num=%d tid=%d\n",
pmbuf->out_ts_sec, pmbuf->out_ts_usec, prx_pd->seq_num,
prx_pd->priority);
pmbuf->priority = prx_pd->priority;
if (pmadapter->enable_net_mon) {
if (prx_pd->rx_pkt_type == PKT_TYPE_802DOT11) {
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
@ -837,7 +862,7 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
* If the packet is not an unicast packet then send the packet
* directly to os. Don't pass thru rx reordering
*/
if ((!IS_11N_ENABLED(priv) &&
if ((!IS_11N_ENABLED(priv) && !IS_116E_ENABLED(priv) &&
!(prx_pd->flags & RXPD_FLAG_PKT_DIRECT_LINK)) ||
(memcmp(priv->adapter, priv->curr_addr,
prx_pkt->eth803_hdr.dest_addr, MLAN_MAC_ADDR_LENGTH) &&

View file

@ -64,6 +64,7 @@ t_void *wlan_ops_sta_process_txpd(t_void *priv, pmlan_buffer pmbuf)
t_u8 *head_ptr = MNULL;
t_u32 pkt_type;
t_u32 tx_control;
t_s32 offset = 0;
ENTER();
@ -98,8 +99,9 @@ t_void *wlan_ops_sta_process_txpd(t_void *priv, pmlan_buffer pmbuf)
/* head_ptr should be aligned */
head_ptr = pmbuf->pbuf + pmbuf->data_offset - Tx_PD_SIZEOF(pmadapter) -
pmpriv->intf_hr_len;
// Typecasting is done for alignment of head_ptr
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(DMA_ALIGNMENT - 1)));
plocal_tx_pd = (TxPD *)(head_ptr + pmpriv->intf_hr_len);
// coverity[bad_memset:SUPPRESS]
memset(pmadapter, plocal_tx_pd, 0, Tx_PD_SIZEOF(pmadapter));
@ -211,7 +213,8 @@ t_void *wlan_ops_sta_process_txpd(t_void *priv, pmlan_buffer pmbuf)
/* Adjust the data offset and length to include TxPD in pmbuf */
pmbuf->data_len += pmbuf->data_offset;
pmbuf->data_offset = (t_u32)(head_ptr - pmbuf->pbuf);
offset = head_ptr - pmbuf->pbuf;
pmbuf->data_offset = (t_u32)offset;
pmbuf->data_len -= pmbuf->data_offset;
done:

View file

@ -360,6 +360,8 @@
/** TLV rssi info */
#define TLV_TYPE_RSSI_INFO (PROPRIETARY_TLV_BASE_ID + 229) /* 0x01e5 */
#define TLV_TYPE_IPV6_RA_OFFLOAD (PROPRIETARY_TLV_BASE_ID + 230) /* 0x01e6 */
/** TLV type : FILS IP config params */
#define TLV_TYPE_AP_FILS_IP_CFG (PROPRIETARY_TLV_BASE_ID + 231) /* 0x01e7 */
/** TLV to indicate firmware only keep probe response while scan */
#define TLV_TYPE_ONLYPROBERESP (PROPRIETARY_TLV_BASE_ID + 233) /* 0x01e9 */
#define TLV_TYPE_RANDOM_MAC (PROPRIETARY_TLV_BASE_ID + 236) /* 0x01ec */
@ -495,6 +497,7 @@
#define TLV_TYPE_SECURE_BOOT_UUID (PROPRIETARY_TLV_BASE_ID + 348) /* 0x025c */
#define TLV_TYPE_CLOUD_KEEP_ALIVE_ACK \
(PROPRIETARY_TLV_BASE_ID + 349) /* 0x025d */
#define TLV_TYPE_6G_SCAN_PARAMS (PROPRIETARY_TLV_BASE_ID + 350) /* 0x025e */
/** TLV type: ps_ext_param */
#define TLV_TYPE_PS_EXT_PARAM (PROPRIETARY_TLV_BASE_ID + 351) /* 0x025f */
#define TLV_TYPE_MCLIENT_FW_CAPS (PROPRIETARY_TLV_BASE_ID + 352) /* 0x0260 */
@ -502,5 +505,6 @@
#define TLV_TYPE_BOOT_TIME_CFG (PROPRIETARY_TLV_BASE_ID + 355) /* 0x0263 */
#define VENDOR_IE_OUIS_TLV_ID (PROPRIETARY_TLV_BASE_ID + 357) /* 0x0265 */
#define TLV_TYPE_AP_INFO (PROPRIETARY_TLV_BASE_ID + 358) /* 0x0266 */
#endif /* !MLAN_TLV_IDS_H_ */

View file

@ -117,8 +117,8 @@ static void wlan_drv_mcast_cycle_delay_calulation(pmlan_adapter pmadapter,
static t_u32 prev_mcast_usec = 0;
t_u32 curr_ts_sec = 0;
t_u32 curr_ts_usec = 0;
t_u64 cycle_delta = 0;
t_u64 profile_delta = 0;
t_s64 cycle_delta = 0;
t_s64 profile_delta = 0;
if (mcast_drv_update_allow_flag == MFALSE)
return;
@ -133,7 +133,7 @@ static void wlan_drv_mcast_cycle_delay_calulation(pmlan_adapter pmadapter,
if (curr_ts_sec || curr_ts_usec) {
/* Calculate profile delta */
profile_delta = (curr_ts_sec - pmbuf->in_ts_sec) * 1000000;
profile_delta += (t_s32)(curr_ts_usec - pmbuf->in_ts_usec);
profile_delta += curr_ts_usec - pmbuf->in_ts_usec;
if ((profile_delta >= 0) && (profile_delta <= 1000))
gmcast_stats.spent_time_under_1000usec++;
@ -145,8 +145,9 @@ static void wlan_drv_mcast_cycle_delay_calulation(pmlan_adapter pmadapter,
gmcast_stats.spent_time_over_3000usec++;
}
/* Process the start cycle data */
cycle_delta = (t_u64)(pmbuf->in_ts_sec - prev_mcast_sec) * 1000000;
cycle_delta += (t_s32)(pmbuf->in_ts_usec - prev_mcast_usec);
cycle_delta = ((t_s64)pmbuf->in_ts_sec - (t_s64)prev_mcast_sec) *
(t_s64)1000000;
cycle_delta += pmbuf->in_ts_usec - prev_mcast_usec;
/* If start cycle delta is more than 5 sec ignore*/
if ((pmbuf->u.mc_tx_info.mc_pkt_flags & (1 << CYCLE_START)) &&

View file

@ -127,7 +127,8 @@ static mlan_status wlan_cmd_set_get_beacon_stuck_cfg(IN pmlan_private pmpriv,
IN t_void *pdata_buf)
{
HostCmd_DS_BEACON_STUCK_CFG *pbeacon_stuck_param_cfg =
(HostCmd_DS_BEACON_STUCK_CFG *)(pdata_buf + sizeof(t_u32));
(HostCmd_DS_BEACON_STUCK_CFG *)((t_u8 *)pdata_buf +
sizeof(t_u32));
ENTER();
@ -405,7 +406,7 @@ static mlan_status wlan_uap_cmd_802_11_hs_cfg(pmlan_private pmpriv,
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_802_11_HS_CFG_ENH *phs_cfg =
(HostCmd_DS_802_11_HS_CFG_ENH *)&(cmd->params.opt_hs_cfg);
t_u8 *tlv = (t_u8 *)phs_cfg + sizeof(HostCmd_DS_802_11_HS_CFG_ENH);
t_u8 *tlv = (t_u8 *)&cmd->params + sizeof(HostCmd_DS_802_11_HS_CFG_ENH);
MrvlIEtypes_HsWakeHoldoff_t *holdoff_tlv = MNULL;
MrvlIEtypes_HS_Antmode_t *antmode_tlv = MNULL;
MrvlIEtypes_WakeupSourceGPIO_t *gpio_tlv = MNULL;
@ -759,6 +760,7 @@ static mlan_status wlan_uap_cmd_ap_config(pmlan_private pmpriv,
MrvlIEtypes_wep_key_t *tlv_wep_key = MNULL;
MrvlIETypes_HTCap_t *tlv_htcap = MNULL;
MrvlIEtypes_wmm_parameter_t *tlv_wmm_parameter = MNULL;
MrvlIEtypes_FILS_ip_config_t *tlv_ip_cfg = MNULL;
MrvlIEtypes_preamble_t *tlv_preamble = MNULL;
MrvlIEtypes_MultiAp_t *tlv_multi_ap = MNULL;
@ -1143,6 +1145,7 @@ static mlan_status wlan_uap_cmd_ap_config(pmlan_private pmpriv,
}
if ((bss->param.bss_config.auth_mode <= MLAN_AUTH_MODE_SHARED) ||
(bss->param.bss_config.auth_mode == MLAN_AUTH_MODE_FILS) ||
(bss->param.bss_config.auth_mode == MLAN_AUTH_MODE_AUTO)) {
tlv_auth_type = (MrvlIEtypes_auth_type_t *)tlv;
tlv_auth_type->header.type =
@ -1486,6 +1489,27 @@ static mlan_status wlan_uap_cmd_ap_config(pmlan_private pmpriv,
cmd_size += sizeof(MrvlIEtypes_wmm_parameter_t);
tlv += sizeof(MrvlIEtypes_wmm_parameter_t);
}
if (bss->param.bss_config.ip_cfg.ip) {
tlv_ip_cfg = (MrvlIEtypes_FILS_ip_config_t *)tlv;
tlv_ip_cfg->header.type =
wlan_cpu_to_le16(TLV_TYPE_AP_FILS_IP_CFG);
tlv_ip_cfg->header.len =
wlan_cpu_to_le16(sizeof(MrvlIEtypes_FILS_ip_config_t) -
sizeof(MrvlIEtypesHeader_t));
tlv_ip_cfg->ip_addr =
wlan_cpu_to_le32(bss->param.bss_config.ip_cfg.ip);
tlv_ip_cfg->subnet_mask = wlan_cpu_to_le32(
bss->param.bss_config.ip_cfg.subnetMask);
tlv_ip_cfg->base_ip =
wlan_cpu_to_le32(bss->param.bss_config.ip_cfg.baseIp);
tlv_ip_cfg->dns_ip =
wlan_cpu_to_le32(bss->param.bss_config.ip_cfg.dnsIp);
tlv_ip_cfg->max_clients = wlan_cpu_to_le16(
bss->param.bss_config.ip_cfg.maxClients);
cmd_size += sizeof(MrvlIEtypes_FILS_ip_config_t);
tlv += sizeof(MrvlIEtypes_FILS_ip_config_t);
}
if (pmpriv->adapter->pcard_info->v17_fw_api &&
bss->param.bss_config.preamble_type) {
tlv_preamble = (MrvlIEtypes_preamble_t *)tlv;
@ -1516,6 +1540,56 @@ static mlan_status wlan_uap_cmd_ap_config(pmlan_private pmpriv,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Enable/Disable UPR/FILS Discovery for 6E
*
* @param priv A pointer to moal_private structure
* @param action MLAN_ACT_SET or MLAN_ACT_GET
* @param wait_option Wait option
* @param sys_cfg A pointer to mlan_uap_bss_param structure
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status wlan_uap_cmd_6e_inband_frame(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action,
pmlan_ioctl_req pioctl_buf)
{
mlan_ds_bss *bss;
mlan_status ret = MLAN_STATUS_SUCCESS;
inband_6e_frames_cmd_t *inband_frame;
HostCmd_DS_SYS_CONFIG *sys_config =
(HostCmd_DS_SYS_CONFIG *)&cmd->params.sys_config;
t_u16 cmd_size;
ENTER();
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_APCMD_SYS_CONFIGURE);
sys_config->action = wlan_cpu_to_le16(cmd_action);
bss = (mlan_ds_bss *)pioctl_buf->pbuf;
inband_frame = (inband_6e_frames_cmd_t *)sys_config->tlv_buffer;
cmd_size = bss->param.inband_6e_frame.frameLen +
sizeof(inband_6e_frames_cmd_t);
memcpy_ext(pmpriv->adapter, inband_frame, &bss->param.inband_6e_frame,
cmd_size, cmd_size);
inband_frame->type = (t_u16)wlan_cpu_to_le16(inband_frame->type);
inband_frame->len = (t_u16)wlan_cpu_to_le16(inband_frame->len);
inband_frame->interval =
(t_u16)wlan_cpu_to_le16(inband_frame->interval);
inband_frame->frameLen =
(t_u16)wlan_cpu_to_le16(inband_frame->frameLen);
cmd_size += sizeof(HostCmd_DS_SYS_CONFIG) + S_DS_GEN;
cmd->size = (t_u16)wlan_cpu_to_le16(cmd_size);
LEAVE();
return ret;
}
/**
* @brief This function prepares command of sys_config
*
@ -1559,6 +1633,7 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
t_u16 req_len = 0, travel_len = 0;
custom_ie *cptr = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
MrvlIEtypes_FILS_ip_config_t *tlv_ip_cfg = MNULL;
MrvlIEtypes_wacp_mode_t *tlv_wacp_mode = MNULL;
MrvlIEtypes_action_chan_switch_t *tlv_chan_switch = MNULL;
IEEEtypes_ChanSwitchAnn_t *csa_ie = MNULL;
@ -1692,6 +1767,40 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
}
break;
case REGULATORY_CLASS:
// sys_config->tlv_buffer is output, pdata_buf
// is input
if (pmpriv->uap_state_chan_cb.bandcfg.chanBand ==
BAND_6GHZ) {
MrvlIETypes_SuppOperClass_t *pOperClass_in =
(MrvlIETypes_SuppOperClass_t *)
pdata_buf;
MrvlIETypes_SuppOperClass_t *pOperClass_out =
(MrvlIETypes_SuppOperClass_t *)
sys_config->tlv_buffer;
pOperClass_out->header
.type = wlan_cpu_to_le16(
pOperClass_in->header.type);
pOperClass_out->header
.len = wlan_cpu_to_le16(
pOperClass_in->header.len);
memcpy_ext(
pmpriv->adapter,
&pOperClass_out
->current_oper_class,
&pOperClass_in
->current_oper_class,
pOperClass_in->header.len,
pOperClass_in->header.len);
cmd->size = wlan_cpu_to_le16(
sizeof(HostCmd_DS_SYS_CONFIG) +
S_DS_GEN +
sizeof(MrvlIEtypesHeader_t) +
pOperClass_in->header.len);
break;
}
poper_class_tlv =
(MrvlIEtypes_chan_bw_oper_t *)pdata_buf;
ret = wlan_get_curr_oper_class(
@ -1880,6 +1989,32 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
bss->param.ap_channel.bandcfg,
bss->param.ap_channel.channel);
}
} else if (bss->sub_command == MLAN_OID_FILS_IP_CFG) {
/* Prepare FILS IP Config TLV */
tlv_ip_cfg = (MrvlIEtypes_FILS_ip_config_t *)
sys_config->tlv_buffer;
tlv_ip_cfg->header.type =
wlan_cpu_to_le16(TLV_TYPE_AP_FILS_IP_CFG);
tlv_ip_cfg->header.len = wlan_cpu_to_le16(
sizeof(MrvlIEtypes_FILS_ip_config_t) -
sizeof(MrvlIEtypesHeader_t));
if (cmd_action == HostCmd_ACT_GEN_SET) {
tlv_ip_cfg->ip_addr = wlan_cpu_to_le32(
bss->param.bss_config.ip_cfg.ip);
tlv_ip_cfg->subnet_mask = wlan_cpu_to_le32(
bss->param.bss_config.ip_cfg.subnetMask);
tlv_ip_cfg->base_ip = wlan_cpu_to_le32(
bss->param.bss_config.ip_cfg.baseIp);
tlv_ip_cfg->dns_ip = wlan_cpu_to_le32(
bss->param.bss_config.ip_cfg.dnsIp);
tlv_ip_cfg->max_clients = wlan_cpu_to_le16(
bss->param.bss_config.ip_cfg.maxClients);
}
cmd->size = wlan_cpu_to_le16(
sizeof(HostCmd_DS_SYS_CONFIG) + S_DS_GEN +
sizeof(MrvlIEtypes_FILS_ip_config_t));
} else if (bss->sub_command == MLAN_OID_ACTION_CHAN_SWITCH) {
cmd->size = sizeof(HostCmd_DS_SYS_CONFIG) + S_DS_GEN +
sizeof(MrvlIEtypes_action_chan_switch_t);
@ -1934,6 +2069,11 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
ret = wlan_uap_cmd_ap_config(pmpriv, cmd, cmd_action,
pioctl_buf);
goto done;
} else if ((bss->sub_command == MLAN_OID_UAP_6E_INBAND_FRAME) &&
(cmd_action == HostCmd_ACT_GEN_SET)) {
ret = wlan_uap_cmd_6e_inband_frame(
pmpriv, cmd, cmd_action, pioctl_buf);
goto done;
}
} else if (pioctl_buf->req_id == MLAN_IOCTL_MISC_CFG) {
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
@ -3038,6 +3178,15 @@ static mlan_status wlan_uap_cmd_snmp_mib(pmlan_private pmpriv,
psnmp_mib->value[0] = *((t_u8 *)pdata_buf);
cmd->size += sizeof(t_u8);
break;
case User_band_config_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u16));
ul_temp = *(t_u32 *)pdata_buf;
*((t_u16 *)(psnmp_mib->value)) =
wlan_cpu_to_le16((t_u16)ul_temp);
cmd->size += sizeof(t_u16);
break;
case StopDeauth_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u8));
@ -3133,7 +3282,7 @@ static mlan_status wlan_uap_ret_snmp_mib(pmlan_private pmpriv,
mlan_ds_snmp_mib *mib = MNULL;
t_u16 oid = wlan_le16_to_cpu(psnmp_mib->oid);
t_u8 *psnmp_oid = MNULL;
t_u32 data;
t_u32 data, oid_offset;
t_u16 tlv_buf_left = 0;
t_u16 tlv_type = 0;
t_u16 query_type = wlan_le16_to_cpu(psnmp_mib->query_type);
@ -3153,10 +3302,16 @@ static mlan_status wlan_uap_ret_snmp_mib(pmlan_private pmpriv,
}
info = (mlan_ds_get_info *)pioctl_buf->pbuf;
tlv_buf_left = resp->size - (sizeof(t_u16) + S_DS_GEN);
psnmp_oid = (t_u8 *)&psnmp_mib->oid;
oid_offset = (t_ptr)&psnmp_mib->oid - (t_ptr)psnmp_mib;
psnmp_oid = (t_u8 *)&resp->params + oid_offset;
while (tlv_buf_left >= sizeof(MrvlIEtypes_snmp_oid_t)) {
/* oid_offset cannot overflow struct size */
// coverity[overflow_sink:SUPPRESS]
tlv_type = wlan_le16_to_cpu(*(t_u16 *)psnmp_oid);
psnmp_oid += sizeof(t_u16) + sizeof(t_u16);
// coverity[cert_arr30_c_violation:SUPPRESS]
// coverity[overrun:SUPPRESS]
// coverity[cert_str31_c_violation:SUPPRESS]
memcpy_ext(pmadapter, &data, psnmp_oid, sizeof(t_u32),
sizeof(t_u32));
switch (tlv_type) {
@ -3369,6 +3524,10 @@ static mlan_status wlan_uap_ret_get_log(pmlan_private pmpriv,
wlan_le32_to_cpu(pget_log->gdma_abort_cnt);
pget_info->param.stats.g_reset_rx_mac_cnt =
wlan_le32_to_cpu(pget_log->g_reset_rx_mac_cnt);
pget_info->param.stats.currTemp =
wlan_le32_to_cpu(pget_log->currTemp);
pget_info->param.stats.TXpwrMethod =
wlan_le32_to_cpu(pget_log->TXpwrMethod);
pget_info->param.stats.SdmaStuckCnt =
wlan_le32_to_cpu(pget_log->SdmaStuckCnt);
// Ownership error counters
@ -3577,7 +3736,7 @@ static mlan_status wlan_uap_cmd_report_mic(pmlan_private pmpriv,
*/
static mlan_status wlan_uap_cmd_key_material(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_u16 cmd_oid,
t_u16 cmd_action, t_u32 cmd_oid,
t_void *pdata_buf)
{
HostCmd_DS_802_11_KEY_MATERIAL *pkey_material =
@ -4075,7 +4234,48 @@ static void wlan_check_uap_capability(pmlan_private priv, pmlan_buffer pevent)
->center_chan = wlan_get_center_freq_idx(
priv, pchan_band_info->bandcfg.chanBand,
pchan_info->channel, CHANNEL_BW_80MHZ);
if (priv->adapter->ecsa_enable) {
if (pchan_band_info->bandcfg.chanBand == BAND_6GHZ) {
if (priv->uap_host_based == MFALSE) {
// compose for embedded case (Using
// Global Operating Class)
MrvlIETypes_SuppOperClass_t operClass;
int ret;
operClass.header.type =
REGULATORY_CLASS;
operClass.header.len =
sizeof(MrvlIETypes_SuppOperClass_t) -
sizeof(MrvlIEtypesHeader_t);
if (pchan_band_info->bandcfg.chanWidth ==
CHAN_BW_80MHZ)
operClass.current_oper_class =
133;
else if (pchan_band_info->bandcfg
.chanWidth ==
CHAN_BW_40MHZ)
operClass.current_oper_class =
132;
else
operClass.current_oper_class =
131;
operClass.oper_class[0] = 0;
ret = wlan_prepare_cmd(
priv,
HostCmd_CMD_APCMD_SYS_CONFIGURE,
HostCmd_ACT_GEN_SET, 0, MNULL,
&operClass);
if (ret != MLAN_STATUS_SUCCESS &&
ret != MLAN_STATUS_PENDING) {
PRINTM(MERROR,
"%s(): Could not set supported operating class IE for priv=%p [priv_bss_idx=%d]!\n",
__func__, priv,
priv->bss_index);
}
}
// else take REGULATORY_CLASS from hostapd
} else if (priv->adapter->ecsa_enable) {
int ret;
t_u8 bandwidth = BW_20MHZ;
@ -4280,8 +4480,8 @@ static mlan_status wlan_ret_cmd_uap_acs_scan(pmlan_private pmpriv,
const HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
HostCMD_DS_APCMD_ACS_SCAN *acs_scan =
(HostCMD_DS_APCMD_ACS_SCAN *)&resp->params.acs_scan;
const HostCMD_DS_APCMD_ACS_SCAN *acs_scan =
(const HostCMD_DS_APCMD_ACS_SCAN *)&resp->params.acs_scan;
mlan_ds_bss *bss = MNULL;
ENTER();
@ -4557,6 +4757,23 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv,
if (pext_tlv->ext_id == HE_CAPABILITY) {
sta_ptr->is_11ax_enabled = MTRUE;
PRINTM(MCMND, "ADD_STA supports 11ax\n");
} else if (pext_tlv->ext_id == HE_6G_CAPABILITY) {
MrvlIEtypes_He_6g_cap_t *phe_6g_cap = MNULL;
phe_6g_cap = (MrvlIEtypes_He_6g_cap_t *)tlv;
if (GET_6G_BAND_CAP_MAXMPDULEN(
phe_6g_cap->capa) == 2)
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_12K;
else if (GET_6G_BAND_CAP_MAXMPDULEN(
phe_6g_cap->capa) == 1)
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_8K;
else
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_4K;
PRINTM(MCMND,
"ADD_STA supports 6E, max_amsdu=%d\n",
sta_ptr->max_amsdu);
} else {
pext_tlv = MNULL;
}
@ -4687,6 +4904,11 @@ static mlan_status wlan_ret_add_station(pmlan_private pmpriv,
return MLAN_STATUS_SUCCESS;
}
extern mlan_status wlan_cmd_802_11_supplicant_pmk(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action,
t_void *pdata_buf);
extern Stats_mcast_drv_t gmcast_stats;
extern t_u8 mcast_drv_update_allow_flag;
#define OP_RESET 3
@ -4892,6 +5114,12 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = wlan_cmd_802_11d_domain_info(pmpriv, cmd_ptr, cmd_action);
break;
#ifdef UAP_SUPPORT
case HostCmd_CMD_802_CUSTOM_BEACON_IE:
ret = wlan_cmd_802_11d_custom_bcn_country_ie_info(
pmpriv, cmd_ptr, (pmlan_ioctl_req)pioctl_buf);
break;
#endif
case HostCmd_CMD_CHAN_REPORT_REQUEST:
ret = wlan_11h_cmd_process(pmpriv, cmd_ptr, pdata_buf);
break;
@ -5112,6 +5340,10 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_net_monitor(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_SUPPLICANT_PMK:
ret = wlan_cmd_802_11_supplicant_pmk(pmpriv, cmd_ptr,
cmd_action, pdata_buf);
break;
case HostCmd_CMD_PACKET_AGGR_CTRL:
ret = wlan_cmd_packet_aggr_ctrl(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
@ -5390,6 +5622,11 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = wlan_ret_802_11d_domain_info(pmpriv, resp);
break;
#ifdef UAP_SUPPORT
case HostCmd_CMD_802_CUSTOM_BEACON_IE:
ret = wlan_ret_802_11d_custom_bcn_country_ie_info(pmpriv, resp);
break;
#endif
case HostCmd_CMD_CHAN_REPORT_REQUEST:
ret = wlan_11h_cmdresp_process(pmpriv, resp);
break;
@ -5455,9 +5692,10 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
(t_u16)wlan_le16_to_cpu(resp->params.tx_buf.buff_size);
#ifdef SDIO
if (IS_SD(pmadapter->card_type)) {
pmadapter->tx_buf_size = (pmadapter->tx_buf_size /
MLAN_SDIO_BLOCK_SIZE) *
MLAN_SDIO_BLOCK_SIZE;
pmadapter->tx_buf_size =
(pmadapter->tx_buf_size /
pmadapter->pcard_sd->sdio_blk_size) *
pmadapter->pcard_sd->sdio_blk_size;
pmadapter->pcard_sd->mp_end_port = wlan_le16_to_cpu(
resp->params.tx_buf.mp_end_port);
pmadapter->pcard_sd->mp_data_port_mask =
@ -5596,6 +5834,9 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
break;
case HostCmd_CMD_REGION_POWER_CFG:
break;
case HostCmd_CMD_SUPPLICANT_PMK:
ret = wlan_ret_802_11_supplicant_pmk(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_PACKET_AGGR_CTRL:
ret = wlan_ret_packet_aggr_ctrl(pmpriv, resp, pioctl_buf);
break;
@ -6247,7 +6488,10 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
PRINTM(MEVENT, "EVENT: EVENT_CSI on UAP\n");
wlan_process_csi_event(pmpriv);
break;
case EVENT_DPD_CAL:
PRINTM(MEVENT, "EVENT: EVENT_DPD_CAL on UAP\n");
wlan_process_dpd_cal_event(pmpriv, pmbuf);
break;
case EVENT_WLS_FTM_COMPLETE:
PRINTM(MEVENT, "EVENT: FTM_GENERIC_EVENT\n");
pevent = (pmlan_event)event_buf;
@ -6335,6 +6579,7 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
pevent->event_len);
// coverity[cert_str32_c_violation:SUPPRESS]
wlan_recv_event(pmpriv, pevent->event_id, pevent);
}
done:

View file

@ -3,7 +3,7 @@
* @brief This file contains the handling of AP mode ioctls
*
*
* Copyright 2009-2024 NXP
* Copyright 2009-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -42,6 +42,8 @@ Change log:
/********************************************************
Global Variables
********************************************************/
extern mlan_status wlan_sec_ioctl_passphrase(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/********************************************************
Local Functions
@ -368,6 +370,40 @@ static mlan_status wlan_uap_bss_ioctl_reset(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Set/Get FILS IP configuration value
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_PENDING --success, otherwise
* MLAN_STATUS_FAILURE
*/
static mlan_status wlan_uap_bss_ioctl_fils_ip_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 cmd_action = 0;
ENTER();
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief This function to process add station.
*
@ -596,6 +632,39 @@ static mlan_status wlan_uap_bss_ioctl_uap_oper_ctrl(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Set 6E inband UPR or FILS Discovery frame
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
static mlan_status
wlan_uap_bss_ioctl_6e_inband_frame(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 cmd_action = 0;
ENTER();
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief Get Uap statistics
*
@ -2036,6 +2105,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
else if (bss->sub_command == MLAN_OID_UAP_ACS_SCAN)
status = wlan_uap_bss_ioctl_acs_scan(pmadapter,
pioctl_req);
else if (bss->sub_command == MLAN_OID_FILS_IP_CFG)
status = wlan_uap_bss_ioctl_fils_ip_cfg(pmadapter,
pioctl_req);
else if (bss->sub_command == MLAN_OID_UAP_OPER_CTRL)
status = wlan_uap_bss_ioctl_uap_oper_ctrl(pmadapter,
pioctl_req);
@ -2045,6 +2117,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
else if (bss->sub_command == MLAN_OID_ACTION_CHAN_SWITCH)
status = wlan_uap_bss_ioctl_action_chan_switch(
pmadapter, pioctl_req);
else if (bss->sub_command == MLAN_OID_UAP_6E_INBAND_FRAME)
status = wlan_uap_bss_ioctl_6e_inband_frame(pmadapter,
pioctl_req);
break;
#ifdef STA_SUPPORT
case MLAN_IOCTL_SCAN:
@ -2123,6 +2198,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
pmadapter->hw_2g_he_cap,
pmadapter->hw_2g_hecap_len,
sizeof(pget_info->param.fw_info.hw_2g_he_cap));
pget_info->param.fw_info.hw_he_6g_cap =
pmadapter->hw_he_6g_cap;
pget_info->param.fw_info.region_code =
pmadapter->region_code;
if (pmadapter->otp_region &&
@ -2153,17 +2230,16 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
break;
case MLAN_IOCTL_MISC_CFG:
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
if (misc->sub_command == MLAN_OID_MISC_GET_SENSOR_TEMP) {
status = wlan_misc_ioctl_get_sensor_temp(pmadapter,
pioctl_req);
}
if (misc->sub_command == MLAN_OID_MISC_INIT_SHUTDOWN)
status = wlan_misc_ioctl_init_shutdown(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_SOFT_RESET)
else if (misc->sub_command == MLAN_OID_MISC_GET_SENSOR_TEMP)
status = wlan_misc_ioctl_get_sensor_temp(pmadapter,
pioctl_req);
else if (misc->sub_command == MLAN_OID_MISC_SOFT_RESET)
status = wlan_uap_misc_ioctl_soft_reset(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_WARM_RESET) {
else if (misc->sub_command == MLAN_OID_MISC_WARM_RESET) {
PRINTM(MCMND, "Request UAP WARM RESET\n");
util_enqueue_list_tail(
pmadapter->pmoal_handle,
@ -2173,54 +2249,53 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
pmadapter->callbacks.moal_spin_unlock);
pmadapter->pending_ioctl = MTRUE;
status = MLAN_STATUS_PENDING;
}
if (misc->sub_command == MLAN_OID_MISC_HOST_CMD)
} else if (misc->sub_command == MLAN_OID_MISC_HOST_CMD)
status =
wlan_misc_ioctl_host_cmd(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_REGION)
else if (misc->sub_command == MLAN_OID_MISC_REGION)
status = wlan_misc_ioctl_region(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GEN_IE)
else if (misc->sub_command == MLAN_OID_MISC_GEN_IE)
status = wlan_uap_misc_ioctl_gen_ie(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CUSTOM_IE)
else if (misc->sub_command == MLAN_OID_MISC_CUSTOM_IE)
status = wlan_misc_ioctl_custom_ie_list(
pmadapter, pioctl_req, MTRUE);
if (misc->sub_command == MLAN_OID_MISC_TX_DATAPAUSE)
else if (misc->sub_command == MLAN_OID_MISC_TX_DATAPAUSE)
status = wlan_uap_misc_ioctl_txdatapause(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RX_MGMT_IND)
else if (misc->sub_command == MLAN_OID_MISC_RX_MGMT_IND)
status = wlan_reg_rx_mgmt_ind(pmadapter, pioctl_req);
#ifdef DEBUG_LEVEL1
if (misc->sub_command == MLAN_OID_MISC_DRVDBG)
else if (misc->sub_command == MLAN_OID_MISC_DRVDBG)
status = wlan_set_drvdbg(pmadapter, pioctl_req);
#endif
if (misc->sub_command == MLAN_OID_MISC_TXCONTROL)
else if (misc->sub_command == MLAN_OID_MISC_TXCONTROL)
status = wlan_misc_ioctl_txcontrol(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MAC_CONTROL)
else if (misc->sub_command == MLAN_OID_MISC_MAC_CONTROL)
status = wlan_misc_ioctl_mac_control(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_CFG)
else if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_CFG)
status = wlan_misc_ioctl_multi_chan_config(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_POLICY)
else if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_POLICY)
status = wlan_misc_ioctl_multi_chan_policy(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DRCS_CFG)
else if (misc->sub_command == MLAN_OID_MISC_DRCS_CFG)
status = wlan_misc_ioctl_drcs_config(pmadapter,
pioctl_req);
#ifdef WIFI_DIRECT_SUPPORT
if (misc->sub_command == MLAN_OID_MISC_WIFI_DIRECT_CONFIG)
else if (misc->sub_command == MLAN_OID_MISC_WIFI_DIRECT_CONFIG)
status = wlan_misc_p2p_config(pmadapter, pioctl_req);
#endif
if (misc->sub_command == MLAN_OID_MISC_GPIO_TSF_LATCH)
else if (misc->sub_command == MLAN_OID_MISC_GPIO_TSF_LATCH)
status = wlan_misc_gpio_tsf_latch_config(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_TSF_INFO)
else if (misc->sub_command == MLAN_OID_MISC_GET_TSF_INFO)
status = wlan_misc_get_tsf_info(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DFS_REAPTER_MODE) {
else if (misc->sub_command == MLAN_OID_MISC_DFS_REAPTER_MODE) {
mlan_ds_misc_cfg *misc_cfg = MNULL;
misc_cfg = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
@ -2230,134 +2305,132 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
sizeof(mlan_ds_misc_dfs_repeater);
status = MLAN_STATUS_SUCCESS;
}
if (misc->sub_command == MLAN_OID_MISC_IND_RST_CFG)
} else if (misc->sub_command == MLAN_OID_MISC_IND_RST_CFG)
status = wlan_misc_ioctl_ind_rst_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MC_AGGR_CFG)
else if (misc->sub_command == MLAN_OID_MISC_MC_AGGR_CFG)
status = wlan_misc_ioctl_mc_aggr_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_STATS)
else if (misc->sub_command == MLAN_OID_MISC_STATS)
status = wlan_misc_ioctl_stats(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CH_LOAD)
else if (misc->sub_command == MLAN_OID_MISC_CH_LOAD)
status = wlan_misc_ioctl_ch_load(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CH_LOAD_RESULTS)
else if (misc->sub_command == MLAN_OID_MISC_CH_LOAD_RESULTS)
status = wlan_misc_ioctl_ch_load_results(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_TSF)
else if (misc->sub_command == MLAN_OID_MISC_GET_TSF)
status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CROSS_CHIP_SYNCH) {
else if (misc->sub_command == MLAN_OID_MISC_CROSS_CHIP_SYNCH)
status = wlan_misc_ioctl_cross_chip_synch(pmadapter,
pioctl_req);
}
if (misc->sub_command == MLAN_OID_MISC_TSP_CFG) {
else if (misc->sub_command == MLAN_OID_MISC_TSP_CFG)
status = wlan_misc_ioctl_tsp_config(pmadapter,
pioctl_req);
}
if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_REGION_CFG)
else if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_REGION_CFG)
status = wlan_misc_chan_reg_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_OPER_CLASS_CHECK)
else if (misc->sub_command == MLAN_OID_MISC_OPER_CLASS_CHECK)
status = wlan_misc_ioctl_operclass_validation(
pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_OPER_CLASS)
else if (misc->sub_command == MLAN_OID_MISC_OPER_CLASS)
status = wlan_misc_ioctl_oper_class(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_AGGR_CTRL)
else if (misc->sub_command == MLAN_OID_MISC_AGGR_CTRL)
status = wlan_misc_ioctl_aggr_ctrl(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_PER_PKT_CFG)
else if (misc->sub_command == MLAN_OID_MISC_PER_PKT_CFG)
status = wlan_misc_per_pkt_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_NET_MONITOR)
else if (misc->sub_command == MLAN_OID_MISC_NET_MONITOR)
status = wlan_misc_ioctl_net_monitor(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_FW_DUMP_EVENT)
else if (misc->sub_command == MLAN_OID_MISC_FW_DUMP_EVENT)
status = wlan_misc_ioctl_fw_dump_event(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG)
else if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG)
status = wlan_misc_ioctl_rxabortcfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_OFDM_DESENSE_CFG)
else if (misc->sub_command == MLAN_OID_MISC_OFDM_DESENSE_CFG)
status = wlan_misc_ioctl_ofdmdesense_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG_EXT)
else if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG_EXT)
status = wlan_misc_ioctl_rxabortcfg_ext(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_NAV_MITIGATION)
else if (misc->sub_command == MLAN_OID_MISC_NAV_MITIGATION)
status = wlan_misc_ioctl_nav_mitigation(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_LED_CONFIG)
else if (misc->sub_command == MLAN_OID_MISC_LED_CONFIG)
status = wlan_misc_ioctl_led(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_TX_AMPDU_PROT_MODE)
else if (misc->sub_command == MLAN_OID_MISC_TX_AMPDU_PROT_MODE)
status = wlan_misc_ioctl_tx_ampdu_prot_mode(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DOT11MC_UNASSOC_FTM_CFG)
else if (misc->sub_command ==
MLAN_OID_MISC_DOT11MC_UNASSOC_FTM_CFG)
status = wlan_misc_ioctl_dot11mc_unassoc_ftm_cfg(
pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_HAL_PHY_CFG)
else if (misc->sub_command == MLAN_OID_MISC_HAL_PHY_CFG)
status = wlan_misc_hal_phy_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RATE_ADAPT_CFG)
else if (misc->sub_command == MLAN_OID_MISC_RATE_ADAPT_CFG)
status = wlan_misc_ioctl_rate_adapt_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CCK_DESENSE_CFG)
else if (misc->sub_command == MLAN_OID_MISC_CCK_DESENSE_CFG)
status = wlan_misc_ioctl_cck_desense_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_ROBUSTCOEX)
else if (misc->sub_command == MLAN_OID_MISC_ROBUSTCOEX)
status = wlan_misc_robustcoex(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DMCS_CONFIG)
else if (misc->sub_command == MLAN_OID_MISC_DMCS_CONFIG)
status = wlan_misc_dmcs_config(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CONFIG_RTT)
else if (misc->sub_command == MLAN_OID_MISC_CONFIG_RTT)
status = wlan_config_rtt(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CANCEL_RTT)
else if (misc->sub_command == MLAN_OID_MISC_CANCEL_RTT)
status = wlan_cancel_rtt(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RTT_RESPONDER_CFG)
else if (misc->sub_command == MLAN_OID_MISC_RTT_RESPONDER_CFG)
status = wlan_rtt_responder_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_TX_RX_HISTOGRAM)
else if (misc->sub_command == MLAN_OID_MISC_GET_TX_RX_HISTOGRAM)
status =
wlan_get_tx_rx_histogram(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CFP_INFO)
else if (misc->sub_command == MLAN_OID_MISC_CFP_INFO)
status = wlan_get_cfpinfo(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_BOOT_SLEEP)
else if (misc->sub_command == MLAN_OID_MISC_BOOT_SLEEP)
status = wlan_misc_bootsleep(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DYN_BW)
else if (misc->sub_command == MLAN_OID_MISC_DYN_BW)
status = wlan_misc_ioctl_dyn_bw(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_TRPC_CFG)
else if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_TRPC_CFG)
status = wlan_get_chan_trpc_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_BAND_STEERING)
else if (misc->sub_command == MLAN_OID_MISC_BAND_STEERING)
status = wlan_misc_band_steering_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_BEACON_STUCK)
else if (misc->sub_command == MLAN_OID_MISC_BEACON_STUCK)
status = wlan_misc_beacon_stuck_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_REGIONPWR_CFG)
else if (misc->sub_command == MLAN_OID_MISC_GET_REGIONPWR_CFG)
status = wlan_get_rgchnpwr_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_REGION_POWER_CFG)
else if (misc->sub_command == MLAN_OID_MISC_REGION_POWER_CFG)
status = wlan_misc_region_power_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CFP_TABLE)
else if (misc->sub_command == MLAN_OID_MISC_CFP_TABLE)
status = wlan_get_cfp_table(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RANGE_EXT)
else if (misc->sub_command == MLAN_OID_MISC_RANGE_EXT)
status = wlan_misc_ioctl_range_ext(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_WACP_MODE)
else if (misc->sub_command == MLAN_OID_MISC_WACP_MODE)
status = wlan_misc_ioctl_wacp_mode(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_COUNTRY_CODE)
else if (misc->sub_command == MLAN_OID_MISC_COUNTRY_CODE)
status = wlan_misc_ioctl_country_code(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_REORDER_FLUSH_TIME)
else if (misc->sub_command == MLAN_OID_MISC_REORDER_FLUSH_TIME)
status = wlan_misc_ioctl_reorder_flush_time(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_EXT_CAP_CFG)
else if (misc->sub_command == MLAN_OID_MISC_EXT_CAP_CFG)
status = wlan_misc_ext_capa_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_TX_FRAME)
else if (misc->sub_command == MLAN_OID_MISC_TX_FRAME)
status =
wlan_misc_ioctl_tx_frame(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_EDMAC_CONFIG)
else if (misc->sub_command == MLAN_OID_MISC_EDMAC_CONFIG)
status = wlan_misc_ioctl_edmac_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CSI)
else if (misc->sub_command == MLAN_OID_MISC_CSI)
status = wlan_misc_csi(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MULTI_AP_CFG)
else if (misc->sub_command == MLAN_OID_MISC_MULTI_AP_CFG)
status = wlan_misc_multi_ap_cfg(pmadapter, pioctl_req);
break;
case MLAN_IOCTL_POWER_CFG:
@ -2368,21 +2441,21 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
break;
case MLAN_IOCTL_PM_CFG:
pm = (mlan_ds_pm_cfg *)pioctl_req->pbuf;
if (pm->sub_command == MLAN_OID_PM_CFG_PS_MODE)
status = wlan_uap_pm_ioctl_mode(pmadapter, pioctl_req);
if (pm->sub_command == MLAN_OID_PM_CFG_DEEP_SLEEP)
status = wlan_uap_pm_ioctl_deepsleep(pmadapter,
pioctl_req);
if (pm->sub_command == MLAN_OID_PM_CFG_HS_CFG)
status = wlan_pm_ioctl_hscfg(pmadapter, pioctl_req);
if (pm->sub_command == MLAN_OID_PM_HS_WAKEUP_REASON)
status = wlan_get_hs_wakeup_reason(pmadapter,
pioctl_req);
if (pm->sub_command == MLAN_OID_PM_MGMT_FILTER)
status = wlan_config_mgmt_filter(pmadapter, pioctl_req);
if (pm->sub_command == MLAN_OID_PM_INFO)
status = wlan_get_pm_info(pmadapter, pioctl_req);
if (pm->sub_command == MLAN_OID_PM_CFG_FW_WAKEUP_METHOD)
else if (pm->sub_command == MLAN_OID_PM_CFG_PS_MODE)
status = wlan_uap_pm_ioctl_mode(pmadapter, pioctl_req);
else if (pm->sub_command == MLAN_OID_PM_CFG_DEEP_SLEEP)
status = wlan_uap_pm_ioctl_deepsleep(pmadapter,
pioctl_req);
else if (pm->sub_command == MLAN_OID_PM_CFG_HS_CFG)
status = wlan_pm_ioctl_hscfg(pmadapter, pioctl_req);
else if (pm->sub_command == MLAN_OID_PM_HS_WAKEUP_REASON)
status = wlan_get_hs_wakeup_reason(pmadapter,
pioctl_req);
else if (pm->sub_command == MLAN_OID_PM_MGMT_FILTER)
status = wlan_config_mgmt_filter(pmadapter, pioctl_req);
else if (pm->sub_command == MLAN_OID_PM_CFG_FW_WAKEUP_METHOD)
status = wlan_fw_wakeup_method(pmadapter, pioctl_req);
break;
case MLAN_IOCTL_SNMP_MIB:
@ -2390,14 +2463,15 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (snmp->sub_command == MLAN_OID_SNMP_MIB_CTRL_DEAUTH)
status = wlan_uap_snmp_mib_ctrl_deauth(pmadapter,
pioctl_req);
if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11D)
else if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11D)
status = wlan_uap_snmp_mib_11d(pmadapter, pioctl_req);
if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H)
else if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H)
status = wlan_uap_snmp_mib_11h(pmadapter, pioctl_req);
if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR)
else if (snmp->sub_command ==
MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR)
status = wlan_uap_snmp_mib_11h_fakeradar(pmadapter,
pioctl_req);
if (snmp->sub_command == MLAN_OID_SNMP_MIB_CHAN_TRACK)
else if (snmp->sub_command == MLAN_OID_SNMP_MIB_CHAN_TRACK)
status = wlan_uap_snmp_mib_chan_track(pmadapter,
pioctl_req);
break;
@ -2406,12 +2480,15 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (sec->sub_command == MLAN_OID_SEC_CFG_ENCRYPT_KEY)
status = wlan_uap_sec_ioctl_set_encrypt_key(pmadapter,
pioctl_req);
if (sec->sub_command == MLAN_OID_SEC_CFG_WAPI_ENABLED)
else if (sec->sub_command == MLAN_OID_SEC_CFG_WAPI_ENABLED)
status = wlan_uap_sec_ioctl_wapi_enable(pmadapter,
pioctl_req);
if (sec->sub_command == MLAN_OID_SEC_CFG_REPORT_MIC_ERR)
else if (sec->sub_command == MLAN_OID_SEC_CFG_REPORT_MIC_ERR)
status = wlan_uap_sec_ioctl_report_mic_error(
pmadapter, pioctl_req);
else if (sec->sub_command == MLAN_OID_SEC_CFG_PASSPHRASE)
status = wlan_sec_ioctl_passphrase(pmadapter,
pioctl_req);
break;
case MLAN_IOCTL_11N_CFG:
status = wlan_11n_cfg_ioctl(pmadapter, pioctl_req);
@ -2423,51 +2500,58 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
else if (cfg11d->sub_command == MLAN_OID_11D_DOMAIN_INFO_EXT)
status =
wlan_11d_cfg_domain_info(pmadapter, pioctl_req);
#ifdef UAP_SUPPORT
else if (cfg11d->sub_command ==
MLAN_OID_11D_BCN_COUNTRY_IE_INFO)
status = wlan_11d_bcn_country_ie_info(pmadapter,
pioctl_req);
#endif
break;
case MLAN_IOCTL_11H_CFG:
cfg11h = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
if (cfg11h->sub_command == MLAN_OID_11H_CHANNEL_CHECK)
status = wlan_uap_11h_channel_check_req(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_DFS_TESTING)
else if (cfg11h->sub_command == MLAN_OID_11H_DFS_TESTING)
status = wlan_11h_ioctl_dfs_testing(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_NOP_INFO)
else if (cfg11h->sub_command == MLAN_OID_11H_CHAN_NOP_INFO)
status = wlan_11h_ioctl_channel_nop_info(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_NOP_CHAN_LIST)
else if (cfg11h->sub_command == MLAN_OID_11H_NOP_CHAN_LIST)
status = wlan_11h_ioctl_nop_channel_list(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_REPORT_REQUEST)
else if (cfg11h->sub_command ==
MLAN_OID_11H_CHAN_REPORT_REQUEST)
status = wlan_11h_ioctl_dfs_chan_report(pmpriv,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_SWITCH_COUNT)
else if (cfg11h->sub_command == MLAN_OID_11H_CHAN_SWITCH_COUNT)
status = wlan_11h_ioctl_chan_switch_count(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_DFS_STATE)
else if (cfg11h->sub_command == MLAN_OID_11H_CHAN_DFS_STATE)
status = wlan_11h_ioctl_chan_dfs_state(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_DFS_W53_CFG)
else if (cfg11h->sub_command == MLAN_OID_11H_DFS_W53_CFG)
status = wlan_11h_ioctl_dfs_w53_cfg(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_DFS_MODE)
else if (cfg11h->sub_command == MLAN_OID_11H_DFS_MODE)
status = wlan_11h_ioctl_dfs_mode(pmadapter, pioctl_req);
break;
case MLAN_IOCTL_RADIO_CFG:
radiocfg = (mlan_ds_radio_cfg *)pioctl_req->pbuf;
if (radiocfg->sub_command == MLAN_OID_MIMO_SWITCH)
status = wlan_radio_ioctl_mimo_switch_cfg(pmadapter,
pioctl_req);
if (radiocfg->sub_command == MLAN_OID_RADIO_CTRL)
status = wlan_radio_ioctl_radio_ctl(pmadapter,
pioctl_req);
if (radiocfg->sub_command == MLAN_OID_REMAIN_CHAN_CFG)
else if (radiocfg->sub_command == MLAN_OID_MIMO_SWITCH)
status = wlan_radio_ioctl_mimo_switch_cfg(pmadapter,
pioctl_req);
else if (radiocfg->sub_command == MLAN_OID_REMAIN_CHAN_CFG)
status = wlan_radio_ioctl_remain_chan_cfg(pmadapter,
pioctl_req);
if (radiocfg->sub_command == MLAN_OID_ANT_CFG)
else if (radiocfg->sub_command == MLAN_OID_ANT_CFG)
status =
wlan_radio_ioctl_ant_cfg(pmadapter, pioctl_req);
if (radiocfg->sub_command == MLAN_OID_BAND_CFG)
else if (radiocfg->sub_command == MLAN_OID_BAND_CFG)
status = wlan_radio_ioctl_band_cfg(pmadapter,
pioctl_req);
break;

View file

@ -3,7 +3,7 @@
* @brief This file contains AP mode transmit and receive functions
*
*
* Copyright 2009-2021, 2024 NXP
* Copyright 2009-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -161,8 +161,9 @@ t_void *wlan_ops_uap_process_txpd(t_void *priv, pmlan_buffer pmbuf)
/* head_ptr should be aligned */
head_ptr = pmbuf->pbuf + pmbuf->data_offset -
Tx_PD_SIZEOF(pmpriv->adapter) - pmpriv->intf_hr_len;
// Typecasting is done for alignment of head_ptr
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(DMA_ALIGNMENT - 1)));
plocal_tx_pd = (TxPD *)(head_ptr + pmpriv->intf_hr_len);
// coverity[bad_memset:SUPPRESS]
memset(pmpriv->adapter, plocal_tx_pd, 0, Tx_PD_SIZEOF(pmpriv->adapter));
@ -917,7 +918,8 @@ mlan_status wlan_process_uap_rx_packet(mlan_private *priv, pmlan_buffer pmbuf)
upload:
/* Chop off RxPD */
pmbuf->data_len -= prx_pd->rx_pkt_offset;
if (pmbuf->data_len >= prx_pd->rx_pkt_offset)
pmbuf->data_len -= prx_pd->rx_pkt_offset;
pmbuf->data_offset += prx_pd->rx_pkt_offset;
pmbuf->pparent = MNULL;

View file

@ -3,7 +3,7 @@
* @brief This file contains USB specific code
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -216,7 +216,8 @@ static mlan_status wlan_usb_prog_fw_w_helper(pmlan_adapter pmadapter,
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u8 *firmware = pmfw->pfw_buf, *RecvBuff;
const t_u8 *firmware = pmfw->pfw_buf;
t_u8 *RecvBuff;
t_u32 retries = MAX_FW_RETRY, DataLength;
t_u32 FWSeqNum = 0, TotalBytes = 0, DnldCmd = 0;
t_u8 *TxBuff = MNULL;

View file

@ -4,7 +4,7 @@
* spinlock and timer defines.
*
*
* Copyright 2008-2021 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -541,18 +541,17 @@ static INLINE t_s32 util_scalar_offset(
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
t_s32 newval;
t_s64 newval;
if (moal_spin_lock)
moal_spin_lock(pmoal_handle, pscalar->plock);
if (pscalar->value < (INT_MAX - offset))
newval = (pscalar->value += offset);
else
newval = (pscalar->value += offset);
if (newval > SINT32_MAX || newval < SINT32_MIN)
newval = 0;
if (moal_spin_unlock)
moal_spin_unlock(pmoal_handle, pscalar->plock);
return newval;
return (t_s32)newval;
}
/**

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for WMM.
*
*
* Copyright 2008-2021, 2024-2025 NXP
* Copyright 2008-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -839,6 +839,7 @@ static raListTbl *wlan_wmm_get_highest_priolist_ptr(pmlan_adapter pmadapter,
/**
* @brief Calculates byte budget based on time budget and currect PHY rate
*
* @param pmadapter Pointer to the mlan_adapter structure
* @param time_budget_us Time budget in usec
* @param phy_rate_kbps TX PHY rate in kbit/sec
*
@ -1499,6 +1500,9 @@ static raListTbl *wlan_wmm_get_next_priolist_ptr(pmlan_adapter pmadapter,
void *const pmoal_handle = pmadapter->pmoal_handle;
raListTbl *ra_list = MNULL;
if (!pmadapter->priv_num)
return MNULL;
if (!pmadapter->mclient_tx_supported)
return wlan_wmm_get_highest_priolist_ptr(pmadapter, priv, tid);
@ -1590,6 +1594,10 @@ static INLINE void wlan_send_single_packet(pmlan_private priv, raListTbl *ptr,
ENTER();
if (ptrindex < 0 || ptrindex >= MAX_NUM_TID) {
LEAVE();
return;
}
pmbuf = (pmlan_buffer)util_dequeue_list(pmadapter->pmoal_handle,
&ptr->buf_head, MNULL, MNULL);
if (pmbuf) {
@ -1816,9 +1824,14 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
ENTER();
if (!pmadapter->priv_num) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
ptr = wlan_wmm_get_next_priolist_ptr(pmadapter, &priv, &ptrindex);
if (!ptr) {
if (!ptr || ptrindex < 0) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -2577,6 +2590,8 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra)
ra_list->is_tdls_link = MTRUE;
} else {
ra_list->is_wmm_enabled = IS_11N_ENABLED(priv);
ra_list->is_wmm_enabled |=
IS_116E_ENABLED(priv);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu = priv->max_amsdu;
}
@ -2968,6 +2983,8 @@ int wlan_ralist_update(mlan_private *priv, t_u8 *old_ra, t_u8 *new_ra)
priv, new_ra);
} else {
ra_list->is_wmm_enabled = IS_11N_ENABLED(priv);
ra_list->is_wmm_enabled |=
IS_116E_ENABLED(priv);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu = priv->max_amsdu;
}
@ -3394,7 +3411,7 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
while (resp_len >= (int)sizeof(ptlv_hdr->header)) {
ptlv_hdr = (MrvlIEtypes_Data_t *)pcurrent;
tlv_len = wlan_le16_to_cpu(ptlv_hdr->header.len);
if ((int)(tlv_len + sizeof(ptlv_hdr->header)) > resp_len) {
if ((tlv_len + sizeof(ptlv_hdr->header)) > resp_len) {
PRINTM(MERROR,
"WMM get status: Error in processing TLV buffer\n");
resp_len = 0;
@ -3615,7 +3632,7 @@ t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv,
{
t_u8 ret_val = 0;
t_u32 out_ts_sec, out_ts_usec;
t_s32 queue_delay;
t_s32 queue_delay, delay;
t_s32 temp_delay = 0;
ENTER();
@ -3645,8 +3662,8 @@ t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv,
*
* Pass max value if queue_delay is beyond the uint8 range
*/
ret_val = (t_u8)(MIN(queue_delay, (t_s32)priv->wmm.drv_pkt_delay_max) >>
1);
delay = MIN(queue_delay, (t_s32)priv->wmm.drv_pkt_delay_max) >> 1;
ret_val = (t_u8)delay;
PRINTM(MINFO, "WMM: Pkt Delay: %d ms, %d ms sent to FW\n", queue_delay,
ret_val);
@ -3666,6 +3683,11 @@ void wlan_wmm_process_tx(pmlan_adapter pmadapter)
{
ENTER();
if (!pmadapter->priv_num) {
LEAVE();
return;
}
do {
if (wlan_dequeue_tx_packet(pmadapter))
break;
@ -3741,6 +3763,11 @@ static INLINE t_u8 wlan_del_tx_pkts_in_ralist(pmlan_private priv,
pmlan_buffer pmbuf = MNULL;
t_u8 ret = MFALSE;
ENTER();
if (tid < 0 || tid >= MAX_NUM_TID) {
LEAVE();
return ret;
}
ra_list = (raListTbl *)util_peek_list(priv->adapter->pmoal_handle,
ra_list_head, MNULL, MNULL);
while (ra_list && ra_list != (raListTbl *)ra_list_head) {
@ -3795,6 +3822,8 @@ t_void wlan_drop_tx_pkts(pmlan_private priv)
pmadapter->callbacks.moal_spin_lock(pmadapter->pmoal_handle,
priv->wmm.ra_list_spinlock);
for (j = 0; j < MAX_NUM_TID; j++, i++) {
if (i < 0)
break;
if (i == MAX_NUM_TID)
i = 0;
if (wlan_del_tx_pkts_in_ralist(
@ -4149,6 +4178,7 @@ mlan_status wlan_ret_wmm_addts_req(pmlan_private pmpriv,
/* Copy the TSPEC data include any extra IEs after the
* TSPEC */
// coverity[cert_arr30_c_violation: SUPPRESS]
memcpy_ext(pmpriv->adapter, paddts->ie_data,
presp_addts->tspec_data, paddts->ie_data_len,
sizeof(paddts->ie_data));
@ -4212,7 +4242,7 @@ mlan_status wlan_ret_wmm_delts_req(pmlan_private pmpriv,
mlan_ioctl_req *pioctl_buf)
{
mlan_ds_wmm_cfg *pwmm;
IEEEtypes_WMM_TSPEC_t *ptspec_ie;
const IEEEtypes_WMM_TSPEC_t *ptspec_ie;
const HostCmd_DS_WMM_DELTS_REQ *presp_delts = &resp->params.del_ts;
ENTER();
@ -4226,7 +4256,7 @@ mlan_status wlan_ret_wmm_delts_req(pmlan_private pmpriv,
presp_delts->command_result);
if (pwmm->param.delts.result == 0) {
ptspec_ie = (IEEEtypes_WMM_TSPEC_t *)
ptspec_ie = (const IEEEtypes_WMM_TSPEC_t *)
presp_delts->tspec_data;
wlan_send_wmmac_host_event(
pmpriv, "DELTS_TX", MNULL,
@ -4679,7 +4709,7 @@ static mlan_status wlan_wmm_ioctl_ts_status(pmlan_adapter pmadapter,
* @return MLAN_STATUS_SUCCESS
*/
mlan_status wlan_cmd_wmm_param_config(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u8 cmd_action,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf)
{
wmm_ac_parameters_t *ac_params = (wmm_ac_parameters_t *)pdata_buf;
@ -4721,22 +4751,22 @@ mlan_status wlan_ret_wmm_param_config(pmlan_private pmpriv,
mlan_ioctl_req *pioctl_buf)
{
mlan_ds_wmm_cfg *pwmm = MNULL;
HostCmd_DS_WMM_PARAM_CONFIG *pcfg =
(HostCmd_DS_WMM_PARAM_CONFIG *)&resp->params.param_config;
const HostCmd_DS_WMM_PARAM_CONFIG *pcfg =
(const HostCmd_DS_WMM_PARAM_CONFIG *)&resp->params.param_config;
t_u8 i;
ENTER();
if (pioctl_buf) {
pwmm = (mlan_ds_wmm_cfg *)pioctl_buf->pbuf;
for (i = 0; i < MAX_AC_QUEUES; i++) {
pcfg->ac_params[i].tx_op_limit = wlan_le16_to_cpu(
pcfg->ac_params[i].tx_op_limit);
}
memcpy_ext(pmpriv->adapter, pwmm->param.ac_params,
pcfg->ac_params,
sizeof(wmm_ac_parameters_t) * MAX_AC_QUEUES,
sizeof(wmm_ac_parameters_t) * MAX_AC_QUEUES);
for (i = 0; i < MAX_AC_QUEUES; i++) {
pwmm->param.ac_params[i].tx_op_limit = wlan_le16_to_cpu(
pwmm->param.ac_params[i].tx_op_limit);
}
}
LEAVE();
@ -5029,12 +5059,29 @@ static t_u32 wlam_wmm_get_he_rate(t_u32 bw, t_u32 gi, t_u32 nss, t_u32 mcs)
t_u32 rate;
static const t_u32 he_80_3p2_gi_mcS_to_rate[] = {
ieee_mbit_rate(30.6), ieee_mbit_rate(61.3),
ieee_mbit_rate(91.9), ieee_mbit_rate(122.5),
/* intentional float value multiplication with 1000 */
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(30.6),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(61.3),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(91.9),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(122.5),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(183.8), ieee_mbit_rate(245),
ieee_mbit_rate(275.6), ieee_mbit_rate(306.3),
ieee_mbit_rate(367.5), ieee_mbit_rate(408.3),
ieee_mbit_rate(459.4), ieee_mbit_rate(510.4)};
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(275.6),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(306.3),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(367.5),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(408.3),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(459.4),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(510.4)};
if (mcs >= NELEMENTS(he_80_3p2_gi_mcS_to_rate))
return 0;
@ -5088,11 +5135,27 @@ static t_u32 wlam_wmm_get_vht_rate(t_u32 bw, t_u32 sgi, t_u32 nss, t_u32 mcs)
t_u32 rate;
static const t_u32 vht_80_lgi_mcs_to_rate[] = {
ieee_mbit_rate(29.3), ieee_mbit_rate(58.5),
ieee_mbit_rate(87.8), ieee_mbit_rate(117.0),
ieee_mbit_rate(175.5), ieee_mbit_rate(234.0),
ieee_mbit_rate(263.3), ieee_mbit_rate(292.5),
ieee_mbit_rate(351.0), ieee_mbit_rate(390.0)};
/* intentional float value multiplication with 1000 */
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(29.3),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(58.5),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(87.8),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(117.0),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(175.5),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(234.0),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(263.3),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(292.5),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(351.0),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(390.0)};
if (mcs >= NELEMENTS(vht_80_lgi_mcs_to_rate))
return 0;
@ -5138,11 +5201,25 @@ static t_u32 wlam_wmm_get_ht_rate(t_u32 bw, t_u32 sgi, t_u32 mcs)
t_u32 rate;
static const t_u32 ht_20_lgi_mcs_to_rate[] = {
ieee_mbit_rate(6.5), ieee_mbit_rate(13), ieee_mbit_rate(19.5),
ieee_mbit_rate(26), ieee_mbit_rate(39), ieee_mbit_rate(52),
ieee_mbit_rate(58.5), ieee_mbit_rate(65), ieee_mbit_rate(13),
ieee_mbit_rate(26), ieee_mbit_rate(39), ieee_mbit_rate(52),
ieee_mbit_rate(78), ieee_mbit_rate(104), ieee_mbit_rate(117),
/* intentional float value multiplication with 1000 */
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(6.5),
ieee_mbit_rate(13),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(19.5),
ieee_mbit_rate(26),
ieee_mbit_rate(39),
ieee_mbit_rate(52),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(58.5),
ieee_mbit_rate(65),
ieee_mbit_rate(13),
ieee_mbit_rate(26),
ieee_mbit_rate(39),
ieee_mbit_rate(52),
ieee_mbit_rate(78),
ieee_mbit_rate(104),
ieee_mbit_rate(117),
ieee_mbit_rate(130),
};
@ -5176,11 +5253,22 @@ static t_u32 wlam_wmm_get_ht_rate(t_u32 bw, t_u32 sgi, t_u32 mcs)
static t_u32 wlam_wmm_get_legacy_rate(t_u32 rate_idx)
{
static const t_u32 legacy_rate_idx_to_rate[] = {
ieee_mbit_rate(1), ieee_mbit_rate(2), ieee_mbit_rate(5.5),
ieee_mbit_rate(11), ieee_mbit_rate(22), ieee_mbit_rate(6),
ieee_mbit_rate(9), ieee_mbit_rate(12), ieee_mbit_rate(18),
ieee_mbit_rate(24), ieee_mbit_rate(36), ieee_mbit_rate(48),
ieee_mbit_rate(54), ieee_mbit_rate(72),
/* intentional float value multiplication with 1000 */
ieee_mbit_rate(1),
ieee_mbit_rate(2),
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
ieee_mbit_rate(5.5),
ieee_mbit_rate(11),
ieee_mbit_rate(22),
ieee_mbit_rate(6),
ieee_mbit_rate(9),
ieee_mbit_rate(12),
ieee_mbit_rate(18),
ieee_mbit_rate(24),
ieee_mbit_rate(36),
ieee_mbit_rate(48),
ieee_mbit_rate(54),
ieee_mbit_rate(72),
};
if (rate_idx >= NELEMENTS(legacy_rate_idx_to_rate))

View file

@ -4,7 +4,7 @@
* of wmm functionalities
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -154,7 +154,7 @@ extern void wlan_wmm_setup_queues(pmlan_private priv);
void wlan_wmm_default_queue_priorities(pmlan_private priv);
/* process wmm_param_config command */
mlan_status wlan_cmd_wmm_param_config(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u8 cmd_action,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
/* process wmm_param_config command response */

View file

@ -3,7 +3,7 @@
* @brief This file declares the generic data structures and APIs.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2022, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -345,9 +345,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/* We support up to 480-byte block size due to FW buffer limitation. */
#define MLAN_SDIO_BLOCK_SIZE 256
/** define SDIO block size for firmware download */
#define MLAN_SDIO_BLOCK_SIZE_FW_DNLD MLAN_SDIO_BLOCK_SIZE
/** define allocated buffer size */
#define ALLOC_BUF_SIZE MLAN_RX_DATA_BUF_SIZE
/** SDIO MP aggr pkt limit */
@ -677,7 +674,9 @@ typedef enum {
#define MEVT_D MBIT(18)
#define MFW_D MBIT(19)
#define MIF_D MBIT(20)
#ifdef FWDUMP_VIA_PRINT
#define MFWDP_D MBIT(21)
#endif /*FWDUMP_VIA_PRINT*/
#define MSCH_D MBIT(22)
#define MENTRY MBIT(28)
#define MWARN MBIT(29)
@ -913,6 +912,9 @@ typedef enum _mlan_event_id {
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE = 0x80000036,
#endif
MLAN_EVENT_ID_DRV_RGPWR_KEY_MISMATCH = 0x80000037,
#if defined(STA_SUPPORT)
MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO = 0x80000038,
#endif
MLAN_EVENT_ID_DRV_ASSOC_FAILURE = 0x80000039,
} mlan_event_id;
@ -920,7 +922,7 @@ typedef enum _mlan_event_id {
/** mlan_image data structure */
typedef struct _mlan_fw_image {
/** Firmware image buffer pointer */
t_u8 *pfw_buf;
const t_u8 *pfw_buf;
/** Firmware image length */
t_u32 fw_len;
/** Firmware reload flag */
@ -1096,6 +1098,30 @@ typedef MLAN_PACK_START struct _chan_band_info {
t_u8 is_dfs_chan;
} MLAN_PACK_END chan_band_info;
#if defined(STA_SUPPORT)
/** MrvlIEtypes_chan_band_reginfo_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_chan_band_reginfo_t {
/** Header */
MrvlIEtypesHeader_t header;
/** Band Configuration */
Band_Config_t bandcfg;
/** channel */
t_u8 channel;
/** Reg Info */
t_u8 regInfo;
} MLAN_PACK_END MrvlIEtypes_chan_band_reginfo_t;
/** Structure to store 6E Channel/Band/Regulatory Info */
typedef MLAN_PACK_START struct _chan_band_reginfo_t {
/** Band Configuration */
Band_Config_t bandcfg;
/** channel */
t_u8 channel;
/** Reg Info */
t_u8 regInfo;
} MLAN_PACK_END chan_band_reginfo_t;
#endif
/** Channel usability flags */
#define NXP_CHANNEL_NO_OFDM MBIT(9)
#define NXP_CHANNEL_NO_CCK MBIT(8)
@ -1222,7 +1248,7 @@ typedef struct _mlan_ioctl_req {
/** Request id */
t_u32 req_id;
/** Action: set or get */
t_u32 action;
t_u16 action;
/** Pointer to buffer */
t_u8 *pbuf;
/** Length of buffer */
@ -1252,6 +1278,36 @@ typedef MLAN_PACK_START struct _mix_rate_info {
t_u8 dcm;
} MLAN_PACK_END mix_rate_info, *pmix_rate_info;
typedef MLAN_PACK_START struct _radiotap_timestamp {
/* device timestamp */
t_u64 device_timestamp;
/* accuracy */
t_u16 accuracy;
/* unit:
* 0 milliseconds,
* 1 microseconds,
* 2 nanoseconds,
* 3-15 reserved */
// coverity[misra_c_2012_rule_6_1_violation:SUPPRESS]
t_u8 unit : 4;
/* position:
* 0 first bit (or symbol containing it) of MPDU - matches TSFT field
* 1 signal acquisition at start of PLCP
* 2 end of PPDU
* 3 end of MPDU (after FCS)
* 4-14 reserved
* 15 unknown or vendor/OOB defined
*/
// coverity[misra_c_2012_rule_6_1_violation:SUPPRESS]
t_u8 position : 4;
/* flags
* 0x01 32-bit counter (high 32 bits are unused)
* 0x02 accuracy known
* 0xFC reserved
*/
t_u8 flags;
} MLAN_PACK_END radiotap_timestamp, *pradiotap_timestamp;
typedef MLAN_PACK_START struct _rxpd_extra_info {
/** flags */
t_u8 flags;
@ -1267,6 +1323,12 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
t_u32 vht_he_sig2;
/** HE user idx */
t_u32 user_idx;
/** timestamp */
radiotap_timestamp timestamp;
/** PLCP CRC Failed */
t_u8 plcp_crc_failed;
t_u8 rssi_dbm_a;
t_u8 rssi_dbm_b;
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
typedef MLAN_PACK_START struct _radiotap_info {
@ -1281,6 +1343,8 @@ typedef MLAN_PACK_START struct _radiotap_info {
/** chan number */
t_u8 chan_num;
t_u8 antenna;
/** extra radiotap */
t_u8 radiotap_extra;
/** extra rxpd info from FW */
rxpd_extra_info extra_info;
} MLAN_PACK_END radiotap_info, *pradiotap_info;
@ -1568,6 +1632,8 @@ typedef MLAN_PACK_START struct _tlvbuf_custom_ie {
tlvbuf_max_mgmt_ie max_mgmt_ie;
} MLAN_PACK_END mlan_ds_misc_custom_ie;
#define FW_STUCK_CODE_VERSION_MISMATCH (0x90)
/** Max TDLS config data length */
#define MAX_TDLS_DATA_LEN 1024
@ -2629,6 +2695,8 @@ typedef struct _mlan_callbacks {
unsigned int rsvd1);
void (*moal_amsdu_tp_accounting)(t_void *pmoal, t_s32 delay,
t_s32 copy_delay);
mlan_status (*moal_calc_short_ssid)(t_u8 *pssid, t_u32 ssid_len,
t_u32 *pshort_ssid);
} mlan_callbacks, *pmlan_callbacks;
/** Parameter unchanged, use MLAN default setting */
@ -2711,6 +2779,10 @@ typedef struct _mlan_device {
/** SDIO MPA Rx */
t_u32 mpa_rx_cfg;
#ifdef SDIO
/** host max block num */
t_u32 max_blk_count;
/** sdio blk size */
t_u32 sdio_blk_size;
/** SDIO Single port rx aggr */
t_u8 sdio_rx_aggr_enable;
/* see blk_queue_max_segment_size */
@ -2800,6 +2872,7 @@ typedef struct _mlan_device {
t_u16 tx_budget;
t_u8 mclient_scheduling;
t_u8 disable_11h_tpc;
t_u8 tpe_ie_ignore;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */

View file

@ -29,6 +29,121 @@ Change log:
#ifndef _MLAN_IEEE_H_
#define _MLAN_IEEE_H_
/* center frequency description */
struct center_freq_desc {
t_u8 pri_chan;
t_u8 ch_40;
t_u8 ch_80;
t_u8 ch_160;
};
/* List of 5GHZ channels */
static const struct center_freq_desc center_freq_idx_map_5g[] = {
{.pri_chan = 36, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 40, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 44, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 48, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 52, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 56, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 60, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 64, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 68, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 72, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 76, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 80, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 84, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 88, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 92, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 96, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 100, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 104, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 108, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 112, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 116, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 120, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 124, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 128, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 132, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 136, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 140, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 144, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 149, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 153, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 157, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 161, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 165, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 169, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 173, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 177, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 184, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 188, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 192, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 196, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 0, .ch_40 = 42 /* terminator with default cfreq */}};
/* List of 6GHZ channels */
static const struct center_freq_desc center_freq_idx_map_6g[] = {
{.pri_chan = 1, .ch_40 = 3, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 5, .ch_40 = 3, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 9, .ch_40 = 11, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 13, .ch_40 = 11, .ch_80 = 7, .ch_160 = 15},
{.pri_chan = 17, .ch_40 = 19, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 21, .ch_40 = 19, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 25, .ch_40 = 27, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 29, .ch_40 = 27, .ch_80 = 23, .ch_160 = 15},
{.pri_chan = 33, .ch_40 = 35, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 37, .ch_40 = 35, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 41, .ch_40 = 43, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 45, .ch_40 = 43, .ch_80 = 39, .ch_160 = 47},
{.pri_chan = 49, .ch_40 = 51, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 53, .ch_40 = 51, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 57, .ch_40 = 59, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 61, .ch_40 = 59, .ch_80 = 55, .ch_160 = 47},
{.pri_chan = 65, .ch_40 = 67, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 69, .ch_40 = 67, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 73, .ch_40 = 75, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 77, .ch_40 = 75, .ch_80 = 71, .ch_160 = 79},
{.pri_chan = 81, .ch_40 = 83, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 85, .ch_40 = 83, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 89, .ch_40 = 91, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 93, .ch_40 = 91, .ch_80 = 87, .ch_160 = 79},
{.pri_chan = 97, .ch_40 = 99, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 101, .ch_40 = 99, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 105, .ch_40 = 107, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 109, .ch_40 = 107, .ch_80 = 103, .ch_160 = 111},
{.pri_chan = 113, .ch_40 = 115, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 117, .ch_40 = 115, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 121, .ch_40 = 123, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 125, .ch_40 = 123, .ch_80 = 119, .ch_160 = 111},
{.pri_chan = 129, .ch_40 = 131, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 133, .ch_40 = 131, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 137, .ch_40 = 139, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 141, .ch_40 = 139, .ch_80 = 135, .ch_160 = 143},
{.pri_chan = 145, .ch_40 = 147, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 149, .ch_40 = 147, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 153, .ch_40 = 155, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 157, .ch_40 = 155, .ch_80 = 151, .ch_160 = 143},
{.pri_chan = 161, .ch_40 = 163, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 165, .ch_40 = 163, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 169, .ch_40 = 171, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 173, .ch_40 = 171, .ch_80 = 167, .ch_160 = 175},
{.pri_chan = 177, .ch_40 = 179, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 181, .ch_40 = 179, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 185, .ch_40 = 187, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 189, .ch_40 = 187, .ch_80 = 183, .ch_160 = 175},
{.pri_chan = 193, .ch_40 = 195, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 197, .ch_40 = 195, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 201, .ch_40 = 203, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 205, .ch_40 = 203, .ch_80 = 199, .ch_160 = 207},
{.pri_chan = 209, .ch_40 = 211, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 213, .ch_40 = 211, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 217, .ch_40 = 219, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 221, .ch_40 = 219, .ch_80 = 215, .ch_160 = 207},
{.pri_chan = 225, .ch_40 = 227, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 229, .ch_40 = 227, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 233, .ch_40 = 0, .ch_80 = 0, .ch_160 = 0},
{.pri_chan = 0, .ch_40 = 37 /* terminator with default cfreq */}};
/** WLAN header size */
#define IEEE80211_HEADER_SIZE 24
@ -123,6 +238,14 @@ typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
AID_INFO = 197,
QUIET_CHAN = 198,
OPER_MODE_NTF = 199,
RNR = 201,
FILS_SESSION = 210,
FILS_PMKID_LIST = 211,
FILS_IP_REQ = 212,
FILS_IP_RESP = 213,
FILS_KEY_AUTH = 214,
FILS_KEY_DELIVERY = 215,
FILS_INDICATION = 240,
ERP_INFO = 42,
@ -1507,6 +1630,52 @@ typedef MLAN_PACK_START struct _IEEEtypes_Element_t {
t_u8 data[];
} MLAN_PACK_END IEEEtypes_Element_t, *pIEEEtypes_Element_t;
typedef MLAN_PACK_START struct _IEEEtypes_6G_control_t {
#ifdef BIG_ENDIAN_SUPPORT
/** reserved */
t_u8 reserved : 2; /* bit 6-7 */
/** regulatory info */
t_u8 regulatory_info : 3; /* bit 3-5 */
/** duplicate_beacon */
t_u8 duplicate_beacon : 1; /* bit 2 */
/** channel width */
t_u8 channel_width : 2; /* bit 0-1 */
#else
/** channel width */
t_u8 channel_width : 2; /* bit 0-1 */
/** duplicate_beacon */
t_u8 duplicate_beacon : 1; /* bit 2 */
/** regulatory info */
t_u8 regulatory_info : 3; /* bit 3-5 */
/** reserved */
t_u8 reserved : 2; /* bit 6-7 */
#endif
} MLAN_PACK_END IEEEtypes_6G_control_t;
/* IEEEtypes_He6GOpInfo_t */
typedef MLAN_PACK_START struct _IEEEtypes_He6GOpInfo_t {
/** primary channel */
t_u8 primary_channel;
/** control */
IEEEtypes_6G_control_t control;
/** center freq0 */
t_u8 channel_center_freq0;
/** center freq1 */
t_u8 channel_center_freq1;
/** minimum rate */
t_u8 minimum_rate;
} MLAN_PACK_END IEEEtypes_He6GOpInfo_t, *pIEEEtypes_He6GOpInfo_t;
/* IEEEtypes_HE6GCap_t */
typedef MLAN_PACK_START struct _IEEEtypes_HE6GCap_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** Element id extension */
t_u8 ext_id;
/** he 6g capability */
t_u16 capa;
} MLAN_PACK_END IEEEtypes_HE6GCap_t, *pIEEEtypes_HE6GCap_t;
/** default channel switch count */
#define DEF_CHAN_SWITCH_COUNT 5
@ -1762,7 +1931,7 @@ typedef MLAN_PACK_START struct {
#define MAX_SCAN_RSP_BUF (16 * 1024)
/** Maximum number of channels that can be sent in user scan config */
#define WLAN_USER_SCAN_CHAN_MAX 50
#define WLAN_USER_SCAN_CHAN_MAX 109
/** Maximum length of SSID list */
#define MRVDRV_MAX_SSID_LIST_LENGTH 10
@ -1826,6 +1995,105 @@ typedef MLAN_PACK_START struct _ChanStatistics_t {
t_u8 max_rss;
} MLAN_PACK_END ChanStatistics_t;
#define MLAN_6G_CHAN_MAX 59
#define MLAN_RNR_COLOC_AP_MAX MLAN_6G_CHAN_MAX
#define WLAN_MAX_6G_SCAN_PARAMS_LIST 20
#define SHORT_SSID_VALID MBIT(0)
#define UNSOLICITED_PROBE MBIT(1)
/**
* IOCTL 6g scan params List sub-structure sent in wlan_ioctl_user_scan_cfg
*/
typedef MLAN_PACK_START struct _wlan_6g_scan_params {
/** scan channel */
t_u8 channel;
/** bit0: short_ssid_valid, bit1: unsolicited_probe */
t_u16 flags;
/** short ssid */
t_u32 short_ssid;
/** bssid */
t_u8 bssid[6];
} MLAN_PACK_END wlan_6g_scan_params;
/*
* Reduced Neighbor Report(RNR), based on 802.11ax-2021,
* section 9.4.2.170.
*/
#define IEEE80211_RNR_TBTT_INFO_OFFSET_BSSID_BSSPARAMS 9
#define IEEE80211_RNR_TBTT_INFO_OFFSET_BSSID_SSSID_BSSPARAMS 13
/** Get count of TBTT Information (bit 7:4) */
#define GET_RNR_TBTT_INFO_HDR_COUNT(hdr) ((hdr >> 4) & 0x0f)
#define GET_RNR_TBTT_INFO_BSSPARAMS_BIT(bss_params, bit) \
(bss_params >> bit) & 0x01
/** RNR BSS parameters */
typedef MLAN_PACK_START struct _IEEEtypes_RnrBssParams_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 rsrvd : 1;
/** Co-Located AP */
t_u8 colocated : 1;
/** Unsolicited Probe Responses Active */
t_u8 unsolicited_probe : 1;
/** Member Of ESS With 2.4/5 GHz Co-Located AP */
t_u8 colocated_ess : 1;
/** Transmitted BSSID */
t_u8 transmitted_bssid : 1;
/** Multiple BSSID */
t_u8 multi_bss : 1;
/** Same SSID */
t_u8 same_ssid : 1;
/** OCT Recommended */
t_u8 oct_recommended : 1;
#else
/** OCT Recommended */
t_u8 oct_recommended : 1;
/** Same SSID */
t_u8 same_ssid : 1;
/** Multiple BSSID */
t_u8 multi_bss : 1;
/** Transmitted BSSID */
t_u8 transmitted_bssid : 1;
/** Member Of ESS With 2.4/5 GHz Co-Located AP */
t_u8 colocated_ess : 1;
/** Unsolicited Probe Responses Active */
t_u8 unsolicited_probe : 1;
/** Co-Located AP */
t_u8 colocated : 1;
/** Reserved */
t_u8 rsrvd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_RnrBssParams_t, *pIEEEtypes_RnrBssParams_t;
/** structure for RNR Neighbor AP Information */
typedef MLAN_PACK_START struct _IEEEtypes_RnrNeighborApInfo_t {
/* TBTT Information Header */
t_u8 tbtt_info_hdr;
/* TBTT Information Length */
t_u8 tbtt_info_len;
/** Operating Class */
t_u8 oper_class;
/** Channel Number */
t_u8 chan_number;
} MLAN_PACK_END IEEEtypes_RnrNeighborApInfo_t, *pIEEEtypes_RnrNeighborApInfo_t;
/** structure for RNR colocated ap */
typedef MLAN_PACK_START struct _RnrColocatedAp_t {
/** BSSID */
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
/** SSID */
mlan_802_11_ssid ssid;
/** Short-SSID */
t_u32 short_ssid;
/** Operating Class */
t_u8 oper_class;
/** Channel Number */
t_u8 chan_number;
/** BSS parameters */
IEEEtypes_RnrBssParams_t bss_params;
} MLAN_PACK_END RnrColocatedAp_t, *pRnrColocatedAp_t;
/** Enhance ext scan type defination */
typedef enum _MLAN_EXT_SCAN_TYPE {
EXT_SCAN_DEFAULT,
@ -1893,6 +2161,10 @@ typedef MLAN_PACK_START struct {
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
/** use scan setting from scan_cfg only */
t_u8 scan_cfg_only;
/**num of 6g scan params for OOB scan */
t_u8 num_6g_scan_params;
/** 6g scan params for OOB scan */
wlan_6g_scan_params scan_param_list[WLAN_MAX_6G_SCAN_PARAMS_LIST];
} MLAN_PACK_END wlan_user_scan_cfg;
/** Default scan interval in millisecond*/
@ -1915,7 +2187,7 @@ typedef MLAN_PACK_START struct {
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
#define CHAN_MAX_6G 0
#define CHAN_MAX_6G 59 // reference from cfg80211_channels_6ghz table
/** max bgscan chan number */
#define WLAN_BG_SCAN_CHAN_MAX 38
@ -1923,6 +2195,9 @@ typedef MLAN_PACK_START struct {
/** max bgscan chan number, include UNII_4 channel */
#define WLAN_BG_SCAN_CHAN_MAX_UNII_4 41
/** max bgscan chan number, 3 + 38 + 59 */
#define WLAN_BG_SCAN_CHAN_MAX_6E 100
/** Enumeration definition */
/** EES MODE */
typedef enum {
@ -2019,6 +2294,8 @@ typedef MLAN_PACK_START struct {
/** Array of ees config struct */
ees_ssid_config ees_ssid_cfg[EES_MAX_SSIDS];
t_u8 random_mac[MLAN_MAC_ADDR_LENGTH];
/** 11ai indication */
t_u8 dot11ai;
} MLAN_PACK_END wlan_bgscan_cfg;
#endif /* STA_SUPPORT */
@ -2027,6 +2304,9 @@ typedef MLAN_PACK_START struct {
/** The security AP in OWE trsnsition Mode */
#define OWE_TRANS_MODE_OWE 2
#define VENDOR_OUI_LEN 4
#define MAX_VENDOR_OUI_NUM 10
#ifdef PRAGMA_PACK
#pragma pack(pop)
#endif
@ -2188,6 +2468,14 @@ typedef struct _BSSDescriptor_t {
IEEEtypes_Extension_t *phe_oprat;
/** HE operation IE offset */
t_u16 he_oprat_offset;
/** HE 6G Capability IE */
IEEEtypes_HE6GCap_t *phe_6g_cap;
/** HE 6G Capability IE offset */
t_u16 he_6g_cap_offset;
/** RNR IE */
IEEEtypes_Generic_t *prnr_ie;
/** RNR IE offset in the beacon buffer */
t_u16 rnr_offset;
#ifdef STA_SUPPORT
/** Country information set */
IEEEtypes_CountryInfoFullSet_t country_info;
@ -2231,6 +2519,10 @@ typedef struct _BSSDescriptor_t {
t_u32 beacon_buf_size_max;
/** scan age in secs */
t_u32 age_in_secs;
/** vendor oui list */
t_u8 vendor_oui[VENDOR_OUI_LEN * MAX_VENDOR_OUI_NUM];
/** vendor OUI count */
t_u8 vendor_oui_count;
} BSSDescriptor_t, *pBSSDescriptor_t;
#endif /* !_MLAN_IEEE_H_ */

View file

@ -3,7 +3,7 @@
* @brief This file declares the IOCTL data structures and APIs.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -220,6 +220,9 @@ enum _mlan_ioctl_req_id {
MLAN_OID_11D_DOMAIN_INFO = 0x000D0003,
#endif
MLAN_OID_11D_DOMAIN_INFO_EXT = 0x000D0004,
#ifdef UAP_SUPPORT
MLAN_OID_11D_BCN_COUNTRY_IE_INFO = 0x000D0005,
#endif
/* Register Memory Access Group */
MLAN_IOCTL_REG_MEM = 0x000E0000,
@ -310,6 +313,7 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_COALESCE_CFG = 0x0020002E,
MLAN_OID_MISC_TDLS_IDLE_TIME = 0x0020002F,
MLAN_OID_MISC_GET_SENSOR_TEMP = 0x00200030,
MLAN_OID_FILS_IP_CFG = 0x00200035,
MLAN_OID_MISC_IPV6_RA_OFFLOAD = 0x00200036,
MLAN_OID_MISC_GTK_REKEY_OFFLOAD = 0x00200037,
MLAN_OID_MISC_OPER_CLASS = 0x00200038,
@ -377,6 +381,7 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_RF_TEST_CONFIG_TRIGGER_FRAME = 0x0020008C,
MLAN_OID_MISC_OFDM_DESENSE_CFG = 0x0020008D,
MLAN_OID_MISC_TSP_CFG = 0x002008C,
MLAN_OID_SCAN_6G_CONFIG = 0x0020008E,
MLAN_OID_MISC_REORDER_FLUSH_TIME = 0x0020008F,
MLAN_OID_MISC_NAV_MITIGATION = 0x00200090,
MLAN_OID_MISC_LED_CONFIG = 0x00200091,
@ -384,9 +389,11 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_EDMAC_CONFIG = 0x00200093,
MLAN_OID_MISC_GPIO_CFG = 0x00200094,
MLAN_OID_MISC_REGION_POWER_CFG = 0x00200095,
MLAN_OID_UAP_6E_INBAND_FRAME = 0x00200096,
MLAN_OID_MISC_OTP_MAC_RD_WR = 0x00200097,
MLAN_OID_MISC_OTP_CAL_DATA_RD_WR = 0x00200098,
MLAN_OID_MISC_AUTH_ASSOC_TIMEOUT_CONFIG = 0x00200099,
MLAN_OID_MISC_PREV_ASSOC_INFO = 0x0020009A,
};
/** Sub command size */
@ -630,6 +637,15 @@ typedef struct _mlan_scan_cfg {
t_u32 scan_chan_gap;
} mlan_scan_cfg, *pmlan_scan_cfg;
/** Type definition of _mlan_scan_6g_cfg */
typedef struct _mlan_scan_6g_cfg {
/** scan 6 GHz channels flag:
* 0: scan all 6 GHz channels,
* 1: scan colocated AP channels or/and PSC channels
*/
t_u8 scan_coloc_ap;
} mlan_scan_6g_cfg, *pmlan_scan_6g_cfg;
/** Type defnition of mlan_ds_scan for MLAN_IOCTL_SCAN */
typedef struct _mlan_ds_scan {
/** Sub-command */
@ -644,6 +660,8 @@ typedef struct _mlan_ds_scan {
mlan_user_scan user_scan;
/** Scan config parameters */
mlan_scan_cfg scan_cfg;
/** 6E Scan config parameters */
mlan_scan_6g_cfg scan_6g_cfg;
} param;
} mlan_ds_scan, *pmlan_ds_scan;
@ -693,7 +711,7 @@ typedef struct _mlan_multicast_list {
} mlan_multicast_list, *pmlan_multicast_list;
/** Max channel */
#define MLAN_MAX_CHANNEL 177
#define MLAN_MAX_CHANNEL 233
/** Maximum number of channels in table */
#define MLAN_MAX_CHANNEL_NUM 128
@ -765,6 +783,8 @@ typedef struct _mlan_ds_misc_assoc_req {
/** mlan_ds_assoc_info */
typedef struct _mlan_ds_assoc_info {
/** bssid */
mlan_802_11_mac_addr bssid;
/** Associate req buffer */
t_u8 assoc_resp_buf[ASSOC_RSP_BUF_SIZE];
/** Response buffer length */
@ -1097,6 +1117,20 @@ typedef struct _wmm_parameter_t {
wmm_ac_parameters_t ac_params[MAX_AC_QUEUES];
} wmm_parameter_t, *pwmm_parameter_t;
/** IP address configuration for 11ai */
typedef struct _ip_addr_cfg_t {
/** IP ADDR **/
t_u32 ip;
/** SUBNET Mask **/
t_u32 subnetMask;
/** Base IP **/
t_u32 baseIp;
/** DNS IP **/
t_u32 dnsIp;
/** MAX Clients **/
t_u16 maxClients;
} ip_addr_cfg_t;
/** MAX BG channel */
#define MAX_BG_CHANNEL 14
/** mlan_bss_param
@ -1210,6 +1244,7 @@ typedef struct _mlan_uap_bss_param {
/** Wmm parameters */
wmm_parameter_t wmm_para;
ip_addr_cfg_t ip_cfg;
/** uap host based config */
t_u32 uap_host_based_config;
/** multi ap flag */
@ -1326,6 +1361,22 @@ typedef struct _mlan_ds_sta_info {
#define WIFI_DIRECT_MODE_STOP_FIND 5
#endif
/** 6E inband frame configuration parameters */
typedef struct inband_6e_frames_cmd_t {
/** type*/
t_u16 type;
/** length of TLV */
t_u16 len;
/** enable/diable */
t_u8 enabled;
/** frame type */
t_u8 frameType;
/** interval (TU) */
t_u16 interval;
/** frame length */
t_u16 frameLen;
} inband_6e_frames_cmd_t;
/** Type definition of mlan_ds_bss for MLAN_IOCTL_BSS */
typedef struct _mlan_ds_bss {
/** Sub-command */
@ -1390,9 +1441,16 @@ typedef struct _mlan_ds_bss {
mlan_ds_sta_info sta_info;
#endif
inband_6e_frames_cmd_t inband_6e_frame;
} param;
} mlan_ds_bss, *pmlan_ds_bss;
/** Host command action : Get Tx 6G CFP table */
#define MLAN_ACT_GET_6G_CFP_TBL 0x6
/** Host command action : Set Tx 6G CFP table */
#define MLAN_ACT_SET_6G_CFP_TBL 0x7
/* OTP Region info */
typedef MLAN_PACK_START struct _otp_region_info {
t_u8 country_code[2];
@ -1410,6 +1468,8 @@ typedef struct _mlan_ds_custom_reg_domain {
t_u8 num_bg_chan;
/** num of 5g channels in custom_reg_domain */
t_u8 num_a_chan;
/** num of 6g channels in custom_reg_domain */
t_u8 num_6g_chan;
/** cfp table */
chan_freq_power_t cfp_tbl[];
} mlan_ds_custom_reg_domain;
@ -1427,6 +1487,7 @@ enum _mlan_band_def {
BAND_AAC = 64,
BAND_GAX = 256,
BAND_AAX = 512,
BAND_6G = 1024,
};
/** Channel bandwidth */
@ -1456,6 +1517,10 @@ typedef struct _mlan_ds_ant_cfg {
t_u32 tx_antenna;
/** Rx antenna mode */
t_u32 rx_antenna;
/** Tx antenna mode 6G*/
t_u8 tx_antenna_6g;
/** Rx antenna mode 6G*/
t_u8 rx_antenna_6g;
} mlan_ds_ant_cfg, *pmlan_ds_ant_cfg;
/** Type definition of mlan_ds_mimo_switch for MLAN_OID_MIMO_SWITCH */
typedef struct _mlan_ds_mimo_switch {
@ -1767,6 +1832,10 @@ typedef struct _mlan_ds_get_stats {
t_u32 gdma_abort_cnt;
/** Rx Reset MAC Count */
t_u32 g_reset_rx_mac_cnt;
/** Current SOC Temperature*/
t_u32 currTemp;
/** TX Power Control Method*/
t_u32 TXpwrMethod;
/** SDMA FSM stuck Count*/
t_u32 SdmaStuckCnt;
// Ownership error counters
@ -1949,6 +2018,8 @@ typedef struct _mlan_fw_info {
t_u8 hw_2g_hecap_len;
/** 802.11ax 2.4G HE capability */
t_u8 hw_2g_he_cap[54];
/** 802.11ax 6G HE capability */
t_u16 hw_he_6g_cap;
/** 802.11ac device support for MIMO abstraction of MCSs */
t_u32 hw_dot_11ac_mcs_support;
/** User conf 802.11ac device support for MIMO abstraction of MCSs */
@ -1977,6 +2048,7 @@ typedef struct _mlan_fw_info {
t_u8 fw_beacon_prot;
/** FW RTT support */
t_u8 rtt_support;
t_u8 he_6g_support;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
@ -2674,6 +2746,7 @@ enum _mlan_auth_mode {
MLAN_AUTH_MODE_FT = 0x02,
MLAN_AUTH_MODE_SAE = 0x03,
MLAN_AUTH_MODE_OWE = 0x04,
MLAN_AUTH_MODE_FILS = 0x05,
MLAN_AUTH_MODE_NETWORKEAP = 0x80,
MLAN_AUTH_MODE_AUTO = 0xFF,
};
@ -2685,6 +2758,7 @@ typedef enum {
AssocAgentAuth_FastBss,
AssocAgentAuth_FastBss_Skip,
AssocAgentAuth_Network_EAP,
AssocAgentAuth_FILS = 5,
AssocAgentAuth_Wpa3Sae = 6,
AssocAgentAuth_Owe = 7,
AssocAgentAuth_Auto,
@ -4040,12 +4114,48 @@ typedef MLAN_PACK_START struct _mlan_ds_11ax_he_capa {
t_u8 val[28];
} MLAN_PACK_END mlan_ds_11ax_he_capa, *pmlan_ds_11ax_he_capa;
/** Type definition of mlan_6g_cap_t */
typedef struct _mlan_6g_cap_t {
/** Minimum MPDU Start Spacing */
t_u16 min_mpdu_start_spacing : 3;
/** Max A-MPDU length Exponent */
t_u16 max_ampdu_length_exp : 3;
/** Max MPDU length */
t_u16 max_mpdu_length : 2;
/** reserved1 */
t_u16 rsvd1 : 1;
/** SM PowerSave */
t_u16 sm_power_save : 2;
/** RD Responder */
t_u16 rd_responder : 1;
/** Rx Antenna Pattern Consistency */
t_u16 rx_ant_pat : 1;
/** Tx Antenna Pattern Consistency */
t_u16 tx_ant_pat : 1;
/** reserved2 */
t_u16 rsvd2 : 2;
} mlan_6g_cap_t;
/** Type definition of mlan_ds_11ax_6g_capa for MLAN_OID_11AX_6G_CFG */
typedef MLAN_PACK_START struct _mlan_ds_11ax_he_6g_capa {
/** tlv id of he capability */
t_u16 id;
/** length of the payload */
t_u16 len;
/** ext_id */
t_u8 ext_id;
/** capability info */
t_u16 capa;
} MLAN_PACK_END mlan_ds_11ax_he_6g_capa, *pmlan_ds_11ax_he_6g_capa;
/** Type definition of mlan_ds_11ax_he_cfg for MLAN_OID_11AX_HE_CFG */
typedef struct _mlan_ds_11ax_he_cfg {
/** band, BIT0:2.4G, BIT1:5G BIT2:6G*/
t_u8 band;
/** mlan_ds_11ax_he_capa */
mlan_ds_11ax_he_capa he_cap;
/** mlan_ds_11ax_he_6g_capa */
mlan_ds_11ax_he_6g_capa he_6g_cap;
} mlan_ds_11ax_he_cfg, *pmlan_ds_11ax_he_cfg;
/** Type definition of mlan_ds_11as_cfg for MLAN_IOCTL_11AX_CFG */
typedef struct _mlan_ds_11ax_cfg {
@ -4185,6 +4295,8 @@ typedef struct _mlan_ds_11ax_llde_cmd {
t_u16 tbppdu_datacnt;
} mlan_ds_11ax_llde_cmd, *pmlan_ds_11ax_llde_cmd;
#define MAX_SIZE_RUTX_SUB_PWR 168 /*for 2G,5G,6G subbands */
/** Type definition of mlan_ds_11ax_rutxpwr_cmd for MLAN_OID_11AX_CMD_CFG */
typedef struct _mlan_ds_11ax_rutxpwr_cmd {
/** type*/
@ -4200,7 +4312,7 @@ typedef struct _mlan_ds_11ax_rutxpwr_cmd {
* id 3 ( consider only 2G support */
t_u8 row;
/**ru tx data */
t_s8 rutxSubPwr[89];
t_s8 rutxSubPwr[MAX_SIZE_RUTX_SUB_PWR];
} mlan_ds_11ax_rutxpwr_cmd, *pmlan_ds_11ax_rutxpwr_cmd;
/** Type definition of mlan_ds_11ax_HeSuER_cmd for MLAN_11AXCMD_HESUER_SUBID */
@ -5514,7 +5626,7 @@ typedef struct _mlan_ds_misc_dfs_repeater {
#define CRITERIA_UNICAST BIT(1)
#define CRITERIA_MULTICAST BIT(3)
#define MAX_NUM_ENTRIES 8
#define MAX_NUM_ENTRIES 9
#define MAX_NUM_BYTE_SEQ 6
#define MAX_NUM_MASK_SEQ 6
@ -5612,6 +5724,7 @@ enum _mlan_act_mef_act_type {
MEF_ACT_AUTOARP,
MEF_ACT_WOWLAN,
MEF_ACT_IPV6_NS,
MEF_ACT_MDNS,
};
typedef struct _mlan_ds_sensor_temp {
@ -6412,6 +6525,10 @@ typedef struct _mlan_ds_ed_mac_cfg {
t_u16 ed_ctrl_5g;
/** Energy detect threshold offset for 5ghz */
t_s16 ed_offset_5g;
/** EU adaptivity for 6ghz band */
t_u16 ed_ctrl_6g;
/** Energy detect threshold offset for 6ghz */
t_s16 ed_offset_6g;
t_u32 ed_bitmap_txq_lock;
} mlan_ds_ed_mac_cfg;
@ -6472,6 +6589,8 @@ typedef struct _mlan_ds_misc_cfg {
mlan_ds_misc_assoc_rsp assoc_resp;
/** Get associate request for MLAN_OID_MISC_ASSOC_REQ */
mlan_ds_misc_assoc_req assoc_req;
/** Get associate info for MLAN_OID_MISC_PREV_ASSOC_INFO */
mlan_ds_assoc_info assoc_info;
/** Function init/shutdown for MLAN_OID_MISC_INIT_SHUTDOWN */
t_u32 func_init_shutdown;
/** Custom IE for MLAN_OID_MISC_CUSTOM_IE */

View file

@ -157,6 +157,79 @@ struct ieee80211_supported_band cfg80211_band_5ghz = {
.n_bitrates = ARRAY_SIZE(cfg80211_rates) - 4,
};
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
/** Channel definitions for 6 GHz to be advertised to cfg80211 */
static struct ieee80211_channel cfg80211_channels_6ghz[] = {
{.center_freq = 5955, .hw_value = 1, .max_power = 23},
{.center_freq = 5975, .hw_value = 5, .max_power = 23},
{.center_freq = 5995, .hw_value = 9, .max_power = 23},
{.center_freq = 6015, .hw_value = 13, .max_power = 23},
{.center_freq = 6035, .hw_value = 17, .max_power = 23},
{.center_freq = 6055, .hw_value = 21, .max_power = 23},
{.center_freq = 6075, .hw_value = 25, .max_power = 23},
{.center_freq = 6095, .hw_value = 29, .max_power = 23},
{.center_freq = 6115, .hw_value = 33, .max_power = 23},
{.center_freq = 6135, .hw_value = 37, .max_power = 23},
{.center_freq = 6155, .hw_value = 41, .max_power = 23},
{.center_freq = 6175, .hw_value = 45, .max_power = 23},
{.center_freq = 6195, .hw_value = 49, .max_power = 23},
{.center_freq = 6215, .hw_value = 53, .max_power = 23},
{.center_freq = 6235, .hw_value = 57, .max_power = 23},
{.center_freq = 6255, .hw_value = 61, .max_power = 23},
{.center_freq = 6275, .hw_value = 65, .max_power = 23},
{.center_freq = 6295, .hw_value = 69, .max_power = 23},
{.center_freq = 6315, .hw_value = 73, .max_power = 23},
{.center_freq = 6335, .hw_value = 77, .max_power = 23},
{.center_freq = 6355, .hw_value = 81, .max_power = 23},
{.center_freq = 6375, .hw_value = 85, .max_power = 23},
{.center_freq = 6395, .hw_value = 89, .max_power = 23},
{.center_freq = 6415, .hw_value = 93, .max_power = 23},
{.center_freq = 6435, .hw_value = 97, .max_power = 23},
{.center_freq = 6455, .hw_value = 101, .max_power = 23},
{.center_freq = 6475, .hw_value = 105, .max_power = 23},
{.center_freq = 6495, .hw_value = 109, .max_power = 23},
{.center_freq = 6515, .hw_value = 113, .max_power = 23},
{.center_freq = 6535, .hw_value = 117, .max_power = 23},
{.center_freq = 6555, .hw_value = 121, .max_power = 23},
{.center_freq = 6575, .hw_value = 125, .max_power = 23},
{.center_freq = 6595, .hw_value = 129, .max_power = 23},
{.center_freq = 6615, .hw_value = 133, .max_power = 23},
{.center_freq = 6635, .hw_value = 137, .max_power = 23},
{.center_freq = 6655, .hw_value = 141, .max_power = 23},
{.center_freq = 6675, .hw_value = 145, .max_power = 23},
{.center_freq = 6695, .hw_value = 149, .max_power = 23},
{.center_freq = 6715, .hw_value = 153, .max_power = 23},
{.center_freq = 6735, .hw_value = 157, .max_power = 23},
{.center_freq = 6755, .hw_value = 161, .max_power = 23},
{.center_freq = 6775, .hw_value = 165, .max_power = 23},
{.center_freq = 6795, .hw_value = 169, .max_power = 23},
{.center_freq = 6815, .hw_value = 173, .max_power = 23},
{.center_freq = 6835, .hw_value = 177, .max_power = 23},
{.center_freq = 6855, .hw_value = 181, .max_power = 23},
{.center_freq = 6875, .hw_value = 185, .max_power = 23},
{.center_freq = 6895, .hw_value = 189, .max_power = 23},
{.center_freq = 6915, .hw_value = 193, .max_power = 23},
{.center_freq = 6935, .hw_value = 197, .max_power = 23},
{.center_freq = 6955, .hw_value = 201, .max_power = 23},
{.center_freq = 6975, .hw_value = 205, .max_power = 23},
{.center_freq = 6995, .hw_value = 209, .max_power = 23},
{.center_freq = 7015, .hw_value = 213, .max_power = 23},
{.center_freq = 7035, .hw_value = 217, .max_power = 23},
{.center_freq = 7055, .hw_value = 221, .max_power = 23},
{.center_freq = 7075, .hw_value = 225, .max_power = 23},
{.center_freq = 7095, .hw_value = 229, .max_power = 23},
{.center_freq = 7115, .hw_value = 233, .max_power = 23},
};
struct ieee80211_supported_band cfg80211_band_6ghz = {
.channels = cfg80211_channels_6ghz,
.band = IEEE80211_BAND_6GHZ,
.n_channels = ARRAY_SIZE(cfg80211_channels_6ghz),
.bitrates = cfg80211_rates + 4,
.n_bitrates = ARRAY_SIZE(cfg80211_rates) - 4,
};
#endif
extern pmoal_handle m_handle[];
#if KERNEL_VERSION(2, 6, 29) < LINUX_VERSION_CODE
@ -183,10 +256,64 @@ int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg,
#endif
#endif
static t_u8 *woal_remove_11ax_ies(moal_private *priv, t_u8 *ie, t_u8 len,
static t_u8 *woal_remove_11ax_ies(moal_private *priv, const t_u8 *ie, t_u8 len,
t_u8 *new_ie_len, t_u32 ie_out_len,
t_u8 *skipped_len);
/**
* @brief Parse IE buffer and search for FILS capability in extended
* Capability IE
*
* @param ie - IE buffer
* @param len - Length of IE buffer
*
* @return MTRUE if FILS capable else MFALSE
*/
t_u8 woal_check_fils_capability(const t_u8 *ie, int len)
{
int left_len = len;
const t_u8 *pos = ie;
int length;
t_u8 id = 0;
const t_u8 *ext_cap = NULL;
if (!ie || !len)
return MFALSE;
while (left_len >= 2) {
length = *(pos + 1);
id = *pos;
if ((length + 2) > left_len)
break;
if (id == EXT_CAPABILITY) {
ext_cap = pos + 2;
break;
}
pos += (length + 2);
left_len -= (length + 2);
}
if (ext_cap && len >= 7) {
/* Bit 50 indicates FILS Capability */
ext_cap += 6;
/* Check bit 3 */
if (*ext_cap & 4) {
PRINTM(MINFO, "FILS Capability Found....\n");
return MTRUE;
}
} else {
PRINTM(MINFO,
"Extended Cap not found.. FILS is not enabled..\n");
return MFALSE;
}
return MFALSE;
}
/**
* @brief Get the private structure from wiphy
*
@ -228,6 +355,10 @@ woal_get_ieee80211_channel(moal_private *priv, chan_band_info *pchan_info)
band = IEEE80211_BAND_2GHZ;
else if (pchan_info->bandcfg.chanBand == BAND_5GHZ)
band = IEEE80211_BAND_5GHZ;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
else if (pchan_info->bandcfg.chanBand == BAND_6GHZ)
band = IEEE80211_BAND_6GHZ;
#endif
freq = ieee80211_channel_to_frequency(pchan_info->channel, band);
return ieee80211_get_channel(priv->wdev->wiphy, freq);
}
@ -293,6 +424,75 @@ int woal_get_active_intf_freq(moal_private *priv)
return 0;
}
/**
* @brief Get receive frequency from FW RX INFO.
*
* @param priv A pointer to moal_private
* @param band_config band_config
* @param chan_num channel num
*
* @return channel frequency
*/
int woal_get_rx_freq(moal_private *priv, t_u8 band_config, t_u8 chan_num)
{
int freq = 0;
Band_Config_t bandcfg;
enum ieee80211_band band = IEEE80211_BAND_2GHZ;
if (chan_num) {
moal_memcpy_ext(priv->phandle, &bandcfg, &band_config,
sizeof(bandcfg), sizeof(band_config));
if (bandcfg.chanBand == BAND_2GHZ)
band = IEEE80211_BAND_2GHZ;
else if (bandcfg.chanBand == BAND_5GHZ)
band = IEEE80211_BAND_5GHZ;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
else if (bandcfg.chanBand == BAND_6GHZ)
band = IEEE80211_BAND_6GHZ;
#endif
return ieee80211_channel_to_frequency(chan_num, band);
}
#if KERNEL_VERSION(2, 6, 39) <= CFG80211_VERSION_CODE
if (priv->phandle->remain_on_channel)
return priv->phandle->chan.center_freq;
#endif
freq = woal_get_active_intf_freq(priv);
return freq;
}
/**
* @brief Convert radio_type to IEEE band
*
* @param radio_type internal radio type
*
* @return IEEE band
*/
t_u8 woal_radio_type_to_ieee_band(t_u8 radio_type)
{
t_u8 ieee_band = 0;
ENTER();
switch (radio_type) {
case BAND_5GHZ:
ieee_band = IEEE80211_BAND_5GHZ;
break;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
case BAND_6GHZ:
ieee_band = IEEE80211_BAND_6GHZ;
break;
#endif
case BAND_2GHZ:
default:
ieee_band = IEEE80211_BAND_2GHZ;
break;
}
LEAVE();
return ieee_band;
}
/**
* @brief Convert driver band configuration to IEEE band type
*
@ -344,6 +544,11 @@ t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band)
case IEEE80211_BAND_5GHZ:
radio_type = BAND_5GHZ;
break;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
case IEEE80211_BAND_6GHZ:
radio_type = BAND_6GHZ;
break;
#endif
case IEEE80211_BAND_2GHZ:
default:
radio_type = BAND_2GHZ;
@ -414,6 +619,11 @@ mlan_status woal_cfg80211_set_key(moal_private *priv, t_u8 is_enable_wep,
ENTER();
if (cipher == WLAN_CIPHER_SUITE_FILS_PSK) {
ret = woal_set_psk_11ai(priv, wait_option, addr, key, key_len);
return ret;
}
#ifdef UAP_CFG80211
#ifdef UAP_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
@ -772,7 +982,7 @@ void woal_cfg80211_display_p2p_actframe(const t_u8 *buf, int len,
return;
}
if (((struct ieee80211_mgmt *)buf)->u.action.category ==
if (((const struct ieee80211_mgmt *)buf)->u.action.category ==
P2P_ACT_FRAME_CATEGORY &&
!memcmp(buf + P2P_ACT_FRAME_OUI_OFFSET, p2p_oui, sizeof(p2p_oui))) {
subtype = *(buf + P2P_ACT_FRAME_OUI_SUBTYPE_OFFSET);
@ -1918,6 +2128,8 @@ struct pmksa_entry *woal_get_pmksa_entry(moal_private *priv, const u8 *bssid)
}
spin_lock_irqsave(&priv->pmksa_list_lock, flags);
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
list_for_each_entry (entry, &priv->pmksa_cache_list, link) {
if (!memcmp(entry->bssid, bssid, ETH_ALEN)) {
spin_unlock_irqrestore(&priv->pmksa_list_lock, flags);
@ -1945,6 +2157,8 @@ int woal_flush_pmksa_list(moal_private *priv)
}
spin_lock_irqsave(&priv->pmksa_list_lock, flags);
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
list_for_each_entry_safe (entry, tmp, &priv->pmksa_cache_list, link) {
list_del(&entry->link);
kfree(entry);
@ -2046,6 +2260,8 @@ int woal_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
PRINTM(MIOCTL, "Delete pmksa: bssid=" MACSTR "\n",
MAC2STR(pmksa->bssid));
spin_lock_irqsave(&priv->pmksa_list_lock, flags);
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
list_for_each_entry_safe (entry, tmp, &priv->pmksa_cache_list, link) {
if (!memcmp(entry->bssid, pmksa->bssid, ETH_ALEN)) {
list_del(&entry->link);
@ -2752,7 +2968,7 @@ static int woal_mgmt_tx(moal_private *priv, const u8 *buf, size_t len,
unsigned long flags;
struct sk_buff *skb = NULL;
struct tx_status_info *tx_info = NULL;
t_u32 remain_len = 0;
int remain_len = 0;
t_u32 buf_flags = 0;
t_u8 tx_seq_num = 0;
mlan_ioctl_req *ioctl_req = NULL;
@ -2782,16 +2998,23 @@ static int woal_mgmt_tx(moal_private *priv, const u8 *buf, size_t len,
if (chan && ((chan->band == NL80211_BAND_2GHZ &&
!(priv->phandle->fw_bands & BAND_GAX)) ||
(chan->band == NL80211_BAND_5GHZ &&
!(priv->phandle->fw_bands & BAND_AAX)))) {
fc = le16_to_cpu(((struct ieee80211_mgmt *)buf)->frame_control);
!(priv->phandle->fw_bands & BAND_AAX))
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|| (chan->band == NL80211_BAND_6GHZ &&
!(priv->phandle->fw_bands & BAND_6G))
#endif
)) {
fc = le16_to_cpu(
((const struct ieee80211_mgmt *)buf)->frame_control);
type = fc & IEEE80211_FCTL_FTYPE;
stype = fc & IEEE80211_FCTL_STYPE;
if ((type == IEEE80211_FTYPE_MGMT &&
(stype == IEEE80211_STYPE_ASSOC_RESP ||
stype == IEEE80211_STYPE_REASSOC_RESP))) {
new_ie = woal_remove_11ax_ies(priv, (t_u8 *)buf, len,
&new_ie_len, MAX_IE_SIZE,
&skipped_len);
new_ie =
woal_remove_11ax_ies(priv, (const t_u8 *)buf,
len, &new_ie_len,
MAX_IE_SIZE, &skipped_len);
}
}
@ -2849,7 +3072,10 @@ static int woal_mgmt_tx(moal_private *priv, const u8 *buf, size_t len,
PACKET_ADDR4_POS,
addr, MLAN_MAC_ADDR_LENGTH, remain_len);
remain_len -= MLAN_MAC_ADDR_LENGTH;
if (remain_len < 0) {
ret = -EFAULT;
goto done;
}
if (!new_ie_len) {
// coverity[overrun:SUPPRESS]
moal_memcpy_ext(priv->phandle,
@ -2860,6 +3086,7 @@ static int woal_mgmt_tx(moal_private *priv, const u8 *buf, size_t len,
} else {
/* new IEs post cleanup of 11ax IEs received from kernel */
// coverity[overrun:SUPPRESS]
// coverity[cert_arr30_c_violation: SUPPRESS]
moal_memcpy_ext(priv->phandle,
pbuf + HEADER_SIZE + sizeof(packet_len) +
PACKET_ADDR4_POS + MLAN_MAC_ADDR_LENGTH,
@ -2868,7 +3095,8 @@ static int woal_mgmt_tx(moal_private *priv, const u8 *buf, size_t len,
DBG_HEXDUMP(MDAT_D, "Mgmt Tx", pbuf,
HEADER_SIZE + packet_len + sizeof(packet_len));
if ((ieee80211_is_action(((struct ieee80211_mgmt *)buf)->frame_control))
if ((ieee80211_is_action(
((const struct ieee80211_mgmt *)buf)->frame_control))
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
|| moal_extflg_isset(priv->phandle, EXT_HOST_MLME)
#endif
@ -3214,12 +3442,13 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
*/
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
if (ieee80211_is_probe_resp(
((struct ieee80211_mgmt *)buf)->frame_control)) {
if (ieee80211_is_probe_resp(((const struct ieee80211_mgmt *)buf)
->frame_control)) {
PRINTM(MIOCTL, "Skip send probe_resp in GO/UAP mode\n");
goto done;
}
fc = le16_to_cpu(((struct ieee80211_mgmt *)buf)->frame_control);
fc = le16_to_cpu(
((const struct ieee80211_mgmt *)buf)->frame_control);
type = fc & IEEE80211_FCTL_FTYPE;
stype = fc & IEEE80211_FCTL_STYPE;
if (type == IEEE80211_FTYPE_MGMT) {
@ -3261,7 +3490,8 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
}
#if KERNEL_VERSION(2, 6, 39) <= CFG80211_VERSION_CODE
if ((ieee80211_is_action(((struct ieee80211_mgmt *)buf)->frame_control))
if ((ieee80211_is_action(
((const struct ieee80211_mgmt *)buf)->frame_control))
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
|| moal_extflg_isset(priv->phandle, EXT_HOST_MLME)
#endif
@ -3279,6 +3509,17 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
woal_cancel_timer(&priv->phandle->remain_timer);
woal_remain_timer_func(priv->phandle);
}
if (ieee80211_is_auth(
((struct ieee80211_mgmt *)buf)->frame_control) &&
(priv->bss_type == MLAN_BSS_TYPE_STA)) {
woal_mgmt_frame_register(priv, IEEE80211_STYPE_AUTH,
MTRUE);
priv->auth_flag = HOST_MLME_AUTH_PENDING;
priv->auth_alg = woal_cpu_to_le16(
((struct ieee80211_mgmt *)buf)->u.auth.auth_alg);
priv->host_mlme = MTRUE;
}
/* With sd8777 We have difficulty to receive response packet in
* 500ms
*/
@ -3386,7 +3627,7 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
if (len > sizeof(moal_802_11_action_header) &&
ieee80211_is_action(
((struct ieee80211_mgmt *)buf)->frame_control)) {
((const struct ieee80211_mgmt *)buf)->frame_control)) {
category = *(buf + sizeof(moal_802_11_action_header) - 1);
action = *(buf + sizeof(moal_802_11_action_header));
if (category == IEEE_MGMT_ACTION_CATEGORY_PUBLIC &&
@ -3648,7 +3889,9 @@ int woal_cfg80211_set_qos_map(struct wiphy *wiphy, struct net_device *dev,
}
moal_memcpy_ext(priv->phandle, qos_map_ie.data,
(t_u8 *)qos_map->dscp_exception,
2 * qos_map->num_des, sizeof(qos_map_ie.data));
MIN(2 * qos_map->num_des,
sizeof(qos_map->dscp_exception)),
sizeof(qos_map_ie.data));
moal_memcpy_ext(priv->phandle,
&qos_map_ie.data[2 * qos_map->num_des],
(t_u8 *)qos_map->up, sizeof(qos_map->up),
@ -3691,7 +3934,7 @@ static t_u16 woal_get_specific_ie(const t_u8 *ie, size_t len, t_u8 *ie_out,
int length;
t_u8 id = 0;
t_u16 out_len = 0;
IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const u8 wps_oui[4] = {0x00, 0x50, 0xf2, 0x04};
const u8 p2p_oui[4] = {0x50, 0x6f, 0x9a, 0x09};
const u8 wfd_oui[4] = {0x50, 0x6f, 0x9a, 0x0a};
@ -3704,7 +3947,7 @@ static t_u16 woal_get_specific_ie(const t_u8 *ie, size_t len, t_u8 *ie_out,
if ((length + 2) > left_len)
break;
if (id == VENDOR_SPECIFIC_221) {
pvendor_ie = (IEEEtypes_VendorSpecific_t *)pos;
pvendor_ie = (const IEEEtypes_VendorSpecific_t *)pos;
if (!memcmp(pvendor_ie->vend_hdr.oui, wmm_oui,
sizeof(pvendor_ie->vend_hdr.oui)) &&
pvendor_ie->vend_hdr.oui_type == wmm_oui[3]) {
@ -3818,20 +4061,20 @@ static t_u8 woal_find_ie(const t_u8 *ie, int len, const t_u8 *spec_ie,
*
* @return true - success, false - otherwise
*/
static bool woal_search_ie(t_u8 *ie, t_u8 ie_len, t_u8 eid, t_u8 ext_eid)
static bool woal_search_ie(const t_u8 *ie, t_u8 ie_len, t_u8 eid, t_u8 ext_eid)
{
IEEEtypes_Header_t *pheader = NULL;
t_u8 *pos = NULL;
const IEEEtypes_Header_t *pheader = NULL;
const t_u8 *pos = NULL;
t_u8 ret_len = 0;
t_u8 ret = false;
t_u8 id = 0;
ENTER();
pos = (t_u8 *)ie;
pos = (const t_u8 *)ie;
ret_len = ie_len;
while (ret_len >= 2) {
pheader = (IEEEtypes_Header_t *)pos;
pheader = (const IEEEtypes_Header_t *)pos;
if ((t_u8)(pheader->len + sizeof(IEEEtypes_Header_t)) >
ret_len) {
PRINTM(MMSG, "invalid IE length = %d left len %d\n",
@ -3870,7 +4113,7 @@ static bool woal_search_ie(t_u8 *ie, t_u8 ie_len, t_u8 eid, t_u8 ext_eid)
*
* @return new ie buffer - success, NULL - otherwise
*/
static t_u8 *woal_remove_11ax_ies(moal_private *priv, t_u8 *ie, t_u8 len,
static t_u8 *woal_remove_11ax_ies(moal_private *priv, const t_u8 *ie, t_u8 len,
t_u8 *new_ie_len, t_u32 ie_out_len,
t_u8 *skipped_len)
{
@ -3889,7 +4132,12 @@ static t_u8 *woal_remove_11ax_ies(moal_private *priv, t_u8 *ie, t_u8 len,
if (!woal_search_ie(ie + min_ie_len, len - min_ie_len, HE_CAPABILITY,
EXTENSION) &&
!woal_search_ie(ie + min_ie_len, len - min_ie_len, HE_OPERATION,
EXTENSION))
EXTENSION)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
&& !woal_search_ie(ie + min_ie_len, len - min_ie_len,
HE_6G_CAPABILITY, EXTENSION)
#endif
)
return NULL;
new_ie = kzalloc(len, GFP_KERNEL);
@ -3971,7 +4219,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
int length;
t_u8 id = 0;
t_u16 out_len = 0;
IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const u8 wps_oui[4] = {0x00, 0x50, 0xf2, 0x04};
const u8 p2p_oui[4] = {0x50, 0x6f, 0x9a, 0x09};
const u8 wfd_oui[4] = {0x50, 0x6f, 0x9a, 0x0a};
@ -4038,7 +4286,11 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
case EXTENSION:
/* skip 11ax, 6G if bands are not enabled */
if (!(priv->phandle->fw_bands & BAND_GAX) ||
!(priv->phandle->fw_bands & BAND_AAX))
!(priv->phandle->fw_bands & BAND_AAX)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|| !(priv->phandle->fw_bands & BAND_6G)
#endif
)
break;
ext_id = *(pos + 2);
@ -4048,6 +4300,33 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
#endif
)
break;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
else if (ext_id == HE_6G_CAPABILITY) {
mlan_ds_11ax_he_cfg he_cfg;
mlan_ds_11ax_he_6g_capa *pCap;
IEEEtypes_HE6GCap_t *p6gCap =
(IEEEtypes_HE6GCap_t *)pos;
memset((void *)&he_cfg, 0x00, sizeof(he_cfg));
he_cfg.band = MBIT(2);
pCap = (mlan_ds_11ax_he_6g_capa *)&he_cfg.he_cap;
pCap->id = p6gCap->ieee_hdr.element_id;
pCap->len = p6gCap->ieee_hdr.len;
moal_memcpy_ext(
priv->phandle, &he_cfg.he_cap.ext_id,
&p6gCap->ext_id, length,
sizeof(mlan_ds_11ax_he_capa) - 4);
// download via host_CMD_802_11AX_CFG = 0x0266,
DBG_HEXDUMP(MCMD_D, "6G_CFG ", (t_u8 *)&he_cfg,
sizeof(he_cfg));
if (woal_11ax_cfg(priv, MLAN_ACT_SET, &he_cfg,
MOAL_IOCTL_WAIT))
PRINTM(MERROR, "Fail to set 6g cfg!\n");
break;
}
#endif
else {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
@ -4116,8 +4395,8 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
if (wps_flag & IE_MASK_EXTCAP) {
ie_len = length + 2;
if (MLAN_STATUS_SUCCESS !=
woal_set_get_gen_ie(priv, MLAN_ACT_SET,
(t_u8 *)pos, &ie_len,
woal_set_get_gen_ie(priv, MLAN_ACT_SET, pos,
NULL, &ie_len,
MOAL_IOCTL_WAIT))
PRINTM(MERROR,
"Fail to set EXTCAP IE\n");
@ -4135,7 +4414,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
break;
case VENDOR_SPECIFIC_221:
/* filter out wmm ie */
pvendor_ie = (IEEEtypes_VendorSpecific_t *)pos;
pvendor_ie = (const IEEEtypes_VendorSpecific_t *)pos;
if (!memcmp(pvendor_ie->vend_hdr.oui, wmm_oui,
sizeof(pvendor_ie->vend_hdr.oui)) &&
pvendor_ie->vend_hdr.oui_type == wmm_oui[3]) {
@ -4178,6 +4457,10 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie,
}
break;
case REGULATORY_CLASS:
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
if (priv->chan.chan->band != NL80211_BAND_6GHZ)
break;
#endif
/* FALLTHRU */
default:
if ((out_len + length + 2) < (int)ie_out_len) {
@ -4221,23 +4504,23 @@ static t_u8 is_selected_registrar_on(const t_u8 *ie, int len)
#define TLV_ID_SELECTED_REGISTRAR 0x1041
int left_len = len - WPS_IE_FIX_LEN;
TLV_Generic_t *tlv = (TLV_Generic_t *)(ie + WPS_IE_FIX_LEN);
const TLV_Generic_t *tlv = (const TLV_Generic_t *)(ie + WPS_IE_FIX_LEN);
u16 tlv_type, tlv_len;
u8 *pos = NULL;
const u8 *pos = NULL;
while (left_len > (int)sizeof(TLV_Generic_t)) {
tlv_type = ntohs((__force __be16)tlv->type);
tlv_len = ntohs((__force __be16)tlv->len);
if (tlv_type == TLV_ID_SELECTED_REGISTRAR) {
PRINTM(MIOCTL, "Selected Registrar found !");
pos = (u8 *)tlv + sizeof(TLV_Generic_t);
pos = (const u8 *)tlv + sizeof(TLV_Generic_t);
if (*pos == 1)
return MTRUE;
else
return MFALSE;
}
tlv = (TLV_Generic_t *)((u8 *)tlv + tlv_len +
sizeof(TLV_Generic_t));
tlv = (const TLV_Generic_t *)((const u8 *)tlv + tlv_len +
sizeof(TLV_Generic_t));
left_len -= tlv_len + sizeof(TLV_Generic_t);
}
return MFALSE;
@ -4258,7 +4541,7 @@ static t_u16 woal_is_selected_registrar_on(const t_u8 *ie, size_t len)
const t_u8 *pos = ie;
int length;
t_u8 id = 0;
IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const IEEEtypes_VendorSpecific_t *pvendor_ie = NULL;
const u8 wps_oui[4] = {0x00, 0x50, 0xf2, 0x04};
while (left_len >= 2) {
@ -4268,7 +4551,7 @@ static t_u16 woal_is_selected_registrar_on(const t_u8 *ie, size_t len)
break;
switch (id) {
case VENDOR_SPECIFIC_221:
pvendor_ie = (IEEEtypes_VendorSpecific_t *)pos;
pvendor_ie = (const IEEEtypes_VendorSpecific_t *)pos;
if (!memcmp(pvendor_ie->vend_hdr.oui, wps_oui,
sizeof(pvendor_ie->vend_hdr.oui)) &&
pvendor_ie->vend_hdr.oui_type == wps_oui[3]) {
@ -4564,6 +4847,7 @@ int woal_cfg80211_mgmt_frame_ie(
beacon_ies_data->mgmt_subtype_mask =
MGMT_MASK_BEACON | MGMT_MASK_ASSOC_RESP |
MGMT_MASK_PROBE_RESP;
// coverity[integer_overflow:SUPPRESS]
beacon_ies_data->ie_length = woal_filter_beacon_ies(
priv, beacon_ies, beacon_ies_len,
beacon_ies_data->ie_buffer, MAX_IE_SIZE,
@ -4571,6 +4855,7 @@ int woal_cfg80211_mgmt_frame_ie(
IE_MASK_VENDOR,
proberesp_ies, proberesp_ies_len);
if (beacon_ies_data->ie_length)
// coverity[integer_overflow:SUPPRESS]
DBG_HEXDUMP(MCMD_D, "beacon ie",
beacon_ies_data->ie_buffer,
beacon_ies_data->ie_length);
@ -4843,6 +5128,27 @@ struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band)
{
struct ieee80211_supported_band *band = NULL;
switch (ieee_band) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
case IEEE80211_BAND_6GHZ:
band = kmemdup(&cfg80211_band_6ghz,
sizeof(struct ieee80211_supported_band),
GFP_KERNEL);
if (!band) {
PRINTM(MERROR, "No memory for 6g band\n");
break;
}
band->channels =
kmemdup(&cfg80211_channels_6ghz,
sizeof(cfg80211_channels_6ghz), GFP_KERNEL);
if (!band->channels) {
PRINTM(MERROR, "No memory for 6g band->channel\n");
kfree(band);
band = NULL;
break;
}
band->n_channels = ARRAY_SIZE(cfg80211_channels_6ghz);
break;
#endif
case IEEE80211_BAND_5GHZ:
band = kmemdup(&cfg80211_band_5ghz,
sizeof(struct ieee80211_supported_band),
@ -5108,7 +5414,7 @@ Bit75: 0x1 (Rx 1024-QAM Support < 242-tone RU)
#define UAP_HE_2G_PHY_CAP5_MASK 0x01
#define UAP_HE_2G_PHY_CAP6_MASK 0xA0
#define UAP_HE_2G_PHY_CAP7_MASK 0x0C
#define UAP_HE_2G_PHY_CAP8_MASK 0x00
#define UAP_HE_2G_PHY_CAP8_MASK 0x02
#define UAP_HE_2G_PHY_CAP9_MASK 0x08
#define UAP_HE_2G_PHY_CAP10_MASK 0x00
@ -5121,7 +5427,11 @@ Bit75: 0x1 (Rx 1024-QAM Support < 242-tone RU)
*/
static void woal_uap_update_11ax_ie(t_u8 band, mlan_ds_11ax_he_capa *hecap_ie)
{
if (band == BAND_5GHZ) {
if (band == BAND_5GHZ
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|| band == BAND_6GHZ
#endif
) {
hecap_ie->he_mac_cap[0] &= UAP_HE_MAC_CAP0_MASK;
hecap_ie->he_mac_cap[1] &= UAP_HE_MAC_CAP1_MASK;
hecap_ie->he_mac_cap[2] &= UAP_HE_MAC_CAP2_MASK;
@ -5188,6 +5498,13 @@ void woal_cfg80211_setup_he_cap(moal_private *priv,
phe_cap = (mlan_ds_11ax_he_capa *)fw_info.hw_he_cap;
hw_hecap_len = fw_info.hw_hecap_len;
woal_uap_update_11ax_ie(BAND_5GHZ, phe_cap);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
} else if (band->band == NL80211_BAND_6GHZ &&
fw_info.fw_bands & BAND_6G) {
phe_cap = (mlan_ds_11ax_he_capa *)fw_info.hw_he_cap;
hw_hecap_len = fw_info.hw_hecap_len;
woal_uap_update_11ax_ie(BAND_6GHZ, phe_cap);
#endif
} else if (band->band == NL80211_BAND_2GHZ &&
fw_info.fw_bands & BAND_GAX) {
phe_cap = (mlan_ds_11ax_he_capa *)fw_info.hw_2g_he_cap;
@ -5250,6 +5567,10 @@ void woal_cfg80211_setup_he_cap(moal_private *priv,
PRINTM(MCMND, "Clear PPE threshold 0x%x\n",
iftype_data->he_cap.he_cap_elem.phy_cap_info[7]);
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
if (band->band == NL80211_BAND_6GHZ)
iftype_data->he_6ghz_capa.capa = fw_info.hw_he_6g_cap;
#endif
band->n_iftype_data = 1;
band->iftype_data = iftype_data;
done:
@ -5505,9 +5826,17 @@ void woal_cfg80211_notify_channel(moal_private *priv,
struct ieee80211_channel *chan;
ENTER();
chan = woal_get_ieee80211_channel(priv, pchan_info);
if (chan && chan->flags & IEEE80211_CHAN_RADAR) {
if (priv->bss_role == MLAN_BSS_ROLE_UAP) {
woal_update_channels_dfs_state(
priv, pchan_info->channel,
pchan_info->bandcfg.chanWidth, DFS_AVAILABLE);
}
}
/* save the new channel for station interface */
if (priv->sme_current.ssid_len) {
chan = woal_get_ieee80211_channel(priv, pchan_info);
if (chan) {
moal_memcpy_ext(priv->phandle, &priv->conn_chan, chan,
sizeof(struct ieee80211_channel),
@ -5621,6 +5950,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
mcs_nss[1] = mcs_nss[0] |= 0x0c;
moal_memcpy_ext(
priv->phandle,
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
@ -5650,6 +5980,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
moal_memcpy_ext(
priv->phandle,
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
@ -5697,6 +6028,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
mcs_nss[1] = mcs_nss[0] |= 0x0c;
moal_memcpy_ext(
priv->phandle,
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
@ -5738,6 +6070,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
moal_memcpy_ext(
priv->phandle,
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
@ -5749,6 +6082,67 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
#endif
}
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
if (wiphy->bands[IEEE80211_BAND_6GHZ]) {
struct ieee80211_supported_band *bands =
wiphy->bands[IEEE80211_BAND_6GHZ];
if (((radio->param.ant_cfg.tx_antenna_6g & 0xFF) != 3 &&
(radio->param.ant_cfg.tx_antenna_6g & 0xFF) !=
0) ||
((radio->param.ant_cfg.rx_antenna_6g & 0xFF) != 3 &&
(radio->param.ant_cfg.rx_antenna_6g & 0xFF) !=
0)) {
if (bands->n_iftype_data &&
bands->iftype_data &&
bands->iftype_data->he_cap.has_he) {
t_u16 mcs_nss[2];
mcs_nss[0] = bands->iftype_data->he_cap
.he_mcs_nss_supp
.rx_mcs_80;
mcs_nss[1] = mcs_nss[0] |= 0x0c;
moal_memcpy_ext(
priv->phandle,
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
(t_void *)&mcs_nss,
sizeof(mcs_nss),
sizeof(bands->iftype_data->he_cap
.he_mcs_nss_supp));
}
} else if ((radio->param.ant_cfg.tx_antenna_6g &
0xFF) == 3 ||
(radio->param.ant_cfg.rx_antenna_6g &
0xFF) == 3) {
if (bands->n_iftype_data &&
bands->iftype_data &&
bands->iftype_data->he_cap.has_he) {
t_u16 mcs_nss[2];
mcs_nss[0] = bands->iftype_data->he_cap
.he_mcs_nss_supp
.rx_mcs_80;
mcs_nss[1] = mcs_nss[0] =
(mcs_nss[0] & ~0x0c) |
((mcs_nss[0] & 0x3) << 2);
moal_memcpy_ext(
priv->phandle,
(t_void *)&bands->iftype_data
->he_cap.he_mcs_nss_supp
.rx_mcs_80,
(t_void *)&mcs_nss,
sizeof(mcs_nss),
sizeof(bands->iftype_data->he_cap
.he_mcs_nss_supp));
}
}
}
#endif
}
}
#endif
@ -5777,6 +6171,10 @@ mlan_status woal_chandef_create(moal_private *priv,
band = IEEE80211_BAND_2GHZ;
else if (pchan_info->bandcfg.chanBand == BAND_5GHZ)
band = IEEE80211_BAND_5GHZ;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
else if (pchan_info->bandcfg.chanBand == BAND_6GHZ)
band = IEEE80211_BAND_6GHZ;
#endif
chandef->chan = ieee80211_get_channel(
priv->wdev->wiphy,
ieee80211_channel_to_frequency(pchan_info->channel, band));
@ -5982,3 +6380,96 @@ void woal_update_channel_dfs_state(t_u8 channel, t_u8 dfs_state)
m_handle[index]->wiphy, channel, dfs_state);
}
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
/**
* @brief Send Enable/Disable 6E Inband FILS Diacovery or Unsolicated Probe
* response frame request to MLAN
*
* @param priv A pointer to moal_private structure
* @param wait_option wait option
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING
* -- success, otherwise fail
*/
mlan_status woal_request_6e_inband_frame(
moal_private *priv, t_u8 wait_option,
struct cfg80211_fils_discovery *fils_discovery,
struct cfg80211_unsol_bcast_probe_resp *unsol_bcast_probe_resp)
{
mlan_ioctl_req *req = NULL;
mlan_ds_bss *bss = NULL;
mlan_status status;
t_u8 *tmpl = NULL;
t_u16 data_len;
inband_6e_frames_cmd_t *inband_frame;
ENTER();
data_len = MAX(fils_discovery->tmpl_len,
unsol_bcast_probe_resp->tmpl_len) +
sizeof(inband_6e_frames_cmd_t);
/* Allocate an IOCTL request buffer */
req = (mlan_ioctl_req *)woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss) +
data_len);
if (req == NULL) {
status = MLAN_STATUS_FAILURE;
goto done;
}
/* Fill request buffer */
bss = (mlan_ds_bss *)req->pbuf;
bss->sub_command = MLAN_OID_UAP_6E_INBAND_FRAME;
req->req_id = MLAN_IOCTL_BSS;
req->action = MLAN_ACT_SET;
inband_frame = &bss->param.inband_6e_frame;
inband_frame->type = NXP_6E_INBAND_FRAMES_TLV_ID;
inband_frame->enabled = MTRUE;
#define NXP_6E_INBAND_FRAMES_UPR 1
#define NXP_6E_INBAND_FRAMES_FILS 2
#define NXP_6E_INBAND_FRAMES_HOST 0x80
if (fils_discovery->tmpl_len) {
inband_frame->frameType =
NXP_6E_INBAND_FRAMES_FILS | NXP_6E_INBAND_FRAMES_HOST;
inband_frame->interval = fils_discovery->min_interval;
inband_frame->frameLen = fils_discovery->tmpl_len;
tmpl = (t_u8 *)fils_discovery->tmpl;
} else {
inband_frame->frameType =
NXP_6E_INBAND_FRAMES_UPR | NXP_6E_INBAND_FRAMES_HOST;
inband_frame->interval = unsol_bcast_probe_resp->interval;
inband_frame->frameLen = unsol_bcast_probe_resp->tmpl_len;
tmpl = (t_u8 *)unsol_bcast_probe_resp->tmpl;
}
if (tmpl) {
moal_memcpy_ext(priv->phandle, (void *)(inband_frame + 1), tmpl,
inband_frame->frameLen, inband_frame->frameLen);
}
inband_frame->len = data_len - sizeof(inband_frame->type) -
sizeof(inband_frame->len);
/* Send IOCTL request to MLAN */
status = woal_request_ioctl(priv, req, wait_option);
if (status == MLAN_STATUS_FAILURE) {
PRINTM(MERROR,
"Set %s inband %s failed! status=%d status_code=%d\n",
inband_frame->enabled ? "Enable" : "Disable",
fils_discovery->tmpl_len ? "FILS Discovery" :
unsol_bcast_probe_resp->tmpl_len ? "UPR" :
"Unknown",
status, req->status_code);
}
done:
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return status;
}
#endif

View file

@ -3,7 +3,7 @@
* @brief This file contains the CFG80211 specific defines.
*
*
* Copyright 2011-2022, 2024 NXP
* Copyright 2011-2022, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -56,6 +56,10 @@
#endif
#endif
#ifndef WLAN_CIPHER_SUITE_FILS_PSK
#define WLAN_CIPHER_SUITE_FILS_PSK 0x000FACFF
#endif
/* define for custom ie operation */
#define MLAN_CUSTOM_IE_AUTO_IDX_MASK 0xffff
#define IE_MASK_WPS 0x0001
@ -70,6 +74,8 @@
#define MRVL_PKT_TYPE_MGMT_EASYMESH 0xCF
#endif
t_u8 woal_check_fils_capability(const t_u8 *ie, int len);
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
void woal_cfg80211_stop_iface(moal_handle *handle);
@ -127,6 +133,7 @@ void woal_regulatory_work_queue(struct work_struct *work);
t_u8 woal_band_cfg_to_ieee_band(t_u32 band);
t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band);
t_u8 woal_radio_type_to_ieee_band(t_u8 radio_type);
int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
@ -547,6 +554,13 @@ void woal_cfg80211_setup_he_cap(moal_private *priv,
void woal_cfg80211_setup_uap_he_cap(moal_private *priv, t_u8 wait_option);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
mlan_status woal_request_6e_inband_frame(
moal_private *priv, t_u8 wait_option,
struct cfg80211_fils_discovery *fils_discovery,
struct cfg80211_unsol_bcast_probe_resp *unsol_bcast_probe_resp);
#endif
void woal_cfg80211_free_bands(struct wiphy *wiphy);
struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band);
@ -559,6 +573,7 @@ int woal_cfg80211_mgmt_frame_ie(
t_u8 wait_option);
int woal_get_active_intf_freq(moal_private *priv);
int woal_get_rx_freq(moal_private *priv, t_u8 band_config, t_u8 chan_num);
void woal_cfg80211_setup_ht_cap(struct ieee80211_sta_ht_cap *ht_info,
t_u32 dev_cap, t_u8 *mcs_set,
@ -577,4 +592,38 @@ int woal_get_wiphy_chan_dfs_state(struct wiphy *wiphy,
mlan_status woal_reset_wifi(moal_handle *handle, t_u8 cnt, char *reason);
/* Handling for 6E Indoor/Outdoor Mode */
#define OP_MODE_LEN 8
#define PSD_LEN 8
/**
* @brief Operation mode/PSD table
*/
typedef struct _mode_psd_t {
/** @brief Operation mode */
t_u8 op_mode[OP_MODE_LEN];
/** @brief PSD Value */
t_u8 psd_dbm[PSD_LEN];
} mode_psd_t;
/**
* @brief The structure for Region-Mode-PSD table
*/
typedef struct _rmp_table_t {
/** @brief Region or Code */
t_u8 code;
/** @brief Mode/Power */
mode_psd_t *mp_ptr;
} rmp_table_t;
void woal_dnld_uap_6e_psd_table(moal_private *priv, const t_u8 *beacon_buf,
t_u32 buf_len);
void woal_dnld_sta_6e_psd_table(moal_private *priv, t_u8 *resp_buf,
t_u32 resp_len,
chan_band_reginfo_t *psta_reg_info);
mlan_status woal_dnld_default_6e_psd_table(moal_private *priv);
#endif /* _MOAL_CFG80211_H_ */

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
* @brief This file contains the CFG80211 vendor specific defines.
*
*
* Copyright 2015-2021, 2024 NXP
* Copyright 2015-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -521,7 +521,7 @@ typedef struct _packet_filter {
spinlock_t lock;
t_u8 state;
t_u8 packet_filter_program[PACKET_FILTER_MAX_LEN];
t_u8 packet_filter_len;
t_u32 packet_filter_len;
t_u32 packet_filter_version;
t_u32 packet_filter_max_len;
} packet_filter;
@ -758,6 +758,13 @@ enum vendor_sub_command {
subcmd_get_csi_dump_path,
subcmd_get_csi_config,
subcmd_get_csi_capa,
subcmd_set_get_dmcs = 0x1920,
subcmd_set_get_edmac = 0x1921,
subcmd_set_get_aggrpriotbl = 0x1922,
subcmd_set_get_addbareject = 0x1923,
subcmd_set_get_tx_ampdu_prot_mode = 0x1924,
subcmd_twt_setup = 0x1925,
subcmd_twt_teardown = 0x1926,
sub_cmd_max,
};
@ -796,7 +803,6 @@ enum mkeep_alive_attributes {
MKEEP_ALIVE_ATTRIBUTE_AFTER_LAST,
MKEEP_ALIVE_ATTRIBUTE_MAX = MKEEP_ALIVE_ATTRIBUTE_AFTER_LAST - 1
};
int woal_roam_ap_info(moal_private *priv, t_u8 *data, int len);
/*Attribute for wpa_supplicant*/

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for debug proc file.
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -1459,8 +1459,10 @@ void woal_debug_entry(moal_private *priv)
i++) {
priv->hist_proc[i].ant_idx = i;
priv->hist_proc[i].priv = priv;
snprintf(hist_entry, sizeof(hist_entry), "wlan-ant%d",
i);
if (snprintf(hist_entry, sizeof(hist_entry),
"wlan-ant%d", i) <= 0)
PRINTM(MERROR,
"Fail to print ant index in histogram entry\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
r = proc_create_data(hist_entry, 0644, priv->hist_entry,
&histogram_proc_fops,
@ -1524,8 +1526,11 @@ void woal_debug_remove(moal_private *priv)
priv->bss_type == MLAN_BSS_TYPE_UAP) {
for (i = 0; i < priv->phandle->card_info->histogram_table_num;
i++) {
snprintf(hist_entry, sizeof(hist_entry), "wlan-ant%d",
i);
if (snprintf(hist_entry, sizeof(hist_entry),
"wlan-ant%d", i) <= 0) {
PRINTM(MERROR, "Failed to write wlan-ant%d\n",
i);
}
remove_proc_entry(hist_entry, priv->hist_entry);
}
remove_proc_entry("histogram", priv->proc_entry);

File diff suppressed because it is too large Load diff

View file

@ -127,6 +127,7 @@ typedef struct _chan_stats {
#define PRIV_CMD_HSSETPARA "hssetpara"
#define PRIV_CMD_MGMT_FILTER "mgmtfilter"
#define PRIV_CMD_SCANCFG "scancfg"
#define PRIV_CMD_6GSCANCFG "6gscancfg"
#define PRIV_CMD_GETNLNUM "getnlnum"
#define PRIV_CMD_AGGRCTRL "aggrctrl"
#ifdef USB
@ -395,6 +396,21 @@ typedef struct _ssu_params_cfg {
/** Private command to get secure boot uuid */
#define PRIV_CMD_GET_SB_UUID "getuuid"
#define FILS_IP_CONFIG "FILSIPCONFIG"
#define FILS_PSK_CONFIG "FILSPSKCONFIG"
#define FILS_IP_STR "ip"
#define FILS_MASK_STR "mask"
#define FILS_BASE_IP_STR "base_ip"
#define FILS_DNS_STR "dns"
#define FILS_COUNT_STR "max"
#define FILS_KEY "key"
#define FILS_BSSID "bssid"
mlan_status woal_set_fils_psk(moal_private *priv, char *data);
#ifdef UAP_SUPPORT
mlan_status woal_set_fils_ip_cfg(moal_private *priv, char *data);
#endif
/** Private command: 11AX Cfg */
#define PRIV_CMD_11AXCFG "11axcfg"
/** Private command: 11AX Cmd */

View file

@ -186,12 +186,11 @@ static int rps = 0;
* Default value of 0 keeps edmac disabled by default
*/
static int edmac_ctrl = 0;
static int tx_skb_clone = 1;
#ifdef IMX_SUPPORT
static int tx_skb_clone = 1;
static int pmqos = 1;
#else
static int tx_skb_clone = 0;
static int pmqos = 0;
#endif
@ -204,7 +203,9 @@ static int hs_auto_arp = 0;
/** 802.11d configuration */
static int cfg_11d;
#endif
#if defined(UAP_SUPPORT)
static int custom_11d_bcn_country_ie_en;
#endif
/** fw serial download check */
static int fw_serial = 1;
@ -343,6 +344,9 @@ int dual_nb;
/** disable 802.11h tpc configuration */
static int disable_11h_tpc = 0;
/** ignore TPE IE configuration from ex-AP*/
static int tpe_ie_ignore = 0;
#ifdef DEBUG_LEVEL1
#ifdef DEBUG_LEVEL2
#define DEFAULT_DEBUG_MASK (0xffffffff)
@ -441,6 +445,7 @@ static card_type_entry card_type_map_tbl[] = {
static int dfs53cfg = DFS_W53_DEFAULT_FW;
static int keep_previous_scan = 1;
static int make_before_break = 0;
static int auto_11ax = 1;
static int reject_addba_req = 0;
@ -971,10 +976,20 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
if (out_data)
if (IS_PCIE(handle->card_type)) {
if (out_data)
moal_extflg_set(handle,
EXT_PM_KEEP_POWER);
else
moal_extflg_clear(handle,
EXT_PM_KEEP_POWER);
} else {
moal_extflg_set(handle, EXT_PM_KEEP_POWER);
else
moal_extflg_clear(handle, EXT_PM_KEEP_POWER);
if (!out_data)
PRINTM(MMSG,
"pm_keep_power=0 config is not eligible for SDIO/USB");
}
PRINTM(MMSG, "pm_keep_power %s\n",
moal_extflg_isset(handle, EXT_PM_KEEP_POWER) ?
"on" :
@ -1005,6 +1020,17 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "cfg_11d = %d\n", params->cfg_11d);
}
#endif
#if defined(UAP_SUPPORT)
else if (strncmp(line, "custom_11d_bcn_country_ie_en",
strlen("custom_11d_bcn_country_ie_en")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->custom_11d_bcn_country_ie_en = out_data;
PRINTM(MMSG, "custom_11d_bcn_country_ie_en = %d\n",
params->custom_11d_bcn_country_ie_en);
}
#endif
#if defined(SDIO)
else if (strncmp(line, "slew_rate", strlen("slew_rate")) == 0) {
if (parse_line_read_int(line, &out_data) !=
@ -1647,6 +1673,22 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
params->disable_11h_tpc = out_data;
PRINTM(MMSG, "disable_11h_tpc=%x\n",
params->disable_11h_tpc);
} else if (strncmp(line, "tpe_ie_ignore",
strlen("tpe_ie_ignore")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->tpe_ie_ignore = out_data;
PRINTM(MMSG, "tpe_ie_ignore=%x\n",
params->tpe_ie_ignore);
} else if (strncmp(line, "make_before_break",
strlen("make_before_break")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->make_before_break = out_data;
PRINTM(MMSG, "make_before_break=%x\n",
params->make_before_break);
}
}
@ -1836,8 +1878,15 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
handle->params.gpiopin = params->gpiopin;
#endif
if (pm_keep_power)
if (IS_PCIE(handle->card_type)) {
if (pm_keep_power)
moal_extflg_set(handle, EXT_PM_KEEP_POWER);
} else {
moal_extflg_set(handle, EXT_PM_KEEP_POWER);
if (!pm_keep_power)
PRINTM(MMSG,
"pm_keep_power=0 config is not eligible for SDIO/USB\n");
}
#if defined(SDIO) && defined(SDIO_SUSPEND_RESUME)
if (shutdown_hs)
moal_extflg_set(handle, EXT_SHUTDOWN_HS);
@ -1847,6 +1896,13 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
handle->params.cfg_11d = params->cfg_11d;
#endif
#if defined(UAP_SUPPORT)
handle->params.custom_11d_bcn_country_ie_en =
custom_11d_bcn_country_ie_en;
if (params)
handle->params.custom_11d_bcn_country_ie_en =
params->custom_11d_bcn_country_ie_en;
#endif
#if defined(SDIO)
handle->params.slew_rate = slew_rate;
if (params)
@ -1867,6 +1923,14 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
woal_dup_string(&handle->params.txpwrlimit_cfg,
params->txpwrlimit_cfg);
if (handle->params.txpwrlimit_cfg) {
memset(handle->mode_psd_file, 0, sizeof(handle->mode_psd_file));
strncpy(handle->mode_psd_file, handle->params.txpwrlimit_cfg,
strlen(handle->params.txpwrlimit_cfg) + 1);
PRINTM(MINFO, "Mode PSD file name: %s", handle->mode_psd_file);
}
handle->params.cntry_txpwr = cntry_txpwr;
if (params)
handle->params.cntry_txpwr = params->cntry_txpwr;
@ -2062,6 +2126,13 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
moal_extflg_set(handle, EXT_COUNTRY_IE_IGNORE);
if (params)
handle->params.disable_11h_tpc = params->disable_11h_tpc;
handle->params.tpe_ie_ignore = tpe_ie_ignore;
/* Ignore country IE when tpe ie is disabled */
if (tpe_ie_ignore)
moal_extflg_set(handle, EXT_COUNTRY_IE_IGNORE);
if (params)
handle->params.tpe_ie_ignore = params->tpe_ie_ignore;
handle->params.make_before_break = make_before_break;
}
/**
@ -2647,6 +2718,12 @@ void woal_init_from_dev_tree(void)
PRINTM(MERROR, "disable_11h_tpc=0x%x\n", data);
disable_11h_tpc = data;
}
} else if (!strncmp(prop->name, "tpe_ie_ignore",
strlen("tpe_ie_ignore"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "tpe_ie_ignore=0x%x\n", data);
tpe_ie_ignore = data;
}
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
@ -2659,6 +2736,14 @@ void woal_init_from_dev_tree(void)
}
#endif
#endif
else if (!strncmp(prop->name, "make_before_break",
strlen("make_before_break"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "make_before_break=0x%x\n",
data);
make_before_break = data;
}
}
}
LEAVE();
return;
@ -2784,6 +2869,8 @@ mlan_status woal_init_module_param(moal_handle *handle)
PRINTM(MMSG, "%s: init module param from usr cfg\n",
card_type_map_tbl[i].name);
size = (t_u32)handle->param_data->size;
// Casting is done to read and parse the data
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
data = (t_u8 *)handle->param_data->data;
while ((int)parse_cfg_get_line(data, size, line) != -1) {
if (line[0] == '#')
@ -2988,6 +3075,16 @@ module_param(cfg_11d, int, 0);
MODULE_PARM_DESC(cfg_11d,
"0: MLAN default; 1: Enable 802.11d; 2: Disable 802.11d");
#endif
#if defined(UAP_SUPPORT)
// It raises warning for same input name used for
// module_param and MODULE_PARM_DESC.
// coverity[misra_c_2012_rule_5_2_violation:SUPPRESS]
module_param(custom_11d_bcn_country_ie_en, int, 0);
MODULE_PARM_DESC(
custom_11d_bcn_country_ie_en,
"1: Enable Custom BCN Country ie; 0: Disable Custom BCN Country ie");
#endif
#if defined(SDIO)
module_param(slew_rate, int, 0);
MODULE_PARM_DESC(
@ -3115,7 +3212,7 @@ MODULE_PARM_DESC(
module_param(antcfg, int, 0660);
MODULE_PARM_DESC(
antcfg,
"0:default; SD8887/SD8987-[1:Tx/Rx antenna 1, 2:Tx/Rx antenna 2, 0xffff:enable antenna diversity];SD8897/SD8997-[Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B];9098/9097-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B,Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B]");
"0:default; SD8887/SD8987-[1:Tx/Rx antenna 1, 2:Tx/Rx antenna 2, 0xffff:enable antenna diversity];SD8897/SD8997-[Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B];9098/9097-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B,Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B];AW693-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B, Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B, Bit 16: 6G Tx/Rx path A, Bit 17: 6G Tx/Rx path B]");
module_param(uap_oper_ctrl, uint, 0);
MODULE_PARM_DESC(uap_oper_ctrl, "0:default; 0x20001:uap restarts on channel 6");
@ -3279,3 +3376,11 @@ MODULE_PARM_DESC(
module_param(disable_11h_tpc, int, 0);
MODULE_PARM_DESC(disable_11h_tpc,
"0: Enable 802.11h tpc; 1: Disable 802.11h tpc");
module_param(tpe_ie_ignore, int, 0);
MODULE_PARM_DESC(tpe_ie_ignore,
"0: obey TPE IEs from ex-AP; 1: ignore TPE IEs from ex-AP");
module_param(make_before_break, int, 0);
MODULE_PARM_DESC(
make_before_break,
"1: make_before_break during roam; 0: no make_before_break during roam");

View file

@ -3,7 +3,7 @@
* @brief This file contains ioctl function to MLAN
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -361,6 +361,8 @@ static inline int woal_copy_mcast_addr(mlan_multicast_list *mlist,
mcptr = mcptr->next;
}
#else
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
netdev_for_each_mc_addr (mcptr, dev)
woal_copy_mc_addr(mlist, mcptr->addr);
#endif /* < 2.6.35 */
@ -876,6 +878,70 @@ done:
return status;
}
/**
* @brief Set PSK
*
* @param priv A pointer to moal_private structure
* @param wait_option Wait option
* @param ssid_bssid A pointer to mlan_ssid_bssid structure
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --
* success, otherwise fail
*/
mlan_status woal_set_psk_11ai(moal_private *priv, t_u8 wait_option,
const t_u8 *addr, const t_u8 *key, int key_len)
{
mlan_ioctl_req *req = NULL;
mlan_ds_sec_cfg *sec = NULL;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
if (key_len) {
/* Allocate an IOCTL request buffer */
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_sec_cfg));
if (req == NULL) {
status = MLAN_STATUS_FAILURE;
goto error;
}
/* Fill request buffer */
sec = (mlan_ds_sec_cfg *)req->pbuf;
sec->sub_command = MLAN_OID_SEC_CFG_PASSPHRASE;
req->req_id = MLAN_IOCTL_SEC_CFG;
req->action = MLAN_ACT_SET;
/* Try Get All */
memset(&sec->param.passphrase, 0, sizeof(mlan_ds_passphrase));
if (addr)
moal_memcpy_ext(priv->phandle,
&sec->param.passphrase.bssid, addr,
MLAN_MAC_ADDR_LENGTH,
sizeof(mlan_802_11_mac_addr));
sec->param.passphrase.psk_type = MLAN_PSK_PMK;
moal_memcpy_ext(priv->phandle,
&(sec->param.passphrase.psk.pmk.pmk), key,
MLAN_MAX_KEY_LENGTH,
sizeof(sec->param.passphrase.psk.pmk.pmk));
/* Send IOCTL request to MLAN */
status = woal_request_ioctl(priv, req, wait_option);
if (status != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR, "11AI: Failed to set PSK\n");
goto error;
}
}
error:
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return status;
}
/**
* @brief Send multicast list request to MLAN
*
@ -1222,7 +1288,8 @@ void woal_check_mc_connection(moal_private *priv, t_u8 wait_option,
return;
#ifdef UAP_SUPPORT
for (i = 0; i < handle->priv_num; i++) {
if (GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_UAP) {
if (handle->priv[i] &&
GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_UAP) {
if (handle->priv[i]->bss_started == MTRUE)
woal_check_uap_dfs_status(handle->priv[i],
wait_option,
@ -1379,14 +1446,16 @@ done:
*
* @param priv A pointer to moal_private structure
* @param action Action set or get
* @param ie Information element
* @param ie Information element to set
* @param get_ie Information element to get
* @param ie_len Length of the IE
* @param wait_option wait option
*
* @return MLAN_STATUS_SUCCESS -- success, otherwise fail
*/
mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action, t_u8 *ie,
int *ie_len, t_u8 wait_option)
mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action,
const t_u8 *ie, t_u8 *get_ie, int *ie_len,
t_u8 wait_option)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ds_misc_cfg *misc = NULL;
@ -1394,7 +1463,7 @@ mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action, t_u8 *ie,
ENTER();
if ((action == MLAN_ACT_GET) && (ie == NULL || ie_len == NULL)) {
if ((action == MLAN_ACT_GET) && (get_ie == NULL || ie_len == NULL)) {
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -1431,7 +1500,7 @@ mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action, t_u8 *ie,
if (action == MLAN_ACT_GET) {
*ie_len = misc->param.gen_ie.len;
if (*ie_len)
moal_memcpy_ext(priv->phandle, ie,
moal_memcpy_ext(priv->phandle, get_ie,
misc->param.gen_ie.ie_data, *ie_len,
*ie_len);
}
@ -1544,6 +1613,9 @@ int woal_pre_warmreset(moal_private *priv)
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
/* Initialize private structures */
for (intf_num = 0; intf_num < handle->priv_num; intf_num++) {
if (!handle->priv[intf_num])
continue;
woal_init_priv(handle->priv[intf_num], MOAL_IOCTL_WAIT);
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
@ -1632,8 +1704,10 @@ int woal_warmreset(moal_private *priv)
/* Enable interfaces */
for (intf_num = 0; intf_num < handle->priv_num; intf_num++) {
netif_device_attach(handle->priv[intf_num]->netdev);
woal_start_queue(handle->priv[intf_num]->netdev);
if (handle->priv[intf_num]) {
netif_device_attach(handle->priv[intf_num]->netdev);
woal_start_queue(handle->priv[intf_num]->netdev);
}
}
done:
LEAVE();
@ -2125,6 +2199,51 @@ done:
return ret;
}
/**
* @brief Get previous AP's assoc_info
*
* @param priv A pointer to moal_private structure
* @param assoc_info A pointer to mlan_ds_assoc_info structure
* @param wait_option wait option
*
* @return MLAN_STATUS_SUCCESS -- success, otherwise fail
*/
mlan_status woal_get_prev_assoc_info(moal_private *priv,
mlan_ds_assoc_info *assoc_info,
t_u8 wait_option)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ds_misc_cfg *misc = NULL;
mlan_ioctl_req *req = NULL;
ENTER();
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
PRINTM(MERROR,
"Fail to allocate buffer for get assoc info request\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
req->req_id = MLAN_IOCTL_MISC_CFG;
misc = (pmlan_ds_misc_cfg)req->pbuf;
misc->sub_command = MLAN_OID_MISC_PREV_ASSOC_INFO;
req->action = MLAN_ACT_GET;
ret = woal_request_ioctl(priv, req, wait_option);
if (ret == MLAN_STATUS_SUCCESS && assoc_info)
moal_memcpy_ext(priv->phandle, assoc_info,
&misc->param.assoc_info,
sizeof(mlan_ds_assoc_info),
sizeof(mlan_ds_assoc_info));
done:
if (ret != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return ret;
}
#endif
/**
@ -2217,6 +2336,8 @@ mlan_status woal_get_active_intf_channel(moal_private *priv,
moal_handle *handle = priv->phandle;
int i;
for (i = 0; i < handle->priv_num; i++) {
if (!handle->priv[i])
continue;
#ifdef STA_SUPPORT
if (GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_STA) {
if (handle->priv[i]->media_connected == MTRUE)
@ -2459,7 +2580,8 @@ int woal_hostcmd_ioctl(struct net_device *dev, struct ifreq *req)
memset(&cmd_header, 0, sizeof(cmd_header));
/* get command header */
if (copy_from_user(&cmd_header, req->ifr_data + sizeof(buf_len),
if (copy_from_user(&cmd_header,
(void *)((t_u8 *)(req->ifr_data) + sizeof(buf_len)),
sizeof(HostCmd_Header))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
@ -2485,7 +2607,7 @@ int woal_hostcmd_ioctl(struct net_device *dev, struct ifreq *req)
/* get the whole command from user */
if (copy_from_user(misc->param.hostcmd.cmd,
req->ifr_data + sizeof(buf_len),
(void *)((t_u8 *)(req->ifr_data) + sizeof(buf_len)),
misc->param.hostcmd.len)) {
PRINTM(MERROR, "copy from user failed\n");
ret = -EFAULT;
@ -2506,7 +2628,7 @@ int woal_hostcmd_ioctl(struct net_device *dev, struct ifreq *req)
ret = -EFAULT;
goto done;
}
if (copy_to_user(req->ifr_data + sizeof(buf_len),
if (copy_to_user((void *)((t_u8 *)(req->ifr_data) + sizeof(buf_len)),
(t_u8 *)misc->param.hostcmd.cmd,
misc->param.hostcmd.len)) {
ret = -EFAULT;
@ -2697,9 +2819,10 @@ int woal_send_host_packet(struct net_device *dev, struct ifreq *req)
pmbuf->data_offset = MLAN_MIN_DATA_HEADER_LEN;
/* get whole packet and header */
if (copy_from_user(pmbuf->pbuf + pmbuf->data_offset,
req->ifr_data + sizeof(packet_len),
PACKET_HEADER_LEN + packet_len)) {
if (copy_from_user(
pmbuf->pbuf + pmbuf->data_offset,
(void *)((t_u8 *)(req->ifr_data) + sizeof(packet_len)),
PACKET_HEADER_LEN + packet_len)) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
woal_free_mlan_buffer(priv->phandle, pmbuf);
@ -3016,7 +3139,7 @@ done:
int woal_set_get_bss_role(moal_private *priv, struct iwreq *wrq)
{
int ret = 0;
int bss_role = 0;
t_u32 bss_role = 0;
t_u8 action = MLAN_ACT_GET;
ENTER();
@ -3038,7 +3161,7 @@ int woal_set_get_bss_role(moal_private *priv, struct iwreq *wrq)
ret = -EINVAL;
goto done;
}
if (bss_role == (int)GET_BSS_ROLE(priv)) {
if (bss_role == GET_BSS_ROLE(priv)) {
PRINTM(MWARN, "Already BSS is in desired role\n");
ret = -EINVAL;
goto done;
@ -3134,6 +3257,8 @@ static mlan_status woal_set_ipv6_ra_offload(moal_handle *handle, t_u8 enable)
misc->param.ipv6_ra_offload.ipv6_addrs_count = priv->ipv6count;
spin_lock_irqsave(&priv->ipv6addr_lock, flags);
ipv6_ra = misc->param.ipv6_ra_offload.ipv6_addrs;
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
list_for_each_entry (ipv6_entry, &priv->ipv6_addrses, link) {
moal_memcpy_ext(priv->phandle, ipv6_ra, ipv6_entry->ipv6_addr,
IPADDR_LEN, IPADDR_LEN);
@ -3177,7 +3302,7 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
req->action = MLAN_ACT_SET;
mef_cfg = (mlan_ds_misc_mef_flt_cfg *)(&misc->param.mef_flt_cfg);
mef_cfg->mef_act_type = MEF_ACT_WOWLAN;
mef_cfg->mef_act_type = MEF_ACT_MDNS;
mef_cfg->criteria = MBIT(3);
entry = (mef_entry_t *)&mef_cfg->mef_entry;
@ -4344,15 +4469,21 @@ void woal_get_version(moal_handle *handle, char *version, int max_len)
ver.l = handle->fw_release_number;
if (hotfix_ver) {
snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u.%u", ver.c[2],
ver.c[1], ver.c[0], ver.c[3], hotfix_ver);
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u.%u",
ver.c[2], ver.c[1], ver.c[0], ver.c[3],
hotfix_ver) <= 0)
PRINTM(MERROR,
"Failed to print hotfix fw version in buffer\n");
} else {
snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u", ver.c[2],
ver.c[1], ver.c[0], ver.c[3]);
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u", ver.c[2],
ver.c[1], ver.c[0], ver.c[3]) <= 0)
PRINTM(MERROR,
"Failed to print fw version in buffer\n");
}
snprintf(version, max_len, handle->driver_version, fw_ver);
if (snprintf(version, max_len, handle->driver_version, fw_ver) <= 0)
PRINTM(MERROR, "Failed to print driver version in buffer\n");
LEAVE();
}
@ -6156,6 +6287,7 @@ mlan_status woal_cancel_scan(moal_private *priv, t_u8 wait_option)
/* add 300ms delay, incase firmware delay 0x7f event after scan cancel
* command response */
woal_sched_timeout(300);
// coverity[LOCK_EVASION:SUPPRESS]
handle->scan_priv = NULL;
done:
if (ret != MLAN_STATUS_PENDING)
@ -6878,6 +7010,155 @@ done:
return ret;
}
/**
* @brief Set FILS PSK
*
* @param priv A pointer to moal_private structure
* @param data A pointer to a buffer
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --
* success, otherwise fail
*/
mlan_status woal_set_fils_psk(moal_private *priv, char *data)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_802_11_mac_addr mac = {0x00};
t_u8 key[MLAN_MAX_KEY_LENGTH] = {0};
char *begin, *end, *opt;
ENTER();
begin = data;
/* Parse command arguments */
while (begin) {
end = woal_strsep(&begin, ';', '/');
if (!end || !end[0])
break;
opt = woal_strsep(&end, '=', '/');
if (!opt || !end) {
PRINTM(MERROR, "Invalid option\n");
LEAVE();
return -EINVAL;
}
if (!strncmp(opt, FILS_KEY, strlen(FILS_KEY))) {
memset(key, 0, sizeof(key));
woal_ascii2hex((t_u8 *)key, end, MLAN_MAX_KEY_LENGTH);
} else if (!strncmp(opt, FILS_BSSID, strlen(FILS_BSSID))) {
woal_mac2u8(mac, end);
}
}
ret = woal_set_psk_11ai(priv, MOAL_IOCTL_WAIT, (t_u8 *)mac, (t_u8 *)key,
MLAN_MAX_KEY_LENGTH);
priv->enable_fils = MTRUE;
return ret;
}
#ifdef UAP_SUPPORT
/**
* @brief Set FILS IP Config
*
* @param priv A pointer to moal_private structure
* @param data A pointer to a buffer
*
* @return MLAN_STATUS_SUCCESS on success, otherwise fail
*/
mlan_status woal_set_fils_ip_cfg(moal_private *priv, char *data)
{
char *begin, *end, *opt;
ip_addr_cfg_t ip_cfg;
int maxClients = 0;
u8 ip[MAX_IPADDR];
u32 ip_address;
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ioctl_req *req = NULL;
mlan_ds_bss *bss = NULL;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
begin = data;
memset(&ip_cfg, 0, sizeof(ip_cfg));
/* Parse command arguments */
while (begin) {
end = woal_strsep(&begin, ';', '/');
if (!end || !end[0])
break;
opt = woal_strsep(&end, '=', '/');
if (!opt || !end) {
PRINTM(MERROR, "Invalid option\n");
LEAVE();
return -EINVAL;
}
if (!strncmp(opt, FILS_COUNT_STR, strlen(FILS_COUNT_STR))) {
maxClients = ip_cfg.maxClients;
if (woal_atoi(&maxClients, end) !=
MLAN_STATUS_SUCCESS) {
LEAVE();
return -EINVAL;
}
continue;
}
/* Parse and store the IP address */
in4_pton(end, strlen(end), ip, ' ', NULL);
ip_address =
ip[3] | (ip[2] << 8) | (ip[1] << 16) | (ip[0] << 24);
if (!strncmp(opt, FILS_IP_STR, strlen(FILS_IP_STR))) {
ip_cfg.ip = ip_address;
} else if (!strncmp(opt, FILS_MASK_STR,
strlen(FILS_MASK_STR))) {
ip_cfg.subnetMask = ip_address;
} else if (!strncmp(opt, FILS_BASE_IP_STR,
strlen(FILS_BASE_IP_STR))) {
ip_cfg.baseIp = ip_address;
} else if (!strncmp(opt, FILS_DNS_STR, strlen(FILS_DNS_STR))) {
ip_cfg.dnsIp = ip_address;
}
}
/* Allocate an IOCTL request buffer */
req = (mlan_ioctl_req *)woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
if (req == NULL) {
ret = -ENOMEM;
goto done;
}
/* Fill request buffer */
bss = (mlan_ds_bss *)req->pbuf;
bss->sub_command = MLAN_OID_FILS_IP_CFG;
req->req_id = MLAN_IOCTL_BSS;
req->action = MLAN_ACT_SET;
/* Fill IP configuration */
moal_memcpy_ext(priv->phandle, &(bss->param.bss_config.ip_cfg), &ip_cfg,
sizeof(ip_cfg), sizeof(bss->param.bss_config.ip_cfg));
/* Send IOCTL request to MLAN */
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
if (status != MLAN_STATUS_SUCCESS) {
ret = -EFAULT;
goto done;
}
priv->enable_fils = MTRUE;
done:
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return ret;
}
#endif
/**
* @brief set power mode
*
@ -8234,6 +8515,7 @@ static int parse_radio_mode_string(const char *s, size_t len,
char *tmp = NULL;
char *pos = NULL;
gfp_t flag;
t_u32 copy_len = 0;
ENTER();
if (!s || !d) {
@ -8241,14 +8523,16 @@ static int parse_radio_mode_string(const char *s, size_t len,
return -EINVAL;
}
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(RADIO_MODE_STR_LEN, flag);
string = kzalloc(RADIO_MODE_STR_LEN + 1, flag);
if (string == NULL) {
LEAVE();
return -ENOMEM;
}
moal_memcpy_ext(NULL, string, s + strlen("radio_mode="),
len - strlen("radio_mode="), RADIO_MODE_STR_LEN - 1);
copy_len = MIN(len - strlen("radio_mode="), RADIO_MODE_STR_LEN - 1);
moal_memcpy_ext(NULL, string, s + strlen("radio_mode="), copy_len,
copy_len);
string[RADIO_MODE_STR_LEN] = '\0';
tmp = string;
string = strstrip(string);
@ -8318,6 +8602,7 @@ static int parse_tx_pwr_string(moal_handle *handle, const char *s, size_t len,
t_u8 pow_conv = MFALSE;
t_u32 pow_limit = 24;
t_u8 card_type;
t_u32 copy_len = 0;
ENTER();
if (!s || !d) {
@ -8332,14 +8617,16 @@ static int parse_tx_pwr_string(moal_handle *handle, const char *s, size_t len,
pow_conv = MTRUE;
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(TX_PWR_STR_LEN, flag);
string = kzalloc(TX_PWR_STR_LEN + 1, flag);
if (string == NULL) {
LEAVE();
return -ENOMEM;
}
moal_memcpy_ext(NULL, string, s + strlen("tx_power="),
len - strlen("tx_power="), TX_PWR_STR_LEN - 1);
copy_len = MIN(len - strlen("tx_power="), TX_PWR_STR_LEN - 1);
moal_memcpy_ext(NULL, string, s + strlen("tx_power="), copy_len,
copy_len);
string[TX_PWR_STR_LEN] = '\0';
tmp = string;
string = strstrip(string);
@ -8393,6 +8680,7 @@ static int parse_tx_cont_string(const char *s, size_t len,
char *tmp = NULL;
char *pos = NULL;
gfp_t flag;
t_u32 copy_len = 0;
ENTER();
if (!s || !d) {
@ -8400,14 +8688,16 @@ static int parse_tx_cont_string(const char *s, size_t len,
return -EINVAL;
}
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(TX_CONT_STR_LEN, flag);
string = kzalloc(TX_CONT_STR_LEN + 1, flag);
if (string == NULL) {
LEAVE();
return -ENOMEM;
}
moal_memcpy_ext(NULL, string, s + strlen("tx_continuous="),
len - strlen("tx_continuous="), TX_CONT_STR_LEN - 1);
copy_len = MIN(len - strlen("tx_continuous="), TX_CONT_STR_LEN - 1);
moal_memcpy_ext(NULL, string, s + strlen("tx_continuous="), copy_len,
copy_len);
string[TX_CONT_STR_LEN] = '\0';
tmp = string;
string = strstrip(string);
@ -8463,6 +8753,7 @@ static int parse_trigger_frame_string(const char *s, size_t len,
char *tmp = NULL;
char *pos = NULL;
gfp_t flag;
t_u32 copy_len = 0;
ENTER();
if (!s || !d) {
@ -8470,13 +8761,15 @@ static int parse_trigger_frame_string(const char *s, size_t len,
return -EINVAL;
}
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(TRIGGER_FRAME_STR_LEN, flag);
string = kzalloc(TRIGGER_FRAME_STR_LEN + 1, flag);
if (string == NULL)
return -ENOMEM;
moal_memcpy_ext(NULL, string, s + strlen("trigger_frame="),
len - strlen("trigger_frame="),
TRIGGER_FRAME_STR_LEN - 1);
copy_len =
MIN(len - strlen("trigger_frame="), TRIGGER_FRAME_STR_LEN - 1);
moal_memcpy_ext(NULL, string, s + strlen("trigger_frame="), copy_len,
copy_len);
string[TRIGGER_FRAME_STR_LEN] = '\0';
tmp = string;
string = strstrip(string);
@ -8669,6 +8962,7 @@ static int parse_tx_frame_string(moal_handle *handle, const char *s, size_t len,
int i;
gfp_t flag;
t_u8 card_type;
t_u32 copy_len = 0;
BOOLEAN dot11ax = MFALSE;
ENTER();
@ -8677,7 +8971,7 @@ static int parse_tx_frame_string(moal_handle *handle, const char *s, size_t len,
return -EINVAL;
}
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(TX_FRAME_STR_LEN, flag);
string = kzalloc(TX_FRAME_STR_LEN + 1, flag);
if (string == NULL)
return -ENOMEM;
@ -8711,8 +9005,10 @@ static int parse_tx_frame_string(moal_handle *handle, const char *s, size_t len,
d->bssid[i] = 0xff;
}
moal_memcpy_ext(NULL, string, s + strlen("tx_frame="),
len - strlen("tx_frame="), TX_FRAME_STR_LEN - 1);
copy_len = MIN(len - strlen("tx_frame="), TX_FRAME_STR_LEN - 1);
moal_memcpy_ext(NULL, string, s + strlen("tx_frame="), copy_len,
copy_len);
string[TX_FRAME_STR_LEN] = '\0';
tmp = string;
string = strstrip(string);
@ -9042,7 +9338,8 @@ static int parse_otp_cal_data_rd_wr_string(const char *s, size_t len,
LEAVE();
return -EINVAL;
}
// Typecasting is done to read the value
// coverity[misra_c_2012_rule_11_8_violation:SUPPRESS]
string = (char *)&(s[strlen("otp_cal_data_rd_wr=")]);
pos = strsep(&string, " \t");
d->action = (t_u16)woal_string_to_number(pos);
@ -9104,7 +9401,7 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
err = MTRUE;
break;
case MFG_CMD_RF_BAND_AG:
if (val != 0 && val != 1)
if (val != 0 && val != 1 && val != 2)
err = MTRUE;
break;
case MFG_CMD_RF_CHANNELBW:
@ -9202,6 +9499,8 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
handle->rf_data->channel = 6;
else if (handle->rf_data->band == BAND_5GHZ)
handle->rf_data->channel = 36;
else if (handle->rf_data->band == BAND_6GHZ)
handle->rf_data->channel = 1;
break;
case MFG_CMD_RF_CHANNELBW:
handle->rf_data->bandwidth = misc->param.mfg_generic_cfg.data1;
@ -9358,12 +9657,21 @@ mlan_status woal_edmac_cfg(moal_private *priv, t_u8 *country_code)
ENTER();
is_etsi = woal_is_etsi_country(country_code);
if (is_etsi == MFALSE && priv->phandle->is_edmac_enabled == MFALSE)
return MLAN_STATUS_SUCCESS;
/* If WACP enabled, EDMAC / EU Adaptivity enabled (all countries /
* regions) */
if (priv->phandle->params.wacp_mode)
is_etsi = MTRUE;
else {
is_etsi = woal_is_etsi_country(country_code);
if (is_etsi == MTRUE && priv->phandle->is_edmac_enabled == MTRUE)
return MLAN_STATUS_SUCCESS;
if (is_etsi == MFALSE &&
priv->phandle->is_edmac_enabled == MFALSE)
return MLAN_STATUS_SUCCESS;
if (is_etsi == MTRUE &&
priv->phandle->is_edmac_enabled == MTRUE)
return MLAN_STATUS_SUCCESS;
}
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
@ -9396,3 +9704,56 @@ done:
LEAVE();
return status;
}
/**
* @brief Configures htc_cap by hostcmd
*
* @param priv A pointer to moal_private structure
* @param action MLAN_ACT_SET or MLAN_ACT_GET
* @param enable A pointer to enable status
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING on success,
* otherwise failure code
*/
mlan_status woal_ioctl_hostcmd_htc_cap(moal_private *priv, t_u16 action,
t_u8 *enable)
{
mlan_ioctl_req *req = NULL;
mlan_ds_misc_cfg *misc = NULL;
HostCmd_DS_802_11_DBGS_CFG *debug_cmd = NULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
/* Allocate an IOCTL request buffer */
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
ret = -ENOMEM;
goto done;
}
/* Fill request buffer */
misc = (mlan_ds_misc_cfg *)req->pbuf;
misc->sub_command = MLAN_OID_MISC_HOST_CMD;
req->req_id = MLAN_IOCTL_MISC_CFG;
req->action = action;
debug_cmd = (HostCmd_DS_802_11_DBGS_CFG *)misc->param.hostcmd.cmd;
debug_cmd->header.command = HostCmd_CMD_DBGS_CFG;
debug_cmd->header.size =
sizeof(HostCmd_DS_802_11_DBGS_CFG) + sizeof(t_u8) /* value */;
debug_cmd->action = action;
debug_cmd->subid = DEBUG_SUBID_ENABLE_HEHTC;
misc->param.hostcmd.len = debug_cmd->header.size;
if (action == MLAN_ACT_SET)
debug_cmd->data[0] = *enable;
/* Send IOCTL request to MLAN */
ret = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
if (ret != MLAN_STATUS_SUCCESS)
goto done;
if (action == MLAN_ACT_GET)
*enable = debug_cmd->data[0];
done:
if (ret != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return ret;
}

File diff suppressed because it is too large Load diff

View file

@ -133,6 +133,9 @@ Change log:
#include "moal_shim.h"
/* Wireless header */
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 12, 12)
#include <net/lib80211.h>
#endif
#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#endif
@ -338,7 +341,7 @@ typedef t_u8 BOOLEAN;
#endif
/** Driver version */
extern char driver_version[];
extern char driver_version[MLAN_MAX_VER_STR_LEN];
extern struct semaphore AddRemoveCardSem;
extern int wifi_status;
@ -490,6 +493,8 @@ typedef struct {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
static inline void woal_timer_handler(struct timer_list *t)
{
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
pmoal_drv_timer timer = from_timer(timer, t, tl);
#else
static inline void woal_timer_handler(unsigned long fcontext)
@ -970,6 +975,19 @@ mlan_status woal_do_dfs_cac(moal_private *priv,
#define MOAL_TIMER_1S 1000
/** 1 milisecond */
#define MOAL_TIMER_1MS 1
/**
* Firmware dump to logger includes additional time delay to
* complete dump. Duration shall be, 10 seconds if firmware
* dump to log is enabled OR 5 seconds otherwise.
*
*/
#ifdef FWDUMP_VIA_PRINT
/** 10 seconds */
#define MOAL_FW_DUMP_TIMER 10000
#else
/** 5 seconds */
#define MOAL_FW_DUMP_TIMER 5000
#endif
/** scan timeout set to 25 seconds */
#define SCAN_TIMEOUT_25S 25000
@ -988,6 +1006,9 @@ mlan_status woal_do_dfs_cac(moal_private *priv,
/** specific scan time after connected */
#define MIN_SPECIFIC_SCAN_CHAN_TIME 40
/* MAX SCAN TIMEOUT: 10 seconds, set to 9.5 seconds */
#define MAX_SCAN_TIMEOUT 9500
/** Default value of re-assoc timer */
#define REASSOC_TIMER_DEFAULT 500
@ -2025,6 +2046,7 @@ struct _moal_private {
mlan_ds_misc_gtk_rekey_data gtk_rekey_data;
dot11_protocol tx_protocols;
dot11_protocol rx_protocols;
t_u8 enable_fils;
t_u16 csi_seq;
/** 0-disable, 1-enable */
t_u16 csi_enable;
@ -2062,6 +2084,8 @@ struct _moal_private {
t_u64 uuid_lo;
t_u64 uuid_hi;
t_u16 auth_tx_wait_time;
t_u32 rx_pkt_ac[MAX_AC_QUEUES];
};
#ifdef SDIO
@ -2221,8 +2245,6 @@ struct mcs_field {
/** vht_field */
struct vht_field {
/** pad: for vht field require 2 bytes alignment */
t_u8 pad;
/** known */
t_u16 known;
/** flags */
@ -2251,7 +2273,6 @@ struct vht_field {
#define HE_CODING_LDPC_USER0 0x2000
/** he_field - COCO */
struct he_field {
t_u8 pad;
t_u16 data1;
t_u16 data2;
t_u16 data3;
@ -2408,32 +2429,28 @@ extern t_u8 ru_signal_52[9];
#define RADIOTAP_FLAGS_PAD_BTW_HEADER_PAYLOAD 0x20
#define RADIOTAP_FLAGS_FAILED_FCS_CHECK 0x40
#define RADIOTAP_FLAGS_USE_SGI_HT 0x80
struct radiotap_body {
/** timestamp */
t_u64 timestamp;
t_u64 timestamp; /* 0~7 bytes */
/** flags */
t_u8 flags;
t_u8 flags; /* 8th byte */
/** rate for LG pkt, RATE flag will be present, it shows datarate in
* 500Kbps. For HT/VHT pkt, RATE flag will not be present, it is not
* used. */
t_u8 rate;
t_u8 rate; /* 9th byte */
/** channel */
struct channel_field channel;
struct channel_field channel; /* 10~13 bytes */
/** antenna_signal */
t_s8 antenna_signal;
t_s8 antenna_signal; /* 14th byte */
/** antenna_noise */
t_s8 antenna_noise;
t_s8 antenna_noise; /* 15th byte */
/** antenna */
t_u8 antenna;
/** union for HT/VHT pkt */
union {
/** mcs field */
struct mcs_field mcs;
/** vht field */
struct vht_field vht;
/** he field */
struct he_field he;
} u;
t_u8 antenna; /* 16th byte */
/** Required Alignment */
t_u8 align_1; /* 17th byte */
/** rx flags Required Alignment is 2 */
t_u16 rx_flags; /* 18~19 bytes */
} __packed;
struct radiotap_header {
@ -2505,6 +2522,15 @@ int woal_enable_fw_roaming(moal_private *priv, int data);
#define GTK_REKEY_OFFLOAD_ENABLE 1
#define GTK_REKEY_OFFLOAD_SUSPEND 2
/** Supported bandwidth for monitor mode */
enum {
SNIFF_BW_20MHZ = 0,
SNIFF_BW_40MHZ = 1,
SNIFF_BW_40MHZ_ABOVE = 1,
SNIFF_BW_40MHZ_BELOW = 3,
SNIFF_BW_80MHZ = 4,
};
/** Monitor Band Channel Config */
typedef struct _netmon_band_chan_cfg {
t_u32 band;
@ -2571,6 +2597,7 @@ enum ext_mod_params {
EXT_SHUTDOWN_HS,
#endif
#endif
EXT_START_11AI_SCAN,
#if defined(USB)
EXT_SKIP_FWDNLD,
#endif
@ -2671,6 +2698,9 @@ typedef struct _moal_mod_para {
#if defined(STA_SUPPORT)
int cfg_11d;
#endif
#if defined(UAP_SUPPORT)
int custom_11d_bcn_country_ie_en;
#endif
#if defined(SDIO)
int slew_rate;
#endif
@ -2734,6 +2764,10 @@ typedef struct _moal_mod_para {
t_u32 reject_addba_req;
/** disable_11h_tpc setting */
int disable_11h_tpc;
/* tpe_ie_ignore setting */
int tpe_ie_ignore;
/* make_before_break during roam */
int make_before_break;
} moal_mod_para;
void woal_tp_acnt_timer_func(void *context);
@ -2853,6 +2887,10 @@ struct _moal_handle {
const struct firmware *dpd_data;
/** txpwr data file */
const struct firmware *txpwr_data;
/** Operation Mode PSD String */
char mode_psd_string[64];
/** Load time file name */
char mode_psd_file[64];
/** Hotplug device */
struct device *hotplug_device;
/** STATUS variables */
@ -3073,6 +3111,8 @@ struct _moal_handle {
/** reg debug flag */
t_u8 reg_dbg;
#ifdef SDIO
/** sdio_blk_size */
t_u32 sdio_blk_size;
#endif /* SDIO */
/** Netlink kernel socket */
struct sock *nl_sk;
@ -3229,11 +3269,7 @@ struct _moal_handle {
#endif
mlan_ds_misc_keep_alive keep_alive[MAX_KEEP_ALIVE_ID];
mlan_ds_misc_keep_alive_rx keep_alive_rx[MAX_KEEP_ALIVE_RX_ID];
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
struct net_device *napi_dev;
#else
struct net_device napi_dev;
#endif
struct napi_struct napi_rx;
/* bus interface operations */
moal_if_ops ops;
@ -3449,12 +3485,14 @@ extern t_u32 drvdbg;
} while (0)
#endif /* DEBUG_LEVEL2 */
#ifdef FWDUMP_VIA_PRINT
#define PRINTM_MFWDP_D(msg...) \
do { \
woal_print(MFWDP_D, msg); \
if (drvdbg & MFWDP_D) \
printk(KERN_DEBUG msg); \
} while (0)
#endif /*FWDUMP_VIA_PRINT*/
#define PRINTM_MFW_D(msg...) \
do { \
woal_print(MFW_D, msg); \
@ -3568,7 +3606,7 @@ static inline void woal_print(t_u32 level, char *fmt, ...)
#define DBG_DUMP_BUF_LEN 64
#define MAX_DUMP_PER_LINE 16
static inline void hexdump(t_u32 level, char *prompt, t_u8 *buf, int len)
static inline void hexdump(t_u32 level, char *prompt, const t_u8 *buf, int len)
{
int i;
char dbgdumpbuf[DBG_DUMP_BUF_LEN];
@ -3780,8 +3818,15 @@ static inline void woal_get_monotonic_time(wifi_timeval *tv)
/** Max register type/offset/value etc. parameter length allowed */
#define MAX_PARAM_LEN 12
/** HostCmd_CMD_DBGS_CFG for Debug cmd configuration */
#define HostCmd_CMD_DBGS_CFG 0x008b
/** Debug subcommand for enable hehtc */
#define DEBUG_SUBID_ENABLE_HEHTC 0x124
/** HostCmd_CMD_CFG_DATA for CAL data */
#define HostCmd_CMD_CFG_DATA 0x008f
/** HostCmd action set */
#define HostCmd_ACT_GEN_SET 0x0001
/** HostCmd CAL data header length */
@ -3805,6 +3850,17 @@ typedef struct _HostCmd_DS_802_11_CFG_DATA {
t_u8 data[1];
} __ATTRIB_PACK__ HostCmd_DS_802_11_CFG_DATA;
typedef struct _HostCmd_DS_802_11_DBGS_CFG {
/** hostcmd header */
HostCmd_DS_GEN header;
/** sub cmd action */
t_u16 action;
/** subid */
t_u16 subid;
/** Data */
t_u8 data[];
} __ATTRIB_PACK__ HostCmd_DS_802_11_DBGS_CFG;
/** combo scan header */
#define WEXT_CSCAN_HEADER "CSCAN S\x01\x00\x00S\x00"
/** combo scan header size */
@ -3988,13 +4044,17 @@ void woal_request_set_multicast_list(moal_private *priv,
mlan_status woal_request_ioctl(moal_private *priv, mlan_ioctl_req *req,
t_u8 wait_option);
/** Set/Get generic element */
mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action, t_u8 *ie,
int *ie_len, t_u8 wait_option);
mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action,
const t_u8 *ie, t_u8 *get_ie, int *ie_len,
t_u8 wait_option);
#ifdef CONFIG_PROC_FS
mlan_status woal_request_soft_reset(moal_handle *handle);
#endif
int woal_request_fw_reload(moal_handle *phandle, t_u8 mode);
mlan_status woal_set_psk_11ai(moal_private *priv, t_u8 wait_option,
const t_u8 *addr, const t_u8 *key, int key_len);
/** Get debug information */
mlan_status woal_get_debug_info(moal_private *priv, t_u8 wait_option,
mlan_debug_info *debug_info);
@ -4074,8 +4134,10 @@ void woal_dump_firmware_info(moal_handle *phandle);
void woal_dump_firmware_info_v2(moal_handle *phandle);
void woal_dump_firmware_info_v3(moal_handle *phandle);
#endif /* SDIO_MMC */
#ifdef FWDUMP_VIA_PRINT
/* Print FW dumps in kernel(dmesg) log */
t_void woal_print_firmware_dump(moal_handle *phandle, char *fwdp_fname);
#endif /*FWDUMP_VIA_PRINT*/
/* Store the FW dumps received from events in a file */
void woal_store_firmware_dump(moal_handle *phandle, pmlan_event pmevent);
void woal_send_fw_dump_complete_event(moal_private *priv);
@ -4116,7 +4178,9 @@ mlan_status woal_get_assoc_rsp(moal_private *priv,
mlan_status woal_get_assoc_req(moal_private *priv,
mlan_ds_misc_assoc_req *assoc_req,
t_u8 wait_option);
mlan_status woal_get_prev_assoc_info(moal_private *priv,
mlan_ds_assoc_info *assoc_info,
t_u8 wait_option);
/** Get signal information */
mlan_status woal_get_signal_info(moal_private *priv, t_u8 wait_option,
mlan_ds_get_signal *signal);
@ -4351,6 +4415,12 @@ void woal_set_multicast_list(struct net_device *dev);
mlan_status woal_request_fw(moal_handle *handle);
mlan_status woal_ioctl_aggr_prio_tbl(moal_private *priv, t_u32 action,
mlan_ds_11n_aggr_prio_tbl *aggr_prio_tbl);
mlan_status woal_ioctl_addba_reject(moal_private *priv, t_u32 action,
t_u8 *addba_reject);
mlan_status woal_ioctl_tx_ampdu_prot_mode(moal_private *priv, t_u32 action,
t_u16 *prot_mode);
mlan_status woal_ioctl_addba_param(moal_private *priv, t_u32 action,
mlan_ds_11n_addba_param *addba_param);
int woal_11h_channel_check_ioctl(moal_private *priv, t_u8 wait_option);
void woal_cancel_cac_block(moal_private *priv);
@ -4429,7 +4499,7 @@ void woal_remove_mcast_node(moal_private *priv, t_u8 *mcast_addr);
t_u8 woal_find_mcast_node_tx(moal_private *priv, struct sk_buff *skb);
mlan_status woal_request_country_power_table(moal_private *priv, char *region,
t_u8 wait_option);
t_u8 wait_option, t_u8 psd_mode);
mlan_status woal_mc_policy_cfg(moal_private *priv, t_u16 *enable,
t_u8 wait_option, t_u8 action);
#ifdef UAP_SUPPORT
@ -4471,6 +4541,10 @@ mlan_status woal_set_net_monitor(moal_private *priv, t_u8 wait_option,
t_u8 enable, t_u8 filter,
netmon_band_chan_cfg *band_chan_cfg);
#endif
#ifdef UAP_SUPPORT
mlan_status woal_send_bcn_country_ie_cmd_fw(moal_private *priv,
t_u8 wait_option);
#endif
mlan_status woal_delba_all(moal_private *priv, t_u8 wait_option);
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
@ -4576,4 +4650,24 @@ struct reflective_enum_element {
extern const char *wlan_errorcode_get_name(enum host_error_code_id id);
/*
* Redefine GFP_KERNEL for coverity issue,
* checker: MISRA C-2012 Rule 10.8,
* msg: Cast from 16 bit width expression \"0x400U | 0x800U\" to a wider 32 bit
* type., description: The value of a composite expression shall not be cast to
* a different essential type category or a wider essential type.
*/
#ifdef __GFP_RECLAIM
#ifdef GFP_KERNEL
#undef GFP_KERNEL
#define GFP_KERNEL \
((__GFP_DIRECT_RECLAIM | __GFP_KSWAPD_RECLAIM) | __GFP_IO | __GFP_FS)
#endif
#endif
mlan_status woal_ioctl_hostcmd_htc_cap(moal_private *priv, t_u16 action,
t_u8 *enable);
int woal_getset_regrdwr(moal_private *priv, t_u32 action, t_u32 type,
t_u32 offset, t_u32 *value);
#endif /* _MOAL_MAIN_H */

View file

@ -153,6 +153,7 @@ static const struct pci_device_id wlan_ids[] = {
/* moal interface ops */
static moal_if_ops pcie_ops;
/********************************************************
Global Variables
********************************************************/
@ -186,6 +187,13 @@ static t_u16 woal_update_card_type(t_void *card)
card_type = CARD_TYPE_PCIE8897;
moal_memcpy_ext(NULL, driver_version, CARD_PCIE8897,
strlen(CARD_PCIE8897), strlen(driver_version));
/* we are copying card name in middle of full version, we can
not copy null termination. This was already tried and
reverted as full version got terminated in middlei(See commit
57c27201f9a23562337491f3cbb9833ca348076c). thus suppressing
the coverity warning for all card types in this function. */
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -199,6 +207,8 @@ static t_u16 woal_update_card_type(t_void *card)
card_type = CARD_TYPE_PCIE8997;
moal_memcpy_ext(NULL, driver_version, CARD_PCIE8997,
strlen(CARD_PCIE8997), strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -212,6 +222,8 @@ static t_u16 woal_update_card_type(t_void *card)
card_type = CARD_TYPE_PCIE9097;
moal_memcpy_ext(NULL, driver_version, CARD_PCIE9097,
strlen(CARD_PCIE9097), strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -227,6 +239,7 @@ static t_u16 woal_update_card_type(t_void *card)
moal_memcpy_ext(NULL, driver_version, CARD_PCIE9098,
strlen(CARD_PCIE9098), strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -241,6 +254,8 @@ static t_u16 woal_update_card_type(t_void *card)
card_type = CARD_TYPE_PCIEAW693;
moal_memcpy_ext(NULL, driver_version, CARD_PCIEAW693,
strlen(CARD_PCIEAW693), strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -254,6 +269,8 @@ static t_u16 woal_update_card_type(t_void *card)
card_type = CARD_TYPE_PCIEIW624;
moal_memcpy_ext(NULL, driver_version, CARD_PCIEIW624,
strlen(CARD_PCIEIW624), strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -792,8 +809,10 @@ static int woal_pcie_suspend(struct pci_dev *pdev, pm_message_t state)
goto done;
}
}
for (i = 0; i < handle->priv_num; i++)
netif_device_detach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_detach(handle->priv[i]->netdev);
}
if (keep_power) {
woal_sched_timeout(200);
@ -807,8 +826,11 @@ static int woal_pcie_suspend(struct pci_dev *pdev, pm_message_t state)
} else {
PRINTM(MMSG, "HS not actived, suspend fail!");
handle->suspend_fail = MTRUE;
for (i = 0; i < handle->priv_num; i++)
netif_device_attach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_attach(
handle->priv[i]->netdev);
}
ret = -EBUSY;
goto done;
}
@ -897,8 +919,10 @@ static int woal_pcie_resume(struct pci_dev *pdev)
LEAVE();
return MLAN_STATUS_SUCCESS;
}
for (i = 0; i < handle->priv_num; i++)
netif_device_attach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_attach(handle->priv[i]->netdev);
}
woal_cancel_hs(woal_get_priv(handle, MLAN_BSS_ROLE_ANY),
MOAL_NO_WAIT);
@ -1673,6 +1697,14 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
PRINTM(MERROR, "FW in debug mode (0x%x)\n", value);
drv_ptr += sprintf(drv_ptr, "FW in debug mode (0x%x)\n",
value);
if (value == FW_STUCK_CODE_VERSION_MISMATCH) {
phandle->driver_init = MFALSE;
PRINTM(MERROR,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
drv_ptr += sprintf(
drv_ptr,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
}
}
}
@ -1835,6 +1867,11 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
value = (value & 0xff00) >> 8;
if (value) {
PRINTM(MERROR, "FW in debug mode (0x%x)\n", value);
if (value == FW_STUCK_CODE_VERSION_MISMATCH) {
phandle->driver_init = MFALSE;
PRINTM(MERROR,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
}
}
}
@ -2259,11 +2296,10 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
"pre-allocced buf is not enough\n");
}
if (RDWR_STATUS_DONE == stat) {
PRINTM(MMSG, "%s done: size=0x%x\n",
PRINTM(MMSG, "%s done: size=0x%lx\n",
mem_type_mapping_tbl[idx].mem_name,
(unsigned int)(dbg_ptr -
mem_type_mapping_tbl[idx]
.mem_Ptr));
(dbg_ptr -
mem_type_mapping_tbl[idx].mem_Ptr));
#ifdef DUMP_TO_PROC
woal_save_dump_info_to_buf(
phandle,
@ -2576,7 +2612,8 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
if (phandle->event_fw_dump) {
queue_work(phandle->workqueue, &phandle->main_work);
phandle->is_fw_dump_timer_set = MTRUE;
woal_mod_timer(&phandle->fw_dump_timer, MOAL_TIMER_5S);
woal_mod_timer(&phandle->fw_dump_timer,
MOAL_FW_DUMP_TIMER);
return;
}
}
@ -2833,18 +2870,28 @@ static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
if (boot_mode != 0x03) {
/* remove extension .se */
if (strstr(handle->card_info->fw_name,
".se"))
".se")) {
// strstr's output is sanitized
// in if condition
// coverity[cert_pos54_c_violation:SUPPRESS]
// coverity[cert_err33_c_violation:SUPPRESS]
memset(strstr(handle->card_info
->fw_name,
".se"),
'\0', sizeof(".se"));
}
if (strstr(handle->card_info
->fw_name_wlan,
".se"))
".se")) {
// strstr's output is sanitized
// in if condition
// coverity[cert_pos54_c_violation:SUPPRESS]
// coverity[cert_err33_c_violation:SUPPRESS]
memset(strstr(handle->card_info
->fw_name_wlan,
".se"),
'\0', sizeof(".se"));
}
}
break;
case PCIEAW693_A0:
@ -2997,11 +3044,16 @@ done:
static void woal_pcie_work(struct work_struct *work)
{
pcie_service_card *card =
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
container_of(work, pcie_service_card, reset_work);
moal_handle *handle = NULL;
moal_handle *ref_handle = NULL;
PRINTM(MMSG, "========START IN-BAND RESET===========\n");
handle = card->handle;
if (!handle)
return;
PRINTM(MMSG, "========START IN-BAND RESET===========\n");
// handle-> mac0 , ref_handle->second mac
if (handle->pref_mac) {
@ -3033,23 +3085,26 @@ static void woal_pcie_work(struct work_struct *work)
}
if (woal_pcie_reset_fw(handle)) {
PRINTM(MERROR, "PCIe In-band Reset Fail\n");
goto done;
woal_send_auto_recovery_failure_event(handle);
wifi_status = WIFI_STATUS_FW_RECOVERY_FAIL;
return;
}
handle->surprise_removed = MFALSE;
if (MLAN_STATUS_SUCCESS == woal_do_flr(handle, false, true))
handle->fw_reseting = MFALSE;
else
else {
handle = NULL;
wifi_status = WIFI_STATUS_FW_RECOVERY_FAIL;
return;
}
if (ref_handle) {
ref_handle->surprise_removed = MFALSE;
if (MLAN_STATUS_SUCCESS == woal_do_flr(ref_handle, false, true))
ref_handle->fw_reseting = MFALSE;
}
card->work_flags = MFALSE;
done:
wifi_status = WIFI_STATUS_OK;
if (handle)
woal_send_auto_recovery_complete_event(handle);
woal_send_auto_recovery_complete_event(handle);
PRINTM(MMSG, "========END IN-BAND RESET===========\n");
return;
}

View file

@ -77,7 +77,7 @@ Change log:
/** Default firmware name */
#ifdef PCIE8997
#define PCIE8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_combo_v4.bin"
#define PCIE8997_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8997_combo_v4.bin"
#define PCIEUART8997_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8997_combo_v4.bin"
#define PCIEUSB8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_combo_v4.bin"
#define PCIE8997_DEFAULT_WLAN_FW_NAME "nxp/pcie8997_wlan_v4.bin"
@ -87,7 +87,7 @@ Change log:
#endif /* PCIE8997 */
#ifdef PCIE8897
#define PCIE8897_DEFAULT_COMBO_FW_NAME "nxp/pcie8897_uapsta.bin"
#define PCIE8897_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8897_combo.bin"
#define PCIE8897_DEFAULT_WLAN_FW_NAME "nxp/pcie8897_wlan.bin"
#endif /* PCIE8897*/
@ -107,7 +107,7 @@ Change log:
#define PCIE9098_A0 0x01
#define PCIE9098_A1 0x02
#define PCIE9098_A2 0x03
#define PCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9098_combo.bin"
#define PCIEUART9098_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9098_combo.bin"
#define PCIEUSB9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEPCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pciepcie9098_combo.bin"
@ -122,7 +122,7 @@ Change log:
#define PCIE9097_A0 0x00
#define PCIE9097_B0 0x01
#define PCIE9097_B1 0x02
#define PCIE9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw620_combo.bin"
#define PCIE9097_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw620_combo.bin"
#define PCIEUART9097_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw620_combo.bin"
#define PCIEUSB9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw620_combo.bin"
#define PCIEUART9097_COMBO_V1_FW_NAME "nxp/pcieuartiw620_combo_v1.bin"
@ -132,7 +132,7 @@ Change log:
#endif /* PCIE9097 */
#ifdef PCIEIW624
#define PCIEIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw624_combo.bin"
#define PCIEIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw624_combo.bin"
#define PCIEUARTIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw624_combo.bin"
#define PCIEUSBIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw624_combo.bin"
#define PCIEUARTUARTIW624_DEFAULT_COMBO_FW_NAME \

View file

@ -1766,144 +1766,6 @@ done:
return ret;
}
/**
* @brief Set/Get network monitor configurations
*
* @param priv A pointer to moal_private structure
* @param wrq A pointer to iwreq structure
*
* @return 0 --success, otherwise fail
*/
static int woal_net_monitor_ioctl(moal_private *priv, struct iwreq *wrq)
{
int user_data_len = wrq->u.data.length;
int data[5] = {0}, copy_len;
int ret = 0;
mlan_ioctl_req *req = NULL;
mlan_ds_misc_cfg *misc = NULL;
mlan_ds_misc_net_monitor *net_mon = NULL;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
copy_len = MIN(sizeof(data), sizeof(int) * user_data_len);
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
LEAVE();
return -ENOMEM;
}
misc = (mlan_ds_misc_cfg *)req->pbuf;
net_mon = (mlan_ds_misc_net_monitor *)&misc->param.net_mon;
misc->sub_command = MLAN_OID_MISC_NET_MONITOR;
req->req_id = MLAN_IOCTL_MISC_CFG;
if (!user_data_len) {
req->action = MLAN_ACT_GET;
} else if (user_data_len == 1 || user_data_len == 4 ||
user_data_len == 5) {
if (copy_from_user(data, wrq->u.data.pointer, copy_len)) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
}
if (data[0] != MTRUE && data[0] != MFALSE) {
PRINTM(MERROR,
"NET_MON: Activity should be enable(=1)/disable(=0)\n");
ret = -EINVAL;
goto done;
}
net_mon->enable_net_mon = data[0];
if (data[0] == MTRUE) {
int i;
if (user_data_len != 4 && user_data_len != 5) {
PRINTM(MERROR,
"NET_MON: Invalid number of args!\n");
ret = -EINVAL;
goto done;
}
/* Supported filter flags */
if (!data[1] || data[1] & ~(MLAN_NETMON_DATA |
MLAN_NETMON_MANAGEMENT |
MLAN_NETMON_CONTROL)) {
PRINTM(MERROR,
"NET_MON: Invalid filter flag\n");
ret = -EINVAL;
goto done;
}
/* Supported bands */
for (i = 0; i < (int)sizeof(SupportedInfraBand); i++)
if (data[2] == SupportedInfraBand[i])
break;
if (i == sizeof(SupportedInfraBand)) {
PRINTM(MERROR, "NET_MON: Invalid band\n");
ret = -EINVAL;
goto done;
}
/* Supported channel */
if (data[3] < 1 || data[3] > MLAN_MAX_CHANNEL) {
PRINTM(MERROR,
"NET_MON: Invalid channel number\n");
ret = -EINVAL;
goto done;
}
if (user_data_len == 5) {
/* Secondary channel offset */
if (!(data[2] & (BAND_GN | BAND_AN))) {
PRINTM(MERROR,
"No 11n in band, can not set "
"secondary channel offset\n");
ret = -EINVAL;
goto done;
}
if ((data[4] != CHANNEL_BW_20MHZ) &&
(data[4] != CHANNEL_BW_40MHZ_ABOVE) &&
(data[4] != CHANNEL_BW_40MHZ_BELOW) &&
(data[4] != CHANNEL_BW_80MHZ)) {
PRINTM(MERROR,
"Invalid secondary channel bandwidth, "
"only allowed 0, 1, 3 or 4\n");
ret = -EINVAL;
goto done;
}
net_mon->chan_bandwidth = data[4];
}
net_mon->filter_flag = data[1];
net_mon->band = data[2];
net_mon->channel = data[3];
}
req->action = MLAN_ACT_SET;
} else {
PRINTM(MERROR, "NET_MON: Invalid number of args!\n");
ret = -EINVAL;
goto done;
}
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
if (status != MLAN_STATUS_SUCCESS) {
ret = -EFAULT;
goto done;
}
data[0] = net_mon->enable_net_mon;
data[1] = net_mon->filter_flag;
data[2] = net_mon->band;
data[3] = net_mon->channel;
data[4] = net_mon->chan_bandwidth;
wrq->u.data.length = 5;
if (copy_to_user(wrq->u.data.pointer, data,
sizeof(int) * wrq->u.data.length)) {
PRINTM(MERROR, "Copy to user failed\n");
ret = -EFAULT;
goto done;
}
done:
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return ret;
}
/**
* @brief Get LOG
*
@ -6829,9 +6691,6 @@ int woal_wext_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
case WOAL_SLEEP_PARAMS:
ret = woal_sleep_params_ioctl(priv, wrq);
break;
case WOAL_NET_MONITOR:
ret = woal_net_monitor_ioctl(priv, wrq);
break;
case WOAL_DFS_TESTING:
ret = woal_dfs_testing(priv, wrq);
break;

View file

@ -3,7 +3,7 @@
* @brief This file contains functions for proc file.
*
*
* Copyright 2008-2022, 2024-2025 NXP
* Copyright 2008-2022, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -212,6 +212,8 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
mcptr = mcptr->next;
}
#else
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
netdev_for_each_mc_addr (mcptr, netdev)
seq_printf(
sfp,
@ -494,10 +496,20 @@ static void woal_priv_get_tx_rx_ant(struct seq_file *sfp, moal_private *priv)
ret = sizeof(int) * 2;
else
ret = sizeof(int) * 1;
if (IS_CARDIW624(priv->phandle->card_type) ||
IS_CARDAW693(priv->phandle->card_type)) {
data[2] = radio->param.ant_cfg.tx_antenna_6g;
data[3] = radio->param.ant_cfg.rx_antenna_6g;
if (data[2] && data[3])
ret = sizeof(int) * 4;
}
if (ret == sizeof(int) * 1)
seq_printf(sfp, "antcfg=0x%x\n", data[0]);
else if (ret == sizeof(int) * 2)
seq_printf(sfp, "antcfg=0x%x 0x%x\n", data[0], data[1]);
else if (ret == sizeof(int) * 4)
seq_printf(sfp, "antcfg=0x%x 0x%x %d %d\n", data[0],
data[1], data[2], data[3]);
} else {
if (radio->param.ant_cfg_1x1.antenna == 0xffff) {
@ -530,7 +542,7 @@ static mlan_status woal_priv_set_tx_rx_ant(moal_handle *handle, char *line)
memset((char *)data, 0, sizeof(data));
parse_arguments(line, data, ARRAY_SIZE(data), &user_data_len);
if (user_data_len > 2) {
if (user_data_len > 4) {
PRINTM(MERROR, "Invalid number of args!\n");
LEAVE();
return MLAN_STATUS_FAILURE;
@ -570,6 +582,10 @@ static mlan_status woal_priv_set_tx_rx_ant(moal_handle *handle, char *line)
}
if (user_data_len == 2)
radio->param.ant_cfg.rx_antenna = data[1];
if (user_data_len == 4) {
radio->param.ant_cfg.tx_antenna_6g = data[2];
radio->param.ant_cfg.rx_antenna_6g = data[3];
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
if (IS_CARD9098(priv->phandle->card_type) ||
IS_CARD9097(priv->phandle->card_type) ||
@ -624,6 +640,7 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
#endif
moal_handle *ref_handle = NULL;
t_u32 cmd = 0;
t_u32 tmp_count = 0;
int copy_len;
moal_private *priv = NULL;
@ -634,7 +651,13 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
}
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
databuf = kzalloc(count, flag);
if (!woal_secure_add(&count, 1, &tmp_count, TYPE_UINT32)) {
PRINTM(MERROR, "%s:count param overflow \n", __func__);
LEAVE();
return -EINVAL;
}
databuf = kzalloc(tmp_count, flag);
if (databuf == NULL) {
LEAVE();
return -ENOMEM;
@ -647,6 +670,7 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
LEAVE();
return 0;
}
databuf[count] = '\0';
line = databuf;
if (!strncmp(databuf, "soft_reset", strlen("soft_reset"))) {
line += strlen("soft_reset") + 1;
@ -1146,7 +1170,7 @@ static int woal_drv_dump_read(struct seq_file *sfp, void *data)
goto done;
}
if (sfp->size < handle->drv_dump_len) {
PRINTM(MERROR,
PRINTM(MCMND,
"drv dump size too big, size=%d, drv_dump_len=%d\n",
(int)sfp->size, handle->drv_dump_len);
sfp->count = sfp->size;
@ -1224,7 +1248,7 @@ static int woal_fw_dump_read(struct seq_file *sfp, void *data)
}
if (sfp->size < handle->fw_dump_len) {
PRINTM(MERROR,
PRINTM(MCMND,
"fw dump size too big, size=%d, fw_dump_len=%ld\n",
(int)sfp->size, (long int)handle->fw_dump_len);
sfp->count = sfp->size;
@ -1353,7 +1377,7 @@ int woal_string_to_number(char *s)
} else
base = 10;
for (; *s; s++) {
for (; *s;) {
if ((*s >= '0') && (*s <= '9'))
r = (r * base) + (*s - '0');
else if ((*s >= 'A') && (*s <= 'F'))
@ -1362,6 +1386,8 @@ int woal_string_to_number(char *s)
r = (r * base) + (*s - 'a' + 10);
else
break;
if (!woal_secure_add(&s, 1, &s, TYPE_PTR))
break;
}
return r * pn;
@ -1440,8 +1466,9 @@ void woal_proc_init(moal_handle *handle)
goto done;
}
snprintf(handle->proc_wlan_name, sizeof(handle->proc_wlan_name),
WLAN_PROC, handle->handle_idx);
if (snprintf(handle->proc_wlan_name, sizeof(handle->proc_wlan_name),
WLAN_PROC, handle->handle_idx) <= 0)
PRINTM(MERROR, "Couldn't write proc interface name\n");
PRINTM(MINFO, "Create Proc Interface %s\n", handle->proc_wlan_name);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)

View file

@ -165,6 +165,7 @@ static const struct sdio_device_id wlan_ids[] = {
{},
};
int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id);
void woal_sdio_remove(struct sdio_func *func);
static void woal_sdiommc_work(struct work_struct *work);
@ -945,8 +946,10 @@ void woal_sdio_shutdown(struct device *dev)
return;
}
handle = cardp->handle;
for (i = 0; i < handle->priv_num; i++)
netif_device_detach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_detach(handle->priv[i]->netdev);
}
if (moal_extflg_isset(handle, EXT_SHUTDOWN_HS)) {
handle->shutdown_hs_in_process = MTRUE;
@ -1079,8 +1082,10 @@ int woal_sdio_suspend(struct device *dev)
goto done;
}
for (i = 0; i < handle->priv_num; i++)
netif_device_detach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_detach(handle->priv[i]->netdev);
}
if (moal_extflg_isset(handle, EXT_PM_KEEP_POWER)) {
/* Enable the Host Sleep */
@ -1116,8 +1121,12 @@ int woal_sdio_suspend(struct device *dev)
} else {
PRINTM(MMSG, "HS not actived, suspend fail!");
handle->suspend_fail = MTRUE;
for (i = 0; i < handle->priv_num; i++)
netif_device_attach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i]) {
netif_device_attach(
handle->priv[i]->netdev);
}
}
ret = -EBUSY;
goto done;
}
@ -1171,8 +1180,10 @@ int woal_sdio_resume(struct device *dev)
LEAVE();
return MLAN_STATUS_SUCCESS;
}
for (i = 0; i < handle->priv_num; i++)
netif_device_attach(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_device_attach(handle->priv[i]->netdev);
}
/* Disable Host Sleep */
woal_cancel_hs(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), MOAL_NO_WAIT);
@ -1320,7 +1331,7 @@ static mlan_status woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list,
struct mmc_data mmc_dat;
struct sdio_func *func = ((sdio_mmc_card *)handle->card)->func;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
t_u32 blkcnt = pmbuf_list->data_len / MLAN_SDIO_BLOCK_SIZE;
t_u32 blkcnt = pmbuf_list->data_len / handle->sdio_blk_size;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
int status;
#endif
@ -1344,7 +1355,7 @@ static mlan_status woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list,
mmc_dat.sg = sg_list;
mmc_dat.sg_len = num_sg;
mmc_dat.blksz = MLAN_SDIO_BLOCK_SIZE;
mmc_dat.blksz = handle->sdio_blk_size;
mmc_dat.blocks = blkcnt;
mmc_dat.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ;
@ -1399,9 +1410,9 @@ static mlan_status woal_sdiommc_write_data_sync(moal_handle *handle,
t_u8 *buffer = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode =
(port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blksz = (blkmode == BLOCK_MODE) ? handle->sdio_blk_size : 1;
t_u32 blkcnt = (blkmode == BLOCK_MODE) ?
(pmbuf->data_len / MLAN_SDIO_BLOCK_SIZE) :
(pmbuf->data_len / handle->sdio_blk_size) :
pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
int status = 0;
@ -1448,9 +1459,9 @@ static mlan_status woal_sdiommc_read_data_sync(moal_handle *handle,
t_u8 *buffer = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode =
(port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blksz = (blkmode == BLOCK_MODE) ? handle->sdio_blk_size : 1;
t_u32 blkcnt = (blkmode == BLOCK_MODE) ?
(pmbuf->data_len / MLAN_SDIO_BLOCK_SIZE) :
(pmbuf->data_len / handle->sdio_blk_size) :
pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
int status = 0;
@ -1604,7 +1615,7 @@ static mlan_status woal_sdiommc_register_dev(moal_handle *handle)
}
/* Set block size */
ret = sdio_set_block_size(card->func, MLAN_SDIO_BLOCK_SIZE);
ret = sdio_set_block_size(card->func, handle->sdio_blk_size);
if (ret) {
PRINTM(MERROR,
"sdio_set_block_seize(): cannot set SDIO block size\n");
@ -1783,9 +1794,7 @@ static t_u8 woal_sdiommc_is_second_mac(moal_handle *handle)
static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef SD9098
sdio_mmc_card *card = (sdio_mmc_card *)handle->card;
#endif
t_u32 revision_id = 0;
t_u32 rev_id_reg = handle->card_info->rev_id_reg;
@ -1800,6 +1809,8 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
ENTER();
handle->sdio_blk_size =
MIN(MLAN_SDIO_BLOCK_SIZE, card->func->card->host->max_blk_size);
if (handle->params.fw_name)
goto done;
#ifdef SD8801
@ -1808,7 +1819,8 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
#endif
/** Revision ID register */
woal_sdiommc_read_reg(handle, rev_id_reg, &revision_id);
PRINTM(MCMND, "revision_id=0x%x\n", revision_id);
PRINTM(MCMND, "revision_id=0x%x sdio_blk_size=%d\n", revision_id,
handle->sdio_blk_size);
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || \
defined(SD9097) || defined(SDIW624) || defined(SDAW693) || \
@ -2225,8 +2237,9 @@ static rdwr_status woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
t_u8 dbg_dump_ctrl_reg = phandle->card_info->dump_fw_ctrl_reg;
t_u8 debug_host_ready = phandle->card_info->dump_fw_host_ready;
#ifdef SD9177
if (IS_SD9177(phandle->card_type)) {
#if defined(SDAW693) || defined(SD9177) || defined(SD9098)
if (IS_SD9177(phandle->card_type) || IS_SDAW693(phandle->card_type) ||
IS_SD9098(phandle->card_type)) {
if (phandle->event_fw_dump)
debug_host_ready = 0xAA;
}
@ -2246,8 +2259,9 @@ static rdwr_status woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
}
}
#ifdef SD9177
if (IS_SD9177(phandle->card_type)) {
#if defined(SDAW693) || defined(SD9177) || defined(SD9098)
if (IS_SD9177(phandle->card_type) || IS_SDAW693(phandle->card_type) ||
IS_SD9098(phandle->card_type)) {
if (phandle->event_fw_dump)
return RDWR_STATUS_SUCCESS;
}
@ -2810,8 +2824,9 @@ void woal_dump_firmware_info_v3(moal_handle *phandle)
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
#ifdef SD9177
if (IS_SD9177(phandle->card_type)) {
#if defined(SDAW693) || defined(SD9177) || defined(SD9098)
if (IS_SD9177(phandle->card_type) || IS_SDAW693(phandle->card_type) ||
IS_SD9098(phandle->card_type)) {
if (phandle->event_fw_dump) {
if (RDWR_STATUS_FAILURE !=
woal_cmd52_rdwr_firmware(phandle, doneflag,
@ -3023,6 +3038,11 @@ static void woal_sdiommc_reg_dbg(moal_handle *phandle)
ret = woal_sdio_readb(phandle, reg, &data);
if (!ret && data) {
PRINTM(MERROR, "FW in debug mode (0x%x)\n", data);
if (data == FW_STUCK_CODE_VERSION_MISMATCH) {
phandle->driver_init = MFALSE;
PRINTM(MERROR,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
}
}
}
@ -3110,6 +3130,7 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
mlan_ioctl(phandle->pmlan_adapter, NULL);
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
msleep(5);
phandle->fw_dump = MTRUE;
if (phandle->card_info->dump_fw_info == DUMP_FW_SDIO_V2) {
woal_dump_firmware_info_v2(phandle);
@ -3119,7 +3140,8 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
woal_trigger_nmi_on_no_dump_event(phandle);
queue_work(phandle->workqueue, &phandle->main_work);
phandle->is_fw_dump_timer_set = MTRUE;
woal_mod_timer(&phandle->fw_dump_timer, MOAL_TIMER_5S);
woal_mod_timer(&phandle->fw_dump_timer,
MOAL_FW_DUMP_TIMER);
return;
}
}
@ -3180,6 +3202,14 @@ static int woal_sdiommc_dump_reg_info(moal_handle *phandle, t_u8 *drv_buf)
PRINTM(MERROR, "FW in debug mode (0x%x)\n", data);
drv_ptr += snprintf(drv_ptr, MAX_BUF_LEN,
"FW in debug mode (0x%x)\n", data);
if (data == FW_STUCK_CODE_VERSION_MISMATCH) {
phandle->driver_init = MFALSE;
PRINTM(MERROR,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version\n");
drv_ptr += snprintf(
drv_ptr, MAX_BUF_LEN,
"WLAN and BT FW version mismatch !! Redownload both FWs with correct and same version!\n");
}
}
}
@ -3302,7 +3332,7 @@ void woal_sdio_reset_hw(moal_handle *handle)
else
#endif
sdio_claim_irq(func, woal_sdio_interrupt);
sdio_set_block_size(card->func, MLAN_SDIO_BLOCK_SIZE);
sdio_set_block_size(card->func, handle->sdio_blk_size);
sdio_release_host(func);
LEAVE();
return;

View file

@ -26,6 +26,7 @@ Change log:
********************************************************/
#include "moal_main.h"
#include "moal_cfg80211.h"
#ifdef USB
#include "moal_usb.h"
#endif
@ -39,7 +40,6 @@ Change log:
#include "moal_uap.h"
#endif
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#include "moal_cfg80211.h"
#include "moal_cfg80211_util.h"
#endif
#include <asm/div64.h>
@ -57,6 +57,8 @@ Change log:
#define NXP_ETH_P_WAPI 0x88B4
#include <linux/crc32.h>
/********************************************************
Local Variables
********************************************************/
@ -727,7 +729,7 @@ void moal_tp_accounting(t_void *pmoal, void *buf, t_u32 drop_point)
struct sk_buff *skb = NULL;
moal_handle *handle = (moal_handle *)pmoal;
pmlan_buffer pmbuf = (pmlan_buffer)buf;
t_s32 delay;
unsigned long delay;
wifi_timeval t;
if (drop_point < MAX_TP_ACCOUNT_DROP_POINT_NUM) {
@ -763,36 +765,43 @@ void moal_tp_accounting(t_void *pmoal, void *buf, t_u32 drop_point)
} else if (drop_point == RX_TIME_PKT) {
woal_get_monotonic_time(&t);
/* deque - pcie receive */
delay = (t_s32)(pmbuf->extra_ts_sec - pmbuf->in_ts_sec) *
1000000;
delay += (t_s32)(pmbuf->extra_ts_usec - pmbuf->in_ts_usec);
delay = ((unsigned long)pmbuf->extra_ts_sec -
(unsigned long)pmbuf->in_ts_sec) *
1000000UL;
delay += (pmbuf->extra_ts_usec - pmbuf->in_ts_usec);
handle->tp_acnt.rx_delay1_driver[handle->tp_acnt.rx_index] =
delay;
(unsigned long)delay;
/* before netif_rx - deque */
delay = (t_s32)(pmbuf->out_ts_sec - pmbuf->extra_ts_sec) *
1000000;
delay += (t_s32)(pmbuf->out_ts_usec - pmbuf->extra_ts_usec);
delay = ((unsigned long)pmbuf->out_ts_sec -
(unsigned long)pmbuf->extra_ts_sec) *
1000000UL;
delay += (pmbuf->out_ts_usec - pmbuf->extra_ts_usec);
handle->tp_acnt.rx_delay2_driver[handle->tp_acnt.rx_index] =
delay;
(unsigned long)delay;
/* netif_rx to netif_rx return */
delay = (t_s32)(t.time_sec - pmbuf->out_ts_sec) * 1000000;
delay += (t_s32)(t.time_usec - pmbuf->out_ts_usec);
delay = ((unsigned long)t.time_sec -
(unsigned long)pmbuf->out_ts_sec) *
1000000UL;
delay += (t.time_usec - pmbuf->out_ts_usec);
handle->tp_acnt.rx_delay_kernel[handle->tp_acnt.rx_index] =
delay;
(unsigned long)delay;
handle->tp_acnt.rx_index++;
if (handle->tp_acnt.rx_index >= TXRX_MAX_SAMPLE)
handle->tp_acnt.rx_index = 0;
} else if (drop_point == TX_TIME_PKT) {
delay = (t_s32)(pmbuf->extra_ts_sec - pmbuf->in_ts_sec) *
1000000;
delay += (t_s32)(pmbuf->extra_ts_usec - pmbuf->in_ts_usec);
delay = ((unsigned long)pmbuf->extra_ts_sec -
(unsigned long)pmbuf->in_ts_sec) *
1000000UL;
delay += (pmbuf->extra_ts_usec - pmbuf->in_ts_usec);
handle->tp_acnt.tx_delay1_driver[handle->tp_acnt.tx_index] =
delay;
(unsigned long)delay;
delay = (t_s32)(pmbuf->out_ts_sec - pmbuf->in_ts_sec) * 1000000;
delay += (t_s32)(pmbuf->out_ts_usec - pmbuf->in_ts_usec);
delay = ((unsigned long)pmbuf->out_ts_sec -
(unsigned long)pmbuf->in_ts_sec) *
1000000UL;
delay += (pmbuf->out_ts_usec - pmbuf->in_ts_usec);
handle->tp_acnt.tx_delay_driver[handle->tp_acnt.tx_index] =
delay;
(unsigned long)delay;
handle->tp_acnt.tx_index++;
if (handle->tp_acnt.tx_index >= TXRX_MAX_SAMPLE)
@ -938,6 +947,7 @@ mlan_status moal_get_hw_spec_complete(t_void *pmoal, mlan_status status,
strlen(CARD_PCIEAW690),
strlen(driver_version));
// coverity[string_null:SUPPRESS]
// coverity[cert_str32_c_violation:SUPPRESS]
moal_memcpy_ext(handle,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -1252,6 +1262,8 @@ mlan_status moal_send_packet_complete(t_void *pmoal, pmlan_buffer pmbuf,
LOW_TX_PENDING) {
int i;
for (i = 0; i < handle->priv_num; i++) {
if (!handle->priv[i])
continue;
#ifdef STA_SUPPORT
if ((GET_BSS_ROLE(
handle->priv[i]) ==
@ -1514,7 +1526,15 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
{
mlan_status status = MLAN_STATUS_SUCCESS;
struct sk_buff *skb = NULL;
struct radiotap_header *rth = NULL;
struct ieee80211_radiotap_header *rth_hdr = NULL;
struct radiotap_body *rth_body = NULL;
t_u32 it_present_1;
t_u32 it_present_2;
radiotap_timestamp *ts_info = NULL;
t_u8 *radiotap_buf = NULL;
t_u8 *radiotap_pos = NULL;
t_u32 radiotap_max_len = 0;
t_u32 radiotap_len = 0;
radiotap_info rt_info = {};
t_u8 format = 0;
t_u8 mcs = 0;
@ -1540,11 +1560,23 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
return status;
}
radiotap_max_len =
sizeof(struct radiotap_header) + sizeof(struct mcs_field) +
sizeof(radiotap_timestamp) + sizeof(struct vht_field) +
sizeof(struct he_field) + 12; /* 12 is max alignment bytes */
radiotap_buf = kzalloc(radiotap_max_len, GFP_ATOMIC);
if (radiotap_buf == NULL)
goto done;
radiotap_pos = radiotap_buf;
skb = (struct sk_buff *)pmbuf->pdesc;
if ((handle->mon_if) && netif_running(handle->mon_if->mon_ndev)) {
// coverity[misra_c_2012_rule_13_5_violation:SUPPRESS]
if ((handle->mon_if) && (handle->mon_if->mon_ndev) &&
netif_running(handle->mon_if->mon_ndev)) {
if (handle->mon_if->radiotap_enabled) {
if (skb_headroom(skb) < sizeof(*rth)) {
if (skb_headroom(skb) < radiotap_max_len) {
PRINTM(MERROR,
"%s No space to add Radio TAP header\n",
__func__);
@ -1571,40 +1603,74 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
mcs = rt_info.rate_info.mcs_index;
nss = rt_info.rate_info.nss_index;
skb_push(skb, sizeof(*rth));
rth = (struct radiotap_header *)skb->data;
memset(skb->data, 0, sizeof(*rth));
rth->hdr.it_version = PKTHDR_RADIOTAP_VERSION;
rth->hdr.it_pad = 0;
rth->hdr.it_len = cpu_to_le16(sizeof(*rth));
rth->hdr.it_present = cpu_to_le32(
rth_hdr = (struct ieee80211_radiotap_header *)
radiotap_pos;
rth_hdr->it_version = PKTHDR_RADIOTAP_VERSION;
rth_hdr->it_pad = 0;
rth_hdr->it_present = cpu_to_le32(
(1 << IEEE80211_RADIOTAP_TSFT) |
(1 << IEEE80211_RADIOTAP_FLAGS) |
(1 << IEEE80211_RADIOTAP_CHANNEL) |
(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
(1 << IEEE80211_RADIOTAP_ANTENNA));
/** Timstamp */
rth->body.timestamp = woal_cpu_to_le64(jiffies);
/** Flags */
rth->body.flags = (rt_info.extra_info.flags &
(1 << IEEE80211_RADIOTAP_ANTENNA) |
(1 << IEEE80211_RADIOTAP_RX_FLAGS));
radiotap_pos +=
sizeof(struct ieee80211_radiotap_header);
radiotap_len +=
sizeof(struct ieee80211_radiotap_header);
if (rt_info.radiotap_extra) {
rth_hdr->it_present |= cpu_to_le32(
(1 << IEEE80211_RADIOTAP_TIMESTAMP) |
(1
<< IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE) |
(1 << IEEE80211_RADIOTAP_EXT));
it_present_1 = cpu_to_le32(
(1
<< IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
(1 << IEEE80211_RADIOTAP_ANTENNA) |
(1
<< IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE) |
(1 << IEEE80211_RADIOTAP_EXT));
it_present_2 = cpu_to_le32(
(1
<< IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
(1 << IEEE80211_RADIOTAP_ANTENNA));
moal_memcpy_ext(handle, radiotap_pos,
&it_present_1, sizeof(t_u32),
sizeof(t_u32));
radiotap_pos += sizeof(t_u32);
radiotap_len += sizeof(t_u32);
moal_memcpy_ext(handle, radiotap_pos,
&it_present_2, sizeof(t_u32),
sizeof(t_u32));
radiotap_pos += sizeof(t_u32);
radiotap_len += sizeof(t_u32);
}
rth_body = (struct radiotap_body *)radiotap_pos;
/** TSFT: bit number 0 */
rth_body->timestamp = woal_cpu_to_le64(jiffies);
/** Flags: bit number 1 */
rth_body->flags = (rt_info.extra_info.flags &
~(RADIOTAP_FLAGS_USE_SGI_HT |
RADIOTAP_FLAGS_WITH_FRAGMENT |
RADIOTAP_FLAGS_WEP_ENCRYPTION |
RADIOTAP_FLAGS_FAILED_FCS_CHECK));
/** reverse fail fcs, 1 means pass FCS in FW, but means
* fail FCS in radiotap */
rth->body.flags |= (~rt_info.extra_info.flags) &
rth_body->flags |= (~rt_info.extra_info.flags) &
RADIOTAP_FLAGS_FAILED_FCS_CHECK;
if ((format == MLAN_RATE_FORMAT_HT) && (gi == 1))
rth->body.flags |= RADIOTAP_FLAGS_USE_SGI_HT;
rth_body->flags |= RADIOTAP_FLAGS_USE_SGI_HT;
if (ieee80211_is_mgmt(dot11_hdr->frame_control) ||
ieee80211_is_data(dot11_hdr->frame_control)) {
if ((ieee80211_has_morefrags(
dot11_hdr->frame_control)) ||
(!ieee80211_is_first_frag(
dot11_hdr->seq_ctrl))) {
rth->body.flags |=
rth_body->flags |=
RADIOTAP_FLAGS_WITH_FRAGMENT;
}
}
@ -1616,17 +1682,18 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
if (!(*(payload + 3) & 0x20)) /** ExtIV bit
shall be 0 for
WEP frame */
rth->body.flags |=
rth_body->flags |=
RADIOTAP_FLAGS_WEP_ENCRYPTION;
}
/** Rate, t_u8 only apply for LG mode */
/** Rate: bit number 2, t_u8 only apply for LG mode */
if (format == MLAN_RATE_FORMAT_LG) {
rth->hdr.it_present |= cpu_to_le32(
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
rth_hdr->it_present |= cpu_to_le32(
1 << IEEE80211_RADIOTAP_RATE);
rth->body.rate = rt_info.rate_info.bitrate;
rth_body->rate = rt_info.rate_info.bitrate;
}
/** Channel */
rth->body.channel.flags = 0;
/** Channel: bit number 3 */
rth_body->channel.flags = 0;
if (rt_info.chan_num &&
(handle->mon_if->band_chan_cfg.channel !=
rt_info.chan_num))
@ -1634,145 +1701,196 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
rt_info.chan_num;
chan_num = handle->mon_if->band_chan_cfg.channel;
band = (chan_num <= 14) ? IEEE80211_BAND_2GHZ :
IEEE80211_BAND_5GHZ;
/** update the band, if different in the Rx frame */
if (handle->mon_if->band_chan_cfg.band != band)
handle->mon_if->band_chan_cfg.band = band;
band = woal_radio_type_to_ieee_band(
handle->mon_if->band_chan_cfg.band);
rth->body.channel.frequency = woal_cpu_to_le16(
rth_body->channel.frequency = woal_cpu_to_le16(
ieee80211_channel_to_frequency(chan_num, band));
rth->body.channel.flags |=
woal_cpu_to_le16((band == IEEE80211_BAND_2GHZ) ?
CHANNEL_FLAGS_2GHZ :
CHANNEL_FLAGS_5GHZ);
if (rth->body.channel.flags &
if (band == IEEE80211_BAND_2GHZ)
rth_body->channel.flags |=
woal_cpu_to_le16(CHANNEL_FLAGS_2GHZ);
else if (band == IEEE80211_BAND_5GHZ ||
band == IEEE80211_BAND_6GHZ)
rth_body->channel.flags |=
woal_cpu_to_le16(CHANNEL_FLAGS_5GHZ);
if (rth_body->channel.flags &
woal_cpu_to_le16(CHANNEL_FLAGS_2GHZ))
rth->body.channel.flags |= woal_cpu_to_le16(
rth_body->channel.flags |= woal_cpu_to_le16(
CHANNEL_FLAGS_DYNAMIC_CCK_OFDM);
else
rth->body.channel.flags |=
rth_body->channel.flags |=
woal_cpu_to_le16(CHANNEL_FLAGS_OFDM);
if (handle->mon_if->chandef.chan &&
(handle->mon_if->chandef.chan->flags &
(IEEE80211_CHAN_PASSIVE_SCAN |
IEEE80211_CHAN_RADAR)))
rth->body.channel.flags |= woal_cpu_to_le16(
rth_body->channel.flags |= woal_cpu_to_le16(
CHANNEL_FLAGS_ONLY_PASSIVSCAN_ALLOW);
/** Antenna */
rth->body.antenna_signal = -(rt_info.nf - rt_info.snr);
rth->body.antenna_noise = -rt_info.nf;
/* Convert FW antenna value to radiotap spec */
rth->body.antenna = (t_u16)rt_info.antenna >> 1;
/** MCS */
/** Antenna signal: bit number 5 */
rth_body->antenna_signal = -(rt_info.nf - rt_info.snr);
/** Antenna noise: bit number 6 */
rth_body->antenna_noise = -rt_info.nf;
/* Antenna: bit number 11, Convert FW antenna value to
* radiotap spec */
rth_body->antenna = (t_u8)rt_info.antenna >> 1;
/** rx_flags: bit number 14 */
if (rt_info.radiotap_extra &&
(rt_info.extra_info.plcp_crc_failed == 1))
rth_body->rx_flags = 0x0002;
radiotap_pos += sizeof(struct radiotap_body);
radiotap_len += sizeof(struct radiotap_body);
/** MCS: bit number 19 */
if (format == MLAN_RATE_FORMAT_HT) {
rth->hdr.it_present |= cpu_to_le32(
struct mcs_field *mcs =
(struct mcs_field *)radiotap_pos;
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
rth_hdr->it_present |= cpu_to_le32(
1 << IEEE80211_RADIOTAP_MCS);
rth->body.u.mcs.known =
rt_info.extra_info.mcs_known;
rth->body.u.mcs.flags =
rt_info.extra_info.mcs_flags;
mcs->known = rt_info.extra_info.mcs_known;
mcs->flags = rt_info.extra_info.mcs_flags;
/** MCS mcs */
rth->body.u.mcs.known |=
MCS_KNOWN_MCS_INDEX_KNOWN;
rth->body.u.mcs.mcs =
rt_info.rate_info.mcs_index;
mcs->known |= MCS_KNOWN_MCS_INDEX_KNOWN;
mcs->mcs = rt_info.rate_info.mcs_index;
/** MCS bw */
rth->body.u.mcs.known |= MCS_KNOWN_BANDWIDTH;
rth->body.u.mcs.flags &= ~(0x03); /** Clear,
mcs->known |= MCS_KNOWN_BANDWIDTH;
mcs->flags &= ~(0x03); /** Clear,
20MHz as
default */
if (bw == 1)
rth->body.u.mcs.flags |= RX_BW_40;
mcs->flags |= RX_BW_40;
/** MCS gi */
rth->body.u.mcs.known |=
MCS_KNOWN_GUARD_INTERVAL;
rth->body.u.mcs.flags &= ~(1 << 2);
mcs->known |= MCS_KNOWN_GUARD_INTERVAL;
mcs->flags &= ~(1 << 2);
if (gi)
rth->body.u.mcs.flags |= gi << 2;
mcs->flags |= gi << 2;
/** MCS FEC */
rth->body.u.mcs.known |= MCS_KNOWN_FEC_TYPE;
rth->body.u.mcs.flags &= ~(1 << 4);
mcs->known |= MCS_KNOWN_FEC_TYPE;
mcs->flags &= ~(1 << 4);
if (ldpc)
rth->body.u.mcs.flags |= ldpc << 4;
mcs->flags |= ldpc << 4;
radiotap_pos += sizeof(struct mcs_field);
radiotap_len += sizeof(struct mcs_field);
}
/** VHT */
/** VHT: bit number 21, Required Alignment is 2 */
if (format == MLAN_RATE_FORMAT_VHT) {
struct vht_field *vht = NULL;
/* ensure 2 byte alignment */
if (radiotap_len & 1) {
radiotap_pos++;
radiotap_len++;
}
vht = (struct vht_field *)radiotap_pos;
vht_sig1 = rt_info.extra_info.vht_he_sig1;
vht_sig2 = rt_info.extra_info.vht_he_sig2;
/** Present Flag */
rth->hdr.it_present |= cpu_to_le32(
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
rth_hdr->it_present |= cpu_to_le32(
1 << IEEE80211_RADIOTAP_VHT);
/** STBC */
rth->body.u.vht.known |=
woal_cpu_to_le16(VHT_KNOWN_STBC);
vht->known |= woal_cpu_to_le16(VHT_KNOWN_STBC);
if (vht_sig1 & MBIT(3))
rth->body.u.vht.flags |= VHT_FLAG_STBC;
vht->flags |= VHT_FLAG_STBC;
/** TXOP_PS_NA */
/** TODO: Not support now */
/** GI */
rth->body.u.vht.known |=
woal_cpu_to_le16(VHT_KNOWN_GI);
vht->known |= woal_cpu_to_le16(VHT_KNOWN_GI);
if (vht_sig2 & MBIT(0))
rth->body.u.vht.flags |= VHT_FLAG_SGI;
vht->flags |= VHT_FLAG_SGI;
/** SGI NSYM DIS */
rth->body.u.vht.known |= woal_cpu_to_le16(
vht->known |= woal_cpu_to_le16(
VHT_KNOWN_SGI_NSYM_DIS);
if (vht_sig2 & MBIT(1))
rth->body.u.vht.flags |=
VHT_FLAG_SGI_NSYM_M10_9;
vht->flags |= VHT_FLAG_SGI_NSYM_M10_9;
/** LDPC_EXTRA_OFDM_SYM */
/** TODO: Not support now */
/** BEAMFORMED */
rth->body.u.vht.known |=
vht->known |=
woal_cpu_to_le16(VHT_KNOWN_BEAMFORMED);
if (vht_sig2 & MBIT(8))
rth->body.u.vht.flags |=
VHT_FLAG_BEAMFORMED;
vht->flags |= VHT_FLAG_BEAMFORMED;
/** BANDWIDTH */
rth->body.u.vht.known |=
vht->known |=
woal_cpu_to_le16(VHT_KNOWN_BANDWIDTH);
if (bw == 1)
rth->body.u.vht.bandwidth = RX_BW_40;
vht->bandwidth = RX_BW_40;
else if (bw == 2)
rth->body.u.vht.bandwidth = RX_BW_80;
vht->bandwidth = RX_BW_80;
/** GROUP_ID */
rth->body.u.vht.known |=
vht->known |=
woal_cpu_to_le16(VHT_KNOWN_GROUP_ID);
rth->body.u.vht.group_id =
(vht_sig1 & (0x3F0)) >> 4;
vht->group_id = (vht_sig1 & (0x3F0)) >> 4;
/** PARTIAL_AID */
/** TODO: Not support now */
/** mcs_nss */
rth->body.u.vht.mcs_nss[0] = vht_sig2 & (0xF0);
vht->mcs_nss[0] = vht_sig2 & (0xF0);
/* Convert FW NSS value to radiotap spec */
rth->body.u.vht.mcs_nss[0] |=
vht->mcs_nss[0] |=
((vht_sig1 & (0x1C00)) >> 10) + 1;
/** gi */
rth->body.u.vht.known |=
woal_cpu_to_le16(VHT_KNOWN_GI);
vht->known |= woal_cpu_to_le16(VHT_KNOWN_GI);
if (gi)
rth->body.u.vht.flags |= VHT_FLAG_SGI;
vht->flags |= VHT_FLAG_SGI;
/** coding */
if (vht_sig2 & MBIT(2))
rth->body.u.vht.coding |=
VHT_CODING_LDPC_USER0;
vht->coding |= VHT_CODING_LDPC_USER0;
radiotap_pos += sizeof(struct vht_field);
radiotap_len += sizeof(struct vht_field);
}
/** Timstamp: bit number 22, Required Alignment is 8 */
if (rt_info.radiotap_extra) {
/* ensure 8 byte alignment */
while (radiotap_len & 7) {
radiotap_pos++;
radiotap_len++;
}
ts_info = (radiotap_timestamp *)radiotap_pos;
ts_info->device_timestamp =
cpu_to_le64(rt_info.extra_info.timestamp
.device_timestamp);
ts_info->accuracy =
rt_info.extra_info.timestamp.accuracy;
ts_info->unit =
rt_info.extra_info.timestamp.unit;
ts_info->position =
rt_info.extra_info.timestamp.position;
ts_info->flags =
rt_info.extra_info.timestamp.flags;
radiotap_pos += sizeof(radiotap_timestamp);
radiotap_len += sizeof(radiotap_timestamp);
}
/** HE: bit number 23, Required Alignment is 2 */
if (format == MLAN_RATE_FORMAT_HE) {
struct he_field *he = NULL;
/* ensure 2 byte alignment */
if (radiotap_len & 1) {
radiotap_pos++;
radiotap_len++;
}
he = (struct he_field *)radiotap_pos;
he_sig1 = rt_info.extra_info.vht_he_sig1;
he_sig2 = rt_info.extra_info.vht_he_sig2;
usr_idx = rt_info.extra_info.user_idx;
rth->hdr.it_present |=
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
rth_hdr->it_present |=
cpu_to_le32(1 << IEEE80211_RADIOTAP_HE);
rth->body.u.he.data1 |= (HE_CODING_KNOWN);
he->data1 |= (HE_CODING_KNOWN);
if (ldpc)
rth->body.u.he.data3 |=
HE_CODING_LDPC_USER0;
rth->body.u.he.data1 |= (HE_BW_KNOWN);
he->data3 |= HE_CODING_LDPC_USER0;
he->data1 |= (HE_BW_KNOWN);
if (he_sig1)
rth->body.u.he.data1 |= (HE_MU_DATA);
he->data1 |= (HE_MU_DATA);
if (bw == 1) {
rth->body.u.he.data5 |= RX_HE_BW_40;
he->data5 |= RX_HE_BW_40;
if (he_sig2) {
MLAN_DECODE_RU_SIGNALING_CH1(
out, he_sig1, he_sig2);
@ -1787,14 +1905,13 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
tone);
}
if (tone != 0) {
rth->body.u.he.data5 &=
he->data5 &=
~RX_HE_BW_40;
rth->body.u.he.data5 |=
tone;
he->data5 |= tone;
}
}
} else if (bw == 2) {
rth->body.u.he.data5 |= RX_HE_BW_80;
he->data5 |= RX_HE_BW_80;
if (he_sig2) {
MLAN_DECODE_RU_SIGNALING_CH1(
out, he_sig1, he_sig2);
@ -1834,14 +1951,13 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
tone);
}
if (tone != 0) {
rth->body.u.he.data5 &=
he->data5 &=
~RX_HE_BW_80;
rth->body.u.he.data5 |=
tone;
he->data5 |= tone;
}
}
} else if (bw == 3) {
rth->body.u.he.data5 |= RX_HE_BW_160;
he->data5 |= RX_HE_BW_160;
if (he_sig2) {
MLAN_DECODE_RU_SIGNALING_CH1(
out, he_sig1, he_sig2);
@ -1881,10 +1997,9 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
tone);
}
if (tone != 0) {
rth->body.u.he.data5 &=
he->data5 &=
~RX_HE_BW_160;
rth->body.u.he.data5 |=
tone;
he->data5 |= tone;
}
}
} else {
@ -1894,27 +2009,38 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
MLAN_DECODE_RU_TONE(
out, usr_idx, tone);
if (tone) {
rth->body.u.he.data5 |=
tone;
he->data5 |= tone;
}
}
}
rth->body.u.he.data2 |= (HE_DATA_GI_KNOWN);
rth->body.u.he.data5 |= ((gi & 3) << 4);
rth->body.u.he.data1 |= (HE_MCS_KNOWN);
he->data2 |= (HE_DATA_GI_KNOWN);
he->data5 |= ((gi & 3) << 4);
he->data1 |= (HE_MCS_KNOWN);
rth->body.u.he.data3 |= (mcs << 8);
rth->body.u.he.data6 |= nss;
rth->body.u.he.data1 |= (HE_DCM_KNOWN);
rth->body.u.he.data1 =
cpu_to_le16(rth->body.u.he.data1);
rth->body.u.he.data5 |= (dcm << 12);
rth->body.u.he.data5 =
cpu_to_le16(rth->body.u.he.data5);
rth->body.u.he.data3 =
cpu_to_le16(rth->body.u.he.data3);
he->data3 |= (mcs << 8);
he->data6 |= nss;
he->data1 |= (HE_DCM_KNOWN);
he->data1 = cpu_to_le16(he->data1);
he->data5 |= (dcm << 12);
he->data5 = cpu_to_le16(he->data5);
he->data3 = cpu_to_le16(he->data3);
radiotap_pos += sizeof(struct he_field);
radiotap_len += sizeof(struct he_field);
}
if (rt_info.radiotap_extra) {
radiotap_pos[0] = rt_info.extra_info.rssi_dbm_a;
radiotap_pos[1] = 0;
radiotap_pos[2] = rt_info.extra_info.rssi_dbm_b;
radiotap_pos[3] = 1;
radiotap_pos += 4;
radiotap_len += 4;
}
rth_hdr->it_len = cpu_to_le16(radiotap_len);
skb_push(skb, radiotap_len);
moal_memcpy_ext(handle, skb->data, radiotap_buf,
radiotap_len, radiotap_len);
}
skb_set_mac_header(skb, 0);
skb->ip_summed = CHECKSUM_UNNECESSARY;
@ -1939,6 +2065,8 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
}
done:
if (radiotap_buf)
kfree(radiotap_buf);
LEAVE();
return status;
@ -2004,7 +2132,7 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
#endif
wifi_timeval t1, t2;
t_s32 delay;
unsigned long delay;
t_u32 in_ts_sec = 0;
t_u32 in_ts_usec = 0;
@ -2102,6 +2230,7 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
eth = (struct ethhdr *)skb_pull(skb, len + padding);
if (!eth) {
PRINTM(MERROR, "Invalid amsdu packet\n");
dev_kfree_skb(frame);
break;
}
}
@ -2164,9 +2293,11 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
moal_tp_accounting(handle, pmbuf, RX_TIME_PKT);
woal_get_monotonic_time(&t2);
delay = (t_s32)(t2.time_sec - in_ts_sec) * 1000000;
delay += (t_s32)(t2.time_usec - in_ts_usec);
moal_amsdu_tp_accounting(pmoal, delay, 0);
delay = ((unsigned long)t2.time_sec -
(unsigned long)in_ts_sec) *
1000000UL;
delay += (t2.time_usec - in_ts_usec);
moal_amsdu_tp_accounting(pmoal, (t_s32)delay, 0);
}
done:
if (status == MLAN_STATUS_PENDING)
@ -2175,6 +2306,40 @@ done:
return status;
}
static t_u8 moal_user_priority_to_qos(t_u32 userPriority)
{
t_u8 aci;
switch (userPriority) {
default:
case 0:
case 3:
/* BE */
aci = 3;
break;
case 1:
case 2:
/* BK */
aci = 2;
break;
case 4:
case 5:
/* VI */
aci = 1;
break;
case 6:
case 7:
/* VO */
aci = 0;
break;
}
return aci;
}
/**
* @brief This function uploads the packet to the network stack
*
@ -2356,10 +2521,10 @@ mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf)
if (transaction_id &&
woal_get_dhcp_discover_info(
priv, transaction_id)) {
status = MLAN_STATUS_FAILURE;
PRINTM(MDATA,
"Drop dhcp pkt, transation_id=%x\n",
transaction_id);
dev_kfree_skb(skb);
goto done;
}
@ -2367,14 +2532,18 @@ mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf)
// TODO: Drop too old entry
if (hash_key) {
struct arp_entry *node;
// Coverity violation raised for
// kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
hash_for_each_possible (priv->hlist,
node, arp_hlist,
hash_key) {
if (node->hash_key ==
hash_key) {
status =
MLAN_STATUS_FAILURE;
PRINTM(MDATA,
"ARP entry exists, drop pkt\n");
dev_kfree_skb(skb);
goto done;
}
}
@ -2435,13 +2604,14 @@ mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf)
RX_PKT_FATE_DRV_DROP_FILTER,
FRAME_TYPE_ETHERNET_II, 0, 0,
skb->data, skb->len);
dev_kfree_skb(skb);
goto done;
}
#endif
#endif
priv->stats.rx_bytes += skb->len;
priv->stats.rx_packets++;
priv->rx_pkt_ac[moal_user_priority_to_qos(
pmbuf->priority)]++;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (drvdbg & MDAT_D)
@ -2532,6 +2702,8 @@ mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf)
}
}
done:
if (status != MLAN_STATUS_PENDING && pmbuf && !pmbuf->pdesc && skb)
dev_kfree_skb(skb);
LEAVE();
return status;
}
@ -2777,7 +2949,8 @@ static mlan_status wlan_process_defer_event(moal_handle *handle,
break;
case MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE:
status = MLAN_STATUS_SUCCESS;
schedule_delayed_work(&handle->pcie_delayed_tx_work, 1);
if (!handle->driver_status)
schedule_delayed_work(&handle->pcie_delayed_tx_work, 1);
break;
#endif /* PCIE */
@ -2957,6 +3130,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
moal_handle *handle = (moal_handle *)pmoal;
moal_handle *ref_handle = NULL;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
t_u8 band_config = 0;
t_u8 chan_num = 0;
#endif
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
t_u8 enable = 1;
@ -2998,6 +3175,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#ifdef UAP_CFG80211
unsigned long wait_time, wait_time_ms, timeout;
#endif
#endif
#if defined(STA_SUPPORT)
chan_band_reginfo_t *psta_reg_info = NULL;
#endif
char iwevent_str[256];
addba_timeout_event *evtbuf = NULL;
@ -3008,7 +3188,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
if (!handle->is_fw_dump_timer_set) {
PRINTM(MMSG, "FW trigger fw dump\n");
handle->is_fw_dump_timer_set = MTRUE;
woal_mod_timer(&handle->fw_dump_timer, MOAL_TIMER_5S);
woal_mod_timer(&handle->fw_dump_timer,
MOAL_FW_DUMP_TIMER);
}
handle->init_wait_q_woken = MTRUE;
wake_up(&handle->init_wait_q);
@ -3123,6 +3304,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
priv->report_scan_result = MFALSE;
#ifdef STA_CFG80211
if (IS_STA_CFG80211(cfg80211_wext)) {
spin_lock_irqsave(&priv->phandle->scan_req_lock,
flags);
if (priv->phandle->scan_request) {
PRINTM(MINFO,
"Reporting scan results\n");
@ -3139,9 +3322,6 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PASSIVE_SCAN_CHAN_TIME,
SPECIFIC_SCAN_CHAN_TIME);
}
spin_lock_irqsave(
&priv->phandle->scan_req_lock,
flags);
if (priv->phandle->scan_request) {
cancel_delayed_work(
&priv->phandle
@ -3153,10 +3333,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
priv->phandle->scan_request =
NULL;
}
spin_unlock_irqrestore(
&priv->phandle->scan_req_lock,
flags);
}
spin_unlock_irqrestore(
&priv->phandle->scan_req_lock, flags);
}
#endif /* STA_CFG80211 */
@ -3249,6 +3428,17 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
break;
case MLAN_EVENT_ID_FW_DISCONNECTED:
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
/* 6E Indoor/Outdoor, download the default power table
* after disconnect/link-loss */
PRINTM(MEVENT, "Downloading default 6E table!!\n");
if (priv->phandle->fw_bands & BAND_6G) {
if (MLAN_STATUS_SUCCESS !=
woal_dnld_default_6e_psd_table(priv))
PRINTM(MERROR,
"Default 6E table download failed!!\n");
}
#endif
if (priv->media_connected)
woal_send_disconnect_to_system(
priv, (t_u16)*pmevent->event_buf);
@ -3682,15 +3872,19 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
if (priv->chan_rpt_req.chanNum && priv->chan_rpt_pending) {
radar_chan = pmevent->event_buf[1];
if (radar_detected) {
snprintf(event_buf, sizeof(event_buf) - 1,
"%s %d", CUS_EVT_RADAR_DETECTED,
radar_chan);
if (snprintf(event_buf, sizeof(event_buf) - 1,
"%s %d", CUS_EVT_RADAR_DETECTED,
radar_chan) <= 0)
PRINTM(MERROR,
"Failed to write event name and chan num in event_buf\n");
woal_broadcast_event(priv, event_buf,
strlen(event_buf));
} else {
snprintf(event_buf, sizeof(event_buf) - 1,
"%s %d", CUS_EVT_CAC_FINISHED,
priv->chan_rpt_req.chanNum);
if (snprintf(event_buf, sizeof(event_buf) - 1,
"%s %d", CUS_EVT_CAC_FINISHED,
priv->chan_rpt_req.chanNum) <= 0)
PRINTM(MERROR,
"Failed to write event name and chan num in event_buf\n");
woal_broadcast_event(priv, event_buf,
strlen(event_buf));
}
@ -3790,6 +3984,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
priv->wdev
->cac_time_ms));
#endif
// coverity[misra_c_2012_rule_10_8_violation:SUPPRESS]
if (!time_after_eq(jiffies, timeout)) {
/* Exact time to make host and
* device timer in sync */
@ -3832,8 +4027,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
case MLAN_EVENT_ID_FW_RADAR_DETECTED:
radar_chan = pmevent->event_buf[0];
bandwidth = pmevent->event_buf[1];
snprintf(event_buf, sizeof(event_buf) - 1, "%s %d",
CUS_EVT_RADAR_DETECTED, radar_chan);
if (snprintf(event_buf, sizeof(event_buf) - 1, "%s %d",
CUS_EVT_RADAR_DETECTED, radar_chan) <= 0) {
PRINTM(MERROR, "Failed to write RADAR detect event\n");
break;
}
woal_broadcast_event(priv, event_buf, strlen(event_buf));
PRINTM(MEVENT, "%s: Radar detected on channel %d\n",
priv->netdev->name, radar_chan);
@ -3960,8 +4158,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
wake_up_interruptible(&priv->phandle->chsw_wait_q);
}
#endif
snprintf(event_buf, sizeof(event_buf) - 1, "%s %d",
CUS_EVT_CHAN_SWITCH_COMPLETE, pchan_info->channel);
if (snprintf(event_buf, sizeof(event_buf) - 1, "%s %d",
CUS_EVT_CHAN_SWITCH_COMPLETE,
pchan_info->channel) <= 0)
PRINTM(MERROR,
"Failed to write switched chan num in event buf\n");
woal_broadcast_event(priv, event_buf, strlen(event_buf));
if (IS_STA_OR_UAP_CFG80211(cfg80211_wext)) {
PRINTM(MMSG,
@ -4395,6 +4596,16 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#endif /* UAP_WEXT */
break;
case MLAN_EVENT_ID_DRV_MGMT_FRAME:
/** We use the event_id field to pass the band_config and
* chan_num */
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
band_config = pmevent->event_buf[0];
chan_num = pmevent->event_buf[1];
#endif
moal_memcpy_ext(priv->phandle, (t_u8 *)pmevent->event_buf,
(t_u8 *)&pmevent->event_id,
sizeof(pmevent->event_id),
sizeof(pmevent->event_id));
#ifdef UAP_WEXT
if (IS_UAP_WEXT(cfg80211_wext)) {
woal_broadcast_event(priv, pmevent->event_buf,
@ -4412,10 +4623,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
* seqctl */
#define PACKET_ADDR4_POS (2 + 2 + 6 + 6 + 6 + 2)
t_u8 *pkt;
int freq =
priv->phandle->remain_on_channel ?
priv->phandle->chan.center_freq :
woal_get_active_intf_freq(priv);
int freq = woal_get_rx_freq(priv, band_config,
chan_num);
if (!freq) {
if (!priv->phandle->chan.center_freq) {
PRINTM(MINFO,
@ -5025,6 +5234,22 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
if (handle->sec_rgpower)
woal_rgpower_key_mismatch_event(priv);
break;
case MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO:
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
psta_reg_info = (chan_band_reginfo_t *)pmevent->event_buf;
if (psta_reg_info->bandcfg.chanBand == BAND_6GHZ) {
PRINTM(MEVENT,
"CSA/ECSA: STA switch to new channel=%d band=%d regInfo=%d!\n",
psta_reg_info->channel,
psta_reg_info->bandcfg.chanBand,
psta_reg_info->regInfo);
woal_dnld_sta_6e_psd_table(priv, NULL, 0,
psta_reg_info);
} else
PRINTM(MEVENT,
"Ignoring the Channel Switch Reg Info Event\n");
#endif
break;
default:
break;
}
@ -5170,6 +5395,8 @@ t_void moal_updata_peer_signal(t_void *pmoal, t_u32 bss_index, t_u8 *peer_addr,
priv = woal_bss_index_to_priv(pmoal, bss_index);
if (priv && priv->enable_auto_tdls) {
spin_lock_irqsave(&priv->tdls_lock, flags);
// Coverity violation raised for kernel's API
// coverity[cert_arr39_c_violation:SUPPRESS]
list_for_each_entry (peer, &priv->tdls_list, link) {
if (!memcmp(peer->peer_addr, peer_addr, ETH_ALEN)) {
peer->rssi = nflr - snr;
@ -5247,3 +5474,14 @@ t_u64 moal_do_div(t_u64 num, t_u32 base)
do_div(val, base);
return val;
}
mlan_status moal_calc_short_ssid(t_u8 *pssid, t_u32 ssid_len,
t_u32 *pshort_ssid)
{
if (!pssid || !ssid_len) {
PRINTM(MWARN, "%s: incorrect SSID\n", __func__);
return MLAN_STATUS_FAILURE;
}
*pshort_ssid = ~crc32_le(~0, pssid, ssid_len);
return MLAN_STATUS_SUCCESS;
}

View file

@ -126,5 +126,7 @@ void woal_request_busfreq_pmqos_add(t_void *pmhandle);
/* pmqos busfreq remove handler*/
void woal_release_busfreq_pmqos_remove(t_void *pmhandle);
#endif
mlan_status moal_calc_short_ssid(t_u8 *pssid, t_u32 ssid_len,
t_u32 *pshort_ssid);
#endif /*_MOAL_H */

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
* driver.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2025, NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -802,9 +802,10 @@ static int woal_uap_snmp_mib(struct net_device *dev, struct ifreq *req)
}
DBG_HEXDUMP(MCMD_D, "snmp_mib_para", (t_u8 *)&param, sizeof(param));
if (param.action) {
if (copy_from_user(value, req->ifr_data + sizeof(param),
MIN(param.oid_val_len,
MAX_SNMP_VALUE_SIZE))) {
if (copy_from_user(
value,
(void *)((t_u8 *)(req->ifr_data) + sizeof(param)),
MIN(param.oid_val_len, MAX_SNMP_VALUE_SIZE))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
@ -855,9 +856,10 @@ static int woal_uap_snmp_mib(struct net_device *dev, struct ifreq *req)
goto done;
}
if (!param.action) { /* GET */
if (copy_to_user(req->ifr_data + sizeof(param),
&snmp->param.oid_value,
MIN(param.oid_val_len, sizeof(t_u32)))) {
if (copy_to_user(
(void *)((t_u8 *)(req->ifr_data) + sizeof(param)),
&snmp->param.oid_value,
MIN(param.oid_val_len, sizeof(t_u32)))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
@ -909,8 +911,10 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
DBG_HEXDUMP(MCMD_D, "domain_info_para", (t_u8 *)&param, sizeof(param));
if (param.action) {
/* get tlv header */
if (copy_from_user(&tlv[0], req->ifr_data + sizeof(param),
TLV_HEADER_LEN)) {
if (copy_from_user(
&tlv[0],
(void *)((t_u8 *)(req->ifr_data) + sizeof(param)),
TLV_HEADER_LEN)) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
@ -923,8 +927,10 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
goto done;
}
/* get full tlv */
if (copy_from_user(tlv, req->ifr_data + sizeof(param),
TLV_HEADER_LEN + tlv_data_len)) {
if (copy_from_user(
tlv,
(void *)((t_u8 *)(req->ifr_data) + sizeof(param)),
TLV_HEADER_LEN + tlv_data_len)) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
@ -966,9 +972,10 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
}
if (!param.action) { /* GET */
tlv_data_len = ((t_u16 *)(cfg11d->param.domain_tlv))[1];
if (copy_to_user(req->ifr_data + sizeof(param),
&cfg11d->param.domain_tlv,
TLV_HEADER_LEN + tlv_data_len)) {
if (copy_to_user(
(void *)((t_u8 *)(req->ifr_data) + sizeof(param)),
&cfg11d->param.domain_tlv,
TLV_HEADER_LEN + tlv_data_len)) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
goto done;
@ -1242,7 +1249,9 @@ static int woal_uap_tx_bf_cfg(struct net_device *dev, struct ifreq *req)
else
/* Set BF configurations */
action = MLAN_ACT_SET;
if (copy_from_user(&bf_cfg, req->ifr_data + sizeof(tx_bf_cfg_para_hdr),
if (copy_from_user(&bf_cfg,
(void *)((t_u8 *)(req->ifr_data) +
sizeof(tx_bf_cfg_para_hdr)),
sizeof(bf_cfg))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
@ -1257,8 +1266,9 @@ static int woal_uap_tx_bf_cfg(struct net_device *dev, struct ifreq *req)
}
/* Copy to user */
if (copy_to_user(req->ifr_data + sizeof(tx_bf_cfg_para_hdr), &bf_cfg,
sizeof(bf_cfg))) {
if (copy_to_user((void *)((t_u8 *)(req->ifr_data) +
sizeof(tx_bf_cfg_para_hdr)),
&bf_cfg, sizeof(bf_cfg))) {
PRINTM(MERROR, "Copy to user failed!\n");
ret = -EFAULT;
goto done;
@ -1311,7 +1321,8 @@ static int woal_uap_ht_tx_cfg(struct net_device *dev, struct ifreq *req)
cfg_11n->sub_command = MLAN_OID_11N_CFG_TX;
ioctl_req->req_id = MLAN_IOCTL_11N_CFG;
if (copy_from_user(&httx_cfg,
req->ifr_data + sizeof(ht_tx_cfg_para_hdr),
(void *)((t_u8 *)(req->ifr_data) +
sizeof(ht_tx_cfg_para_hdr)),
sizeof(mlan_ds_11n_tx_cfg))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
@ -1337,8 +1348,9 @@ static int woal_uap_ht_tx_cfg(struct net_device *dev, struct ifreq *req)
PRINTM(MINFO, "GET: httxcap:0x%x\n", httx_cfg.httxcap);
}
/* Copy to user */
if (copy_to_user(req->ifr_data + sizeof(ht_tx_cfg_para_hdr), &httx_cfg,
sizeof(mlan_ds_11n_tx_cfg))) {
if (copy_to_user((void *)((t_u8 *)(req->ifr_data) +
sizeof(ht_tx_cfg_para_hdr)),
&httx_cfg, sizeof(mlan_ds_11n_tx_cfg))) {
PRINTM(MERROR, "Copy to user failed!\n");
ret = -EFAULT;
goto done;
@ -1401,7 +1413,9 @@ static int woal_uap_vht_cfg(struct net_device *dev, struct ifreq *req)
cfg_11ac = (mlan_ds_11ac_cfg *)ioctl_req->pbuf;
cfg_11ac->sub_command = MLAN_OID_11AC_VHT_CFG;
ioctl_req->req_id = MLAN_IOCTL_11AC_CFG;
if (copy_from_user(&vht_cfg, req->ifr_data + sizeof(vht_cfg_para_hdr),
if (copy_from_user(&vht_cfg,
(void *)((t_u8 *)(req->ifr_data) +
sizeof(vht_cfg_para_hdr)),
sizeof(mlan_ds_11ac_vht_cfg))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
@ -1751,11 +1765,14 @@ static int woal_uap_tx_rate_cfg(struct net_device *dev, struct ifreq *req)
rate->param.rate_cfg.rate_type = MLAN_RATE_INDEX;
rate->sub_command = MLAN_OID_RATE_CFG;
mreq->req_id = MLAN_IOCTL_RATE;
rate->auto_null_fixrate_enable = 0xFF;
if (!(tx_rate_config.action))
mreq->action = MLAN_ACT_GET;
else {
if ((tx_rate_config.user_data_cnt <= 0) ||
(tx_rate_config.user_data_cnt > 4)) {
(tx_rate_config.user_data_cnt > 5)) {
PRINTM(MERROR, "Invalid user_data_cnt\n");
ret = -EINVAL;
goto done;
@ -1826,6 +1843,17 @@ static int woal_uap_tx_rate_cfg(struct net_device *dev, struct ifreq *req)
else
rate->param.rate_cfg.rate_setting =
tx_rate_config.rate_setting;
if (tx_rate_config.user_data_cnt == 5) {
if (tx_rate_config.auto_null_fixrate_enable >
1) {
ret = -EINVAL;
goto done;
}
rate->auto_null_fixrate_enable =
tx_rate_config.auto_null_fixrate_enable;
}
}
}
@ -1917,6 +1945,8 @@ static int woal_uap_antenna_cfg(struct net_device *dev, struct ifreq *req)
mreq->action = MLAN_ACT_SET;
radio->param.ant_cfg.tx_antenna = antenna_config.tx_mode;
radio->param.ant_cfg.rx_antenna = antenna_config.rx_mode;
radio->param.ant_cfg.tx_antenna_6g = antenna_config.tx_mode_6g;
radio->param.ant_cfg.rx_antenna_6g = antenna_config.rx_mode_6g;
}
status = woal_request_ioctl(priv, mreq, MOAL_IOCTL_WAIT);
@ -1944,6 +1974,8 @@ static int woal_uap_antenna_cfg(struct net_device *dev, struct ifreq *req)
if (mreq->action == MLAN_ACT_GET) {
antenna_config.tx_mode = radio->param.ant_cfg.tx_antenna;
antenna_config.rx_mode = radio->param.ant_cfg.rx_antenna;
antenna_config.tx_mode_6g = radio->param.ant_cfg.tx_antenna_6g;
antenna_config.rx_mode_6g = radio->param.ant_cfg.rx_antenna_6g;
if (copy_to_user(req->ifr_data, &antenna_config,
sizeof(ant_cfg_t))) {
PRINTM(MERROR, "Copy to user failed\n");
@ -2515,7 +2547,9 @@ static int woal_uap_operation_ctrl(struct net_device *dev, struct ifreq *req)
bss = (mlan_ds_bss *)ioctl_req->pbuf;
bss->sub_command = MLAN_OID_UAP_OPER_CTRL;
ioctl_req->req_id = MLAN_IOCTL_BSS;
if (copy_from_user(&uap_oper, req->ifr_data + sizeof(uap_oper_para_hdr),
if (copy_from_user(&uap_oper,
(void *)((t_u8 *)(req->ifr_data) +
sizeof(uap_oper_para_hdr)),
sizeof(mlan_uap_oper_ctrl))) {
PRINTM(MERROR, "Copy from user failed\n");
ret = -EFAULT;
@ -2542,7 +2576,8 @@ static int woal_uap_operation_ctrl(struct net_device *dev, struct ifreq *req)
}
/* Copy to user */
if (copy_to_user(req->ifr_data + sizeof(uap_oper_para_hdr),
if (copy_to_user((void *)((t_u8 *)(req->ifr_data) +
sizeof(uap_oper_para_hdr)),
&bss->param.ap_oper_ctrl,
sizeof(mlan_uap_oper_ctrl))) {
PRINTM(MERROR, "Copy to user failed!\n");
@ -3768,8 +3803,8 @@ done:
*
* @return 0--success, otherwise failure
*/
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40,
IEEEtypes_VHTCap_t *vhtcap_ie)
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 band,
t_u8 vht20_40, const IEEEtypes_VHTCap_t *vhtcap_ie)
{
mlan_ioctl_req *req = NULL;
mlan_ds_11ac_cfg *cfg_11ac = NULL;
@ -3781,6 +3816,12 @@ int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40,
memset(&fw_info, 0, sizeof(mlan_fw_info));
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
if ((band == BAND_5GHZ && !(fw_info.fw_bands & BAND_AAC)) ||
(band == BAND_2GHZ && !(fw_info.fw_bands & BAND_GAC))) {
PRINTM(MERROR, "fw doesn't support 11ac\n");
ret = -EFAULT;
goto done;
}
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11ac_cfg));
if (req == NULL) {
@ -3900,7 +3941,7 @@ done:
* @return 0--success, otherwise failure
*/
int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
IEEEtypes_HECap_t *hecap_ie)
const IEEEtypes_HECap_t *hecap_ie)
{
mlan_fw_info fw_info;
int ret = 0;
@ -3915,11 +3956,18 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
ret = -EFAULT;
goto done;
}
if ((band == BAND_6GHZ) && !(fw_info.fw_bands & BAND_6G)) {
PRINTM(MERROR, "FW doesn't support 6E 11ax\n");
ret = -EFAULT;
goto done;
}
memset(&he_cfg, 0, sizeof(he_cfg));
if (band == BAND_5GHZ)
he_cfg.band = MBIT(1);
else if (band == BAND_2GHZ)
he_cfg.band = MBIT(0);
else if (band == BAND_6GHZ)
he_cfg.band = MBIT(2);
else {
PRINTM(MERROR, "Invalid band!\n");
ret = -EFAULT;
@ -3931,7 +3979,7 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
goto done;
}
if (hecap_ie) {
DBG_HEXDUMP(MCMD_D, "hecap_ie", (t_u8 *)hecap_ie,
DBG_HEXDUMP(MCMD_D, "hecap_ie", (const t_u8 *)hecap_ie,
hecap_ie->ieee_hdr.len +
sizeof(IEEEtypes_Header_t));
he_cfg.he_cap.id = hecap_ie->ieee_hdr.element_id;
@ -4555,6 +4603,162 @@ done:
return ret;
}
/**
* @brief Set default configurations pre BSS START
*
* @param A pointer to moal_private
*
* @return 0 --success, otherwise fail
*/
static mlan_status woal_uap_set_pre_confing(moal_private *priv)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
#if 0 // DMCS enable/disable by parameter in development phase.
ENTER();
if (priv->phandle->params.wacp_mode) {
/** Enable DMCS, if wacp_mode enabled */
if (MLAN_STATUS_SUCCESS != woal_set_dmcs(priv, 1, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR, "Set DMCS failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
}
done:
#endif
LEAVE();
return ret;
}
#define BF_CFG_ACT_SET 1
/**
* @brief Set default configurations post BSS START
*
* @param A pointer to moal_private
*
* @return 0 --success, otherwise fail
*/
static mlan_status woal_uap_set_post_confing(moal_private *priv)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 prot_mode;
mlan_ds_11n_aggr_prio_tbl aggr_prio_tbl;
mlan_ds_11n_addba_param addba_param;
mlan_ds_11n_tx_bf_cfg bf_cfg;
mlan_bf_global_cfg_args *bf_global = NULL;
int i;
t_u8 addba_reject[MAX_NUM_TID];
t_u8 tos_to_tid_inv[] = {0x02, 0x00, 0x01, 0x03,
0x04, 0x05, 0x06, 0x07};
t_u8 set_htc_cap;
t_u32 tx_bf_cap = 0;
ENTER();
if (priv->phandle->params.wacp_mode) {
/** Enable AMPDU/AMSDU, if wacp_mode enabled */
for (i = 0; i < MAX_NUM_TID; i++) {
aggr_prio_tbl.ampdu[i] = tos_to_tid_inv[i];
aggr_prio_tbl.amsdu[i] = tos_to_tid_inv[i];
}
if (MLAN_STATUS_SUCCESS !=
woal_ioctl_aggr_prio_tbl(priv, MLAN_ACT_SET,
&aggr_prio_tbl)) {
PRINTM(MERROR, "Set AMPDU/AMSDU failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/** Disable addbareject, if wacp_mode enabled */
for (i = 0; i < MAX_NUM_TID; i++) {
addba_reject[i] = MFALSE;
}
if (MLAN_STATUS_SUCCESS !=
woal_ioctl_addba_reject(priv, MLAN_ACT_SET, addba_reject)) {
PRINTM(MERROR, "Set addbareject failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/** Set addbapara, if wacp_mode enabled */
memset(&addba_param, 0, sizeof(addba_param));
addba_param.timeout = 65535;
addba_param.txwinsize = 64;
addba_param.rxwinsize = 64;
addba_param.txamsdu = 0;
addba_param.rxamsdu = 0;
if (MLAN_STATUS_SUCCESS !=
woal_ioctl_addba_param(priv, MLAN_ACT_SET, &addba_param)) {
PRINTM(MERROR, "Set addba_param failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
/** Enable ed_mac, if wacp_mode enabled */
if (MLAN_STATUS_SUCCESS !=
woal_edmac_cfg(priv, priv->phandle->country_code)) {
PRINTM(MERROR, "Enable edmac failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
#endif
/** Set AMPDU protect mode to TX_AMPDU_RTS_CTS, if wacp_mode
* enabled */
prot_mode = TX_AMPDU_RTS_CTS;
if (MLAN_STATUS_SUCCESS !=
woal_ioctl_tx_ampdu_prot_mode(priv, MLAN_ACT_SET,
&prot_mode)) {
PRINTM(MERROR, "Set AMPDU protect mode failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/** Enable HTC CAP if wacp_mode enabled */
set_htc_cap = 1;
if (MLAN_STATUS_SUCCESS !=
woal_ioctl_hostcmd_htc_cap(priv, MLAN_ACT_SET,
&set_htc_cap)) {
PRINTM(MERROR, "Set Hostcmd htc_cap failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/** Disable beamforming and sounding if wacp_mode enabled */
woal_set_get_tx_bf_cap(priv, MLAN_ACT_GET, &tx_bf_cap);
if (tx_bf_cap) {
memset(&bf_cfg, 0, sizeof(bf_cfg));
/* Pointer to corresponding buffer */
bf_global = &bf_cfg.body.bf_global_cfg;
bf_cfg.action = BF_CFG_ACT_SET;
bf_global->bf_enbl = 0; /* Disable beamforming */
bf_global->sounding_enbl = 0; /* Disable sounding */
bf_global->fb_type = 3; /* Set FB type to 3 */
bf_global->snr_threshold = 10; /* Set snr threshold to
10 */
bf_global->sounding_interval = 500; /* Set sounding
interval to 500
ms */
bf_global->bf_mode = 5; /* Set beamforming mode to 5 */
if (MLAN_STATUS_SUCCESS !=
woal_set_get_tx_bf_cfg(priv, MLAN_ACT_SET,
&bf_cfg)) {
PRINTM(MERROR, "Set TX beamforming failed\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
}
}
done:
LEAVE();
return ret;
}
/**
* @brief uap BSS control ioctl handler
*
@ -4603,6 +4807,15 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
goto done;
}
}
/* DMCS and other that do not use FW cmd directly configurations
*/
if (MLAN_STATUS_SUCCESS != woal_uap_set_pre_confing(priv)) {
PRINTM(MERROR,
"Set WACP Pre default configurations failed\n");
ret = -EFAULT;
goto done;
}
bss->sub_command = MLAN_OID_BSS_START;
if (priv->uap_host_based) {
bss->param.host_based |= UAP_FLAG_HOST_BASED;
@ -4660,6 +4873,12 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
}
woal_flush_tx_stat_queue(priv);
woal_flush_tcp_sess_queue(priv);
} else if (data == UAP_BSS_START) {
/* Due to the influence of DMCS, the configurations using FW cmd
* must wait until BSS START. */
if (MLAN_STATUS_SUCCESS != woal_uap_set_post_confing(priv))
PRINTM(MERROR,
"Set WACP Post default configurations failed\n");
}
done:
if (status != MLAN_STATUS_PENDING)

View file

@ -3,7 +3,7 @@
* @brief This file contains uap driver specific defines etc.
*
*
* Copyright 2008-2022, 2024 NXP
* Copyright 2008-2025, NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -158,6 +158,9 @@ typedef struct _tx_rate_cfg_t {
t_u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
/** Rate Setting */
t_u16 rate_setting;
/** Only set auto tx fix rate */
t_u16 auto_null_fixrate_enable;
} tx_rate_cfg_t;
/** ant_cfg structure */
@ -170,6 +173,10 @@ typedef struct _ant_cfg_t {
int tx_mode;
/** RX mode configured */
int rx_mode;
/** TX mode 6G configured */
t_u8 tx_mode_6g;
/** RX mode 6G configured */
t_u8 rx_mode_6g;
} ant_cfg_t;
/** htstream_cfg structure */
@ -615,12 +622,13 @@ int woal_uap_set_get_multi_ap_mode(moal_private *priv, struct iwreq *wrq);
#endif
#endif
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40,
IEEEtypes_VHTCap_t *vhtcap_ie);
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 band,
t_u8 vht20_40,
const IEEEtypes_VHTCap_t *vhtcap_ie);
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg,
t_u8 wait_option);
int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
IEEEtypes_HECap_t *hecap_ie);
const IEEEtypes_HECap_t *hecap_ie);
int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg,
t_u16 ht_cap, t_u8 en);
mlan_status woal_uap_set_11n_status(moal_private *priv,

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
* @brief This file contains wireless extension standard ioctl functions
*
*
* Copyright 2010-2021 NXP
* Copyright 2010-2021, 2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -58,6 +58,21 @@ static const chan_to_freq_t chan_to_freq[] = {
{132, 5660, 1}, {136, 5680, 1}, {140, 5700, 1}, {144, 5720, 1},
{149, 5745, 1}, {153, 5765, 1}, {157, 5785, 1}, {161, 5805, 1},
{165, 5825, 1}, {169, 5845, 1}, {173, 5865, 1}, {177, 5885, 1},
{1, 5955, 2}, {5, 5975, 2}, {9, 5995, 2}, {13, 6015, 2},
{17, 6035, 2}, {21, 6055, 2}, {25, 6075, 2}, {29, 6095, 2},
{33, 6115, 2}, {37, 6135, 2}, {41, 6155, 2}, {45, 6175, 2},
{49, 6195, 2}, {53, 6215, 2}, {57, 6235, 2}, {61, 6255, 2},
{65, 6275, 2}, {69, 6295, 2}, {73, 6315, 2}, {77, 6335, 2},
{81, 6355, 2}, {85, 6375, 2}, {89, 6395, 2}, {94, 6415, 2},
{97, 6435, 2}, {101, 6455, 2}, {105, 6475, 2}, {109, 6495, 2},
{113, 6515, 2}, {117, 6535, 2}, {121, 6555, 2}, {125, 6575, 2},
{129, 6595, 2}, {133, 6615, 2}, {137, 6635, 2}, {141, 6655, 2},
{145, 6675, 2}, {149, 6695, 2}, {153, 6715, 2}, {157, 6735, 2},
{161, 6755, 2}, {165, 6775, 2}, {169, 6795, 2}, {173, 6815, 2},
{177, 6835, 2}, {181, 6855, 2}, {185, 6875, 2}, {189, 6895, 2},
{193, 6915, 2}, {197, 6935, 2}, {201, 6955, 2}, {205, 6975, 2},
{209, 6995, 2}, {213, 7015, 2}, {217, 7035, 2}, {221, 7055, 2},
{225, 7075, 2}, {229, 7095, 2}, {233, 7115, 2},
};
/**
@ -409,7 +424,9 @@ static int woal_get_freq(struct net_device *dev, struct iw_request_info *info,
return -EFAULT;
}
band = (((ap_cfg->bandcfg.chanBand == BAND_5GHZ) ? 1 : 0));
band = ((ap_cfg->bandcfg.chanBand == BAND_6GHZ) ?
2 :
((ap_cfg->bandcfg.chanBand == BAND_5GHZ) ? 1 : 0));
fwrq->m = (long)channel_to_frequency(ap_cfg->channel, band);
fwrq->i = (long)ap_cfg->channel;
fwrq->e = 6;
@ -479,16 +496,17 @@ static int woal_get_bss_mode(struct net_device *dev,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->essid;
mlan_uap_bss_param *sys_cfg = NULL, *ap_cfg = NULL;
wep_key *pkey = NULL;
int key_index = 0;
@ -1729,15 +1747,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0--success, otherwise fail
*/
static int woal_get_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->essid;
mlan_uap_bss_param *ap_cfg = NULL;
ENTER();
@ -1873,9 +1892,9 @@ struct iw_handler_def woal_uap_handler_def = {
.num_standard = ARRAY_SIZE(woal_handler),
.num_private = ARRAY_SIZE(woal_private_handler),
.num_private_args = ARRAY_SIZE(woal_uap_priv_args),
.standard = (iw_handler *)woal_handler,
.private = (iw_handler *)woal_private_handler,
.private_args = (struct iw_priv_args *)woal_uap_priv_args,
.standard = (const iw_handler *)woal_handler,
.private = (const iw_handler *)woal_private_handler,
.private_args = (const struct iw_priv_args *)woal_uap_priv_args,
#if WIRELESS_EXT > 20
.get_wireless_stats = woal_get_uap_wireless_stats,
#endif

View file

@ -4,7 +4,7 @@
* driver.
*
*
* Copyright 2008-2021, 2024 NXP
* Copyright 2008-2021, 2024-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -191,6 +191,7 @@ static struct usb_driver REFDATA woal_usb_driver = {
#endif /* CONFIG_PM */
};
/* moal interface ops */
static moal_if_ops usb_ops;
@ -1323,8 +1324,10 @@ static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
* between a suspended state and a 'disconnect' one.
*/
handle->is_suspended = MTRUE;
for (i = 0; i < handle->priv_num; i++)
netif_carrier_off(handle->priv[i]->netdev);
for (i = 0; i < handle->priv_num; i++) {
if (handle->priv[i])
netif_carrier_off(handle->priv[i]->netdev);
}
/* Unlink Rx cmd URB */
if (atomic_read(&cardp->rx_cmd_urb_pending) && cardp->rx_cmd.urb) {
@ -1407,7 +1410,8 @@ static int woal_usb_resume(struct usb_interface *intf)
}
for (i = 0; i < handle->priv_num; i++)
if (handle->priv[i]->media_connected == MTRUE)
if (handle->priv[i] &&
handle->priv[i]->media_connected == MTRUE)
netif_carrier_on(handle->priv[i]->netdev);
/* Disable Host Sleep */
@ -2083,7 +2087,7 @@ static void woal_usb_dump_fw_info(moal_handle *phandle)
if (status != MLAN_STATUS_PENDING)
kfree(req);
phandle->is_fw_dump_timer_set = MTRUE;
woal_mod_timer(&phandle->fw_dump_timer, MOAL_TIMER_5S);
woal_mod_timer(&phandle->fw_dump_timer, MOAL_FW_DUMP_TIMER);
done:
LEAVE();

View file

@ -3,7 +3,7 @@
* @brief This file contains wireless extension standard ioctl functions
*
*
* Copyright 2008-2024 NXP
* Copyright 2008-2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -303,15 +303,16 @@ static t_u8 woal_rssi_to_quality(t_s16 rssi)
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->data;
ENTER();
/*
* Check the size of the string
@ -332,15 +333,16 @@ static int woal_set_nick(struct net_device *dev, struct iw_request_info *info,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success
*/
static int woal_get_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->data;
ENTER();
/*
* Get the Nick Name saved
@ -871,15 +873,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
static int woal_set_power(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0, disabled;
struct iw_param *vwrq = &wrqu->param;
moal_private *priv = (moal_private *)netdev_priv(dev);
ENTER();
@ -906,15 +909,16 @@ static int woal_set_power(struct net_device *dev, struct iw_request_info *info,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
static int woal_get_power(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0, ps_mode = 0;
struct iw_param *vwrq = &wrqu->param;
moal_private *priv = (moal_private *)netdev_priv(dev);
ENTER();
@ -941,14 +945,15 @@ static int woal_get_power(struct net_device *dev, struct iw_request_info *info,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_retry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
struct iw_param *vwrq = &wrqu->retry;
int ret = 0, retry_val = vwrq->value;
moal_private *priv = (moal_private *)netdev_priv(dev);
@ -981,15 +986,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_get_retry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int retry_val, ret = 0;
struct iw_param *vwrq = &wrqu->retry;
moal_private *priv = (moal_private *)netdev_priv(dev);
ENTER();
@ -1018,16 +1024,17 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->encoding;
mlan_ds_sec_cfg *sec = NULL;
mlan_ioctl_req *req = NULL;
int index = 0;
@ -1142,7 +1149,7 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
@ -1247,16 +1254,17 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_rate(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_param *vwrq = &wrqu->bitrate;
mlan_rate_cfg_t rate_cfg;
ENTER();
@ -1284,15 +1292,16 @@ static int woal_set_rate(struct net_device *dev, struct iw_request_info *info,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_get_rate(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
struct iw_param *vwrq = &wrqu->bitrate;
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_rate_cfg_t rate_cfg;
@ -1319,15 +1328,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_rts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
struct iw_param *vwrq = &wrqu->rts;
moal_private *priv = (moal_private *)netdev_priv(dev);
int rthr = vwrq->value;
@ -1358,15 +1368,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_get_rts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int rthr, ret = 0;
struct iw_param *vwrq = &wrqu->rts;
moal_private *priv = (moal_private *)netdev_priv(dev);
ENTER();
@ -1392,15 +1403,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_set_frag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
struct iw_param *vwrq = &wrqu->frag;
moal_private *priv = (moal_private *)netdev_priv(dev);
int fthr = vwrq->value;
@ -1431,16 +1443,17 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0 --success, otherwise fail
*/
static int woal_get_frag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0, fthr;
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_param *vwrq = &wrqu->frag;
ENTER();
@ -1482,8 +1495,8 @@ static int woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info,
ENTER();
if (MLAN_STATUS_SUCCESS != woal_set_get_gen_ie(priv, MLAN_ACT_GET, ie,
&ie_len,
if (MLAN_STATUS_SUCCESS != woal_set_get_gen_ie(priv, MLAN_ACT_GET, NULL,
ie, &ie_len,
MOAL_IOCTL_WAIT)) {
ret = -EFAULT;
goto done;
@ -1547,9 +1560,9 @@ static int woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
}
}
if (MLAN_STATUS_SUCCESS != woal_set_get_gen_ie(priv, MLAN_ACT_SET,
(t_u8 *)extra, &ie_len,
MOAL_IOCTL_WAIT)) {
if (MLAN_STATUS_SUCCESS !=
woal_set_get_gen_ie(priv, MLAN_ACT_SET, (t_u8 *)extra, NULL,
&ie_len, MOAL_IOCTL_WAIT)) {
ret = -EFAULT;
goto done;
}
@ -1925,13 +1938,13 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param vwrq A pointer to iw_param structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return -EOPNOTSUPP
*/
static int woal_set_pmksa(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
ENTER();
LEAVE();
@ -2193,6 +2206,8 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
t_u8 country_code[COUNTRY_CODE_LEN];
int len = 0;
gfp_t flag;
unsigned int link_speed = 0;
ENTER();
if (!priv || !priv->phandle) {
PRINTM(MERROR, "priv or handle is NULL\n");
@ -2253,8 +2268,9 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
goto done;
}
PRINTM(MIOCTL, "tx rate=%d\n", (int)rate.rate);
link_speed = rate.rate * 500000 / 1000000;
len = snprintf(buf, MAX_BUF_LEN, "LinkSpeed %d\n",
(int)(rate.rate * 500000 / 1000000)) +
(int)link_speed) +
1;
} else if (strncmp(buf, "MACADDR", strlen("MACADDR")) == 0) {
len = snprintf(buf, MAX_BUF_LEN,
@ -2529,10 +2545,11 @@ static mlan_status woal_wext_request_scan(moal_private *priv, t_u8 wait_option,
* @return 0--success, otherwise fail
*/
static int woal_set_scan(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_param *vwrq = &wrqu->param;
moal_handle *handle = priv->phandle;
#if WIRELESS_EXT >= 18
struct iw_scan_req *req;
@ -2658,7 +2675,7 @@ static int woal_owe_specific_scan(moal_private *priv,
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0--success, otherwise fail
@ -2909,15 +2926,16 @@ setessid_ret:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0--success, otherwise fail
*/
static int woal_get_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->essid;
mlan_bss_info bss_info;
int ret = 0;
@ -2953,15 +2971,16 @@ done:
*
* @param dev A pointer to net_device structure
* @param info A pointer to iw_request_info structure
* @param dwrq A pointer to iw_point structure
* @param wrqu A pointer to iwreq_data union
* @param extra A pointer to extra data buf
*
* @return 0--success, otherwise fail
*/
static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
union iwreq_data *wrqu, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iw_point *dwrq = &wrqu->data;
int ret = 0;
char *current_ev = extra;
char *end_buf = extra + IW_SCAN_MAX_DATA;
@ -2983,6 +3002,7 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
IEEEtypes_ElementId_e element_id;
t_u8 element_len;
gfp_t flag;
int event_len = 0;
ENTER();
@ -3145,7 +3165,8 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
}
/* Check if an event is added */
if ((unsigned int)(current_val - current_ev) >= IW_EV_PARAM_LEN)
event_len = current_val - current_ev;
if ((unsigned int)event_len >= IW_EV_PARAM_LEN)
current_ev = current_val;
/* Beacon Interval */
@ -3246,7 +3267,8 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
/*
* Check if we added any event
*/
if ((unsigned int)(current_val - current_ev) > IW_EV_LCP_LEN)
event_len = current_val - current_ev;
if ((unsigned int)event_len > IW_EV_LCP_LEN)
current_ev = current_val;
}
@ -3384,7 +3406,11 @@ void woal_send_iwevcustom_event(moal_private *priv, char *str)
memset(&iwrq, 0, sizeof(union iwreq_data));
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf) - 1, "%s", str);
if (snprintf(buf, sizeof(buf) - 1, "%s", str) <= 0) {
PRINTM(MERROR, "Failed to write custom event in iwreq buf\n");
LEAVE();
return;
}
iwrq.data.pointer = (t_u8 __user *)buf;
iwrq.data.length = strlen(buf) + 1;
@ -3438,9 +3464,9 @@ struct iw_handler_def woal_handler_def = {
.num_standard = ARRAY_SIZE(woal_handler),
.num_private = ARRAY_SIZE(woal_private_handler),
.num_private_args = ARRAY_SIZE(woal_private_args),
.standard = (iw_handler *)woal_handler,
.private = (iw_handler *)woal_private_handler,
.private_args = (struct iw_priv_args *)woal_private_args,
.standard = (const iw_handler *)woal_handler,
.private = (const iw_handler *)woal_private_handler,
.private_args = (const struct iw_priv_args *)woal_private_args,
#if WIRELESS_EXT > 20
.get_wireless_stats = woal_get_wireless_stats,
#endif