mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2026-11-20 18:39:49 -05:00
Driver commit for release MM6X18537.p15_V1 2025-06-20_11:48:00
Firmware version for commit: W8997-16.92.21.p151.5 W9098-17.92.1.p149.72 IW416-16.92.21.p151.5 W8987-16.92.21.p151.5 IW612-18.99.3.p25.10 IW610-18.99.5.p65 AW693-18.99.2.p145.35
This commit is contained in:
parent
038a307943
commit
7d13b9dc29
37 changed files with 2416 additions and 76 deletions
2
Makefile
2
Makefile
|
|
@ -175,7 +175,7 @@ APPDIR= $(shell if test -d "mapp"; then echo mapp; fi)
|
|||
#############################################################################
|
||||
|
||||
ccflags-y += -I$(KERNELDIR)/include
|
||||
ccflags-y += -DMLAN_RELEASE_VERSION='"537.p9"'
|
||||
ccflags-y += -DMLAN_RELEASE_VERSION='"537.p15"'
|
||||
|
||||
ccflags-y += -DFPNUM='"92"'
|
||||
|
||||
|
|
|
|||
|
|
@ -844,6 +844,18 @@ int wlan_cmd_append_116e_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
return ret_len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function checks whether the operation class is a 6G
|
||||
*
|
||||
* @param op_class global operation class
|
||||
*
|
||||
* @return 0--not allowed, other value allowed
|
||||
*/
|
||||
t_bool is_6ghz_op_class(t_u8 op_class)
|
||||
{
|
||||
return op_class >= 131 && op_class <= 137;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function check if 11AX is allowed in bandcfg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* @brief This file contains the functions for station ioctl.
|
||||
*
|
||||
*
|
||||
* Copyright 2018-2022 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
|
||||
|
|
@ -69,6 +69,7 @@ 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);
|
||||
t_bool is_6ghz_op_class(t_u8 op_class);
|
||||
|
||||
int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
||||
t_u8 **ppbuffer);
|
||||
|
|
|
|||
|
|
@ -2517,8 +2517,8 @@ typedef struct _oper_bw_chan {
|
|||
t_u8 global_oper_class;
|
||||
/*bandwidth 0-20M 1-40M 2-80M 3-160M*/
|
||||
t_u8 bandwidth;
|
||||
/*channel list*/
|
||||
t_u8 channel_list[13];
|
||||
/*channel list, includes 6G*/
|
||||
t_u8 channel_list[59]; /*size is based current largest channel array*/
|
||||
} oper_bw_chan;
|
||||
|
||||
/** oper class table for US*/
|
||||
|
|
@ -2548,6 +2548,35 @@ static oper_bw_chan oper_bw_chan_us[] = {
|
|||
{128, 128, 2, {42, 58, 106, 122, 138, 155}},
|
||||
{129, 129, 3, {50, 114}},
|
||||
{130, 130, 2, {42, 58, 106, 122, 138, 155}},
|
||||
/* 6G 20MHz */
|
||||
{131, 131, 0, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37,
|
||||
41, 45, 49, 53, 57, 61, 65, 69, 73, 77,
|
||||
81, 85, 89, 93, 97, 101, 105, 109, 113, 117,
|
||||
121, 125, 129, 133, 137, 141, 145, 149, 153, 157,
|
||||
161, 165, 169, 173, 177, 181, 185, 189, 193, 197,
|
||||
201, 205, 209, 213, 217, 221, 225, 229, 233}},
|
||||
/* 6G 40MHz */
|
||||
{132, 132, 1, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37,
|
||||
41, 45, 49, 53, 57, 61, 65, 69, 73, 77,
|
||||
81, 85, 89, 93, 97, 101, 105, 109, 113, 117,
|
||||
121, 125, 129, 133, 137, 141, 145, 149, 153, 157,
|
||||
161, 165, 169, 173, 177, 181, 185, 189, 193, 197,
|
||||
201, 205, 209, 213, 217, 221, 225, 229, 233}},
|
||||
/* 6G 80MHz */
|
||||
{133, 133, 2, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37,
|
||||
41, 45, 49, 53, 57, 61, 65, 69, 73, 77,
|
||||
81, 85, 89, 93, 97, 101, 105, 109, 113, 117,
|
||||
121, 125, 129, 133, 137, 141, 145, 149, 153, 157,
|
||||
161, 165, 169, 173, 177, 181, 185, 189, 193, 197,
|
||||
201, 205, 209, 213, 217, 221, 225, 229, 233}},
|
||||
/* 6G 160MHz */
|
||||
{134, 134, 3, {15, 47, 79, 111, 143, 175, 207}},
|
||||
/* 6G 80+ MHz */
|
||||
{135,
|
||||
135,
|
||||
0,
|
||||
{7, 23, 39, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 215}},
|
||||
{136, 136, 0, {2}},
|
||||
};
|
||||
/** oper class table for EU*/
|
||||
static oper_bw_chan oper_bw_chan_eu[] = {
|
||||
|
|
@ -2568,6 +2597,20 @@ static oper_bw_chan oper_bw_chan_eu[] = {
|
|||
{128, 128, 2, {42, 58, 106, 122, 138, 155}},
|
||||
{129, 129, 3, {50, 114}},
|
||||
{130, 130, 2, {42, 58, 106, 122, 138, 155}},
|
||||
/* 6G 20MHz */
|
||||
{131, 131, 0, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 40MHz */
|
||||
{132, 132, 1, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 80MHz */
|
||||
{133, 133, 2, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 160MHz */
|
||||
{134, 134, 3, {15, 47, 79}},
|
||||
/* 6G 80+ MHz */
|
||||
{135, 135, 0, {7, 23, 39, 55, 71, 87}},
|
||||
{136, 136, 0, {2}},
|
||||
};
|
||||
/** oper class table for Japan*/
|
||||
static oper_bw_chan oper_bw_chan_jp[] = {
|
||||
|
|
@ -2595,6 +2638,20 @@ static oper_bw_chan oper_bw_chan_jp[] = {
|
|||
{128, 128, 2, {42, 58, 106, 122, 138, 155}},
|
||||
{129, 129, 3, {50, 114}},
|
||||
{130, 130, 2, {42, 58, 106, 122, 138, 155}},
|
||||
/* 6G 20MHz */
|
||||
{131, 131, 0, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 40MHz */
|
||||
{132, 132, 1, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 80MHz */
|
||||
{133, 133, 2, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45,
|
||||
49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93}},
|
||||
/* 6G 160MHz */
|
||||
{134, 134, 3, {15, 47, 79}},
|
||||
/* 6G 80+ MHz */
|
||||
{135, 135, 0, {7, 23, 39, 55, 71, 87}},
|
||||
{136, 136, 0, {2}},
|
||||
};
|
||||
/** oper class table for China*/
|
||||
static oper_bw_chan oper_bw_chan_cn[] = {
|
||||
|
|
@ -2765,7 +2822,8 @@ mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
|
|||
* @return MLAN_STATUS_PENDING --success, otherwise fail
|
||||
*/
|
||||
mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
|
||||
t_u8 bw, t_u8 *oper_class)
|
||||
t_u8 bw, t_u8 *oper_class,
|
||||
t_u8 *global_oper_class)
|
||||
{
|
||||
oper_bw_chan *poper_bw_chan = MNULL;
|
||||
t_u8 center_freq_idx = 0;
|
||||
|
|
@ -2805,6 +2863,9 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
|
|||
channel) {
|
||||
*oper_class =
|
||||
poper_bw_chan[i].oper_class;
|
||||
*global_oper_class =
|
||||
poper_bw_chan[i]
|
||||
.global_oper_class;
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1472,6 +1472,7 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv,
|
|||
sec, usec, wlan_hostcmd_get_name(cmd_code), cmd_code,
|
||||
wlan_le16_to_cpu(*(t_u16 *)((t_u8 *)pcmd + S_DS_GEN)), cmd_size,
|
||||
wlan_le16_to_cpu(pcmd->seq_num), timeout);
|
||||
|
||||
DBG_HEXDUMP(MCMD_D, "DNLD_CMD", (t_u8 *)pcmd, cmd_size);
|
||||
|
||||
#if defined(SDIO) || defined(PCIE)
|
||||
|
|
@ -2358,14 +2359,20 @@ done:
|
|||
* @return N/A
|
||||
*/
|
||||
static void wlan_handle_cmd_error_in_pre_aleep(mlan_adapter *pmadapter,
|
||||
t_u16 cmd_no)
|
||||
t_u16 cmd_no,
|
||||
HostCmd_DS_COMMAND *rsp)
|
||||
{
|
||||
cmd_ctrl_node *pcmd_node = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
PRINTM(MERROR, "CMD_RESP: 0x%x block in pre_asleep!\n", cmd_no);
|
||||
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
|
||||
pcmd_node = pmadapter->curr_cmd;
|
||||
pmadapter->curr_cmd = MNULL;
|
||||
|
||||
if (pcmd_node) {
|
||||
if (!IS_USB(pmadapter->card_type)) {
|
||||
pcmd_node->cmdbuf->data_offset +=
|
||||
|
|
@ -2381,6 +2388,7 @@ static void wlan_handle_cmd_error_in_pre_aleep(mlan_adapter *pmadapter,
|
|||
}
|
||||
wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node, MFALSE);
|
||||
}
|
||||
|
||||
wlan_release_cmd_lock(pmadapter);
|
||||
LEAVE();
|
||||
}
|
||||
|
|
@ -2441,6 +2449,7 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
|
||||
resp = (HostCmd_DS_COMMAND *)(pmadapter->curr_cmd->respbuf->pbuf +
|
||||
pmadapter->curr_cmd->respbuf->data_offset);
|
||||
|
||||
orig_cmdresp_no = wlan_le16_to_cpu(resp->command);
|
||||
cmdresp_no = (orig_cmdresp_no & HostCmd_CMD_ID_MASK);
|
||||
if (pmadapter->curr_cmd->cmd_no != cmdresp_no) {
|
||||
|
|
@ -2546,7 +2555,7 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
if (!IS_USB(pmadapter->card_type) && pmadapter->curr_cmd &&
|
||||
cmdresp_result == HostCmd_RESULT_PRE_ASLEEP) {
|
||||
wlan_handle_cmd_error_in_pre_aleep(pmadapter,
|
||||
cmdresp_no);
|
||||
cmdresp_no, resp);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -2560,7 +2569,7 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
if (!IS_USB(pmadapter->card_type) && pmadapter->curr_cmd &&
|
||||
cmdresp_result == HostCmd_RESULT_PRE_ASLEEP) {
|
||||
wlan_handle_cmd_error_in_pre_aleep(pmadapter,
|
||||
cmdresp_no);
|
||||
cmdresp_no, resp);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -2666,6 +2675,9 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
(HostCmd_CMD_GET_HW_SPEC == cmdresp_no)) {
|
||||
pmadapter->hw_status = WlanHardwareStatusGetHwSpecdone;
|
||||
}
|
||||
#if defined(PCIEAW693)
|
||||
#endif
|
||||
|
||||
done:
|
||||
LEAVE();
|
||||
return ret;
|
||||
|
|
@ -5328,6 +5340,7 @@ mlan_status wlan_adapter_get_hw_spec(pmlan_adapter pmadapter)
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/** DPD data dnld cmd prepare */
|
||||
if ((pmadapter->pdpd_data) && (pmadapter->dpd_data_len > 0)) {
|
||||
ret = wlan_process_hostcmd_cfg(priv, CFG_TYPE_DPDFILE,
|
||||
|
|
@ -10433,6 +10446,47 @@ mlan_status wlan_cmd_nav_mitigation(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of HW based nav mitigation
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param cmd A pointer to HostCmd_DS_COMMAND structure
|
||||
* @param cmd_action the action: GET or SET
|
||||
* @param pdata_buf A pointer to data buffer
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
mlan_status wlan_cmd_nav_mitigation_hw(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf)
|
||||
{
|
||||
HostCmd_DS_CMD_NavMitigationHwCfg *cfg_cmd =
|
||||
(HostCmd_DS_CMD_NavMitigationHwCfg *)&cmd->params
|
||||
.nav_mitigation_hw;
|
||||
mlan_ds_misc_nav_mitigation_hw *cfg =
|
||||
(mlan_ds_misc_nav_mitigation_hw *)pdata_buf;
|
||||
|
||||
ENTER();
|
||||
|
||||
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_NAV_MITIGATION_HW_CFG);
|
||||
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_CMD_NavMitigationHwCfg) +
|
||||
S_DS_GEN);
|
||||
cfg_cmd->action = wlan_cpu_to_le16(cmd_action);
|
||||
|
||||
if (cmd_action == HostCmd_ACT_GEN_SET) {
|
||||
cfg_cmd->start_nav_mitigation =
|
||||
wlan_cpu_to_le16(cfg->start_nav_mitigation);
|
||||
cfg_cmd->duration_threshold =
|
||||
wlan_cpu_to_le16(cfg->duration_threshold);
|
||||
cfg_cmd->honoring_duration =
|
||||
wlan_cpu_to_le16(cfg->honoring_duration);
|
||||
cfg_cmd->txop_duration_threshold =
|
||||
wlan_cpu_to_le16(cfg->txop_duration_threshold);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of LED config parameter
|
||||
*
|
||||
|
|
@ -10615,6 +10669,41 @@ mlan_status wlan_ret_nav_mitigation(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of HW based nav mitigation
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param resp A pointer to HostCmd_DS_COMMAND
|
||||
* @param pioctl_buf A pointer to mlan_ioctl_req structure
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
mlan_status wlan_ret_nav_mitigation_hw(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf)
|
||||
{
|
||||
HostCmd_DS_CMD_NavMitigationHwCfg *cfg_cmd =
|
||||
(HostCmd_DS_CMD_NavMitigationHwCfg *)&resp->params
|
||||
.nav_mitigation_hw;
|
||||
mlan_ds_misc_cfg *misc_cfg = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_buf) {
|
||||
misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
|
||||
misc_cfg->param.nav_mitigation_hw.start_nav_mitigation =
|
||||
wlan_le16_to_cpu(cfg_cmd->start_nav_mitigation);
|
||||
misc_cfg->param.nav_mitigation_hw.duration_threshold =
|
||||
wlan_le16_to_cpu(cfg_cmd->duration_threshold);
|
||||
misc_cfg->param.nav_mitigation_hw.honoring_duration =
|
||||
wlan_le16_to_cpu(cfg_cmd->honoring_duration);
|
||||
misc_cfg->param.nav_mitigation_hw.txop_duration_threshold =
|
||||
wlan_le16_to_cpu(cfg_cmd->txop_duration_threshold);
|
||||
}
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function sets the hal/phy cfg params
|
||||
*
|
||||
|
|
|
|||
|
|
@ -780,6 +780,29 @@ typedef struct _assoc_logger {
|
|||
#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9)
|
||||
#define SCAN_STATE_SCAN_COMPLETE MBIT(10)
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Agiled channel switch state */
|
||||
typedef enum _agcs_state {
|
||||
/** AGCS is desabled */
|
||||
AGCS_STATE_IDLE = 0,
|
||||
/** AGCS is enabled */
|
||||
AGCS_STATE_START = 1,
|
||||
/**When FW sends AGCS event to notify the driver to prepare for channel
|
||||
switch.*/
|
||||
AGCS_STATE_TRIGGERED = 2,
|
||||
/** Start to scan the candidate channels */
|
||||
AGCS_STATE_IN_SCAN = 3,
|
||||
/** Receives the scan report */
|
||||
AGCS_STATE_SCAN_REPORT = 4,
|
||||
/** All candidate channels scanned done */
|
||||
AGCS_STATE_SCAN_DONE = 5,
|
||||
/** Start Channel Switch */
|
||||
AGCS_STATE_CSA_START = 6,
|
||||
/** Channel Switch Completed */
|
||||
AGCS_STATE_COMPLETE = 7,
|
||||
} agcs_state;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#ifdef USB
|
||||
/** mlan_usb_ep */
|
||||
typedef enum _mlan_usb_ep {
|
||||
|
|
@ -878,6 +901,10 @@ typedef enum _mlan_event_id {
|
|||
#endif /* SSU_SUPPORT */
|
||||
MLAN_EVENT_ID_CSI = 0x00000040,
|
||||
MLAN_EVENT_ID_FW_TX_BULK_STATUS = 0x00000043,
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Agiled channel switch triggered */
|
||||
MLAN_EVENT_ID_FW_AGCS_TRIGGER = 0x00000044,
|
||||
#endif /* UAP_SUPPORT */
|
||||
/* Event generated by MLAN driver (MSB=1) */
|
||||
MLAN_EVENT_ID_DRV_CONNECTED = 0x80000001,
|
||||
MLAN_EVENT_ID_DRV_DEFER_HANDLING = 0x80000002,
|
||||
|
|
@ -920,6 +947,7 @@ typedef enum _mlan_event_id {
|
|||
MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO = 0x80000038,
|
||||
#endif
|
||||
MLAN_EVENT_ID_DRV_ASSOC_FAILURE = 0x80000039,
|
||||
MLAN_EVENT_ID_EMERGENCY_TEMP_REACHED = 0x80000040,
|
||||
} mlan_event_id;
|
||||
|
||||
/** Data Structures */
|
||||
|
|
@ -2883,6 +2911,7 @@ typedef struct _mlan_device {
|
|||
t_u8 mclient_scheduling;
|
||||
t_u8 disable_11h_tpc;
|
||||
t_u8 tpe_ie_ignore;
|
||||
t_u32 amsdu_disable;
|
||||
} mlan_device, *pmlan_device;
|
||||
|
||||
/** MLAN API function prototype */
|
||||
|
|
|
|||
|
|
@ -221,5 +221,17 @@ ENUM_ELEMENT(EVENT_DUMMY_HOST_WAKEUP_SIGNAL, 0x0001),
|
|||
ENUM_ELEMENT(EVENT_CHANNEL_SWITCH_REGINFO, 0x00A5),
|
||||
#endif
|
||||
|
||||
ENUM_ELEMENT(EVENT_EMERGENCY_TEMP_REACHED, 0x00A9),
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Event ID: Agiled Channel Switch report */
|
||||
ENUM_ELEMENT(EVENT_AGCS_REPORT, 0x00AA),
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#if defined(PCIE) || defined(SDIO)
|
||||
/** Card Event definition : In Band reset triggered by FW */
|
||||
ENUM_ELEMENT(EVENT_FW_IN_BAND_RESET, 0x00AD),
|
||||
#endif
|
||||
|
||||
/* Always keep this last */
|
||||
ENUM_ELEMENT_LAST(__HostEvent_Last)
|
||||
|
|
|
|||
|
|
@ -7399,6 +7399,20 @@ typedef MLAN_PACK_START struct _HostCmd_DS_CMD_NAV_MITIGATION_CFG {
|
|||
t_u16 stop_cnt;
|
||||
} MLAN_PACK_END HostCmd_DS_CMD_NAV_MITIGATION_CFG;
|
||||
|
||||
/** HostCmd_CMD_NAV_MITIGATION_HW_CFG */
|
||||
typedef MLAN_PACK_START struct _HostCmd_DS_CMD_NavMitigationHw {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** start/stop nav mitigation */
|
||||
t_u16 start_nav_mitigation;
|
||||
/** Duration value in us to set as threshold in ACT_SET action */
|
||||
t_u16 duration_threshold;
|
||||
/** HOnoring duration threshold for NAV mitigation */
|
||||
t_u16 honoring_duration;
|
||||
/** TxOP duration threshold for NAV mitigation */
|
||||
t_u16 txop_duration_threshold;
|
||||
} MLAN_PACK_END HostCmd_DS_CMD_NavMitigationHwCfg;
|
||||
|
||||
typedef MLAN_PACK_START struct _HostCmd_DS_CMD_LED_CFG {
|
||||
t_u16 action;
|
||||
t_u8 enable;
|
||||
|
|
@ -7536,7 +7550,7 @@ typedef MLAN_PACK_START struct _HostCmd_CMD_802_11_STA_TX_RATE {
|
|||
|
||||
/** actual number of entries in array */
|
||||
t_u16 num_entries;
|
||||
} HostCmd_CMD_802_11_STA_TX_RATE;
|
||||
} MLAN_PACK_END HostCmd_CMD_802_11_STA_TX_RATE;
|
||||
|
||||
/** HostCmd_MCLIENT_SCHEDULE_CFG */
|
||||
typedef MLAN_PACK_START struct _HostCmd_MCLIENT_SCHEDULE_CFG {
|
||||
|
|
@ -7548,7 +7562,42 @@ typedef MLAN_PACK_START struct _HostCmd_MCLIENT_SCHEDULE_CFG {
|
|||
|
||||
/** enable PS mode change reporting */
|
||||
t_u8 ps_mode_change_report;
|
||||
} HostCmd_MCLIENT_SCHEDULE_CFG;
|
||||
} MLAN_PACK_END HostCmd_MCLIENT_SCHEDULE_CFG;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** HostCmd_DS_AGCS_CFG */
|
||||
typedef MLAN_PACK_START struct _HostCmd_DS_AGCS_CFG {
|
||||
/** action - get/set */
|
||||
t_u16 action;
|
||||
|
||||
/* BIT0 - Enable Agile channel switching in CarPlay
|
||||
* BIT1 - no specific interference type check, but only check Tx or Rx
|
||||
* throughput drop
|
||||
*/
|
||||
t_u32 features;
|
||||
|
||||
/* Adjust the weight of TX/RX average packet count */
|
||||
t_u8 avg_threshold_percentage;
|
||||
|
||||
/* The conservative amount of rx packet per second */
|
||||
t_u16 rx_min_pkt_count;
|
||||
|
||||
/* The conservative amount of tx packet per second */
|
||||
t_u16 tx_min_pkt_count;
|
||||
|
||||
/* Unit is ms */
|
||||
t_u32 sample_time;
|
||||
|
||||
/* The latest sampled windows size */
|
||||
t_u8 sample_count_window;
|
||||
|
||||
/* Continuous drop rapidly times */
|
||||
t_u8 continuous_hit_count;
|
||||
|
||||
/* Make sure a reasonable rate can be sustained. */
|
||||
t_s8 nf_margin;
|
||||
} MLAN_PACK_END HostCmd_DS_AGCS_CFG;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/** HostCmd_DS_COMMAND */
|
||||
typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
||||
|
|
@ -7809,6 +7858,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
HostCmd_DS_CMD_OFDM_DESENSE_CFG ofdm_desense_cfg;
|
||||
HostCmd_DS_CMD_RX_ABORT_CFG_EXT rx_abort_cfg_ext;
|
||||
HostCmd_DS_CMD_NAV_MITIGATION_CFG nav_mitigation;
|
||||
HostCmd_DS_CMD_NavMitigationHwCfg nav_mitigation_hw;
|
||||
HostCmd_DS_CMD_LED_CFG ledcntrcfg;
|
||||
HostCmd_DS_CMD_TX_AMPDU_PROT_MODE tx_ampdu_prot_mode;
|
||||
HostCmd_DS_CMD_RATE_ADAPT_CFG rate_adapt_cfg;
|
||||
|
|
@ -7849,6 +7899,10 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
/** Auth, (Re)Assoc timeout configuration */
|
||||
HostCmd_DS_AUTH_ASSOC_TIMEOUT_CFG auth_assoc_cfg;
|
||||
t_u8 assoc_rsp_buf[ASSOC_RSP_BUF_SIZE];
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Agiled channel switch configuration */
|
||||
HostCmd_DS_AGCS_CFG agcs_cfg;
|
||||
#endif /* UAP_SUPPORT */
|
||||
} params;
|
||||
} MLAN_PACK_END HostCmd_DS_COMMAND, *pHostCmd_DS_COMMAND;
|
||||
|
||||
|
|
@ -7945,6 +7999,26 @@ typedef enum _BLOCK_6G_CHAN_SWITCH_REASON {
|
|||
BLOCK_6G_CHAN_SWITCH_REASON_STA_RX_ECSA = 4,
|
||||
} BLOCK_6G_CHAN_SWITCH_REASON;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** FW trigger the agiled channel switch */
|
||||
#define AGCS_TYPE_CS_TRIGGER 0
|
||||
/** FW send current channel statistics */
|
||||
#define AGCS_TYPE_STATS_REPORT 1
|
||||
|
||||
/* Fw agcs statistics structure */
|
||||
typedef MLAN_PACK_START struct _agcs_stats_info_t {
|
||||
/** This is STATS_REPORT or CS_TRIGGER */
|
||||
t_u16 type;
|
||||
/** Channel utilization in the last 100ms */
|
||||
t_u16 ch_load;
|
||||
/** noise in the last 100ms */
|
||||
t_s16 noise;
|
||||
/** nf_threshold is used to check the noise floor of candidate channels
|
||||
*/
|
||||
t_s16 nf_threshold;
|
||||
} MLAN_PACK_END agcs_stats_info_t;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#ifdef PRAGMA_PACK
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -481,5 +481,13 @@ ENUM_ELEMENT(HostCmd_CMD_GET_HW_SPEC, 0x0003),
|
|||
|
||||
/** Host Command ID : HS Event masking configuration */
|
||||
ENUM_ELEMENT(HostCmd_CMD_HS_EVENT_MASK, 0x028a),
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Host Command ID : Agiled channel switch configuration */
|
||||
ENUM_ELEMENT(HostCmd_CMD_APCMD_AGCS_CFG, 0x0293),
|
||||
#endif
|
||||
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAV_MITIGATION_HW_CFG, 0x0294),
|
||||
|
||||
/* Always keep this last */
|
||||
ENUM_ELEMENT_LAST(__HostCmd_CMD_Last)
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@ 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);
|
||||
|
|
|
|||
|
|
@ -393,7 +393,14 @@ enum _mlan_ioctl_req_id {
|
|||
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,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x0020009C,
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
MLAN_OID_MISC_NAV_MITIGATION_HW = 0x0020009D,
|
||||
};
|
||||
|
||||
/** Sub command size */
|
||||
|
|
@ -4912,6 +4919,17 @@ typedef struct _mlan_ds_misc_nav_mitigation {
|
|||
|
||||
} mlan_ds_misc_nav_mitigation;
|
||||
|
||||
typedef struct _mlan_ds_misc_nav_mitigation_hw {
|
||||
/** start/stop nav mitigation */
|
||||
t_u16 start_nav_mitigation;
|
||||
/** Duration value in us to set as threshold in ACT_SET action */
|
||||
t_u16 duration_threshold;
|
||||
/** HOnoring duration threshold for NAV mitigation */
|
||||
t_u16 honoring_duration;
|
||||
/** TxOP duration threshold for NAV mitigation */
|
||||
t_u16 txop_duration_threshold;
|
||||
} mlan_ds_misc_nav_mitigation_hw;
|
||||
|
||||
#define MAX_FW_STATES 6
|
||||
typedef struct _mlan_ds_led_behavior {
|
||||
t_u8 firmwarestate;
|
||||
|
|
@ -6567,6 +6585,33 @@ typedef struct _mlan_ds_auth_assoc_timeout_cfg {
|
|||
t_u16 retry_timeout;
|
||||
} mlan_ds_auth_assoc_timeout_cfg;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Agiled channel switch configuration parameters */
|
||||
typedef struct _mlan_ds_agcs_cfg {
|
||||
/**agcs cfg action 0-GET, 1-SET */
|
||||
t_u16 action;
|
||||
/* BIT0 - Enable Agile channel switching in CarPlay
|
||||
* BIT1 - no specific interference type check, but only check Tx or Rx
|
||||
* throughput drop
|
||||
*/
|
||||
t_u32 features;
|
||||
/* Adjust the weight of TX/RX average packet count */
|
||||
t_u8 avg_threshold_percentage;
|
||||
/* The requires at least average rx packets per second */
|
||||
t_u16 rx_min_pkt_count;
|
||||
/* The requires at least average tx packets per second */
|
||||
t_u16 tx_min_pkt_count;
|
||||
/* Unit is ms */
|
||||
t_u32 sample_time;
|
||||
/* The latest sampled windows size */
|
||||
t_u8 sample_count_window;
|
||||
/* Continuous drop rapidly times */
|
||||
t_u8 continuous_hit_count;
|
||||
/* Make sure a reasonable rate can be sustained. */
|
||||
t_s8 nf_margin;
|
||||
} mlan_ds_agcs_cfg;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */
|
||||
typedef struct _mlan_ds_misc_cfg {
|
||||
/** Sub-command */
|
||||
|
|
@ -6710,6 +6755,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_misc_ofdm_desense_cfg ofdm_desense_cfg;
|
||||
mlan_ds_misc_rx_abort_cfg_ext rx_abort_cfg_ext;
|
||||
mlan_ds_misc_nav_mitigation nav_mitigation;
|
||||
mlan_ds_misc_nav_mitigation_hw nav_mitigation_hw;
|
||||
mlan_ds_misc_led_cfg led_config;
|
||||
mlan_ds_misc_tx_ampdu_prot_mode tx_ampdu_prot_mode;
|
||||
mlan_ds_misc_rate_adapt_cfg rate_adapt_cfg;
|
||||
|
|
@ -6747,6 +6793,10 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_ed_mac_cfg edmac_cfg;
|
||||
mlan_ds_gpio_cfg_ops gpio_cfg_ops;
|
||||
mlan_ds_auth_assoc_timeout_cfg auth_assoc_cfg;
|
||||
#ifdef UAP_SUPPORT
|
||||
/** config AGCS for MLAN_OID_MISC_AGCS_CONFIG */
|
||||
mlan_ds_agcs_cfg agcs_cfg;
|
||||
#endif /* UAP_SUPPORT */
|
||||
} param;
|
||||
} mlan_ds_misc_cfg, *pmlan_ds_misc_cfg;
|
||||
|
||||
|
|
@ -6785,4 +6835,34 @@ typedef struct _mlan_cfpinfo {
|
|||
#define MLAN_REASON_CLASS3_FRAME_FROM_NOASSOC_STA 7
|
||||
#define MLAN_REASON_DISASSOC_STA_HAS_LEFT 8
|
||||
#define MLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Processing AGCS report */
|
||||
#define AGCS_EVENT_TYPE_PROCESS_EVENT 1
|
||||
/* After AGCS scan, select and switch to new channel */
|
||||
#define AGCS_EVENT_TYPE_SEL_CHANNEL 2
|
||||
|
||||
/** Type definition of agcs_stats for agcs_event */
|
||||
typedef struct _agcs_stats {
|
||||
/** All STAs support ECS */
|
||||
t_u8 all_sta_ecs;
|
||||
/** All STAs support 6g */
|
||||
t_u8 all_sta_6g;
|
||||
/** ch_load of current channel */
|
||||
t_u16 ch_load;
|
||||
/** noise of current channel */
|
||||
t_s16 noise;
|
||||
/** The noise floor threshold currently used by fw */
|
||||
t_s16 nf_threshold;
|
||||
} agcs_stats, *pagcs_stats;
|
||||
|
||||
/** Type definition of agcs_event for WOAL_EVENT_AGCS */
|
||||
typedef struct _agcs_event {
|
||||
/** AGCS_EVENT_TYPE_PROCESS_EVENT or AGCS_EVENT_TYPE_SEL_CHANNEL */
|
||||
t_u32 type;
|
||||
/** AGCS stats info */
|
||||
agcs_stats stats;
|
||||
} agcs_event, *pagcs_event;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#endif /* !_MLAN_IOCTL_H_ */
|
||||
|
|
|
|||
|
|
@ -1063,6 +1063,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
IEEEtypes_CapInfo_t *pcap_info;
|
||||
t_u8 ft_akm = 0;
|
||||
t_u8 oper_class;
|
||||
t_u8 global_oper_class;
|
||||
t_u8 oper_class_flag = MFALSE;
|
||||
t_u8 akm_type = 0;
|
||||
MrvlIEtypes_HostMlme_t *host_mlme_tlv = MNULL;
|
||||
|
|
@ -1473,7 +1474,8 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
pmpriv,
|
||||
pbss_desc->phy_param_set.ds_param_set
|
||||
.current_chan,
|
||||
pbss_desc->curr_bandwidth, &oper_class))
|
||||
pbss_desc->curr_bandwidth, &oper_class,
|
||||
&global_oper_class))
|
||||
wlan_add_supported_oper_class_ie(pmpriv, &pos,
|
||||
oper_class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1651,8 +1651,6 @@ struct _sta_node {
|
|||
IEEEtypes_HTInfo_t HTInfo;
|
||||
/** peer BSSCO_20_40*/
|
||||
IEEEtypes_2040BSSCo_t BSSCO_20_40;
|
||||
/*Extended capability*/
|
||||
IEEEtypes_ExtCap_t ExtCap;
|
||||
/*RSN IE*/
|
||||
IEEEtypes_Generic_t rsn_ie;
|
||||
/**Link ID*/
|
||||
|
|
@ -1684,6 +1682,10 @@ struct _sta_node {
|
|||
t_u8 vendor_oui[VENDOR_OUI_LEN * MAX_VENDOR_OUI_NUM];
|
||||
/** vendor OUI count */
|
||||
t_u8 vendor_oui_count;
|
||||
/* Support operating class IE */
|
||||
IEEEtypes_Generic_t OperClass;
|
||||
/*Extended capability*/
|
||||
IEEEtypes_ExtCap_t ExtCap;
|
||||
};
|
||||
|
||||
/** 802.11h State information kept in the 'mlan_adapter' driver structure */
|
||||
|
|
@ -2072,6 +2074,7 @@ typedef struct _mlan_init_para {
|
|||
t_u32 reject_addba_req;
|
||||
t_u8 disable_11h_tpc;
|
||||
t_u8 tpe_ie_ignore;
|
||||
t_u32 amsdu_disable;
|
||||
} mlan_init_para, *pmlan_init_para;
|
||||
|
||||
#ifdef SDIO
|
||||
|
|
@ -3109,7 +3112,7 @@ struct _mlan_adapter {
|
|||
/** LLDE enable/disable */
|
||||
t_u8 llde_enabled;
|
||||
/** LLDE modes 0 - default; 1 - carplay; 2 - gameplay; 3 - sound bar, 4
|
||||
* <EFBFBD> validation, 5- event driven */
|
||||
* - 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 */
|
||||
|
|
@ -3125,6 +3128,10 @@ struct _mlan_adapter {
|
|||
/** iPhone device list */
|
||||
t_u8 llde_iphonefilters[MAX_IPHONE_FILTER_ENTRIES *
|
||||
MLAN_MAC_ADDR_LENGTH];
|
||||
#ifdef UAP_SUPPORT
|
||||
/** agiled channel switch info */
|
||||
agcs_stats agcs_info;
|
||||
#endif /* UAP_SUPPORT */
|
||||
};
|
||||
|
||||
/** IPv4 ARP request header */
|
||||
|
|
@ -3997,6 +4004,9 @@ mlan_status wlan_cmd_rxabortcfg_ext(pmlan_private pmpriv,
|
|||
mlan_status wlan_cmd_nav_mitigation(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
|
||||
t_void *pdata_buf);
|
||||
mlan_status wlan_cmd_nav_mitigation_hw(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
mlan_status wlan_cmd_led_config(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
mlan_status wlan_ret_rxabortcfg_ext(pmlan_private pmpriv,
|
||||
|
|
@ -4005,6 +4015,9 @@ mlan_status wlan_ret_rxabortcfg_ext(pmlan_private pmpriv,
|
|||
mlan_status wlan_ret_nav_mitigation(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
mlan_status wlan_ret_nav_mitigation_hw(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
mlan_status wlan_ret_led_config(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
mlan_status wlan_cmd_tx_ampdu_prot_mode(pmlan_private pmpriv,
|
||||
|
|
@ -4055,6 +4068,8 @@ mlan_status wlan_misc_ioctl_rxabortcfg_ext(pmlan_adapter pmadapter,
|
|||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_nav_mitigation(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_nav_mitigation_hw(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_led(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_tx_ampdu_prot_mode(pmlan_adapter pmadapter,
|
||||
|
|
@ -4528,7 +4543,8 @@ mlan_status wlan_ret_boot_sleep(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
int wlan_add_supported_oper_class_ie(mlan_private *pmpriv, t_u8 **pptlv_out,
|
||||
t_u8 curr_oper_class);
|
||||
mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
|
||||
t_u8 bw, t_u8 *oper_class);
|
||||
t_u8 bw, t_u8 *oper_class,
|
||||
t_u8 *global_oper_class);
|
||||
mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
|
||||
t_u8 oper_class, t_u8 bandwidth);
|
||||
mlan_status wlan_misc_ioctl_operclass_validation(pmlan_adapter pmadapter,
|
||||
|
|
@ -4885,6 +4901,12 @@ typedef enum _delay_unit {
|
|||
SEC,
|
||||
} t_delay_unit;
|
||||
|
||||
enum tls_message_id {
|
||||
TLS_HOST_HELLO = 1,
|
||||
TLS_DEVICE_HELLO = 2,
|
||||
TLS_HOST_FINISHED = 3,
|
||||
};
|
||||
|
||||
/** delay function */
|
||||
t_void wlan_delay_func(mlan_adapter *pmadapter, t_u32 delay, t_delay_unit u);
|
||||
|
||||
|
|
|
|||
|
|
@ -4168,6 +4168,8 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
|
|||
(MrvlIEtypesHeader_t *)(pevent->pbuf + pevent->data_offset +
|
||||
ASSOC_EVENT_FIX_SIZE);
|
||||
MrvlIETypes_MgmtFrameSet_t *mgmt_tlv = MNULL;
|
||||
IEEEtypes_ExtCap_t *pExtCap = MNULL;
|
||||
IEEEtypes_Generic_t *pOperClass = MNULL;
|
||||
|
||||
ENTER();
|
||||
while (tlv_buf_left >= (int)sizeof(MrvlIEtypesHeader_t)) {
|
||||
|
|
@ -4363,6 +4365,57 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
|
|||
priv->adapter, assoc_req_ie, ie_len,
|
||||
&sta_ptr->multi_ap_ie);
|
||||
#endif
|
||||
pExtCap = (IEEEtypes_ExtCap_t *)
|
||||
wlan_get_specific_ie(priv, assoc_req_ie,
|
||||
ie_len,
|
||||
EXT_CAPABILITY, 0);
|
||||
if (pExtCap) {
|
||||
memcpy_ext(
|
||||
priv->adapter,
|
||||
(t_u8 *)&sta_ptr->ExtCap,
|
||||
pExtCap,
|
||||
pExtCap->ieee_hdr.len +
|
||||
sizeof(IEEEtypes_Header_t),
|
||||
sizeof(IEEEtypes_ExtCap_t));
|
||||
sta_ptr->ExtCap.ieee_hdr.len = MIN(
|
||||
pExtCap->ieee_hdr.len,
|
||||
sizeof(IEEEtypes_ExtCap_t) -
|
||||
sizeof(IEEEtypes_Header_t));
|
||||
PRINTM(MCMND,
|
||||
"Check STA capab mac_addr" MACSTR
|
||||
" ExtChanSwitching:%d\n",
|
||||
MAC2STR(sta_ptr->mac_addr),
|
||||
sta_ptr->ExtCap.ext_cap
|
||||
.ExtChanSwitching);
|
||||
} else {
|
||||
PRINTM(MCMND,
|
||||
"STA doesn't support EXT_CAPABILITY\n");
|
||||
}
|
||||
|
||||
pOperClass = (IEEEtypes_Generic_t *)
|
||||
wlan_get_specific_ie(priv, assoc_req_ie,
|
||||
ie_len,
|
||||
REGULATORY_CLASS,
|
||||
0);
|
||||
if (pOperClass) {
|
||||
memcpy_ext(
|
||||
priv->adapter,
|
||||
(t_u8 *)&sta_ptr->OperClass,
|
||||
pOperClass,
|
||||
pOperClass->ieee_hdr.len +
|
||||
sizeof(MrvlIEtypesHeader_t),
|
||||
sizeof(IEEEtypes_Generic_t));
|
||||
sta_ptr->OperClass.ieee_hdr.len = MIN(
|
||||
pOperClass->ieee_hdr.len,
|
||||
sizeof(IEEEtypes_Generic_t) -
|
||||
sizeof(IEEEtypes_Header_t));
|
||||
PRINTM(MCMND,
|
||||
"Check STA capab OperClass:%d",
|
||||
sta_ptr->OperClass.data[0]);
|
||||
} else {
|
||||
PRINTM(MCMND,
|
||||
"STA doesn't support REGULATORY_CLASS\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -7284,7 +7337,7 @@ mlan_status wlan_misc_ioctl_oper_class(pmlan_adapter pmadapter,
|
|||
{
|
||||
pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
t_u8 channel, bandwidth, oper_class = 0;
|
||||
t_u8 channel, bandwidth, oper_class = 0, global_oper_class = 0;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
|
|
@ -7308,7 +7361,7 @@ mlan_status wlan_misc_ioctl_oper_class(pmlan_adapter pmadapter,
|
|||
|
||||
if (pioctl_req->action == MLAN_ACT_GET) {
|
||||
ret = wlan_get_curr_oper_class(pmpriv, channel, bandwidth,
|
||||
&oper_class);
|
||||
&oper_class, &global_oper_class);
|
||||
misc->param.bw_chan_oper.oper_class = oper_class;
|
||||
} else {
|
||||
PRINTM(MERROR, "Unsupported cmd_action\n");
|
||||
|
|
@ -7690,6 +7743,38 @@ mlan_status wlan_misc_ioctl_nav_mitigation(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief HW based nav mitigation parameter
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pioctl_req A pointer to ioctl request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_PENDING --success, otherwise fail
|
||||
*/
|
||||
mlan_status wlan_misc_ioctl_nav_mitigation_hw(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
mlan_ds_misc_cfg *pmisc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
|
||||
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;
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_NAV_MITIGATION_HW_CFG,
|
||||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
&(pmisc->param.nav_mitigation_hw));
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief led config parameter
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1943,6 +1943,7 @@ static mlan_status wlan_scan_setup_scan_config(
|
|||
if (pmpriv->adapter->ecsa_enable) {
|
||||
t_u8 bandwidth = BW_20MHZ;
|
||||
t_u8 oper_class = 1;
|
||||
t_u8 global_oper_class = 0;
|
||||
t_u32 usr_dot_11n_dev_cap;
|
||||
if (pmpriv->media_connected) {
|
||||
if (pmpriv->config_bands & BAND_A)
|
||||
|
|
@ -1961,7 +1962,7 @@ static mlan_status wlan_scan_setup_scan_config(
|
|||
wlan_get_curr_oper_class(
|
||||
pmpriv,
|
||||
pmpriv->curr_bss_params.bss_descriptor.channel,
|
||||
bandwidth, &oper_class);
|
||||
bandwidth, &oper_class, &global_oper_class);
|
||||
}
|
||||
wlan_add_supported_oper_class_ie(pmpriv, &ptlv_pos, oper_class);
|
||||
}
|
||||
|
|
@ -8692,6 +8693,7 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
|
|||
t_u8 bandwidth = BW_20MHZ;
|
||||
t_u8 oper_class = 1;
|
||||
t_u32 usr_dot_11n_dev_cap;
|
||||
t_u8 global_oper_class = 0;
|
||||
if (pmpriv->media_connected) {
|
||||
if (pmpriv->config_bands & BAND_A)
|
||||
usr_dot_11n_dev_cap =
|
||||
|
|
@ -8709,7 +8711,7 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
|
|||
wlan_get_curr_oper_class(
|
||||
pmpriv,
|
||||
pmpriv->curr_bss_params.bss_descriptor.channel,
|
||||
bandwidth, &oper_class);
|
||||
bandwidth, &oper_class, &global_oper_class);
|
||||
}
|
||||
len = wlan_add_supported_oper_class_ie(pmpriv, &tlv,
|
||||
oper_class);
|
||||
|
|
|
|||
|
|
@ -479,6 +479,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
|
|||
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->init_para.amsdu_disable = pmdevice->amsdu_disable;
|
||||
pmadapter->priv_num = 0;
|
||||
pmadapter->priv[0] = MNULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -4428,6 +4428,10 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_cmd_nav_mitigation(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_NAV_MITIGATION_HW_CFG:
|
||||
ret = wlan_cmd_nav_mitigation_hw(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_LED_CONTROL:
|
||||
ret = wlan_cmd_led_config(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
|
@ -4497,6 +4501,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_cmd_auth_assoc_timeout_cfg(pmpriv, cmd_ptr,
|
||||
cmd_action, pdata_buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
|
@ -4552,7 +4557,10 @@ mlan_status wlan_ops_sta_init_cmd(t_void *priv, t_u8 first_bss)
|
|||
}
|
||||
|
||||
memset(pmpriv->adapter, &amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl));
|
||||
amsdu_aggr_ctrl.enable = MLAN_ACT_ENABLE;
|
||||
if (pmpriv->adapter->init_para.amsdu_disable)
|
||||
amsdu_aggr_ctrl.enable = MLAN_ACT_DISABLE;
|
||||
else
|
||||
amsdu_aggr_ctrl.enable = MLAN_ACT_ENABLE;
|
||||
/* Send request to firmware */
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_AMSDU_AGGR_CTRL,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL,
|
||||
|
|
|
|||
|
|
@ -3758,6 +3758,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_NAV_MITIGATION_CFG:
|
||||
ret = wlan_ret_nav_mitigation(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_NAV_MITIGATION_HW_CFG:
|
||||
ret = wlan_ret_nav_mitigation_hw(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_LED_CONTROL:
|
||||
ret = wlan_ret_led_config(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1558,6 +1558,16 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
PRINTM(MEVENT, "EVENT: EVENT_IMD3_CAL_END\n");
|
||||
break;
|
||||
|
||||
case EVENT_EMERGENCY_TEMP_REACHED:
|
||||
PRINTM(MEVENT, "EVENT: EVENT_EMERGENCY_TEMP_REACHED\n");
|
||||
|
||||
pevent->event_id = MLAN_EVENT_ID_EMERGENCY_TEMP_REACHED;
|
||||
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);
|
||||
wlan_recv_event(pmpriv, pevent->event_id, pevent);
|
||||
break;
|
||||
case EVENT_DPD_CAL:
|
||||
wlan_process_dpd_cal_event(pmpriv, pmbuf);
|
||||
break;
|
||||
|
|
@ -1573,6 +1583,13 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
pmpriv->rx_quality = wlan_le16_to_cpu(cfg_cmd->rx_quality);
|
||||
break;
|
||||
}
|
||||
#if defined(PCIE) || defined(SDIO)
|
||||
case EVENT_FW_IN_BAND_RESET:
|
||||
DBG_HEXDUMP(MCMD_D, "EVENT_FW_IN_BAND_RESET",
|
||||
pmbuf->pbuf + pmbuf->data_offset, pmbuf->data_len);
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
|
||||
break;
|
||||
#endif
|
||||
case EVENT_CHANNEL_SWITCH_REGINFO:
|
||||
PRINTM(MEVENT, "EVENT: Channel Switch Reginfo (%#x)\n",
|
||||
eventcause);
|
||||
|
|
|
|||
|
|
@ -5306,6 +5306,10 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_MISC_NAV_MITIGATION:
|
||||
status = wlan_misc_ioctl_nav_mitigation(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_NAV_MITIGATION_HW:
|
||||
status = wlan_misc_ioctl_nav_mitigation_hw(pmadapter,
|
||||
pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_LED_CONFIG:
|
||||
status = wlan_misc_ioctl_led(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1621,6 +1621,7 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
|
|||
MrvlIEtypes_chan_bw_oper_t *poper_class_tlv = MNULL;
|
||||
t_u8 length = 0;
|
||||
t_u8 curr_oper_class = 1;
|
||||
t_u8 global_oper_class = 0;
|
||||
t_u8 *oper_class_ie = (t_u8 *)sys_config->tlv_buffer;
|
||||
t_u16 i = 0;
|
||||
t_u8 ac = 0;
|
||||
|
|
@ -1808,7 +1809,7 @@ static mlan_status wlan_uap_cmd_sys_configure(pmlan_private pmpriv,
|
|||
poper_class_tlv->ds_chan_bw_oper.channel,
|
||||
poper_class_tlv->ds_chan_bw_oper
|
||||
.bandwidth,
|
||||
&curr_oper_class);
|
||||
&curr_oper_class, &global_oper_class);
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MERROR,
|
||||
"Can not get current oper class! bandwidth = %d, channel = %d\n",
|
||||
|
|
@ -5040,6 +5041,238 @@ static mlan_status wlan_ret_stats(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of uap agcs config
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param resp A pointer to HostCmd_DS_COMMAND
|
||||
* @param pioctl_buf A pointer to mlan_ioctl_req structure
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static mlan_status wlan_uap_ret_agcs_cfg(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf)
|
||||
{
|
||||
HostCmd_DS_AGCS_CFG *pcmd_agcs_cfg =
|
||||
(HostCmd_DS_AGCS_CFG *)&resp->params.agcs_cfg;
|
||||
mlan_ds_misc_cfg *misc_cfg = MNULL;
|
||||
mlan_ds_agcs_cfg *pagcs_cfg = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_buf && pioctl_buf->action == MLAN_ACT_GET) {
|
||||
misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
|
||||
pagcs_cfg = (mlan_ds_agcs_cfg *)&misc_cfg->param.agcs_cfg;
|
||||
pagcs_cfg->features = wlan_le32_to_cpu(pcmd_agcs_cfg->features);
|
||||
pagcs_cfg->avg_threshold_percentage =
|
||||
pcmd_agcs_cfg->avg_threshold_percentage;
|
||||
pagcs_cfg->rx_min_pkt_count =
|
||||
wlan_le16_to_cpu(pcmd_agcs_cfg->rx_min_pkt_count);
|
||||
pagcs_cfg->tx_min_pkt_count =
|
||||
wlan_le16_to_cpu(pcmd_agcs_cfg->tx_min_pkt_count);
|
||||
pagcs_cfg->sample_time =
|
||||
wlan_le32_to_cpu(pcmd_agcs_cfg->sample_time);
|
||||
pagcs_cfg->sample_count_window =
|
||||
pcmd_agcs_cfg->sample_count_window;
|
||||
pagcs_cfg->continuous_hit_count =
|
||||
pcmd_agcs_cfg->continuous_hit_count;
|
||||
pagcs_cfg->nf_margin = pcmd_agcs_cfg->nf_margin;
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of AGCS_CFG
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param cmd A pointer to HostCmd_DS_COMMAND structure
|
||||
* @param cmd_action
|
||||
* @param pdata_buf A pointer to data buffer
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
static mlan_status wlan_cmd_apcmd_agcs_cfg(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf)
|
||||
{
|
||||
HostCmd_DS_AGCS_CFG *pcmd_agcs_cfg =
|
||||
(HostCmd_DS_AGCS_CFG *)&cmd->params.agcs_cfg;
|
||||
mlan_ds_agcs_cfg *pagcs_cfg = (mlan_ds_agcs_cfg *)pdata_buf;
|
||||
ENTER();
|
||||
|
||||
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_APCMD_AGCS_CFG);
|
||||
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_CMD_APCMD_AGCS_CFG) +
|
||||
S_DS_GEN + sizeof(HostCmd_DS_AGCS_CFG));
|
||||
|
||||
pcmd_agcs_cfg->action = wlan_cpu_to_le16(cmd_action);
|
||||
pcmd_agcs_cfg->features = wlan_cpu_to_le32(pagcs_cfg->features);
|
||||
pcmd_agcs_cfg->avg_threshold_percentage =
|
||||
pagcs_cfg->avg_threshold_percentage;
|
||||
pcmd_agcs_cfg->rx_min_pkt_count =
|
||||
wlan_cpu_to_le32(pagcs_cfg->rx_min_pkt_count);
|
||||
pcmd_agcs_cfg->tx_min_pkt_count =
|
||||
wlan_cpu_to_le32(pagcs_cfg->tx_min_pkt_count);
|
||||
pcmd_agcs_cfg->sample_time = wlan_cpu_to_le32(pagcs_cfg->sample_time);
|
||||
pcmd_agcs_cfg->sample_count_window = pagcs_cfg->sample_count_window;
|
||||
pcmd_agcs_cfg->continuous_hit_count = pagcs_cfg->continuous_hit_count;
|
||||
pcmd_agcs_cfg->nf_margin = pagcs_cfg->nf_margin;
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handle the agiled cs event
|
||||
*
|
||||
* @param priv A pointer to mlan_private structure
|
||||
* @param pbuf A pointer to mlan_buffer which has event content.
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static mlan_status wlan_process_agcs_event(pmlan_private priv,
|
||||
pmlan_buffer pmbuf)
|
||||
{
|
||||
pmlan_adapter pmadapter = priv->adapter;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
t_u8 *evt_buf = MNULL;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
pmlan_event pevent;
|
||||
pagcs_event pacs_start_event = MNULL;
|
||||
agcs_stats_info_t *stats = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
stats = (agcs_stats_info_t *)(pmbuf->pbuf + pmbuf->data_offset +
|
||||
sizeof(t_u32));
|
||||
|
||||
if (stats->type == AGCS_TYPE_STATS_REPORT) {
|
||||
PRINTM(MMSG,
|
||||
"AGCS stats report ch_load=%d, noise=%d, nf_threshold=%d",
|
||||
stats->ch_load, stats->noise, stats->nf_threshold);
|
||||
goto done;
|
||||
} else if (stats->type == AGCS_TYPE_CS_TRIGGER) {
|
||||
/* Allocate memory for event buffer */
|
||||
status = pcb->moal_malloc(pmadapter->pmoal_handle,
|
||||
MAX_EVENT_SIZE, MLAN_MEM_DEF,
|
||||
&evt_buf);
|
||||
if ((status == MLAN_STATUS_SUCCESS) && evt_buf) {
|
||||
sta_node *sta_ptr;
|
||||
t_u8 oper_class = 0;
|
||||
t_u8 global_oper_class = 0;
|
||||
t_u8 bandwidth;
|
||||
|
||||
if (wlan_is_station_list_empty(priv)) {
|
||||
PRINTM(MERROR, "Not found any connected STA");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
sta_ptr = (sta_node *)util_peek_list(
|
||||
priv->adapter->pmoal_handle, &priv->sta_list,
|
||||
priv->adapter->callbacks.moal_spin_lock,
|
||||
priv->adapter->callbacks.moal_spin_unlock);
|
||||
if (!sta_ptr) {
|
||||
PRINTM(MERROR, "Not found any connected STA");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
pevent = (pmlan_event)evt_buf;
|
||||
pacs_start_event = (pagcs_event)pevent->event_buf;
|
||||
pacs_start_event->type = AGCS_EVENT_TYPE_PROCESS_EVENT;
|
||||
pacs_start_event->stats.ch_load =
|
||||
(t_u16)wlan_le16_to_cpu(stats->ch_load);
|
||||
pacs_start_event->stats.noise =
|
||||
(t_s16)wlan_le16_to_cpu(stats->noise);
|
||||
pacs_start_event->stats.nf_threshold =
|
||||
(t_s16)wlan_le16_to_cpu(stats->nf_threshold);
|
||||
pacs_start_event->stats.all_sta_ecs = MTRUE;
|
||||
pacs_start_event->stats.all_sta_6g = MTRUE;
|
||||
switch (priv->uap_bandwidth) {
|
||||
case CHAN_BW_20MHZ:
|
||||
bandwidth = BW_20MHZ;
|
||||
break;
|
||||
case CHAN_BW_40MHZ:
|
||||
bandwidth = BW_40MHZ;
|
||||
break;
|
||||
case CHAN_BW_80MHZ:
|
||||
bandwidth = BW_80MHZ;
|
||||
break;
|
||||
default:
|
||||
bandwidth = BW_20MHZ;
|
||||
break;
|
||||
}
|
||||
|
||||
wlan_get_curr_oper_class(priv, priv->uap_channel,
|
||||
bandwidth, &oper_class,
|
||||
&global_oper_class);
|
||||
while (sta_ptr &&
|
||||
(sta_ptr != (sta_node *)&priv->sta_list)) {
|
||||
PRINTM(MCMND,
|
||||
"AGCS sta mac_addr" MACSTR
|
||||
" ExtChanSwitching:%d is_11ax_enabled:%d OperClass:%d\n",
|
||||
MAC2STR(sta_ptr->mac_addr),
|
||||
sta_ptr->ExtCap.ext_cap.ExtChanSwitching,
|
||||
sta_ptr->is_11ax_enabled,
|
||||
sta_ptr->OperClass.data[0]);
|
||||
|
||||
if ((sta_ptr->ExtCap.ext_cap.ExtChanSwitching ==
|
||||
0) &&
|
||||
(global_oper_class != 128)) {
|
||||
pacs_start_event->stats.all_sta_ecs =
|
||||
MFALSE;
|
||||
}
|
||||
if (sta_ptr->is_11ax_enabled == 0) {
|
||||
pacs_start_event->stats.all_sta_6g =
|
||||
MFALSE;
|
||||
} else {
|
||||
int i;
|
||||
t_bool t_support_6g = MFALSE;
|
||||
|
||||
for (i = 0;
|
||||
i <
|
||||
sta_ptr->OperClass.ieee_hdr.len;
|
||||
i++) {
|
||||
if (is_6ghz_op_class(
|
||||
sta_ptr->OperClass
|
||||
.data[i]) ==
|
||||
MTRUE) {
|
||||
t_support_6g = MTRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pacs_start_event->stats.all_sta_6g &=
|
||||
t_support_6g;
|
||||
}
|
||||
sta_ptr = sta_ptr->pnext;
|
||||
}
|
||||
PRINTM(MCMND, "AGCS all_sta_ecs:%d all_sta_6g:%d",
|
||||
pacs_start_event->stats.all_sta_ecs,
|
||||
pacs_start_event->stats.all_sta_6g);
|
||||
|
||||
/* Send event to moal */
|
||||
pevent->bss_index = priv->bss_index;
|
||||
pevent->event_id = MLAN_EVENT_ID_FW_AGCS_TRIGGER;
|
||||
/* Event length is the agcs_event length in byte */
|
||||
pevent->event_len = sizeof(agcs_event);
|
||||
/* keep agcs_info in pmadapter */
|
||||
memcpy_ext(pmadapter, &pmadapter->agcs_info,
|
||||
&pacs_start_event->stats, sizeof(agcs_stats),
|
||||
sizeof(agcs_stats));
|
||||
status =
|
||||
wlan_recv_event(priv, pevent->event_id, pevent);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
if (evt_buf)
|
||||
pcb->moal_mfree(pmadapter->pmoal_handle, evt_buf);
|
||||
|
||||
LEAVE();
|
||||
return status;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global Functions
|
||||
********************************************************/
|
||||
|
|
@ -5426,6 +5659,10 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_cmd_nav_mitigation(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_NAV_MITIGATION_HW_CFG:
|
||||
ret = wlan_cmd_nav_mitigation_hw(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_LED_CONTROL:
|
||||
ret = wlan_cmd_led_config(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
|
@ -5514,6 +5751,11 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
cmd_action, pdata_buf);
|
||||
break;
|
||||
|
||||
case HostCmd_CMD_APCMD_AGCS_CFG:
|
||||
ret = wlan_cmd_apcmd_agcs_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no);
|
||||
if (pioctl_req)
|
||||
|
|
@ -5897,6 +6139,9 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_NAV_MITIGATION_CFG:
|
||||
ret = wlan_ret_nav_mitigation(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_NAV_MITIGATION_HW_CFG:
|
||||
ret = wlan_ret_nav_mitigation_hw(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_LED_CONTROL:
|
||||
ret = wlan_ret_led_config(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
|
@ -5983,6 +6228,10 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_MCLIENT_SCHEDULE_CFG:
|
||||
break;
|
||||
|
||||
case HostCmd_CMD_APCMD_AGCS_CFG:
|
||||
ret = wlan_uap_ret_agcs_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINTM(MERROR, "CMD_RESP: Unknown command response %#x\n",
|
||||
resp->command);
|
||||
|
|
@ -6467,6 +6716,14 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
|
|||
*/
|
||||
break;
|
||||
|
||||
#if defined(PCIE) || defined(SDIO)
|
||||
case EVENT_FW_IN_BAND_RESET:
|
||||
DBG_HEXDUMP(MCMD_D, "EVENT_FW_IN_BAND_RESET",
|
||||
pmbuf->pbuf + pmbuf->data_offset, pmbuf->data_len);
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EVENT_CHAN_SWITCH_TO_6G_BLOCK:
|
||||
reason_code = wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
|
||||
pmbuf->data_offset +
|
||||
|
|
@ -6582,6 +6839,11 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
|
|||
wlan_process_sta_ps_change_event(priv, pmbuf);
|
||||
break;
|
||||
|
||||
case EVENT_AGCS_REPORT:
|
||||
PRINTM(MEVENT, "EVENT: AGCS report\n");
|
||||
wlan_process_agcs_event(priv, pmbuf);
|
||||
break;
|
||||
|
||||
default:
|
||||
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -2026,6 +2026,43 @@ static mlan_status wlan_uap_snmp_mib_chan_track(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get/set Agiled channel switch cfg
|
||||
*
|
||||
* @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_uap_agcs_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;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
|
||||
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_AGCS_CFG, cmd_action,
|
||||
0, (t_void *)pioctl_req,
|
||||
(t_void *)&misc->param.agcs_cfg);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MLAN uap ioctl handler
|
||||
*
|
||||
|
|
@ -2357,6 +2394,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
else if (misc->sub_command == MLAN_OID_MISC_NAV_MITIGATION)
|
||||
status = wlan_misc_ioctl_nav_mitigation(pmadapter,
|
||||
pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_NAV_MITIGATION_HW)
|
||||
status = wlan_misc_ioctl_nav_mitigation_hw(pmadapter,
|
||||
pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_LED_CONFIG)
|
||||
status = wlan_misc_ioctl_led(pmadapter, pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_TX_AMPDU_PROT_MODE)
|
||||
|
|
@ -2432,6 +2472,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
status = wlan_misc_csi(pmadapter, pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_MULTI_AP_CFG)
|
||||
status = wlan_misc_multi_ap_cfg(pmadapter, pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_AGCS_CONFIG)
|
||||
status = wlan_uap_agcs_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_IOCTL_POWER_CFG:
|
||||
power = (mlan_ds_power_cfg *)pioctl_req->pbuf;
|
||||
|
|
|
|||
|
|
@ -2747,8 +2747,13 @@ t_void wlan_wmm_init(pmlan_adapter pmadapter)
|
|||
}
|
||||
#endif
|
||||
priv->user_rxwinsize = priv->add_ba_param.rx_win_size;
|
||||
priv->add_ba_param.tx_amsdu = MTRUE;
|
||||
priv->add_ba_param.rx_amsdu = MTRUE;
|
||||
if (pmadapter->init_para.amsdu_disable) {
|
||||
priv->add_ba_param.tx_amsdu = MFALSE;
|
||||
priv->add_ba_param.rx_amsdu = MFALSE;
|
||||
} else {
|
||||
priv->add_ba_param.tx_amsdu = MTRUE;
|
||||
priv->add_ba_param.rx_amsdu = MTRUE;
|
||||
}
|
||||
memset(priv->adapter, priv->rx_seq, 0xff,
|
||||
sizeof(priv->rx_seq));
|
||||
wlan_wmm_default_queue_priorities(priv);
|
||||
|
|
|
|||
|
|
@ -780,6 +780,29 @@ typedef struct _assoc_logger {
|
|||
#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9)
|
||||
#define SCAN_STATE_SCAN_COMPLETE MBIT(10)
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Agiled channel switch state */
|
||||
typedef enum _agcs_state {
|
||||
/** AGCS is desabled */
|
||||
AGCS_STATE_IDLE = 0,
|
||||
/** AGCS is enabled */
|
||||
AGCS_STATE_START = 1,
|
||||
/**When FW sends AGCS event to notify the driver to prepare for channel
|
||||
switch.*/
|
||||
AGCS_STATE_TRIGGERED = 2,
|
||||
/** Start to scan the candidate channels */
|
||||
AGCS_STATE_IN_SCAN = 3,
|
||||
/** Receives the scan report */
|
||||
AGCS_STATE_SCAN_REPORT = 4,
|
||||
/** All candidate channels scanned done */
|
||||
AGCS_STATE_SCAN_DONE = 5,
|
||||
/** Start Channel Switch */
|
||||
AGCS_STATE_CSA_START = 6,
|
||||
/** Channel Switch Completed */
|
||||
AGCS_STATE_COMPLETE = 7,
|
||||
} agcs_state;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#ifdef USB
|
||||
/** mlan_usb_ep */
|
||||
typedef enum _mlan_usb_ep {
|
||||
|
|
@ -878,6 +901,10 @@ typedef enum _mlan_event_id {
|
|||
#endif /* SSU_SUPPORT */
|
||||
MLAN_EVENT_ID_CSI = 0x00000040,
|
||||
MLAN_EVENT_ID_FW_TX_BULK_STATUS = 0x00000043,
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Agiled channel switch triggered */
|
||||
MLAN_EVENT_ID_FW_AGCS_TRIGGER = 0x00000044,
|
||||
#endif /* UAP_SUPPORT */
|
||||
/* Event generated by MLAN driver (MSB=1) */
|
||||
MLAN_EVENT_ID_DRV_CONNECTED = 0x80000001,
|
||||
MLAN_EVENT_ID_DRV_DEFER_HANDLING = 0x80000002,
|
||||
|
|
@ -920,6 +947,7 @@ typedef enum _mlan_event_id {
|
|||
MLAN_EVENT_ID_FW_CHAN_SWITCH_REGINFO = 0x80000038,
|
||||
#endif
|
||||
MLAN_EVENT_ID_DRV_ASSOC_FAILURE = 0x80000039,
|
||||
MLAN_EVENT_ID_EMERGENCY_TEMP_REACHED = 0x80000040,
|
||||
} mlan_event_id;
|
||||
|
||||
/** Data Structures */
|
||||
|
|
@ -2883,6 +2911,7 @@ typedef struct _mlan_device {
|
|||
t_u8 mclient_scheduling;
|
||||
t_u8 disable_11h_tpc;
|
||||
t_u8 tpe_ie_ignore;
|
||||
t_u32 amsdu_disable;
|
||||
} mlan_device, *pmlan_device;
|
||||
|
||||
/** MLAN API function prototype */
|
||||
|
|
|
|||
|
|
@ -393,7 +393,14 @@ enum _mlan_ioctl_req_id {
|
|||
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,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x0020009C,
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
MLAN_OID_MISC_NAV_MITIGATION_HW = 0x0020009D,
|
||||
};
|
||||
|
||||
/** Sub command size */
|
||||
|
|
@ -4912,6 +4919,17 @@ typedef struct _mlan_ds_misc_nav_mitigation {
|
|||
|
||||
} mlan_ds_misc_nav_mitigation;
|
||||
|
||||
typedef struct _mlan_ds_misc_nav_mitigation_hw {
|
||||
/** start/stop nav mitigation */
|
||||
t_u16 start_nav_mitigation;
|
||||
/** Duration value in us to set as threshold in ACT_SET action */
|
||||
t_u16 duration_threshold;
|
||||
/** HOnoring duration threshold for NAV mitigation */
|
||||
t_u16 honoring_duration;
|
||||
/** TxOP duration threshold for NAV mitigation */
|
||||
t_u16 txop_duration_threshold;
|
||||
} mlan_ds_misc_nav_mitigation_hw;
|
||||
|
||||
#define MAX_FW_STATES 6
|
||||
typedef struct _mlan_ds_led_behavior {
|
||||
t_u8 firmwarestate;
|
||||
|
|
@ -6567,6 +6585,33 @@ typedef struct _mlan_ds_auth_assoc_timeout_cfg {
|
|||
t_u16 retry_timeout;
|
||||
} mlan_ds_auth_assoc_timeout_cfg;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Agiled channel switch configuration parameters */
|
||||
typedef struct _mlan_ds_agcs_cfg {
|
||||
/**agcs cfg action 0-GET, 1-SET */
|
||||
t_u16 action;
|
||||
/* BIT0 - Enable Agile channel switching in CarPlay
|
||||
* BIT1 - no specific interference type check, but only check Tx or Rx
|
||||
* throughput drop
|
||||
*/
|
||||
t_u32 features;
|
||||
/* Adjust the weight of TX/RX average packet count */
|
||||
t_u8 avg_threshold_percentage;
|
||||
/* The requires at least average rx packets per second */
|
||||
t_u16 rx_min_pkt_count;
|
||||
/* The requires at least average tx packets per second */
|
||||
t_u16 tx_min_pkt_count;
|
||||
/* Unit is ms */
|
||||
t_u32 sample_time;
|
||||
/* The latest sampled windows size */
|
||||
t_u8 sample_count_window;
|
||||
/* Continuous drop rapidly times */
|
||||
t_u8 continuous_hit_count;
|
||||
/* Make sure a reasonable rate can be sustained. */
|
||||
t_s8 nf_margin;
|
||||
} mlan_ds_agcs_cfg;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */
|
||||
typedef struct _mlan_ds_misc_cfg {
|
||||
/** Sub-command */
|
||||
|
|
@ -6710,6 +6755,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_misc_ofdm_desense_cfg ofdm_desense_cfg;
|
||||
mlan_ds_misc_rx_abort_cfg_ext rx_abort_cfg_ext;
|
||||
mlan_ds_misc_nav_mitigation nav_mitigation;
|
||||
mlan_ds_misc_nav_mitigation_hw nav_mitigation_hw;
|
||||
mlan_ds_misc_led_cfg led_config;
|
||||
mlan_ds_misc_tx_ampdu_prot_mode tx_ampdu_prot_mode;
|
||||
mlan_ds_misc_rate_adapt_cfg rate_adapt_cfg;
|
||||
|
|
@ -6747,6 +6793,10 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_ed_mac_cfg edmac_cfg;
|
||||
mlan_ds_gpio_cfg_ops gpio_cfg_ops;
|
||||
mlan_ds_auth_assoc_timeout_cfg auth_assoc_cfg;
|
||||
#ifdef UAP_SUPPORT
|
||||
/** config AGCS for MLAN_OID_MISC_AGCS_CONFIG */
|
||||
mlan_ds_agcs_cfg agcs_cfg;
|
||||
#endif /* UAP_SUPPORT */
|
||||
} param;
|
||||
} mlan_ds_misc_cfg, *pmlan_ds_misc_cfg;
|
||||
|
||||
|
|
@ -6785,4 +6835,34 @@ typedef struct _mlan_cfpinfo {
|
|||
#define MLAN_REASON_CLASS3_FRAME_FROM_NOASSOC_STA 7
|
||||
#define MLAN_REASON_DISASSOC_STA_HAS_LEFT 8
|
||||
#define MLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/* Processing AGCS report */
|
||||
#define AGCS_EVENT_TYPE_PROCESS_EVENT 1
|
||||
/* After AGCS scan, select and switch to new channel */
|
||||
#define AGCS_EVENT_TYPE_SEL_CHANNEL 2
|
||||
|
||||
/** Type definition of agcs_stats for agcs_event */
|
||||
typedef struct _agcs_stats {
|
||||
/** All STAs support ECS */
|
||||
t_u8 all_sta_ecs;
|
||||
/** All STAs support 6g */
|
||||
t_u8 all_sta_6g;
|
||||
/** ch_load of current channel */
|
||||
t_u16 ch_load;
|
||||
/** noise of current channel */
|
||||
t_s16 noise;
|
||||
/** The noise floor threshold currently used by fw */
|
||||
t_s16 nf_threshold;
|
||||
} agcs_stats, *pagcs_stats;
|
||||
|
||||
/** Type definition of agcs_event for WOAL_EVENT_AGCS */
|
||||
typedef struct _agcs_event {
|
||||
/** AGCS_EVENT_TYPE_PROCESS_EVENT or AGCS_EVENT_TYPE_SEL_CHANNEL */
|
||||
t_u32 type;
|
||||
/** AGCS stats info */
|
||||
agcs_stats stats;
|
||||
} agcs_event, *pagcs_event;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#endif /* !_MLAN_IOCTL_H_ */
|
||||
|
|
|
|||
|
|
@ -6812,6 +6812,7 @@ static int woal_priv_warmreset(moal_private *priv, t_u8 *respbuf,
|
|||
moal_handle *ref_handle;
|
||||
moal_private *ref_priv;
|
||||
ENTER();
|
||||
|
||||
ret = woal_pre_warmreset(priv);
|
||||
if (ret)
|
||||
goto done;
|
||||
|
|
@ -13317,6 +13318,556 @@ void woal_process_chan_event(moal_private *priv, t_u8 type, t_u8 channel,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/**
|
||||
* @brief This function prepare agcs event
|
||||
*
|
||||
* @param priv pointer to the moal_private structure.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void woal_agcs_event(moal_private *priv, pagcs_event pacs_start_event)
|
||||
{
|
||||
struct woal_event *evt;
|
||||
unsigned long flags;
|
||||
moal_handle *handle = priv->phandle;
|
||||
|
||||
evt = kzalloc(sizeof(struct woal_event), GFP_ATOMIC);
|
||||
if (evt) {
|
||||
evt->priv = priv;
|
||||
evt->type = WOAL_EVENT_AGCS;
|
||||
evt->evt.event_len = sizeof(agcs_event);
|
||||
moal_memcpy_ext(priv->phandle, &evt->agcs_evt, pacs_start_event,
|
||||
evt->evt.event_len, sizeof(agcs_event));
|
||||
INIT_LIST_HEAD(&evt->link);
|
||||
spin_lock_irqsave(&handle->evt_lock, flags);
|
||||
list_add_tail(&evt->link, &handle->evt_queue);
|
||||
spin_unlock_irqrestore(&handle->evt_lock, flags);
|
||||
queue_work(handle->evt_workqueue, &handle->evt_work);
|
||||
}
|
||||
// coverity[misra_c_2012_rule_22_1_violation:SUPPRESS]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Print AGCS state machine
|
||||
*
|
||||
* @param state AGCS state
|
||||
*
|
||||
* @return String to be printed
|
||||
*
|
||||
*/
|
||||
static char *moal_agcs_print_state(agcs_state state)
|
||||
{
|
||||
switch (state) {
|
||||
case AGCS_STATE_IDLE:
|
||||
return "AGCS_STATE_IDLE";
|
||||
case AGCS_STATE_START:
|
||||
return "AGCS_STATE_START";
|
||||
case AGCS_STATE_TRIGGERED:
|
||||
return "AGCS_STATE_TRIGGERED";
|
||||
case AGCS_STATE_IN_SCAN:
|
||||
return "AGCS_STATE_IN_SCAN";
|
||||
case AGCS_STATE_SCAN_REPORT:
|
||||
return "AGCS_STATE_SCAN_REPORT";
|
||||
case AGCS_STATE_SCAN_DONE:
|
||||
return "AGCS_STATE_SCAN_DONE";
|
||||
case AGCS_STATE_CSA_START:
|
||||
return "AGCS_STATE_CSA_START";
|
||||
case AGCS_STATE_COMPLETE:
|
||||
return "AGCS_STATE_COMPLETE";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "UNKNOWN STATE";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AGCS transfer state machine
|
||||
*
|
||||
* @param phandle Pointer to moal_handle structure
|
||||
* @param next_state Transer to next state
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS -- success, otherwise fail
|
||||
*
|
||||
*/
|
||||
mlan_status moal_agcs_trans_state(moal_private *priv, agcs_state next_state)
|
||||
{
|
||||
moal_handle *phandle = NULL;
|
||||
agcs_state cur_state = AGCS_STATE_IDLE;
|
||||
mlan_status ret = MLAN_STATUS_FAILURE;
|
||||
|
||||
if (!priv || !priv->phandle) {
|
||||
PRINTM(MERROR, "priv or handle is null\n");
|
||||
return ret;
|
||||
}
|
||||
phandle = priv->phandle;
|
||||
cur_state = phandle->agcs_state;
|
||||
switch (next_state) {
|
||||
case AGCS_STATE_IDLE:
|
||||
if ((phandle->agcs_state < AGCS_STATE_TRIGGERED) ||
|
||||
(phandle->agcs_state >= AGCS_STATE_COMPLETE)) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_START:
|
||||
if ((phandle->agcs_state < AGCS_STATE_TRIGGERED) ||
|
||||
(phandle->agcs_state >= AGCS_STATE_COMPLETE)) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_TRIGGERED:
|
||||
if ((phandle->agcs_state == AGCS_STATE_START) ||
|
||||
(phandle->agcs_state == AGCS_STATE_IN_SCAN) ||
|
||||
(phandle->agcs_state == AGCS_STATE_SCAN_REPORT)) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_IN_SCAN:
|
||||
if (phandle->agcs_state == AGCS_STATE_TRIGGERED) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_SCAN_REPORT:
|
||||
if ((phandle->agcs_state == AGCS_STATE_IN_SCAN) ||
|
||||
(phandle->agcs_state == AGCS_STATE_SCAN_REPORT)) {
|
||||
pagcs_event pacs_start_event = NULL;
|
||||
|
||||
phandle->agcs_state = next_state;
|
||||
pacs_start_event =
|
||||
kzalloc(sizeof(struct woal_event), GFP_ATOMIC);
|
||||
if (pacs_start_event) {
|
||||
pacs_start_event->type =
|
||||
AGCS_EVENT_TYPE_SEL_CHANNEL;
|
||||
woal_agcs_event(priv, pacs_start_event);
|
||||
kfree(pacs_start_event);
|
||||
}
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_SCAN_DONE:
|
||||
if (phandle->agcs_state == AGCS_STATE_SCAN_REPORT) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_CSA_START:
|
||||
if (phandle->agcs_state == AGCS_STATE_SCAN_DONE) {
|
||||
phandle->agcs_state = next_state;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case AGCS_STATE_COMPLETE:
|
||||
if ((phandle->agcs_state == AGCS_STATE_SCAN_DONE) ||
|
||||
(phandle->agcs_state == AGCS_STATE_CSA_START)) {
|
||||
phandle->agcs_state = AGCS_STATE_START;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (phandle->agcs_state != AGCS_STATE_IDLE)
|
||||
PRINTM(MEVENT, "AGCS trans state: (%s) -> (%s) , ret=%d\n",
|
||||
moal_agcs_print_state(cur_state),
|
||||
moal_agcs_print_state(next_state), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Process agiled cs event
|
||||
*
|
||||
* @param priv a pointer to moal_private structure
|
||||
* @param pstart_event a pointer to agcs_stats structure
|
||||
*
|
||||
* @return N/A
|
||||
*
|
||||
*/
|
||||
void woal_process_agcs_event(moal_private *priv, pagcs_stats pstart_event)
|
||||
{
|
||||
moal_private *pmpriv = NULL;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
chan_band_info chaninfo;
|
||||
t_u8 chidx, next_ch;
|
||||
moal_handle *phandle = NULL;
|
||||
wlan_user_scan_cfg *scan_cfg = NULL;
|
||||
wlan_user_scan_chan *pchan_list;
|
||||
|
||||
memset(&chaninfo, 0, sizeof(chaninfo));
|
||||
|
||||
pmpriv = woal_get_active_uap_interface(priv->phandle);
|
||||
if (!pmpriv) {
|
||||
phandle = (moal_handle *)priv->phandle->pref_mac;
|
||||
pmpriv = woal_get_active_uap_interface(phandle);
|
||||
}
|
||||
if (pmpriv) {
|
||||
phandle = pmpriv->phandle;
|
||||
if (!phandle) {
|
||||
PRINTM(MERROR, "moal_handle is NULL\n");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
status = moal_agcs_trans_state(priv, AGCS_STATE_TRIGGERED);
|
||||
if (status == MLAN_STATUS_FAILURE) {
|
||||
PRINTM(MERROR,
|
||||
"agcs state failed(AGCS_STATE_TRIGGERED)\n");
|
||||
goto done;
|
||||
}
|
||||
pchan_list = phandle->agcs_info.chan_list;
|
||||
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_get_ap_channel(pmpriv, MLAN_ACT_GET,
|
||||
MOAL_IOCTL_WAIT, &chaninfo)) {
|
||||
PRINTM(MERROR, "Fail to get ap channel \n");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* select one channel */
|
||||
scan_cfg = kzalloc(sizeof(wlan_user_scan_cfg), GFP_ATOMIC);
|
||||
if (scan_cfg == NULL) {
|
||||
PRINTM(MERROR, "Fail to allocate scan_cfg buffer\n");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
next_ch = 0;
|
||||
chidx = 0;
|
||||
if (pstart_event->all_sta_ecs) {
|
||||
/* If all connected STAs support ECS, channel switch to
|
||||
* diff operating class */
|
||||
if ((pstart_event->all_sta_6g) &&
|
||||
(priv->phandle->hw_info.fw_cap_ext &
|
||||
FW_CAPINFO_EXT_6G)) {
|
||||
/* If all connected STAs support 6g, switch to
|
||||
* diff band(5g<->6g) */
|
||||
if (chaninfo.bandcfg.chanBand == BAND_6GHZ) {
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number !=
|
||||
0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if (pchan_list[chidx]
|
||||
.radio_type ==
|
||||
BAND_5GHZ) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number !=
|
||||
0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if (pchan_list[chidx]
|
||||
.radio_type ==
|
||||
BAND_6GHZ) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* switch to diff operating class(upper 5g <->
|
||||
* lower 5g) */
|
||||
if (chaninfo.channel < 149) {
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number !=
|
||||
0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if ((pchan_list[chidx]
|
||||
.radio_type ==
|
||||
BAND_5GHZ) &&
|
||||
(pchan_list[chidx]
|
||||
.chan_number >=
|
||||
149)) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number !=
|
||||
0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if ((pchan_list[chidx]
|
||||
.radio_type ==
|
||||
BAND_5GHZ) &&
|
||||
(pchan_list[chidx]
|
||||
.chan_number <
|
||||
149)) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* channel switch to same operating class */
|
||||
if (chaninfo.channel < 14) {
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number != 0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if ((pchan_list[chidx].radio_type ==
|
||||
BAND_2GHZ) &&
|
||||
(chaninfo.channel !=
|
||||
pchan_list[chidx].chan_number)) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
} else if (chaninfo.channel < 149) {
|
||||
/* lower 5g channels */
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number != 0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if ((pchan_list[chidx].radio_type ==
|
||||
BAND_5GHZ) &&
|
||||
(pchan_list[chidx].chan_number <
|
||||
149) &&
|
||||
(chaninfo.channel !=
|
||||
pchan_list[chidx].chan_number)) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* upper 5g channels */
|
||||
for (chidx = 0, next_ch = 0;
|
||||
(pchan_list[chidx].chan_number != 0) &&
|
||||
(chidx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
chidx++) {
|
||||
if ((pchan_list[chidx].radio_type ==
|
||||
BAND_5GHZ) &&
|
||||
(pchan_list[chidx].chan_number >=
|
||||
149) &&
|
||||
(chaninfo.channel !=
|
||||
pchan_list[chidx].chan_number)) {
|
||||
moal_memcpy_ext(
|
||||
phandle,
|
||||
(t_void *)&scan_cfg
|
||||
->chan_list
|
||||
[next_ch],
|
||||
(const t_void
|
||||
*)&pchan_list
|
||||
[chidx],
|
||||
sizeof(wlan_user_scan_chan),
|
||||
sizeof(wlan_user_scan_chan));
|
||||
next_ch++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scan_cfg->chan_list[0].chan_number == 0) {
|
||||
PRINTM(MERROR, "Fail to select channel\n");
|
||||
status = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
/** scan type: 0 legacy, 1: enhance scan*/
|
||||
scan_cfg->ext_scan_type = EXT_SCAN_ENHANCE;
|
||||
phandle->agcs_num_in_chan_stats = next_ch;
|
||||
/* Call for scan */
|
||||
status = woal_request_userscan(priv, MOAL_NO_WAIT, scan_cfg);
|
||||
if (status == MLAN_STATUS_FAILURE) {
|
||||
PRINTM(MERROR,
|
||||
"AGCS request the scan of candidate channel list failed\n");
|
||||
}
|
||||
status = moal_agcs_trans_state(priv, AGCS_STATE_IN_SCAN);
|
||||
if (status == MLAN_STATUS_FAILURE) {
|
||||
PRINTM(MERROR,
|
||||
"agcs state failed(AGCS_STATE_IN_SCAN)\n");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if (scan_cfg)
|
||||
kfree(scan_cfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Process agiled cs event to select channel and switch
|
||||
*
|
||||
* @param priv a pointer to moal_private structure
|
||||
* @param pstart_event a pointer to agcs_stats structure
|
||||
*
|
||||
* @return N/A
|
||||
*
|
||||
*/
|
||||
void woal_process_ch_sel_and_switch(moal_private *priv, pagcs_event pevent)
|
||||
{
|
||||
moal_handle *handle = NULL;
|
||||
mlan_scan_resp scan_resp;
|
||||
ChanStatistics_t *pchan_stats, *pbest_chan_stats;
|
||||
int i;
|
||||
t_u16 best_ch_load = 0;
|
||||
|
||||
if (!priv || !priv->phandle) {
|
||||
PRINTM(MERROR, "priv or handle is null\n");
|
||||
return;
|
||||
}
|
||||
handle = priv->phandle;
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_scan_table(priv, MOAL_NO_WAIT, &scan_resp)) {
|
||||
PRINTM(MERROR, "AGCS get scan table failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (scan_resp.pchan_stats != NULL) {
|
||||
pbest_chan_stats = pchan_stats =
|
||||
(ChanStatistics_t *)scan_resp.pchan_stats;
|
||||
|
||||
if (scan_resp.num_in_chan_stats <
|
||||
handle->agcs_num_in_chan_stats) {
|
||||
PRINTM(MMSG,
|
||||
"AGCS there are still channels that have not been scanned.\n");
|
||||
return;
|
||||
}
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_SCAN_DONE)) {
|
||||
PRINTM(MERROR,
|
||||
"agcs state failed(AGCS_STATE_SCAN_DONE)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)scan_resp.num_in_chan_stats; i++) {
|
||||
if (pchan_stats[i].cca_scan_duration) {
|
||||
if (pbest_chan_stats->noise >
|
||||
pchan_stats[i].noise) {
|
||||
pbest_chan_stats = &pchan_stats[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pbest_chan_stats->cca_scan_duration) {
|
||||
best_ch_load = pbest_chan_stats->cca_busy_duration *
|
||||
100 /
|
||||
pbest_chan_stats->cca_scan_duration;
|
||||
}
|
||||
/* (NF_newChannel < NF_threshold) && (channelLoad_newChannel <
|
||||
* ChLoad_TH%) */
|
||||
if ((pbest_chan_stats->noise < pevent->stats.nf_threshold) &&
|
||||
(best_ch_load <
|
||||
handle->agcs_info.chload_threshold_percentage)) {
|
||||
chan_band_info chaninfo;
|
||||
t_u8 band_width = CHANNEL_BW_20MHZ;
|
||||
t_u8 new_oper_class = 0;
|
||||
|
||||
memset(&chaninfo, 0, sizeof(chaninfo));
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_get_ap_channel(priv, MLAN_ACT_GET,
|
||||
MOAL_IOCTL_WAIT,
|
||||
&chaninfo)) {
|
||||
PRINTM(MERROR, "Fail to get ap channel \n");
|
||||
return;
|
||||
}
|
||||
switch (chaninfo.bandcfg.chanWidth) {
|
||||
case CHAN_BW_40MHZ:
|
||||
if (chaninfo.bandcfg.chan2Offset ==
|
||||
SEC_CHAN_BELOW)
|
||||
band_width = CHANNEL_BW_40MHZ_BELOW;
|
||||
else if (chaninfo.bandcfg.chan2Offset ==
|
||||
SEC_CHAN_ABOVE)
|
||||
band_width = CHANNEL_BW_40MHZ_ABOVE;
|
||||
if (pbest_chan_stats->bandcfg.chanBand ==
|
||||
BAND_6GHZ)
|
||||
new_oper_class = 132;
|
||||
break;
|
||||
case CHAN_BW_80MHZ:
|
||||
band_width = CHANNEL_BW_80MHZ;
|
||||
if (pbest_chan_stats->bandcfg.chanBand ==
|
||||
BAND_6GHZ)
|
||||
new_oper_class = 133;
|
||||
break;
|
||||
default:
|
||||
band_width = CHANNEL_BW_20MHZ;
|
||||
if (pbest_chan_stats->bandcfg.chanBand ==
|
||||
BAND_6GHZ)
|
||||
new_oper_class = 131;
|
||||
break;
|
||||
}
|
||||
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_CSA_START);
|
||||
woal_channel_switch(priv, MTRUE, new_oper_class,
|
||||
pbest_chan_stats->chan_num,
|
||||
handle->agcs_info.csa_cnt,
|
||||
pbest_chan_stats->bandcfg.chanBand,
|
||||
band_width, MTRUE);
|
||||
} else {
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_COMPLETE);
|
||||
PRINTM(MEVENT,
|
||||
"AGCS no channel switch NF_newChannel(%d) < NF_threshold(%d) && chload_newChannel(%d) < ChLoad_TH(%d)\n",
|
||||
pbest_chan_stats->noise,
|
||||
pevent->stats.nf_threshold, best_ch_load,
|
||||
handle->agcs_info.chload_threshold_percentage);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/**
|
||||
* @brief check if channel under nop
|
||||
*
|
||||
|
|
@ -20127,6 +20678,103 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get NAV mitigation HW based config parameters
|
||||
*
|
||||
* @param priv A pointer to moal_private structure
|
||||
* @param respbuf A pointer to response buffer
|
||||
* @param respbuflen Available length of response buffer
|
||||
*
|
||||
* @return Number of bytes written, negative for failure.
|
||||
*/
|
||||
static int woal_priv_nav_mitigation_hw(moal_private *priv, t_u8 *respbuf,
|
||||
t_u32 respbuflen)
|
||||
{
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_misc_cfg *misc = NULL;
|
||||
int ret = 0;
|
||||
int data[4] = {0};
|
||||
int header_len = 0, user_data_len = 0;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (!respbuf) {
|
||||
PRINTM(MERROR, "response buffer is not available!\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_NAV_MITIGATION_HW);
|
||||
user_data_len = strlen(respbuf) - header_len;
|
||||
|
||||
/* 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_NAV_MITIGATION_HW;
|
||||
req->req_id = MLAN_IOCTL_MISC_CFG;
|
||||
if ((int)strlen(respbuf) == header_len) {
|
||||
/* GET operation */
|
||||
user_data_len = 0;
|
||||
req->action = MLAN_ACT_GET;
|
||||
} else {
|
||||
/* SET operation */
|
||||
parse_arguments(respbuf + header_len, data, ARRAY_SIZE(data),
|
||||
&user_data_len);
|
||||
if (user_data_len > 4 ||
|
||||
(user_data_len == 1 && data[0] != MFALSE)) {
|
||||
PRINTM(MERROR, "Invalid number of args!\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
misc->param.nav_mitigation_hw.start_nav_mitigation = data[0];
|
||||
if (data[0] == MTRUE) {
|
||||
PRINTM(MERROR, "Value set!\n");
|
||||
misc->param.nav_mitigation_hw.duration_threshold =
|
||||
data[1];
|
||||
misc->param.nav_mitigation_hw.honoring_duration =
|
||||
data[2];
|
||||
misc->param.nav_mitigation_hw.txop_duration_threshold =
|
||||
data[3];
|
||||
} else {
|
||||
PRINTM(MERROR, "Value not set!\n");
|
||||
misc->param.nav_mitigation_hw.duration_threshold = 0;
|
||||
misc->param.nav_mitigation_hw.honoring_duration = 0;
|
||||
misc->param.nav_mitigation_hw.txop_duration_threshold =
|
||||
0;
|
||||
}
|
||||
req->action = MLAN_ACT_SET;
|
||||
}
|
||||
/* Send IOCTL request to MLAN */
|
||||
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
|
||||
if (status != MLAN_STATUS_SUCCESS) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (req->action == MLAN_ACT_GET) {
|
||||
data[0] = misc->param.nav_mitigation_hw.start_nav_mitigation;
|
||||
data[1] = misc->param.nav_mitigation_hw.duration_threshold;
|
||||
data[2] = misc->param.nav_mitigation_hw.honoring_duration;
|
||||
data[3] = misc->param.nav_mitigation_hw.txop_duration_threshold;
|
||||
moal_memcpy_ext(priv->phandle, respbuf, (t_u8 *)data,
|
||||
sizeof(data), respbuflen);
|
||||
}
|
||||
ret = sizeof(data);
|
||||
done:
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get LED config parameters
|
||||
*
|
||||
|
|
@ -21111,6 +21759,254 @@ static int woal_priv_get_uuid(moal_private *priv, t_u8 *respbuf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
|
||||
/* Adjust the weight of TX/RX average packet count percentage */
|
||||
#define AGCS_PARAMS_AVG_THR_PERCENT 50
|
||||
/* The conservative amount of rx packet per second */
|
||||
#define AGCS_PARAMS_RX_MIN_GPKTCNT 850
|
||||
/* The conservative amount of tx packet per second */
|
||||
#define AGCS_PARAMS_TX_MIN_GPKTCNT 430
|
||||
/* Check current channel throughput/noise periodic, unit is ms */
|
||||
#define AGCS_PARAMS_SAMPLE_TIME 500
|
||||
/* The latest sampled windows size */
|
||||
#define AGCS_PARAMS_SAMPLE_CNT_WINDOWS 10
|
||||
/* The count of consecutive hits required */
|
||||
#define AGCS_PARAMS_CONTINUOUS_HIT_CNT 2
|
||||
/* 25 for 64-QAM, make sure a reasonable rate can be sustained. */
|
||||
#define AGCS_PARAMS_NF_MARGIN 25
|
||||
/* The channel load threshold that the new channel needs to reach. */
|
||||
#define AGCS_PARAMS_CHLOAD_THR_PERCENT 50
|
||||
/* Channel switch announcement count */
|
||||
#define AGCS_PARAMS_CSA_COUNT 5
|
||||
|
||||
/* After AGCS triggered, scan the candidate channel list with duration, unit is
|
||||
* ms */
|
||||
#define AGCS_PARAMS_SCAN_TIME 30
|
||||
|
||||
/* Carplay candidate channel list */
|
||||
static t_u8 agcs_chan_2g[] = {1, 6, 11};
|
||||
static t_u8 agcs_chan_5g[] = {36, 40, 44, 48, 149, 153, 157, 161, 165};
|
||||
static t_u8 agcs_chan_6g[] = {37};
|
||||
|
||||
/**
|
||||
* @brief Copy AGCS configuration values from source or default
|
||||
*
|
||||
* @param phandle Pointer to moal_handle structure
|
||||
* @param pagcs_info_req Dest pagcs_info pointer to wlan_agcs_info structure
|
||||
* @param psrc_agcs_info Source pagcs_info pointer to wlan_agcs_info
|
||||
* structure
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
static void wlan_copy_agcs_info(moal_handle *phandle,
|
||||
wlan_agcs_info *pagcs_info_req,
|
||||
wlan_agcs_info *psrc_agcs_info)
|
||||
{
|
||||
t_u8 tmp_idx = 0;
|
||||
t_u8 chan_cmd_idx = 0;
|
||||
|
||||
moal_memcpy_ext(phandle, (char *)pagcs_info_req, psrc_agcs_info,
|
||||
sizeof(wlan_agcs_info), sizeof(wlan_agcs_info));
|
||||
if (pagcs_info_req->avg_threshold_percentage == 0)
|
||||
pagcs_info_req->avg_threshold_percentage =
|
||||
AGCS_PARAMS_AVG_THR_PERCENT;
|
||||
if (pagcs_info_req->rx_min_pkt_count == 0)
|
||||
pagcs_info_req->rx_min_pkt_count = AGCS_PARAMS_RX_MIN_GPKTCNT;
|
||||
if (pagcs_info_req->tx_min_pkt_count == 0)
|
||||
pagcs_info_req->tx_min_pkt_count = AGCS_PARAMS_TX_MIN_GPKTCNT;
|
||||
if (pagcs_info_req->sample_time == 0)
|
||||
pagcs_info_req->sample_time = AGCS_PARAMS_SAMPLE_TIME;
|
||||
if (pagcs_info_req->sample_count_window == 0)
|
||||
pagcs_info_req->sample_count_window =
|
||||
AGCS_PARAMS_SAMPLE_CNT_WINDOWS;
|
||||
if (pagcs_info_req->continuous_hit_count == 0)
|
||||
pagcs_info_req->continuous_hit_count =
|
||||
AGCS_PARAMS_CONTINUOUS_HIT_CNT;
|
||||
if (pagcs_info_req->nf_margin == 0)
|
||||
pagcs_info_req->nf_margin = AGCS_PARAMS_NF_MARGIN;
|
||||
if (pagcs_info_req->chload_threshold_percentage == 0)
|
||||
pagcs_info_req->chload_threshold_percentage =
|
||||
AGCS_PARAMS_CHLOAD_THR_PERCENT;
|
||||
if (pagcs_info_req->csa_cnt == 0)
|
||||
pagcs_info_req->csa_cnt = AGCS_PARAMS_CSA_COUNT;
|
||||
|
||||
if (pagcs_info_req->chan_list[0].chan_number == 0) {
|
||||
for (tmp_idx = 0; (tmp_idx < sizeof(agcs_chan_2g)) &&
|
||||
(chan_cmd_idx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
tmp_idx++, chan_cmd_idx++) {
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].chan_number =
|
||||
agcs_chan_2g[tmp_idx];
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].radio_type =
|
||||
BAND_2GHZ;
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].scan_time =
|
||||
AGCS_PARAMS_SCAN_TIME;
|
||||
}
|
||||
for (tmp_idx = 0; (tmp_idx < sizeof(agcs_chan_5g)) &&
|
||||
(chan_cmd_idx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
tmp_idx++, chan_cmd_idx++) {
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].chan_number =
|
||||
agcs_chan_5g[tmp_idx];
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].radio_type =
|
||||
BAND_5GHZ;
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].scan_time =
|
||||
AGCS_PARAMS_SCAN_TIME;
|
||||
}
|
||||
for (tmp_idx = 0; (tmp_idx < sizeof(agcs_chan_6g)) &&
|
||||
(chan_cmd_idx < WLAN_USER_SCAN_CHAN_MAX);
|
||||
tmp_idx++, chan_cmd_idx++) {
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].chan_number =
|
||||
agcs_chan_6g[tmp_idx];
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].radio_type =
|
||||
BAND_6GHZ;
|
||||
pagcs_info_req->chan_list[chan_cmd_idx].scan_time =
|
||||
AGCS_PARAMS_SCAN_TIME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Agiled channel switch
|
||||
*
|
||||
* @param priv A pointer to moal_private structure
|
||||
* @param respbuf A pointer to response buffer
|
||||
* @param respbuflen Available length of response buffer
|
||||
*
|
||||
* @return Number of bytes written, negative for failure.
|
||||
*/
|
||||
static int woal_priv_agcs(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
|
||||
{
|
||||
wlan_agcs_info *pagcs_info_req = NULL;
|
||||
wlan_agcs_info *pagcs_info_src = NULL;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_misc_cfg *misc = NULL;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
int header_len = 0;
|
||||
int ret = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (!priv || !priv->phandle) {
|
||||
PRINTM(MERROR, "priv or handle is null\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
pagcs_info_req =
|
||||
(wlan_agcs_info *)kmalloc(sizeof(wlan_agcs_info), GFP_KERNEL);
|
||||
if (!pagcs_info_req) {
|
||||
PRINTM(MERROR, "Malloc buffer failed\n");
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
header_len = strlen(PRIV_CMD_AGCS);
|
||||
|
||||
/* 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_AGCS_CONFIG;
|
||||
req->req_id = MLAN_IOCTL_MISC_CFG;
|
||||
|
||||
pagcs_info_src = (wlan_agcs_info *)(respbuf + header_len);
|
||||
if (pagcs_info_src->action == MLAN_ACT_GET) {
|
||||
/* GET operation */
|
||||
req->action = MLAN_ACT_GET;
|
||||
} else {
|
||||
/* Create the agcs_info_req structure */
|
||||
/* We expect the agcs_info_req structure to be passed in respbuf
|
||||
*/
|
||||
memset(pagcs_info_req, 0, sizeof(wlan_agcs_info));
|
||||
wlan_copy_agcs_info(priv->phandle, pagcs_info_req,
|
||||
(wlan_agcs_info *)(respbuf + header_len));
|
||||
|
||||
misc->param.agcs_cfg.features = pagcs_info_req->mode;
|
||||
misc->param.agcs_cfg.avg_threshold_percentage =
|
||||
pagcs_info_req->avg_threshold_percentage;
|
||||
misc->param.agcs_cfg.rx_min_pkt_count =
|
||||
pagcs_info_req->rx_min_pkt_count;
|
||||
misc->param.agcs_cfg.tx_min_pkt_count =
|
||||
pagcs_info_req->tx_min_pkt_count;
|
||||
misc->param.agcs_cfg.sample_time = pagcs_info_req->sample_time;
|
||||
misc->param.agcs_cfg.sample_count_window =
|
||||
pagcs_info_req->sample_count_window;
|
||||
misc->param.agcs_cfg.continuous_hit_count =
|
||||
pagcs_info_req->continuous_hit_count;
|
||||
misc->param.agcs_cfg.nf_margin = pagcs_info_req->nf_margin;
|
||||
|
||||
req->action = MLAN_ACT_SET;
|
||||
}
|
||||
|
||||
/* Send IOCTL request to MLAN */
|
||||
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
|
||||
if (status != MLAN_STATUS_SUCCESS) {
|
||||
ret = -EFAULT;
|
||||
PRINTM(MERROR, "request ioctl failed\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (req->action == MLAN_ACT_GET) {
|
||||
pagcs_info_req->mode = misc->param.agcs_cfg.features;
|
||||
pagcs_info_req->avg_threshold_percentage =
|
||||
misc->param.agcs_cfg.avg_threshold_percentage;
|
||||
pagcs_info_req->rx_min_pkt_count =
|
||||
misc->param.agcs_cfg.rx_min_pkt_count;
|
||||
pagcs_info_req->tx_min_pkt_count =
|
||||
misc->param.agcs_cfg.tx_min_pkt_count;
|
||||
pagcs_info_req->sample_time = misc->param.agcs_cfg.sample_time;
|
||||
pagcs_info_req->sample_count_window =
|
||||
misc->param.agcs_cfg.sample_count_window;
|
||||
pagcs_info_req->continuous_hit_count =
|
||||
misc->param.agcs_cfg.continuous_hit_count;
|
||||
pagcs_info_req->nf_margin = misc->param.agcs_cfg.nf_margin;
|
||||
|
||||
if (priv->phandle->agcs_info.chload_threshold_percentage == 0)
|
||||
pagcs_info_req->chload_threshold_percentage =
|
||||
AGCS_PARAMS_CHLOAD_THR_PERCENT;
|
||||
else
|
||||
pagcs_info_req->chload_threshold_percentage =
|
||||
priv->phandle->agcs_info
|
||||
.chload_threshold_percentage;
|
||||
|
||||
if (priv->phandle->agcs_info.csa_cnt == 0)
|
||||
pagcs_info_req->csa_cnt = AGCS_PARAMS_CSA_COUNT;
|
||||
else
|
||||
pagcs_info_req->csa_cnt =
|
||||
priv->phandle->agcs_info.csa_cnt;
|
||||
} else {
|
||||
/* When fw cmd succeeds, copy it to moal_handle->agcs_info */
|
||||
moal_memcpy_ext(priv->phandle,
|
||||
(char *)&(priv->phandle->agcs_info),
|
||||
(char *)pagcs_info_req, sizeof(wlan_agcs_info),
|
||||
sizeof(wlan_agcs_info));
|
||||
if (pagcs_info_req->mode & 0x1) {
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_START);
|
||||
} else {
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_IDLE);
|
||||
}
|
||||
}
|
||||
|
||||
moal_memcpy_ext(priv->phandle, respbuf, (t_u8 *)pagcs_info_req,
|
||||
sizeof(wlan_agcs_info), respbuflen);
|
||||
|
||||
ret = sizeof(wlan_agcs_info);
|
||||
|
||||
done:
|
||||
kfree(pagcs_info_req);
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/**
|
||||
* @brief Set priv command for Android
|
||||
* @param dev A pointer to net_device structure
|
||||
|
|
@ -21627,6 +22523,13 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req)
|
|||
len = woal_priv_rx_abort_cfg_ext(priv, buf,
|
||||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_NAV_MITIGATION_HW,
|
||||
strlen(PRIV_CMD_NAV_MITIGATION_HW)) == 0) {
|
||||
/* dconfigure nav mitigate */
|
||||
len = woal_priv_nav_mitigation_hw(priv, buf,
|
||||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_NAV_MITIGATION,
|
||||
strlen(PRIV_CMD_NAV_MITIGATION)) == 0) {
|
||||
|
|
@ -23121,8 +24024,16 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req)
|
|||
/* Get chnrgpwr */
|
||||
len = woal_priv_get_chnrgpwr(priv, buf, priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf, PRIV_CMD_GET_TXPWR_LIMIT,
|
||||
strlen(PRIV_CMD_GET_TXPWR_LIMIT)) == 0) {
|
||||
}
|
||||
#ifdef UAP_SUPPORT
|
||||
else if (strnicmp(buf, PRIV_CMD_AGCS, strlen(PRIV_CMD_AGCS)) == 0) {
|
||||
/* Set agiled channel switch */
|
||||
len = woal_priv_agcs(priv, buf, priv_cmd.total_len);
|
||||
goto handled;
|
||||
}
|
||||
#endif /* UAP_SUPPORT */
|
||||
else if (strnicmp(buf, PRIV_CMD_GET_TXPWR_LIMIT,
|
||||
strlen(PRIV_CMD_GET_TXPWR_LIMIT)) == 0) {
|
||||
/* Get txpwrlimit */
|
||||
len = woal_priv_get_txpwrlimit(priv, buf, priv_cmd.total_len);
|
||||
goto handled;
|
||||
|
|
|
|||
|
|
@ -319,6 +319,8 @@ typedef struct _chan_stats {
|
|||
#define PRIV_CMD_RX_ABORT_CFG_EXT "rx_abort_cfg_ext"
|
||||
/** configure NAV mitigation parameters. */
|
||||
#define PRIV_CMD_NAV_MITIGATION "nav_mitigation"
|
||||
/** configure HW based NAV mitigation parameters. */
|
||||
#define PRIV_CMD_NAV_MITIGATION_HW "nav_mitigation_hw"
|
||||
#define PRIV_CMD_LED "led"
|
||||
#define TX_AMPDU_RTS_CTS 0
|
||||
#define TX_AMPDU_CTS_2_SELF 1
|
||||
|
|
@ -792,4 +794,9 @@ typedef struct {
|
|||
} __ATTRIB_PACK__ wlan_ieee80211_chan_list;
|
||||
|
||||
#define PRIV_CMD_TP_STATE "tp_state"
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
#define PRIV_CMD_AGCS "agcs"
|
||||
#endif
|
||||
|
||||
#endif /* _WOAL_ETH_PRIV_H_ */
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ static int tx_work = 0;
|
|||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
||||
/**
|
||||
* RPS to steer packets to specific CPU
|
||||
* Default value of 0 keeps rps disabled by default
|
||||
* Default value of 0xf keeps rps enabled by default
|
||||
*/
|
||||
static int rps = 0;
|
||||
static int rps = 0x0F;
|
||||
|
||||
/**
|
||||
* rps cpu mask
|
||||
|
|
@ -206,6 +206,7 @@ static int cfg_11d;
|
|||
#if defined(UAP_SUPPORT)
|
||||
static int custom_11d_bcn_country_ie_en;
|
||||
#endif
|
||||
static int amsdu_disable;
|
||||
/** fw serial download check */
|
||||
static int fw_serial = 1;
|
||||
|
||||
|
|
@ -1064,6 +1065,15 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
params->custom_11d_bcn_country_ie_en);
|
||||
}
|
||||
#endif
|
||||
else if (strncmp(line, "amsdu_disable",
|
||||
strlen("amsdu_disable")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->amsdu_disable = out_data;
|
||||
PRINTM(MERROR, "amsdu_disable = %d\n",
|
||||
params->amsdu_disable);
|
||||
}
|
||||
#if defined(SDIO)
|
||||
else if (strncmp(line, "slew_rate", strlen("slew_rate")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
|
|
@ -1764,7 +1774,7 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
{
|
||||
t_u8 addr[ETH_ALEN];
|
||||
bool is_valid_mac_addr = false;
|
||||
|
||||
unsigned int rps_mask = 0, nr_cpu = 0;
|
||||
if (hw_test)
|
||||
moal_extflg_set(handle, EXT_HW_TEST);
|
||||
#ifdef CONFIG_OF
|
||||
|
|
@ -1965,6 +1975,10 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
handle->params.custom_11d_bcn_country_ie_en =
|
||||
params->custom_11d_bcn_country_ie_en;
|
||||
#endif
|
||||
handle->params.amsdu_disable = amsdu_disable;
|
||||
if (params)
|
||||
handle->params.amsdu_disable = params->amsdu_disable;
|
||||
|
||||
#if defined(SDIO)
|
||||
handle->params.slew_rate = slew_rate;
|
||||
if (params)
|
||||
|
|
@ -2094,7 +2108,10 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
|
||||
#if defined(CONFIG_RPS)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
||||
nr_cpu = num_online_cpus();
|
||||
rps_mask = (1U << nr_cpu) - 1;
|
||||
handle->params.rps = rps & RPS_CPU_MASK;
|
||||
handle->params.rps &= rps_mask;
|
||||
PRINTM(MMSG, "rps set to %x from module param\n", handle->params.rps);
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -3146,6 +3163,11 @@ MODULE_PARM_DESC(
|
|||
custom_11d_bcn_country_ie_en,
|
||||
"1: Enable Custom BCN Country ie; 0: Disable Custom BCN Country ie");
|
||||
#endif
|
||||
// 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(amsdu_disable, int, 0);
|
||||
MODULE_PARM_DESC(amsdu_disable, "1: Disable AMSDU aggr; 0: Enable AMSDU aggr");
|
||||
|
||||
#if defined(SDIO)
|
||||
module_param(slew_rate, int, 0);
|
||||
|
|
@ -3232,6 +3254,9 @@ MODULE_PARM_DESC(ring_size,
|
|||
module_param(pcie_int_mode, int, 0);
|
||||
MODULE_PARM_DESC(pcie_int_mode, "0: Legacy mode; 1: MSI mode");
|
||||
#endif /* PCIE */
|
||||
// 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(low_power_mode_enable, int, 0);
|
||||
MODULE_PARM_DESC(low_power_mode_enable, "0/1: Disable/Enable Low Power Mode");
|
||||
|
||||
|
|
@ -3287,6 +3312,9 @@ module_param(indication_gpio, int, 0);
|
|||
MODULE_PARM_DESC(
|
||||
indication_gpio,
|
||||
"GPIO to indicate wakeup source; high four bits: level for normal wakeup; low four bits: GPIO pin number.");
|
||||
// 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(disconnect_on_suspend, int, 0);
|
||||
MODULE_PARM_DESC(
|
||||
disconnect_on_suspend,
|
||||
|
|
@ -3301,6 +3329,9 @@ MODULE_PARM_DESC(
|
|||
indrstcfg,
|
||||
"Independent reset configuration; high byte: GPIO pin number; low byte: IR mode");
|
||||
|
||||
// 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(fixed_beacon_buffer, int, 0);
|
||||
MODULE_PARM_DESC(
|
||||
fixed_beacon_buffer,
|
||||
|
|
@ -3376,6 +3407,9 @@ MODULE_PARM_DESC(
|
|||
#endif
|
||||
|
||||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
// 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(disable_regd_by_driver, int, 0);
|
||||
MODULE_PARM_DESC(
|
||||
disable_regd_by_driver,
|
||||
|
|
|
|||
|
|
@ -336,6 +336,24 @@ static inline void woal_copy_mc_addr(mlan_multicast_list *mlist,
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy NAN network mcast addr to multicast table
|
||||
*
|
||||
* @param mlist A pointer to mlan_multicast_list structure
|
||||
*
|
||||
* @return Number of multicast addresses
|
||||
*/
|
||||
static inline int woal_copy_nan_mcast_addr(mlan_multicast_list *mlist)
|
||||
{
|
||||
t_u8 nan_network_addr[6] = {0x51, 0x6f, 0x9a, 0x01, 0, 0};
|
||||
ENTER();
|
||||
|
||||
woal_copy_mc_addr(mlist, nan_network_addr);
|
||||
|
||||
LEAVE();
|
||||
return mlist->num_multicast_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy multicast table
|
||||
*
|
||||
|
|
@ -400,6 +418,9 @@ static int woal_copy_all_mc_list(moal_handle *handle,
|
|||
woal_copy_mcast_addr(mlist,
|
||||
priv->netdev);
|
||||
}
|
||||
// NAN mcast addr supposed to download whatever the
|
||||
// media_connected is
|
||||
woal_copy_nan_mcast_addr(mlist);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -3405,7 +3426,7 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
|
|||
filter->type = TYPE_BYTE_EQ;
|
||||
filter->repeat = 1;
|
||||
filter->offset = 38;
|
||||
filter->num_bytes = 4;
|
||||
filter->num_byte_seq = 4;
|
||||
moal_memcpy_ext(handle, filter->byte_seq, "\xe0\x00\x00\xfb", 4,
|
||||
sizeof(filter->byte_seq));
|
||||
entry->rpn[2] = RPN_TYPE_AND;
|
||||
|
|
|
|||
|
|
@ -1352,6 +1352,32 @@ done:
|
|||
// coverity[misra_c_2012_rule_22_1_violation:SUPPRESS]
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function send the auto recovery start event to kernel
|
||||
*
|
||||
* @param handle Pointer to structure moal_handle
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void woal_send_auto_recovery_start_event(moal_handle *handle)
|
||||
{
|
||||
moal_private *priv;
|
||||
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
|
||||
if (priv) {
|
||||
woal_broadcast_event(priv, CUS_EVT_FW_RECOVER_START,
|
||||
strlen(CUS_EVT_FW_RECOVER_START));
|
||||
#ifdef STA_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
if (IS_STA_OR_UAP_CFG80211(handle->params.cfg80211_wext))
|
||||
woal_cfg80211_vendor_event(
|
||||
priv, event_fw_reset_success,
|
||||
CUS_EVT_FW_RECOVER_START,
|
||||
strlen(CUS_EVT_FW_RECOVER_START));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function send the auto recovery complete event to kernel
|
||||
*
|
||||
|
|
@ -2829,6 +2855,7 @@ mlan_status woal_init_sw(moal_handle *handle)
|
|||
device.reject_addba_req = handle->params.reject_addba_req;
|
||||
device.disable_11h_tpc = (t_u32)handle->params.disable_11h_tpc;
|
||||
device.tpe_ie_ignore = (t_u32)handle->params.tpe_ie_ignore;
|
||||
device.amsdu_disable = handle->params.amsdu_disable;
|
||||
|
||||
for (i = 0; i < handle->drv_mode.intf_num; i++) {
|
||||
device.bss_attr[i].bss_type =
|
||||
|
|
@ -2851,6 +2878,7 @@ mlan_status woal_init_sw(moal_handle *handle)
|
|||
device.mclient_scheduling = handle->params.mclient_scheduling;
|
||||
/* Clean up the mode_psd_string for 6E Indoor/Outdoor */
|
||||
memset(handle->mode_psd_string, 0, sizeof(handle->mode_psd_string));
|
||||
|
||||
moal_memcpy_ext(handle, &device.callbacks, &woal_callbacks,
|
||||
sizeof(mlan_callbacks), sizeof(mlan_callbacks));
|
||||
if (!handle->params.amsdu_deaggr)
|
||||
|
|
@ -2937,6 +2965,7 @@ void woal_free_moal_handle(moal_handle *handle)
|
|||
kfree(fwdump_fname);
|
||||
fwdump_fname = NULL;
|
||||
}
|
||||
|
||||
/* Free module params */
|
||||
woal_free_module_param(handle);
|
||||
/** clear pref_mac to avoid later crash */
|
||||
|
|
@ -4838,7 +4867,11 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle)
|
|||
PRINTM(MERROR,
|
||||
"WLAN: Fail download FW with nowwait: %u\n",
|
||||
moal_extflg_isset(handle, EXT_REQ_FW_NOWAIT));
|
||||
if (handle->ops.reg_dbg)
|
||||
if (handle->ops.reg_dbg
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
handle->ops.reg_dbg(handle);
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -4914,11 +4947,19 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle)
|
|||
if (handle->hardware_status != HardwareStatusReady) {
|
||||
wifi_status = WIFI_STATUS_INIT_FW_FAIL;
|
||||
handle->event_fw_dump = MFALSE;
|
||||
if (handle->ops.reg_dbg)
|
||||
if (handle->ops.reg_dbg
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
handle->ops.reg_dbg(handle);
|
||||
#ifdef DEBUG_LEVEL1
|
||||
if (drvdbg & MFW_D) {
|
||||
if (handle->ops.dump_fw_info) {
|
||||
if (handle->ops.dump_fw_info
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
) {
|
||||
handle->ops.dump_fw_info(handle);
|
||||
#ifdef DUMP_TO_PROC
|
||||
woal_print_firmware_dump_buf(
|
||||
|
|
@ -5495,7 +5536,7 @@ static int woal_mon_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
|
|||
"woal_mon_do_ioctl: mon_if == NULL || mon_if->base_ndev == NULL\n");
|
||||
goto fail;
|
||||
}
|
||||
PRINTM(MERROR, "woal_mon_do_ioctl: ioctl cmd = 0x%x\n", cmd);
|
||||
PRINTM(MIOCTL, "woal_mon_do_ioctl: ioctl cmd = 0x%x\n", cmd);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||
ret = woal_do_ioctl(mon_if->base_ndev, req, data, cmd);
|
||||
|
|
@ -6807,6 +6848,7 @@ void woal_flush_workqueue(moal_handle *handle)
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
cancel_delayed_work_sync(&handle->emergency_reset_work);
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
|
|
@ -6873,6 +6915,7 @@ void woal_terminate_workqueue(moal_handle *handle)
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
cancel_delayed_work_sync(&handle->emergency_reset_work);
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
|
|
@ -9321,7 +9364,9 @@ void woal_set_multicast_list(struct net_device *dev)
|
|||
{
|
||||
moal_private *priv = (moal_private *)netdev_priv(dev);
|
||||
ENTER();
|
||||
queue_work(priv->mclist_workqueue, &priv->mclist_work);
|
||||
if (priv && priv->mclist_workqueue) {
|
||||
queue_work(priv->mclist_workqueue, &priv->mclist_work);
|
||||
}
|
||||
LEAVE();
|
||||
}
|
||||
#endif
|
||||
|
|
@ -9530,6 +9575,8 @@ void woal_init_priv(moal_private *priv, t_u8 wait_option)
|
|||
moal_memcpy_ext(priv->phandle, priv->netdev->dev_addr,
|
||||
priv->current_addr, ETH_ALEN, ETH_ALEN);
|
||||
#endif
|
||||
|
||||
woal_set_multicast_list(priv->netdev);
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
|
||||
priv->host_mlme = 0;
|
||||
priv->auth_flag = 0;
|
||||
|
|
@ -9589,8 +9636,10 @@ mlan_status woal_reset_intf(moal_private *priv, t_u8 wait_option, int all_intf)
|
|||
MFALSE, 0, NULL)) {
|
||||
PRINTM(MERROR, "%s: stop net monitor failed \n",
|
||||
__func__);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
/* Even if stop net monitor is failed still continue to
|
||||
* clean the kernel related config otherwise it leads to
|
||||
* kernel crash.
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
netif_device_detach(handle->mon_if->mon_ndev);
|
||||
|
|
@ -11491,7 +11540,11 @@ static int woal_dump_moal_drv_info(moal_handle *phandle, t_u8 *buf)
|
|||
ptr += snprintf(ptr, MAX_BUF_LEN,
|
||||
"------------moal_debug_info End-------------\n");
|
||||
|
||||
if (phandle->ops.dump_reg_info)
|
||||
if (phandle->ops.dump_reg_info
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
)
|
||||
ptr += phandle->ops.dump_reg_info(phandle, ptr);
|
||||
|
||||
LEAVE();
|
||||
|
|
@ -12414,7 +12467,11 @@ void woal_moal_debug_info(moal_private *priv, moal_handle *handle, u8 flag)
|
|||
#ifdef PCIE
|
||||
if (IS_PCIE(phandle->card_type)) {
|
||||
#ifdef DEBUG_LEVEL1
|
||||
if (phandle->ops.reg_dbg) {
|
||||
if (phandle->ops.reg_dbg
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
) {
|
||||
phandle->ops.reg_dbg(phandle);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -12425,8 +12482,11 @@ void woal_moal_debug_info(moal_private *priv, moal_handle *handle, u8 flag)
|
|||
if (flag && ((phandle->main_state == MOAL_END_MAIN_PROCESS) ||
|
||||
(phandle->main_state == MOAL_STATE_IDLE))) {
|
||||
#ifdef DEBUG_LEVEL1
|
||||
if (phandle->ops.reg_dbg &&
|
||||
(drvdbg & (MREG_D | MFW_D))) {
|
||||
if (phandle->ops.reg_dbg && (drvdbg & (MREG_D | MFW_D))
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
) {
|
||||
phandle->ops.reg_dbg(phandle);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -12764,6 +12824,57 @@ t_void woal_scan_timeout_handler(struct work_struct *work)
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This workqueue function handles woal emergency reset work
|
||||
*
|
||||
* @param work A pointer to work_struct
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
t_void woal_emergency_reset_handler(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *delayed_work = to_delayed_work(work);
|
||||
// Coverity violation raised for kernel's API
|
||||
// coverity[cert_arr39_c_violation:SUPPRESS]
|
||||
moal_handle *handle =
|
||||
container_of(delayed_work, moal_handle, emergency_reset_work);
|
||||
moal_handle *ref_handle = NULL;
|
||||
moal_private *priv = NULL;
|
||||
t_u8 auto_fw_dump = MFALSE;
|
||||
|
||||
ENTER();
|
||||
|
||||
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
|
||||
if (!priv) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
priv->phandle->driver_status = MTRUE;
|
||||
ref_handle = (moal_handle *)priv->phandle->pref_mac;
|
||||
if (!ref_handle) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
ref_handle->driver_status = MTRUE;
|
||||
|
||||
#ifdef DEBUG_LEVEL1
|
||||
if (drvdbg & MFW_D)
|
||||
auto_fw_dump = MTRUE;
|
||||
#endif
|
||||
|
||||
woal_moal_debug_info(priv, NULL, MFALSE);
|
||||
|
||||
PRINTM(MEVENT, "RESET FW NOW !!\n");
|
||||
|
||||
mlan_pm_wakeup_card(priv->phandle->pmlan_adapter, MFALSE);
|
||||
|
||||
woal_process_hang(priv->phandle);
|
||||
|
||||
wifi_status = WIFI_STATUS_EMERGENCY_TEMP_REACHED;
|
||||
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This workqueue function handles woal event queue
|
||||
*
|
||||
|
|
@ -12898,6 +13009,21 @@ t_void woal_evt_work_queue(struct work_struct *work)
|
|||
"Fail to request country power table\n");
|
||||
}
|
||||
break;
|
||||
#ifdef UAP_SUPPORT
|
||||
case WOAL_EVENT_AGCS:
|
||||
if (evt->agcs_evt.type ==
|
||||
AGCS_EVENT_TYPE_PROCESS_EVENT) {
|
||||
woal_process_agcs_event(
|
||||
(moal_private *)evt->priv,
|
||||
&evt->agcs_evt.stats);
|
||||
} else if (evt->agcs_evt.type ==
|
||||
AGCS_EVENT_TYPE_SEL_CHANNEL) {
|
||||
woal_process_ch_sel_and_switch(
|
||||
(moal_private *)evt->priv,
|
||||
&evt->agcs_evt);
|
||||
}
|
||||
break;
|
||||
#endif /* UAP_SUPPORT */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -13253,7 +13379,11 @@ t_void woal_main_work_queue(struct work_struct *work)
|
|||
}
|
||||
if (handle->reg_dbg == MTRUE) {
|
||||
handle->reg_dbg = MFALSE;
|
||||
if (handle->ops.reg_dbg)
|
||||
if (handle->ops.reg_dbg
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
handle->ops.reg_dbg(handle);
|
||||
}
|
||||
if (handle->fw_dbg == MTRUE) {
|
||||
|
|
@ -13261,7 +13391,11 @@ t_void woal_main_work_queue(struct work_struct *work)
|
|||
#ifdef DEBUG_LEVEL1
|
||||
drvdbg &= ~MFW_D;
|
||||
#endif
|
||||
if (handle->ops.dump_fw_info)
|
||||
if (handle->ops.dump_fw_info
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
handle->ops.dump_fw_info(handle);
|
||||
LEAVE();
|
||||
return;
|
||||
|
|
@ -13653,6 +13787,9 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops,
|
|||
woal_scan_timeout_handler);
|
||||
#endif
|
||||
|
||||
INIT_DELAYED_WORK(&handle->emergency_reset_work,
|
||||
&woal_emergency_reset_handler);
|
||||
|
||||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
|
||||
MLAN_INIT_WORK(&handle->host_mlme_work, woal_host_mlme_work_queue);
|
||||
|
|
|
|||
|
|
@ -340,6 +340,19 @@ typedef t_u8 BOOLEAN;
|
|||
#define MAX_TIME_LEN 128
|
||||
#endif
|
||||
|
||||
/** FW cap info bit 12: 2G Support */
|
||||
#ifndef ISSUPP_11AC2GENABLED
|
||||
#define ISSUPP_11AC2GENABLED(FwCapInfo) (FwCapInfo & MBIT(12))
|
||||
#endif
|
||||
/** FW cap info bit 13: 5G Support */
|
||||
#ifndef ISSUPP_11AC5GENABLED
|
||||
#define ISSUPP_11AC5GENABLED(FwCapInfo) (FwCapInfo & MBIT(13))
|
||||
#endif
|
||||
/** FW cap info Ext bit 14: 6G Support */
|
||||
#ifndef FW_CAPINFO_EXT_6G
|
||||
#define FW_CAPINFO_EXT_6G MBIT(14)
|
||||
#endif
|
||||
|
||||
/** Driver version */
|
||||
extern char driver_version[MLAN_MAX_VER_STR_LEN];
|
||||
|
||||
|
|
@ -415,6 +428,7 @@ typedef enum _MOAL_HARDWARE_STATUS {
|
|||
#define WIFI_STATUS_FW_DUMP 9
|
||||
#define WIFI_STATUS_FW_RELOAD 10
|
||||
#define WIFI_STATUS_FW_RECOVERY_FAIL 11
|
||||
#define WIFI_STATUS_EMERGENCY_TEMP_REACHED 12
|
||||
|
||||
/** fw cap info 11p */
|
||||
#define FW_CAPINFO_80211P MBIT(24)
|
||||
|
|
@ -573,17 +587,9 @@ static inline void woal_mod_timer(pmoal_drv_timer timer,
|
|||
static inline void woal_cancel_timer(moal_drv_timer *timer)
|
||||
{
|
||||
if (timer->timer_is_periodic || in_atomic() || irqs_disabled())
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
timer_delete(&timer->tl);
|
||||
#else
|
||||
del_timer(&timer->tl);
|
||||
#endif
|
||||
else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
timer_delete_sync(&timer->tl);
|
||||
#else
|
||||
del_timer_sync(&timer->tl);
|
||||
#endif
|
||||
timer->timer_is_canceled = MTRUE;
|
||||
timer->time_period = 0;
|
||||
}
|
||||
|
|
@ -1293,6 +1299,9 @@ enum woal_event_type {
|
|||
#endif
|
||||
WOAL_EVENT_RGPWR_KEY_MISMATCH,
|
||||
WOAL_EVENT_RESET_WIFI,
|
||||
#ifdef UAP_SUPPORT
|
||||
WOAL_EVENT_AGCS,
|
||||
#endif /* UAP_SUPPORT */
|
||||
};
|
||||
|
||||
/** chan_rpt_info */
|
||||
|
|
@ -1326,6 +1335,10 @@ struct woal_event {
|
|||
mlan_deauth_param deauth_info;
|
||||
chan_radar_info radar_info;
|
||||
t_u8 deauth_evt_cnt;
|
||||
#ifdef UAP_SUPPORT
|
||||
/** AGCS event data for WOAL_EVENT_AGCS */
|
||||
agcs_event agcs_evt;
|
||||
#endif /* UAP_SUPPORT */
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -2711,6 +2724,7 @@ typedef struct _moal_mod_para {
|
|||
#if defined(UAP_SUPPORT)
|
||||
int custom_11d_bcn_country_ie_en;
|
||||
#endif
|
||||
int amsdu_disable;
|
||||
#if defined(SDIO)
|
||||
int slew_rate;
|
||||
#endif
|
||||
|
|
@ -2851,6 +2865,37 @@ typedef struct _moal_tp_acnt_t {
|
|||
moal_drv_timer timer;
|
||||
} moal_tp_acnt_t;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
typedef MLAN_PACK_START struct {
|
||||
t_u16 action;
|
||||
/* BIT0 - Enable Agile channel switching in CarPlay
|
||||
* BIT1 - no specific interference type check, but only check Tx or Rx
|
||||
* throughput drop
|
||||
*/
|
||||
t_u32 mode;
|
||||
/* Adjust the weight of TX/RX average packet count */
|
||||
t_u8 avg_threshold_percentage;
|
||||
/* The conservative amount of rx packet per second */
|
||||
t_u16 rx_min_pkt_count;
|
||||
/* The conservative amount of tx packet per second */
|
||||
t_u16 tx_min_pkt_count;
|
||||
/* Unit is ms */
|
||||
t_u32 sample_time;
|
||||
/* The latest sampled windows size */
|
||||
t_u8 sample_count_window;
|
||||
/* Continuous drop rapidly times */
|
||||
t_u8 continuous_hit_count;
|
||||
/* Make sure a reasonable rate can be sustained. */
|
||||
t_s8 nf_margin;
|
||||
/* The channel load threshold that the new channel needs to reach. */
|
||||
t_u8 chload_threshold_percentage;
|
||||
/* channel switch announcement count, default is 5 */
|
||||
t_u8 csa_cnt;
|
||||
/** Variable number (fixed maximum) of channels to scan up */
|
||||
wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
|
||||
} MLAN_PACK_END wlan_agcs_info;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
/** Handle data structure for MOAL */
|
||||
struct _moal_handle {
|
||||
/** MLAN adapter structure */
|
||||
|
|
@ -3200,6 +3245,8 @@ struct _moal_handle {
|
|||
t_u32 scan_timeout;
|
||||
|
||||
#endif
|
||||
/** emergency reset work*/
|
||||
struct delayed_work emergency_reset_work;
|
||||
#endif
|
||||
/** main state */
|
||||
t_u8 main_state;
|
||||
|
|
@ -3330,6 +3377,17 @@ struct _moal_handle {
|
|||
t_u32 ips_ctrl;
|
||||
BOOLEAN is_edmac_enabled;
|
||||
bool driver_init;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** agiled channel switch state */
|
||||
t_u32 agcs_state;
|
||||
/** The number of channels in the scan list */
|
||||
t_u32 agcs_num_in_chan_stats;
|
||||
/** Agiled channel switch info from cmd */
|
||||
wlan_agcs_info agcs_info;
|
||||
/* fw cap and cap_ext */
|
||||
mlan_hw_info hw_info;
|
||||
#endif /* UAP_SUPPORT */
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -4409,6 +4467,7 @@ t_void woal_pcie_tx_complete_work_queue(struct work_struct *work);
|
|||
#ifdef STA_CFG80211
|
||||
t_void woal_scan_timeout_handler(struct work_struct *work);
|
||||
#endif
|
||||
t_void woal_emergency_reset_handler(struct work_struct *work);
|
||||
|
||||
netdev_tx_t woal_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
#ifdef STA_SUPPORT
|
||||
|
|
@ -4424,6 +4483,7 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_num,
|
|||
t_u8 bss_type);
|
||||
void woal_clean_up(moal_handle *handle);
|
||||
void woal_send_auto_recovery_complete_event(moal_handle *handle);
|
||||
void woal_send_auto_recovery_start_event(moal_handle *handle);
|
||||
void woal_send_auto_recovery_failure_event(moal_handle *handle);
|
||||
void woal_remove_interface(moal_handle *handle, t_u8 bss_index);
|
||||
void woal_set_multicast_list(struct net_device *dev);
|
||||
|
|
@ -4684,5 +4744,14 @@ 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);
|
||||
#ifdef UAP_SUPPORT
|
||||
extern void woal_process_agcs_event(moal_private *priv,
|
||||
pagcs_stats pstart_event);
|
||||
extern void woal_process_ch_sel_and_switch(moal_private *priv,
|
||||
pagcs_event pevent);
|
||||
extern mlan_status moal_agcs_trans_state(moal_private *priv,
|
||||
agcs_state next_state);
|
||||
extern void woal_agcs_event(moal_private *priv, pagcs_event pacs_start_event);
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#endif /* _MOAL_MAIN_H */
|
||||
|
|
|
|||
|
|
@ -299,9 +299,7 @@ static mlan_status woal_reset_adma(moal_handle *handle)
|
|||
t_u32 value;
|
||||
t_u32 reset_reg = handle->card_info->fw_reset_reg;
|
||||
t_u8 reset_adma_val = 0x97;
|
||||
/* wake up device before set the reset reg */
|
||||
handle->ops.read_reg(handle, handle->card_info->fw_wakeup_reg, &value);
|
||||
udelay(100);
|
||||
|
||||
if (handle->ops.write_reg(handle, reset_reg, reset_adma_val) !=
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MERROR, "Failed to write register.\n");
|
||||
|
|
@ -492,7 +490,11 @@ perform_init:
|
|||
}
|
||||
if (woal_init_fw(handle)) {
|
||||
PRINTM(MFATAL, "Firmware Init Failed\n");
|
||||
woal_pcie_reg_dbg(handle);
|
||||
#ifdef PCIE
|
||||
if (!IS_PCIEAW693(handle->card_type))
|
||||
#endif
|
||||
woal_pcie_reg_dbg(handle);
|
||||
|
||||
if (fw_serial_bkp)
|
||||
moal_extflg_set(handle, EXT_FW_SERIAL);
|
||||
goto err_init_fw;
|
||||
|
|
@ -949,6 +951,11 @@ static void woal_pcie_reset_prepare(struct pci_dev *pdev)
|
|||
pcie_service_card *card;
|
||||
moal_handle *handle;
|
||||
moal_handle *ref_handle = NULL;
|
||||
#if defined(PCIEAW693)
|
||||
pcie_service_card *ref_card = NULL;
|
||||
t_u32 value;
|
||||
t_u32 count = 0;
|
||||
#endif
|
||||
|
||||
ENTER();
|
||||
|
||||
|
|
@ -984,8 +991,34 @@ static void woal_pcie_reset_prepare(struct pci_dev *pdev)
|
|||
ref_handle = (moal_handle *)handle->pref_mac;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PCIEAW693)
|
||||
/* WAR to Poll firmware dump flag for 5 seconds */
|
||||
while (count < 50 &&
|
||||
(handle->fw_dump || (ref_handle && ref_handle->fw_dump))) {
|
||||
woal_sched_timeout(100);
|
||||
count++;
|
||||
}
|
||||
|
||||
// This is just WAR for PRC release
|
||||
/* wake up device before set the reset reg */
|
||||
handle->ops.read_reg(handle, handle->card_info->fw_wakeup_reg, &value);
|
||||
mdelay(50);
|
||||
|
||||
/*Disable L1 before start of FLR*/
|
||||
pci_write_config_dword(card->dev, 0x80, 0x40);
|
||||
if (ref_handle)
|
||||
ref_card = (pcie_service_card *)ref_handle->card;
|
||||
if (ref_card)
|
||||
pci_write_config_dword(ref_card->dev, 0x80, 0x40);
|
||||
#endif
|
||||
|
||||
handle->surprise_removed = MTRUE;
|
||||
handle->fw_reseting = MTRUE;
|
||||
if (ref_handle) {
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
ref_handle->fw_reseting = MTRUE;
|
||||
}
|
||||
// TODO: Can add more chips once the related code has been ported to fw
|
||||
// v18
|
||||
if (IS_PCIE9097(handle->card_type) || IS_PCIE9098(handle->card_type) ||
|
||||
|
|
@ -995,8 +1028,6 @@ static void woal_pcie_reset_prepare(struct pci_dev *pdev)
|
|||
|
||||
woal_do_flr(handle, true, true);
|
||||
if (ref_handle) {
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
ref_handle->fw_reseting = MTRUE;
|
||||
woal_do_flr(ref_handle, true, true);
|
||||
}
|
||||
|
||||
|
|
@ -1012,6 +1043,9 @@ static void woal_pcie_reset_done(struct pci_dev *pdev)
|
|||
pcie_service_card *card;
|
||||
moal_handle *handle;
|
||||
moal_handle *ref_handle = NULL;
|
||||
#if defined(PCIEAW693)
|
||||
pcie_service_card *ref_card = NULL;
|
||||
#endif
|
||||
ENTER();
|
||||
|
||||
card = pci_get_drvdata(pdev);
|
||||
|
|
@ -1058,6 +1092,17 @@ static void woal_pcie_reset_done(struct pci_dev *pdev)
|
|||
wifi_status = WIFI_STATUS_OK;
|
||||
if (handle)
|
||||
woal_send_auto_recovery_complete_event(handle);
|
||||
|
||||
// This is just WAR for PRC release
|
||||
#if defined(PCIEAW693)
|
||||
/*Re-enable L1 before start of FLR*/
|
||||
pci_write_config_dword(card->dev, 0x80, 0x143);
|
||||
if (ref_handle)
|
||||
ref_card = (pcie_service_card *)ref_handle->card;
|
||||
if (ref_card)
|
||||
pci_write_config_dword(ref_card->dev, 0x80, 0x143);
|
||||
#endif
|
||||
|
||||
LEAVE();
|
||||
}
|
||||
#else
|
||||
|
|
@ -3058,12 +3103,17 @@ static void woal_pcie_work(struct work_struct *work)
|
|||
container_of(work, pcie_service_card, reset_work);
|
||||
moal_handle *handle = NULL;
|
||||
moal_handle *ref_handle = NULL;
|
||||
#if defined(PCIEAW693)
|
||||
pcie_service_card *ref_card = NULL;
|
||||
t_u32 value;
|
||||
#endif
|
||||
handle = card->handle;
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
PRINTM(MMSG, "========START IN-BAND RESET===========\n");
|
||||
|
||||
woal_send_auto_recovery_start_event(handle);
|
||||
// handle-> mac0 , ref_handle->second mac
|
||||
if (handle->pref_mac) {
|
||||
if (handle->second_mac) {
|
||||
|
|
@ -3078,6 +3128,20 @@ static void woal_pcie_work(struct work_struct *work)
|
|||
mlan_ioctl(ref_handle->pmlan_adapter, NULL);
|
||||
}
|
||||
}
|
||||
// This is just WAR for PRC release
|
||||
#if defined(PCIEAW693)
|
||||
/* wake up device before set the reset reg */
|
||||
handle->ops.read_reg(handle, handle->card_info->fw_wakeup_reg, &value);
|
||||
mdelay(50);
|
||||
|
||||
/*Disable L1 state before start of IN-BAND RESET*/
|
||||
pci_write_config_dword(card->dev, 0x80, 0x40);
|
||||
if (ref_handle)
|
||||
ref_card = (pcie_service_card *)ref_handle->card;
|
||||
if (ref_card)
|
||||
pci_write_config_dword(ref_card->dev, 0x80, 0x40);
|
||||
#endif
|
||||
|
||||
handle->surprise_removed = MTRUE;
|
||||
handle->fw_reseting = MTRUE;
|
||||
// TODO: Can add more chips once the related code has been ported to fw
|
||||
|
|
@ -3122,6 +3186,15 @@ static void woal_pcie_work(struct work_struct *work)
|
|||
card->work_flags = MFALSE;
|
||||
wifi_status = WIFI_STATUS_OK;
|
||||
woal_send_auto_recovery_complete_event(handle);
|
||||
|
||||
// This is just WAR for PRC release
|
||||
#if defined(PCIEAW693)
|
||||
/*Re-enable L1 state once IN-BAND RESET is done*/
|
||||
pci_write_config_dword(card->dev, 0x80, 0x143);
|
||||
if (ref_card)
|
||||
pci_write_config_dword(ref_card->dev, 0x80, 0x143);
|
||||
#endif
|
||||
|
||||
PRINTM(MMSG, "========END IN-BAND RESET===========\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* @brief This file contains 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
|
||||
|
|
|
|||
|
|
@ -3368,6 +3368,7 @@ static void woal_sdiommc_work(struct work_struct *work)
|
|||
moal_handle *ref_handle = NULL;
|
||||
PRINTM(MMSG, "========START IN-BAND RESET===========\n");
|
||||
handle = card->handle;
|
||||
woal_send_auto_recovery_start_event(handle);
|
||||
// handle-> mac0 , ref_handle->second mac
|
||||
if (handle->pref_mac) {
|
||||
if (handle->second_mac) {
|
||||
|
|
|
|||
|
|
@ -1046,6 +1046,9 @@ mlan_status moal_get_hw_spec_complete(t_void *pmoal, mlan_status status,
|
|||
}
|
||||
PRINTM(MCMND, "org_drv_mode=0x%x drv_mode=0x%x\n", drv_mode,
|
||||
handle->params.drv_mode);
|
||||
|
||||
moal_memcpy_ext(handle, &(handle->hw_info), phw,
|
||||
sizeof(mlan_hw_info), sizeof(mlan_hw_info));
|
||||
}
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
|
|
@ -3230,6 +3233,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
addba_timeout_event *evtbuf = NULL;
|
||||
|
||||
t_u8 auto_fw_dump = MFALSE;
|
||||
static int fw_reset_cnt = 0;
|
||||
t_u8 fw_reset_time = 0;
|
||||
ENTER();
|
||||
if (pmevent->event_id == MLAN_EVENT_ID_FW_DUMP_INFO) {
|
||||
if (!handle->is_fw_dump_timer_set) {
|
||||
|
|
@ -3424,6 +3429,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
priv->phandle->scan_time_start.time_usec = 0;
|
||||
}
|
||||
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_SCAN_REPORT);
|
||||
break;
|
||||
|
||||
case MLAN_EVENT_ID_DRV_OBSS_SCAN_PARAM:
|
||||
|
|
@ -3786,6 +3792,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
pmevent->event_len +
|
||||
strlen(FW_DEBUG_INFO) + 1);
|
||||
break;
|
||||
|
||||
case MLAN_EVENT_ID_FW_WMM_CONFIG_CHANGE:
|
||||
#ifdef STA_WEXT
|
||||
if (IS_STA_WEXT(cfg80211_wext))
|
||||
|
|
@ -4269,6 +4276,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef UAP_SUPPORT
|
||||
moal_agcs_trans_state(priv, AGCS_STATE_COMPLETE);
|
||||
#endif /* UAP_SUPPORT */
|
||||
break;
|
||||
case MLAN_EVENT_ID_FW_STOP_TX:
|
||||
woal_stop_queue(priv->netdev);
|
||||
|
|
@ -5316,6 +5326,25 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
"Ignoring the Channel Switch Reg Info Event\n");
|
||||
#endif
|
||||
break;
|
||||
case MLAN_EVENT_ID_EMERGENCY_TEMP_REACHED:
|
||||
fw_reset_time = (t_u8)pmevent->event_buf[4];
|
||||
if (fw_reset_time <= 0)
|
||||
fw_reset_time = 60;
|
||||
fw_reset_cnt++;
|
||||
PRINTM(MEVENT,
|
||||
"EMERGENCY TEMPRETURE REACHED: %d times...Wait for %d sec to cool down radio!!\n",
|
||||
fw_reset_cnt, fw_reset_time);
|
||||
|
||||
queue_delayed_work(priv->phandle->evt_workqueue,
|
||||
&priv->phandle->emergency_reset_work,
|
||||
msecs_to_jiffies(fw_reset_time * 1000));
|
||||
|
||||
break;
|
||||
#ifdef UAP_SUPPORT
|
||||
case MLAN_EVENT_ID_FW_AGCS_TRIGGER: {
|
||||
woal_agcs_event(priv, (pagcs_event)pmevent->event_buf);
|
||||
} break;
|
||||
#endif /* UAP_SUPPORT */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3047,31 +3047,24 @@ void woal_host_mlme_work_queue(struct work_struct *work)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief This workqueue function handles association timeout event in event
|
||||
* queue case
|
||||
* @brief This function handles fallback to previous AP in the event of
|
||||
* association failure.
|
||||
*
|
||||
* @param priv pointer to moal_private
|
||||
* @param assoc_info pointer to cfg80211_bss
|
||||
*
|
||||
* @return N/A
|
||||
* @return 0 -- success, otherwise fail
|
||||
*/
|
||||
|
||||
void woal_host_mlme_process_assoc_timeout(moal_private *priv,
|
||||
struct cfg80211_bss *bss)
|
||||
{
|
||||
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || \
|
||||
(defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33 && \
|
||||
CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 74)))
|
||||
struct cfg80211_assoc_failure data;
|
||||
#endif
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
static mlan_status woal_host_mlme_fallback_to_prev_ap(moal_private *priv)
|
||||
{
|
||||
mlan_ds_assoc_info *assoc_info;
|
||||
struct cfg80211_roam_info roam_info;
|
||||
chan_band_info channel;
|
||||
mlan_status status = MLAN_STATUS_FAILURE;
|
||||
|
||||
assoc_info = kzalloc(sizeof(mlan_ds_assoc_info), GFP_ATOMIC);
|
||||
if (!assoc_info)
|
||||
return;
|
||||
return status;
|
||||
memset(&roam_info, 0, sizeof(roam_info));
|
||||
memset(&channel, 0, sizeof(channel));
|
||||
|
||||
|
|
@ -3094,6 +3087,29 @@ void woal_host_mlme_process_assoc_timeout(moal_private *priv,
|
|||
roam_info.resp_ie = assoc_info->assoc_resp_buf;
|
||||
roam_info.resp_ie_len = assoc_info->assoc_resp_len;
|
||||
|
||||
if (priv->conn_ssid_len) {
|
||||
#if (CFG80211_VERSION_CODE > KERNEL_VERSION(5, 19, 1))
|
||||
if (priv->wdev->u.client.ssid_len == 0) {
|
||||
priv->wdev->u.client.ssid_len =
|
||||
priv->conn_ssid_len;
|
||||
moal_memcpy_ext(
|
||||
priv->phandle,
|
||||
(void *)priv->wdev->u.client.ssid,
|
||||
priv->conn_ssid, priv->conn_ssid_len,
|
||||
priv->wdev->u.client.ssid_len);
|
||||
}
|
||||
#else
|
||||
if (priv->wdev->ssid_len == 0) {
|
||||
priv->wdev->ssid_len = priv->conn_ssid_len;
|
||||
moal_memcpy_ext(priv->phandle,
|
||||
(void *)priv->wdev->ssid,
|
||||
priv->conn_ssid,
|
||||
priv->conn_ssid_len,
|
||||
priv->wdev->ssid_len);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
cfg80211_roamed(priv->netdev, &roam_info, GFP_KERNEL);
|
||||
priv->cfg_disconnect = MFALSE;
|
||||
priv->host_mlme = MTRUE;
|
||||
|
|
@ -3110,17 +3126,44 @@ void woal_host_mlme_process_assoc_timeout(moal_private *priv,
|
|||
if (MLAN_STATUS_FAILURE ==
|
||||
woal_chandef_create(priv, &priv->chan, &channel)) {
|
||||
PRINTM(MERROR,
|
||||
"Asssoc timeout:create chandef failed\n");
|
||||
"Assoc timeout:create chandef failed\n");
|
||||
}
|
||||
priv->channel = channel.channel;
|
||||
priv->bandwidth = channel.bandcfg.chanWidth;
|
||||
}
|
||||
|
||||
PRINTM(MMSG, "wlan: HostMlme fallback to AP " MACSTR "\n",
|
||||
MAC2STR(assoc_info->bssid));
|
||||
kfree(assoc_info);
|
||||
return;
|
||||
status = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
kfree(assoc_info);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This workqueue function handles association timeout event in event
|
||||
* queue case
|
||||
*
|
||||
* @param priv pointer to moal_private
|
||||
* @param assoc_info pointer to cfg80211_bss
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
void woal_host_mlme_process_assoc_timeout(moal_private *priv,
|
||||
struct cfg80211_bss *bss)
|
||||
{
|
||||
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || \
|
||||
(defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33 && \
|
||||
CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 74)))
|
||||
struct cfg80211_assoc_failure data;
|
||||
#endif
|
||||
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
if (woal_host_mlme_fallback_to_prev_ap(priv) == MLAN_STATUS_SUCCESS)
|
||||
return;
|
||||
#endif
|
||||
/* Send Assoc Failure with Timeout to CFG80211 */
|
||||
priv->host_mlme = MFALSE;
|
||||
|
|
@ -3137,11 +3180,23 @@ void woal_host_mlme_process_assoc_timeout(moal_private *priv,
|
|||
* API in CFG to hold/unhold BSS.
|
||||
*/
|
||||
woal_sched_timeout(100);
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
|
||||
wiphy_lock(priv->wdev->wiphy);
|
||||
#else
|
||||
mutex_lock(&priv->wdev->mtx);
|
||||
#endif
|
||||
cfg80211_assoc_failure(priv->netdev, &data);
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
|
||||
wiphy_unlock(priv->wdev->wiphy);
|
||||
#else
|
||||
mutex_unlock(&priv->wdev->mtx);
|
||||
#endif
|
||||
#else
|
||||
PRINTM(MEVENT, "wlan: HostMlme assoc timeout\n");
|
||||
woal_sched_timeout(100);
|
||||
mutex_lock(&priv->wdev->mtx);
|
||||
cfg80211_assoc_timeout(priv->netdev, bss);
|
||||
mutex_unlock(&priv->wdev->mtx);
|
||||
#endif
|
||||
memset(priv->cfg_bssid, 0, ETH_ALEN);
|
||||
woal_clear_conn_params(priv);
|
||||
|
|
@ -3385,6 +3440,77 @@ static void woal_assoc_resp_event(moal_private *priv,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef WLAN_AKM_SUITE_SAE
|
||||
#define WLAN_AKM_SUITE_SAE 0x000FAC08
|
||||
#endif
|
||||
|
||||
#ifndef WLAN_AKM_SUITE_OWE
|
||||
#define WLAN_AKM_SUITE_OWE 0x000FAC12
|
||||
#endif
|
||||
|
||||
#ifndef WLAN_AKM_SUITE_WFA_DPP
|
||||
#define WLAN_AKM_SUITE_WFA_DPP 0x506F9A02
|
||||
#endif
|
||||
|
||||
#define WLAN_STATUS_FCG_NOT_SUPPORTED 77
|
||||
|
||||
/**
|
||||
* @brief This function decides if fallback to previous AP
|
||||
* approach is allowed for the assoc resp failure.
|
||||
*
|
||||
* @param priv A pointer to moal_private structure
|
||||
*
|
||||
* @param req A pointer to cfg80211_assoc_request
|
||||
*
|
||||
* @param passoc_resp A pointer to mlan_ds_misc_assoc_rsp structure
|
||||
*
|
||||
* @return true -- allowed, false -- not allowed
|
||||
*/
|
||||
static bool
|
||||
is_fallback_allowed_for_assoc_resp(moal_private *priv,
|
||||
struct cfg80211_assoc_request *req,
|
||||
mlan_ds_misc_assoc_rsp *passoc_resp)
|
||||
{
|
||||
IEEEtypes_AssocRsp_t *passoc_rsp =
|
||||
(IEEEtypes_AssocRsp_t *)(passoc_resp->assoc_resp_buf +
|
||||
sizeof(IEEEtypes_MgmtHdr_t));
|
||||
|
||||
if (priv->phandle->params.make_before_break == false)
|
||||
return false;
|
||||
|
||||
// Needs PMKSA clearing for SAE.
|
||||
if (req->crypto.n_akm_suites &&
|
||||
req->crypto.akm_suites[0] == WLAN_AKM_SUITE_SAE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (passoc_rsp->status_code) {
|
||||
// DPP cases handling.
|
||||
case WLAN_STATUS_ASSOC_DENIED_UNSPEC:
|
||||
case WLAN_STATUS_INVALID_AKMP:
|
||||
if (req->crypto.n_akm_suites &&
|
||||
req->crypto.akm_suites[0] == WLAN_AKM_SUITE_WFA_DPP) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
// Results in trying next supported DH group.
|
||||
case WLAN_STATUS_FCG_NOT_SUPPORTED:
|
||||
if (req->crypto.n_akm_suites &&
|
||||
req->crypto.akm_suites[0] == WLAN_AKM_SUITE_OWE) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
// MBO use case. Temp disallow bss in upper layer.
|
||||
case WLAN_STATUS_ASSOC_DENIED_LOWACK:
|
||||
// Assoc temp rejection. PMF cases.
|
||||
case WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is association handler when host MLME
|
||||
* enable.
|
||||
|
|
@ -3657,7 +3783,9 @@ done:
|
|||
if (ssid_bssid->assoc_rsp.assoc_resp_len &&
|
||||
ssid_bssid->assoc_rsp.assoc_resp_len >
|
||||
(sizeof(IEEEtypes_MgmtHdr_t) +
|
||||
sizeof(IEEEtypes_AssocRsp_t))) {
|
||||
sizeof(IEEEtypes_AssocRsp_t)) &&
|
||||
(is_fallback_allowed_for_assoc_resp(
|
||||
priv, req, &ssid_bssid->assoc_rsp) == false)) {
|
||||
// save the connection param when send assoc_resp to
|
||||
// kernel
|
||||
woal_save_assoc_params(priv, req, ssid_bssid);
|
||||
|
|
|
|||
|
|
@ -1867,13 +1867,14 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
|
|||
->ht_cap.cap &
|
||||
0x13ff)) |
|
||||
0x0c;
|
||||
else
|
||||
else if (wiphy->bands[IEEE80211_BAND_5GHZ]) {
|
||||
sys_config->ht_cap_info =
|
||||
(ht_cap &
|
||||
(wiphy->bands[IEEE80211_BAND_5GHZ]
|
||||
->ht_cap.cap &
|
||||
0x13ff)) |
|
||||
0x0c;
|
||||
}
|
||||
}
|
||||
PRINTM(MCMND,
|
||||
"11n=%d, ht_cap=0x%x, channel=%d, bandcfg:chanBand=0x%x chanWidth=0x%x chan2Offset=0x%x scanMode=0x%x\n",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue