mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2026-11-20 18:39:49 -05:00
Driver commit for release MM6X18542.p2_V1 2025-12-24_16:21:31
Firmware version for commit: W9098-17.92.1.p149.82 IW416-16.92.21.p155 W8987-16.92.21.p153.7 IW612-18.99.3.p29.1 IW610-18.99.5.p86 AW693-18.99.2.p145.161 Signed-off-by: Pushpendra Tiwari <pushpendra.tiwari@nxp.com>
This commit is contained in:
parent
7b05b57625
commit
e753dc757d
54 changed files with 2870 additions and 1134 deletions
59
Makefile
59
Makefile
|
|
@ -37,14 +37,9 @@ CONFIG_PCIE8897=n
|
|||
CONFIG_SD8977=n
|
||||
CONFIG_SD8978=y
|
||||
CONFIG_USB8978=n
|
||||
CONFIG_SD8997=n
|
||||
CONFIG_USB8997=n
|
||||
CONFIG_PCIE8997=n
|
||||
CONFIG_SD8987=y
|
||||
CONFIG_SD9097=n
|
||||
CONFIG_SD9177=y
|
||||
CONFIG_SD8801=n
|
||||
CONFIG_USB8801=n
|
||||
CONFIG_USB9097=n
|
||||
CONFIG_PCIE9097=n
|
||||
CONFIG_SD9098=y
|
||||
|
|
@ -154,6 +149,7 @@ ifeq ($(ANDROID_BUILD), 1)
|
|||
PWD := $(shell pwd)
|
||||
KERNELDIR ?= $(KERNEL_SRC)
|
||||
ccflags-y += -DANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)
|
||||
CONFIG_SD8978=n
|
||||
endif
|
||||
|
||||
MODEXT = ko
|
||||
|
|
@ -186,7 +182,9 @@ APPDIR= $(shell if test -d "mapp"; then echo mapp; fi)
|
|||
#############################################################################
|
||||
|
||||
ccflags-y += -I$(KERNELDIR)/include
|
||||
ccflags-y += -DMLAN_RELEASE_VERSION='"540.p34"'
|
||||
ccflags-y += -DMLAN_RELEASE_VERSION='"542.p2"'
|
||||
ccflags-y += -DMLAN_EXT_RELEASE_VERSION='"542.p2"'
|
||||
ccflags-y += -DREL_MILESTONE='""'
|
||||
|
||||
ccflags-y += -DFPNUM='"92"'
|
||||
|
||||
|
|
@ -294,10 +292,6 @@ ifeq ($(CONFIG_SD8978),y)
|
|||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSD8978
|
||||
endif
|
||||
ifeq ($(CONFIG_SD8997),y)
|
||||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSD8997
|
||||
endif
|
||||
ifeq ($(CONFIG_SD8987),y)
|
||||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSD8987
|
||||
|
|
@ -317,6 +311,10 @@ endif
|
|||
ifeq ($(CONFIG_SDAW693),y)
|
||||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSDAW693
|
||||
CONFIG_SECURE_HOST=n
|
||||
ifeq ($(CONFIG_SECURE_HOST), y)
|
||||
BINDIR = secure_hostif_wlan_bin
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CONFIG_SD9177),y)
|
||||
CONFIG_SDIO=y
|
||||
|
|
@ -330,10 +328,6 @@ ifeq ($(CONFIG_USB8897),y)
|
|||
CONFIG_MUSB=y
|
||||
ccflags-y += -DUSB8897
|
||||
endif
|
||||
ifeq ($(CONFIG_USB8997),y)
|
||||
CONFIG_MUSB=y
|
||||
ccflags-y += -DUSB8997
|
||||
endif
|
||||
ifeq ($(CONFIG_USB8978),y)
|
||||
CONFIG_MUSB=y
|
||||
ccflags-y += -DUSB8978
|
||||
|
|
@ -358,10 +352,6 @@ ifeq ($(CONFIG_PCIE8897),y)
|
|||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIE8897
|
||||
endif
|
||||
ifeq ($(CONFIG_PCIE8997),y)
|
||||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIE8997
|
||||
endif
|
||||
ifeq ($(CONFIG_PCIE9097),y)
|
||||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIE9097
|
||||
|
|
@ -381,6 +371,10 @@ ifeq ($(CONFIG_PCIEAW693),y)
|
|||
ifeq ($(ANDROID_BUILD), 1)
|
||||
CONFIG_XDP_SUPPORT=n
|
||||
endif
|
||||
CONFIG_SECURE_HOST=n
|
||||
ifeq ($(CONFIG_SECURE_HOST), y)
|
||||
BINDIR = secure_hostif_wlan_bin
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CONFIG_SDIO),y)
|
||||
ccflags-y += -DSDIO
|
||||
|
|
@ -526,6 +520,9 @@ endif
|
|||
|
||||
# Default for out-of-tree builds
|
||||
CONFIG_NXP_WLAN_DRIVER ?= m
|
||||
ifeq ($(CONFIG_SECURE_HOST), y)
|
||||
ccflags-y += -DSECURE_HOST
|
||||
endif
|
||||
|
||||
MOALOBJS = mlinux/moal_main.o \
|
||||
mlinux/moal_ioctl.o \
|
||||
|
|
@ -607,6 +604,32 @@ endif
|
|||
|
||||
|
||||
|
||||
ifeq ($(CONFIG_SECURE_HOST),y)
|
||||
ccflags-y += -I$(src)/nanotls/include
|
||||
ccflags-y += -I$(src)/nanotls/lib/include
|
||||
ccflags-y += -I$(src)/nanotls/lib/aes/include
|
||||
|
||||
ccflags-y += -I$(src)/include
|
||||
ccflags-y += -I$(src)/lib/include
|
||||
ccflags-y += -I$(src)/lib/aes/include
|
||||
ccflags-y += -I$(KERNELDIR)/include/linux
|
||||
ccflags-y += -std=gnu99
|
||||
ccflags-y += -Wno-format-security -Wno-unused-but-set-variable -Wno-declaration-after-statement
|
||||
MLANOBJS += mlan/mlan_shc.o
|
||||
MOALOBJS += nanotls/lib/src/blockwise.o \
|
||||
nanotls/lib/src/chash.o \
|
||||
nanotls/lib/src/hmac.o \
|
||||
nanotls/lib/src/p256-m.o \
|
||||
nanotls/lib/src/sha256.o \
|
||||
nanotls/lib/aes/src/aes.o \
|
||||
nanotls/lib/aes/src/gcm.o \
|
||||
nanotls/src/nanotls-common.o \
|
||||
nanotls/src/nanotls-hooks.o \
|
||||
nanotls/src/nanotls-host.o \
|
||||
nanotls/src/nanotls-device.o \
|
||||
nanotls/src/nanotls-data.o \
|
||||
mlinux/moal_shc.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_NXP_WLAN_DRIVER) := mlan.o
|
||||
mlan-objs := $(MLANOBJS)
|
||||
|
|
|
|||
7
README
7
README
|
|
@ -158,7 +158,7 @@
|
|||
For 9097/9098: antcfg=0x101|0x303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G>
|
||||
For IW624/AW693: antcfg=0x10101|0x30303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G, Bit16: Tx/Rx Path A for 6G, Bit17: Tx/Rx Path B for 6G>
|
||||
For AW693, it's recommended to use mod_para configuration file for antcfg as MAC1 supports 2x2 and MAC2 supports only 1x1.
|
||||
For 8897/8997: antcfg=0x11|0x13|0x33 <Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B>
|
||||
For 8897: antcfg=0x11|0x13|0x33 <Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B>
|
||||
For others: antcfg=0|1|2|0xffff <default | Tx/Rx antenna 1 | Tx/Rx antenna 2 | enable antenna diversity>
|
||||
plinkstats=0|1|2 <Disable plinkstats (default) | Enable plinkstats | Restore plinkstats>
|
||||
Example usage:
|
||||
|
|
@ -275,6 +275,9 @@
|
|||
this bit is only used with STA BSS
|
||||
others -- reserved
|
||||
|
||||
secure_host=0|1 <Disable secure host interface (default) | Enable secure host interface>
|
||||
Note: For secure_host=1, Firmware image shall be secure host enabled.
|
||||
|
||||
bandctrl=0|1 <Disable bandctrl mode (default) | Enable bandctrl mode>
|
||||
|
||||
Note: On some platforms (e.g. PXA910/920) double quotation marks ("") need to used
|
||||
|
|
@ -461,7 +464,7 @@
|
|||
echo "fw_reload=4" > /proc/mwlan/adapterX/config trigger PCIe FLR and reload firmware.
|
||||
echo "fw_reload=6" > /proc/mwlan/adapterX/config trigger PCIe inband firmware reset and reload firmware.
|
||||
|
||||
(Note: This feature will be supported on IW416 and 8997.
|
||||
(Note: This feature will be supported on IW416.
|
||||
For 8987, it only work with the board which supports parallel fw download)
|
||||
|
||||
6) FOR RF test mode commands:
|
||||
|
|
|
|||
|
|
@ -844,18 +844,6 @@ 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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ 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);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ Change Log:
|
|||
#endif /* PCIE */
|
||||
#include "mlan_init.h"
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
#include "mlan_shc.h"
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
|
@ -1550,8 +1554,16 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv,
|
|||
(t_u8 *)pcmd + S_DS_GEN)),
|
||||
cmd_size, wlan_le16_to_cpu(pcmd->seq_num), timeout);
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (!pmadapter->shc_secure_host)
|
||||
#endif
|
||||
DBG_HEXDUMP(MCMD_D, "DNLD_CMD", (t_u8 *)pcmd, cmd_size);
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host)
|
||||
DBG_HEXDUMP(MSHC_D, "DNLD_CMD", (t_u8 *)pcmd, cmd_size);
|
||||
#endif
|
||||
|
||||
#if defined(SDIO) || defined(PCIE)
|
||||
if (!IS_USB(pmadapter->card_type)) {
|
||||
pcmd_node->cmdbuf->data_offset -=
|
||||
|
|
@ -1560,6 +1572,23 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host &&
|
||||
wlan_is_secure_host_cmd(pcmd->command) == MTRUE) {
|
||||
if (wlan_shc_secure_hostcmd_process(pmadapter, pcmd) !=
|
||||
MLAN_STATUS_FAILURE) {
|
||||
pcmd_node->cmdbuf->data_len += 16;
|
||||
PRINTM(MCMND, "%s is encrypted",
|
||||
wlan_hostcmd_get_name(cmd_code));
|
||||
DBG_HEXDUMP(MCMD_D, "Encrypted DNLD_CMD", (t_u8 *)pcmd,
|
||||
pcmd->size);
|
||||
} else {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Send the command to lower layer */
|
||||
ret = pmadapter->ops.host_to_card(pmpriv, MLAN_TYPE_CMD,
|
||||
pcmd_node->cmdbuf, MNULL);
|
||||
|
|
@ -2465,6 +2494,15 @@ static void wlan_handle_cmd_error_in_pre_aleep(mlan_adapter *pmadapter,
|
|||
MLAN_STATUS_SUCCESS);
|
||||
pcmd_node->respbuf = MNULL;
|
||||
}
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host) {
|
||||
memcpy_ext(pmadapter,
|
||||
pcmd_node->cmdbuf->pbuf +
|
||||
pcmd_node->cmdbuf->data_offset,
|
||||
rsp, rsp->size, rsp->size);
|
||||
pcmd_node->cmdbuf->data_len = rsp->size;
|
||||
}
|
||||
#endif
|
||||
wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node, MFALSE);
|
||||
}
|
||||
|
||||
|
|
@ -2529,6 +2567,15 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
resp = (HostCmd_DS_COMMAND *)(pmadapter->curr_cmd->respbuf->pbuf +
|
||||
pmadapter->curr_cmd->respbuf->data_offset);
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host) {
|
||||
if (wlan_shc_secure_hostresp_process(pmadapter, resp) !=
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
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) {
|
||||
|
|
@ -2661,6 +2708,9 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
/* Check init command response */
|
||||
if (pmadapter->hw_status == WlanHardwareStatusInitializing ||
|
||||
pmadapter->hw_status == WlanHardwareStatusGetHwSpec
|
||||
#ifdef SECURE_HOST
|
||||
|| pmadapter->hw_status == WlanHardwareStatusSecHandshake
|
||||
#endif
|
||||
) {
|
||||
if (ret == MLAN_STATUS_FAILURE) {
|
||||
#if 0
|
||||
|
|
@ -2680,6 +2730,13 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
PRINTM(MERROR,
|
||||
"cmd 0x%02x failed during initialization\n",
|
||||
cmdresp_no);
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->hw_status ==
|
||||
WlanHardwareStatusSecHandshake) {
|
||||
PRINTM(MERROR,
|
||||
"secure host handshake incomplete\n");
|
||||
}
|
||||
#endif
|
||||
wlan_init_fw_complete(pmadapter);
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -2755,6 +2812,26 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
|
|||
(HostCmd_CMD_GET_HW_SPEC == cmdresp_no)) {
|
||||
pmadapter->hw_status = WlanHardwareStatusGetHwSpecdone;
|
||||
}
|
||||
#ifdef SECURE_HOST
|
||||
else if (IS_CARDAW693(pmadapter->card_type) &&
|
||||
pmadapter->shc_secure_host &&
|
||||
(pmadapter->hw_status == WlanHardwareStatusGetHwSpec) &&
|
||||
(HostCmd_CMD_FUNC_INIT == cmdresp_no)) {
|
||||
if (!pmadapter->second_mac) {
|
||||
pmadapter->hw_status = WlanHardwareStatusSecHandshake;
|
||||
PRINTM(MMSG, "secure host handshake start\n");
|
||||
ret = mlan_shc_handshake(pmadapter, TLS_HOST_HELLO,
|
||||
MNULL);
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
pmadapter->hw_status =
|
||||
WlanHardwareStatusNotReady;
|
||||
wlan_init_fw_complete(pmadapter);
|
||||
}
|
||||
} else {
|
||||
wlan_adapter_get_hw_spec(pmadapter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
done:
|
||||
LEAVE();
|
||||
|
|
@ -5432,6 +5509,48 @@ mlan_status wlan_cmd_func_init(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd)
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
mlan_status wlan_adapter_func_init(pmlan_adapter pmadapter)
|
||||
{
|
||||
mlan_status ret;
|
||||
pmlan_private priv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY);
|
||||
|
||||
ENTER();
|
||||
#if defined(SDIO)
|
||||
/*
|
||||
* This should be issued in the very first to config
|
||||
* SDIO_GPIO interrupt mode.
|
||||
*/
|
||||
if (IS_SD(pmadapter->card_type) &&
|
||||
(wlan_set_sdio_gpio_int(priv) != MLAN_STATUS_SUCCESS)) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PCIE
|
||||
if (IS_PCIE(pmadapter->card_type) &&
|
||||
(MLAN_STATUS_SUCCESS != wlan_set_pcie_buf_config(priv))) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_FUNC_INIT, HostCmd_ACT_GEN_SET,
|
||||
0, MNULL, MNULL);
|
||||
if (ret) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
||||
done:
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function issues adapter specific commands
|
||||
* to initialize firmware
|
||||
|
|
@ -5464,18 +5583,27 @@ mlan_status wlan_adapter_get_hw_spec(pmlan_adapter pmadapter)
|
|||
|
||||
#ifdef PCIE
|
||||
if (IS_PCIE(pmadapter->card_type) &&
|
||||
#ifdef SECURE_HOST
|
||||
!pmadapter->shc_secure_host &&
|
||||
#endif
|
||||
(MLAN_STATUS_SUCCESS != wlan_set_pcie_buf_config(priv))) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (!pmadapter->shc_secure_host) {
|
||||
#endif
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_FUNC_INIT,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
if (ret) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
#ifdef SECURE_HOST
|
||||
}
|
||||
#endif
|
||||
|
||||
/** DPD data dnld cmd prepare */
|
||||
if ((pmadapter->pdpd_data) && (pmadapter->dpd_data_len > 0)) {
|
||||
|
|
@ -6003,21 +6131,9 @@ mlan_status wlan_process_vdll_event(pmlan_private pmpriv, pmlan_buffer pevent)
|
|||
break;
|
||||
case VDLL_IND_TYPE_INTF_RESET:
|
||||
PRINTM(MEVENT, "VDLL_IND (INTF_RESET)\n");
|
||||
#ifdef PCIE8997
|
||||
/* For PCIe PFU, need to reset both Tx and Rx rd/wrptr */
|
||||
if (IS_PCIE8997(pmadapter->card_type)) {
|
||||
pmadapter->pcard_pcie->txbd_wrptr = 0;
|
||||
pmadapter->pcard_pcie->txbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->rxbd_wrptr =
|
||||
pmadapter->pcard_pcie->reg
|
||||
->txrx_rw_ptr_rollover_ind;
|
||||
pmadapter->pcard_pcie->rxbd_rdptr = 0;
|
||||
}
|
||||
#endif
|
||||
#if defined(SD8997) || defined(SD8987) || defined(SD8978)
|
||||
#if defined(SD8987) || defined(SD8978)
|
||||
/* For SDIO, need to reset wr_port only */
|
||||
if (IS_SD8997(pmadapter->card_type) ||
|
||||
IS_SD8987(pmadapter->card_type) ||
|
||||
if (IS_SD8987(pmadapter->card_type) ||
|
||||
IS_SD8978(pmadapter->card_type)) {
|
||||
pmadapter->pcard_sd->curr_wr_port =
|
||||
pmadapter->pcard_sd->reg->start_wr_port;
|
||||
|
|
@ -6912,6 +7028,7 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
t_u16 left_len;
|
||||
t_u16 tlv_type = 0;
|
||||
t_u16 tlv_len = 0;
|
||||
t_u16 fw_pl_ver = 0;
|
||||
MrvlIEtypes_fw_ver_info_t *api_rev = MNULL;
|
||||
t_u16 api_id = 0;
|
||||
MrvlIEtypesHeader_t *tlv = MNULL;
|
||||
|
|
@ -6921,6 +7038,7 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
MrvlIEtypes_fw_cap_info_t *fw_cap_tlv = MNULL;
|
||||
|
||||
MrvlIEtypes_Secure_Boot_Uuid_t *sb_uuid_tlv = MNULL;
|
||||
MrvlIEtypes_fw_ver_ie_t *fw_ver_ie = MNULL;
|
||||
t_u32 feature_mask = 0;
|
||||
|
||||
ENTER();
|
||||
|
|
@ -6990,17 +7108,16 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
pmadapter->fw_country_code = wlan_le16_to_cpu(hw_spec->fw_country_code);
|
||||
PRINTM(MCMND, "GET_HW_SPEC: country_code=0x%X\n",
|
||||
pmadapter->fw_country_code);
|
||||
pmadapter->fw_release_number =
|
||||
wlan_le32_to_cpu(hw_spec->fw_release_number);
|
||||
pmadapter->number_of_antenna =
|
||||
wlan_le16_to_cpu(hw_spec->number_of_antenna) & 0x00ff;
|
||||
pmadapter->antinfo =
|
||||
(wlan_le16_to_cpu(hw_spec->number_of_antenna) & 0xff00) >> 8;
|
||||
PRINTM(MCMND, "num_ant=%d, antinfo=0x%x\n",
|
||||
pmadapter->number_of_antenna, pmadapter->antinfo);
|
||||
|
||||
PRINTM(MINFO, "GET_HW_SPEC: fw_release_number- 0x%X\n",
|
||||
pmadapter->fw_release_number);
|
||||
memcpy(pmadapter, &pmadapter->fw_release_number,
|
||||
&hw_spec->fw_release_number, sizeof(hw_spec->fw_release_number));
|
||||
pmadapter->fw_release_number.patchLevel =
|
||||
((t_u8 *)(&hw_spec->fw_release_number))[3];
|
||||
PRINTM(MINFO, "GET_HW_SPEC: Permanent addr- " MACSTR "\n",
|
||||
MAC2STR(hw_spec->permanent_addr));
|
||||
PRINTM(MINFO, "GET_HW_SPEC: hw_if_version=0x%X version=0x%X\n",
|
||||
|
|
@ -7199,6 +7316,49 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
PRINTM(MCMND, "fw hotfix ver=%d\n",
|
||||
api_rev->major_ver);
|
||||
break;
|
||||
case FW_PL_VER_ID:
|
||||
fw_pl_ver = ((api_rev->minor_ver << 8) |
|
||||
(api_rev->major_ver));
|
||||
pmadapter->fw_release_number.patchLevel =
|
||||
fw_pl_ver;
|
||||
PRINTM(MCMND,
|
||||
"GET_HW_SPEC: fw_release_number received from FW: v%d.%d.%d.%d\n",
|
||||
pmadapter->fw_release_number.majorRevNum,
|
||||
pmadapter->fw_release_number.minorRevNum,
|
||||
pmadapter->fw_release_number.releaseNum,
|
||||
pmadapter->fw_release_number.patchLevel);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NXP_VERSION_COMPONENTS_TLV_ID:
|
||||
fw_ver_ie = (MrvlIEtypes_fw_ver_ie_t *)tlv;
|
||||
api_id = wlan_le16_to_cpu(fw_ver_ie->api_id);
|
||||
switch (api_id) {
|
||||
case FW_MILESTONE_VER_ID:
|
||||
memcpy(pmadapter, pmadapter->fw_ver_milestone,
|
||||
fw_ver_ie->ver_ie_ptr,
|
||||
tlv_len - sizeof(fw_ver_ie->api_id));
|
||||
PRINTM(MCMND,
|
||||
"GET_HW_SPEC: FW build milestone: %s\n",
|
||||
pmadapter->fw_ver_milestone);
|
||||
break;
|
||||
case FW_BUILDTYPE_VER_ID:
|
||||
memcpy(pmadapter, pmadapter->fw_ver_buildtype,
|
||||
fw_ver_ie->ver_ie_ptr,
|
||||
tlv_len - sizeof(fw_ver_ie->api_id));
|
||||
PRINTM(MCMND, "GET_HW_SPEC: FW buildtype: %s\n",
|
||||
pmadapter->fw_ver_buildtype);
|
||||
break;
|
||||
case FW_COMMIT_INFO_VER_ID:
|
||||
memcpy(pmadapter, pmadapter->fw_ver_data,
|
||||
fw_ver_ie->ver_ie_ptr,
|
||||
tlv_len - sizeof(fw_ver_ie->api_id));
|
||||
PRINTM(MCMND,
|
||||
"GET_HW_SPEC: FW version data: %s\n",
|
||||
pmadapter->fw_ver_data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -11731,6 +11891,7 @@ mlan_status wlan_ret_foundry_type(pmlan_private pmpriv,
|
|||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of RANGE_EXT
|
||||
*
|
||||
|
|
@ -12054,6 +12215,14 @@ mlan_status wlan_ret_get_sensor_temp(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
mlan_status wlan_process_secure_host_event(pmlan_private pmpriv, t_u8 *data,
|
||||
t_u32 len)
|
||||
{
|
||||
return wlan_shc_process_secure_host_event(pmpriv, data, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function prepares command to configure edmac
|
||||
*
|
||||
|
|
|
|||
|
|
@ -376,8 +376,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_8897 0x02
|
||||
/** 8977 card type */
|
||||
#define CARD_TYPE_8977 0x03
|
||||
/** 8997 card type */
|
||||
#define CARD_TYPE_8997 0x04
|
||||
/** 8987 card type */
|
||||
#define CARD_TYPE_8987 0x05
|
||||
/** 9098 card type */
|
||||
|
|
@ -418,8 +416,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_SD8977 (CARD_TYPE_8977 | (INTF_SD << 8))
|
||||
/** SD8978 card type */
|
||||
#define CARD_TYPE_SD8978 (CARD_TYPE_8978 | (INTF_SD << 8))
|
||||
/** SD8997 card type */
|
||||
#define CARD_TYPE_SD8997 (CARD_TYPE_8997 | (INTF_SD << 8))
|
||||
/** SD8987 card type */
|
||||
#define CARD_TYPE_SD8987 (CARD_TYPE_8987 | (INTF_SD << 8))
|
||||
/** SD9097 card type */
|
||||
|
|
@ -441,7 +437,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
|
||||
#define IS_SD8977(ct) (CARD_TYPE_SD8977 == (ct))
|
||||
#define IS_SD8978(ct) (CARD_TYPE_SD8978 == (ct))
|
||||
#define IS_SD8997(ct) (CARD_TYPE_SD8997 == (ct))
|
||||
#define IS_SD8987(ct) (CARD_TYPE_SD8987 == (ct))
|
||||
#define IS_SD9097(ct) (CARD_TYPE_SD9097 == (ct))
|
||||
#define IS_SD9098(ct) (CARD_TYPE_SD9098 == (ct))
|
||||
|
|
@ -459,8 +454,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_SD8977 "SD8977"
|
||||
/** SD8978 Card */
|
||||
#define CARD_SD8978 "SDIW416"
|
||||
/** SD8997 Card */
|
||||
#define CARD_SD8997 "SD8997"
|
||||
/** SD8987 Card */
|
||||
#define CARD_SD8987 "SD8987"
|
||||
/** SD9097 Card */
|
||||
|
|
@ -484,8 +477,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#ifdef PCIE
|
||||
/** PCIE8897 card type */
|
||||
#define CARD_TYPE_PCIE8897 (CARD_TYPE_8897 | (INTF_PCIE << 8))
|
||||
/** PCIE8997 card type */
|
||||
#define CARD_TYPE_PCIE8997 (CARD_TYPE_8997 | (INTF_PCIE << 8))
|
||||
/** PCIE9097 card type */
|
||||
#define CARD_TYPE_PCIE9097 (CARD_TYPE_9097 | (INTF_PCIE << 8))
|
||||
/** PCIE9098 card type */
|
||||
|
|
@ -496,7 +487,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_PCIEAW693 (CARD_TYPE_AW693 | (INTF_PCIE << 8))
|
||||
|
||||
#define IS_PCIE8897(ct) (CARD_TYPE_PCIE8897 == (ct))
|
||||
#define IS_PCIE8997(ct) (CARD_TYPE_PCIE8997 == (ct))
|
||||
#define IS_PCIE9097(ct) (CARD_TYPE_PCIE9097 == (ct))
|
||||
#define IS_PCIE9098(ct) (CARD_TYPE_PCIE9098 == (ct))
|
||||
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
|
||||
|
|
@ -504,8 +494,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
|
||||
/** PCIE8897 Card */
|
||||
#define CARD_PCIE8897 "PCIE8897"
|
||||
/** PCIE8997 Card */
|
||||
#define CARD_PCIE8997 "PCIE8997"
|
||||
/** PCIE9097 Card */
|
||||
#define CARD_PCIE9097 "PCIEIW620"
|
||||
/** PCIE9000S Card */
|
||||
|
|
@ -533,8 +521,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_USB8801 (CARD_TYPE_8801 | (INTF_USB << 8))
|
||||
/** USB8897 card type */
|
||||
#define CARD_TYPE_USB8897 (CARD_TYPE_8897 | (INTF_USB << 8))
|
||||
/** USB8997 card type */
|
||||
#define CARD_TYPE_USB8997 (CARD_TYPE_8997 | (INTF_USB << 8))
|
||||
/** USB8978 card type */
|
||||
#define CARD_TYPE_USB8978 (CARD_TYPE_8978 | (INTF_USB << 8))
|
||||
/** USB9098 card type */
|
||||
|
|
@ -548,7 +534,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
|
||||
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
|
||||
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
|
||||
#define IS_USB8997(ct) (CARD_TYPE_USB8997 == (ct))
|
||||
#define IS_USB8978(ct) (CARD_TYPE_USB8978 == (ct))
|
||||
#define IS_USB9098(ct) (CARD_TYPE_USB9098 == (ct))
|
||||
#define IS_USB9097(ct) (CARD_TYPE_USB9097 == (ct))
|
||||
|
|
@ -559,8 +544,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_USB8801 "USB8801"
|
||||
/** USB8897 Card */
|
||||
#define CARD_USB8897 "USB8897"
|
||||
/** USB8997 Card */
|
||||
#define CARD_USB8997 "USB8997"
|
||||
/** USB8978 Card */
|
||||
#define CARD_USB8978 "USBIW416"
|
||||
/** USB9098 Card */
|
||||
|
|
@ -578,7 +561,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define IS_CARD8897(ct) (CARD_TYPE_8897 == ((ct)&0xf))
|
||||
#define IS_CARD8977(ct) (CARD_TYPE_8977 == ((ct)&0xf))
|
||||
#define IS_CARD8978(ct) (CARD_TYPE_8978 == ((ct)&0xf))
|
||||
#define IS_CARD8997(ct) (CARD_TYPE_8997 == ((ct)&0xf))
|
||||
#define IS_CARD8987(ct) (CARD_TYPE_8987 == ((ct)&0xf))
|
||||
#define IS_CARD9098(ct) (CARD_TYPE_9098 == ((ct)&0xf))
|
||||
#define IS_CARD9097(ct) (CARD_TYPE_9097 == ((ct)&0xf))
|
||||
|
|
@ -692,6 +674,9 @@ typedef enum {
|
|||
#define MFWDP_D MBIT(21)
|
||||
#endif /*FWDUMP_VIA_PRINT*/
|
||||
#define MSCH_D MBIT(22)
|
||||
#ifdef SECURE_HOST
|
||||
#define MSHC_D MBIT(23)
|
||||
#endif
|
||||
#define MENTRY MBIT(28)
|
||||
#define MWARN MBIT(29)
|
||||
#define MINFO MBIT(30)
|
||||
|
|
@ -2814,7 +2799,27 @@ typedef struct _mlan_callbacks {
|
|||
void (*moal_write_u16)(void *dest, t_u16 val);
|
||||
void (*moal_write_u32)(void *dest, t_u32 val);
|
||||
} moal_unaligned_access;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
t_u8 (*moal_secure_host_get_msg_id)(t_void *msg);
|
||||
mlan_status (*moal_secure_host_init)(t_void *pmoal, const t_u8 key[64],
|
||||
const t_u8 uuid[16]);
|
||||
void (*moal_secure_host_cleanup)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_do_hello)(t_void *pmoal, t_void **msg);
|
||||
mlan_status (*moal_secure_host_device_hello_rcvd)(t_void *pmoal,
|
||||
t_void *msg);
|
||||
mlan_status (*moal_secure_host_do_finished)(t_void *pmoal,
|
||||
t_void **msg);
|
||||
mlan_status (*moal_secure_host_derive_traffic_keys)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_data_ctx_init)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_data_encrypt)(t_void *pmoal,
|
||||
t_void **enc_data,
|
||||
t_void **payload,
|
||||
t_u32 len);
|
||||
mlan_status (*moal_secure_host_data_decrypt)(t_void *pmoal,
|
||||
t_void **dec_data,
|
||||
t_void **payload,
|
||||
t_u32 len);
|
||||
#endif
|
||||
t_u32 (*moal_crc32_be)(t_u32 initial_crc, t_u8 const *data,
|
||||
unsigned long len);
|
||||
} mlan_callbacks, *pmlan_callbacks;
|
||||
|
|
@ -2998,6 +3003,9 @@ typedef struct _mlan_device {
|
|||
t_u8 disable_11h_tpc;
|
||||
t_u8 tpe_ie_ignore;
|
||||
t_u32 amsdu_disable;
|
||||
#ifdef SECURE_HOST
|
||||
t_u32 secure_host;
|
||||
#endif
|
||||
} mlan_device, *pmlan_device;
|
||||
|
||||
/** MLAN API function prototype */
|
||||
|
|
@ -3113,11 +3121,11 @@ MLAN_API void mlan_process_pcie_interrupt_cb(t_void *pmadapter, int type);
|
|||
#endif
|
||||
|
||||
#ifndef SINT32_MAX
|
||||
#define SINT32_MAX 0x7fffffff
|
||||
#define SINT32_MAX 2147483647
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MIN
|
||||
#define SINT32_MIN 0x80000000
|
||||
#define SINT32_MIN (-2147483647 - 1)
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
|
|
|
|||
|
|
@ -235,6 +235,10 @@ ENUM_ELEMENT(EVENT_DUMMY_HOST_WAKEUP_SIGNAL, 0x0001),
|
|||
ENUM_ELEMENT(EVENT_FW_IN_BAND_RESET, 0x00AD),
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
ENUM_ELEMENT(EVENT_SECURE_HOST_COMM, 0x00AE),
|
||||
#endif
|
||||
|
||||
/** Event ID: WiFi uAP Channel Avoidance */
|
||||
ENUM_ELEMENT(EVENT_WIFI_CHANNEL_AVOID_LIST, 0x00AF),
|
||||
|
||||
|
|
|
|||
|
|
@ -1207,6 +1207,11 @@ typedef enum _ENH_PS_MODES {
|
|||
EN_AUTO_PS = 0xff,
|
||||
} ENH_PS_MODES;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
/** Secure Host command, payload is encrypted*/
|
||||
#define HostCmd_Encrypted_BIT 0x4000
|
||||
#endif
|
||||
|
||||
/** Command RET code, MSB is set to 1 */
|
||||
#define HostCmd_RET_BIT 0x8000
|
||||
|
||||
|
|
@ -2393,6 +2398,22 @@ typedef MLAN_PACK_START struct _HostCmd_DS_GTK_REKEY_PARAMS {
|
|||
t_u32 replay_ctr_high;
|
||||
} MLAN_PACK_END HostCmd_DS_GTK_REKEY_PARAMS;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
typedef MLAN_PACK_START struct _SECURE_HOST_MSG_HEADER {
|
||||
t_u32 magic;
|
||||
t_u16 len;
|
||||
t_u8 id;
|
||||
t_u8 version;
|
||||
} MLAN_PACK_END SECURE_HOST_MSG_HEADER;
|
||||
|
||||
typedef MLAN_PACK_START struct _HostCmd_DS_SECURE_HOST {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** TLS handshake message data */
|
||||
t_u8 tls_data[1024];
|
||||
} MLAN_PACK_END HostCmd_DS_SECURE_HOST;
|
||||
#endif
|
||||
|
||||
/** Data structure of WMM QoS information */
|
||||
typedef MLAN_PACK_START struct _WmmQosInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
|
|
@ -2808,8 +2829,22 @@ enum API_VER_ID {
|
|||
UAP_FW_API_VER_ID = 3,
|
||||
CHANRPT_API_VER_ID = 4,
|
||||
FW_HOTFIX_VER_ID = 5,
|
||||
FW_PL_VER_ID = 6,
|
||||
FW_MILESTONE_VER_ID = 7,
|
||||
FW_BUILDTYPE_VER_ID = 8,
|
||||
FW_COMMIT_INFO_VER_ID = 9,
|
||||
};
|
||||
|
||||
/** MrvlIEtypes_fw_ver_info_t */
|
||||
typedef MLAN_PACK_START struct _MrvlIEtypes_fw_ver_ie_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** API id */
|
||||
t_u16 api_id;
|
||||
/** fw version details */
|
||||
t_u8 ver_ie_ptr[];
|
||||
} MLAN_PACK_END MrvlIEtypes_fw_ver_ie_t;
|
||||
|
||||
/** FW AP V15 */
|
||||
#define HOST_API_VERSION_V15 15
|
||||
/** FW minor version 1 */
|
||||
|
|
@ -4670,6 +4705,7 @@ typedef MLAN_PACK_START struct _hostcmd_twt_report {
|
|||
typedef MLAN_PACK_START struct _HostCmd_DS_GET_FOUNDRY_TYPE {
|
||||
t_u8 foundry_type;
|
||||
} MLAN_PACK_END HostCmd_DS_GET_FOUNDRY_TYPE;
|
||||
|
||||
/** Type definition of hostcmd_twt_information */
|
||||
typedef struct MLAN_PACK_START _hostcmd_twt_information {
|
||||
/** TWT Flow Identifier. Range: [0-7] */
|
||||
|
|
@ -5236,6 +5272,9 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_SAE_PWE_Mode_t {
|
|||
|
||||
/** SAE H2E capability bit in RSNX */
|
||||
#define SAE_H2E_BIT 5
|
||||
/** SSID Protection capability bit in RSNX */
|
||||
#define SSID_PROTECTION_BIT 21
|
||||
#define SSID_PROTECTION_OCTET3_BIT 5
|
||||
|
||||
/* rsnMode -
|
||||
* Bit 0 : No RSN
|
||||
|
|
@ -6555,6 +6594,14 @@ typedef MLAN_PACK_START struct _HostCmd_DS_PACKET_AGGR_OVER_HOST_INTERFACE {
|
|||
} MLAN_PACK_END HostCmd_DS_PACKET_AGGR_OVER_HOST_INTERFACE;
|
||||
#endif /* USB */
|
||||
|
||||
/** HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG */
|
||||
typedef MLAN_PACK_START struct _HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG {
|
||||
/** ACT_GET/ACT_SET */
|
||||
t_u16 action;
|
||||
/** LTE COEX BAND */
|
||||
t_u8 band;
|
||||
} MLAN_PACK_END HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG;
|
||||
|
||||
/** HostCmd_CONFIG_LOW_PWR_MODE */
|
||||
typedef MLAN_PACK_START struct _HostCmd_CONFIG_LOW_PWR_MODE {
|
||||
/** Enable LPM */
|
||||
|
|
@ -6977,7 +7024,7 @@ typedef MLAN_PACK_START struct _HostCmd_DS_PCIE_ADMA_INIT {
|
|||
t_u8 reserved;
|
||||
} HostCmd_DS_PCIE_ADMA_INIT;
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/** PCIE ring buffer description for DATA */
|
||||
typedef MLAN_PACK_START struct _mlan_pcie_data_buf {
|
||||
/** Buffer descriptor flags */
|
||||
|
|
@ -7838,7 +7885,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
HostCmd_DS_802_11_NET_MONITOR net_mon;
|
||||
HostCmd_DS_CMD_TX_DATA_PAUSE tx_data_pause;
|
||||
#if defined(PCIE)
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
HostCmd_DS_PCIE_HOST_BUF_DETAILS pcie_host_spec;
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -7861,6 +7908,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
HostCmd_DS_MULTI_CHAN_CFG multi_chan_cfg;
|
||||
HostCmd_DS_MULTI_CHAN_POLICY multi_chan_policy;
|
||||
HostCmd_DS_DRCS_CFG drcs_cfg;
|
||||
HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG lte_coex_cfg;
|
||||
HostCmd_CONFIG_LOW_PWR_MODE low_pwr_mode_cfg;
|
||||
HostCmd_DS_TSF tsf;
|
||||
HostCmd_DS_DFS_REPEATER_MODE dfs_repeater;
|
||||
|
|
@ -7924,6 +7972,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t mfg_tx_trigger_config;
|
||||
mfg_cmd_otp_mac_addr_rd_wr_t mfg_otp_mac_addr_rd_wr;
|
||||
mfg_cmd_otp_cal_data_rd_wr_t mfg_otp_cal_data_rd_wr;
|
||||
mfg_CmdDebugTemperature_Cfg_t mfg_debug_temp;
|
||||
HostCmd_DS_CMD_ARB_CONFIG arb_cfg;
|
||||
HostCmd_DS_CMD_DOT11MC_UNASSOC_FTM_CFG dot11mc_unassoc_ftm_cfg;
|
||||
HostCmd_DS_HAL_PHY_CFG hal_phy_cfg_params;
|
||||
|
|
@ -7941,6 +7990,10 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
HostCmd_CMD_802_11_STA_TX_RATE sta_rx_rate;
|
||||
HostCmd_MCLIENT_SCHEDULE_CFG mclient_cfg;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
HostCmd_DS_SECURE_HOST shc;
|
||||
#endif
|
||||
|
||||
/** WMM HOST ADDTS */
|
||||
HostCmd_DS_WMM_HOST_ADDTS_REQ host_add_ts;
|
||||
/** WMM HOST DELTS */
|
||||
|
|
@ -7949,6 +8002,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
|
|||
HostCmd_DS_AUTH_ASSOC_TIMEOUT_CFG auth_assoc_cfg;
|
||||
t_u8 assoc_rsp_buf[ASSOC_RSP_BUF_SIZE];
|
||||
HostCmd_DS_GET_FOUNDRY_TYPE foundry_type;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** Agiled channel switch configuration */
|
||||
HostCmd_DS_AGCS_CFG agcs_cfg;
|
||||
|
|
@ -8091,4 +8145,21 @@ typedef MLAN_PACK_START struct _Event_DPD_CAL_t {
|
|||
t_u8 sub_band;
|
||||
} MLAN_PACK_END Event_DPD_CAL_t;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
typedef MLAN_PACK_START struct _SECURE_HOST_EVENT_HEADER {
|
||||
/** Type ID */
|
||||
t_u16 type_id;
|
||||
t_u16 bbs;
|
||||
/** Action */
|
||||
t_u16 tls_action;
|
||||
} MLAN_PACK_END SECURE_HOST_EVENT_HEADER;
|
||||
|
||||
typedef MLAN_PACK_START struct SECURE_HOST_EVENT {
|
||||
/** TLS handshake message header */
|
||||
SECURE_HOST_EVENT_HEADER tls_header;
|
||||
/** TLS handshake message data */
|
||||
t_u8 tls_data[];
|
||||
} MLAN_PACK_END SECURE_HOST_EVENT;
|
||||
#endif
|
||||
|
||||
#endif /* !_MLAN_FW_H_ */
|
||||
|
|
|
|||
|
|
@ -355,6 +355,8 @@ ENUM_ELEMENT(HostCmd_CMD_GET_HW_SPEC, 0x0003),
|
|||
|
||||
ENUM_ELEMENT(HostCmd_CMD_FW_DUMP_EVENT, 0x0125),
|
||||
|
||||
ENUM_ELEMENT(HostCmd_CMD_LTE_COEX_BAND_CONFIG, 0x0126),
|
||||
|
||||
ENUM_ELEMENT(HostCmd_CMD_CONFIG_LOW_POWER_MODE, 0x0128),
|
||||
|
||||
/** Host Command ID : Target device access */
|
||||
|
|
@ -491,6 +493,10 @@ ENUM_ELEMENT(HostCmd_CMD_GET_HW_SPEC, 0x0003),
|
|||
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAV_MITIGATION_HW_CFG, 0x0294),
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
ENUM_ELEMENT(HostCmd_CMD_SECURE_HOST, 0x0295),
|
||||
#endif
|
||||
|
||||
/** Host Command ID : To enable/disable/force-enable PPB feature */
|
||||
ENUM_ELEMENT(HostCmd_CMD_PREAMBLE_PWR_BOOST, 0x0296),
|
||||
/* Always keep this last */
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,14 @@ typedef MLAN_PACK_START struct _IEEEtypes_OverlapBSSScanParam_t {
|
|||
} MLAN_PACK_END IEEEtypes_OverlapBSSScanParam_t,
|
||||
*pIEEEtypes_OverlapBSSScanParam_t;
|
||||
|
||||
/** MrvlIEtypes_rsnx_ie_t */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_rsnx_ie_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** data (3 octets) */
|
||||
t_u8 data[3];
|
||||
} MLAN_PACK_END IEEEtypes_rsnx_ie_t, *pIEEEtypes_rsnx_ie_t;
|
||||
|
||||
/** VHT MCS rate set field, refer to 802.11ac */
|
||||
typedef MLAN_PACK_START struct _VHT_MCS_set {
|
||||
t_u16 rx_mcs_map;
|
||||
|
|
|
|||
|
|
@ -944,7 +944,13 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
|
|||
pmadapter->fw_bands = 0;
|
||||
pmadapter->config_bands = 0;
|
||||
pmadapter->pscan_channels = MNULL;
|
||||
pmadapter->fw_release_number = 0;
|
||||
pmadapter->fw_release_number.releaseNum = 0;
|
||||
pmadapter->fw_release_number.minorRevNum = 0;
|
||||
pmadapter->fw_release_number.majorRevNum = 0;
|
||||
pmadapter->fw_release_number.patchLevel = 0;
|
||||
pmadapter->fw_ver_milestone[0] = '\0';
|
||||
pmadapter->fw_ver_buildtype[0] = '\0';
|
||||
pmadapter->fw_ver_data[0] = '\0';
|
||||
pmadapter->fw_cap_info = 0;
|
||||
memset(pmadapter, &pmadapter->upld_buf, 0, sizeof(pmadapter->upld_buf));
|
||||
pmadapter->upld_len = 0;
|
||||
|
|
@ -975,7 +981,7 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
|
|||
pmadapter->pcard_pcie->rxbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->evtbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->txbd_pending = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pmadapter->pcard_pcie->rxbd_wrptr =
|
||||
pmadapter->pcard_pcie->reg
|
||||
|
|
@ -1572,8 +1578,16 @@ mlan_status wlan_init_fw(pmlan_adapter pmadapter)
|
|||
wlan_init_adapter(pmadapter);
|
||||
#ifdef MFG_CMD_SUPPORT
|
||||
if (pmadapter->mfg_mode != MTRUE) {
|
||||
#endif
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host) {
|
||||
wlan_adapter_func_init(pmadapter);
|
||||
} else {
|
||||
#endif
|
||||
wlan_adapter_get_hw_spec(pmadapter);
|
||||
#ifdef SECURE_HOST
|
||||
}
|
||||
#endif
|
||||
#ifdef MFG_CMD_SUPPORT
|
||||
}
|
||||
#ifdef PCIE
|
||||
|
|
@ -1585,6 +1599,9 @@ mlan_status wlan_init_fw(pmlan_adapter pmadapter)
|
|||
}
|
||||
|
||||
if (((pmadapter->card_type) & 0xff) == CARD_TYPE_AW693
|
||||
#ifdef SECURE_HOST
|
||||
&& (!pmadapter->shc_secure_host)
|
||||
#endif
|
||||
) {
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_FUNC_INIT,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
|
|
|
|||
|
|
@ -308,6 +308,8 @@ enum _mlan_ioctl_req_id {
|
|||
#endif
|
||||
MLAN_OID_MISC_TDLS_OPER = 0x00200026,
|
||||
MLAN_OID_MISC_GET_TDLS_IES = 0x00200027,
|
||||
MLAN_OID_MISC_LTE_COEX_CFG = 0x00200028,
|
||||
|
||||
MLAN_OID_MISC_LOW_PWR_MODE = 0x00200029,
|
||||
MLAN_OID_MISC_MEF_FLT_CFG = 0x0020002A,
|
||||
MLAN_OID_MISC_DFS_REAPTER_MODE = 0x0020002B,
|
||||
|
|
@ -400,11 +402,16 @@ enum _mlan_ioctl_req_id {
|
|||
MLAN_OID_MISC_FOUNDRY_TYPE = 0X0020009B,
|
||||
|
||||
MLAN_OID_MISC_NAV_MITIGATION_HW = 0x0020009C,
|
||||
|
||||
MLAN_OID_MISC_PREAMBLE_PWR_BOOST = 0x0020009D,
|
||||
MLAN_OID_MISC_PER_BAND_TXPWR_CAP = 0x0020009E,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x0020009F,
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x002000A0,
|
||||
#endif /* UAP_SUPPORT */
|
||||
MLAN_OID_SEC_CFG_SSID_PROTECTION = 0x002000A1,
|
||||
MLAN_OID_MISC_RF_TEST_DEBUG_TEMPERATURE = 0x002000A2
|
||||
|
||||
};
|
||||
|
||||
/** Sub command size */
|
||||
|
|
@ -454,6 +461,9 @@ enum _mlan_ext_scan {
|
|||
MLAN_EXT_SCAN_ENH
|
||||
};
|
||||
|
||||
#define MAX_RFUS 2
|
||||
#define MAX_PATHS 2
|
||||
|
||||
/** Max number of supported rates */
|
||||
#define MLAN_SUPPORTED_RATES 32
|
||||
|
||||
|
|
@ -2009,10 +2019,22 @@ typedef struct _mlan_ds_get_signal {
|
|||
/** bit for 5 G antenna diversity */
|
||||
#define ANT_DIVERSITY_5G MBIT(7)
|
||||
|
||||
/** firmware complete version number */
|
||||
typedef struct {
|
||||
/** FW release number */
|
||||
t_u8 releaseNum;
|
||||
/** minor version */
|
||||
t_u8 minorRevNum;
|
||||
/** major version */
|
||||
t_u8 majorRevNum;
|
||||
/** patch level version */
|
||||
t_u16 patchLevel;
|
||||
} fw_release_version_t;
|
||||
|
||||
/** mlan_fw_info data structure for MLAN_OID_GET_FW_INFO */
|
||||
typedef struct _mlan_fw_info {
|
||||
/** Firmware version */
|
||||
t_u32 fw_ver;
|
||||
fw_release_version_t fw_ver;
|
||||
/** Firmware Hotfix version */
|
||||
t_u8 hotfix_version;
|
||||
/** tx buf size */
|
||||
|
|
@ -2083,6 +2105,12 @@ typedef struct _mlan_fw_info {
|
|||
t_u8 sec_rgpower;
|
||||
/*country code from OTP*/
|
||||
t_u16 fw_country_code;
|
||||
/** firmware version milestone */
|
||||
char fw_ver_milestone[10];
|
||||
/** firmware version buildtype */
|
||||
char fw_ver_buildtype[10];
|
||||
/** firmware version data */
|
||||
char fw_ver_data[30];
|
||||
} mlan_fw_info, *pmlan_fw_info;
|
||||
|
||||
/** Version string buffer length */
|
||||
|
|
@ -3001,6 +3029,7 @@ typedef struct _mlan_ds_sec_cfg {
|
|||
t_u8 sta_mac[MLAN_MAC_ADDR_LENGTH];
|
||||
#endif
|
||||
mlan_ds_passphrase roam_passphrase[MAX_SEC_SSID_NUM];
|
||||
t_u32 ssid_protection;
|
||||
} param;
|
||||
} mlan_ds_sec_cfg, *pmlan_ds_sec_cfg;
|
||||
|
||||
|
|
@ -5649,6 +5678,13 @@ typedef struct _mlan_ds_misc_tdls_ies {
|
|||
t_u8 regulatory_class[IEEE_MAX_IE_SIZE];
|
||||
} mlan_ds_misc_tdls_ies;
|
||||
|
||||
/** Type definition of mlan_ds_misc_lte_coex_band_cfg
|
||||
* for MLAN_OID_MISC_LTE_COEX_CFG */
|
||||
typedef struct _mlan_ds_misc_lte_coex_band_cfg {
|
||||
/** LTE COEX BAND */
|
||||
t_u8 band;
|
||||
} mlan_ds_misc_lte_coex_band_cfg;
|
||||
|
||||
typedef struct _mlan_ds_misc_dfs_repeater {
|
||||
/** Set or Get */
|
||||
t_u16 action;
|
||||
|
|
@ -6113,7 +6149,7 @@ typedef struct _mlan_ds_misc_chan_trpc_cfg {
|
|||
#define MFG_CMD_CONFIG_TRIGGER_FRAME 0x110C
|
||||
#define MFG_CMD_OTP_MAC_ADD 0x108C
|
||||
#define MFG_CMD_OTP_CAL_DATA 0x121A
|
||||
|
||||
#define MFG_CMD_SET_DEBUG_TEMPERATURE 0x121f
|
||||
/** MFG CMD generic cfg */
|
||||
struct MLAN_PACK_START mfg_cmd_generic_cfg {
|
||||
/** MFG command code */
|
||||
|
|
@ -6441,6 +6477,24 @@ typedef MLAN_PACK_START struct _mfg_cmd_otp_cal_data_rd_wr_t {
|
|||
t_u8 cal_data[CAL_DATA_LEN];
|
||||
} MLAN_PACK_END mfg_cmd_otp_cal_data_rd_wr_t;
|
||||
|
||||
/** Thermal simulation structure */
|
||||
typedef MLAN_PACK_START struct _mfg_cmd_set_debug_temperature {
|
||||
/** MFG command code */
|
||||
t_u32 mfg_cmd;
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Device ID */
|
||||
t_u16 device_id;
|
||||
/** MFG Error code */
|
||||
t_u32 error;
|
||||
/** enable/disable thermal simulation */
|
||||
t_u32 simulation_enable;
|
||||
/** CAU temperature to be set */
|
||||
t_s32 cau_temperature;
|
||||
/** RFU temperature to be set */
|
||||
t_s32 rfu_temperature[MAX_RFUS][MAX_PATHS];
|
||||
} MLAN_PACK_END mfg_CmdDebugTemperature_Cfg_t;
|
||||
|
||||
typedef struct _mlan_ds_misc_chnrgpwr_cfg {
|
||||
/** length */
|
||||
t_u16 length;
|
||||
|
|
@ -6536,8 +6590,6 @@ typedef struct _mlan_ds_foundry_type {
|
|||
t_u8 foundry_type;
|
||||
} mlan_ds_foundry_type;
|
||||
|
||||
#define MAX_RFUS 2
|
||||
#define MAX_PATHS 2
|
||||
typedef struct _mlan_ds_tsp_cfg {
|
||||
/** TSP config action 0-GET, 1-SET */
|
||||
t_u16 action;
|
||||
|
|
@ -6771,6 +6823,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_gpio_tsf_latch gpio_tsf_latch_config;
|
||||
mlan_ds_tsf_info tsf_info;
|
||||
mlan_ds_coalesce_cfg coalesce_cfg;
|
||||
mlan_ds_misc_lte_coex_band_cfg lte_cfg;
|
||||
t_u8 low_pwr_mode;
|
||||
/** MEF-FLT-CONFIG for MLAN_OID_MISC_NV_FLT_CFG */
|
||||
mlan_ds_misc_mef_flt_cfg mef_flt_cfg;
|
||||
|
|
@ -6830,6 +6883,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t mfg_tx_trigger_config;
|
||||
mfg_cmd_otp_mac_addr_rd_wr_t mfg_otp_mac_addr_rd_wr;
|
||||
mfg_cmd_otp_cal_data_rd_wr_t mfg_otp_cal_data_rd_wr;
|
||||
mfg_CmdDebugTemperature_Cfg_t mfg_debug_temp;
|
||||
mlan_ds_misc_arb_cfg arb_cfg;
|
||||
mlan_ds_misc_cfp_tbl cfp;
|
||||
t_u8 range_ext_mode;
|
||||
|
|
@ -6851,7 +6905,9 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_gpio_cfg_ops gpio_cfg_ops;
|
||||
mlan_ds_auth_assoc_timeout_cfg auth_assoc_cfg;
|
||||
mlan_ds_foundry_type soc_foundry_type;
|
||||
|
||||
mlan_ds_misc_per_band_txpwr_cap per_band_txpwr_cap;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** config AGCS for MLAN_OID_MISC_AGCS_CONFIG */
|
||||
mlan_ds_agcs_cfg agcs_cfg;
|
||||
|
|
|
|||
|
|
@ -1216,7 +1216,42 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
pos += sizeof(pauth_tlv->header) + pauth_tlv->header.len;
|
||||
pauth_tlv->header.len = wlan_cpu_to_le16(pauth_tlv->header.len);
|
||||
}
|
||||
|
||||
/* insert RSNX IE TLV */
|
||||
if (pbss_desc->prsnx_ie != MNULL && pbss_desc->prsnx_ie->ieee_hdr.len) {
|
||||
IEEEtypes_rsnx_ie_t *rsnx_tlv;
|
||||
t_u16 len = 0;
|
||||
rsnx_tlv = (IEEEtypes_rsnx_ie_t *)pos;
|
||||
rsnx_tlv->header.type = wlan_cpu_to_le16(TLV_TYPE_RSNX);
|
||||
rsnx_tlv->data[0] = rsnx_tlv->data[1] = rsnx_tlv->data[2] = 0;
|
||||
if (pauth_tlv != MNULL &&
|
||||
(pauth_tlv->auth_type ==
|
||||
wlan_cpu_to_le16(AssocAgentAuth_Wpa3Sae)) &&
|
||||
(pbss_desc->prsnx_ie->data[0] & (0x1 << SAE_H2E_BIT))) {
|
||||
/* Set SAE H2E bit in the first octet */
|
||||
rsnx_tlv->data[0] |= (0x1 << SAE_H2E_BIT);
|
||||
len = 1;
|
||||
}
|
||||
if (pmpriv->ssid_protection &&
|
||||
(pbss_desc->prsnx_ie->ieee_hdr.len > 2) &&
|
||||
(pbss_desc->prsnx_ie->data[2] &
|
||||
(0x1 << SSID_PROTECTION_OCTET3_BIT))) {
|
||||
/* Set SSID Protection capability bit in the third
|
||||
* octet, set bit 1 in the first octet and increment the
|
||||
* len to 3
|
||||
*/
|
||||
rsnx_tlv->data[0] |= 2;
|
||||
rsnx_tlv->data[2] |=
|
||||
(0x1 << SSID_PROTECTION_OCTET3_BIT);
|
||||
len = 3;
|
||||
}
|
||||
if (len) {
|
||||
rsnx_tlv->header.len = wlan_cpu_to_le16(len);
|
||||
pos += sizeof(rsnx_tlv->header) + len;
|
||||
}
|
||||
}
|
||||
/* attach PWE TLV for backwards compatibility with the FW versions
|
||||
* which doesn't support RSNX IE or ssid protection capability
|
||||
*/
|
||||
if ((pauth_tlv != MNULL) &&
|
||||
(pauth_tlv->auth_type ==
|
||||
wlan_cpu_to_le16(AssocAgentAuth_Wpa3Sae))) {
|
||||
|
|
@ -1237,7 +1272,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
sizeof(psae_pwe_mode_tlv->pwe);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_SUPPORT_MULTI_BANDS(pmadapter) &&
|
||||
(pbss_desc->bss_band & pmpriv->config_bands) &&
|
||||
!(ISSUPP_11NENABLED(pmadapter->fw_cap_info) &&
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ Change log:
|
|||
#ifndef _MLAN_MAIN_H_
|
||||
#define _MLAN_MAIN_H_
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
#include "nanotls-host.h"
|
||||
#endif
|
||||
|
||||
#define PUBLIC_KEY_SIZE 64
|
||||
#define UUID_LEN 16
|
||||
|
||||
|
|
@ -599,10 +603,10 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
|
|||
#define SDIO_CMD53_MAX_SIZE 65280
|
||||
#define MAX_SUPPORT_AMSDU_SIZE 4096
|
||||
/** Maximum numbfer of registers to read for multiple port */
|
||||
#if defined(SD8887) || defined(SD8997) || defined(SD8977) || \
|
||||
defined(SD8987) || defined(SD9098) || defined(SD9097) || \
|
||||
defined(SDAW693) || defined(SDIW624) || defined(SD8978) || \
|
||||
defined(SD9177) || defined(SDIW610)
|
||||
#if defined(SD8887) || defined(SD8977) || defined(SD8987) || \
|
||||
defined(SD9098) || defined(SD9097) || defined(SDAW693) || \
|
||||
defined(SDIW624) || defined(SD8978) || defined(SD9177) || \
|
||||
defined(SDIW610)
|
||||
#define MAX_MP_REGS 196
|
||||
#else
|
||||
/* upto 0xB7 */
|
||||
|
|
@ -645,6 +649,7 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
|
|||
#define MFG_CMD_RADIO_MODE_CFG 0x1211
|
||||
#define MFG_CMD_CONFIG_MAC_HE_TB_TX 0x110A
|
||||
#define MFG_CMD_CONFIG_TRIGGER_FRAME 0x110C
|
||||
#define MFG_CMD_SET_DEBUG_TEMPERATURE 0x121f
|
||||
|
||||
/** Debug command number */
|
||||
#define DBG_CMD_NUM 10
|
||||
|
|
@ -725,6 +730,9 @@ typedef enum _WLAN_HARDWARE_STATUS {
|
|||
WlanHardwareStatusReady,
|
||||
WlanHardwareStatusGetHwSpec,
|
||||
WlanHardwareStatusGetHwSpecdone,
|
||||
#ifdef SECURE_HOST
|
||||
WlanHardwareStatusSecHandshake,
|
||||
#endif
|
||||
WlanHardwareStatusInitializing,
|
||||
WlanHardwareStatusInitdone,
|
||||
WlanHardwareStatusReset,
|
||||
|
|
@ -1325,6 +1333,8 @@ typedef struct _mlan_private {
|
|||
/* Mgmt Frame Protection config */
|
||||
mlan_ds_misc_pmfcfg pmfcfg;
|
||||
#endif
|
||||
/* SSID Protection capability */
|
||||
t_u8 ssid_protection;
|
||||
/** WAPI IE */
|
||||
t_u8 wapi_ie[256];
|
||||
/** WAPI IE length */
|
||||
|
|
@ -1669,6 +1679,10 @@ struct _sta_node {
|
|||
IEEEtypes_HTInfo_t HTInfo;
|
||||
/** peer BSSCO_20_40*/
|
||||
IEEEtypes_2040BSSCo_t BSSCO_20_40;
|
||||
/* Support operating class IE */
|
||||
IEEEtypes_Generic_t OperClass;
|
||||
/*Extended capability*/
|
||||
IEEEtypes_ExtCap_t ExtCap;
|
||||
/*RSN IE*/
|
||||
IEEEtypes_Generic_t rsn_ie;
|
||||
/**Link ID*/
|
||||
|
|
@ -1700,10 +1714,6 @@ 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 */
|
||||
|
|
@ -2518,6 +2528,18 @@ typedef struct _adapter_operations {
|
|||
t_u32 intf_header_len;
|
||||
} mlan_adapter_operations;
|
||||
|
||||
/** firmware complete version number */
|
||||
typedef struct _fw_release_version {
|
||||
/** FW release number */
|
||||
t_u8 releaseNum;
|
||||
/** minor version */
|
||||
t_u8 minorRevNum;
|
||||
/** major version */
|
||||
t_u8 majorRevNum;
|
||||
/** patch level version */
|
||||
t_u16 patchLevel;
|
||||
} fw_release_version;
|
||||
|
||||
/** Adapter data structure for MLAN */
|
||||
struct _mlan_adapter {
|
||||
/** MOAL handle structure */
|
||||
|
|
@ -2611,9 +2633,15 @@ struct _mlan_adapter {
|
|||
|
||||
/** Radio on flag */
|
||||
t_u16 radio_on;
|
||||
|
||||
fw_release_version fw_release_number;
|
||||
/** Firmware release number */
|
||||
t_u32 fw_release_number;
|
||||
// t_u32 fw_release_number;
|
||||
/** firmware version milestone */
|
||||
char fw_ver_milestone[10];
|
||||
/** firmware version buildtype */
|
||||
char fw_ver_buildtype[10];
|
||||
/** firmware version data */
|
||||
char fw_ver_data[30];
|
||||
/** firmware version */
|
||||
t_u8 fw_ver;
|
||||
/** firmware minor version */
|
||||
|
|
@ -3146,7 +3174,7 @@ struct _mlan_adapter {
|
|||
/** LLDE enable/disable */
|
||||
t_u8 llde_enabled;
|
||||
/** LLDE modes 0 - default; 1 - carplay; 2 - gameplay; 3 - sound bar, 4
|
||||
* - validation, 5- event driven */
|
||||
* - 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 */
|
||||
|
|
@ -3166,6 +3194,10 @@ struct _mlan_adapter {
|
|||
/** agiled channel switch info */
|
||||
agcs_stats agcs_info;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
t_u32 shc_secure_host;
|
||||
#endif
|
||||
t_u8 key[PUBLIC_KEY_SIZE];
|
||||
t_u8 uuid[UUID_LEN];
|
||||
t_u32 fw_meta_data_len;
|
||||
|
|
@ -4665,6 +4697,9 @@ mlan_status wlan_ret_drcs_cfg(pmlan_private pmpriv,
|
|||
void wlan_bt_coex_wlan_param_update_event(pmlan_private priv,
|
||||
pmlan_buffer pevent);
|
||||
|
||||
mlan_status wlan_misc_ioctl_lte_coex_band_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
mlan_status wlan_misc_ioctl_dfs_repeater_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
|
|
@ -5259,9 +5294,19 @@ mlan_status wlan_cmd_mclient_scheduling_enable(pmlan_private pmpriv,
|
|||
void wlan_add_iPhone_entry(mlan_private *priv, t_u8 *mac);
|
||||
void wlan_delete_iPhone_entry(mlan_private *priv, t_u8 *mac);
|
||||
|
||||
extern void print_chan_switch_block_event(t_u16 reason_code);
|
||||
/**
|
||||
* @brief This function checks whether the operation class is a 6G
|
||||
*
|
||||
* @param op_class global operation class
|
||||
*
|
||||
* @return 0--not allowed, other value allowed
|
||||
*/
|
||||
static INLINE t_bool wlan_is_6ghz_op_class(t_u8 op_class)
|
||||
{
|
||||
return op_class >= 131 && op_class <= 137;
|
||||
}
|
||||
|
||||
mlan_status mlan_read_meta_data(mlan_adapter *pmadapter, pmlan_fw_image pmfw);
|
||||
extern void print_chan_switch_block_event(t_u16 reason_code);
|
||||
|
||||
static inline t_bool wlan_copy_on_tx_enabled(const mlan_adapter *adapter)
|
||||
{
|
||||
|
|
@ -5273,4 +5318,20 @@ static inline t_bool wlan_copy_on_rx_enabled(const mlan_adapter *adapter)
|
|||
return adapter->init_para.copy_on_rx;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
mlan_status wlan_adapter_func_init(pmlan_adapter pmadapter);
|
||||
mlan_status wlan_cmd_secure_host(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_pvoid pdata_buf);
|
||||
mlan_status wlan_process_secure_host_event(pmlan_private pmpriv, t_u8 *data,
|
||||
t_u32 len);
|
||||
#endif
|
||||
mlan_status mlan_read_meta_data(mlan_adapter *pmadapter, pmlan_fw_image pmfw);
|
||||
mlan_status wlan_cmd_mfg_set_debug_temperature(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action,
|
||||
t_void *pdata_buf);
|
||||
mlan_status wlan_ret_mfg_debug_temperature(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
|
||||
#endif /* !_MLAN_MAIN_H_ */
|
||||
|
|
|
|||
|
|
@ -6018,6 +6018,45 @@ mlan_status wlan_misc_ioctl_drcs_config(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get/Set LTE coexistence configuration
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pioctl_req A pointer to ioctl request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
mlan_status wlan_misc_ioctl_lte_coex_band_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
t_u16 cmd_action = 0;
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
|
||||
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_LTE_COEX_BAND_CONFIG,
|
||||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
&misc->param.lte_cfg);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
else
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Is any uAP started or STA connected?
|
||||
*
|
||||
|
|
@ -7318,6 +7357,7 @@ mlan_status wlan_misc_ioctl_foundry_type(pmlan_adapter pmadapter,
|
|||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get CHAN_TPRC setting
|
||||
*
|
||||
|
|
@ -8218,8 +8258,23 @@ mlan_status wlan_misc_ioctl_rf_test_cfg(pmlan_adapter pmadapter,
|
|||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
&(pmisc->param.mfg_otp_cal_data_rd_wr));
|
||||
break;
|
||||
case MLAN_OID_MISC_RF_TEST_DEBUG_TEMPERATURE:
|
||||
if (pioctl_req->action == MLAN_ACT_SET)
|
||||
cmd_action = HostCmd_ACT_GEN_SET;
|
||||
else if (pioctl_req->action == MLAN_ACT_GET)
|
||||
cmd_action = HostCmd_ACT_GEN_GET;
|
||||
else {
|
||||
PRINTM(MERROR, "Unsupported cmd_action\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
/* Send request to firmware */
|
||||
PRINTM(MERROR, " sending request to FW mlan_misc \n");
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_MFG_COMMAND,
|
||||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
(&(pmisc->param.mfg_debug_temp)));
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
done:
|
||||
|
|
@ -8598,13 +8653,6 @@ mlan_status wlan_misc_ioctl_edmac_cfg(pmlan_adapter pmadapter,
|
|||
misc->param.edmac_cfg.ed_ctrl_5g = 0x1;
|
||||
misc->param.edmac_cfg.ed_offset_5g = 0xA;
|
||||
misc->param.edmac_cfg.ed_bitmap_txq_lock = 0x1e00FF;
|
||||
} else if (IS_CARD8997(pmadapter->card_type)) {
|
||||
// from config/ed_mac_ctrl_V2_8997.conf
|
||||
misc->param.edmac_cfg.ed_ctrl_2g = 0x1;
|
||||
misc->param.edmac_cfg.ed_offset_2g = 0x0;
|
||||
misc->param.edmac_cfg.ed_ctrl_5g = 0x1;
|
||||
misc->param.edmac_cfg.ed_offset_5g = 0x4;
|
||||
misc->param.edmac_cfg.ed_bitmap_txq_lock = 0xFF;
|
||||
} else if (IS_CARD8978(pmadapter->card_type)) {
|
||||
// from config/ed_mac_ctrl_V2_iw416.conf
|
||||
misc->param.edmac_cfg.ed_ctrl_2g = 0x1;
|
||||
|
|
|
|||
177
mlan/mlan_pcie.c
177
mlan/mlan_pcie.c
|
|
@ -80,47 +80,6 @@ static const struct _mlan_card_info mlan_card_info_pcie8897 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef PCIE8997
|
||||
static const struct _mlan_pcie_card_reg mlan_reg_pcie8997 = {
|
||||
.reg_txbd_rdptr = PCIE8997_RD_DATA_PTR_Q0_Q1,
|
||||
.reg_txbd_wrptr = PCIE8997_WR_DATA_PTR_Q0_Q1,
|
||||
.reg_rxbd_rdptr = PCIE8997_RD_DATA_PTR_Q0_Q1,
|
||||
.reg_rxbd_wrptr = PCIE8997_WR_DATA_PTR_Q0_Q1,
|
||||
.reg_evtbd_rdptr = REG_EVTBD_RDPTR,
|
||||
.reg_evtbd_wrptr = REG_EVTBD_WRPTR,
|
||||
.reg_host_int_mask = PCIE_HOST_INT_MASK,
|
||||
.reg_host_int_status_mask = PCIE_HOST_INT_STATUS_MASK,
|
||||
.reg_host_int_status = PCIE_HOST_INT_STATUS,
|
||||
.reg_cpu_int_event = PCIE_CPU_INT_EVENT,
|
||||
.reg_ip_rev = PCIE_IP_REV_REG,
|
||||
.reg_drv_ready = REG_DRV_READY,
|
||||
.reg_cpu_int_status = PCIE_CPU_INT_STATUS,
|
||||
.reg_scratch_0 = PCIE_SCRATCH_0_REG,
|
||||
.reg_scratch_1 = PCIE_SCRATCH_1_REG,
|
||||
.reg_scratch_2 = PCIE_SCRATCH_2_REG,
|
||||
.reg_scratch_3 = PCIE_SCRATCH_3_REG,
|
||||
.host_intr_mask = HOST_INTR_MASK,
|
||||
.host_intr_dnld_done = HOST_INTR_DNLD_DONE,
|
||||
.host_intr_upld_rdy = HOST_INTR_UPLD_RDY,
|
||||
.host_intr_cmd_done = HOST_INTR_CMD_DONE,
|
||||
.host_intr_event_rdy = HOST_INTR_EVENT_RDY,
|
||||
.host_intr_cmd_dnld = HOST_INTR_CMD_DNLD,
|
||||
.txrx_rw_ptr_mask = 0x00000FFF,
|
||||
.txrx_rw_ptr_wrap_mask = 0x00001FFF,
|
||||
.txrx_rw_ptr_rollover_ind = MBIT(12),
|
||||
.use_adma = MFALSE,
|
||||
.msi_int_wr_clr = MTRUE,
|
||||
};
|
||||
|
||||
static const struct _mlan_card_info mlan_card_info_pcie8997 = {
|
||||
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
|
||||
.v16_fw_api = 1,
|
||||
.supp_ps_handshake = 0,
|
||||
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
|
||||
.support_11mc = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef PCIEAW693
|
||||
static const struct _mlan_pcie_card_reg mlan_reg_pcieaw693 = {
|
||||
.reg_txbd_rdptr = PCIE9098_TXBD_RDPTR,
|
||||
|
|
@ -909,8 +868,8 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
/**
|
||||
* @brief This function handles command response completion
|
||||
*
|
||||
|
|
@ -994,16 +953,6 @@ static mlan_status wlan_pcie_send_vdll(mlan_adapter *pmadapter,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef PCIE8997
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf, MFALSE)) {
|
||||
PRINTM(MERROR, "Failed to send vdll block to device\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
PRINTM(MINFO, "PCIE - Download VDLL Block: successful.\n");
|
||||
done:
|
||||
if (ret == MLAN_STATUS_FAILURE)
|
||||
|
|
@ -1215,7 +1164,7 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter)
|
|||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u32 i;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
pmlan_pcie_data_buf ptx_bd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -1234,7 +1183,7 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter)
|
|||
|
||||
/* allocate shared memory for the BD ring and divide the same in to
|
||||
several descriptors */
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma)
|
||||
pmadapter->pcard_pcie->txbd_ring_size =
|
||||
sizeof(mlan_pcie_data_buf) *
|
||||
|
|
@ -1332,7 +1281,7 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
ptx_bd_buf =
|
||||
(mlan_pcie_data_buf
|
||||
|
|
@ -1365,7 +1314,7 @@ static mlan_status wlan_pcie_delete_txbd_ring(mlan_adapter *pmadapter)
|
|||
t_u32 i;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
mlan_buffer *pmbuf = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_data_buf *ptx_bd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -1389,7 +1338,7 @@ static mlan_status wlan_pcie_delete_txbd_ring(mlan_adapter *pmadapter)
|
|||
MLAN_STATUS_FAILURE);
|
||||
}
|
||||
pmadapter->pcard_pcie->tx_buf_list[i] = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
ptx_bd_buf =
|
||||
(mlan_pcie_data_buf *)
|
||||
|
|
@ -1467,7 +1416,7 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
|
|||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u32 i;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_data_buf *prxbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -1481,7 +1430,7 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
|
|||
ENTER();
|
||||
|
||||
pmadapter->pcard_pcie->rxbd_rdptr = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/*
|
||||
* driver maintaines the write pointer and firmware maintaines the read
|
||||
* pointer. The read pointer starts at 0 (zero) while the write pointer
|
||||
|
|
@ -1574,7 +1523,6 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
|
|||
"buf_len: %#x\n",
|
||||
pmbuf, pmbuf->pbuf, (t_u32)((t_u64)pmbuf->buf_pa >> 32),
|
||||
(t_u32)pmbuf->buf_pa, pmbuf->data_len);
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
if (wlan_copy_on_rx_enabled(pmadapter)) {
|
||||
|
|
@ -1613,7 +1561,7 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
prxbd_buf =
|
||||
(mlan_pcie_data_buf
|
||||
|
|
@ -1669,7 +1617,7 @@ static mlan_status wlan_pcie_delete_rxbd_ring(mlan_adapter *pmadapter)
|
|||
t_u32 i;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
mlan_buffer *pmbuf = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_data_buf *prxbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -1708,7 +1656,7 @@ static mlan_status wlan_pcie_delete_rxbd_ring(mlan_adapter *pmadapter)
|
|||
}
|
||||
pmadapter->pcard_pcie->rx_coherent_buf_list[i] = MNULL;
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
prxbd_buf = (mlan_pcie_data_buf *)
|
||||
pmadapter->pcard_pcie->rxbd_ring[i];
|
||||
|
|
@ -1769,7 +1717,7 @@ static mlan_status wlan_pcie_create_evtbd_ring(mlan_adapter *pmadapter)
|
|||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
mlan_buffer *pmbuf = MNULL;
|
||||
t_u32 i;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
pmlan_pcie_evt_buf pevtbd_buf;
|
||||
#endif
|
||||
|
||||
|
|
@ -1785,7 +1733,7 @@ static mlan_status wlan_pcie_create_evtbd_ring(mlan_adapter *pmadapter)
|
|||
* starts at zero with rollover bit set
|
||||
*/
|
||||
pmadapter->pcard_pcie->evtbd_rdptr = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pmadapter->pcard_pcie->evtbd_wrptr = EVT_RW_PTR_ROLLOVER_IND;
|
||||
pmadapter->pcard_pcie->evtbd_ring_size =
|
||||
|
|
@ -1850,7 +1798,7 @@ static mlan_status wlan_pcie_create_evtbd_ring(mlan_adapter *pmadapter)
|
|||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pevtbd_buf =
|
||||
(mlan_pcie_evt_buf
|
||||
|
|
@ -1902,7 +1850,7 @@ static mlan_status wlan_pcie_delete_evtbd_ring(mlan_adapter *pmadapter)
|
|||
t_u32 i;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
mlan_buffer *pmbuf = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_evt_buf *pevtbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -1923,7 +1871,7 @@ static mlan_status wlan_pcie_delete_evtbd_ring(mlan_adapter *pmadapter)
|
|||
|
||||
pmadapter->pcard_pcie->evt_buf_list[i] = MNULL;
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pevtbd_buf =
|
||||
(mlan_pcie_evt_buf *)
|
||||
|
|
@ -2070,7 +2018,7 @@ static mlan_status wlan_pcie_delete_cmdrsp_buf(mlan_adapter *pmadapter)
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
#define PCIE_TXBD_EMPTY(wrptr, rdptr, mask, rollover_ind) \
|
||||
(((wrptr & mask) == (rdptr & mask)) && \
|
||||
((wrptr & rollover_ind) == (rdptr & rollover_ind)))
|
||||
|
|
@ -2123,7 +2071,7 @@ static mlan_status wlan_pcie_flush_txbd_ring(mlan_adapter *pmadapter)
|
|||
*/
|
||||
static t_u8 wlan_check_tx_pending_buffer(mlan_adapter *pmadapter, t_u32 rdptr)
|
||||
{
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
|
|
@ -2169,7 +2117,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
|||
t_u32 unmap_count = 0;
|
||||
const t_bool unmap_on_tx = !wlan_copy_on_tx_enabled(pmadapter);
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
|
|
@ -2200,7 +2148,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
|||
PRINTM(MINFO, "SEND DATA COMP: rdptr_prev=0x%x, rdptr=0x%x\n",
|
||||
pmadapter->pcard_pcie->txbd_rdptr, rdptr);
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma)
|
||||
rdptr = rdptr >> TXBD_RW_PTR_START;
|
||||
#endif
|
||||
|
|
@ -2242,7 +2190,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
|||
}
|
||||
|
||||
unmap_count++;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (pmadapter->pcard_pcie->txbd_flush)
|
||||
wlan_write_data_complete(pmadapter, pmbuf,
|
||||
MLAN_STATUS_FAILURE);
|
||||
|
|
@ -2253,7 +2201,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
|||
}
|
||||
|
||||
pmadapter->pcard_pcie->tx_buf_list[wrdoneidx] = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
ptx_bd_buf = (mlan_pcie_data_buf *)pmadapter->pcard_pcie
|
||||
->txbd_ring[wrdoneidx];
|
||||
|
|
@ -2297,7 +2245,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (pmadapter->pcard_pcie->txbd_flush) {
|
||||
if (PCIE_TXBD_EMPTY(pmadapter->pcard_pcie->txbd_wrptr,
|
||||
pmadapter->pcard_pcie->txbd_rdptr,
|
||||
|
|
@ -2368,7 +2316,7 @@ exit_tx_proc:
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
#define PCIE_TXBD_NOT_FULL(wrptr, rdptr, mask, rollover_ind) \
|
||||
(((wrptr & mask) != (rdptr & mask)) || \
|
||||
((wrptr & rollover_ind) == (rdptr & rollover_ind)))
|
||||
|
|
@ -2385,7 +2333,7 @@ static t_u8 wlan_check_txbd_not_full(mlan_adapter *pmadapter)
|
|||
{
|
||||
t_u32 txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
txrx_rw_ptr_rollover_ind =
|
||||
|
|
@ -2644,7 +2592,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
|||
mlan_tx_param *tx_param)
|
||||
{
|
||||
t_u32 reg_txbd_wrptr = pmadapter->pcard_pcie->reg->reg_txbd_wrptr;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
|
|
@ -2743,7 +2691,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
|||
pmadapter->pmlan_pcie_lock);
|
||||
|
||||
pmadapter->pcard_pcie->tx_buf_list[wrindx] = pmbuf;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
wr_ptr_start = TXBD_RW_PTR_START;
|
||||
ptx_bd_buf = (mlan_pcie_data_buf *)pmadapter->pcard_pcie
|
||||
|
|
@ -2863,7 +2811,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
|||
pmadapter->pcard_pcie->txbd_rdptr,
|
||||
pmadapter->pcard_pcie->txbd_wrptr,
|
||||
pmadapter->pcard_pcie->txbd_pending);
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
/* Send the TX ready interrupt */
|
||||
if (pcb->moal_write_reg(pmadapter->pmoal_handle,
|
||||
|
|
@ -2899,7 +2847,7 @@ done_unmap:
|
|||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||
pmadapter->pmlan_pcie_lock);
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma && ptx_bd_buf) {
|
||||
ptx_bd_buf->paddr = 0;
|
||||
ptx_bd_buf->len = 0;
|
||||
|
|
@ -2933,7 +2881,7 @@ done:
|
|||
*/
|
||||
static t_u8 wlan_check_rx_pending_buffer(mlan_adapter *pmadapter, t_u32 rdptr)
|
||||
{
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
|
|
@ -2973,7 +2921,7 @@ static t_u8 wlan_check_rx_pending_buffer(mlan_adapter *pmadapter, t_u32 rdptr)
|
|||
*/
|
||||
static t_u8 wlan_is_rx_pending_full(mlan_adapter *pmadapter, t_u32 rdptr)
|
||||
{
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
|
|
@ -3024,7 +2972,7 @@ static t_u8 wlan_is_rx_pending_full(mlan_adapter *pmadapter, t_u32 rdptr)
|
|||
static void wlan_pcie_rx_ring_attach_buf(mlan_adapter *pmadapter,
|
||||
t_u32 rd_index, mlan_buffer *pmbuf)
|
||||
{
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_data_buf *prxbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -3032,7 +2980,7 @@ static void wlan_pcie_rx_ring_attach_buf(mlan_adapter *pmadapter,
|
|||
adma_dual_desc_buf *padma_bd_buf;
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
prxbd_buf = (mlan_pcie_data_buf *)
|
||||
pmadapter->pcard_pcie->rxbd_ring[rd_index];
|
||||
|
|
@ -3096,13 +3044,13 @@ mlan_status wlan_pcie_rx_ring_move_rdwrptr(mlan_adapter *pmadapter,
|
|||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u32 txbd_val = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
t_u32 txrx_rw_ptr_mask = pmadapter->pcard_pcie->reg->txrx_rw_ptr_mask;
|
||||
t_u32 txrx_rw_ptr_rollover_ind =
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_rollover_ind;
|
||||
#endif
|
||||
PRINTM(MINFO, "wlan_pcie_rx_ring_move_rdwrptr %d", update_action);
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if (update_action & RX_RD_UPDATE) {
|
||||
/* update rxbd's rdptrs */
|
||||
|
|
@ -3155,7 +3103,7 @@ mlan_status wlan_pcie_rx_ring_move_rdwrptr(mlan_adapter *pmadapter,
|
|||
ret = pcb->moal_write_reg(pmadapter->pmoal_handle,
|
||||
pmadapter->pcard_pcie->reg->reg_rxbd_wrptr,
|
||||
pmadapter->pcard_pcie->rxbd_wrptr | txbd_val);
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||
pmadapter->pmlan_pcie_lock);
|
||||
|
|
@ -3543,7 +3491,7 @@ static mlan_status wlan_pcie_send_cmd(mlan_adapter *pmadapter,
|
|||
}
|
||||
pmadapter->pcard_pcie->cmd_buf = pmbuf;
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
/* To send a command, the driver will:
|
||||
1. Write the 64bit physical address of the data buffer to
|
||||
|
|
@ -3626,7 +3574,7 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
#define MLAN_SLEEP_COOKIE_DEF 0xBEEFBEEF
|
||||
#define MAX_DELAY_LOOP_COUNT 100
|
||||
|
||||
|
|
@ -3728,7 +3676,7 @@ static mlan_status wlan_pcie_process_cmd_resp(mlan_adapter *pmadapter)
|
|||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_delay_for_sleep_cookie(pmadapter,
|
||||
MAX_DELAY_LOOP_COUNT);
|
||||
#endif
|
||||
|
|
@ -3747,7 +3695,7 @@ static mlan_status wlan_pcie_process_cmd_resp(mlan_adapter *pmadapter)
|
|||
/* Take the pointer and set it to CMD node and will
|
||||
return in the response complete callback */
|
||||
pmadapter->pcard_pcie->cmdrsp_buf = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
/* Clear the cmd-rsp buffer address in scratch
|
||||
registers. This will prevent firmware from writing to
|
||||
|
|
@ -3832,7 +3780,7 @@ static mlan_status wlan_pcie_cmdrsp_complete(mlan_adapter *pmadapter,
|
|||
*/
|
||||
static t_u8 wlan_check_evt_buffer(mlan_adapter *pmadapter, t_u32 rdptr)
|
||||
{
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if (((rdptr & EVT_RW_PTR_MASK) !=
|
||||
(pmadapter->pcard_pcie->evtbd_rdptr & EVT_RW_PTR_MASK)) ||
|
||||
|
|
@ -3871,7 +3819,7 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
|
|||
t_u32 rdptr = 0;
|
||||
t_u32 event;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_evt_buf *pevtbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -3918,7 +3866,7 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
|
|||
|
||||
/* Take the pointer and set it to event pointer in adapter
|
||||
and will return back after event handling callback */
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pevtbd_buf = (mlan_pcie_evt_buf *)pmadapter->pcard_pcie
|
||||
->evtbd_ring[rd_index];
|
||||
|
|
@ -3980,7 +3928,7 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
|
|||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||
pmadapter->pmlan_event_lock);
|
||||
pmadapter->pcard_pcie->evtbd_rdptr++;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if ((pmadapter->pcard_pcie->evtbd_rdptr &
|
||||
EVT_RW_PTR_MASK) == MLAN_MAX_EVT_BD) {
|
||||
|
|
@ -4080,7 +4028,7 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
|
|||
t_u32 wrptr =
|
||||
pmadapter->pcard_pcie->evtbd_wrptr & (MLAN_MAX_EVT_BD - 1);
|
||||
t_u32 rdptr = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
mlan_pcie_evt_buf *pevtbd_buf;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
|
|
@ -4132,7 +4080,7 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
|
|||
}
|
||||
|
||||
pmadapter->pcard_pcie->evt_buf_list[wrptr] = pmbuf;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pevtbd_buf = (mlan_pcie_evt_buf *)pmadapter->pcard_pcie
|
||||
->evtbd_ring[wrptr];
|
||||
|
|
@ -4168,7 +4116,7 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
|
|||
|
||||
pmadapter->pcard_pcie->evtbd_wrptr++;
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if ((pmadapter->pcard_pcie->evtbd_wrptr & EVT_RW_PTR_MASK) ==
|
||||
MLAN_MAX_EVT_BD) {
|
||||
|
|
@ -4229,7 +4177,7 @@ mlan_status wlan_pcie_init_fw(pmlan_adapter pmadapter)
|
|||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u32 txbd_val = 0;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
txbd_val = pmadapter->pcard_pcie->txbd_wrptr &
|
||||
pmadapter->pcard_pcie->reg->txrx_rw_ptr_wrap_mask;
|
||||
|
|
@ -4536,13 +4484,6 @@ mlan_status wlan_get_pcie_device(pmlan_adapter pmadapter)
|
|||
pmadapter->pcard_pcie->txrx_bd_size = MAX_TXRX_BD;
|
||||
break;
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
case CARD_TYPE_PCIE8997:
|
||||
pmadapter->pcard_pcie->reg = &mlan_reg_pcie8997;
|
||||
pmadapter->pcard_info = &mlan_card_info_pcie8997;
|
||||
pmadapter->pcard_pcie->txrx_bd_size = MAX_TXRX_BD;
|
||||
break;
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
case CARD_TYPE_PCIE9097:
|
||||
case CARD_TYPE_PCIE9098:
|
||||
|
|
@ -4788,8 +4729,8 @@ static mlan_status wlan_process_pcie_int_status(mlan_adapter *pmadapter)
|
|||
MLAN_BSS_ROLE_ANY),
|
||||
MLAN_EVENT_ID_DRV_DEFER_CMDRESP, MNULL);
|
||||
}
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
if (pmadapter->pcard_pcie->reg->host_intr_cmd_dnld &&
|
||||
(pcie_ireg &
|
||||
pmadapter->pcard_pcie->reg->host_intr_cmd_dnld)) {
|
||||
|
|
@ -5085,8 +5026,8 @@ mlan_status wlan_pcie_host_to_card(pmlan_private pmpriv, t_u8 type,
|
|||
ret = wlan_pcie_send_data(pmadapter, type, pmbuf, tx_param);
|
||||
} else if (type == MLAN_TYPE_CMD)
|
||||
ret = wlan_pcie_send_cmd(pmadapter, pmbuf);
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
else if (type == MLAN_TYPE_VDLL)
|
||||
ret = wlan_pcie_send_vdll(pmadapter, pmbuf);
|
||||
#endif
|
||||
|
|
@ -5280,7 +5221,7 @@ mlan_status wlan_free_pcie_ring_buf(pmlan_adapter pmadapter)
|
|||
mlan_status wlan_clean_pcie_ring_buf(pmlan_adapter pmadapter)
|
||||
{
|
||||
ENTER();
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma)
|
||||
wlan_pcie_flush_txbd_ring(pmadapter);
|
||||
#endif
|
||||
|
|
@ -5299,7 +5240,7 @@ mlan_status wlan_clean_pcie_ring_buf(pmlan_adapter pmadapter)
|
|||
mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv)
|
||||
{
|
||||
pmlan_adapter pmadapter = MNULL;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
HostCmd_DS_PCIE_HOST_BUF_DETAILS host_spec;
|
||||
#endif
|
||||
#if defined(PCIE)
|
||||
|
|
@ -5316,7 +5257,7 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv)
|
|||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
pmadapter = pmpriv->adapter;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
memset(pmadapter, &host_spec, 0,
|
||||
sizeof(HostCmd_DS_PCIE_HOST_BUF_DETAILS));
|
||||
|
|
@ -5403,7 +5344,7 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/**
|
||||
* @brief This function prepares command PCIE host buffer config.
|
||||
*
|
||||
|
|
@ -5616,8 +5557,8 @@ static void wlan_pcie_process_cmd_dnld(mlan_adapter *pmadapter)
|
|||
ENTER();
|
||||
if (pmadapter->cmd_sent)
|
||||
pmadapter->cmd_sent = MFALSE;
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
if (pmadapter->pcard_pcie->vdll_cmd_buf)
|
||||
wlan_pcie_send_vdll_complete(pmadapter);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* driver.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2021, 2024 NXP
|
||||
* Copyright 2008-2021, 2025 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
|
@ -326,7 +326,7 @@ Change log:
|
|||
PCIE9098_HOST_INTR_CMD_DONE | PCIE9098_HOST_INTR_EVENT_RDY)
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/* PCIE INTERNAL REGISTERS */
|
||||
/** PCIE data exchange register 0 */
|
||||
#define PCIE_SCRATCH_0_REG 0x0C10
|
||||
|
|
@ -372,16 +372,6 @@ Change log:
|
|||
#define PCIE_SCRATCH_12_REG 0x0CF0
|
||||
#endif
|
||||
|
||||
#ifdef PCIE8997
|
||||
/* PCIE read data pointer for queue 0 and 1 */
|
||||
#define PCIE8997_RD_DATA_PTR_Q0_Q1 0xC1A4 /* 0x8000C1A4 */
|
||||
/* PCIE read data pointer for queue 2 and 3 */
|
||||
#define PCIE8997_RD_DATA_PTR_Q2_Q3 0xC1A8 /* 0x8000C1A8 */
|
||||
/* PCIE write data pointer for queue 0 and 1 */
|
||||
#define PCIE8997_WR_DATA_PTR_Q0_Q1 0xC174 /* 0x8000C174 */
|
||||
/* PCIE write data pointer for queue 2 and 3 */
|
||||
#define PCIE8997_WR_DATA_PTR_Q2_Q3 0xC178 /* 0x8000C178 */
|
||||
#endif
|
||||
#ifdef PCIE8897
|
||||
/* PCIE read data pointer for queue 0 and 1 */
|
||||
#define PCIE8897_RD_DATA_PTR_Q0_Q1 0xC08C /* 0x8000C08C */
|
||||
|
|
@ -405,7 +395,7 @@ Change log:
|
|||
/** Set Event Done interupt to the FW*/
|
||||
#define CPU_INTR_EVENT_DONE MBIT(5)
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/** Data sent interrupt for host */
|
||||
#define HOST_INTR_DNLD_DONE MBIT(0)
|
||||
/** Data receive interrupt for host */
|
||||
|
|
@ -483,7 +473,7 @@ mlan_status wlan_get_pcie_device(pmlan_adapter pmadapter);
|
|||
/** Set PCIE host buffer configurations */
|
||||
mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv);
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
/** Prepare command PCIE host buffer config */
|
||||
mlan_status wlan_cmd_pcie_host_buf_cfg(pmlan_private pmpriv,
|
||||
pHostCmd_DS_COMMAND cmd,
|
||||
|
|
|
|||
|
|
@ -182,11 +182,10 @@ static const struct _mlan_card_info mlan_card_info_sd8897 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#if defined(SD8977) || defined(SD8997) || defined(SD8987) || \
|
||||
defined(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SDAW693) || defined(SD8978) || defined(SD9177) || \
|
||||
defined(SDIW610)
|
||||
static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
|
||||
#if defined(SD8977) || defined(SD8987) || defined(SD9098) || \
|
||||
defined(SD9097) || defined(SDIW624) || defined(SDAW693) || \
|
||||
defined(SD8978) || defined(SD9177) || defined(SDIW610)
|
||||
static const struct _mlan_sdio_card_reg mlan_reg_sd8977 = {
|
||||
.start_rd_port = 0,
|
||||
.start_wr_port = 0,
|
||||
.base_0_reg = 0xf8,
|
||||
|
|
@ -258,16 +257,6 @@ static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef SD8997
|
||||
static const struct _mlan_card_info mlan_card_info_sd8997 = {
|
||||
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
|
||||
.v16_fw_api = 1,
|
||||
.supp_ps_handshake = 0,
|
||||
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
|
||||
.support_11mc = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef SD9097
|
||||
static const struct _mlan_card_info mlan_card_info_sd9097 = {
|
||||
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
|
||||
|
|
@ -2311,55 +2300,49 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter)
|
|||
#if defined(SD8977) || defined(SD8978)
|
||||
case CARD_TYPE_SD8977:
|
||||
case CARD_TYPE_SD8978:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd8977;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
case CARD_TYPE_SD8997:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd8997;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD8987
|
||||
case CARD_TYPE_SD8987:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd8987;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD9098
|
||||
case CARD_TYPE_SD9098:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd9098;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD9097
|
||||
case CARD_TYPE_SD9097:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd9097;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDIW624
|
||||
case CARD_TYPE_SDIW624:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sdiw624;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDAW693
|
||||
case CARD_TYPE_SDAW693:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sdaw693;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDIW610
|
||||
case CARD_TYPE_SDIW610:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sdiw610;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD9177
|
||||
case CARD_TYPE_SD9177:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977;
|
||||
pmadapter->pcard_info = &mlan_card_info_sd9177;
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -2971,8 +2954,8 @@ exit:
|
|||
}
|
||||
|
||||
#if defined(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SDAW693) || defined(SD9177) || defined(SD8997) || \
|
||||
defined(SD8987) || defined(SD8978) || defined(SDIW610)
|
||||
defined(SDAW693) || defined(SD9177) || defined(SD8987) || \
|
||||
defined(SD8978) || defined(SDIW610)
|
||||
/**
|
||||
* @brief This function sends vdll data to the card.
|
||||
*
|
||||
|
|
@ -3036,8 +3019,8 @@ static mlan_status wlan_sdio_host_to_card_ext(pmlan_private pmpriv, t_u8 type,
|
|||
mlan_adapter *pmadapter = pmpriv->adapter;
|
||||
|
||||
#if defined(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SDAW693) || defined(SD9177) || defined(SD8997) || \
|
||||
defined(SD8987) || defined(SD8978) || defined(SDIW610)
|
||||
defined(SDAW693) || defined(SD9177) || defined(SD8987) || \
|
||||
defined(SD8978) || defined(SDIW610)
|
||||
if (type == MLAN_TYPE_VDLL)
|
||||
return wlan_sdio_send_vdll(pmadapter, pmbuf);
|
||||
#endif
|
||||
|
|
@ -3097,10 +3080,9 @@ void wlan_decode_spa_buffer(mlan_adapter *pmadapter, t_u8 *buf, t_u32 len)
|
|||
break;
|
||||
}
|
||||
if (pkt_len > SDIO_INTF_HEADER_LEN) {
|
||||
/* mbuf_deaggr is freed in moal_recv_complete(),
|
||||
* therefore Overwriting mbuf_deaggr is not harmful.
|
||||
*/
|
||||
// coverity[overwrite_var:SUPPRESS]
|
||||
// mbuf_deaggr is already initialized as NULL
|
||||
// coverity[RESOURCE_LEAK:SUPPRESS]
|
||||
// coverity[misra_c_2012_rule_22_1_violation:SUPPRESS]
|
||||
mbuf_deaggr = wlan_alloc_mlan_buffer(
|
||||
pmadapter, pkt_len - SDIO_INTF_HEADER_LEN,
|
||||
MLAN_RX_HEADER_LEN, MOAL_ALLOC_MLAN_BUFFER);
|
||||
|
|
@ -3118,7 +3100,10 @@ void wlan_decode_spa_buffer(mlan_adapter *pmadapter, t_u8 *buf, t_u32 len)
|
|||
pkt_len - SDIO_INTF_HEADER_LEN,
|
||||
pkt_len - SDIO_INTF_HEADER_LEN);
|
||||
mbuf_deaggr->data_len = pkt_len - SDIO_INTF_HEADER_LEN;
|
||||
// Buffer mbuf_deaggr will be free in Kernel API.
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
wlan_handle_rx_packet(pmadapter, mbuf_deaggr);
|
||||
|
||||
data += block_size;
|
||||
total_pkt_len -= block_size;
|
||||
if (total_pkt_len < pmadapter->pcard_sd->sdio_rx_block_size)
|
||||
|
|
@ -3126,10 +3111,8 @@ void wlan_decode_spa_buffer(mlan_adapter *pmadapter, t_u8 *buf, t_u32 len)
|
|||
}
|
||||
done:
|
||||
LEAVE();
|
||||
/* mbuf_deaggr is freed in moal_recv_complete(), therefore
|
||||
* Overwriting mbuf_deaggr is not harmful.
|
||||
*/
|
||||
// coverity[overwrite_var:SUPPRESS]
|
||||
// Buffer mbuf_deaggr will be free in Kernel API.
|
||||
// coverity[misra_c_2012_rule_22_1_violation:SUPPRESS]
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3638,14 +3621,10 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
#if defined(SD8997) || defined(SD8977) || defined(SD8987) || \
|
||||
defined(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SDAW693) || defined(SD8978) || defined(SD9177) || \
|
||||
defined(SDIW610)
|
||||
#if defined(SD8977) || defined(SD8987) || defined(SD9098) || \
|
||||
defined(SD9097) || defined(SDIW624) || defined(SDAW693) || \
|
||||
defined(SD8978) || defined(SD9177) || defined(SDIW610)
|
||||
if (MFALSE
|
||||
#ifdef SD8997
|
||||
|| IS_SD8997(pmadapter->card_type)
|
||||
#endif
|
||||
#ifdef SD8977
|
||||
|| IS_SD8977(pmadapter->card_type)
|
||||
#endif
|
||||
|
|
|
|||
346
mlan/mlan_shc.c
Executable file
346
mlan/mlan_shc.c
Executable file
|
|
@ -0,0 +1,346 @@
|
|||
/** @file mlan_shc.c
|
||||
*
|
||||
* @brief This file contains the secure host interface functions.
|
||||
*
|
||||
*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nanotls-device.h"
|
||||
#include "nanotls-host.h"
|
||||
#include "nanotls-common.h"
|
||||
|
||||
#ifdef INT_MAX
|
||||
#undef INT_MAX
|
||||
#endif
|
||||
|
||||
#ifdef UINT_MAX
|
||||
#undef UINT_MAX
|
||||
#endif
|
||||
|
||||
#include "mlan.h"
|
||||
#include "mlan_init.h"
|
||||
#include "mlan_util.h"
|
||||
#include "mlan_fw.h"
|
||||
#include "mlan_shc.h"
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
enum action_status {
|
||||
ACTION_HANDSHAKE = 0,
|
||||
ACTION_HANDSHAKE_SUCCESS = 1,
|
||||
ACTION_HANDSHAKE_FAIL = 2,
|
||||
};
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
#define SECURE_HOST_TAG_LEN 16
|
||||
|
||||
/********************************************************
|
||||
Local Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief This function decrypts command response received
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param buf A pointer to command payload
|
||||
* @param len Command payload length
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
static mlan_status mlan_shc_data_decrypt(pmlan_adapter pmadapter, t_u8 *buf,
|
||||
t_u32 len)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_void *enc_data = MNULL;
|
||||
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle, len, MLAN_MEM_DEF,
|
||||
(t_u8 **)&enc_data);
|
||||
if (ret != MLAN_STATUS_SUCCESS)
|
||||
return ret;
|
||||
|
||||
ret = pcb->moal_secure_host_data_decrypt(pmadapter->pmoal_handle,
|
||||
&enc_data, (void *)&buf, len);
|
||||
pcb->moal_mfree(pmadapter->pmoal_handle, enc_data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function encrypts command request to be transmitted
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param buf A pointer to command payload
|
||||
* @param len Command payload length
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
static mlan_status mlan_shc_data_encrypt(pmlan_adapter pmadapter, t_u8 *buf,
|
||||
t_u32 len)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_void *enc_data = MNULL;
|
||||
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle, len, MLAN_MEM_DEF,
|
||||
(t_u8 **)&enc_data);
|
||||
if (ret != MLAN_STATUS_SUCCESS)
|
||||
return ret;
|
||||
|
||||
ret = pcb->moal_secure_host_data_encrypt(pmadapter->pmoal_handle,
|
||||
&enc_data, (void *)&buf, len);
|
||||
pcb->moal_mfree(pmadapter->pmoal_handle, enc_data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares secure host handshake msg to be sent to fw
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @msg A pointer to message
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
static mlan_status mlan_shc_prepare_msg(pmlan_adapter pmadapter, t_void *msg)
|
||||
{
|
||||
mlan_private *pmpriv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY);
|
||||
|
||||
mlan_status ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_SECURE_HOST, 0,
|
||||
0, MNULL, msg);
|
||||
if (ret != MLAN_STATUS_SUCCESS)
|
||||
PRINTM(MERROR, "secure host: command prepare failed\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function initializes data path post secure host handshake
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
static mlan_status mlan_shc_data_path_init(pmlan_adapter pmadapter)
|
||||
{
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
|
||||
if (!pcb->moal_secure_host_derive_traffic_keys(
|
||||
pmadapter->pmoal_handle) &&
|
||||
!pcb->moal_secure_host_data_ctx_init(pmadapter->pmoal_handle))
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief This function determines if command in secured or non-secured
|
||||
*
|
||||
* @param cmd_id Unique command id
|
||||
* @return secured:MTRUE, MFALSE otherwise
|
||||
*/
|
||||
t_bool wlan_is_secure_host_cmd(t_u16 cmd_id)
|
||||
{
|
||||
switch (cmd_id) {
|
||||
/** non-secure commands sent prior host and fw handshake */
|
||||
case HostCmd_CMD_SECURE_HOST:
|
||||
case HostCmd_CMD_FUNC_INIT:
|
||||
case HostCmd_CMD_GET_HW_SPEC:
|
||||
case HostCmd_CMD_MCLIENT_SCHEDULE_CFG:
|
||||
case HostCmd_CMD_802_11_SNMP_MIB:
|
||||
case HostCmd_CMD_RECONFIGURE_TX_BUFF:
|
||||
case HostCmd_CMD_802_11_FW_WAKE_METHOD:
|
||||
case HostCmd_CMD_PCIE_ADMA_INIT:
|
||||
case HostCmd_CMD_802_11_RF_ANTENNA:
|
||||
case HostCmd_CMD_DBGS_CFG:
|
||||
return MFALSE;
|
||||
|
||||
/** list of secure host commands */
|
||||
case HostCmd_CMD_802_11_KEY_MATERIAL:
|
||||
case HostCmd_CMD_SUPPLICANT_PMK:
|
||||
case HostCmd_CMD_SUPPLICANT_PROFILE:
|
||||
case HostCmd_CMD_REGION_POWER_CFG:
|
||||
case HostCmd_CMD_VERSION_EXT:
|
||||
case HostCmd_CMD_CFG_DATA:
|
||||
return MTRUE;
|
||||
}
|
||||
|
||||
return MTRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function process command request to be transmitted
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pcmd A pointer to command request
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status wlan_shc_secure_hostcmd_process(pmlan_adapter pmadapter,
|
||||
HostCmd_DS_COMMAND *pcmd)
|
||||
{
|
||||
t_u32 cmd_size = 0;
|
||||
|
||||
if ((!(pcmd->command & HostCmd_Encrypted_BIT)) &&
|
||||
pcmd->size >= S_DS_GEN &&
|
||||
(mlan_shc_data_encrypt(pmadapter, ((t_u8 *)pcmd + S_DS_GEN),
|
||||
(pcmd->size - S_DS_GEN)) !=
|
||||
MLAN_STATUS_FAILURE)) {
|
||||
pcmd->command |= HostCmd_Encrypted_BIT;
|
||||
cmd_size = wlan_le16_to_cpu(pcmd->size);
|
||||
cmd_size += SECURE_HOST_TAG_LEN;
|
||||
pcmd->size = wlan_cpu_to_le16(cmd_size);
|
||||
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function process received command response
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param resp A pointer to command response
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status wlan_shc_secure_hostresp_process(pmlan_adapter pmadapter,
|
||||
HostCmd_DS_COMMAND *resp)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
t_u16 cmd = wlan_le16_to_cpu(resp->command);
|
||||
t_u16 cmd_size = wlan_le16_to_cpu(resp->size);
|
||||
|
||||
if ((cmd & HostCmd_Encrypted_BIT)) {
|
||||
if (cmd_size <= S_DS_GEN)
|
||||
return MLAN_STATUS_FAILURE;
|
||||
|
||||
ret = mlan_shc_data_decrypt(pmadapter,
|
||||
((t_u8 *)resp + S_DS_GEN),
|
||||
(cmd_size - S_DS_GEN));
|
||||
if (ret != MLAN_STATUS_FAILURE) {
|
||||
resp->command &= ~HostCmd_Encrypted_BIT;
|
||||
resp->size = wlan_le16_to_cpu(resp->size -
|
||||
SECURE_HOST_TAG_LEN);
|
||||
DBG_HEXDUMP(MSHC_D, "Decrypted CMD_RESP", resp,
|
||||
resp->size);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles firmware event post secure host handshake
|
||||
*
|
||||
* @param pmadapter A pointer to mlan private structure
|
||||
* @param type A pointer to event data
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status wlan_shc_process_secure_host_event(pmlan_private pmpriv, t_u8 *data,
|
||||
t_u32 len)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_FAILURE;
|
||||
pmlan_adapter pmadapter = pmpriv->adapter;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u8 type;
|
||||
|
||||
SECURE_HOST_EVENT_HEADER *pevent = (SECURE_HOST_EVENT_HEADER *)data;
|
||||
|
||||
switch (pevent->tls_action) {
|
||||
case ACTION_HANDSHAKE:
|
||||
type = pcb->moal_secure_host_get_msg_id(
|
||||
data + sizeof(SECURE_HOST_EVENT_HEADER));
|
||||
ret = mlan_shc_handshake(
|
||||
pmadapter, type,
|
||||
data + sizeof(SECURE_HOST_EVENT_HEADER));
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
pmadapter->hw_status = WlanHardwareStatusNotReady;
|
||||
wlan_init_fw_complete(pmadapter);
|
||||
}
|
||||
break;
|
||||
case ACTION_HANDSHAKE_SUCCESS:
|
||||
PRINTM(MMSG, "secure host handshake success\n");
|
||||
if (!mlan_shc_data_path_init(pmadapter)) {
|
||||
wlan_adapter_get_hw_spec(pmadapter);
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
} else {
|
||||
PRINTM(MERROR, "secure host data init failed\n");
|
||||
}
|
||||
break;
|
||||
case ACTION_HANDSHAKE_FAIL:
|
||||
PRINTM(MERROR,
|
||||
"secure host handshake fail, event status (0x%x) received\n",
|
||||
pevent->tls_action);
|
||||
break;
|
||||
default:
|
||||
PRINTM(MERROR,
|
||||
"secure host, invalid event status (0x%x) received\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles security handshake between host and FW
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param type One of the three message types
|
||||
* @return success:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status mlan_shc_handshake(pmlan_adapter pmadapter, t_u8 type, t_void *msg)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_FAILURE;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_void *buf = MNULL;
|
||||
|
||||
switch (type) {
|
||||
case TLS_HOST_HELLO:
|
||||
if (!pcb->moal_secure_host_init(pmadapter->pmoal_handle,
|
||||
pmadapter->key,
|
||||
pmadapter->uuid) &&
|
||||
!pcb->moal_secure_host_do_hello(pmadapter->pmoal_handle,
|
||||
&buf)) {
|
||||
ret = mlan_shc_prepare_msg(pmadapter, buf);
|
||||
}
|
||||
break;
|
||||
case TLS_DEVICE_HELLO:
|
||||
/** Process TLS device hello (M2) message */
|
||||
if (pcb->moal_secure_host_device_hello_rcvd(
|
||||
pmadapter->pmoal_handle, msg))
|
||||
break;
|
||||
fallthrough;
|
||||
case TLS_HOST_FINISHED:
|
||||
if (!pcb->moal_secure_host_do_finished(pmadapter->pmoal_handle,
|
||||
&buf) &&
|
||||
!mlan_shc_prepare_msg(pmadapter, buf)) {
|
||||
pmadapter->hw_status = WlanHardwareStatusGetHwSpec;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
PRINTM(MMSG, "Invalid shc message type:%x\n", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
40
mlan/mlan_shc.h
Executable file
40
mlan/mlan_shc.h
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
/** @file mlan_shc.c
|
||||
*
|
||||
* @brief This file contains the secure host interface functions.
|
||||
*
|
||||
*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MLAN_SHC_H_
|
||||
#define _MLAN_SHC_H_
|
||||
#ifdef STA_SUPPORT
|
||||
#include "mlan_join.h"
|
||||
#endif
|
||||
#include "mlan_main.h"
|
||||
|
||||
mlan_status mlan_shc_handshake(pmlan_adapter pmadapter, t_u8 type, t_void *msg);
|
||||
mlan_status wlan_shc_process_secure_host_event(pmlan_private pmpriv, t_u8 *data,
|
||||
t_u32 len);
|
||||
mlan_status wlan_shc_secure_hostcmd_process(pmlan_adapter pmadapter,
|
||||
HostCmd_DS_COMMAND *pcmd);
|
||||
t_bool wlan_is_secure_host_cmd(t_u16 cmd_id);
|
||||
mlan_status wlan_shc_secure_hostresp_process(pmlan_adapter pmadapter,
|
||||
HostCmd_DS_COMMAND *resp);
|
||||
mlan_status wlan_shc_prep_for_requeue(pmlan_adapter pmadapter,
|
||||
HostCmd_DS_COMMAND *pcmd);
|
||||
#endif
|
||||
|
|
@ -410,6 +410,9 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
|
|||
PRINTM(MMSG,
|
||||
"Attach mlan adapter operations.card_type is 0x%x.\n",
|
||||
pmdevice->card_type);
|
||||
/* coverity assumes that Passing pmadapter to memset,
|
||||
* sets pmadapter->callbacks.moal_memcpy_ext to NULL
|
||||
*/
|
||||
memcpy_ext(pmadapter, &pmadapter->ops, &mlan_pcie_ops,
|
||||
sizeof(mlan_adapter_operations),
|
||||
sizeof(mlan_adapter_operations));
|
||||
|
|
@ -441,6 +444,11 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
|
|||
PRINTM(MMSG,
|
||||
"Attach mlan adapter operations.card_type is 0x%x.\n",
|
||||
pmdevice->card_type);
|
||||
/* coverity assumes that Passing pmadapter to memset,
|
||||
* sets pmadapter->callbacks.moal_memcpy_ext to NULL but
|
||||
* memset of pmadapter will not nullify
|
||||
* pmadapter->callbacks.moal_memcpy_ext.
|
||||
*/
|
||||
memcpy_ext(pmadapter, &pmadapter->ops, &mlan_usb_ops,
|
||||
sizeof(mlan_adapter_operations),
|
||||
sizeof(mlan_adapter_operations));
|
||||
|
|
@ -572,6 +580,18 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
|
|||
(t_u8)pmdevice->bss_attr[0].bss_num;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
pmadapter->shc_secure_host = pmdevice->secure_host;
|
||||
if (pmadapter->second_mac && pmadapter->shc_secure_host) {
|
||||
if (pcb->moal_secure_host_derive_traffic_keys(
|
||||
pmadapter->pmoal_handle) ||
|
||||
pcb->moal_secure_host_data_ctx_init(
|
||||
pmadapter->pmoal_handle)) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* init function table */
|
||||
for (j = 0; mlan_ops[j]; j++) {
|
||||
if (mlan_ops[j]->bss_role == GET_BSS_ROLE(pmadapter->priv[0])) {
|
||||
|
|
@ -725,6 +745,12 @@ mlan_status mlan_read_meta_data(mlan_adapter *pmadapter, pmlan_fw_image pmfw)
|
|||
if (memcmp(pmadapter, magic,
|
||||
(pmfw->pfw_buf + pmfw->fw_len) - META_MAGIC_OFFSET,
|
||||
META_MAGIC_LEN)) {
|
||||
#ifdef SECURE_HOST
|
||||
if (pmadapter->shc_secure_host)
|
||||
PRINTM(MERROR,
|
||||
"Secure host failed: No Meta magic in FW\n");
|
||||
else
|
||||
#endif
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
LEAVE();
|
||||
|
|
@ -2255,8 +2281,10 @@ void mlan_process_deaggr_pkt(t_void *padapter, pmlan_buffer pmbuf, t_u8 *drop)
|
|||
t_void mlan_set_driver_status(t_void *adapter, t_u8 driver_status)
|
||||
{
|
||||
mlan_adapter *pmadapter = (mlan_adapter *)adapter;
|
||||
|
||||
ENTER();
|
||||
pmadapter->driver_status = driver_status;
|
||||
if (pmadapter)
|
||||
pmadapter->driver_status = driver_status;
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -548,6 +548,48 @@ static mlan_status wlan_cmd_mfg_config_trigger_frame(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command to set debug temperature
|
||||
*
|
||||
* @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 or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status wlan_cmd_mfg_set_debug_temperature(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action,
|
||||
t_void *pdata_buf)
|
||||
{
|
||||
mfg_CmdDebugTemperature_Cfg_t *temp_config =
|
||||
(mfg_CmdDebugTemperature_Cfg_t *)&cmd->params.mfg_debug_temp;
|
||||
mfg_CmdDebugTemperature_Cfg_t *cfg =
|
||||
(mfg_CmdDebugTemperature_Cfg_t *)pdata_buf;
|
||||
t_u8 rfu = 0;
|
||||
t_u8 rpath = 0;
|
||||
|
||||
ENTER();
|
||||
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_MFG_COMMAND);
|
||||
cmd->size = wlan_cpu_to_le16(sizeof(mfg_CmdDebugTemperature_Cfg_t) +
|
||||
S_DS_GEN);
|
||||
temp_config->mfg_cmd = wlan_cpu_to_le32(cfg->mfg_cmd);
|
||||
temp_config->action = wlan_cpu_to_le16(cmd_action);
|
||||
temp_config->simulation_enable =
|
||||
wlan_cpu_to_le32(cfg->simulation_enable);
|
||||
temp_config->cau_temperature = wlan_cpu_to_le32(cfg->cau_temperature);
|
||||
|
||||
for (rfu = 0; rfu < MAX_RFUS; rfu++) {
|
||||
for (rpath = 0; rpath < MAX_PATHS; rpath++)
|
||||
temp_config->rfu_temperature[rfu][rpath] =
|
||||
wlan_cpu_to_le32(
|
||||
cfg->rfu_temperature[rfu][rpath]);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of MFG HE TB Tx.
|
||||
*
|
||||
|
|
@ -706,6 +748,11 @@ mlan_status wlan_cmd_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
|||
ret = wlan_cmd_mfg_otp_cal_data_rw(pmpriv, cmd, action,
|
||||
pdata_buf);
|
||||
goto cmd_mfg_done;
|
||||
case MFG_CMD_SET_DEBUG_TEMPERATURE:
|
||||
ret = wlan_cmd_mfg_set_debug_temperature(pmpriv, cmd, action,
|
||||
pdata_buf);
|
||||
goto cmd_mfg_done;
|
||||
|
||||
case MFG_CMD_SET_TEST_MODE:
|
||||
case MFG_CMD_UNSET_TEST_MODE:
|
||||
case MFG_CMD_TX_ANT:
|
||||
|
|
@ -2968,6 +3015,36 @@ mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static mlan_status wlan_cmd_lte_coex_band_cfg(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action,
|
||||
t_void *pdata_buf)
|
||||
{
|
||||
mlan_ds_misc_lte_coex_band_cfg *lte_cfg = MNULL;
|
||||
HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG *cmd_lte_cfg =
|
||||
&cmd->params.lte_coex_cfg;
|
||||
|
||||
ENTER();
|
||||
|
||||
cmd->size = S_DS_GEN + sizeof(HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG);
|
||||
|
||||
lte_cfg = (mlan_ds_misc_lte_coex_band_cfg *)pdata_buf;
|
||||
cmd->size = wlan_cpu_to_le16(cmd->size);
|
||||
cmd->command = wlan_cpu_to_le16(cmd->command);
|
||||
cmd_lte_cfg->action = wlan_cpu_to_le16(cmd_action);
|
||||
if (cmd_action == HostCmd_ACT_GEN_SET) {
|
||||
if (!lte_cfg) {
|
||||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
cmd_lte_cfg->band = (lte_cfg->band);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares Low Power Mode
|
||||
*
|
||||
|
|
@ -3900,6 +3977,25 @@ static mlan_status wlan_cmd_auth_assoc_timeout_cfg(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
mlan_status wlan_cmd_secure_host(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_void *pdata_buf)
|
||||
{
|
||||
HostCmd_DS_SECURE_HOST *shc = &cmd->params.shc;
|
||||
SECURE_HOST_MSG_HEADER *tls_hdr = (SECURE_HOST_MSG_HEADER *)pdata_buf;
|
||||
t_u16 tls_len = tls_hdr->len;
|
||||
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_SECURE_HOST);
|
||||
cmd->size = wlan_cpu_to_le16(S_DS_GEN + sizeof(shc->action) + tls_len);
|
||||
|
||||
shc->action = 0x0;
|
||||
memcpy_ext(pmpriv->adapter, (void *)&shc->tls_data, (void *)pdata_buf,
|
||||
tls_len, tls_len);
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function prepare the command before sending to firmware.
|
||||
*
|
||||
|
|
@ -4277,7 +4373,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_meas_cmd_process(pmpriv, cmd_ptr, pdata_buf);
|
||||
break;
|
||||
#if defined(PCIE)
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
case HostCmd_CMD_PCIE_HOST_BUF_DETAILS:
|
||||
ret = wlan_cmd_pcie_host_buf_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
|
@ -4340,6 +4436,10 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
case HostCmd_CMD_DRCS_CONFIG:
|
||||
ret = wlan_cmd_drcs_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_LTE_COEX_BAND_CONFIG:
|
||||
ret = wlan_cmd_lte_coex_band_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_CONFIG_LOW_POWER_MODE:
|
||||
ret = wlan_cmd_low_pwr_mode(pmpriv, cmd_ptr, pdata_buf);
|
||||
break;
|
||||
|
|
@ -4524,6 +4624,11 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
case HostCmd_CMD_DS_GET_FOUNDRY_TYPE:
|
||||
ret = wlan_cmd_get_foundry_type(pmpriv, cmd_ptr, cmd_action);
|
||||
break;
|
||||
#ifdef SECURE_HOST
|
||||
case HostCmd_CMD_SECURE_HOST:
|
||||
ret = wlan_cmd_secure_host(pmpriv, cmd_ptr, pdata_buf);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
#include "mlan_11ax.h"
|
||||
#include "mlan_11h.h"
|
||||
#include "mlan_meas.h"
|
||||
#ifdef SECURE_HOST
|
||||
#include "mlan_shc.h"
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
* Local Variables
|
||||
|
|
@ -2482,6 +2485,38 @@ wlan_ret_packet_aggr_over_host_interface(pmlan_private pmpriv,
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of
|
||||
* LTE coexistence configuration
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param resp A pointer to HostCmd_DS_COMMAND
|
||||
* @param pioctl_buf A pointer to command buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static mlan_status wlan_ret_lte_coex_band_cfg(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf)
|
||||
{
|
||||
HostCmd_DS_LTE_COEX_BAND_PARAMS_CONFIG *cmd_lte_cfg =
|
||||
&resp->params.lte_coex_cfg;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
mlan_ds_misc_lte_coex_band_cfg *lte_cfg = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_buf && (pioctl_buf->action == MLAN_ACT_GET)) {
|
||||
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
|
||||
lte_cfg =
|
||||
(mlan_ds_misc_lte_coex_band_cfg *)&misc->param.lte_cfg;
|
||||
lte_cfg->band = wlan_le16_to_cpu(cmd_lte_cfg->band);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of
|
||||
* DFS Repeater mode configuration
|
||||
|
|
@ -3038,6 +3073,45 @@ static mlan_status wlan_ret_mfg_config_trigger_frame(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of debug temperature
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param resp A pointer to HostCmd_DS_COMMAND
|
||||
* @param pioctl_buf A pointer to command buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
mlan_status wlan_ret_mfg_debug_temperature(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf)
|
||||
{
|
||||
mfg_CmdDebugTemperature_Cfg_t *temp_config =
|
||||
(mfg_CmdDebugTemperature_Cfg_t *)&resp->params.mfg_debug_temp;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
mfg_CmdDebugTemperature_Cfg_t *cfg = MNULL;
|
||||
t_u8 rfu = 0;
|
||||
t_u8 rpath = 0;
|
||||
ENTER();
|
||||
if (!pioctl_buf) {
|
||||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
|
||||
cfg = (mfg_CmdDebugTemperature_Cfg_t *)&misc->param.mfg_debug_temp;
|
||||
cfg->simulation_enable =
|
||||
wlan_le32_to_cpu(temp_config->simulation_enable);
|
||||
cfg->cau_temperature = wlan_le32_to_cpu(temp_config->cau_temperature);
|
||||
for (rfu = 0; rfu < MAX_RFUS; rfu++) {
|
||||
for (rpath = 0; rpath < MAX_PATHS; rpath++)
|
||||
cfg->rfu_temperature[rfu][rpath] = wlan_le32_to_cpu(
|
||||
temp_config->rfu_temperature[rfu][rpath]);
|
||||
}
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command resp of MFG HE TB Tx
|
||||
*
|
||||
|
|
@ -3188,6 +3262,9 @@ mlan_status wlan_ret_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
case MFG_CMD_OTP_CAL_DATA:
|
||||
ret = wlan_ret_mfg_otp_cal_data_rw(pmpriv, resp, pioctl_buf);
|
||||
goto cmd_mfg_done;
|
||||
case MFG_CMD_SET_DEBUG_TEMPERATURE:
|
||||
ret = wlan_ret_mfg_debug_temperature(pmpriv, resp, pioctl_buf);
|
||||
goto cmd_mfg_done;
|
||||
case MFG_CMD_SET_TEST_MODE:
|
||||
case MFG_CMD_UNSET_TEST_MODE:
|
||||
case MFG_CMD_TX_ANT:
|
||||
|
|
@ -3475,6 +3552,10 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_FUNC_INIT:
|
||||
case HostCmd_CMD_FUNC_SHUTDOWN:
|
||||
break;
|
||||
#ifdef SECURE_HOST
|
||||
case HostCmd_CMD_SECURE_HOST:
|
||||
break;
|
||||
#endif
|
||||
case HostCmd_CMD_802_11_KEY_MATERIAL:
|
||||
ret = wlan_ret_802_11_key_material(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
|
@ -3483,6 +3564,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_DS_GET_FOUNDRY_TYPE:
|
||||
ret = wlan_ret_foundry_type(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
||||
case HostCmd_CMD_SUPPLICANT_PMK:
|
||||
ret = wlan_ret_802_11_supplicant_pmk(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
|
@ -3648,7 +3730,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
ret = wlan_ret_net_monitor(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
#if defined(PCIE)
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
case HostCmd_CMD_PCIE_HOST_BUF_DETAILS:
|
||||
PRINTM(MINFO, "PCIE host buffer configuration successful.\n");
|
||||
break;
|
||||
|
|
@ -3701,6 +3783,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_DRCS_CONFIG:
|
||||
ret = wlan_ret_drcs_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_LTE_COEX_BAND_CONFIG:
|
||||
ret = wlan_ret_lte_coex_band_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_CONFIG_LOW_POWER_MODE:
|
||||
break;
|
||||
case HostCmd_CMD_DFS_REPEATER_MODE:
|
||||
|
|
|
|||
|
|
@ -1657,12 +1657,20 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
PRINTM(MEVENT,
|
||||
"Ignoring the Channel Switch Reg Info Event\n");
|
||||
break;
|
||||
#ifdef SECURE_HOST
|
||||
case EVENT_SECURE_HOST_COMM:
|
||||
ret = wlan_process_secure_host_event(
|
||||
pmpriv, pmbuf->pbuf + pmbuf->data_offset,
|
||||
pmbuf->data_len);
|
||||
break;
|
||||
#endif
|
||||
case EVENT_WIFI_CHANNEL_AVOID_LIST:
|
||||
PRINTM(MEVENT, "EVENT: EVENT_WIFI_CHANNEL_AVOID_LIST (%#x)\n",
|
||||
eventcause);
|
||||
pevent->event_id = MLAN_EVENT_ID_FW_WIFI_CHANNEL_AVOID_LIST;
|
||||
pevent->bss_index = pmpriv->bss_index;
|
||||
pevent->event_len = pmbuf->data_len;
|
||||
// coverity[cert_arr30_c_violation:SUPPRESS]
|
||||
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
|
||||
pmbuf->pbuf + pmbuf->data_offset, pevent->event_len,
|
||||
pevent->event_len);
|
||||
|
|
|
|||
|
|
@ -403,7 +403,22 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_GET_FW_INFO:
|
||||
pioctl_req->data_read_written =
|
||||
sizeof(mlan_fw_info) + MLAN_SUB_COMMAND_SIZE;
|
||||
pget_info->param.fw_info.fw_ver = pmadapter->fw_release_number;
|
||||
memcpy_ext(pmadapter, &pget_info->param.fw_info.fw_ver,
|
||||
&pmadapter->fw_release_number,
|
||||
sizeof(pget_info->param.fw_info.fw_ver),
|
||||
sizeof(pmadapter->fw_release_number));
|
||||
memcpy_ext(pmadapter, pget_info->param.fw_info.fw_ver_milestone,
|
||||
pmadapter->fw_ver_milestone,
|
||||
sizeof(pget_info->param.fw_info.fw_ver_milestone),
|
||||
sizeof(pmadapter->fw_ver_milestone));
|
||||
memcpy_ext(pmadapter, pget_info->param.fw_info.fw_ver_buildtype,
|
||||
pmadapter->fw_ver_buildtype,
|
||||
sizeof(pget_info->param.fw_info.fw_ver_buildtype),
|
||||
sizeof(pmadapter->fw_ver_buildtype));
|
||||
memcpy_ext(pmadapter, pget_info->param.fw_info.fw_ver_data,
|
||||
pmadapter->fw_ver_data,
|
||||
sizeof(pget_info->param.fw_info.fw_ver_data),
|
||||
sizeof(pmadapter->fw_ver_data));
|
||||
pget_info->param.fw_info.hotfix_version =
|
||||
pmadapter->fw_hotfix_ver;
|
||||
pget_info->param.fw_info.tx_buf_size = pmadapter->tx_buf_size;
|
||||
|
|
@ -1215,7 +1230,6 @@ static mlan_status wlan_query_passphrase(mlan_private *priv,
|
|||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Search for a BSS
|
||||
*
|
||||
|
|
@ -1248,6 +1262,34 @@ static mlan_status wlan_bss_ioctl_find_bss(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get ssid protection capability status
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pioctl_req A pointer to ioctl request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS --success
|
||||
*/
|
||||
static mlan_status wlan_sec_ioctl_ssid_protection(IN pmlan_adapter pmadapter,
|
||||
IN pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
mlan_ds_sec_cfg *sec = MNULL;
|
||||
ENTER();
|
||||
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
|
||||
if (pioctl_req->action == MLAN_ACT_GET) {
|
||||
sec->param.ssid_protection = pmpriv->ssid_protection;
|
||||
} else {
|
||||
pmpriv->ssid_protection = (t_u8)sec->param.ssid_protection;
|
||||
PRINTM(MINFO, "Set: SSID Protection = %d\n",
|
||||
(int)pmpriv->ssid_protection);
|
||||
}
|
||||
pioctl_req->data_read_written = sizeof(t_u32) + MLAN_SUB_COMMAND_SIZE;
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Search for a BSS
|
||||
*
|
||||
|
|
@ -3248,6 +3290,9 @@ static mlan_status wlan_sec_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_SEC_CFG_ESUPP_MODE:
|
||||
status = wlan_sec_ioctl_esupp_mode(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_SEC_CFG_SSID_PROTECTION:
|
||||
status = wlan_sec_ioctl_ssid_protection(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
||||
default:
|
||||
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
|
||||
|
|
@ -5179,6 +5224,10 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_MISC_DRCS_CFG:
|
||||
status = wlan_misc_ioctl_drcs_config(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_LTE_COEX_CFG:
|
||||
status = wlan_misc_ioctl_lte_coex_band_cfg(pmadapter,
|
||||
pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_LOW_PWR_MODE:
|
||||
status = wlan_misc_ioctl_low_pwr_mode(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
|
@ -5357,6 +5406,7 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_MISC_RF_TEST_TX_FRAME:
|
||||
case MLAN_OID_MISC_RF_TEST_HE_POWER:
|
||||
case MLAN_OID_MISC_OTP_MAC_RD_WR:
|
||||
case MLAN_OID_MISC_RF_TEST_DEBUG_TEMPERATURE:
|
||||
case MLAN_OID_MISC_OTP_CAL_DATA_RD_WR:
|
||||
status = wlan_misc_ioctl_rf_test_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
|
@ -5392,10 +5442,12 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_MISC_FOUNDRY_TYPE:
|
||||
status = wlan_misc_ioctl_foundry_type(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
||||
case MLAN_OID_MISC_PER_BAND_TXPWR_CAP:
|
||||
status = wlan_misc_ioctl_per_band_txpwr_cap(pmadapter,
|
||||
pioctl_req);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (pioctl_req)
|
||||
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
/** TLV type : Power capability */
|
||||
#define TLV_TYPE_POWER_CAPABILITY 0x0021
|
||||
#define TLV_TYPE_HT_CAPABILITY 0x002d
|
||||
/** TLV type : RSN eXtended IE */
|
||||
#define TLV_TYPE_RSNX 0x00f4
|
||||
/** TLV type : Vendor Specific IE */
|
||||
#define TLV_TYPE_VENDOR_SPECIFIC_IE 0x00dd
|
||||
#define TLV_TYPE_EXTENSION_ID 0x00ff
|
||||
|
|
@ -507,6 +509,8 @@
|
|||
#define VENDOR_IE_OUIS_TLV_ID (PROPRIETARY_TLV_BASE_ID + 357) /* 0x0265 */
|
||||
#define TLV_TYPE_AP_INFO (PROPRIETARY_TLV_BASE_ID + 358) /* 0x0266 */
|
||||
#define TLV_TYPE_CSI_AGC_CONFIG (PROPRIETARY_TLV_BASE_ID + 363) /* 0x026b */
|
||||
#define NXP_VERSION_COMPONENTS_TLV_ID \
|
||||
(PROPRIETARY_TLV_BASE_ID + 364) /* 0x026c */
|
||||
#define TLV_TYPE_PER_BAND_TXPWR_CAP (PROPRIETARY_TLV_BASE_ID + 365) /* 0x026d \
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -5286,27 +5286,39 @@ static mlan_status wlan_process_agcs_event(pmlan_private priv,
|
|||
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;
|
||||
if (pacs_start_event->stats.all_sta_6g ==
|
||||
MTRUE) {
|
||||
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;
|
||||
for (i = 0;
|
||||
i < sta_ptr->OperClass
|
||||
.ieee_hdr.len;
|
||||
i++) {
|
||||
if (wlan_is_6ghz_op_class(
|
||||
sta_ptr->OperClass
|
||||
.data[i]) ==
|
||||
MTRUE) {
|
||||
t_support_6g =
|
||||
MTRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (t_support_6g == MFALSE)
|
||||
pacs_start_event->stats
|
||||
.all_sta_6g =
|
||||
MFALSE;
|
||||
}
|
||||
pacs_start_event->stats.all_sta_6g &=
|
||||
t_support_6g;
|
||||
}
|
||||
if (pacs_start_event->stats.all_sta_ecs ==
|
||||
MFALSE &&
|
||||
pacs_start_event->stats.all_sta_6g ==
|
||||
MFALSE) {
|
||||
break;
|
||||
}
|
||||
sta_ptr = sta_ptr->pnext;
|
||||
}
|
||||
|
|
@ -5661,7 +5673,7 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
pdata_buf);
|
||||
break;
|
||||
#if defined(PCIE)
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
case HostCmd_CMD_PCIE_HOST_BUF_DETAILS:
|
||||
ret = wlan_cmd_pcie_host_buf_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
|
@ -6170,7 +6182,7 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
ret = wlan_ret_packet_aggr_ctrl(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
#if defined(PCIE)
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
case HostCmd_CMD_PCIE_HOST_BUF_DETAILS:
|
||||
PRINTM(MINFO, "PCIE host buffer configuration successful.\n");
|
||||
break;
|
||||
|
|
@ -6279,6 +6291,7 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_DS_GET_FOUNDRY_TYPE:
|
||||
ret = wlan_ret_foundry_type(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
||||
#ifdef STA_SUPPORT
|
||||
case HostCmd_CMD_802_11_SCAN_EXT:
|
||||
ret = wlan_ret_802_11_scan_ext(pmpriv, resp, pioctl_buf);
|
||||
|
|
|
|||
|
|
@ -2185,8 +2185,27 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
&pget_info->param.fw_info.mac_addr,
|
||||
pmpriv->curr_addr, MLAN_MAC_ADDR_LENGTH,
|
||||
MLAN_MAC_ADDR_LENGTH);
|
||||
pget_info->param.fw_info.fw_ver =
|
||||
pmadapter->fw_release_number;
|
||||
memcpy_ext(pmadapter, &pget_info->param.fw_info.fw_ver,
|
||||
&pmadapter->fw_release_number,
|
||||
sizeof(pget_info->param.fw_info.fw_ver),
|
||||
sizeof(pmadapter->fw_release_number));
|
||||
memcpy_ext(pmadapter,
|
||||
pget_info->param.fw_info.fw_ver_milestone,
|
||||
pmadapter->fw_ver_milestone,
|
||||
sizeof(pget_info->param.fw_info
|
||||
.fw_ver_milestone),
|
||||
sizeof(pmadapter->fw_ver_milestone));
|
||||
memcpy_ext(pmadapter,
|
||||
pget_info->param.fw_info.fw_ver_buildtype,
|
||||
pmadapter->fw_ver_buildtype,
|
||||
sizeof(pget_info->param.fw_info
|
||||
.fw_ver_buildtype),
|
||||
sizeof(pmadapter->fw_ver_buildtype));
|
||||
memcpy_ext(pmadapter,
|
||||
pget_info->param.fw_info.fw_ver_data,
|
||||
pmadapter->fw_ver_data,
|
||||
sizeof(pget_info->param.fw_info.fw_ver_data),
|
||||
sizeof(pmadapter->fw_ver_data));
|
||||
pget_info->param.fw_info.hotfix_version =
|
||||
pmadapter->fw_hotfix_ver;
|
||||
pget_info->param.fw_info.tx_buf_size =
|
||||
|
|
@ -2358,6 +2377,7 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
else if (misc->sub_command == MLAN_OID_MISC_FOUNDRY_TYPE)
|
||||
status = wlan_misc_ioctl_foundry_type(pmadapter,
|
||||
pioctl_req);
|
||||
|
||||
else if (misc->sub_command == MLAN_OID_MISC_GET_TSF)
|
||||
status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req);
|
||||
else if (misc->sub_command == MLAN_OID_MISC_CROSS_CHIP_SYNCH)
|
||||
|
|
|
|||
|
|
@ -47,16 +47,6 @@ static const struct _mlan_card_info mlan_card_info_usb8897 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef USB8997
|
||||
static const struct _mlan_card_info mlan_card_info_usb8997 = {
|
||||
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
|
||||
.v16_fw_api = 1,
|
||||
.supp_ps_handshake = 1,
|
||||
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
|
||||
.support_11mc = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef USB8978
|
||||
static const struct _mlan_card_info mlan_card_info_usb8978 = {
|
||||
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_2K,
|
||||
|
|
@ -825,11 +815,6 @@ mlan_status wlan_get_usb_device(pmlan_adapter pmadapter)
|
|||
pmadapter->pcard_info = &mlan_card_info_usb8897;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
case CARD_TYPE_USB8997:
|
||||
pmadapter->pcard_info = &mlan_card_info_usb8997;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
case CARD_TYPE_USB8978:
|
||||
pmadapter->pcard_info = &mlan_card_info_usb8978;
|
||||
|
|
@ -970,6 +955,7 @@ mlan_status wlan_usb_deaggr_rx_pkt(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
|
|||
* handling completed, Coverity is not able to trace callbacks
|
||||
* registered for and process_rx_packet and moal_recv_complete
|
||||
*/
|
||||
// coverity[overwrite_var:SUPPRESS]
|
||||
// coverity[RESOURCE_LEAK]: SUPPRESS
|
||||
/* send new packet to processing */
|
||||
ret = wlan_handle_rx_packet(pmadapter, pdeaggr_buf);
|
||||
|
|
@ -1377,7 +1363,7 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
|
|||
}
|
||||
if (type == MLAN_TYPE_CMD
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USBIW624) || \
|
||||
defined(USB8997) || defined(USB8978) || defined(USBIW610)
|
||||
defined(USB8978) || defined(USBIW610)
|
||||
|| type == MLAN_TYPE_VDLL
|
||||
#endif
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -161,9 +161,9 @@ static raListTbl *wlan_wmm_allocate_ralist_node(pmlan_adapter pmadapter,
|
|||
|
||||
ENTER();
|
||||
|
||||
if (pmadapter->callbacks.moal_malloc(pmadapter->pmoal_handle,
|
||||
sizeof(raListTbl), MLAN_MEM_DEF,
|
||||
(t_u8 **)&ra_list)) {
|
||||
if (pmadapter->callbacks.moal_malloc(
|
||||
pmadapter->pmoal_handle, sizeof(raListTbl),
|
||||
MLAN_MEM_FLAG_ATOMIC, (t_u8 **)&ra_list)) {
|
||||
PRINTM(MERROR, "Fail to allocate ra_list\n");
|
||||
goto done;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,8 +376,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_8897 0x02
|
||||
/** 8977 card type */
|
||||
#define CARD_TYPE_8977 0x03
|
||||
/** 8997 card type */
|
||||
#define CARD_TYPE_8997 0x04
|
||||
/** 8987 card type */
|
||||
#define CARD_TYPE_8987 0x05
|
||||
/** 9098 card type */
|
||||
|
|
@ -418,8 +416,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_SD8977 (CARD_TYPE_8977 | (INTF_SD << 8))
|
||||
/** SD8978 card type */
|
||||
#define CARD_TYPE_SD8978 (CARD_TYPE_8978 | (INTF_SD << 8))
|
||||
/** SD8997 card type */
|
||||
#define CARD_TYPE_SD8997 (CARD_TYPE_8997 | (INTF_SD << 8))
|
||||
/** SD8987 card type */
|
||||
#define CARD_TYPE_SD8987 (CARD_TYPE_8987 | (INTF_SD << 8))
|
||||
/** SD9097 card type */
|
||||
|
|
@ -441,7 +437,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
|
||||
#define IS_SD8977(ct) (CARD_TYPE_SD8977 == (ct))
|
||||
#define IS_SD8978(ct) (CARD_TYPE_SD8978 == (ct))
|
||||
#define IS_SD8997(ct) (CARD_TYPE_SD8997 == (ct))
|
||||
#define IS_SD8987(ct) (CARD_TYPE_SD8987 == (ct))
|
||||
#define IS_SD9097(ct) (CARD_TYPE_SD9097 == (ct))
|
||||
#define IS_SD9098(ct) (CARD_TYPE_SD9098 == (ct))
|
||||
|
|
@ -459,8 +454,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_SD8977 "SD8977"
|
||||
/** SD8978 Card */
|
||||
#define CARD_SD8978 "SDIW416"
|
||||
/** SD8997 Card */
|
||||
#define CARD_SD8997 "SD8997"
|
||||
/** SD8987 Card */
|
||||
#define CARD_SD8987 "SD8987"
|
||||
/** SD9097 Card */
|
||||
|
|
@ -484,8 +477,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#ifdef PCIE
|
||||
/** PCIE8897 card type */
|
||||
#define CARD_TYPE_PCIE8897 (CARD_TYPE_8897 | (INTF_PCIE << 8))
|
||||
/** PCIE8997 card type */
|
||||
#define CARD_TYPE_PCIE8997 (CARD_TYPE_8997 | (INTF_PCIE << 8))
|
||||
/** PCIE9097 card type */
|
||||
#define CARD_TYPE_PCIE9097 (CARD_TYPE_9097 | (INTF_PCIE << 8))
|
||||
/** PCIE9098 card type */
|
||||
|
|
@ -496,7 +487,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_PCIEAW693 (CARD_TYPE_AW693 | (INTF_PCIE << 8))
|
||||
|
||||
#define IS_PCIE8897(ct) (CARD_TYPE_PCIE8897 == (ct))
|
||||
#define IS_PCIE8997(ct) (CARD_TYPE_PCIE8997 == (ct))
|
||||
#define IS_PCIE9097(ct) (CARD_TYPE_PCIE9097 == (ct))
|
||||
#define IS_PCIE9098(ct) (CARD_TYPE_PCIE9098 == (ct))
|
||||
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
|
||||
|
|
@ -504,8 +494,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
|
||||
/** PCIE8897 Card */
|
||||
#define CARD_PCIE8897 "PCIE8897"
|
||||
/** PCIE8997 Card */
|
||||
#define CARD_PCIE8997 "PCIE8997"
|
||||
/** PCIE9097 Card */
|
||||
#define CARD_PCIE9097 "PCIEIW620"
|
||||
/** PCIE9000S Card */
|
||||
|
|
@ -533,8 +521,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_TYPE_USB8801 (CARD_TYPE_8801 | (INTF_USB << 8))
|
||||
/** USB8897 card type */
|
||||
#define CARD_TYPE_USB8897 (CARD_TYPE_8897 | (INTF_USB << 8))
|
||||
/** USB8997 card type */
|
||||
#define CARD_TYPE_USB8997 (CARD_TYPE_8997 | (INTF_USB << 8))
|
||||
/** USB8978 card type */
|
||||
#define CARD_TYPE_USB8978 (CARD_TYPE_8978 | (INTF_USB << 8))
|
||||
/** USB9098 card type */
|
||||
|
|
@ -548,7 +534,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
|
||||
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
|
||||
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
|
||||
#define IS_USB8997(ct) (CARD_TYPE_USB8997 == (ct))
|
||||
#define IS_USB8978(ct) (CARD_TYPE_USB8978 == (ct))
|
||||
#define IS_USB9098(ct) (CARD_TYPE_USB9098 == (ct))
|
||||
#define IS_USB9097(ct) (CARD_TYPE_USB9097 == (ct))
|
||||
|
|
@ -559,8 +544,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_USB8801 "USB8801"
|
||||
/** USB8897 Card */
|
||||
#define CARD_USB8897 "USB8897"
|
||||
/** USB8997 Card */
|
||||
#define CARD_USB8997 "USB8997"
|
||||
/** USB8978 Card */
|
||||
#define CARD_USB8978 "USBIW416"
|
||||
/** USB9098 Card */
|
||||
|
|
@ -578,7 +561,6 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define IS_CARD8897(ct) (CARD_TYPE_8897 == ((ct)&0xf))
|
||||
#define IS_CARD8977(ct) (CARD_TYPE_8977 == ((ct)&0xf))
|
||||
#define IS_CARD8978(ct) (CARD_TYPE_8978 == ((ct)&0xf))
|
||||
#define IS_CARD8997(ct) (CARD_TYPE_8997 == ((ct)&0xf))
|
||||
#define IS_CARD8987(ct) (CARD_TYPE_8987 == ((ct)&0xf))
|
||||
#define IS_CARD9098(ct) (CARD_TYPE_9098 == ((ct)&0xf))
|
||||
#define IS_CARD9097(ct) (CARD_TYPE_9097 == ((ct)&0xf))
|
||||
|
|
@ -692,6 +674,9 @@ typedef enum {
|
|||
#define MFWDP_D MBIT(21)
|
||||
#endif /*FWDUMP_VIA_PRINT*/
|
||||
#define MSCH_D MBIT(22)
|
||||
#ifdef SECURE_HOST
|
||||
#define MSHC_D MBIT(23)
|
||||
#endif
|
||||
#define MENTRY MBIT(28)
|
||||
#define MWARN MBIT(29)
|
||||
#define MINFO MBIT(30)
|
||||
|
|
@ -2814,7 +2799,27 @@ typedef struct _mlan_callbacks {
|
|||
void (*moal_write_u16)(void *dest, t_u16 val);
|
||||
void (*moal_write_u32)(void *dest, t_u32 val);
|
||||
} moal_unaligned_access;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
t_u8 (*moal_secure_host_get_msg_id)(t_void *msg);
|
||||
mlan_status (*moal_secure_host_init)(t_void *pmoal, const t_u8 key[64],
|
||||
const t_u8 uuid[16]);
|
||||
void (*moal_secure_host_cleanup)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_do_hello)(t_void *pmoal, t_void **msg);
|
||||
mlan_status (*moal_secure_host_device_hello_rcvd)(t_void *pmoal,
|
||||
t_void *msg);
|
||||
mlan_status (*moal_secure_host_do_finished)(t_void *pmoal,
|
||||
t_void **msg);
|
||||
mlan_status (*moal_secure_host_derive_traffic_keys)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_data_ctx_init)(t_void *pmoal);
|
||||
mlan_status (*moal_secure_host_data_encrypt)(t_void *pmoal,
|
||||
t_void **enc_data,
|
||||
t_void **payload,
|
||||
t_u32 len);
|
||||
mlan_status (*moal_secure_host_data_decrypt)(t_void *pmoal,
|
||||
t_void **dec_data,
|
||||
t_void **payload,
|
||||
t_u32 len);
|
||||
#endif
|
||||
t_u32 (*moal_crc32_be)(t_u32 initial_crc, t_u8 const *data,
|
||||
unsigned long len);
|
||||
} mlan_callbacks, *pmlan_callbacks;
|
||||
|
|
@ -2998,6 +3003,9 @@ typedef struct _mlan_device {
|
|||
t_u8 disable_11h_tpc;
|
||||
t_u8 tpe_ie_ignore;
|
||||
t_u32 amsdu_disable;
|
||||
#ifdef SECURE_HOST
|
||||
t_u32 secure_host;
|
||||
#endif
|
||||
} mlan_device, *pmlan_device;
|
||||
|
||||
/** MLAN API function prototype */
|
||||
|
|
@ -3113,11 +3121,11 @@ MLAN_API void mlan_process_pcie_interrupt_cb(t_void *pmadapter, int type);
|
|||
#endif
|
||||
|
||||
#ifndef SINT32_MAX
|
||||
#define SINT32_MAX 0x7fffffff
|
||||
#define SINT32_MAX 2147483647
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MIN
|
||||
#define SINT32_MIN 0x80000000
|
||||
#define SINT32_MIN (-2147483647 - 1)
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,14 @@ typedef MLAN_PACK_START struct _IEEEtypes_OverlapBSSScanParam_t {
|
|||
} MLAN_PACK_END IEEEtypes_OverlapBSSScanParam_t,
|
||||
*pIEEEtypes_OverlapBSSScanParam_t;
|
||||
|
||||
/** MrvlIEtypes_rsnx_ie_t */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_rsnx_ie_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** data (3 octets) */
|
||||
t_u8 data[3];
|
||||
} MLAN_PACK_END IEEEtypes_rsnx_ie_t, *pIEEEtypes_rsnx_ie_t;
|
||||
|
||||
/** VHT MCS rate set field, refer to 802.11ac */
|
||||
typedef MLAN_PACK_START struct _VHT_MCS_set {
|
||||
t_u16 rx_mcs_map;
|
||||
|
|
|
|||
|
|
@ -308,6 +308,8 @@ enum _mlan_ioctl_req_id {
|
|||
#endif
|
||||
MLAN_OID_MISC_TDLS_OPER = 0x00200026,
|
||||
MLAN_OID_MISC_GET_TDLS_IES = 0x00200027,
|
||||
MLAN_OID_MISC_LTE_COEX_CFG = 0x00200028,
|
||||
|
||||
MLAN_OID_MISC_LOW_PWR_MODE = 0x00200029,
|
||||
MLAN_OID_MISC_MEF_FLT_CFG = 0x0020002A,
|
||||
MLAN_OID_MISC_DFS_REAPTER_MODE = 0x0020002B,
|
||||
|
|
@ -400,11 +402,16 @@ enum _mlan_ioctl_req_id {
|
|||
MLAN_OID_MISC_FOUNDRY_TYPE = 0X0020009B,
|
||||
|
||||
MLAN_OID_MISC_NAV_MITIGATION_HW = 0x0020009C,
|
||||
|
||||
MLAN_OID_MISC_PREAMBLE_PWR_BOOST = 0x0020009D,
|
||||
MLAN_OID_MISC_PER_BAND_TXPWR_CAP = 0x0020009E,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x0020009F,
|
||||
MLAN_OID_MISC_AGCS_CONFIG = 0x002000A0,
|
||||
#endif /* UAP_SUPPORT */
|
||||
MLAN_OID_SEC_CFG_SSID_PROTECTION = 0x002000A1,
|
||||
MLAN_OID_MISC_RF_TEST_DEBUG_TEMPERATURE = 0x002000A2
|
||||
|
||||
};
|
||||
|
||||
/** Sub command size */
|
||||
|
|
@ -454,6 +461,9 @@ enum _mlan_ext_scan {
|
|||
MLAN_EXT_SCAN_ENH
|
||||
};
|
||||
|
||||
#define MAX_RFUS 2
|
||||
#define MAX_PATHS 2
|
||||
|
||||
/** Max number of supported rates */
|
||||
#define MLAN_SUPPORTED_RATES 32
|
||||
|
||||
|
|
@ -2009,10 +2019,22 @@ typedef struct _mlan_ds_get_signal {
|
|||
/** bit for 5 G antenna diversity */
|
||||
#define ANT_DIVERSITY_5G MBIT(7)
|
||||
|
||||
/** firmware complete version number */
|
||||
typedef struct {
|
||||
/** FW release number */
|
||||
t_u8 releaseNum;
|
||||
/** minor version */
|
||||
t_u8 minorRevNum;
|
||||
/** major version */
|
||||
t_u8 majorRevNum;
|
||||
/** patch level version */
|
||||
t_u16 patchLevel;
|
||||
} fw_release_version_t;
|
||||
|
||||
/** mlan_fw_info data structure for MLAN_OID_GET_FW_INFO */
|
||||
typedef struct _mlan_fw_info {
|
||||
/** Firmware version */
|
||||
t_u32 fw_ver;
|
||||
fw_release_version_t fw_ver;
|
||||
/** Firmware Hotfix version */
|
||||
t_u8 hotfix_version;
|
||||
/** tx buf size */
|
||||
|
|
@ -2083,6 +2105,12 @@ typedef struct _mlan_fw_info {
|
|||
t_u8 sec_rgpower;
|
||||
/*country code from OTP*/
|
||||
t_u16 fw_country_code;
|
||||
/** firmware version milestone */
|
||||
char fw_ver_milestone[10];
|
||||
/** firmware version buildtype */
|
||||
char fw_ver_buildtype[10];
|
||||
/** firmware version data */
|
||||
char fw_ver_data[30];
|
||||
} mlan_fw_info, *pmlan_fw_info;
|
||||
|
||||
/** Version string buffer length */
|
||||
|
|
@ -3001,6 +3029,7 @@ typedef struct _mlan_ds_sec_cfg {
|
|||
t_u8 sta_mac[MLAN_MAC_ADDR_LENGTH];
|
||||
#endif
|
||||
mlan_ds_passphrase roam_passphrase[MAX_SEC_SSID_NUM];
|
||||
t_u32 ssid_protection;
|
||||
} param;
|
||||
} mlan_ds_sec_cfg, *pmlan_ds_sec_cfg;
|
||||
|
||||
|
|
@ -5649,6 +5678,13 @@ typedef struct _mlan_ds_misc_tdls_ies {
|
|||
t_u8 regulatory_class[IEEE_MAX_IE_SIZE];
|
||||
} mlan_ds_misc_tdls_ies;
|
||||
|
||||
/** Type definition of mlan_ds_misc_lte_coex_band_cfg
|
||||
* for MLAN_OID_MISC_LTE_COEX_CFG */
|
||||
typedef struct _mlan_ds_misc_lte_coex_band_cfg {
|
||||
/** LTE COEX BAND */
|
||||
t_u8 band;
|
||||
} mlan_ds_misc_lte_coex_band_cfg;
|
||||
|
||||
typedef struct _mlan_ds_misc_dfs_repeater {
|
||||
/** Set or Get */
|
||||
t_u16 action;
|
||||
|
|
@ -6113,7 +6149,7 @@ typedef struct _mlan_ds_misc_chan_trpc_cfg {
|
|||
#define MFG_CMD_CONFIG_TRIGGER_FRAME 0x110C
|
||||
#define MFG_CMD_OTP_MAC_ADD 0x108C
|
||||
#define MFG_CMD_OTP_CAL_DATA 0x121A
|
||||
|
||||
#define MFG_CMD_SET_DEBUG_TEMPERATURE 0x121f
|
||||
/** MFG CMD generic cfg */
|
||||
struct MLAN_PACK_START mfg_cmd_generic_cfg {
|
||||
/** MFG command code */
|
||||
|
|
@ -6441,6 +6477,24 @@ typedef MLAN_PACK_START struct _mfg_cmd_otp_cal_data_rd_wr_t {
|
|||
t_u8 cal_data[CAL_DATA_LEN];
|
||||
} MLAN_PACK_END mfg_cmd_otp_cal_data_rd_wr_t;
|
||||
|
||||
/** Thermal simulation structure */
|
||||
typedef MLAN_PACK_START struct _mfg_cmd_set_debug_temperature {
|
||||
/** MFG command code */
|
||||
t_u32 mfg_cmd;
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Device ID */
|
||||
t_u16 device_id;
|
||||
/** MFG Error code */
|
||||
t_u32 error;
|
||||
/** enable/disable thermal simulation */
|
||||
t_u32 simulation_enable;
|
||||
/** CAU temperature to be set */
|
||||
t_s32 cau_temperature;
|
||||
/** RFU temperature to be set */
|
||||
t_s32 rfu_temperature[MAX_RFUS][MAX_PATHS];
|
||||
} MLAN_PACK_END mfg_CmdDebugTemperature_Cfg_t;
|
||||
|
||||
typedef struct _mlan_ds_misc_chnrgpwr_cfg {
|
||||
/** length */
|
||||
t_u16 length;
|
||||
|
|
@ -6536,8 +6590,6 @@ typedef struct _mlan_ds_foundry_type {
|
|||
t_u8 foundry_type;
|
||||
} mlan_ds_foundry_type;
|
||||
|
||||
#define MAX_RFUS 2
|
||||
#define MAX_PATHS 2
|
||||
typedef struct _mlan_ds_tsp_cfg {
|
||||
/** TSP config action 0-GET, 1-SET */
|
||||
t_u16 action;
|
||||
|
|
@ -6771,6 +6823,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_gpio_tsf_latch gpio_tsf_latch_config;
|
||||
mlan_ds_tsf_info tsf_info;
|
||||
mlan_ds_coalesce_cfg coalesce_cfg;
|
||||
mlan_ds_misc_lte_coex_band_cfg lte_cfg;
|
||||
t_u8 low_pwr_mode;
|
||||
/** MEF-FLT-CONFIG for MLAN_OID_MISC_NV_FLT_CFG */
|
||||
mlan_ds_misc_mef_flt_cfg mef_flt_cfg;
|
||||
|
|
@ -6830,6 +6883,7 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t mfg_tx_trigger_config;
|
||||
mfg_cmd_otp_mac_addr_rd_wr_t mfg_otp_mac_addr_rd_wr;
|
||||
mfg_cmd_otp_cal_data_rd_wr_t mfg_otp_cal_data_rd_wr;
|
||||
mfg_CmdDebugTemperature_Cfg_t mfg_debug_temp;
|
||||
mlan_ds_misc_arb_cfg arb_cfg;
|
||||
mlan_ds_misc_cfp_tbl cfp;
|
||||
t_u8 range_ext_mode;
|
||||
|
|
@ -6851,7 +6905,9 @@ typedef struct _mlan_ds_misc_cfg {
|
|||
mlan_ds_gpio_cfg_ops gpio_cfg_ops;
|
||||
mlan_ds_auth_assoc_timeout_cfg auth_assoc_cfg;
|
||||
mlan_ds_foundry_type soc_foundry_type;
|
||||
|
||||
mlan_ds_misc_per_band_txpwr_cap per_band_txpwr_cap;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** config AGCS for MLAN_OID_MISC_AGCS_CONFIG */
|
||||
mlan_ds_agcs_cfg agcs_cfg;
|
||||
|
|
|
|||
|
|
@ -700,25 +700,32 @@ static int woal_cfg80211_subcmd_get_fw_version(struct wiphy *wiphy,
|
|||
t_u32 reply_len = 0;
|
||||
char end_c = '\0';
|
||||
int ret = 0;
|
||||
char fw_ver[32] = {0};
|
||||
char fw_ver[100] = {0};
|
||||
t_u8 hotfix_ver = 0;
|
||||
union {
|
||||
t_u32 l;
|
||||
t_u8 c[4];
|
||||
} ver;
|
||||
|
||||
ENTER();
|
||||
|
||||
hotfix_ver = priv->phandle->fw_hotfix_version;
|
||||
ver.l = priv->phandle->fw_release_number;
|
||||
if (hotfix_ver) {
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u.%u%c",
|
||||
ver.c[2], ver.c[1], ver.c[0], ver.c[3], hotfix_ver,
|
||||
end_c) <= 0)
|
||||
if (snprintf(fw_ver, sizeof(fw_ver),
|
||||
"%s-%u.%u.%u.p%u.%u, %s-%s%c",
|
||||
priv->phandle->fw_ver_milestone,
|
||||
priv->phandle->fw_release_number.majorRevNum,
|
||||
priv->phandle->fw_release_number.minorRevNum,
|
||||
priv->phandle->fw_release_number.releaseNum,
|
||||
priv->phandle->fw_release_number.patchLevel,
|
||||
hotfix_ver, priv->phandle->fw_ver_buildtype,
|
||||
priv->phandle->fw_ver_data, end_c) <= 0)
|
||||
PRINTM(MERROR, "Failed to write fw hotfix version\n");
|
||||
} else {
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u%c", ver.c[2],
|
||||
ver.c[1], ver.c[0], ver.c[3], end_c) <= 0)
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%s-%u.%u.%u.p%u, %s-%s%c",
|
||||
priv->phandle->fw_ver_milestone,
|
||||
priv->phandle->fw_release_number.majorRevNum,
|
||||
priv->phandle->fw_release_number.minorRevNum,
|
||||
priv->phandle->fw_release_number.releaseNum,
|
||||
priv->phandle->fw_release_number.patchLevel,
|
||||
priv->phandle->fw_ver_buildtype,
|
||||
priv->phandle->fw_ver_data, end_c) <= 0)
|
||||
PRINTM(MERROR, "Failed to write fw version\n");
|
||||
}
|
||||
reply_len = strlen(fw_ver) + 1;
|
||||
|
|
@ -9968,16 +9975,16 @@ static const struct wiphy_vendor_command vendor_commands[] = {
|
|||
#endif
|
||||
},
|
||||
{
|
||||
.info = {
|
||||
.vendor_id = MRVL_VENDOR_ID,
|
||||
.subcmd = subcmd_get_usable_channels,
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
|
||||
WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = woal_cfg80211_subcmd_get_usable_channels,
|
||||
.info = {
|
||||
.vendor_id = MRVL_VENDOR_ID,
|
||||
.subcmd = subcmd_get_usable_channels,
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
|
||||
WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = woal_cfg80211_subcmd_get_usable_channels,
|
||||
#if KERNEL_VERSION(5, 3, 0) <= CFG80211_VERSION_CODE
|
||||
.policy = woal_usable_channel_policy,
|
||||
.maxattr = ATTR_USABLE_CHANNEL_MAX,
|
||||
.policy = woal_usable_channel_policy,
|
||||
.maxattr = ATTR_USABLE_CHANNEL_MAX,
|
||||
#endif
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2908,6 +2908,91 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get esupplicant ssid_protection configurations
|
||||
*
|
||||
* @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_setget_priv_ssid_protection(moal_private *priv, t_u8 *respbuf,
|
||||
t_u32 respbuflen)
|
||||
{
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_sec_cfg *sec = NULL;
|
||||
int ret = 0;
|
||||
t_u32 data[1];
|
||||
int user_data_len = 0;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (!priv->phandle->card_info->embedded_supp) {
|
||||
PRINTM(MERROR, "Not supported cmd on this card\n");
|
||||
ret = -EOPNOTSUPP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strlen(respbuf) ==
|
||||
(strlen(CMD_NXP) + strlen(PRIV_CMD_SSID_PROTECTION))) {
|
||||
/* GET operation */
|
||||
user_data_len = 0;
|
||||
} else {
|
||||
/* SET operation */
|
||||
memset((char *)data, 0, sizeof(data));
|
||||
parse_arguments(respbuf + strlen(CMD_NXP) +
|
||||
strlen(PRIV_CMD_SSID_PROTECTION),
|
||||
data, ARRAY_SIZE(data), &user_data_len);
|
||||
}
|
||||
|
||||
if (user_data_len >= 2) {
|
||||
PRINTM(MERROR, "Too many arguments\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
if (user_data_len) {
|
||||
if (data[0] > 1) {
|
||||
PRINTM(MERROR, "Invalid ssid protection value\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_sec_cfg));
|
||||
if (req == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
req->req_id = MLAN_IOCTL_SEC_CFG;
|
||||
sec = (mlan_ds_sec_cfg *)req->pbuf;
|
||||
sec->sub_command = MLAN_OID_SEC_CFG_SSID_PROTECTION;
|
||||
if (user_data_len == 0)
|
||||
req->action = MLAN_ACT_GET;
|
||||
else {
|
||||
req->action = MLAN_ACT_SET;
|
||||
sec->param.ssid_protection = data[0];
|
||||
}
|
||||
|
||||
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
|
||||
if (status != MLAN_STATUS_SUCCESS) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
moal_memcpy_ext(priv->phandle, respbuf,
|
||||
(t_u8 *)&sec->param.ssid_protection, sizeof(data),
|
||||
respbuflen);
|
||||
ret = sizeof(data);
|
||||
done:
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deauthenticate
|
||||
*
|
||||
|
|
@ -5157,6 +5242,10 @@ static int woal_priv_set_get_drvdbg(moal_private *priv, t_u8 *respbuf,
|
|||
#endif
|
||||
printk(KERN_ALERT "MMPA_D (%08x) %s\n", MMPA_D,
|
||||
(drvdbg & MMPA_D) ? "X" : "");
|
||||
#ifdef SECURE_HOST
|
||||
printk(KERN_ALERT "MSHC_D (%08x) %s\n", MSHC_D,
|
||||
(drvdbg & MSHC_D) ? "X" : "");
|
||||
#endif
|
||||
printk(KERN_ALERT "MIF_D (%08x) %s\n", MIF_D,
|
||||
(drvdbg & MIF_D) ? "X" : "");
|
||||
printk(KERN_ALERT "MFW_D (%08x) %s\n", MFW_D,
|
||||
|
|
@ -7016,6 +7105,13 @@ static int woal_priv_warmreset(moal_private *priv, t_u8 *respbuf,
|
|||
moal_private *ref_priv;
|
||||
ENTER();
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (handle->params.secure_host) {
|
||||
PRINTM(MERROR,
|
||||
"Warm reset not supported with secure host enabled\n");
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
ret = woal_pre_warmreset(priv);
|
||||
if (ret)
|
||||
goto done;
|
||||
|
|
@ -9728,6 +9824,7 @@ static int woal_priv_set_get_dscp_map(moal_private *priv, t_u8 *respbuf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define BUF_LEN 50
|
||||
/**
|
||||
* @brief Get extended driver version
|
||||
*
|
||||
|
|
@ -9744,6 +9841,7 @@ static int woal_priv_get_driver_verext(moal_private *priv, t_u8 *respbuf,
|
|||
mlan_ds_get_info *info = NULL;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
int ret = 0;
|
||||
char buf[BUF_LEN];
|
||||
int copy_size = 0;
|
||||
int user_data_len = 0, header_len = 0;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
|
@ -9789,15 +9887,24 @@ static int woal_priv_get_driver_verext(moal_private *priv, t_u8 *respbuf,
|
|||
goto done;
|
||||
}
|
||||
|
||||
ret = snprintf(buf, BUF_LEN, "%s%s-%s, ", DRV_BUILDTYPE, KERN_VERSION,
|
||||
MLAN_EXT_RELEASE_VERSION);
|
||||
if (ret <= 0) {
|
||||
PRINTM(MERROR, "Failed to mlan release ext version\n");
|
||||
goto done;
|
||||
}
|
||||
/*
|
||||
* Set the amount to copy back to the application as the minimum of the
|
||||
* available assoc resp data or the buffer provided by the application
|
||||
*/
|
||||
copy_size = MIN(strlen(info->param.ver_ext.version_str), respbuflen);
|
||||
moal_memcpy_ext(priv->phandle, respbuf, info->param.ver_ext.version_str,
|
||||
copy_size, respbuflen);
|
||||
copy_size =
|
||||
MIN(ret + strlen(info->param.ver_ext.version_str), respbuflen);
|
||||
moal_memcpy_ext(priv->phandle, respbuf, buf, ret, respbuflen);
|
||||
moal_memcpy_ext(priv->phandle, respbuf + ret,
|
||||
info->param.ver_ext.version_str, copy_size - ret,
|
||||
respbuflen);
|
||||
ret = copy_size;
|
||||
PRINTM(MINFO, "MOAL EXTENDED VERSION: %s\n",
|
||||
PRINTM(MERROR, "MOAL EXTENDED VERSION: %s\n",
|
||||
info->param.ver_ext.version_str);
|
||||
|
||||
done:
|
||||
|
|
@ -17791,6 +17898,84 @@ done:
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Set/Get LTE coexistence parameters
|
||||
*
|
||||
* @param priv Pointer to moal_private structure
|
||||
* @param respbuf Pointer to response buffer
|
||||
* @param resplen Response buffer length
|
||||
*
|
||||
* @return Number of bytes written, negative for failure.
|
||||
*/
|
||||
static int woal_priv_lte_coex_band_cfg(moal_private *priv, t_u8 *respbuf,
|
||||
t_u32 respbuflen)
|
||||
{
|
||||
int ret = 0;
|
||||
t_u8 *pos = NULL;
|
||||
int user_data_len = 0, header_len = 0, data[1];
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_misc_cfg *misc_cfg = NULL;
|
||||
mlan_ds_misc_lte_coex_band_cfg *lte_cfg = NULL;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
|
||||
header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_LTE_COEX_CFG);
|
||||
/* Allocate an IOCTL request buffer */
|
||||
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
|
||||
if (req == NULL) {
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
}
|
||||
/* Fill request buffer */
|
||||
req->req_id = MLAN_IOCTL_MISC_CFG;
|
||||
misc_cfg = (mlan_ds_misc_cfg *)req->pbuf;
|
||||
misc_cfg->sub_command = MLAN_OID_MISC_LTE_COEX_CFG;
|
||||
lte_cfg = &misc_cfg->param.lte_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);
|
||||
pos = respbuf + header_len;
|
||||
if (user_data_len != 1) {
|
||||
PRINTM(MERROR, "Invalid number of args! %d\n",
|
||||
user_data_len);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
if (user_data_len == 1) {
|
||||
lte_cfg->band = data[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 (!user_data_len) {
|
||||
moal_memcpy_ext(priv->phandle, respbuf, (t_u8 *)lte_cfg,
|
||||
sizeof(mlan_ds_misc_lte_coex_band_cfg),
|
||||
respbuflen);
|
||||
ret = sizeof(mlan_ds_misc_lte_coex_band_cfg);
|
||||
}
|
||||
|
||||
done:
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get DFS repeater mode
|
||||
*
|
||||
|
|
@ -22763,6 +22948,13 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req)
|
|||
len = woal_setget_priv_passphrase(priv, buf,
|
||||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_SSID_PROTECTION,
|
||||
strlen(PRIV_CMD_SSID_PROTECTION)) == 0) {
|
||||
/* SSID protection mode configuration */
|
||||
len = woal_setget_priv_ssid_protection(
|
||||
priv, buf, priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP), PRIV_CMD_DEAUTH,
|
||||
strlen(PRIV_CMD_DEAUTH)) == 0) {
|
||||
/* Deauth */
|
||||
|
|
@ -23601,6 +23793,7 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req)
|
|||
len = woal_priv_get_foundry_type(priv, buf,
|
||||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_CROSS_CHIP_SYNCH,
|
||||
strlen(PRIV_CMD_CROSS_CHIP_SYNCH)) == 0) {
|
||||
|
|
@ -23800,6 +23993,13 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req)
|
|||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
#endif
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_LTE_COEX_CFG,
|
||||
strlen(PRIV_CMD_LTE_COEX_CFG)) == 0) {
|
||||
/* Set/Get LTE coexistence parameters */
|
||||
len = woal_priv_lte_coex_band_cfg(priv, buf,
|
||||
priv_cmd.total_len);
|
||||
goto handled;
|
||||
} else if (strnicmp(buf + strlen(CMD_NXP),
|
||||
PRIV_CMD_DFS_REPEATER_CFG,
|
||||
strlen(PRIV_CMD_DFS_REPEATER_CFG)) == 0) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ Change log:
|
|||
#define PRIV_CMD_GETLOG "getlog"
|
||||
#define PRIV_CMD_ESUPPMODE "esuppmode"
|
||||
#define PRIV_CMD_PASSPHRASE "passphrase"
|
||||
#define PRIV_CMD_SSID_PROTECTION "ssid_protection"
|
||||
#define PRIV_CMD_DEAUTH "deauth"
|
||||
#ifdef UAP_SUPPORT
|
||||
#define PRIV_CMD_AP_DEAUTH "apdeauth"
|
||||
|
|
@ -258,6 +259,7 @@ typedef struct _chan_stats {
|
|||
#define PRIV_CMD_TARGET_CHANNEL "targetchan"
|
||||
#define PRIV_CMD_BACKUP_CHANNEL "backupchan"
|
||||
|
||||
#define PRIV_CMD_LTE_COEX_CFG "ltecoexcfg"
|
||||
#define PRIV_CMD_DFS_REPEATER_CFG "dfs_repeater"
|
||||
#ifdef WIFI_DIRECT_SUPPORT
|
||||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
|
|
@ -313,6 +315,7 @@ typedef struct _chan_stats {
|
|||
#define PRIV_CMD_ARB_CFG "arb"
|
||||
|
||||
#define PRIV_CMD_FOUNDRY_TYPE "foundry_type"
|
||||
|
||||
/**Private command to configure static rx abort config */
|
||||
#define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg"
|
||||
/**Private command to configure static OFDM DESENSE config */
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ static int ext_scan;
|
|||
static int bootup_cal_ctrl = 0;
|
||||
/** IEEE PS mode */
|
||||
static int ps_mode;
|
||||
/** tcpackenh parameter */
|
||||
static int tcpackenh = 1;
|
||||
/** plinkstats parameter */
|
||||
static char *plinkstats = NULL;
|
||||
/** tcpackenh parameter */
|
||||
static int tcpackenh = 1;
|
||||
/** passive to active scan */
|
||||
static int p2a_scan;
|
||||
/** scan chan gap */
|
||||
|
|
@ -393,9 +393,6 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef SD8978
|
||||
{CARD_TYPE_SD8978, 0, CARD_SD8978},
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
{CARD_TYPE_SD8997, 0, CARD_SD8997},
|
||||
#endif
|
||||
#ifdef SD8987
|
||||
{CARD_TYPE_SD8987, 0, CARD_SD8987},
|
||||
#endif
|
||||
|
|
@ -420,9 +417,6 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef PCIE8897
|
||||
{CARD_TYPE_PCIE8897, 0, CARD_PCIE8897},
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
{CARD_TYPE_PCIE8997, 0, CARD_PCIE8997},
|
||||
#endif
|
||||
#ifdef PCIE9097
|
||||
{CARD_TYPE_PCIE9097, 0, CARD_PCIE9097},
|
||||
#endif
|
||||
|
|
@ -439,9 +433,6 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef USB8897
|
||||
{CARD_TYPE_USB8897, 0, CARD_USB8897},
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
{CARD_TYPE_USB8997, 0, CARD_USB8997},
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
{CARD_TYPE_USB8978, 0, CARD_USB8978},
|
||||
#endif
|
||||
|
|
@ -498,6 +489,11 @@ mlan_status check_device_name_info(char *device_name, t_u16 *card_type)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
/** secure host mode support */
|
||||
int secure_host = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function read a line in module parameter file
|
||||
*
|
||||
|
|
@ -1137,13 +1133,6 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
goto err;
|
||||
params->ps_mode = out_data;
|
||||
PRINTM(MMSG, "ps_mode = %d\n", params->ps_mode);
|
||||
} else if (strncmp(line, "tcpackenh", strlen("tcpackenh")) ==
|
||||
0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->tcpackenh = out_data;
|
||||
PRINTM(MMSG, "tcpackenh = %d\n", params->tcpackenh);
|
||||
} else if (strncmp(line, "plinkstats", strlen("plinkstats")) ==
|
||||
0) {
|
||||
if (parse_line_read_string(line, &out_str) !=
|
||||
|
|
@ -1151,6 +1140,13 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
goto err;
|
||||
woal_dup_string(¶ms->plinkstats, out_str);
|
||||
PRINTM(MMSG, "plinkstats=%s\n", params->plinkstats);
|
||||
} else if (strncmp(line, "tcpackenh", strlen("tcpackenh")) ==
|
||||
0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->tcpackenh = out_data;
|
||||
PRINTM(MMSG, "tcpackenh = %d\n", params->tcpackenh);
|
||||
} else if (strncmp(line, "p2a_scan", strlen("p2a_scan")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
|
|
@ -1952,6 +1948,16 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
PRINTM(MMSG, "make_before_break=%x\n",
|
||||
params->make_before_break);
|
||||
}
|
||||
#ifdef SECURE_HOST
|
||||
else if (strncmp(line, "secure_host", strlen("secure_host")) ==
|
||||
0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->secure_host = out_data;
|
||||
}
|
||||
#endif
|
||||
|
||||
else if (strncmp(line, "bandctrl", strlen("bandctrl")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
|
|
@ -1970,6 +1976,11 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
params->mclient_scheduling = 0;
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (!IS_CARDAW693(handle->card_type))
|
||||
params->secure_host = 0;
|
||||
#endif
|
||||
|
||||
if (end)
|
||||
return ret;
|
||||
err:
|
||||
|
|
@ -2455,6 +2466,14 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
handle->params.tpe_ie_ignore = params->tpe_ie_ignore;
|
||||
handle->params.make_before_break = make_before_break;
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
handle->params.secure_host = secure_host;
|
||||
if (params)
|
||||
handle->params.secure_host = params->secure_host;
|
||||
if (!IS_CARDAW693(handle->card_type))
|
||||
handle->params.secure_host = 0;
|
||||
#endif
|
||||
|
||||
handle->params.bandctrl = bandctrl;
|
||||
if (params)
|
||||
handle->params.bandctrl = params->bandctrl;
|
||||
|
|
@ -3103,6 +3122,15 @@ void woal_init_from_dev_tree(void)
|
|||
make_before_break = data;
|
||||
}
|
||||
}
|
||||
#ifdef SECURE_HOST
|
||||
else if (!strncmp(prop->name, "secure_host",
|
||||
strlen("secure_host"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
PRINTM(MIOCTL, "secure_host=0x%x\n", data);
|
||||
secure_host = data;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
else if (!strncmp(prop->name, "bandctrl", strlen("bandctrl"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
|
|
@ -3715,7 +3743,7 @@ MODULE_PARM_DESC(
|
|||
module_param(antcfg, int, 0660);
|
||||
MODULE_PARM_DESC(
|
||||
antcfg,
|
||||
"0:default; SD8887/SD8987-[1:Tx/Rx antenna 1, 2:Tx/Rx antenna 2, 0xffff:enable antenna diversity];SD8897/SD8997-[Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B];9098/9097-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B,Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B];AW693-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B, Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B, Bit 16: 6G Tx/Rx path A, Bit 17: 6G Tx/Rx path B]");
|
||||
"0:default; SD8887/SD8987-[1:Tx/Rx antenna 1, 2:Tx/Rx antenna 2, 0xffff:enable antenna diversity];SD8897-[Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B];9098/9097-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B,Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B];AW693-[Bit 0: 2G Tx/Rx path A, Bit 1: 2G Tx/Rx path B, Bit 8: 5G Tx/Rx path A, Bit 9: 5G Tx/Rx path B, Bit 16: 6G Tx/Rx path A, Bit 17: 6G Tx/Rx path B]");
|
||||
|
||||
module_param(uap_oper_ctrl, uint, 0);
|
||||
MODULE_PARM_DESC(uap_oper_ctrl, "0:default; 0x20001:uap restarts on channel 6");
|
||||
|
|
@ -3908,6 +3936,13 @@ MODULE_PARM_DESC(
|
|||
make_before_break,
|
||||
"1: make_before_break during roam; 0: no make_before_break during roam");
|
||||
|
||||
module_param(bandctrl, int, 0660);
|
||||
#ifdef SECURE_HOST
|
||||
module_param(secure_host, int, 0660);
|
||||
MODULE_PARM_DESC(
|
||||
secure_host,
|
||||
"0: Disable secure host mode(default); 1: Enable secure host mode");
|
||||
#endif
|
||||
|
||||
module_param(bandctrl, int, 0);
|
||||
MODULE_PARM_DESC(bandctrl,
|
||||
"0: Disable bandctrl mode(default); 1: Enable bandctrl mode");
|
||||
|
|
|
|||
|
|
@ -2314,7 +2314,27 @@ mlan_status woal_request_get_fw_info(moal_private *priv, t_u8 wait_option,
|
|||
/* Send IOCTL request to MLAN */
|
||||
status = woal_request_ioctl(priv, req, wait_option);
|
||||
if (status == MLAN_STATUS_SUCCESS) {
|
||||
priv->phandle->fw_release_number = info->param.fw_info.fw_ver;
|
||||
moal_memcpy_ext(priv->phandle,
|
||||
&priv->phandle->fw_release_number,
|
||||
&info->param.fw_info.fw_ver,
|
||||
sizeof(info->param.fw_info.fw_ver),
|
||||
sizeof(priv->phandle->fw_release_number));
|
||||
strncpy(priv->phandle->fw_ver_milestone,
|
||||
info->param.fw_info.fw_ver_milestone,
|
||||
sizeof(priv->phandle->fw_ver_milestone) - 1);
|
||||
priv->phandle->fw_ver_milestone
|
||||
[sizeof(priv->phandle->fw_ver_milestone) - 1] = '\0';
|
||||
strncpy(priv->phandle->fw_ver_buildtype,
|
||||
info->param.fw_info.fw_ver_buildtype,
|
||||
sizeof(priv->phandle->fw_ver_buildtype) - 1);
|
||||
priv->phandle->fw_ver_buildtype
|
||||
[sizeof(priv->phandle->fw_ver_buildtype) - 1] = '\0';
|
||||
strncpy(priv->phandle->fw_ver_data,
|
||||
info->param.fw_info.fw_ver_data,
|
||||
sizeof(priv->phandle->fw_ver_data) - 1);
|
||||
priv->phandle
|
||||
->fw_ver_data[sizeof(priv->phandle->fw_ver_data) - 1] =
|
||||
'\0';
|
||||
priv->phandle->fw_hotfix_version =
|
||||
info->param.fw_info.hotfix_version;
|
||||
priv->phandle->fw_ecsa_enable = info->param.fw_info.ecsa_enable;
|
||||
|
|
@ -4571,33 +4591,61 @@ done:
|
|||
*/
|
||||
void woal_get_version(moal_handle *handle, char *version, int max_len)
|
||||
{
|
||||
t_u8 hotfix_ver = 0;
|
||||
union {
|
||||
t_u32 l;
|
||||
t_u8 c[4];
|
||||
} ver;
|
||||
char fw_ver[32];
|
||||
t_u8 hotfix_ver = 0, copied_len = 0;
|
||||
char fw_ver[100];
|
||||
|
||||
ENTER();
|
||||
|
||||
memset(fw_ver, 0, sizeof(fw_ver));
|
||||
hotfix_ver = handle->fw_hotfix_version;
|
||||
ver.l = handle->fw_release_number;
|
||||
|
||||
if (hotfix_ver) {
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u.%u",
|
||||
ver.c[2], ver.c[1], ver.c[0], ver.c[3],
|
||||
hotfix_ver) <= 0)
|
||||
if (strlen(handle->fw_ver_milestone) != 0) {
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%s-",
|
||||
handle->fw_ver_milestone) <= 0)
|
||||
PRINTM(MERROR,
|
||||
"Failed to print hotfix fw version in buffer\n");
|
||||
|
||||
} else {
|
||||
if (snprintf(fw_ver, sizeof(fw_ver), "%u.%u.%u.p%u", ver.c[2],
|
||||
ver.c[1], ver.c[0], ver.c[3]) <= 0)
|
||||
PRINTM(MERROR,
|
||||
"Failed to print fw version in buffer\n");
|
||||
"Failed to print fw version milestone in buffer\n");
|
||||
else
|
||||
copied_len = strlen(fw_ver);
|
||||
}
|
||||
|
||||
if (snprintf(version, max_len, handle->driver_version, fw_ver) <= 0)
|
||||
if (snprintf(fw_ver + copied_len, sizeof(fw_ver) - copied_len,
|
||||
"%u.%u.%u.p%u", handle->fw_release_number.majorRevNum,
|
||||
handle->fw_release_number.minorRevNum,
|
||||
handle->fw_release_number.releaseNum,
|
||||
handle->fw_release_number.patchLevel) <= 0)
|
||||
PRINTM(MERROR, "Failed to print fw version in buffer\n");
|
||||
else
|
||||
copied_len = strlen(fw_ver);
|
||||
|
||||
if (hotfix_ver) {
|
||||
if (snprintf(fw_ver + copied_len, sizeof(fw_ver) - copied_len,
|
||||
".%u", hotfix_ver) <= 0)
|
||||
PRINTM(MERROR,
|
||||
"Failed to print hotfix fw version in buffer\n");
|
||||
else
|
||||
copied_len = strlen(fw_ver);
|
||||
}
|
||||
|
||||
if (strlen(handle->fw_ver_data) != 0) {
|
||||
if (snprintf(fw_ver + copied_len, sizeof(fw_ver) - copied_len,
|
||||
", %s", handle->fw_ver_data) <= 0)
|
||||
PRINTM(MERROR,
|
||||
"Failed to print fw version data in buffer\n");
|
||||
else
|
||||
copied_len = strlen(fw_ver);
|
||||
}
|
||||
|
||||
if (strlen(handle->fw_ver_buildtype) != 0) {
|
||||
if (snprintf(fw_ver + copied_len, sizeof(fw_ver) - copied_len,
|
||||
"-%s", handle->fw_ver_buildtype) <= 0)
|
||||
PRINTM(MERROR,
|
||||
"Failed to print fw version buildtype in buffer\n");
|
||||
else
|
||||
copied_len = strlen(fw_ver);
|
||||
}
|
||||
|
||||
if (snprintf(version, max_len, handle->driver_version, fw_ver,
|
||||
REL_MILESTONE) <= 0)
|
||||
PRINTM(MERROR, "Failed to print driver version in buffer\n");
|
||||
|
||||
LEAVE();
|
||||
|
|
@ -7645,9 +7693,13 @@ mlan_status woal_set_bandctrl(moal_private *priv, t_u32 bandctrl)
|
|||
if (priv->media_connected && !priv->cfg_disconnect) {
|
||||
PRINTM(MMSG, "Disconnect STA " MACSTR "\n",
|
||||
MAC2STR(priv->cfg_bssid));
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT_TIMEOUT,
|
||||
priv->cfg_bssid,
|
||||
DEF_DEAUTH_REASON_CODE);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT_TIMEOUT,
|
||||
priv->cfg_bssid,
|
||||
DEF_DEAUTH_REASON_CODE)) {
|
||||
PRINTM(MERROR, "%s: woal_disconnect failed \n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
} else if (bandctrl == BANDCTRL_SET_BANDCFG) {
|
||||
priv->fake_scan_complete = MFALSE;
|
||||
|
|
@ -7657,9 +7709,13 @@ mlan_status woal_set_bandctrl(moal_private *priv, t_u32 bandctrl)
|
|||
(priv->channel > 14)) {
|
||||
PRINTM(MMSG, "Disconnect STA " MACSTR "\n",
|
||||
MAC2STR(priv->cfg_bssid));
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT_TIMEOUT,
|
||||
priv->cfg_bssid,
|
||||
DEF_DEAUTH_REASON_CODE);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT_TIMEOUT,
|
||||
priv->cfg_bssid,
|
||||
DEF_DEAUTH_REASON_CODE)) {
|
||||
PRINTM(MERROR, "%s: woal_disconnect failed \n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
woal_flush_scan_table(priv, BAND_SELECT_2G_ONLY);
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||
|
|
@ -8785,6 +8841,7 @@ void woal_ioctl_get_misc_conf(moal_private *priv, mlan_ds_misc_cfg *info)
|
|||
#define HE_TB_TX_STR_LEN 30
|
||||
#define MAX_RADIO_MODE 21
|
||||
#define OTP_RDWR_LEN 50
|
||||
#define MAX_THERMAL_SIMULATION_LEN 100
|
||||
|
||||
/*
|
||||
* @brief Parse mfg cmd radio mode string
|
||||
|
|
@ -9647,6 +9704,110 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Parse mfg_CmdDebugTemperature_Cfg_t
|
||||
*
|
||||
* @param handle A pointer to moal_handle structure
|
||||
* @param s A pointer to user buffer
|
||||
* @param len Length of user buffer
|
||||
* @param d A pointer to mfg_cmd_generic_cfg struct
|
||||
* @return 0 on success, -EINVAL otherwise
|
||||
*/
|
||||
|
||||
static int parse_set_debug_temperature(const char *s, size_t len,
|
||||
mfg_CmdDebugTemperature_Cfg_t *d)
|
||||
{
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
char *string = NULL;
|
||||
char *temp = NULL;
|
||||
char *pos = NULL;
|
||||
t_u8 mac, rpath;
|
||||
gfp_t flag;
|
||||
size_t prefix_len;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (!s || !d) {
|
||||
LEAVE();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
flag = GFP_KERNEL;
|
||||
if (in_atomic())
|
||||
flag = GFP_ATOMIC;
|
||||
else if (irqs_disabled())
|
||||
flag = GFP_ATOMIC;
|
||||
|
||||
string = kzalloc(MAX_THERMAL_SIMULATION_LEN, flag);
|
||||
if (!string) {
|
||||
PRINTM(MERROR, "Memory allocation failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
memset(d, 0, sizeof(mfg_CmdDebugTemperature_Cfg_t));
|
||||
// Safely copy the input string, excluding the prefix
|
||||
prefix_len = strlen("set_debug_temperature=");
|
||||
if (len <= prefix_len) {
|
||||
PRINTM(MERROR, "Invalid input string length\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
strncpy(string, s + prefix_len, MAX_THERMAL_SIMULATION_LEN - 1);
|
||||
string[MAX_THERMAL_SIMULATION_LEN - 1] = '\0';
|
||||
|
||||
temp = strstrip(string);
|
||||
|
||||
// Parse simulation enable
|
||||
pos = strsep(&temp, " \t");
|
||||
if (!pos) {
|
||||
PRINTM(MERROR, "Missing simulation enable parameter\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
d->simulation_enable = (t_u32)woal_string_to_number(pos);
|
||||
if (d->simulation_enable == MFALSE) {
|
||||
PRINTM(MERROR, "Thermal simulation disabled\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
// Parse CAU temperature
|
||||
pos = strsep(&temp, " \t");
|
||||
if (!pos) {
|
||||
PRINTM(MERROR, "Missing CAU temperature parameter\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
d->cau_temperature = (t_s32)woal_string_to_number(pos);
|
||||
|
||||
// Parse RFU temperatures
|
||||
for (mac = 0; mac < MAX_RFUS; mac++) {
|
||||
for (rpath = 0; rpath < MAX_PATHS; rpath++) {
|
||||
pos = strsep(&temp, " \t");
|
||||
if (!pos) {
|
||||
PRINTM(MERROR, "Insufficient parameters\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
d->rfu_temperature[mac][rpath] =
|
||||
(t_s32)woal_string_to_number(pos);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate simulation enable
|
||||
if (d->simulation_enable > 1) {
|
||||
PRINTM(MERROR, "Invalid simulation enable value\n");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
kfree(string);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function sends RF test mode command in firmware
|
||||
*
|
||||
|
|
@ -9663,6 +9824,7 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
|
|||
mlan_ds_misc_cfg *misc = NULL;
|
||||
int err = MFALSE;
|
||||
int i;
|
||||
t_u8 mac, rpath;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
|
@ -9692,9 +9854,7 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
|
|||
err = MTRUE;
|
||||
break;
|
||||
case MFG_CMD_RF_CHANNELBW:
|
||||
if (val != 0 && val != 1 &&
|
||||
(val != 4 ||
|
||||
(val == 4 && handle->rf_data->band == BAND_2GHZ)))
|
||||
if (val != 0 && val != 1 && val != 4)
|
||||
err = MTRUE;
|
||||
break;
|
||||
case MFG_CMD_RF_CHAN:
|
||||
|
|
@ -9748,6 +9908,13 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
|
|||
err = MTRUE;
|
||||
}
|
||||
break;
|
||||
case MFG_CMD_SET_DEBUG_TEMPERATURE:
|
||||
misc->sub_command = MLAN_OID_MISC_RF_TEST_DEBUG_TEMPERATURE;
|
||||
if (parse_set_debug_temperature(buffer, len,
|
||||
&misc->param.mfg_debug_temp)) {
|
||||
err = MTRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
err = MTRUE;
|
||||
}
|
||||
|
|
@ -9917,6 +10084,21 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
|
|||
misc->param.mfg_otp_cal_data_rd_wr.cal_data[i];
|
||||
}
|
||||
break;
|
||||
case MFG_CMD_SET_DEBUG_TEMPERATURE:
|
||||
handle->rf_data->mfg_debug_temp.action =
|
||||
misc->param.mfg_debug_temp.action;
|
||||
handle->rf_data->mfg_debug_temp.simulation_enable =
|
||||
misc->param.mfg_debug_temp.simulation_enable;
|
||||
handle->rf_data->mfg_debug_temp.cau_temperature =
|
||||
misc->param.mfg_debug_temp.cau_temperature;
|
||||
for (mac = 0; mac < MAX_RFUS; mac++) {
|
||||
for (rpath = 0; (rpath < MAX_PATHS); rpath++)
|
||||
handle->rf_data->mfg_debug_temp
|
||||
.rfu_temperature[mac][rpath] =
|
||||
misc->param.mfg_debug_temp
|
||||
.rfu_temperature[mac][rpath];
|
||||
}
|
||||
break;
|
||||
}
|
||||
done:
|
||||
if (err || ret != MLAN_STATUS_PENDING)
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ Change log:
|
|||
#include <linux/rtc.h>
|
||||
#include <linux/utsname.h>
|
||||
#endif
|
||||
#ifdef SECURE_HOST
|
||||
#include "moal_shc.h"
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
|
|
@ -319,50 +322,6 @@ static struct _card_info card_info_SD8978 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef SD8997
|
||||
static struct _card_info card_info_SD8997 = {
|
||||
.embedded_supp = 1,
|
||||
.drcs = 0,
|
||||
.go_noa = 1,
|
||||
.v16_fw_api = 1,
|
||||
.pmic = 1,
|
||||
.cal_data_cfg = 1,
|
||||
.low_power_enable = 0,
|
||||
.rx_rate_max = 196,
|
||||
.histogram_table_num = 3,
|
||||
.feature_control = FEATURE_CTRL_DEFAULT,
|
||||
.rev_id_reg = 0xc8,
|
||||
.host_strap_reg = 0xf4,
|
||||
.magic_reg = 0xf0,
|
||||
.fw_name = SD8997_DEFAULT_COMBO_FW_NAME,
|
||||
.fw_name_wlan = SD8997_DEFAULT_WLAN_FW_NAME,
|
||||
#ifdef SDIO
|
||||
.dump_fw_info = DUMP_FW_SDIO_V3,
|
||||
.dump_fw_ctrl_reg = 0xf9,
|
||||
.dump_fw_start_reg = 0xf1,
|
||||
.dump_fw_end_reg = 0xf8,
|
||||
.dump_fw_host_ready = 0xcc,
|
||||
.dump_reg.reg_table = {0x08, 0x58, 0x5C, 0x5D, 0x60, 0x61, 0x62, 0x64,
|
||||
0x65, 0x66, 0x68, 0x69, 0x6a},
|
||||
.dump_reg.reg_table_size = 13,
|
||||
.scratch_reg = 0xe8,
|
||||
.func1_reg_start = 0x10,
|
||||
.func1_reg_end = 0x17,
|
||||
.fw_stuck_code_reg = 0xEB,
|
||||
.fw_reset_reg = 0x0EE,
|
||||
.fw_reset_val = 0x99,
|
||||
.fw_wakeup_reg = 0,
|
||||
.fw_wakeup_val = 2,
|
||||
.fw_winner_status_reg = 0xFC,
|
||||
.slew_rate_reg = 0x80002328,
|
||||
.slew_rate_bit_offset = 12,
|
||||
#endif
|
||||
.sniffer_support = 1,
|
||||
.per_pkt_cfg_support = 1,
|
||||
.host_mlme_required = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef SD9098
|
||||
static struct _card_info card_info_SD9098 = {
|
||||
.embedded_supp = 1,
|
||||
|
|
@ -633,33 +592,6 @@ static struct _card_info card_info_SDIW610 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef PCIE8997
|
||||
static struct _card_info card_info_PCIE8997 = {
|
||||
.embedded_supp = 1,
|
||||
.drcs = 0,
|
||||
.go_noa = 1,
|
||||
.v16_fw_api = 1,
|
||||
.pmic = 1,
|
||||
.cal_data_cfg = 1,
|
||||
.low_power_enable = 0,
|
||||
.rx_rate_max = 196,
|
||||
.histogram_table_num = 3,
|
||||
.feature_control = FEATURE_CTRL_DEFAULT,
|
||||
.rev_id_reg = 0x8,
|
||||
.host_strap_reg = 0x0cd0,
|
||||
.magic_reg = 0x0cd4,
|
||||
.fw_name = PCIE8997_DEFAULT_COMBO_FW_NAME,
|
||||
.fw_name_wlan = PCIE8997_DEFAULT_WLAN_FW_NAME,
|
||||
.fw_stuck_code_reg = 0xcf8,
|
||||
.fw_reset_reg = 0xcf4,
|
||||
.fw_reset_val = 0x99,
|
||||
.fw_wakeup_reg = 0x0c48,
|
||||
.sniffer_support = 1,
|
||||
.per_pkt_cfg_support = 1,
|
||||
.host_mlme_required = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef PCIE9097
|
||||
static struct _card_info card_info_PCIE9097 = {
|
||||
.embedded_supp = 1,
|
||||
|
|
@ -794,26 +726,6 @@ static struct _card_info card_info_USB8978 = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef USB8997
|
||||
static struct _card_info card_info_USB8997 = {
|
||||
.embedded_supp = 1,
|
||||
.drcs = 1,
|
||||
.go_noa = 1,
|
||||
.v16_fw_api = 1,
|
||||
.pmic = 1,
|
||||
.cal_data_cfg = 1,
|
||||
.low_power_enable = 0,
|
||||
.rx_rate_max = 196,
|
||||
.feature_control = FEATURE_CTRL_DEFAULT,
|
||||
.histogram_table_num = 3,
|
||||
.fw_name = USB8997_DEFAULT_COMBO_FW_NAME,
|
||||
.fw_name_wlan = USB8997_DEFAULT_WLAN_FW_NAME,
|
||||
.sniffer_support = 1,
|
||||
.per_pkt_cfg_support = 1,
|
||||
.host_mlme_required = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef USB9098
|
||||
static struct _card_info card_info_USB9098 = {
|
||||
.embedded_supp = 1,
|
||||
|
|
@ -1026,6 +938,20 @@ static mlan_callbacks woal_callbacks = {
|
|||
.moal_unaligned_access.moal_read_u32 = moal_read_unaligned_u32,
|
||||
.moal_unaligned_access.moal_write_u16 = moal_write_unaligned_u16,
|
||||
.moal_unaligned_access.moal_write_u32 = moal_write_unaligned_u32,
|
||||
#ifdef SECURE_HOST
|
||||
.moal_secure_host_get_msg_id = moal_secure_host_get_msg_id,
|
||||
.moal_secure_host_init = moal_secure_host_init,
|
||||
.moal_secure_host_cleanup = moal_secure_host_cleanup,
|
||||
.moal_secure_host_do_hello = moal_secure_host_do_hello,
|
||||
.moal_secure_host_device_hello_rcvd =
|
||||
moal_secure_host_device_hello_rcvd,
|
||||
.moal_secure_host_do_finished = moal_secure_host_do_finished,
|
||||
.moal_secure_host_derive_traffic_keys =
|
||||
moal_secure_host_derive_traffic_keys,
|
||||
.moal_secure_host_data_ctx_init = moal_secure_host_data_ctx_init,
|
||||
.moal_secure_host_data_encrypt = moal_secure_host_data_encrypt,
|
||||
.moal_secure_host_data_decrypt = moal_secure_host_data_decrypt,
|
||||
#endif
|
||||
.moal_crc32_be = moal_crc32_be,
|
||||
};
|
||||
|
||||
|
|
@ -1299,6 +1225,12 @@ void woal_clean_up(moal_handle *handle)
|
|||
}
|
||||
|
||||
woal_flush_evt_queue(handle);
|
||||
// Cancel pending ioctl
|
||||
if (handle->pmlan_adapter) {
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
queue_work(handle->workqueue, &handle->main_work);
|
||||
woal_sched_timeout(10);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1485,93 +1417,23 @@ static void woal_get_timestamp(char *tstamp)
|
|||
*/
|
||||
static void woal_hang_work_queue(struct work_struct *work)
|
||||
{
|
||||
int i;
|
||||
moal_private *priv;
|
||||
int cfg80211_wext = 0;
|
||||
int ret = 0;
|
||||
t_u8 reload_mode = 0;
|
||||
moal_handle *ref_handle = NULL;
|
||||
ENTER();
|
||||
if (!reset_handle) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
mlan_ioctl(reset_handle->pmlan_adapter, NULL);
|
||||
cfg80211_wext = reset_handle->params.cfg80211_wext;
|
||||
// stop pending scan
|
||||
#ifdef STA_CFG80211
|
||||
if (IS_STA_CFG80211(cfg80211_wext) && reset_handle->scan_request &&
|
||||
reset_handle->scan_priv) {
|
||||
moal_private *scan_priv = reset_handle->scan_priv;
|
||||
/** some supplicant can not handle SCAN abort event */
|
||||
if (scan_priv->bss_type == MLAN_BSS_TYPE_STA)
|
||||
woal_cfg80211_scan_done(reset_handle->scan_request,
|
||||
MTRUE);
|
||||
else
|
||||
woal_cfg80211_scan_done(reset_handle->scan_request,
|
||||
MFALSE);
|
||||
reset_handle->scan_request = NULL;
|
||||
reset_handle->scan_priv = NULL;
|
||||
cancel_delayed_work_sync(&reset_handle->scan_timeout_work);
|
||||
reset_handle->scan_pending_on_block = MFALSE;
|
||||
MOAL_REL_SEMAPHORE(&reset_handle->async_sem);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = 0; i < reset_handle->priv_num; i++) {
|
||||
if (reset_handle->priv[i]) {
|
||||
priv = reset_handle->priv[i];
|
||||
woal_stop_queue(priv->netdev);
|
||||
if (netif_carrier_ok(priv->netdev))
|
||||
netif_carrier_off(priv->netdev);
|
||||
priv->media_connected = MFALSE;
|
||||
// disconnect
|
||||
moal_connection_status_check_pmqos(priv->phandle);
|
||||
#ifdef STA_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||||
if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev &&
|
||||
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \
|
||||
(defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31))
|
||||
priv->wdev->connected) {
|
||||
#else
|
||||
priv->wdev->current_bss) {
|
||||
#endif
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
|
||||
if (priv->host_mlme)
|
||||
woal_deauth_event(
|
||||
priv,
|
||||
MLAN_REASON_DEAUTH_LEAVING,
|
||||
priv->cfg_bssid);
|
||||
else
|
||||
#endif
|
||||
cfg80211_disconnected(priv->netdev, 0,
|
||||
NULL, 0,
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||
true,
|
||||
#endif
|
||||
GFP_KERNEL);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
// stop bgscan
|
||||
#ifdef STA_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
|
||||
if (IS_STA_CFG80211(cfg80211_wext) &&
|
||||
priv->sched_scanning && priv->wdev) {
|
||||
priv->bg_scan_start = MFALSE;
|
||||
priv->bg_scan_reported = MFALSE;
|
||||
cfg80211_sched_scan_stopped(priv->wdev->wiphy
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
,
|
||||
priv->bg_scan_reqid
|
||||
#endif
|
||||
);
|
||||
priv->sched_scanning = MFALSE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if (reset_handle->pref_mac) {
|
||||
ref_handle = reset_handle->pref_mac;
|
||||
woal_clean_up(ref_handle);
|
||||
woal_flush_workqueue(ref_handle);
|
||||
}
|
||||
woal_clean_up(reset_handle);
|
||||
woal_flush_workqueue(reset_handle);
|
||||
if (reset_handle->params.auto_fw_reload) {
|
||||
if (IS_SD(reset_handle->card_type)) {
|
||||
|
|
@ -2566,6 +2428,10 @@ mlan_status woal_init_sw(moal_handle *handle)
|
|||
t_void *pmlan;
|
||||
int cfg80211_wext = handle->params.cfg80211_wext;
|
||||
|
||||
#if defined(SECURE_HOST)
|
||||
moal_handle *ref_handle = NULL;
|
||||
#endif
|
||||
|
||||
ENTER();
|
||||
|
||||
if (!device) {
|
||||
|
|
@ -2946,6 +2812,26 @@ mlan_status woal_init_sw(moal_handle *handle)
|
|||
memset(handle->mode_psd_ru_string, 0,
|
||||
sizeof(handle->mode_psd_ru_string));
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
device->secure_host = (t_u32)handle->params.secure_host;
|
||||
|
||||
if (handle->second_mac && handle->params.secure_host &&
|
||||
handle->pref_mac) {
|
||||
ref_handle = (moal_handle *)handle->pref_mac;
|
||||
handle->secure = ref_handle->secure;
|
||||
}
|
||||
|
||||
if (handle->second_mac && handle->params.secure_host &&
|
||||
!handle->secure) {
|
||||
PRINTM(MERROR, "secure host handshake incomplete\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
if (device)
|
||||
kfree(device);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
moal_memcpy_ext(handle, &device->callbacks, &woal_callbacks,
|
||||
sizeof(mlan_callbacks), sizeof(mlan_callbacks));
|
||||
if (!handle->params.amsdu_deaggr)
|
||||
|
|
@ -3035,6 +2921,16 @@ void woal_free_moal_handle(moal_handle *handle)
|
|||
fwdump_fname = NULL;
|
||||
}
|
||||
|
||||
#ifdef SECURE_HOST
|
||||
if (handle->params.secure_host) {
|
||||
moal_secure_host_cleanup(handle);
|
||||
handle->secure = NULL;
|
||||
if (handle->pref_mac) {
|
||||
ref_handle = (moal_handle *)handle->pref_mac;
|
||||
ref_handle->secure = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Free module params */
|
||||
woal_free_module_param(handle);
|
||||
/** clear pref_mac to avoid later crash */
|
||||
|
|
@ -4916,7 +4812,7 @@ static mlan_status woal_req_cal_data(moal_handle *handle,
|
|||
}
|
||||
} else if (!cal_data_cfg && handle->card_info->cal_data_cfg) {
|
||||
PRINTM(MERROR,
|
||||
"Please add cal_data_cfg for 8887/8977/8997/8987/8978\n");
|
||||
"Please add cal_data_cfg for 8887/8977/8987/8978\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -5012,11 +4908,7 @@ 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
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
if (handle->ops.reg_dbg)
|
||||
handle->ops.reg_dbg(handle);
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -5024,8 +4916,7 @@ static mlan_status woal_init_fw_dpc(moal_handle *handle)
|
|||
|
||||
#if defined(USB)
|
||||
if (handle->boot_state == USB_FW_DNLD) {
|
||||
if (!IS_USB8997(handle->card_type) &&
|
||||
!IS_USB9098(handle->card_type) &&
|
||||
if (!IS_USB9098(handle->card_type) &&
|
||||
!IS_USB9097(handle->card_type) &&
|
||||
!IS_USBIW624(handle->card_type) &&
|
||||
!IS_USBIW610(handle->card_type) &&
|
||||
|
|
@ -5092,11 +4983,7 @@ 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
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
if (handle->ops.reg_dbg)
|
||||
handle->ops.reg_dbg(handle);
|
||||
#ifdef DEBUG_LEVEL1
|
||||
if (drvdbg & MFW_D) {
|
||||
|
|
@ -6765,10 +6652,14 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_index,
|
|||
(bss_type == MLAN_BSS_TYPE_STA))
|
||||
woal_start_bgscan(priv);
|
||||
#endif /* STA_SUPPORT */
|
||||
if (handle->params.plinkstats)
|
||||
#ifdef STA_CFG80211
|
||||
#ifdef STA_SUPPORT
|
||||
if (handle->params.plinkstats) {
|
||||
/* Init plinkstats parameters*/
|
||||
woal_priv_init_link_stats(priv);
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
LEAVE();
|
||||
return priv;
|
||||
error:
|
||||
|
|
@ -6931,7 +6822,22 @@ void woal_remove_interface(moal_handle *handle, t_u8 bss_index)
|
|||
if (IS_STA_OR_UAP_CFG80211(handle->params.cfg80211_wext) &&
|
||||
priv->bss_type != MLAN_BSS_TYPE_DFS) {
|
||||
rtnl_lock();
|
||||
/*
|
||||
* Close the netdev first, else
|
||||
* netdev notifiers will need to acquire the wiphy lock
|
||||
* again in cfg80211_unregister_netdevice() causing
|
||||
* deadlock.
|
||||
*/
|
||||
|
||||
if (priv->wdev->netdev)
|
||||
dev_close(priv->wdev->netdev);
|
||||
/*
|
||||
* cfg80211_unregister_netdevice() requires both the
|
||||
* RTNL and wiphy mutex to be held
|
||||
* */
|
||||
mutex_lock(&handle->wiphy->mtx);
|
||||
cfg80211_unregister_netdevice(dev);
|
||||
mutex_unlock(&handle->wiphy->mtx);
|
||||
rtnl_unlock();
|
||||
} else
|
||||
#endif
|
||||
|
|
@ -6980,8 +6886,27 @@ void woal_remove_interface(moal_handle *handle, t_u8 bss_index)
|
|||
if (priv->vlan_sta_list[count]->is_valid) {
|
||||
priv->vlan_sta_list[count]->is_valid = MFALSE;
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
/*
|
||||
* cfg80211_unregister_netdevice() requires both
|
||||
* the RTNL and wiphy mutex to be held
|
||||
* */
|
||||
rtnl_lock();
|
||||
/*
|
||||
* Close the netdev first, else
|
||||
* netdev notifiers will need to acquire the
|
||||
* wiphy lock again in
|
||||
* cfg80211_unregister_netdevice() causing
|
||||
* deadlock.
|
||||
* */
|
||||
|
||||
if (priv->vlan_sta_list[count]->netdev)
|
||||
dev_close(priv->vlan_sta_list[count]
|
||||
->netdev);
|
||||
mutex_lock(&handle->wiphy->mtx);
|
||||
cfg80211_unregister_netdevice(
|
||||
priv->vlan_sta_list[count]->netdev);
|
||||
mutex_unlock(&handle->wiphy->mtx);
|
||||
rtnl_unlock();
|
||||
#else
|
||||
unregister_netdevice(
|
||||
priv->vlan_sta_list[count]->netdev);
|
||||
|
|
@ -10433,11 +10358,6 @@ static int woal_get_card_info(moal_handle *phandle)
|
|||
phandle->card_info = &card_info_SD8978;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
case CARD_TYPE_SD8997:
|
||||
phandle->card_info = &card_info_SD8997;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD9098
|
||||
case CARD_TYPE_SD9098:
|
||||
phandle->card_info = &card_info_SD9098;
|
||||
|
|
@ -10471,11 +10391,6 @@ static int woal_get_card_info(moal_handle *phandle)
|
|||
phandle->event_fw_dump = MTRUE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
case CARD_TYPE_PCIE8997:
|
||||
phandle->card_info = &card_info_PCIE8997;
|
||||
break;
|
||||
#endif
|
||||
#ifdef PCIE9097
|
||||
case CARD_TYPE_PCIE9097:
|
||||
phandle->card_info = &card_info_PCIE9097;
|
||||
|
|
@ -10499,11 +10414,6 @@ static int woal_get_card_info(moal_handle *phandle)
|
|||
phandle->event_fw_dump = MTRUE;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
case CARD_TYPE_USB8997:
|
||||
phandle->card_info = &card_info_USB8997;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
case CARD_TYPE_USB8978:
|
||||
phandle->card_info = &card_info_USB8978;
|
||||
|
|
@ -11568,7 +11478,7 @@ t_void woal_store_ssu_dump(moal_handle *phandle, mlan_event *pmevent)
|
|||
PRINTM(MERROR, "event_len is invalid\n");
|
||||
}
|
||||
|
||||
PRINTM(MINFO, "ssu dump event: evt_len=%d toal_len=%llu\n",
|
||||
PRINTM(MINFO, "ssu dump event: evt_len=%u toal_len=%llu\n",
|
||||
pmevent->event_len, phandle->ssu_dump_len);
|
||||
PRINTM(MMSG, "==== SSU DUMP END: %ld bytes ====\n",
|
||||
(long int)phandle->ssu_dump_len);
|
||||
|
|
@ -12112,11 +12022,7 @@ 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
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
)
|
||||
if (phandle->ops.dump_reg_info)
|
||||
ptr += phandle->ops.dump_reg_info(phandle, ptr);
|
||||
|
||||
LEAVE();
|
||||
|
|
@ -13041,11 +12947,7 @@ 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
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
) {
|
||||
if (phandle->ops.reg_dbg) {
|
||||
phandle->ops.reg_dbg(phandle);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -13056,11 +12958,8 @@ 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))
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(phandle->card_type)
|
||||
#endif
|
||||
) {
|
||||
if (phandle->ops.reg_dbg &&
|
||||
(drvdbg & (MREG_D | MFW_D))) {
|
||||
phandle->ops.reg_dbg(phandle);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -13752,7 +13651,7 @@ done:
|
|||
* @return N/A
|
||||
*
|
||||
*/
|
||||
static void woal_survey_dump_reset(moal_private *priv)
|
||||
void woal_survey_dump_reset(moal_private *priv)
|
||||
{
|
||||
mlan_ds_get_stats stats;
|
||||
|
||||
|
|
@ -13766,6 +13665,39 @@ static void woal_survey_dump_reset(moal_private *priv)
|
|||
moal_get_host_time_ns(&priv->bss_active_time);
|
||||
}
|
||||
|
||||
#ifdef STA_CFG80211
|
||||
/**
|
||||
* @brief This function sends scan report to cfg80211
|
||||
*
|
||||
* @param priv a pointer to moal_private structure
|
||||
*
|
||||
* @return N/A
|
||||
*
|
||||
*/
|
||||
static void woal_send_bss_scan_result(moal_private *priv)
|
||||
{
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&priv->phandle->scan_req_lock, flags);
|
||||
if (priv->phandle->scan_request) {
|
||||
PRINTM(MINFO, "Reporting scan results\n");
|
||||
woal_inform_bss_from_scan_result(priv, NULL, MOAL_NO_WAIT);
|
||||
if (!priv->phandle->first_scan_done) {
|
||||
priv->phandle->first_scan_done = MTRUE;
|
||||
if (!priv->phandle->user_scan_cfg)
|
||||
woal_set_scan_time(priv, ACTIVE_SCAN_CHAN_TIME,
|
||||
PASSIVE_SCAN_CHAN_TIME,
|
||||
SPECIFIC_SCAN_CHAN_TIME);
|
||||
}
|
||||
if (priv->phandle->scan_request) {
|
||||
cancel_delayed_work(&priv->phandle->scan_timeout_work);
|
||||
woal_cfg80211_scan_done(priv->phandle->scan_request,
|
||||
MFALSE);
|
||||
priv->phandle->scan_request = NULL;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&priv->phandle->scan_req_lock, flags);
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* @brief This workqueue function handles woal event queue
|
||||
*
|
||||
|
|
@ -13924,6 +13856,9 @@ t_void woal_evt_work_queue(struct work_struct *work)
|
|||
woal_print_linkstats_info((moal_private *)evt->priv,
|
||||
MFALSE);
|
||||
break;
|
||||
case WOAL_EVENT_SURVEY_DUMP_RESET:
|
||||
woal_survey_dump_reset((moal_private *)evt->priv);
|
||||
break;
|
||||
#ifdef UAP_SUPPORT
|
||||
case WOAL_EVENT_AGCS:
|
||||
if (evt->agcs_evt.type ==
|
||||
|
|
@ -13939,9 +13874,11 @@ t_void woal_evt_work_queue(struct work_struct *work)
|
|||
}
|
||||
break;
|
||||
#endif /* UAP_SUPPORT */
|
||||
case WOAL_EVENT_SURVEY_DUMP_RESET:
|
||||
woal_survey_dump_reset((moal_private *)evt->priv);
|
||||
#ifdef STA_CFG80211
|
||||
case WOAL_EVENT_CFG80211_INFORM_BSS:
|
||||
woal_send_bss_scan_result((moal_private *)evt->priv);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -14300,11 +14237,7 @@ t_void woal_main_work_queue(struct work_struct *work)
|
|||
}
|
||||
if (handle->reg_dbg == MTRUE) {
|
||||
handle->reg_dbg = MFALSE;
|
||||
if (handle->ops.reg_dbg
|
||||
#ifdef PCIE
|
||||
&& !IS_PCIEAW693(handle->card_type)
|
||||
#endif
|
||||
)
|
||||
if (handle->ops.reg_dbg)
|
||||
handle->ops.reg_dbg(handle);
|
||||
}
|
||||
if (handle->fw_dbg == MTRUE) {
|
||||
|
|
@ -14898,12 +14831,7 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops,
|
|||
device_init_wakeup(dev, true);
|
||||
#ifdef SD8887
|
||||
if (IS_SD8887(handle->card_type)) {
|
||||
union {
|
||||
t_u32 l;
|
||||
t_u8 c[4];
|
||||
} ver;
|
||||
ver.l = handle->fw_release_number;
|
||||
if (ver.c[1] == 75) {
|
||||
if (handle->fw_release_number.minorRevNum == 75) {
|
||||
handle->card_info->embedded_supp = 0;
|
||||
PRINTM(MMSG,
|
||||
"Disable EMBEDED Supplicant for SD8887-FP75\n");
|
||||
|
|
@ -15006,12 +14934,9 @@ mlan_status woal_remove_card(void *card)
|
|||
#endif
|
||||
if (handle->rf_test_mode)
|
||||
woal_process_rf_test_mode(handle, MFG_CMD_UNSET_TEST_MODE);
|
||||
handle->surprise_removed = MTRUE;
|
||||
woal_clean_up(handle);
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
|
||||
handle->surprise_removed = MTRUE;
|
||||
woal_flush_workqueue(handle);
|
||||
|
||||
if (moal_extflg_isset(handle, EXT_NAPI)) {
|
||||
napi_disable(&handle->napi_rx);
|
||||
netif_napi_del(&handle->napi_rx);
|
||||
|
|
@ -15407,8 +15332,6 @@ static void woal_pre_reset(moal_handle *handle)
|
|||
woal_clean_up(handle);
|
||||
/** mask host interrupt from firmware */
|
||||
mlan_disable_host_int(handle->pmlan_adapter);
|
||||
/** cancel all pending commands */
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
woal_flush_workqueue(handle);
|
||||
|
||||
handle->fw_reload = MTRUE;
|
||||
|
|
@ -15652,7 +15575,6 @@ int woal_request_fw_reload(moal_handle *phandle, t_u8 mode)
|
|||
LEAVE();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (phandle->fw_dump) {
|
||||
PRINTM(MMSG, "Ignore fw reload req, fw dump is ongoing\n");
|
||||
LEAVE();
|
||||
|
|
|
|||
|
|
@ -222,6 +222,16 @@ Change log:
|
|||
* 802.1 Local Experimental 1.
|
||||
*/
|
||||
|
||||
#ifndef fallthrough
|
||||
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||
#define fallthrough __attribute__((fallthrough))
|
||||
#elif defined(__clang__) && __clang_major__ >= 10
|
||||
#define fallthrough __attribute__((fallthrough))
|
||||
#else
|
||||
#define fallthrough /* fall through */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24)
|
||||
#define REFDATA __refdata
|
||||
#else
|
||||
|
|
@ -296,7 +306,8 @@ Change log:
|
|||
/** Define BOOLEAN */
|
||||
typedef t_u8 BOOLEAN;
|
||||
|
||||
#define INTF_CARDTYPE "----------%s-MM"
|
||||
#define INTF_CARDTYPE "----------%s-%s-MM"
|
||||
#define DRV_BUILDTYPE "MM"
|
||||
|
||||
#define KERN_VERSION "6X"
|
||||
|
||||
|
|
@ -1333,10 +1344,13 @@ enum woal_event_type {
|
|||
WOAL_EVENT_RGPWR_KEY_MISMATCH,
|
||||
WOAL_EVENT_RESET_WIFI,
|
||||
WOAL_EVENT_PRINT_LINKSTATS,
|
||||
WOAL_EVENT_SURVEY_DUMP_RESET,
|
||||
#ifdef UAP_SUPPORT
|
||||
WOAL_EVENT_AGCS,
|
||||
#endif /* UAP_SUPPORT */
|
||||
WOAL_EVENT_SURVEY_DUMP_RESET,
|
||||
#ifdef STA_CFG80211
|
||||
WOAL_EVENT_CFG80211_INFORM_BSS,
|
||||
#endif
|
||||
};
|
||||
|
||||
/** chan_rpt_info */
|
||||
|
|
@ -1533,6 +1547,7 @@ struct rf_test_mode_data {
|
|||
mfg_cmd_otp_mac_addr_rd_wr_t mfg_otp_mac_addr_rd_wr;
|
||||
/* OTP CAL data */
|
||||
mfg_cmd_otp_cal_data_rd_wr_t mfg_otp_cal_data_rd_wr;
|
||||
mfg_CmdDebugTemperature_Cfg_t mfg_debug_temp;
|
||||
};
|
||||
|
||||
/** Number of samples in histogram (/proc/mwlan/adapterX/mlan0/histogram).*/
|
||||
|
|
@ -2259,9 +2274,6 @@ struct _moal_private {
|
|||
t_u64 rx_airtime_base;
|
||||
/*TX airtime count*/
|
||||
t_u64 tx_airtime_base;
|
||||
|
||||
t_u32 band_ctrl;
|
||||
|
||||
#ifdef XDP_SUPPORT
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
/** xdp */
|
||||
|
|
@ -2269,6 +2281,8 @@ struct _moal_private {
|
|||
struct xdp_rxq_info xdp_rxq;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
t_u32 band_ctrl;
|
||||
};
|
||||
|
||||
#ifdef SDIO
|
||||
|
|
@ -2980,10 +2994,13 @@ typedef struct _moal_mod_para {
|
|||
int tpe_ie_ignore;
|
||||
/* make_before_break during roam */
|
||||
int make_before_break;
|
||||
int bandctrl;
|
||||
|
||||
/** plinkstats_cfg setting */
|
||||
char *plinkstats;
|
||||
#ifdef SECURE_HOST
|
||||
int secure_host;
|
||||
#endif
|
||||
int bandctrl;
|
||||
|
||||
} moal_mod_para;
|
||||
|
||||
void woal_tp_acnt_timer_func(void *context);
|
||||
|
|
@ -3057,6 +3074,18 @@ typedef struct _moal_tp_acnt_t {
|
|||
moal_drv_timer timer;
|
||||
} moal_tp_acnt_t;
|
||||
|
||||
/** firmware complete version number */
|
||||
typedef struct _fw_release_version {
|
||||
/** FW release number */
|
||||
t_u8 releaseNum;
|
||||
/** minor version */
|
||||
t_u8 minorRevNum;
|
||||
/** major version */
|
||||
t_u8 majorRevNum;
|
||||
/** patch level version */
|
||||
t_u16 patchLevel;
|
||||
} fw_release_version;
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
typedef MLAN_PACK_START struct {
|
||||
t_u16 action;
|
||||
|
|
@ -3156,7 +3185,7 @@ struct _moal_handle {
|
|||
/** POWER MANAGEMENT AND PnP SUPPORT */
|
||||
BOOLEAN surprise_removed;
|
||||
/** Firmware release number */
|
||||
t_u32 fw_release_number;
|
||||
fw_release_version fw_release_number;
|
||||
/** Firmware Hotfix version */
|
||||
t_u8 fw_hotfix_version;
|
||||
/** Firmware support bands */
|
||||
|
|
@ -3590,7 +3619,19 @@ struct _moal_handle {
|
|||
t_u32 ips_ctrl;
|
||||
BOOLEAN is_edmac_enabled;
|
||||
bool driver_init;
|
||||
/** firmware version milestone */
|
||||
char fw_ver_milestone[10];
|
||||
/** firmware version buildtype */
|
||||
char fw_ver_buildtype[10];
|
||||
/** firmware version data */
|
||||
char fw_ver_data[30];
|
||||
|
||||
#ifdef XDP_SUPPORT
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
struct page *page;
|
||||
t_u32 xdp_rd;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UAP_SUPPORT
|
||||
/** agiled channel switch state */
|
||||
t_u32 agcs_state;
|
||||
|
|
@ -3603,6 +3644,9 @@ struct _moal_handle {
|
|||
/* agcs scan event */
|
||||
agcs_stats agcs_scan_event;
|
||||
#endif /* UAP_SUPPORT */
|
||||
#ifdef SECURE_HOST
|
||||
void *secure;
|
||||
#endif
|
||||
|
||||
#ifdef DUMP_TO_PROC
|
||||
#if defined(PCIE)
|
||||
|
|
@ -3612,12 +3656,6 @@ struct _moal_handle {
|
|||
t_u8 *ssu_dump_buf;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef XDP_SUPPORT
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
struct page *page;
|
||||
t_u32 xdp_rd;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -4955,6 +4993,7 @@ t_bool woal_secure_sub(t_void *datain, t_s32 sub, t_void *dataout,
|
|||
mlan_status woal_edmac_cfg(moal_private *priv, t_u8 *country_code);
|
||||
void woal_print_linkstats_event(void *context);
|
||||
void woal_print_linkstats_info(moal_private *priv, bool is_reset);
|
||||
void woal_survey_dump_reset(moal_private *priv);
|
||||
mlan_status woal_get_ch_load(moal_private *priv, t_u16 duration);
|
||||
mlan_status woal_get_ch_load_results(moal_private *priv, t_u16 *ch_load,
|
||||
t_s16 *noise);
|
||||
|
|
|
|||
|
|
@ -73,24 +73,6 @@ static const struct pci_device_id wlan_ids[] = {
|
|||
0,
|
||||
},
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
{
|
||||
PCIE_VENDOR_ID_MRVL,
|
||||
PCIE_DEVICE_ID_88W8997P,
|
||||
PCI_ANY_ID,
|
||||
PCI_ANY_ID,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
PCIE_VENDOR_ID_V2_MRVL,
|
||||
PCIE_DEVICE_ID_88W8997P,
|
||||
PCI_ANY_ID,
|
||||
PCI_ANY_ID,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
#endif
|
||||
#ifdef PCIE9097
|
||||
{
|
||||
PCIE_VENDOR_ID_V2_MRVL,
|
||||
|
|
@ -163,8 +145,8 @@ static moal_if_ops pcie_ops;
|
|||
********************************************************/
|
||||
|
||||
static mlan_status woal_pcie_preinit(struct pci_dev *pdev);
|
||||
#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \
|
||||
defined(PCIE9097) || defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE8897) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
|
||||
t_u8 resetflag);
|
||||
#endif
|
||||
|
|
@ -203,27 +185,6 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
if (cardp_pcie->dev->device == PCIE_DEVICE_ID_88W8997P) {
|
||||
card_type = CARD_TYPE_PCIE8997;
|
||||
moal_memcpy_ext(NULL, driver_version, CARD_PCIE8997,
|
||||
strlen(CARD_PCIE8997), strlen(driver_version));
|
||||
/* we are copying card name in middle of full version, we can
|
||||
* not copy null termination. This was already tried and
|
||||
* reverted as full version got terminated in middle(See commit
|
||||
* 57c27201f9a23562337491f3cbb9833ca348076c). thus suppressing
|
||||
* the coverity warning for all card types in this function.
|
||||
*/
|
||||
// coverity[string_null:SUPPRESS]
|
||||
// coverity[cert_str32_c_violation:SUPPRESS]
|
||||
moal_memcpy_ext(NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V16, strlen(V16),
|
||||
strlen(driver_version) - strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIE9097
|
||||
if (cardp_pcie->dev->device == PCIE_DEVICE_ID_88W9097) {
|
||||
card_type = CARD_TYPE_PCIE9097;
|
||||
|
|
@ -330,7 +291,9 @@ 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);
|
||||
mdelay(50);
|
||||
if (handle->ops.write_reg(handle, reset_reg, reset_adma_val) !=
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MERROR, "Failed to write register.\n");
|
||||
|
|
@ -398,8 +361,7 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
|
|||
return (mlan_status)MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
if (!IS_PCIE8997(handle->card_type) &&
|
||||
!IS_PCIE9097(handle->card_type) &&
|
||||
if (!IS_PCIE9097(handle->card_type) &&
|
||||
!IS_PCIEIW624(handle->card_type) &&
|
||||
!IS_PCIEAW693(handle->card_type) &&
|
||||
!IS_PCIE9098(handle->card_type)) {
|
||||
|
|
@ -419,8 +381,6 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
|
|||
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
|
||||
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
|
||||
woal_clean_up(handle);
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
|
||||
/* Shutdown firmware */
|
||||
handle->init_wait_q_woken = MFALSE;
|
||||
status = mlan_shutdown_fw(handle->pmlan_adapter);
|
||||
|
|
@ -521,11 +481,7 @@ perform_init:
|
|||
}
|
||||
if (woal_init_fw(handle)) {
|
||||
PRINTM(MFATAL, "Firmware Init Failed\n");
|
||||
#ifdef PCIE
|
||||
if (!IS_PCIEAW693(handle->card_type))
|
||||
#endif
|
||||
woal_pcie_reg_dbg(handle);
|
||||
|
||||
woal_pcie_reg_dbg(handle);
|
||||
if (fw_serial_bkp)
|
||||
moal_extflg_set(handle, EXT_FW_SERIAL);
|
||||
goto err_init_fw;
|
||||
|
|
@ -984,11 +940,6 @@ 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();
|
||||
|
||||
|
|
@ -1024,36 +975,8 @@ 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++;
|
||||
}
|
||||
#endif
|
||||
|
||||
handle->surprise_removed = MTRUE;
|
||||
handle->fw_reseting = MTRUE;
|
||||
if (ref_handle) {
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
ref_handle->fw_reseting = MTRUE;
|
||||
}
|
||||
|
||||
#if defined(PCIEAW693)
|
||||
// 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
|
||||
// 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) ||
|
||||
|
|
@ -1063,6 +986,8 @@ 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);
|
||||
}
|
||||
|
||||
|
|
@ -1078,9 +1003,6 @@ 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);
|
||||
|
|
@ -1127,17 +1049,6 @@ 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
|
||||
|
|
@ -1563,12 +1474,14 @@ static mlan_status woal_pcie_register_dev(moal_handle *handle)
|
|||
ret = request_irq(pdev->irq, woal_pcie_interrupt, 0,
|
||||
"mrvl_pcie_msi", pdev);
|
||||
if (ret) {
|
||||
PRINTM(MFATAL, "request_irq failed: ret=%d\n",
|
||||
PRINTM(MERROR, "request_irq failed: ret=%d\n",
|
||||
ret);
|
||||
pci_disable_msi(pdev);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
PRINTM(MERROR, "pci_enable_msi failed: ret=%d\n", ret);
|
||||
}
|
||||
// follow through
|
||||
|
||||
|
|
@ -1710,7 +1623,7 @@ void woal_pcie_bus_unregister(void)
|
|||
#define PCIE9098_DUMP_START_REG 0x1C98
|
||||
#define PCIE9098_DUMP_END_REG 0x1C9F
|
||||
#endif
|
||||
#if defined(PCIE8897) || defined(PCIE8997)
|
||||
#if defined(PCIE8897)
|
||||
#define DEBUG_DUMP_CTRL_REG 0xCF4
|
||||
#define DEBUG_DUMP_START_REG 0xCF8
|
||||
#define DEBUG_DUMP_END_REG 0xCFF
|
||||
|
|
@ -1725,7 +1638,7 @@ void woal_pcie_bus_unregister(void)
|
|||
#define PCIE9098_DUMP_REG_END 0x1C9C
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
#if defined(PCIE8897)
|
||||
#define PCIE_SCRATCH_12_REG 0x0CF0;
|
||||
#define PCIE_SCRATCH_14_REG 0x0CF8;
|
||||
#define PCIE_SCRATCH_15_REG 0x0CFC;
|
||||
|
|
@ -1747,8 +1660,8 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
|
|||
t_u8 i;
|
||||
char buf[256], *ptr;
|
||||
pcie_service_card *card = (pcie_service_card *)phandle->card;
|
||||
int config_reg_table[] = {0x00, 0x04, 0x10, 0x18, 0x2c,
|
||||
0x3c, 0x44, 0x80, 0x98, 0x170};
|
||||
int config_reg_table[] = {0x00, 0x04, 0x10, 0x18, 0x2c, 0x3c, 0x44,
|
||||
0x50, 0x60, 0x64, 0x80, 0x98, 0x170};
|
||||
t_u32 dump_start_reg = 0;
|
||||
t_u32 dump_end_reg = 0;
|
||||
t_u32 scratch_14_reg = 0;
|
||||
|
|
@ -1791,9 +1704,8 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
|
|||
|
||||
drv_ptr += sprintf(drv_ptr, "FW Scrach Registers:\n");
|
||||
|
||||
#if defined(PCIE8897) || defined(PCIE8997)
|
||||
if (IS_PCIE8897(phandle->card_type) ||
|
||||
IS_PCIE8997(phandle->card_type)) {
|
||||
#if defined(PCIE8897)
|
||||
if (IS_PCIE8897(phandle->card_type)) {
|
||||
reg = PCIE_SCRATCH_12_REG;
|
||||
dump_start_reg = PCIE_DUMP_START_REG;
|
||||
dump_end_reg = PCIE_DUMP_END_REG;
|
||||
|
|
@ -1922,8 +1834,8 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
|
|||
t_u8 i;
|
||||
char buf[256], *ptr;
|
||||
pcie_service_card *card = (pcie_service_card *)phandle->card;
|
||||
int config_reg_table[] = {0x00, 0x04, 0x10, 0x18, 0x2c,
|
||||
0x3c, 0x44, 0x80, 0x98, 0x170};
|
||||
int config_reg_table[] = {0x00, 0x04, 0x10, 0x18, 0x2c, 0x3c, 0x44,
|
||||
0x50, 0x60, 0x64, 0x80, 0x98, 0x170};
|
||||
t_u32 dump_start_reg = 0;
|
||||
t_u32 dump_end_reg = 0;
|
||||
t_u32 scratch_14_reg = 0;
|
||||
|
|
@ -1957,9 +1869,8 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
|
|||
}
|
||||
|
||||
PRINTM(MMSG, "FW Scrach Registers:\n");
|
||||
#if defined(PCIE8897) || defined(PCIE8997)
|
||||
if (IS_PCIE8897(phandle->card_type) ||
|
||||
IS_PCIE8997(phandle->card_type)) {
|
||||
#if defined(PCIE8897)
|
||||
if (IS_PCIE8897(phandle->card_type)) {
|
||||
reg = PCIE_SCRATCH_12_REG;
|
||||
dump_start_reg = PCIE_DUMP_START_REG;
|
||||
dump_end_reg = PCIE_DUMP_END_REG;
|
||||
|
|
@ -2100,19 +2011,18 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#define DEBUG_HOST_READY_8997 0xCC
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
#define DEBUG_HOST_EVENT_READY 0xAA
|
||||
#define DEBUG_HOST_RESET_READY \
|
||||
0x98 /* 0x98: Reset WiFi only, 0x99: Reset both BT and WiFi */
|
||||
static memory_type_mapping mem_type_mapping_tbl_8997 = {"DUMP", NULL, NULL,
|
||||
static memory_type_mapping mem_type_mapping_tbl_9098 = {"DUMP", NULL, NULL,
|
||||
0xDD, 0x00};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \
|
||||
defined(PCIE9097) || defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE8897) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
/**
|
||||
* @brief This function reads data by 8 bit from card register
|
||||
*
|
||||
|
|
@ -2155,12 +2065,6 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
|
|||
dump_ctrl_reg = DEBUG_DUMP_CTRL_REG;
|
||||
}
|
||||
#endif
|
||||
#if defined(PCIE8997)
|
||||
if (IS_PCIE8997(phandle->card_type)) {
|
||||
debug_host_ready = DEBUG_HOST_READY_8997;
|
||||
dump_ctrl_reg = DEBUG_DUMP_CTRL_REG;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
|
|
@ -2170,8 +2074,6 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
|
|||
IS_PCIE9097(phandle->card_type)) {
|
||||
if (phandle->event_fw_dump)
|
||||
debug_host_ready = DEBUG_HOST_EVENT_READY;
|
||||
else
|
||||
debug_host_ready = DEBUG_HOST_READY_8997;
|
||||
if (resetflag)
|
||||
debug_host_ready = DEBUG_HOST_RESET_READY;
|
||||
dump_ctrl_reg = PCIE9098_DUMP_CTRL_REG;
|
||||
|
|
@ -2436,8 +2338,8 @@ done:
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
/**
|
||||
* @brief This function dump firmware memory to file
|
||||
*
|
||||
|
|
@ -2461,7 +2363,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
|
|||
moal_handle *ref_handle;
|
||||
#endif
|
||||
t_u8 *end_ptr = NULL;
|
||||
memory_type_mapping *mem_type_mapping_tbl = &mem_type_mapping_tbl_8997;
|
||||
memory_type_mapping *mem_type_mapping_tbl = &mem_type_mapping_tbl_9098;
|
||||
t_u32 dump_start_reg = 0;
|
||||
t_u32 dump_end_reg = 0;
|
||||
|
||||
|
|
@ -2517,12 +2419,6 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
|
|||
dump_start_reg = PCIE9098_DUMP_START_REG;
|
||||
dump_end_reg = PCIE9098_DUMP_END_REG;
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIE8997
|
||||
if (IS_PCIE8997(phandle->card_type)) {
|
||||
dump_start_reg = DEBUG_DUMP_START_REG;
|
||||
dump_end_reg = DEBUG_DUMP_END_REG;
|
||||
}
|
||||
#endif
|
||||
reg = dump_start_reg;
|
||||
ret = woal_read_reg_eight_bit(phandle, reg, &dump_num);
|
||||
|
|
@ -2683,10 +2579,9 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
|
|||
if (IS_PCIE8897(phandle->card_type))
|
||||
woal_pcie_dump_fw_info_v1(phandle);
|
||||
#endif
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
if (IS_PCIE8997(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
if (IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
|
|
@ -2728,14 +2623,14 @@ static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
|
|||
moal_handle *ref_handle = NULL;
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
t_u32 rev_id_reg = handle->card_info->rev_id_reg;
|
||||
t_u32 revision_id = 0;
|
||||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIEAW693) || defined(PCIEIW624)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \
|
||||
defined(PCIEIW624)
|
||||
t_u32 host_strap_reg = handle->card_info->host_strap_reg;
|
||||
t_u32 magic_reg = handle->card_info->magic_reg;
|
||||
t_u32 strap = 0;
|
||||
|
|
@ -2788,27 +2683,6 @@ static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
|
|||
goto done;
|
||||
}
|
||||
|
||||
#ifdef PCIE8997
|
||||
if (IS_PCIE8997(handle->card_type)) {
|
||||
woal_pcie_read_reg(handle, rev_id_reg, &revision_id);
|
||||
woal_pcie_read_reg(handle, host_strap_reg, &strap);
|
||||
woal_pcie_read_reg(handle, magic_reg, &magic);
|
||||
revision_id &= 0xff;
|
||||
strap &= 0x7;
|
||||
magic &= 0xff;
|
||||
PRINTM(MCMND, "magic=0x%x, strap=0x%x, revision_id=0x%x\n",
|
||||
magic, strap, revision_id);
|
||||
if ((revision_id == PCIE8997_A1) &&
|
||||
(magic == CHIP_MAGIC_VALUE)) {
|
||||
if (strap == CARD_TYPE_PCIE_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUART8997_DEFAULT_COMBO_FW_NAME);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUSB8997_DEFAULT_COMBO_FW_NAME);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIE9098
|
||||
if (IS_PCIE9098(handle->card_type)) {
|
||||
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN0) {
|
||||
|
|
@ -3140,10 +3014,6 @@ 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;
|
||||
|
|
@ -3158,26 +3028,9 @@ static void woal_pcie_work(struct work_struct *work)
|
|||
} else {
|
||||
ref_handle = (moal_handle *)handle->pref_mac;
|
||||
}
|
||||
if (ref_handle) {
|
||||
if (ref_handle)
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
woal_clean_up(ref_handle);
|
||||
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
|
||||
|
|
@ -3222,15 +3075,6 @@ 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,6 @@ Change log:
|
|||
#define PCIE_VENDOR_ID_V2_MRVL (0x1b4b)
|
||||
#define PCIE_VENDOR_ID_NXP (0x1131)
|
||||
|
||||
#ifdef PCIE8997
|
||||
/** PCIE device ID for 8997 card */
|
||||
#define PCIE_DEVICE_ID_88W8997P (0x2b42)
|
||||
#endif
|
||||
#ifdef PCIE8897
|
||||
/** PCIE device ID for 8897 card */
|
||||
#define PCIE_DEVICE_ID_88W8897P (0x2b38)
|
||||
|
|
@ -76,15 +72,6 @@ Change log:
|
|||
#include "moal_main.h"
|
||||
|
||||
/** Default firmware name */
|
||||
#ifdef PCIE8997
|
||||
#define PCIE8997_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8997_combo_v4.bin"
|
||||
#define PCIEUART8997_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8997_combo_v4.bin"
|
||||
#define PCIEUSB8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_combo_v4.bin"
|
||||
#define PCIE8997_DEFAULT_WLAN_FW_NAME "nxp/pcie8997_wlan_v4.bin"
|
||||
/** PCIE8997 chip revision ID */
|
||||
#define PCIE8997_A0 0x10
|
||||
#define PCIE8997_A1 0x11
|
||||
#endif /* PCIE8997 */
|
||||
|
||||
#ifdef PCIE8897
|
||||
#define PCIE8897_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8897_combo.bin"
|
||||
|
|
|
|||
|
|
@ -2607,6 +2607,10 @@ static int woal_drv_dbg(moal_private *priv, struct iwreq *wrq)
|
|||
#endif
|
||||
printk(KERN_ALERT "MMPA_D (%08x) %s\n", MMPA_D,
|
||||
(drvdbg & MMPA_D) ? "X" : "");
|
||||
#ifdef SECURE_HOST
|
||||
printk(KERN_ALERT "MSHC_D (%08x) %s\n", MSHC_D,
|
||||
(drvdbg & MSHC_D) ? "X" : "");
|
||||
#endif
|
||||
printk(KERN_ALERT "MIF_D (%08x) %s\n", MIF_D,
|
||||
(drvdbg & MIF_D) ? "X" : "");
|
||||
printk(KERN_ALERT "MFW_D (%08x) %s\n", MFW_D,
|
||||
|
|
|
|||
|
|
@ -106,10 +106,6 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
|
|||
#ifdef UAP_SUPPORT
|
||||
mlan_ds_uap_stats ustats;
|
||||
#endif
|
||||
union {
|
||||
t_u32 l;
|
||||
t_u8 c[4];
|
||||
} ver;
|
||||
|
||||
fw_info.uuid_lo = fw_info.uuid_hi = 0x0ULL;
|
||||
|
||||
|
|
@ -159,9 +155,12 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
|
|||
#endif
|
||||
seq_printf(sfp, "driver_version = %s", fmt);
|
||||
seq_printf(sfp, "\ninterface_name=\"%s\"\n", netdev->name);
|
||||
ver.l = handle->fw_release_number;
|
||||
seq_printf(sfp, "firmware_major_version=%u.%u.%u\n", ver.c[2], ver.c[1],
|
||||
ver.c[0]);
|
||||
seq_printf(sfp, "firmware_major_version=%s-%u.%u.%u, %s-%s\n",
|
||||
handle->fw_ver_milestone,
|
||||
handle->fw_release_number.majorRevNum,
|
||||
handle->fw_release_number.minorRevNum,
|
||||
handle->fw_release_number.releaseNum,
|
||||
priv->phandle->fw_ver_data, priv->phandle->fw_ver_buildtype);
|
||||
|
||||
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
|
||||
if (fw_info.uuid_lo || fw_info.uuid_hi)
|
||||
|
|
@ -867,6 +866,10 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
|
|||
"otp_cal_data_rd_wr=", strlen("otp_cal_data_rd_wr=")) &&
|
||||
count > strlen("otp_cal_data_rd_wr="))
|
||||
cmd = MFG_CMD_OTP_CAL_DATA;
|
||||
if (!strncmp(databuf, "set_debug_temperature=",
|
||||
strlen("set_debug_temperature=")) &&
|
||||
count > strlen("set_debug_temperature="))
|
||||
cmd = MFG_CMD_SET_DEBUG_TEMPERATURE;
|
||||
|
||||
if (cmd && handle->rf_test_mode &&
|
||||
(woal_process_rf_test_mode_cmd(
|
||||
|
|
@ -883,7 +886,6 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
|
|||
MLAN_STATUS_SUCCESS)
|
||||
PRINTM(MERROR, "Could not set Antenna Diversity!!\n");
|
||||
}
|
||||
|
||||
MODULE_PUT;
|
||||
kfree(databuf);
|
||||
LEAVE();
|
||||
|
|
@ -1121,7 +1123,22 @@ static int woal_config_read(struct seq_file *sfp, void *data)
|
|||
handle->rf_data->mfg_otp_mac_addr_rd_wr.mac_addr[3],
|
||||
handle->rf_data->mfg_otp_mac_addr_rd_wr.mac_addr[4],
|
||||
handle->rf_data->mfg_otp_mac_addr_rd_wr.mac_addr[5]);
|
||||
|
||||
seq_printf(sfp, "\n");
|
||||
seq_printf(sfp, "set_debug_temperature=%u,",
|
||||
handle->rf_data->mfg_debug_temp.simulation_enable);
|
||||
seq_printf(sfp, "%d,",
|
||||
handle->rf_data->mfg_debug_temp.cau_temperature);
|
||||
seq_printf(
|
||||
sfp, "%d,%d,%d,%d\n",
|
||||
handle->rf_data->mfg_debug_temp.rfu_temperature[0][0],
|
||||
handle->rf_data->mfg_debug_temp.rfu_temperature[0][1],
|
||||
handle->rf_data->mfg_debug_temp.rfu_temperature[1][0],
|
||||
handle->rf_data->mfg_debug_temp.rfu_temperature[1][1]);
|
||||
|
||||
seq_printf(sfp, "\n");
|
||||
}
|
||||
|
||||
// Read current antcfg configuration
|
||||
woal_priv_get_tx_rx_ant(sfp, priv);
|
||||
|
||||
|
|
@ -1320,6 +1337,7 @@ static int woal_ssu_dump_read(struct seq_file *sfp, void *data)
|
|||
{
|
||||
moal_handle *handle = (moal_handle *)sfp->private;
|
||||
int ret = 0;
|
||||
int format_result = 0;
|
||||
t_u32 i;
|
||||
t_u32 *tmpbuf;
|
||||
unsigned char *sfpbuf;
|
||||
|
|
@ -1345,9 +1363,9 @@ static int woal_ssu_dump_read(struct seq_file *sfp, void *data)
|
|||
|
||||
if (sfp->size < ((handle->ssu_dump_len * 9) / 4)) {
|
||||
PRINTM(MCMND,
|
||||
"ssu dump size too big, size=%d, ssu_dump_len=%ld\n",
|
||||
(int)sfp->size,
|
||||
(long int)((handle->ssu_dump_len * 9) / 4));
|
||||
"ssu dump size too big, size=%lu, ssu_dump_len=%lu\n",
|
||||
sfp->size,
|
||||
(unsigned long)((handle->ssu_dump_len * 9) / 4));
|
||||
sfp->count = sfp->size;
|
||||
ret = 0;
|
||||
MODULE_PUT;
|
||||
|
|
@ -1357,15 +1375,23 @@ static int woal_ssu_dump_read(struct seq_file *sfp, void *data)
|
|||
tmpbuf = (t_u32 *)handle->ssu_dump_buf;
|
||||
sfpbuf = sfp->buf;
|
||||
for (i = 0; i < handle->ssu_dump_len / 4; i++) {
|
||||
if ((i + 1) % 8 == 0)
|
||||
snprintf(dw_string, sizeof(dw_string), "%08x\n",
|
||||
*tmpbuf);
|
||||
else
|
||||
snprintf(dw_string, sizeof(dw_string), "%08x ",
|
||||
*tmpbuf);
|
||||
// Use array indexing instead of pointer arithmetic to avoid
|
||||
// overflow
|
||||
t_u32 current_word = tmpbuf[i];
|
||||
|
||||
if ((i + 1) % 8 == 0) {
|
||||
format_result = snprintf(dw_string, sizeof(dw_string),
|
||||
"%08x\n", current_word);
|
||||
} else {
|
||||
format_result = snprintf(dw_string, sizeof(dw_string),
|
||||
"%08x ", current_word);
|
||||
}
|
||||
if (format_result <= 0 || format_result >= sizeof(dw_string)) {
|
||||
PRINTM(MERROR, "String formatting failed at word %u\n",
|
||||
i);
|
||||
}
|
||||
|
||||
moal_memcpy_ext(handle, sfpbuf, dw_string, 9, 9);
|
||||
tmpbuf++;
|
||||
sfpbuf += 9;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,13 +92,6 @@ Change log:
|
|||
#define SD8977_DEFAULT_WLAN_FW_NAME "nxp/sd8977_wlan_v2.bin"
|
||||
#endif /* SD8977 */
|
||||
|
||||
#ifdef SD8997
|
||||
#define SD8997_DEFAULT_COMBO_FW_NAME "nxp/sduart8997_combo_v4.bin"
|
||||
#define SDUART8997_DEFAULT_COMBO_FW_NAME "nxp/sduart8997_combo_v4.bin"
|
||||
#define SDSD8997_DEFAULT_COMBO_FW_NAME "nxp/sdsd8997_combo_v4.bin"
|
||||
#define SD8997_DEFAULT_WLAN_FW_NAME "nxp/sd8997_wlan_v4.bin"
|
||||
#endif /* SD8997 */
|
||||
|
||||
#ifdef SD8987
|
||||
#define SD8987_DEFAULT_COMBO_FW_NAME "nxp/sduart8987_combo.bin"
|
||||
#define SDUART8987_DEFAULT_COMBO_FW_NAME "nxp/sduart8987_combo.bin"
|
||||
|
|
|
|||
|
|
@ -78,10 +78,6 @@ static moal_if_ops sdiommc_ops;
|
|||
/** Device ID for SD8978 */
|
||||
#define SD_DEVICE_ID_8978 (0x9159)
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
/** Device ID for SD8997 */
|
||||
#define SD_DEVICE_ID_8997 (0x9141)
|
||||
#endif
|
||||
#ifdef SD8987
|
||||
/** Device ID for SD8987 */
|
||||
#define SD_DEVICE_ID_8987 (0x9149)
|
||||
|
|
@ -129,9 +125,6 @@ static const struct sdio_device_id wlan_ids[] = {
|
|||
#ifdef SD8978
|
||||
{SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8978)},
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
{SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8997)},
|
||||
#endif
|
||||
#ifdef SD8987
|
||||
{SDIO_DEVICE(MRVL_VENDOR_ID, SD_DEVICE_ID_8987)},
|
||||
#endif
|
||||
|
|
@ -651,20 +644,6 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
|
||||
}
|
||||
#endif
|
||||
#ifdef SD8997
|
||||
if (cardp_sd->func->device == SD_DEVICE_ID_8997) {
|
||||
card_type = CARD_TYPE_SD8997;
|
||||
moal_memcpy_ext(NULL, driver_version, CARD_SD8997,
|
||||
strlen(CARD_SD8997), strlen(driver_version));
|
||||
moal_memcpy_ext(
|
||||
NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V16, strlen(V16),
|
||||
strnlen(driver_version, MLAN_MAX_VER_STR_LEN - 1) -
|
||||
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
|
||||
}
|
||||
#endif
|
||||
#ifdef SD8987
|
||||
if (cardp_sd->func->device == SD_DEVICE_ID_8987) {
|
||||
card_type = CARD_TYPE_SD8987;
|
||||
|
|
@ -765,6 +744,7 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
|
||||
}
|
||||
#endif
|
||||
driver_version[MLAN_MAX_VER_STR_LEN - 1] = '\0';
|
||||
return card_type;
|
||||
}
|
||||
|
||||
|
|
@ -811,6 +791,24 @@ int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
|
|||
if (!func->enable_timeout)
|
||||
func->enable_timeout = 200;
|
||||
#endif
|
||||
|
||||
#if defined(SDAW693) || defined(SD9098)
|
||||
#ifdef SDIO_SUSPEND_RESUME
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
|
||||
#ifdef SDAW693
|
||||
if (func->device == SD_DEVICE_ID_AW693_FN1 ||
|
||||
func->device == SD_DEVICE_ID_AW693_FN2)
|
||||
device_disable_async_suspend(&func->dev);
|
||||
#endif
|
||||
#ifdef SD9098
|
||||
if (func->device == SD_DEVICE_ID_9098_FN1 ||
|
||||
func->device == SD_DEVICE_ID_9098_FN2)
|
||||
device_disable_async_suspend(&func->dev);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sdio_claim_host(func);
|
||||
ret = sdio_enable_func(func);
|
||||
if (ret) {
|
||||
|
|
@ -1858,9 +1856,9 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
|
|||
t_u32 revision_id = 0;
|
||||
t_u32 rev_id_reg = handle->card_info->rev_id_reg;
|
||||
|
||||
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || \
|
||||
defined(SD9097) || defined(SDIW624) || defined(SDAW693) || \
|
||||
defined(SD8978) || defined(SD9177) || defined(SDIW610)
|
||||
#if defined(SD8987) || defined(SD9098) || defined(SD9097) || \
|
||||
defined(SDIW624) || defined(SDAW693) || defined(SD8978) || \
|
||||
defined(SD9177) || defined(SDIW610)
|
||||
t_u32 magic_reg = handle->card_info->magic_reg;
|
||||
t_u32 magic = 0;
|
||||
t_u32 host_strap_reg = handle->card_info->host_strap_reg;
|
||||
|
|
@ -1881,9 +1879,9 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
|
|||
PRINTM(MCMND, "revision_id=0x%x sdio_blk_size=%d\n", revision_id,
|
||||
handle->sdio_blk_size);
|
||||
|
||||
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || \
|
||||
defined(SD9097) || defined(SDIW624) || defined(SDAW693) || \
|
||||
defined(SD8978) || defined(SD9177) || defined(SDIW610)
|
||||
#if defined(SD8987) || defined(SD9098) || defined(SD9097) || \
|
||||
defined(SDIW624) || defined(SDAW693) || defined(SD8978) || \
|
||||
defined(SD9177) || defined(SDIW610)
|
||||
/** Revision ID register */
|
||||
woal_sdiommc_read_reg(handle, magic_reg, &magic);
|
||||
/** Revision ID register */
|
||||
|
|
@ -1944,21 +1942,6 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SD8997
|
||||
if (IS_SD8997(handle->card_type)) {
|
||||
if (magic == CHIP_MAGIC_VALUE) {
|
||||
if (strap == CARD_TYPE_SD_UART)
|
||||
strncpy(handle->card_info->fw_name,
|
||||
SDUART8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else
|
||||
strncpy(handle->card_info->fw_name,
|
||||
SDSD8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SD8987
|
||||
if (IS_SD8987(handle->card_type)) {
|
||||
if (magic == CHIP_MAGIC_VALUE) {
|
||||
|
|
@ -2294,8 +2277,8 @@ static memory_type_mapping mem_type_mapping_tbl[] = {
|
|||
{"EXT13", NULL, NULL, 0xFD, 0},
|
||||
{"EXTLAST", NULL, NULL, 0xFE, 0},
|
||||
};
|
||||
static memory_type_mapping mem_type_mapping_tbl_8977_8997 = {"DUMP", NULL, NULL,
|
||||
0xDD, 0};
|
||||
static memory_type_mapping mem_type_mapping_tbl_8977 = {"DUMP", NULL, NULL,
|
||||
0xDD, 0};
|
||||
/**
|
||||
* @brief This function read/write firmware via cmd52
|
||||
*
|
||||
|
|
@ -2633,8 +2616,7 @@ void woal_dump_firmware_info_v3(moal_handle *phandle)
|
|||
t_u8 *end_ptr = NULL;
|
||||
t_u8 dbg_dump_start_reg = 0;
|
||||
t_u8 dbg_dump_end_reg = 0;
|
||||
memory_type_mapping *pmem_type_mapping_tbl =
|
||||
&mem_type_mapping_tbl_8977_8997;
|
||||
memory_type_mapping *pmem_type_mapping_tbl = &mem_type_mapping_tbl_8977;
|
||||
|
||||
if (!phandle) {
|
||||
PRINTM(MERROR, "Could not dump firmwware info\n");
|
||||
|
|
@ -2945,10 +2927,18 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
|
|||
phandle->fw_dump_len = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(phandle->pmlan_adapter)) {
|
||||
PRINTM(MERROR, "phandle->pmlan_adapter is NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/** cancel all pending commands */
|
||||
mlan_ioctl(phandle->pmlan_adapter, NULL);
|
||||
queue_work(phandle->workqueue, &phandle->main_work);
|
||||
|
||||
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
|
||||
|
||||
msleep(5);
|
||||
phandle->fw_dump = MTRUE;
|
||||
if (phandle->card_info->dump_fw_info == DUMP_FW_SDIO_V2) {
|
||||
|
|
@ -3303,7 +3293,6 @@ static mlan_status woal_do_sdiommc_flr(moal_handle *handle, bool prepare,
|
|||
mlan_disable_host_int(handle->pmlan_adapter);
|
||||
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
|
||||
woal_clean_up(handle);
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
|
||||
/* Shutdown firmware */
|
||||
handle->init_wait_q_woken = MFALSE;
|
||||
|
|
@ -3497,11 +3486,8 @@ static void woal_sdiommc_work(struct work_struct *work)
|
|||
} else {
|
||||
ref_handle = (moal_handle *)handle->pref_mac;
|
||||
}
|
||||
if (ref_handle) {
|
||||
if (ref_handle)
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
woal_clean_up(ref_handle);
|
||||
mlan_ioctl(ref_handle->pmlan_adapter, NULL);
|
||||
}
|
||||
}
|
||||
handle->surprise_removed = MTRUE;
|
||||
handle->fw_reseting = MTRUE;
|
||||
|
|
|
|||
385
mlinux/moal_shc.c
Executable file
385
mlinux/moal_shc.c
Executable file
|
|
@ -0,0 +1,385 @@
|
|||
/** @file moal_shc.c
|
||||
*
|
||||
* @brief This file contains callback functions for secure host interface.
|
||||
*
|
||||
*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "moal_shc.h"
|
||||
|
||||
t_u8 public_key[NANOTLS_ECDSA_PUBLIC_KEY_SIZE];
|
||||
t_u8 fw_uuid[NANOTLS_UUID_LEN];
|
||||
|
||||
/**
|
||||
* @brief This function determines secure host message id
|
||||
*
|
||||
* @param msg A pointer to message
|
||||
*
|
||||
* @return success:valid message id, invalid otherwise
|
||||
*/
|
||||
t_u8 moal_secure_host_get_msg_id(t_void *msg)
|
||||
{
|
||||
struct nanotls_message_hdr *hdr = (struct nanotls_message_hdr *)msg;
|
||||
return hdr->message_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function reads publick key extracted from fw to nanotls library
|
||||
*
|
||||
* @param ctx A pointer to nanotls host context
|
||||
* @param device_info A pointer to nanotls device info
|
||||
* @ecdsa_pub_key Public key
|
||||
*
|
||||
* @return E_OK
|
||||
*/
|
||||
static enum ecode
|
||||
moal_get_pub_key(const struct nanotls_host_ctx *ctx,
|
||||
const struct nanotls_device_info *device_info,
|
||||
uint8_t ecdsa_pub_key[NANOTLS_ECDSA_PUBLIC_KEY_SIZE])
|
||||
{
|
||||
memcpy(ecdsa_pub_key, public_key, NANOTLS_ECDSA_PUBLIC_KEY_SIZE);
|
||||
return E_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function initialized host context
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param key A pointer to public key
|
||||
* @uuid Device uuid
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_init(t_void *pmoal,
|
||||
const t_u8 key[NANOTLS_ECDSA_PUBLIC_KEY_SIZE],
|
||||
const t_u8 uuid[NANOTLS_UUID_LEN])
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
|
||||
handle->secure = kzalloc(sizeof(secure_host_t), GFP_KERNEL);
|
||||
if (!handle->secure) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for shc handler\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
secure->host_ctx = kzalloc(sizeof(struct nanotls_host_ctx), GFP_KERNEL);
|
||||
if (!secure->host_ctx) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for shc context\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
memcpy(public_key, key, NANOTLS_ECDSA_PUBLIC_KEY_SIZE);
|
||||
memcpy(fw_uuid, uuid, NANOTLS_UUID_LEN);
|
||||
|
||||
ret = nanotls_host_init_pubkey_cb(secure->host_ctx, moal_get_pub_key);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Failed to init shc context\n");
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function free up secure host memory
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void moal_secure_host_cleanup(t_void *pmoal)
|
||||
{
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
int idx = 0;
|
||||
|
||||
if (!handle->secure)
|
||||
return;
|
||||
|
||||
PRINTM(MMSG, "Free secure host context\n");
|
||||
|
||||
if (secure->host_ctx)
|
||||
nanotls_host_cleanup(secure->host_ctx);
|
||||
|
||||
for (idx = 0; idx < MAX_CTX_AND_KEY; idx++) {
|
||||
if (secure->data_ctx[idx])
|
||||
kfree(secure->data_ctx[idx]);
|
||||
if (secure->host_keys[idx])
|
||||
kfree(secure->host_keys[idx]);
|
||||
}
|
||||
|
||||
if (secure->host_finished)
|
||||
kfree(secure->host_finished);
|
||||
|
||||
if (secure->device_hello)
|
||||
kfree(secure->device_hello);
|
||||
|
||||
if (secure->host_hello)
|
||||
kfree(secure->host_hello);
|
||||
|
||||
if (secure->host_ctx)
|
||||
kfree(secure->host_ctx);
|
||||
|
||||
kfree(secure);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares host do hello message
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param msg A pointer to do hello message
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_do_hello(t_void *pmoal, t_void **msg)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
|
||||
secure->host_hello =
|
||||
kzalloc(sizeof(struct nanotls_host_hello), GFP_KERNEL);
|
||||
if (!secure->host_hello) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for host hello\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
*msg = kzalloc(sizeof(struct nanotls_host_hello), GFP_KERNEL);
|
||||
if (!secure->host_hello) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for host hello msg\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
ret = nanotls_host_do_hello(secure->host_ctx, secure->host_hello);
|
||||
if (!ret) {
|
||||
moal_memcpy_ext(handle, *msg, secure->host_hello,
|
||||
sizeof(struct nanotls_host_hello),
|
||||
sizeof(struct nanotls_host_hello));
|
||||
} else {
|
||||
PRINTM(MERROR, "Failed to generate host hello\n");
|
||||
}
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function process received device hello message
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param msg A pointer to device hello message
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_device_hello_rcvd(t_void *pmoal, t_void *msg)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
secure->device_hello =
|
||||
kzalloc(sizeof(struct nanotls_device_hello), GFP_KERNEL);
|
||||
if (!secure->device_hello) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for device hello\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
moal_memcpy_ext(handle, secure->device_hello, msg,
|
||||
sizeof(struct nanotls_device_hello),
|
||||
sizeof(struct nanotls_device_hello));
|
||||
|
||||
ret = nanotls_host_device_hello_rcvd(secure->host_ctx,
|
||||
secure->device_hello);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Failed to process device hello\n");
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares secure host finished message
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param msg A pointer to secure host finished message
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_do_finished(t_void *pmoal, t_void **msg)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
secure->host_finished =
|
||||
kzalloc(sizeof(struct nanotls_host_finished), GFP_KERNEL);
|
||||
if (!secure->host_finished) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for host finished\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
*msg = kzalloc(sizeof(struct nanotls_host_finished), GFP_KERNEL);
|
||||
if (!(*msg)) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for host finish msg\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
ret = nanotls_host_do_finished(secure->host_ctx, secure->host_finished);
|
||||
if (!ret) {
|
||||
moal_memcpy_ext(handle, *msg, secure->host_finished,
|
||||
sizeof(struct nanotls_host_finished),
|
||||
sizeof(struct nanotls_host_finished));
|
||||
} else {
|
||||
PRINTM(MERROR, "Failed to generate host finished msg\n");
|
||||
}
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function derives traffice keys
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_derive_traffic_keys(t_void *pmoal)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
t_u8 idx = 0;
|
||||
|
||||
idx = handle->second_mac;
|
||||
secure->host_keys[idx] =
|
||||
kzalloc(sizeof(struct nanotls_traffic_keys), GFP_KERNEL);
|
||||
if (!secure->host_keys[idx]) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for host keys\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
ret = nanotls_host_derive_traffic_keys_instance(
|
||||
secure->host_ctx, secure->host_keys[idx], idx);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Failed to derive host keys\n");
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function initializes data context
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_data_ctx_init(t_void *pmoal)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
t_u8 idx = 0;
|
||||
idx = handle->second_mac;
|
||||
secure->data_ctx[idx] =
|
||||
kzalloc(sizeof(struct nanotls_ctx_data), GFP_KERNEL);
|
||||
if (!secure->data_ctx[idx]) {
|
||||
PRINTM(MERROR, "Failed to alloc memory for data context\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
ret = nanotls_data_ctx_init(secure->data_ctx[idx], NANOTLS_ROLE_HOST,
|
||||
secure->host_keys[idx]);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Failed to init data context\n");
|
||||
|
||||
return (ret != 0) ? MLAN_STATUS_FAILURE : MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function encrypts the payload
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param enc_data A pointer to encrypted data
|
||||
* @param payload A pointer to payload to be encrpted
|
||||
* @param len Payload length
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_data_encrypt(t_void *pmoal, t_void **enc_data,
|
||||
t_void **payload, t_u32 len)
|
||||
{
|
||||
int ret = 0;
|
||||
t_u8 tag[NANOTLS_AES_GCM_TAG_SIZE];
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
t_u8 idx = 0;
|
||||
|
||||
if (!secure) {
|
||||
PRINTM(MERROR, "encrypt:shc context not initialized\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
idx = handle->second_mac;
|
||||
ret = nanotls_data_write(secure->data_ctx[idx], *enc_data, *payload,
|
||||
len, tag);
|
||||
if (!ret) {
|
||||
moal_memcpy_ext(handle, *payload, *enc_data, len, len);
|
||||
moal_memcpy_ext(handle, *payload + len, tag,
|
||||
NANOTLS_AES_GCM_TAG_SIZE,
|
||||
NANOTLS_AES_GCM_TAG_SIZE);
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
PRINTM(MERROR, "Failed to encrypt command request\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function decrypts the payload
|
||||
*
|
||||
* @param pmoal A pointer to moal_handle structure
|
||||
* @param dec_data A pointer to decrypted data
|
||||
* @param payload A pointer to encrypted payload
|
||||
* @param len Payload length
|
||||
*
|
||||
* @return sucess:MLAN_STATUS_SUCCESS, MLAN_STATUS_FAILURE otherwise
|
||||
*/
|
||||
mlan_status moal_secure_host_data_decrypt(t_void *pmoal, t_void **dec_data,
|
||||
t_void **payload, t_u32 len)
|
||||
{
|
||||
int ret = 0;
|
||||
moal_handle *handle = (moal_handle *)pmoal;
|
||||
secure_host_t *secure = (secure_host_t *)handle->secure;
|
||||
t_u8 idx = 0;
|
||||
|
||||
if (!secure) {
|
||||
PRINTM(MERROR, "decrypt: shc context not initialized\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
idx = handle->second_mac;
|
||||
|
||||
ret = nanotls_data_read(secure->data_ctx[idx], *dec_data, *payload,
|
||||
len - NANOTLS_AES_GCM_TAG_SIZE,
|
||||
*payload + (len - NANOTLS_AES_GCM_TAG_SIZE));
|
||||
if (!ret) {
|
||||
moal_memcpy_ext(handle, *payload, *dec_data,
|
||||
len - NANOTLS_AES_GCM_TAG_SIZE,
|
||||
len - NANOTLS_AES_GCM_TAG_SIZE);
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
PRINTM(MERROR, "Failed to decrypt command response\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
59
mlinux/moal_shc.h
Executable file
59
mlinux/moal_shc.h
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
/** @file moal_shc.c
|
||||
*
|
||||
* @brief This file contains callback functions for secure host interface.
|
||||
*
|
||||
*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MOAL_SHC_H_
|
||||
#define _MOAL_SHC_H_
|
||||
|
||||
#include "moal_main.h"
|
||||
#include "nanotls-device.h"
|
||||
#include "nanotls-host.h"
|
||||
#include "nanotls-common.h"
|
||||
#include "nanotls-data.h"
|
||||
|
||||
/* Unique data context and traffic key per MAC */
|
||||
#define MAX_CTX_AND_KEY 2
|
||||
|
||||
typedef struct _secure_host_t {
|
||||
struct nanotls_host_ctx *host_ctx;
|
||||
struct nanotls_host_hello *host_hello;
|
||||
struct nanotls_device_hello *device_hello;
|
||||
struct nanotls_host_finished *host_finished;
|
||||
struct nanotls_traffic_keys *host_keys[MAX_CTX_AND_KEY];
|
||||
struct nanotls_ctx_data *data_ctx[MAX_CTX_AND_KEY];
|
||||
} secure_host_t;
|
||||
|
||||
t_u8 moal_secure_host_get_msg_id(t_void *msg);
|
||||
mlan_status moal_secure_host_init(t_void *pmoal,
|
||||
const t_u8 key[NANOTLS_ECDSA_PUBLIC_KEY_SIZE],
|
||||
const t_u8 uuid[NANOTLS_UUID_LEN]);
|
||||
void moal_secure_host_cleanup(t_void *pmoal);
|
||||
mlan_status moal_secure_host_do_hello(t_void *pmoal, t_void **msg);
|
||||
mlan_status moal_secure_host_device_hello_rcvd(t_void *pmoal, t_void *msg);
|
||||
mlan_status moal_secure_host_do_finished(t_void *pmoal, t_void **msg);
|
||||
mlan_status moal_secure_host_derive_traffic_keys(t_void *pmoal);
|
||||
mlan_status moal_secure_host_data_ctx_init(t_void *pmoal);
|
||||
mlan_status moal_secure_host_data_encrypt(t_void *pmoal, t_void **enc_data,
|
||||
t_void **payload, t_u32 len);
|
||||
mlan_status moal_secure_host_data_decrypt(t_void *pmoal, t_void **dec_data,
|
||||
t_void **payload, t_u32 len);
|
||||
|
||||
#endif /* _MOAL_SHC_H_ */
|
||||
|
|
@ -281,7 +281,7 @@ mlan_status moal_malloc_cached(t_void *pmoal, t_u32 size, t_u8 **ppbuf,
|
|||
flag = in_atomic() ? GFP_ATOMIC :
|
||||
irqs_disabled() ? GFP_ATOMIC :
|
||||
GFP_KERNEL;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
*ppbuf = dma_alloc_noncoherent(&card->dev->dev, size, &dma,
|
||||
DMA_BIDIRECTIONAL, flag);
|
||||
#else
|
||||
|
|
@ -321,7 +321,7 @@ mlan_status moal_mfree_cached(t_void *pmoal, t_u32 size, t_u8 *pbuf,
|
|||
if (unlikely(!pbuf || !card))
|
||||
return MLAN_STATUS_FAILURE;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
dma_free_noncoherent(&card->dev->dev, size, pbuf, buf_pa,
|
||||
DMA_BIDIRECTIONAL);
|
||||
#else
|
||||
|
|
@ -1871,8 +1871,13 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
|
|||
struct ieee80211_radiotap_header);
|
||||
if (rt_info.radiotap_extra) {
|
||||
rth_hdr->it_present |= cpu_to_le32(
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 9, 0)
|
||||
(1
|
||||
<< IEEE80211_RADIOTAP_TIMESTAMP) |
|
||||
<< IEEE80211_RADIOTAP_TIMESTAMP)
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
|
|
||||
(1
|
||||
<< IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE) |
|
||||
(1 << IEEE80211_RADIOTAP_EXT));
|
||||
|
|
@ -3597,6 +3602,35 @@ static void woal_survey_dump_reset_event(moal_private *priv)
|
|||
// coverity[leaked_storage]: SUPPRESS
|
||||
}
|
||||
|
||||
#ifdef STA_CFG80211
|
||||
/**
|
||||
* @brief This function send event to inform BSS from scan result
|
||||
*
|
||||
* @param priv A pointer moal_private structure
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
static void woal_send_bss_scan_result_event(moal_private *priv)
|
||||
{
|
||||
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_CFG80211_INFORM_BSS;
|
||||
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);
|
||||
}
|
||||
// evt buffer will be freed by woal_evt_work_queue() once event is
|
||||
// handled coverity[misra_c_2012_rule_22_1_violation:SUPPRESS]
|
||||
// coverity[leaked_storage]: SUPPRESS
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* @brief This function handles event receive
|
||||
*
|
||||
|
|
@ -3609,9 +3643,6 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
{
|
||||
#ifdef STA_SUPPORT
|
||||
int custom_len = 0;
|
||||
#ifdef STA_CFG80211
|
||||
unsigned long flags;
|
||||
#endif
|
||||
#endif
|
||||
moal_private *priv = NULL;
|
||||
#if defined(STA_SUPPORT) || defined(UAP_SUPPORT)
|
||||
|
|
@ -3815,38 +3846,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
priv->report_scan_result = MFALSE;
|
||||
#ifdef STA_CFG80211
|
||||
if (IS_STA_CFG80211(cfg80211_wext)) {
|
||||
spin_lock_irqsave(&priv->phandle->scan_req_lock,
|
||||
flags);
|
||||
if (priv->phandle->scan_request) {
|
||||
PRINTM(MINFO,
|
||||
"Reporting scan results\n");
|
||||
woal_inform_bss_from_scan_result(
|
||||
priv, NULL, MOAL_NO_WAIT);
|
||||
if (!priv->phandle->first_scan_done) {
|
||||
priv->phandle->first_scan_done =
|
||||
MTRUE;
|
||||
if (!priv->phandle
|
||||
->user_scan_cfg)
|
||||
woal_set_scan_time(
|
||||
priv,
|
||||
ACTIVE_SCAN_CHAN_TIME,
|
||||
PASSIVE_SCAN_CHAN_TIME,
|
||||
SPECIFIC_SCAN_CHAN_TIME);
|
||||
}
|
||||
if (priv->phandle->scan_request) {
|
||||
cancel_delayed_work(
|
||||
&priv->phandle
|
||||
->scan_timeout_work);
|
||||
woal_cfg80211_scan_done(
|
||||
priv->phandle
|
||||
->scan_request,
|
||||
MFALSE);
|
||||
priv->phandle->scan_request =
|
||||
NULL;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(
|
||||
&priv->phandle->scan_req_lock, flags);
|
||||
woal_send_bss_scan_result_event(priv);
|
||||
}
|
||||
#endif /* STA_CFG80211 */
|
||||
|
||||
|
|
@ -4193,27 +4193,6 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
#ifdef STA_CFG80211
|
||||
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
|
||||
if (IS_STA_CFG80211(cfg80211_wext)) {
|
||||
struct cfg80211_bss *bss = NULL;
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
|
||||
bss = cfg80211_get_bss(priv->wdev->wiphy, NULL,
|
||||
priv->cfg_bssid, NULL, 0,
|
||||
IEEE80211_BSS_TYPE_ESS,
|
||||
IEEE80211_PRIVACY_ANY);
|
||||
|
||||
#else
|
||||
bss = cfg80211_get_bss(priv->wdev->wiphy, NULL,
|
||||
priv->cfg_bssid, NULL, 0,
|
||||
WLAN_CAPABILITY_ESS,
|
||||
WLAN_CAPABILITY_ESS);
|
||||
#endif
|
||||
if (bss) {
|
||||
cfg80211_unlink_bss(priv->wdev->wiphy, bss);
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
|
||||
cfg80211_put_bss(priv->wdev->wiphy, bss);
|
||||
#else
|
||||
cfg80211_put_bss(bss);
|
||||
#endif
|
||||
}
|
||||
if (!hw_test && priv->roaming_enabled)
|
||||
woal_config_bgscan_and_rssi(priv, MFALSE);
|
||||
else {
|
||||
|
|
@ -5746,7 +5725,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
|||
roam_info->req_ie_len = ie_len;
|
||||
roam_info->resp_ie = pinfo->rsp_ie;
|
||||
roam_info->resp_ie_len = pinfo->header.len;
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
||||
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || \
|
||||
(defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33))
|
||||
if (priv->wdev->u.client.ssid_len)
|
||||
#else
|
||||
if (priv->wdev->ssid_len)
|
||||
|
|
|
|||
|
|
@ -7082,7 +7082,8 @@ static int woal_cfg80211_dump_survey(struct wiphy *wiphy,
|
|||
if (stats.cca_cnt_us != 0) {
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
|
||||
survey->filled |= SURVEY_INFO_TIME |
|
||||
survey->filled |= SURVEY_INFO_IN_USE |
|
||||
SURVEY_INFO_TIME |
|
||||
SURVEY_INFO_TIME_BUSY |
|
||||
SURVEY_INFO_TIME_RX |
|
||||
SURVEY_INFO_TIME_TX;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,9 @@ static int woal_uap_get_fw_info(struct net_device *dev, struct ifreq *req)
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
fw.fw_release_number = fw_info.fw_ver;
|
||||
// fw.fw_release_number = fw_info.fw_ver;
|
||||
moal_memcpy_ext(priv->phandle, &fw.fw_release_number, &fw_info.fw_ver,
|
||||
sizeof(fw.fw_release_number), sizeof(fw_info.fw_ver));
|
||||
fw.hw_dev_mcs_support = fw_info.hw_dev_mcs_support;
|
||||
fw.fw_bands = fw_info.fw_bands;
|
||||
fw.region_code = fw_info.region_code;
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ typedef struct _uap_fw_info {
|
|||
/** Get */
|
||||
t_u32 action;
|
||||
/** Firmware release number */
|
||||
t_u32 fw_release_number;
|
||||
fw_release_version_t fw_release_number;
|
||||
/** Device support for MIMO abstraction of MCSs */
|
||||
t_u8 hw_dev_mcs_support;
|
||||
/** fw_bands*/
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ extern struct semaphore AddRemoveCardSem;
|
|||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBIW624) || defined(USBIW610)
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USB8978) || \
|
||||
defined(USBIW624) || defined(USBIW610)
|
||||
/** Card-type detection frame response */
|
||||
typedef struct {
|
||||
/** 32-bit ACK+WINNER field */
|
||||
|
|
@ -68,16 +68,6 @@ static struct usb_device_id woal_usb_table[] = {
|
|||
{NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_1, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_2, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_1, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997V2_PID_1,
|
||||
"NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_2, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_3, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_4, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_5, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_6, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_1, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_1_BT,
|
||||
|
|
@ -116,9 +106,6 @@ static struct usb_device_id woal_usb_table_skip_fwdnld[] = {
|
|||
#ifdef USB8897
|
||||
{NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_2, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
{NXP_USB_DEVICE(USB8997_VID_1, USB8997_PID_2, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_2, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_2_BT,
|
||||
|
|
@ -500,8 +487,8 @@ rx_ret:
|
|||
Global Functions
|
||||
********************************************************/
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBIW624) || defined(USBIW610)
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USB8978) || \
|
||||
defined(USBIW624) || defined(USBIW610)
|
||||
/**
|
||||
* @brief Check chip revision
|
||||
*
|
||||
|
|
@ -726,33 +713,6 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
strlen(INTF_CARDTYPE) - strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#ifdef USB8997
|
||||
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_1 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_2 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_3 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_4 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_5 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997_PID_6 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8997V2_PID_1) {
|
||||
card_type = CARD_TYPE_USB8997;
|
||||
moal_memcpy_ext(NULL, driver_version, CARD_USB8997,
|
||||
strlen(CARD_USB8997), strlen(driver_version));
|
||||
moal_memcpy_ext(
|
||||
NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V16, strlen(V16),
|
||||
strnlen(driver_version, MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) - strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#ifdef USB8978
|
||||
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USB8978_PID_1 ||
|
||||
|
|
@ -843,15 +803,17 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
device_name, &card_type,
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct)) ==
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
moal_memcpy_ext(NULL, driver_version, device_name,
|
||||
strlen(device_name), strlen(driver_version));
|
||||
moal_memcpy_ext(
|
||||
NULL, driver_version, device_name, strlen(device_name),
|
||||
strnlen(driver_version, MLAN_MAX_VER_STR_LEN - 1));
|
||||
|
||||
if (card_type == CARD_TYPE_USB8801) {
|
||||
moal_memcpy_ext(NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V14, strlen(V14),
|
||||
strlen(driver_version) -
|
||||
strnlen(driver_version,
|
||||
MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
} else if (card_type == CARD_TYPE_USB8897) {
|
||||
|
|
@ -859,16 +821,17 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V15, strlen(V15),
|
||||
strlen(driver_version) -
|
||||
strnlen(driver_version,
|
||||
MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
} else if (card_type == CARD_TYPE_USB8997 ||
|
||||
card_type == CARD_TYPE_USB8978) {
|
||||
} else if (card_type == CARD_TYPE_USB8978) {
|
||||
moal_memcpy_ext(NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V16, strlen(V16),
|
||||
strlen(driver_version) -
|
||||
strnlen(driver_version,
|
||||
MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
} else if (card_type == CARD_TYPE_USB9098 ||
|
||||
|
|
@ -877,7 +840,8 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V17, strlen(V17),
|
||||
strlen(driver_version) -
|
||||
strnlen(driver_version,
|
||||
MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
} else if (card_type == CARD_TYPE_USBIW624 ||
|
||||
|
|
@ -886,11 +850,15 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V18, strlen(V18),
|
||||
strlen(driver_version) -
|
||||
strnlen(driver_version,
|
||||
MLAN_MAX_VER_STR_LEN - 1) -
|
||||
strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
}
|
||||
}
|
||||
|
||||
driver_version[MLAN_MAX_VER_STR_LEN - 1] = '\0';
|
||||
|
||||
return card_type;
|
||||
}
|
||||
|
||||
|
|
@ -947,10 +915,6 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
#ifdef USB8897
|
||||
case (__force __le16)USB8897_PID_1:
|
||||
#endif /* USB8897 */
|
||||
#ifdef USB8997
|
||||
case (__force __le16)USB8997_PID_1:
|
||||
case (__force __le16)USB8997V2_PID_1:
|
||||
#endif /* USB8997 */
|
||||
#ifdef USB8978
|
||||
case (__force __le16)USB8978_PID_1:
|
||||
case (__force __le16)USB8978_PID_1_BT:
|
||||
|
|
@ -978,9 +942,6 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
#ifdef USB8897
|
||||
case (__force __le16)USB8897_PID_2:
|
||||
#endif /* USB8897 */
|
||||
#ifdef USB8997
|
||||
case (__force __le16)USB8997_PID_2:
|
||||
#endif /* USB8997 */
|
||||
#ifdef USB8978
|
||||
case (__force __le16)USB8978_PID_2:
|
||||
case (__force __le16)USB8978_PID_2_BT:
|
||||
|
|
@ -1011,15 +972,6 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
|
||||
break;
|
||||
}
|
||||
/*To do, get card type*/
|
||||
/* if
|
||||
(woal_cpu_to_le16(udev->descriptor.idProduct) ==
|
||||
USB8897_PID_2) usb_cardp->card_type =
|
||||
CARD_TYPE_USB8897; else if
|
||||
(woal_cpu_to_le16(udev->descriptor.idProduct) ==
|
||||
USB8997_PID_2) usb_cardp->card_type =
|
||||
CARD_TYPE_USB997;
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2159,8 +2111,8 @@ done:
|
|||
static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBIW624) || defined(USBIW610)
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USB8978) || \
|
||||
defined(USBIW624) || defined(USBIW610)
|
||||
t_u32 revision_id = 0;
|
||||
t_u32 strap = 0;
|
||||
t_u32 boot_mode = 0;
|
||||
|
|
@ -2179,8 +2131,8 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
if (cardp->boot_state == USB_FW_READY)
|
||||
goto done;
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBIW624) || defined(USBIW610)
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USB8978) || \
|
||||
defined(USBIW624) || defined(USBIW610)
|
||||
ret = woal_check_chip_revision(handle, &revision_id, &strap,
|
||||
&boot_mode);
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
|
|
@ -2191,19 +2143,6 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
PRINTM(MCMND, "revision=0x%x, strap=0x%x\n", revision_id, strap);
|
||||
#endif
|
||||
|
||||
#ifdef USB8997
|
||||
if (IS_USB8997(handle->card_type)) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else if (strap != 0)
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USB8978
|
||||
if (IS_USB8978(handle->card_type)) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
|
|
|
|||
|
|
@ -28,20 +28,6 @@ Change Log:
|
|||
#ifndef _MOAL_USB_H
|
||||
#define _MOAL_USB_H
|
||||
|
||||
#ifdef USB8997
|
||||
/** USB VID 1 */
|
||||
#define USB8997_VID_1 0x1286
|
||||
/** USB PID 1 */
|
||||
#define USB8997_PID_1 0x204D
|
||||
/** USB PID 2 */
|
||||
#define USB8997_PID_2 0x204E
|
||||
#define USB8997_PID_3 0x2047
|
||||
#define USB8997_PID_4 0x2048
|
||||
#define USB8997_PID_5 0x2050
|
||||
#define USB8997_PID_6 0x2051
|
||||
#define USB8997V2_PID_1 0x2052
|
||||
#endif /* USB8997 */
|
||||
|
||||
#ifdef USB8978
|
||||
/** USB VID 1 */
|
||||
#define USB8978_VID_1 0x1286
|
||||
|
|
@ -110,8 +96,8 @@ Change Log:
|
|||
/** Number of Rx data URB */
|
||||
#define MVUSB_RX_DATA_URB 6
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBIW624) || defined(USBIW610)
|
||||
#if defined(USB9098) || defined(USB9097) || defined(USB8978) || \
|
||||
defined(USBIW624) || defined(USBIW610)
|
||||
/* Transmit buffer size for chip revision check */
|
||||
#define CHIP_REV_TX_BUF_SIZE 16
|
||||
/* Receive buffer size for chip revision check */
|
||||
|
|
@ -126,14 +112,6 @@ Change Log:
|
|||
#endif
|
||||
|
||||
/** Default firmaware name */
|
||||
#ifdef USB8997
|
||||
#define USB8997_DEFAULT_COMBO_FW_NAME "nxp/usbusb8997_combo_v4.bin"
|
||||
#define USB8997_DEFAULT_WLAN_FW_NAME "nxp/usb8997_wlan_v4.bin"
|
||||
#define USBUART8997_DEFAULT_COMBO_FW_NAME "nxp/usbuart8997_combo_v4.bin"
|
||||
#define USBUSB8997_DEFAULT_COMBO_FW_NAME "nxp/usbusb8997_combo_v4.bin"
|
||||
|
||||
#endif /* USB8997 */
|
||||
|
||||
#ifdef USB8978
|
||||
#define USB8978_DEFAULT_COMBO_FW_NAME "nxp/usbusbiw416_combo.bin"
|
||||
#define USB8978_DEFAULT_WLAN_FW_NAME "nxp/usbiw416_wlan.bin"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue