1
0
Fork 0

MLK-24191 net: wireless: nxp: mxm_wifiex: upgrade to mxm4x17175 release

The MxM wifi driver upgrade to.
ssh://git@bitbucket.sw.nxp.com/wcswrel/
rel-nxp-wifi-fp92-bt-fp85-linux-android-mxm4x17175-mgpl.git

The release main changes:
- includes previous bugfixs
- fix the coverity issues
- fix the coding style

Reviewed-by: yang.tian <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Fugang Duan 2020-05-28 17:51:50 +08:00
parent 749435ba3d
commit 6b4a83a75f
85 changed files with 35367 additions and 37778 deletions

View File

@ -266,6 +266,7 @@ endif
ccflags-y += -Wno-stringop-overflow
ccflags-y += -Wno-tautological-compare
ccflags-y += -Wno-packed-bitfield-compat
ccflags-y += -Wno-stringop-truncation
#############################################################################
# Make Targets

View File

@ -55,9 +55,8 @@ t_u16 wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands,
* @return channel center frequency center, if found; O, otherwise
*/
t_u8
wlan_get_center_freq_idx(IN mlan_private *pmpriv,
IN t_u16 band, IN t_u32 pri_chan, IN t_u8 chan_bw)
t_u8 wlan_get_center_freq_idx(IN mlan_private *pmpriv, IN t_u16 band,
IN t_u32 pri_chan, IN t_u8 chan_bw)
{
t_u8 center_freq_idx = 0;
@ -141,8 +140,7 @@ wlan_get_center_freq_idx(IN mlan_private *pmpriv,
break;
}
/* fall through */
default: /* error. go to the default */
default: /* error. go to the default */
center_freq_idx = 42;
}
}
@ -156,8 +154,7 @@ wlan_get_center_freq_idx(IN mlan_private *pmpriv,
*
* @return The bitmap of supported nss
*/
static t_u8
wlan_get_nss_vht_mcs(t_u16 mcs_map_set)
static t_u8 wlan_get_nss_vht_mcs(t_u16 mcs_map_set)
{
t_u8 nss, nss_map = 0;
for (nss = 1; nss <= 8; nss++) {
@ -175,8 +172,7 @@ wlan_get_nss_vht_mcs(t_u16 mcs_map_set)
*
* @return The bitmap of supported nss
*/
static t_u8
wlan_get_nss_num_vht_mcs(t_u16 mcs_map_set)
static t_u8 wlan_get_nss_num_vht_mcs(t_u16 mcs_map_set)
{
t_u8 nss, nss_num = 0;
for (nss = 1; nss <= 8; nss++) {
@ -196,8 +192,8 @@ wlan_get_nss_num_vht_mcs(t_u16 mcs_map_set)
*
* @return N/A
*/
static void
wlan_fill_cap_info(mlan_private *priv, VHT_capa_t *vht_cap, t_u8 bands)
static void wlan_fill_cap_info(mlan_private *priv, VHT_capa_t *vht_cap,
t_u8 bands)
{
t_u32 usr_dot_11ac_dev_cap;
@ -221,9 +217,8 @@ wlan_fill_cap_info(mlan_private *priv, VHT_capa_t *vht_cap, t_u8 bands)
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
static mlan_status
wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
IN pmlan_ioctl_req pioctl_req)
static mlan_status wlan_11ac_ioctl_vhtcfg(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];
@ -233,23 +228,23 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
t_u32 cfg_value = 0;
t_u32 hw_value = 0;
t_u8 nss = 0;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(USB9097) || defined(SD9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(USB9097) || defined(SD9097)
t_u16 rx_nss = 0;
t_u16 tx_nss = 0;
#endif
ENTER();
#define VHT_CAP_INFO_BIT_FIELDS \
(MBIT(4)|MBIT(5)|MBIT(6)|MBIT(7)| \
MBIT(11)|MBIT(12)|MBIT(19)|MBIT(20)| \
MBIT(21)|MBIT(22)|MBIT(28)|MBIT(29))
#define VHT_CAP_INFO_BIT_FIELDS \
(MBIT(4) | MBIT(5) | MBIT(6) | MBIT(7) | MBIT(11) | MBIT(12) | \
MBIT(19) | MBIT(20) | MBIT(21) | MBIT(22) | MBIT(28) | MBIT(29))
cfg = (mlan_ds_11ac_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_SET) {
/** SET operation */
/** validate the user input and correct it if necessary */
/** SET operation */
/** validate the user input and correct it if necessary */
if (pmpriv->bss_role == MLAN_BSS_ROLE_STA) {
if (cfg->param.vht_cfg.txrx == 3) {
PRINTM(MERROR,
@ -265,147 +260,144 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
return MLAN_STATUS_FAILURE;
}
}
/** set bit fileds */
/** set bit fileds */
usr_vht_cap_info = VHT_CAP_INFO_BIT_FIELDS &
cfg->param.vht_cfg.vht_cap_info &
pmadapter->hw_dot_11ac_dev_cap;
/** set MAX MPDU LEN field (bit 0 - bit 1) */
cfg->param.vht_cfg.vht_cap_info &
pmadapter->hw_dot_11ac_dev_cap;
/** set MAX MPDU LEN field (bit 0 - bit 1) */
cfg_value =
GET_VHTCAP_MAXMPDULEN(cfg->param.vht_cfg.vht_cap_info);
hw_value =
GET_VHTCAP_MAXMPDULEN(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_MAXMPDULEN(usr_vht_cap_info,
MIN(cfg_value, hw_value));
/** set CHAN Width Set field (bit 2 - bit 3) */
/** set CHAN Width Set field (bit 2 - bit 3) */
cfg_value = GET_VHTCAP_CHWDSET(cfg->param.vht_cfg.vht_cap_info);
hw_value = GET_VHTCAP_CHWDSET(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_CHWDSET(usr_vht_cap_info, MIN(cfg_value, hw_value));
/** set Rx STBC field (bit 8 - bit 10) */
/** set Rx STBC field (bit 8 - bit 10) */
cfg_value = GET_VHTCAP_RXSTBC(cfg->param.vht_cfg.vht_cap_info);
hw_value = GET_VHTCAP_RXSTBC(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_RXSTBC(usr_vht_cap_info, MIN(cfg_value, hw_value));
/** set Steering Number of BFer Ant (bit 13 - bit 15) */
/** set Steering Number of BFer Ant (bit 13 - bit 15) */
cfg_value =
GET_VHTCAP_SNBFERANT(cfg->param.vht_cfg.vht_cap_info);
hw_value = GET_VHTCAP_SNBFERANT(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_SNBFERANT(usr_vht_cap_info,
MIN(cfg_value, hw_value));
/** set Number of Sounding Dimension (bit 16 - bit 18) */
/** set Number of Sounding Dimension (bit 16 - bit 18) */
cfg_value =
GET_VHTCAP_NUMSNDDM(cfg->param.vht_cfg.vht_cap_info);
hw_value = GET_VHTCAP_NUMSNDDM(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_NUMSNDDM(usr_vht_cap_info, MIN(cfg_value, hw_value));
/** set Number of Max AMPDU Length Exponent (bit 23 - bit 25) */
cfg_value =
GET_VHTCAP_MAXAMPDULENEXP(cfg->param.vht_cfg.
vht_cap_info);
hw_value =
GET_VHTCAP_MAXAMPDULENEXP(pmadapter->
hw_dot_11ac_dev_cap);
/** set Number of Max AMPDU Length Exponent (bit 23 - bit 25) */
cfg_value = GET_VHTCAP_MAXAMPDULENEXP(
cfg->param.vht_cfg.vht_cap_info);
hw_value = GET_VHTCAP_MAXAMPDULENEXP(
pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_MAXAMPDULENEXP(usr_vht_cap_info,
MIN(cfg_value, hw_value));
/** set VHT Link Adaptation Capable (bit 26 - bit 27) */
/** set VHT Link Adaptation Capable (bit 26 - bit 27) */
cfg_value =
GET_VHTCAP_LINKADPCAP(cfg->param.vht_cfg.vht_cap_info);
hw_value =
GET_VHTCAP_LINKADPCAP(pmadapter->hw_dot_11ac_dev_cap);
SET_VHTCAP_LINKADPCAP(usr_vht_cap_info,
MIN(cfg_value, hw_value));
/** update the user setting if it is beyond the hw capabiliteis */
/** update the user setting if it is beyond the hw capabiliteis
*/
cfg->param.vht_cfg.vht_cap_info = usr_vht_cap_info;
PRINTM(MINFO, "Set: vht cap info 0x%x\n", usr_vht_cap_info);
/** update the RX MCS map */
/** update the RX MCS map */
if (cfg->param.vht_cfg.txrx & MLAN_RADIO_RX) {
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (cfg->param.vht_cfg.band == BAND_SELECT_A) {
rx_nss = GET_RXMCSSUPP(pmadapter->
user_htstream >>
8);
tx_nss = GET_TXMCSSUPP(pmadapter->
user_htstream >>
8) & 0x0f;
rx_nss = GET_RXMCSSUPP(
pmadapter->user_htstream >> 8);
tx_nss =
GET_TXMCSSUPP(
pmadapter->user_htstream >>
8) &
0x0f;
} else {
rx_nss = GET_RXMCSSUPP(pmadapter->
user_htstream);
tx_nss = GET_TXMCSSUPP(pmadapter->
user_htstream) &
rx_nss = GET_RXMCSSUPP(
pmadapter->user_htstream);
tx_nss =
GET_TXMCSSUPP(
pmadapter->user_htstream) &
0x0f;
}
}
#endif
/* use the previous user value */
if (cfg->param.vht_cfg.vht_rx_mcs == 0xffffffff)
cfg->param.vht_cfg.vht_rx_mcs =
GET_VHTMCS(pmpriv->
usr_dot_11ac_mcs_support);
cfg->param.vht_cfg.vht_rx_mcs = GET_VHTMCS(
pmpriv->usr_dot_11ac_mcs_support);
for (nss = 1; nss <= 8; nss++) {
cfg_value =
GET_VHTNSSMCS(cfg->param.vht_cfg.
vht_rx_mcs, nss);
hw_value =
GET_DEVNSSRXMCS(pmadapter->
hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
cfg_value = GET_VHTNSSMCS(
cfg->param.vht_cfg.vht_rx_mcs, nss);
hw_value = GET_DEVNSSRXMCS(
pmadapter->hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if ((rx_nss != 0) && (nss > rx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_VHTNSSMCS(cfg->param.vht_cfg.
vht_rx_mcs, nss,
NO_NSS_SUPPORT);
SET_VHTNSSMCS(
cfg->param.vht_cfg.vht_rx_mcs,
nss, NO_NSS_SUPPORT);
else
SET_VHTNSSMCS(cfg->param.vht_cfg.
vht_rx_mcs, nss,
MIN(cfg_value, hw_value));
SET_VHTNSSMCS(
cfg->param.vht_cfg.vht_rx_mcs,
nss, MIN(cfg_value, hw_value));
}
PRINTM(MINFO, "Set: vht rx mcs set 0x%08x\n",
cfg->param.vht_cfg.vht_rx_mcs);
/* use the previous user value */
if (cfg->param.vht_cfg.vht_tx_mcs == 0xffffffff)
cfg->param.vht_cfg.vht_tx_mcs =
GET_VHTMCS(pmpriv->
usr_dot_11ac_mcs_support >>
16);
cfg->param.vht_cfg.vht_tx_mcs = GET_VHTMCS(
pmpriv->usr_dot_11ac_mcs_support >> 16);
for (nss = 1; nss <= 8; nss++) {
cfg_value =
GET_VHTNSSMCS(cfg->param.vht_cfg.
vht_tx_mcs, nss);
hw_value =
GET_DEVNSSTXMCS(pmadapter->
hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
cfg_value = GET_VHTNSSMCS(
cfg->param.vht_cfg.vht_tx_mcs, nss);
hw_value = GET_DEVNSSTXMCS(
pmadapter->hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if ((rx_nss != 0) && (nss > rx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_VHTNSSMCS(cfg->param.vht_cfg.
vht_tx_mcs, nss,
NO_NSS_SUPPORT);
SET_VHTNSSMCS(
cfg->param.vht_cfg.vht_tx_mcs,
nss, NO_NSS_SUPPORT);
else
SET_VHTNSSMCS(cfg->param.vht_cfg.
vht_tx_mcs, nss,
MIN(cfg_value, hw_value));
SET_VHTNSSMCS(
cfg->param.vht_cfg.vht_tx_mcs,
nss, MIN(cfg_value, hw_value));
}
PRINTM(MINFO, "Set: vht tx mcs set 0x%08x\n",
cfg->param.vht_cfg.vht_tx_mcs);
if (!cfg->param.vht_cfg.skip_usr_11ac_mcs_cfg) {
RESET_DEVRXMCSMAP(pmpriv->
usr_dot_11ac_mcs_support);
RESET_DEVRXMCSMAP(
pmpriv->usr_dot_11ac_mcs_support);
pmpriv->usr_dot_11ac_mcs_support |= GET_VHTMCS(
cfg->param.vht_cfg.vht_rx_mcs);
RESET_DEVTXMCSMAP(
pmpriv->usr_dot_11ac_mcs_support);
pmpriv->usr_dot_11ac_mcs_support |=
GET_VHTMCS(cfg->param.vht_cfg.
vht_rx_mcs);
RESET_DEVTXMCSMAP(pmpriv->
usr_dot_11ac_mcs_support);
pmpriv->usr_dot_11ac_mcs_support |=
(GET_VHTMCS
(cfg->param.vht_cfg.vht_tx_mcs) << 16);
(GET_VHTMCS(
cfg->param.vht_cfg.vht_tx_mcs)
<< 16);
PRINTM(MINFO, "Set: vht mcs set 0x%08x\n",
pmpriv->usr_dot_11ac_mcs_support);
} else {
@ -438,7 +430,7 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
cfg->param.vht_cfg.bwcfg;
} else {
/** GET operation */
/** GET operation */
if (cfg->param.vht_cfg.band == BAND_SELECT_BG) {
cfg->param.vht_cfg.vht_cap_info =
pmpriv->usr_dot_11ac_dev_cap_bg;
@ -459,32 +451,18 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
}
cfg->param.vht_cfg.bwcfg =
pmpriv->usr_dot_11ac_bw;
cfg->param.vht_cfg.vht_rx_mcs =
GET_DEVRXMCSMAP(pmpriv->
usr_dot_11ac_mcs_support);
cfg->param.vht_cfg.vht_tx_mcs =
GET_DEVTXMCSMAP(pmpriv->
usr_dot_11ac_mcs_support);
cfg->param.vht_cfg.vht_rx_mcs = GET_DEVRXMCSMAP(
pmpriv->usr_dot_11ac_mcs_support);
cfg->param.vht_cfg.vht_tx_mcs = GET_DEVTXMCSMAP(
pmpriv->usr_dot_11ac_mcs_support);
cfg->param.vht_cfg.vht_rx_max_rate =
wlan_convert_mcsmap_to_maxrate(pmpriv,
cfg->
param.
vht_cfg.
band,
cfg->
param.
vht_cfg.
vht_rx_mcs);
wlan_convert_mcsmap_to_maxrate(
pmpriv, cfg->param.vht_cfg.band,
cfg->param.vht_cfg.vht_rx_mcs);
cfg->param.vht_cfg.vht_tx_max_rate =
wlan_convert_mcsmap_to_maxrate(pmpriv,
cfg->
param.
vht_cfg.
band,
cfg->
param.
vht_cfg.
vht_tx_mcs);
wlan_convert_mcsmap_to_maxrate(
pmpriv, cfg->param.vht_cfg.band,
cfg->param.vht_cfg.vht_tx_mcs);
}
LEAVE();
return ret;
@ -497,10 +475,7 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_11AC_CFG,
cmd_action,
0,
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_11AC_CFG, cmd_action, 0,
(t_void *)pioctl_req,
(t_void *)&cfg->param.vht_cfg);
if (ret == MLAN_STATUS_SUCCESS)
@ -518,9 +493,8 @@ wlan_11ac_ioctl_vhtcfg(IN pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
static mlan_status
wlan_11ac_ioctl_opermodecfg(IN pmlan_adapter pmadapter,
IN pmlan_ioctl_req pioctl_req)
static mlan_status wlan_11ac_ioctl_opermodecfg(IN pmlan_adapter pmadapter,
IN pmlan_ioctl_req pioctl_req)
{
mlan_ds_11ac_cfg *cfg = MNULL;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
@ -536,10 +510,8 @@ wlan_11ac_ioctl_opermodecfg(IN pmlan_adapter pmadapter,
} else if (pioctl_req->action == MLAN_ACT_SET) {
hw_bw_160or8080 =
GET_VHTCAP_CHWDSET(pmadapter->hw_dot_11ac_dev_cap);
hw_rx_nss =
wlan_get_nss_num_vht_mcs(GET_DEVRXMCSMAP
(pmadapter->
hw_dot_11ac_mcs_support));
hw_rx_nss = wlan_get_nss_num_vht_mcs(
GET_DEVRXMCSMAP(pmadapter->hw_dot_11ac_mcs_support));
if ((((cfg->param.opermode_cfg.bw - 1) > BW_80MHZ) &&
!hw_bw_160or8080) ||
(cfg->param.opermode_cfg.nss > hw_rx_nss)) {
@ -569,9 +541,9 @@ static mlan_status
wlan_11ac_ioctl_supported_mcs_set(IN pmlan_adapter pmadapter,
IN pmlan_ioctl_req pioctl_req)
{
/*mlan_ds_11ac_cfg *cfg= MNULL; */
/*int rx_mcs_supp; */
/*t_u8 mcs_set[NUM_MCS_SUPP]; */
/*mlan_ds_11ac_cfg *cfg= MNULL;*/
/*int rx_mcs_supp;*/
/*t_u8 mcs_set[NUM_MCS_SUPP];*/
ENTER();
#if 0
@ -583,15 +555,15 @@ wlan_11ac_ioctl_supported_mcs_set(IN pmlan_adapter pmadapter,
}
rx_mcs_supp = GET_11ACRXMCSSUPP(pmadapter->usr_dot_11ac_mcs_support);
/* Set MCS */
memset(pmadapter, (t_u8 *)mcs_set, 0xff, rx_mcs_supp);
memset(pmadapter, (t_u8 *) mcs_set, 0xff, rx_mcs_supp);
/* Clear all the other values */
memset(pmadapter, (t_u8 *)&mcs_set[rx_mcs_supp], 0,
NUM_MCS_FIELD - rx_mcs_supp);
memset(pmadapter, (t_u8 *) &mcs_set[rx_mcs_supp], 0,
NUM_MCS_FIELD - rx_mcs_supp);
/* Set MCS32 with 40MHz support */
if (ISSUPP_CHANWIDTH80(pmadapter->usr_dot_11ac_dev_cap_bg)
|| ISSUPP_CHANWIDTH80(pmadapter->usr_dot_11ac_dev_cap_a)
)
SETHT_MCS32(mcs_set);
|| ISSUPP_CHANWIDTH80(pmadapter->usr_dot_11ac_dev_cap_a)
)
SETHT_MCS32(mcs_set);
cfg = (mlan_ds_11ac_cfg *)pioctl_req->pbuf;
memcpy_ext(pmadapter, cfg->param.supported_mcs_set, mcs_set,
@ -614,8 +586,7 @@ wlan_11ac_ioctl_supported_mcs_set(IN pmlan_adapter pmadapter,
*
* @return N/A
*/
void
wlan_show_dot11acdevcap(pmlan_adapter pmadapter, t_u32 cap)
void wlan_show_dot11acdevcap(pmlan_adapter pmadapter, t_u32 cap)
{
ENTER();
@ -643,10 +614,10 @@ wlan_show_dot11acdevcap(pmlan_adapter pmadapter, t_u32 cap)
(ISSUPP_11ACVHTTXOPPS(cap) ? "supported" : "not supported"));
PRINTM(MINFO, "GET_HW_SPEC: MU RX beamformee %s\n",
(ISSUPP_11ACMURXBEAMFORMEE(cap) ? "supported" :
"not supported"));
"not supported"));
PRINTM(MINFO, "GET_HW_SPEC: MU TX beamformee %s\n",
(ISSUPP_11ACMUTXBEAMFORMEE(cap) ? "supported" :
"not supported"));
"not supported"));
PRINTM(MINFO, "GET_HW_SPEC: SU RX Beamformee %s\n",
(ISSUPP_11ACSUBEAMFORMEE(cap) ? "supported" : "not supported"));
PRINTM(MINFO, "GET_HW_SPEC: SU TX Beamformer %s\n",
@ -678,8 +649,7 @@ wlan_show_dot11acdevcap(pmlan_adapter pmadapter, t_u32 cap)
*
* @return N/A
*/
void
wlan_show_dot11acmcssupport(pmlan_adapter pmadapter, t_u32 support)
void wlan_show_dot11acmcssupport(pmlan_adapter pmadapter, t_u32 support)
{
ENTER();
@ -700,8 +670,8 @@ wlan_show_dot11acmcssupport(pmlan_adapter pmadapter, t_u32 support)
*
* @return the max data rate for long GI
*/
t_u16
wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands, t_u16 mcs_map)
t_u16 wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands,
t_u16 mcs_map)
{
t_u8 i;
t_u8 nss;
@ -713,46 +683,46 @@ wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands, t_u16 mcs_map)
/* tables of the MCS map to the highest data rate (in Mbps)
* supported for long GI */
t_u16 max_rate_lgi_20MHZ[8][3] = {
{0x41, 0x4E, 0x0}, /* NSS = 1 */
{0x82, 0x9C, 0x0}, /* NSS = 2 */
{0xC3, 0xEA, 0x104}, /* NSS = 3 */
{0x104, 0x138, 0x0}, /* NSS = 4 */
{0x145, 0x186, 0x0}, /* NSS = 5 */
{0x186, 0x1D4, 0x208}, /* NSS = 6 */
{0x1C7, 0x222, 0x0}, /* NSS = 7 */
{0x208, 0x270, 0x0} /* NSS = 8 */
{0x41, 0x4E, 0x0}, /* NSS = 1 */
{0x82, 0x9C, 0x0}, /* NSS = 2 */
{0xC3, 0xEA, 0x104}, /* NSS = 3 */
{0x104, 0x138, 0x0}, /* NSS = 4 */
{0x145, 0x186, 0x0}, /* NSS = 5 */
{0x186, 0x1D4, 0x208}, /* NSS = 6 */
{0x1C7, 0x222, 0x0}, /* NSS = 7 */
{0x208, 0x270, 0x0} /* NSS = 8 */
};
t_u16 max_rate_lgi_40MHZ[8][3] = {
{0x87, 0xA2, 0xB4}, /* NSS = 1 */
{0x10E, 0x144, 0x168}, /* NSS = 2 */
{0x195, 0x1E6, 0x21C}, /* NSS = 3 */
{0x21C, 0x288, 0x2D0}, /* NSS = 4 */
{0x2A3, 0x32A, 0x384}, /* NSS = 5 */
{0x32A, 0x3CC, 0x438}, /* NSS = 6 */
{0x3B1, 0x46E, 0x4EC}, /* NSS = 7 */
{0x438, 0x510, 0x5A0} /* NSS = 8 */
{0x87, 0xA2, 0xB4}, /* NSS = 1 */
{0x10E, 0x144, 0x168}, /* NSS = 2 */
{0x195, 0x1E6, 0x21C}, /* NSS = 3 */
{0x21C, 0x288, 0x2D0}, /* NSS = 4 */
{0x2A3, 0x32A, 0x384}, /* NSS = 5 */
{0x32A, 0x3CC, 0x438}, /* NSS = 6 */
{0x3B1, 0x46E, 0x4EC}, /* NSS = 7 */
{0x438, 0x510, 0x5A0} /* NSS = 8 */
};
t_u16 max_rate_lgi_80MHZ[8][3] = {
{0x124, 0x15F, 0x186}, /* NSS = 1 */
{0x249, 0x2BE, 0x30C}, /* NSS = 2 */
{0x36D, 0x41D, 0x492}, /* NSS = 3 */
{0x492, 0x57C, 0x618}, /* NSS = 4 */
{0x5B6, 0x6DB, 0x79E}, /* NSS = 5 */
{0x6DB, 0x83A, 0x0}, /* NSS = 6 */
{0x7FF, 0x999, 0xAAA}, /* NSS = 7 */
{0x924, 0xAF8, 0xC30} /* NSS = 8 */
{0x124, 0x15F, 0x186}, /* NSS = 1 */
{0x249, 0x2BE, 0x30C}, /* NSS = 2 */
{0x36D, 0x41D, 0x492}, /* NSS = 3 */
{0x492, 0x57C, 0x618}, /* NSS = 4 */
{0x5B6, 0x6DB, 0x79E}, /* NSS = 5 */
{0x6DB, 0x83A, 0x0}, /* NSS = 6 */
{0x7FF, 0x999, 0xAAA}, /* NSS = 7 */
{0x924, 0xAF8, 0xC30} /* NSS = 8 */
};
t_u16 max_rate_lgi_160MHZ[8][3] = {
{0x249, 0x2BE, 0x30C}, /* NSS = 1 */
{0x492, 0x57C, 0x618}, /* NSS = 2 */
{0x6DB, 0x83A, 0x0}, /* NSS = 3 */
{0x924, 0xAF8, 0xC30}, /* NSS = 4 */
{0xB6D, 0xDB6, 0xF3C}, /* NSS = 5 */
{0xDB6, 0x1074, 0x1248}, /* NSS = 6 */
{0xFFF, 0x1332, 0x1554}, /* NSS = 7 */
{0x1248, 0x15F0, 0x1860} /* NSS = 8 */
{0x249, 0x2BE, 0x30C}, /* NSS = 1 */
{0x492, 0x57C, 0x618}, /* NSS = 2 */
{0x6DB, 0x83A, 0x0}, /* NSS = 3 */
{0x924, 0xAF8, 0xC30}, /* NSS = 4 */
{0xB6D, 0xDB6, 0xF3C}, /* NSS = 5 */
{0xDB6, 0x1074, 0x1248}, /* NSS = 6 */
{0xFFF, 0x1332, 0x1554}, /* NSS = 7 */
{0x1248, 0x15F0, 0x1860} /* NSS = 8 */
};
if (bands & BAND_AAC) {
@ -772,7 +742,7 @@ wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands, t_u16 mcs_map)
}
max_mcs = (mcs_map >> (2 * nss)) & 0x3;
/* if max_mcs is 3, nss must be 0 (SS = 1). Thus, max mcs is MCS 9 */
/* if max_mcs is 3, nss must be 0 (SS = 1). Thus, max mcs is MCS 9*/
if (max_mcs >= 3)
max_mcs = 2;
@ -797,8 +767,8 @@ wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands, t_u16 mcs_map)
/* MCS9 is not supported in NSS1/2/4/5/7/8 */
if (max_mcs >= 1 && max_rate == 0)
max_rate =
max_rate_lgi_20MHZ[nss][max_mcs
- 1];
max_rate_lgi_20MHZ[nss]
[max_mcs - 1];
}
}
}
@ -817,10 +787,8 @@ wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands, t_u16 mcs_map)
* @param bw_80p80 TRUE -- enable 80p80
* @return N/A
*/
void
wlan_fill_vht_cap_tlv(mlan_private *priv,
MrvlIETypes_VHTCap_t *pvht_cap, t_u16 bands, t_u8 flag,
t_u8 bw_80p80)
void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
t_u16 bands, t_u8 flag, t_u8 bw_80p80)
{
t_u16 mcs_map_user = 0;
t_u16 mcs_map_resp = 0;
@ -828,7 +796,8 @@ wlan_fill_vht_cap_tlv(mlan_private *priv,
t_u16 mcs_user = 0;
t_u16 mcs_resp = 0;
t_u16 nss;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
t_u16 rx_nss = 0, tx_nss = 0;
#endif
ENTER();
@ -842,26 +811,28 @@ wlan_fill_vht_cap_tlv(mlan_private *priv,
wlan_cpu_to_le32(pvht_cap->vht_cap.vht_cap_info);
/* Fill VHT MCS Set */
/* rx MCS Set, find the minimum of the user rx mcs and ap rx mcs */
/* rx MCS Set, find the minimum of the user rx mcs and ap rx mcs*/
mcs_map_resp = mcs_map_user =
GET_DEVRXMCSMAP(priv->usr_dot_11ac_mcs_support);
if (flag)
mcs_map_resp =
wlan_le16_to_cpu(pvht_cap->vht_cap.mcs_sets.rx_mcs_map);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (IS_CARD9098(priv->adapter->card_type) ||
IS_CARD9097(priv->adapter->card_type)) {
if (bands & BAND_A) {
rx_nss = GET_RXMCSSUPP(priv->adapter->
user_htstream >> 8);
tx_nss = GET_TXMCSSUPP(priv->adapter->
user_htstream >> 8) & 0x0f;
rx_nss = GET_RXMCSSUPP(priv->adapter->user_htstream >>
8);
tx_nss = GET_TXMCSSUPP(priv->adapter->user_htstream >>
8) &
0x0f;
} else {
rx_nss = GET_RXMCSSUPP(priv->adapter->user_htstream);
tx_nss = GET_TXMCSSUPP(priv->adapter->
user_htstream) & 0x0f;
tx_nss = GET_TXMCSSUPP(priv->adapter->user_htstream) &
0x0f;
}
/** force 1x1 when enable 80P80 */
/** force 1x1 when enable 80P80 */
if (bw_80p80)
rx_nss = tx_nss = 1;
}
@ -870,7 +841,8 @@ wlan_fill_vht_cap_tlv(mlan_private *priv,
for (nss = 1; nss <= 8; nss++) {
mcs_user = GET_VHTNSSMCS(mcs_map_user, nss);
mcs_resp = GET_VHTNSSMCS(mcs_map_resp, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if ((rx_nss != 0) && (nss > rx_nss))
mcs_user = NO_NSS_SUPPORT;
#endif
@ -901,7 +873,8 @@ wlan_fill_vht_cap_tlv(mlan_private *priv,
for (nss = 1; nss <= 8; nss++) {
mcs_user = GET_VHTNSSMCS(mcs_map_user, nss);
mcs_resp = GET_VHTNSSMCS(mcs_map_resp, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if ((tx_nss != 0) && (nss > tx_nss))
mcs_user = NO_NSS_SUPPORT;
#endif
@ -935,9 +908,8 @@ wlan_fill_vht_cap_tlv(mlan_private *priv,
*
* @return N/A
*/
void
wlan_fill_vht_cap_ie(mlan_private *priv,
IEEEtypes_VHTCap_t *pvht_cap, t_u16 bands)
void wlan_fill_vht_cap_ie(mlan_private *priv, IEEEtypes_VHTCap_t *pvht_cap,
t_u16 bands)
{
ENTER();
@ -952,19 +924,15 @@ wlan_fill_vht_cap_ie(mlan_private *priv,
GET_DEVRXMCSMAP(priv->usr_dot_11ac_mcs_support);
/* rx highest rate */
pvht_cap->vht_cap.mcs_sets.rx_max_rate =
wlan_convert_mcsmap_to_maxrate(priv, bands,
pvht_cap->vht_cap.mcs_sets.
rx_mcs_map);
pvht_cap->vht_cap.mcs_sets.rx_max_rate = wlan_convert_mcsmap_to_maxrate(
priv, bands, pvht_cap->vht_cap.mcs_sets.rx_mcs_map);
/* tx MCS map */
pvht_cap->vht_cap.mcs_sets.tx_mcs_map =
GET_DEVTXMCSMAP(priv->usr_dot_11ac_mcs_support);
/* tx highest rate */
pvht_cap->vht_cap.mcs_sets.tx_max_rate =
wlan_convert_mcsmap_to_maxrate(priv, bands,
pvht_cap->vht_cap.mcs_sets.
tx_mcs_map);
pvht_cap->vht_cap.mcs_sets.tx_max_rate = wlan_convert_mcsmap_to_maxrate(
priv, bands, pvht_cap->vht_cap.mcs_sets.tx_mcs_map);
LEAVE();
return;
@ -978,11 +946,11 @@ wlan_fill_vht_cap_ie(mlan_private *priv,
*
* @return ret suport 80+80Mhz or not
*/
t_u8
wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
t_u8 wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
{
t_u8 ret = MFALSE;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
t_u16 rx_nss = 0, tx_nss = 0;
IEEEtypes_VHTCap_t *pvht_cap = pbss_desc->pvht_cap;
MrvlIEtypes_He_cap_t *phecap = MNULL;
@ -991,30 +959,31 @@ wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
ENTER();
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (!IS_CARD9098(pmpriv->adapter->card_type)
&& !IS_CARD9097(pmpriv->adapter->card_type))
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (!IS_CARD9098(pmpriv->adapter->card_type) &&
!IS_CARD9097(pmpriv->adapter->card_type))
return ret;
/** check band A */
/** check band A */
if (!(pbss_desc->bss_band & BAND_A))
return ret;
/** check band A antenna setting */
/** check band A antenna setting */
rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >> 8);
tx_nss = GET_TXMCSSUPP(pmpriv->adapter->user_htstream >> 8) & 0x0f;
/** check if support 2*2 */
/** check if support 2*2 */
if (rx_nss != 2 || tx_nss != 2)
return ret;
/** check if AP support AC 80P80 */
if (ISSUPP_11ACBW8080(pmpriv->usr_dot_11ac_dev_cap_a)
&& pvht_cap && ISSUPP_11ACBW8080(pvht_cap->vht_cap.vht_cap_info))
if (ISSUPP_11ACBW8080(pmpriv->usr_dot_11ac_dev_cap_a) && pvht_cap &&
ISSUPP_11ACBW8080(pvht_cap->vht_cap.vht_cap_info))
ret = MTRUE;
/** check if AP support AX 80P80 */
if (pbss_desc->phe_cap) {
pBsshecap = (IEEEtypes_HECap_t *) pbss_desc->phe_cap;
phecap = (MrvlIEtypes_He_cap_t *) pmpriv->user_he_cap;
if (ret && (phecap->he_phy_cap[0] & MBIT(4))
&& (pBsshecap->he_phy_cap[0] & MBIT(4)))
pBsshecap = (IEEEtypes_HECap_t *)pbss_desc->phe_cap;
phecap = (MrvlIEtypes_He_cap_t *)pmpriv->user_he_cap;
if (ret && (phecap->he_phy_cap[0] & MBIT(4)) &&
(pBsshecap->he_phy_cap[0] & MBIT(4)))
ret = MTRUE;
else
ret = MFALSE;
@ -1033,9 +1002,8 @@ wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
*
* @return bytes added to the buffer
*/
int
wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer)
int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer)
{
pmlan_adapter pmadapter = pmpriv->adapter;
MrvlIETypes_VHTCap_t *pvht_cap;
@ -1044,7 +1012,8 @@ wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u16 nss;
int ret_len = 0;
t_u8 bw_80p80 = MFALSE;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(USB9097) || defined(SD9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(USB9097) || defined(SD9097)
t_u16 rx_nss = 0;
#endif
@ -1062,8 +1031,8 @@ wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
/* VHT Capabilities IE */
if (pbss_desc->pvht_cap &&
wlan_get_nss_vht_mcs(pbss_desc->pvht_cap->vht_cap.mcs_sets.
rx_mcs_map)) {
wlan_get_nss_vht_mcs(
pbss_desc->pvht_cap->vht_cap.mcs_sets.rx_mcs_map)) {
pvht_cap = (MrvlIETypes_VHTCap_t *)*ppbuffer;
memset(pmadapter, pvht_cap, 0, sizeof(MrvlIETypes_VHTCap_t));
pvht_cap->header.type = wlan_cpu_to_le16(VHT_CAPABILITY);
@ -1071,8 +1040,8 @@ wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
memcpy_ext(pmadapter,
(t_u8 *)pvht_cap + sizeof(MrvlIEtypesHeader_t),
(t_u8 *)pbss_desc->pvht_cap +
sizeof(IEEEtypes_Header_t), pvht_cap->header.len,
sizeof(VHT_capa_t));
sizeof(IEEEtypes_Header_t),
pvht_cap->header.len, sizeof(VHT_capa_t));
bw_80p80 = wlan_is_80_80_support(pmpriv, pbss_desc);
wlan_fill_vht_cap_tlv(pmpriv, pvht_cap, pbss_desc->bss_band,
MTRUE, bw_80p80);
@ -1102,34 +1071,36 @@ wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
pmpriv->usr_dot_11ac_opermode_bw - 1;
if (pbss_desc->bss_band & BAND_G) {
if (!(IS_OPER_MODE_20M(pmrvl_oper_mode->oper_mode))) {
if (pbss_desc->pht_cap->ht_cap.
ht_cap_info & MBIT(1))
SET_OPER_MODE_40M(pmrvl_oper_mode->
oper_mode);
if (pbss_desc->pht_cap->ht_cap.ht_cap_info &
MBIT(1))
SET_OPER_MODE_40M(
pmrvl_oper_mode->oper_mode);
else
SET_OPER_MODE_20M(pmrvl_oper_mode->
oper_mode);
SET_OPER_MODE_20M(
pmrvl_oper_mode->oper_mode);
}
}
} else {
/** set default bandwidth:80M*/
/** set default bandwidth:80M*/
SET_OPER_MODE_80M(pmrvl_oper_mode->oper_mode);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (pbss_desc->bss_band & BAND_A)
rx_nss = GET_RXMCSSUPP(pmadapter->
user_htstream >> 8);
rx_nss = GET_RXMCSSUPP(
pmadapter->user_htstream >> 8);
else
rx_nss = GET_RXMCSSUPP(pmadapter->
user_htstream);
rx_nss =
GET_RXMCSSUPP(pmadapter->user_htstream);
}
#endif
mcs_map_user =
GET_DEVRXMCSMAP(pmpriv->usr_dot_11ac_mcs_support);
nss = wlan_get_nss_num_vht_mcs(mcs_map_user);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || defined(PCIE9097) || defined(SD9097) || defined(USB9097)
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
PRINTM(MCMND, "rx_nss=%d nss=%d\n", rx_nss, nss);
@ -1170,8 +1141,8 @@ wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
mlan_status
wlan_11ac_cfg_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
mlan_status wlan_11ac_cfg_ioctl(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_status status = MLAN_STATUS_SUCCESS;
mlan_ds_11ac_cfg *cfg = MNULL;
@ -1216,10 +1187,9 @@ wlan_11ac_cfg_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
* @param pdata_buf A pointer to data buffer
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_cmd_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf)
mlan_status wlan_cmd_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_11AC_CFG *vhtcfg = &cmd->params.vhtcfg;
@ -1230,7 +1200,7 @@ wlan_cmd_11ac_cfg(IN pmlan_private pmpriv,
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_11AC_CFG) + S_DS_GEN);
vhtcfg->action = wlan_cpu_to_le16(cmd_action);
vhtcfg->band_config = vht_cfg->band & 0xFF;
//block user enable 80MHZ
// block user enable 80MHZ
if (IS_FW_SUPPORT_NO_80MHZ(pmadapter))
vht_cfg->bwcfg = 0;
@ -1258,9 +1228,9 @@ wlan_cmd_11ac_cfg(IN pmlan_private pmpriv,
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_ret_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp, IN mlan_ioctl_req *pioctl_buf)
mlan_status wlan_ret_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
IN mlan_ioctl_req *pioctl_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
mlan_ds_11ac_cfg *cfg = MNULL;
@ -1291,33 +1261,29 @@ wlan_ret_11ac_cfg(IN pmlan_private pmpriv,
cfg->param.vht_cfg.vht_tx_mcs =
wlan_le32_to_cpu(cfg->param.vht_cfg.vht_tx_mcs);
cfg->param.vht_cfg.vht_rx_max_rate =
wlan_convert_mcsmap_to_maxrate(pmpriv,
cfg->param.vht_cfg.band,
cfg->param.vht_cfg.
vht_rx_mcs);
wlan_convert_mcsmap_to_maxrate(
pmpriv, cfg->param.vht_cfg.band,
cfg->param.vht_cfg.vht_rx_mcs);
cfg->param.vht_cfg.vht_tx_max_rate =
wlan_convert_mcsmap_to_maxrate(pmpriv,
cfg->param.vht_cfg.band,
cfg->param.vht_cfg.
vht_tx_mcs);
wlan_convert_mcsmap_to_maxrate(
pmpriv, cfg->param.vht_cfg.band,
cfg->param.vht_cfg.vht_tx_mcs);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
void
wlan_update_11ac_cap(mlan_private *pmpriv)
void wlan_update_11ac_cap(mlan_private *pmpriv)
{
mlan_adapter *pmadapter = pmpriv->adapter;
pmpriv->usr_dot_11ac_mcs_support = pmadapter->hw_dot_11ac_mcs_support;
pmpriv->usr_dot_11ac_dev_cap_bg =
pmadapter->
hw_dot_11ac_dev_cap & ~DEFALUT_11AC_CAP_BEAMFORMING_RESET_MASK;
pmadapter->hw_dot_11ac_dev_cap &
~DEFALUT_11AC_CAP_BEAMFORMING_RESET_MASK;
pmpriv->usr_dot_11ac_dev_cap_a =
pmadapter->
hw_dot_11ac_dev_cap & ~DEFALUT_11AC_CAP_BEAMFORMING_RESET_MASK;
pmadapter->hw_dot_11ac_dev_cap &
~DEFALUT_11AC_CAP_BEAMFORMING_RESET_MASK;
pmpriv->usr_dot_11ac_bw = BW_FOLLOW_VHTCAP;
}
@ -1329,8 +1295,7 @@ wlan_update_11ac_cap(mlan_private *pmpriv)
*
* @return 0--not allowed, other value allowed
*/
t_u8
wlan_11ac_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
t_u8 wlan_11ac_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
{
if (pmpriv->bss_mode == MLAN_BSS_MODE_IBSS) {
if (bss_band & BAND_G)

View File

@ -44,8 +44,8 @@ t_u8 wlan_11ac_bandconfig_allowed(mlan_private *pmpriv, t_u8 bss_band);
t_u8 wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc);
mlan_status wlan_cmd_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf);
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf);
mlan_status wlan_ret_11ac_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,

View File

@ -55,8 +55,7 @@
*
* @return N/A
*/
void
wlan_show_dot11axmaccap(pmlan_adapter pmadapter, t_u32 cap)
void wlan_show_dot11axmaccap(pmlan_adapter pmadapter, t_u32 cap)
{
ENTER();
@ -71,8 +70,7 @@ wlan_show_dot11axmaccap(pmlan_adapter pmadapter, t_u32 cap)
*
* @return MTRUE/MFALSE
*/
t_u8
wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc)
t_u8 wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc)
{
if (!pbss_desc->phe_cap)
return MFALSE;
@ -92,8 +90,8 @@ wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc)
*
* @return MTRUE/MFALSE
*/
t_u8
wlan_check_11ax_twt_supported(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
MrvlIEtypes_He_cap_t *phecap = MNULL;
MrvlIEtypes_He_cap_t *hw_he_cap = MNULL;
@ -101,19 +99,17 @@ wlan_check_11ax_twt_supported(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
if (!wlan_check_ap_11ax_twt_supported(pbss_desc))
return MFALSE;
if (pbss_desc->bss_band & BAND_A) {
hw_he_cap =
(MrvlIEtypes_He_cap_t *) & pmpriv->adapter->hw_he_cap;
phecap = (MrvlIEtypes_He_cap_t *) & pmpriv->user_he_cap;
hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap;
phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
} else {
hw_he_cap =
(MrvlIEtypes_He_cap_t *) & pmpriv->adapter->
hw_2g_he_cap;
phecap = (MrvlIEtypes_He_cap_t *) & pmpriv->user_2g_he_cap;
(MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_2g_he_cap;
phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_2g_he_cap;
}
if (!(hw_he_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT))
return MFALSE;
if (phecap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT) ;
return MTRUE;
if (phecap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT)
return MTRUE;
return MFALSE;
}
@ -125,8 +121,7 @@ wlan_check_11ax_twt_supported(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
*
* @return N/A
*/
void
wlan_show_dot11axphycap(pmlan_adapter pmadapter, t_u32 support)
void wlan_show_dot11axphycap(pmlan_adapter pmadapter, t_u32 support)
{
ENTER();
@ -145,9 +140,8 @@ wlan_show_dot11axphycap(pmlan_adapter pmadapter, t_u32 support)
*
* @return bytes added to the phe_cap
*/
t_u16
wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u8 band,
MrvlIEtypes_Extension_t * phe_cap, t_u8 flag)
t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u8 band,
MrvlIEtypes_Extension_t *phe_cap, t_u8 flag)
{
pmlan_adapter pmadapter = pmpriv->adapter;
t_u16 len = 0;
@ -183,9 +177,8 @@ wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u8 band,
*
* @return bytes added to the buffer
*/
int
wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer)
int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer)
{
pmlan_adapter pmadapter = pmpriv->adapter;
MrvlIEtypes_He_cap_t *phecap = MNULL;
@ -203,13 +196,13 @@ wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
LEAVE();
return 0;
}
/** check if AP support HE, if not return right away */
/** check if AP support HE, if not return right away */
if (!pbss_desc->phe_cap) {
LEAVE();
return 0;
}
bw_80p80 = wlan_is_80_80_support(pmpriv, pbss_desc);
phecap = (MrvlIEtypes_He_cap_t *) * ppbuffer;
phecap = (MrvlIEtypes_He_cap_t *)*ppbuffer;
if (pbss_desc->bss_band & BAND_A) {
memcpy_ext(pmadapter, *ppbuffer, pmpriv->user_he_cap,
pmpriv->user_hecap_len, pmpriv->user_hecap_len);
@ -257,11 +250,9 @@ wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
*
* @return N/A
*/
void
wlan_update_11ax_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t * hw_he_cap)
void wlan_update_11ax_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t *hw_he_cap)
{
MrvlIEtypes_He_cap_t *phe_cap = MNULL;
t_u8 i = 0;
t_u8 he_cap_2g = 0;
@ -273,9 +264,9 @@ wlan_update_11ax_cap(mlan_adapter *pmadapter,
LEAVE();
return;
}
phe_cap = (MrvlIEtypes_He_cap_t *) hw_he_cap;
if (phe_cap->
he_phy_cap[0] & (AX_2G_40MHZ_SUPPORT | AX_2G_20MHZ_SUPPORT)) {
phe_cap = (MrvlIEtypes_He_cap_t *)hw_he_cap;
if (phe_cap->he_phy_cap[0] &
(AX_2G_40MHZ_SUPPORT | AX_2G_20MHZ_SUPPORT)) {
pmadapter->hw_2g_hecap_len =
hw_he_cap->len + sizeof(MrvlIEtypesHeader_t);
memcpy_ext(pmadapter, pmadapter->hw_2g_he_cap,
@ -311,17 +302,17 @@ wlan_update_11ax_cap(mlan_adapter *pmadapter,
pmadapter->priv[i]->user_2g_he_cap,
pmadapter->hw_2g_he_cap,
pmadapter->hw_2g_hecap_len,
sizeof(pmadapter->priv[i]->
user_2g_he_cap));
sizeof(pmadapter->priv[i]
->user_2g_he_cap));
} else {
pmadapter->priv[i]->user_hecap_len =
pmadapter->hw_hecap_len;
memcpy_ext(pmadapter,
pmadapter->priv[i]->user_he_cap,
pmadapter->hw_he_cap,
pmadapter->hw_hecap_len,
sizeof(pmadapter->priv[i]->
user_he_cap));
memcpy_ext(
pmadapter,
pmadapter->priv[i]->user_he_cap,
pmadapter->hw_he_cap,
pmadapter->hw_hecap_len,
sizeof(pmadapter->priv[i]->user_he_cap));
}
}
}
@ -337,10 +328,8 @@ wlan_update_11ax_cap(mlan_adapter *pmadapter,
*
* @return 0--not allowed, other value allowed
*/
t_u16
wlan_11ax_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
t_u16 wlan_11ax_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
{
if (!IS_FW_SUPPORT_11AX(pmpriv->adapter))
return MFALSE;
if (pmpriv->bss_mode == MLAN_BSS_MODE_IBSS) {
@ -365,8 +354,8 @@ wlan_11ax_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band)
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
static mlan_status
wlan_11ax_ioctl_hecfg(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
static mlan_status wlan_11ax_ioctl_hecfg(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];
@ -384,7 +373,7 @@ wlan_11ax_ioctl_hecfg(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
return MLAN_STATUS_RESOURCE;
}
cfg = (mlan_ds_11ax_cfg *) pioctl_req->pbuf;
cfg = (mlan_ds_11ax_cfg *)pioctl_req->pbuf;
if ((cfg->param.he_cfg.band & MBIT(0)) &&
!(pmadapter->fw_bands & BAND_GAX)) {
@ -402,10 +391,7 @@ wlan_11ax_ioctl_hecfg(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_11AX_CFG,
cmd_action,
0,
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_11AX_CFG, cmd_action, 0,
(t_void *)pioctl_req,
(t_void *)&cfg->param.he_cfg);
if (ret == MLAN_STATUS_SUCCESS)
@ -423,15 +409,15 @@ wlan_11ax_ioctl_hecfg(IN pmlan_adapter pmadapter, IN pmlan_ioctl_req pioctl_req)
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
mlan_status
wlan_11ax_cfg_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
mlan_status wlan_11ax_cfg_ioctl(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_status status = MLAN_STATUS_SUCCESS;
mlan_ds_11ax_cfg *cfg = MNULL;
ENTER();
cfg = (mlan_ds_11ax_cfg *) pioctl_req->pbuf;
cfg = (mlan_ds_11ax_cfg *)pioctl_req->pbuf;
switch (cfg->sub_command) {
case MLAN_OID_11AX_HE_CFG:
status = wlan_11ax_ioctl_hecfg(pmadapter, pioctl_req);
@ -439,6 +425,9 @@ wlan_11ax_cfg_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
case MLAN_OID_11AX_CMD_CFG:
status = wlan_11ax_ioctl_cmd(pmadapter, pioctl_req);
break;
case MLAN_OID_11AX_TWT_CFG:
status = wlan_11ax_ioctl_twtcfg(pmadapter, pioctl_req);
break;
default:
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
status = MLAN_STATUS_FAILURE;
@ -457,14 +446,13 @@ wlan_11ax_cfg_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
* @param pdata_buf A pointer to data buffer
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf)
mlan_status wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_11AX_CFG *axcfg = &cmd->params.axcfg;
mlan_ds_11ax_he_cfg *hecfg = (mlan_ds_11ax_he_cfg *) pdata_buf;
mlan_ds_11ax_he_cfg *hecfg = (mlan_ds_11ax_he_cfg *)pdata_buf;
MrvlIEtypes_Extension_t *tlv = MNULL;
t_u8 *pos = MNULL;
@ -476,13 +464,13 @@ wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
axcfg->band_config = hecfg->band & 0xFF;
pos = (t_u8 *)axcfg->val;
/**HE Capability */
/**HE Capability */
if (hecfg->he_cap.len && (hecfg->he_cap.ext_id == HE_CAPABILITY)) {
tlv = (MrvlIEtypes_Extension_t *) pos;
tlv = (MrvlIEtypes_Extension_t *)pos;
tlv->type = wlan_cpu_to_le16(hecfg->he_cap.id);
tlv->len = wlan_cpu_to_le16(hecfg->he_cap.len);
memcpy_ext(pmadapter, &tlv->ext_id,
&hecfg->he_cap.ext_id, hecfg->he_cap.len,
memcpy_ext(pmadapter, &tlv->ext_id, &hecfg->he_cap.ext_id,
hecfg->he_cap.len,
MRVDRV_SIZE_OF_CMD_BUFFER - cmd->size);
cmd->size += hecfg->he_cap.len + sizeof(MrvlIEtypesHeader_t);
pos += hecfg->he_cap.len + sizeof(MrvlIEtypesHeader_t);
@ -493,7 +481,6 @@ wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handles the command response of 11axcfg
*
@ -503,9 +490,9 @@ wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp, IN mlan_ioctl_req *pioctl_buf)
mlan_status wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
IN mlan_ioctl_req *pioctl_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
mlan_ds_11ax_cfg *cfg = MNULL;
@ -519,13 +506,13 @@ wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
if (pioctl_buf == MNULL)
goto done;
cfg = (mlan_ds_11ax_cfg *) pioctl_buf->pbuf;
cfg = (mlan_ds_11ax_cfg *)pioctl_buf->pbuf;
cfg->param.he_cfg.band = axcfg->band_config;
hecap = (mlan_ds_11ax_he_capa *) & cfg->param.he_cfg.he_cap;
hecap = (mlan_ds_11ax_he_capa *)&cfg->param.he_cfg.he_cap;
/* TLV parse */
left_len = resp->size - sizeof(HostCmd_DS_11AX_CFG) - S_DS_GEN;
tlv = (MrvlIEtypes_Extension_t *) axcfg->val;
tlv = (MrvlIEtypes_Extension_t *)axcfg->val;
pmpriv->user_hecap_len = 0;
while (left_len > sizeof(MrvlIEtypesHeader_t)) {
@ -539,34 +526,33 @@ wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
memcpy_ext(pmadapter, (t_u8 *)&hecap->ext_id,
(t_u8 *)&tlv->ext_id, tlv_len,
sizeof(mlan_ds_11ax_he_capa) -
sizeof(MrvlIEtypesHeader_t));
sizeof(MrvlIEtypesHeader_t));
if (cfg->param.he_cfg.band & MBIT(1)) {
memcpy_ext(pmadapter,
(t_u8 *)&pmpriv->user_he_cap,
(t_u8 *)tlv,
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->user_he_cap));
pmpriv->user_hecap_len =
MIN(tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->
user_he_cap));
memcpy_ext(
pmadapter,
(t_u8 *)&pmpriv->user_he_cap,
(t_u8 *)tlv,
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->user_he_cap));
pmpriv->user_hecap_len = MIN(
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->user_he_cap));
PRINTM(MCMND, "user_hecap_len=%d\n",
pmpriv->user_hecap_len);
} else {
memcpy_ext(pmadapter,
(t_u8 *)&pmpriv->
user_2g_he_cap, (t_u8 *)tlv,
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->
user_2g_he_cap));
pmpriv->user_2g_hecap_len =
MIN(tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->
user_2g_he_cap));
memcpy_ext(
pmadapter,
(t_u8 *)&pmpriv->user_2g_he_cap,
(t_u8 *)tlv,
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->user_2g_he_cap));
pmpriv->user_2g_hecap_len = MIN(
tlv_len +
sizeof(MrvlIEtypesHeader_t),
sizeof(pmpriv->user_2g_he_cap));
PRINTM(MCMND, "user_2g_hecap_len=%d\n",
pmpriv->user_2g_hecap_len);
}
@ -577,8 +563,8 @@ wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
}
left_len -= (sizeof(MrvlIEtypesHeader_t) + tlv_len);
tlv = (MrvlIEtypes_Extension_t *) ((t_u8 *)tlv + tlv_len +
sizeof(MrvlIEtypesHeader_t));
tlv = (MrvlIEtypes_Extension_t *)((t_u8 *)tlv + tlv_len +
sizeof(MrvlIEtypesHeader_t));
}
done:
@ -594,8 +580,8 @@ done:
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
mlan_status
wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
mlan_status wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_status status = MLAN_STATUS_SUCCESS;
mlan_ds_11ax_cmd_cfg *cfg = MNULL;
@ -612,7 +598,7 @@ wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
LEAVE();
return MLAN_STATUS_RESOURCE;
}
cfg = (mlan_ds_11ax_cmd_cfg *) pioctl_req->pbuf;
cfg = (mlan_ds_11ax_cmd_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
@ -620,10 +606,8 @@ wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
status = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_11AX_CMD,
cmd_action,
0, (t_void *)pioctl_req, (t_void *)cfg);
status = wlan_prepare_cmd(pmpriv, HostCmd_CMD_11AX_CMD, cmd_action, 0,
(t_void *)pioctl_req, (t_void *)cfg);
if (status == MLAN_STATUS_SUCCESS)
status = MLAN_STATUS_PENDING;
@ -640,20 +624,25 @@ wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
* @param pdata_buf A pointer to data buffer
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf)
mlan_status wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_11AX_CMD_CFG *axcmd = &cmd->params.axcmd;
mlan_ds_11ax_cmd_cfg *ds_11ax_cmd = (mlan_ds_11ax_cmd_cfg *) pdata_buf;
mlan_ds_11ax_cmd_cfg *ds_11ax_cmd = (mlan_ds_11ax_cmd_cfg *)pdata_buf;
mlan_ds_11ax_sr_cmd *sr_cmd =
(mlan_ds_11ax_sr_cmd *) & ds_11ax_cmd->param;
(mlan_ds_11ax_sr_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_beam_cmd *beam_cmd =
(mlan_ds_11ax_beam_cmd *) & ds_11ax_cmd->param;
(mlan_ds_11ax_beam_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_htc_cmd *htc_cmd =
(mlan_ds_11ax_htc_cmd *) & ds_11ax_cmd->param;
(mlan_ds_11ax_htc_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_txop_cmd *txop_cmd =
(mlan_ds_11ax_txop_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_txomi_cmd *txomi_cmd =
(mlan_ds_11ax_txomi_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_toltime_cmd *toltime_cmd =
(mlan_ds_11ax_toltime_cmd *)&ds_11ax_cmd->param;
MrvlIEtypes_Data_t *tlv = MNULL;
ENTER();
@ -670,7 +659,7 @@ wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
memcpy_ext(pmadapter, tlv->data,
&sr_cmd->param.obss_pd_offset.offset, sr_cmd->len,
sr_cmd->len);
cmd->size += +sizeof(MrvlIEtypesHeader_t) + sr_cmd->len;
cmd->size += sizeof(MrvlIEtypesHeader_t) + sr_cmd->len;
break;
case MLAN_11AXCMD_BEAM_SUBID:
axcmd->val[0] = beam_cmd->value;
@ -680,6 +669,21 @@ wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
axcmd->val[0] = htc_cmd->value;
cmd->size += sizeof(t_u8);
break;
case MLAN_11AXCMD_TXOPRTS_SUBID:
memcpy_ext(pmadapter, axcmd->val, &txop_cmd->rts_thres,
sizeof(t_u16), sizeof(t_u16));
cmd->size += sizeof(t_u16);
break;
case MLAN_11AXCMD_TXOMI_SUBID:
memcpy_ext(pmadapter, axcmd->val, &txomi_cmd->omi,
sizeof(t_u16), sizeof(t_u16));
cmd->size += sizeof(t_u16);
break;
case MLAN_11AXCMD_OBSS_TOLTIME_SUBID:
memcpy_ext(pmadapter, axcmd->val, &toltime_cmd->tol_time,
sizeof(t_u32), sizeof(t_u32));
cmd->size += sizeof(t_u32);
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", ds_11ax_cmd->sub_id);
break;
@ -700,9 +704,9 @@ wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp, IN mlan_ioctl_req *pioctl_buf)
mlan_status wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
IN mlan_ioctl_req *pioctl_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
mlan_ds_11ax_cmd_cfg *cfg = MNULL;
@ -716,7 +720,7 @@ wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
if (pioctl_buf == MNULL)
goto done;
cfg = (mlan_ds_11ax_cmd_cfg *) pioctl_buf->pbuf;
cfg = (mlan_ds_11ax_cmd_cfg *)pioctl_buf->pbuf;
cfg->sub_id = wlan_le16_to_cpu(axcmd->sub_id);
switch (axcmd->sub_id) {
@ -724,18 +728,19 @@ wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
/* TLV parse */
left_len =
resp->size - sizeof(HostCmd_DS_11AX_CMD_CFG) - S_DS_GEN;
//tlv = (MrvlIEtypes_Extension_t *)axcfg->val;
// tlv = (MrvlIEtypes_Extension_t *)axcfg->val;
tlv = (MrvlIEtypes_Data_t *)axcmd->val;
while (left_len > sizeof(MrvlIEtypesHeader_t)) {
tlv_type = wlan_le16_to_cpu(tlv->header.type);
tlv_len = wlan_le16_to_cpu(tlv->header.len);
memcpy_ext(pmadapter,
cfg->param.sr_cfg.param.obss_pd_offset.
offset, tlv->data, tlv_len, tlv_len);
memcpy_ext(
pmadapter,
cfg->param.sr_cfg.param.obss_pd_offset.offset,
tlv->data, tlv_len, tlv_len);
left_len -= (sizeof(MrvlIEtypesHeader_t) + tlv_len);
tlv = (MrvlIEtypes_Data_t *)((t_u8 *)tlv + tlv_len +
sizeof
(MrvlIEtypesHeader_t));
tlv = (MrvlIEtypes_Data_t
*)((t_u8 *)tlv + tlv_len +
sizeof(MrvlIEtypesHeader_t));
}
break;
case MLAN_11AXCMD_BEAM_SUBID:
@ -744,6 +749,18 @@ wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
case MLAN_11AXCMD_HTC_SUBID:
cfg->param.htc_cfg.value = *axcmd->val;
break;
case MLAN_11AXCMD_TXOPRTS_SUBID:
memcpy_ext(pmadapter, &cfg->param.txop_cfg.rts_thres,
axcmd->val, sizeof(t_u16), sizeof(t_u16));
break;
case MLAN_11AXCMD_TXOMI_SUBID:
memcpy_ext(pmadapter, &cfg->param.txomi_cfg.omi, axcmd->val,
sizeof(t_u16), sizeof(t_u16));
break;
case MLAN_11AXCMD_OBSS_TOLTIME_SUBID:
memcpy_ext(pmadapter, &cfg->param.toltime_cfg.tol_time,
axcmd->val, sizeof(t_u32), sizeof(t_u32));
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", axcmd->sub_id);
break;
@ -753,3 +770,129 @@ done:
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares TWT cfg command to configure
* setup/teardown
*
* @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 Status returned
*/
mlan_status wlan_cmd_twt_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf)
{
pmlan_adapter pmadapter = pmpriv->adapter;
HostCmd_DS_TWT_CFG *hostcmd_twtcfg =
(HostCmd_DS_TWT_CFG *)&cmd->params.twtcfg;
mlan_ds_twtcfg *ds_twtcfg = (mlan_ds_twtcfg *)pdata_buf;
hostcmd_twt_setup *twt_setup_params = MNULL;
hostcmd_twt_teardown *twt_teardown_params = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_TWT_CFG);
hostcmd_twtcfg->action = wlan_cpu_to_le16(cmd_action);
hostcmd_twtcfg->sub_id = wlan_cpu_to_le16(ds_twtcfg->sub_id);
cmd->size = S_DS_GEN + sizeof(hostcmd_twtcfg->action) +
sizeof(hostcmd_twtcfg->sub_id);
switch (hostcmd_twtcfg->sub_id) {
case MLAN_11AX_TWT_SETUP_SUBID:
twt_setup_params = &hostcmd_twtcfg->param.twt_setup;
memset(pmadapter, twt_setup_params, 0x00,
sizeof(hostcmd_twtcfg->param.twt_setup));
twt_setup_params->implicit =
ds_twtcfg->param.twt_setup.implicit;
twt_setup_params->announced =
ds_twtcfg->param.twt_setup.announced;
twt_setup_params->trigger_enabled =
ds_twtcfg->param.twt_setup.trigger_enabled;
twt_setup_params->twt_info_disabled =
ds_twtcfg->param.twt_setup.twt_info_disabled;
twt_setup_params->negotiation_type =
ds_twtcfg->param.twt_setup.negotiation_type;
twt_setup_params->twt_wakeup_duration =
ds_twtcfg->param.twt_setup.twt_wakeup_duration;
twt_setup_params->flow_identifier =
ds_twtcfg->param.twt_setup.flow_identifier;
twt_setup_params->hard_constraint =
ds_twtcfg->param.twt_setup.hard_constraint;
twt_setup_params->twt_exponent =
ds_twtcfg->param.twt_setup.twt_exponent;
twt_setup_params->twt_mantissa = wlan_cpu_to_le16(
ds_twtcfg->param.twt_setup.twt_mantissa);
cmd->size += sizeof(hostcmd_twtcfg->param.twt_setup);
break;
case MLAN_11AX_TWT_TEARDOWN_SUBID:
twt_teardown_params = &hostcmd_twtcfg->param.twt_teardown;
memset(pmadapter, twt_teardown_params, 0x00,
sizeof(hostcmd_twtcfg->param.twt_teardown));
twt_teardown_params->flow_identifier =
ds_twtcfg->param.twt_teardown.flow_identifier;
twt_teardown_params->negotiation_type =
ds_twtcfg->param.twt_teardown.negotiation_type;
twt_teardown_params->teardown_all_twt =
ds_twtcfg->param.twt_teardown.teardown_all_twt;
cmd->size += sizeof(hostcmd_twtcfg->param.twt_teardown);
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", ds_twtcfg->sub_id);
ret = MLAN_STATUS_FAILURE;
break;
}
cmd->size = wlan_cpu_to_le16(cmd->size);
LEAVE();
return ret;
}
/**
* @brief TWT config command handler
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
mlan_status wlan_11ax_ioctl_twtcfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_ds_twtcfg *cfg = MNULL;
t_u16 cmd_action = 0;
ENTER();
if (pioctl_req->buf_len < sizeof(mlan_ds_twtcfg)) {
PRINTM(MERROR, "MLAN bss IOCTL length is too short.\n");
pioctl_req->data_read_written = 0;
pioctl_req->buf_len_needed = sizeof(mlan_ds_twtcfg);
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
LEAVE();
return MLAN_STATUS_RESOURCE;
}
cfg = (mlan_ds_twtcfg *)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_TWT_CFG, cmd_action, 0,
(t_void *)pioctl_req, (t_void *)cfg);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}

View File

@ -24,16 +24,21 @@
#define _MLAN_11AX_H_
/** device support 2.4G 40MHZ*/
#define AX_2G_40MHZ_SUPPORT MBIT(1)
#define AX_2G_40MHZ_SUPPORT MBIT(1)
/** device support 2.4G 242 tone RUs */
#define AX_2G_20MHZ_SUPPORT MBIT(5)
#define AX_2G_20MHZ_SUPPORT MBIT(5)
t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc);
mlan_status wlan_11ax_ioctl_twtcfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_twt_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf);
t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u8 band,
MrvlIEtypes_Extension_t * phe_cap, t_u8 flag);
MrvlIEtypes_Extension_t *phe_cap, t_u8 flag);
void wlan_update_11ax_cap(mlan_adapter *pmadapter,
MrvlIEtypes_Extension_t * hw_he_cap);
MrvlIEtypes_Extension_t *hw_he_cap);
int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u8 **ppbuffer);
t_u16 wlan_11ax_bandconfig_allowed(mlan_private *pmpriv, t_u16 bss_band);
@ -43,14 +48,14 @@ mlan_status wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf);
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf);
mlan_status wlan_ret_11ax_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
IN mlan_ioctl_req *pioctl_buf);
mlan_status wlan_cmd_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf);
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf);
mlan_status wlan_ret_11ax_cmd(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
IN mlan_ioctl_req *pioctl_buf);

View File

@ -38,92 +38,69 @@ Change log:
#ifdef STA_SUPPORT
/** Region code mapping */
typedef struct _region_code_mapping {
/** Region */
/** Region */
t_u8 region[COUNTRY_CODE_LEN];
/** Code */
/** Code */
t_u8 code;
} region_code_mapping_t;
/** Region code mapping table */
static region_code_mapping_t region_code_mapping[] = {
{"US ", 0x10}, /* US FCC */
{"CA ", 0x20}, /* IC Canada */
{"SG ", 0x10}, /* Singapore */
{"EU ", 0x30}, /* ETSI */
{"AU ", 0x30}, /* Australia */
{"KR ", 0x30}, /* Republic Of Korea */
{"FR ", 0x32}, /* France */
{"JP ", 0x40}, /* Japan */
{"JP ", 0x41}, /* Japan */
{"CN ", 0x50}, /* China */
{"JP ", 0xFE}, /* Japan */
{"JP ", 0xFF}, /* Japan special */
{"US ", 0x10}, /* US FCC */
{"CA ", 0x20}, /* IC Canada */
{"SG ", 0x10}, /* Singapore */
{"EU ", 0x30}, /* ETSI */
{"AU ", 0x30}, /* Australia */
{"KR ", 0x30}, /* Republic Of Korea */
{"FR ", 0x32}, /* France */
{"JP ", 0x40}, /* Japan */
{"JP ", 0x41}, /* Japan */
{"CN ", 0x50}, /* China */
{"JP ", 0xFE}, /* Japan */
{"JP ", 0xFF}, /* Japan special */
};
/** Universal region code */
#define UNIVERSAL_REGION_CODE 0xff
#define UNIVERSAL_REGION_CODE 0xff
#endif
/** Default Tx power */
#define TX_PWR_DEFAULT 10
#define TX_PWR_DEFAULT 10
/* Following two structures define the supported channels */
/** Channels for 802.11b/g */
static chan_freq_power_t channel_freq_power_UN_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
{4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT},
{6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT},
{8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT},
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT},
{12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT},
{14, 2484, TX_PWR_DEFAULT}
};
{1, 2412, TX_PWR_DEFAULT}, {2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT}, {4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT}, {6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT}, {8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT}, {10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT}, {12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT}, {14, 2484, TX_PWR_DEFAULT}};
/** Channels for 802.11a/j */
static chan_freq_power_t channel_freq_power_UN_AJ[] = {
{8, 5040, TX_PWR_DEFAULT},
{12, 5060, TX_PWR_DEFAULT},
{16, 5080, TX_PWR_DEFAULT},
{34, 5170, TX_PWR_DEFAULT},
{38, 5190, TX_PWR_DEFAULT},
{42, 5210, TX_PWR_DEFAULT},
{46, 5230, TX_PWR_DEFAULT},
{36, 5180, TX_PWR_DEFAULT},
{40, 5200, TX_PWR_DEFAULT},
{44, 5220, TX_PWR_DEFAULT},
{48, 5240, TX_PWR_DEFAULT},
{52, 5260, TX_PWR_DEFAULT},
{56, 5280, TX_PWR_DEFAULT},
{60, 5300, TX_PWR_DEFAULT},
{64, 5320, TX_PWR_DEFAULT},
{100, 5500, TX_PWR_DEFAULT},
{104, 5520, TX_PWR_DEFAULT},
{108, 5540, TX_PWR_DEFAULT},
{112, 5560, TX_PWR_DEFAULT},
{116, 5580, TX_PWR_DEFAULT},
{120, 5600, TX_PWR_DEFAULT},
{124, 5620, TX_PWR_DEFAULT},
{128, 5640, TX_PWR_DEFAULT},
{132, 5660, TX_PWR_DEFAULT},
{136, 5680, TX_PWR_DEFAULT},
{140, 5700, TX_PWR_DEFAULT},
{149, 5745, TX_PWR_DEFAULT},
{153, 5765, TX_PWR_DEFAULT},
{157, 5785, TX_PWR_DEFAULT},
{161, 5805, TX_PWR_DEFAULT},
{8, 5040, TX_PWR_DEFAULT}, {12, 5060, TX_PWR_DEFAULT},
{16, 5080, TX_PWR_DEFAULT}, {34, 5170, TX_PWR_DEFAULT},
{38, 5190, TX_PWR_DEFAULT}, {42, 5210, TX_PWR_DEFAULT},
{46, 5230, TX_PWR_DEFAULT}, {36, 5180, TX_PWR_DEFAULT},
{40, 5200, TX_PWR_DEFAULT}, {44, 5220, TX_PWR_DEFAULT},
{48, 5240, TX_PWR_DEFAULT}, {52, 5260, TX_PWR_DEFAULT},
{56, 5280, TX_PWR_DEFAULT}, {60, 5300, TX_PWR_DEFAULT},
{64, 5320, TX_PWR_DEFAULT}, {100, 5500, TX_PWR_DEFAULT},
{104, 5520, TX_PWR_DEFAULT}, {108, 5540, TX_PWR_DEFAULT},
{112, 5560, TX_PWR_DEFAULT}, {116, 5580, TX_PWR_DEFAULT},
{120, 5600, TX_PWR_DEFAULT}, {124, 5620, TX_PWR_DEFAULT},
{128, 5640, TX_PWR_DEFAULT}, {132, 5660, TX_PWR_DEFAULT},
{136, 5680, TX_PWR_DEFAULT}, {140, 5700, TX_PWR_DEFAULT},
{149, 5745, TX_PWR_DEFAULT}, {153, 5765, TX_PWR_DEFAULT},
{157, 5785, TX_PWR_DEFAULT}, {161, 5805, TX_PWR_DEFAULT},
{165, 5825, TX_PWR_DEFAULT},
/* {240, 4920, TX_PWR_DEFAULT},
{244, 4940, TX_PWR_DEFAULT},
{248, 4960, TX_PWR_DEFAULT},
{252, 4980, TX_PWR_DEFAULT},
channels for 11J JP 10M channel gap */
/* {240, 4920, TX_PWR_DEFAULT},
{244, 4940, TX_PWR_DEFAULT},
{248, 4960, TX_PWR_DEFAULT},
{252, 4980, TX_PWR_DEFAULT},
channels for 11J JP 10M channel gap */
};
/********************************************************
@ -142,8 +119,7 @@ channels for 11J JP 10M channel gap */
*
* @return Region string
*/
static t_u8 *
wlan_11d_code_2_region(pmlan_adapter pmadapter, t_u8 code)
static t_u8 *wlan_11d_code_2_region(pmlan_adapter pmadapter, t_u8 code)
{
t_u8 i;
@ -172,10 +148,9 @@ wlan_11d_code_2_region(pmlan_adapter pmadapter, t_u8 code)
*
* @return MTRUE or MFALSE
*/
static t_u8
wlan_11d_channel_known(pmlan_adapter pmadapter,
t_u8 band,
t_u8 chan, parsed_region_chan_11d_t *parsed_region_chan)
static t_u8 wlan_11d_channel_known(pmlan_adapter pmadapter, t_u8 band,
t_u8 chan,
parsed_region_chan_11d_t *parsed_region_chan)
{
chan_power_11d_t *pchan_pwr = parsed_region_chan->chan_pwr;
t_u8 no_of_chan = parsed_region_chan->no_of_chan;
@ -196,12 +171,12 @@ wlan_11d_channel_known(pmlan_adapter pmadapter,
ret = MTRUE;
if (band & BAND_A) {
/* If chan is a DFS channel, we need to see an AP on it */
/* If chan is a DFS channel, we need to see an
* AP on it */
pmpriv = wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_STA);
if (pmpriv &&
wlan_11h_radar_detect_required(pmpriv,
chan)) {
if (pmpriv && wlan_11h_radar_detect_required(
pmpriv, chan)) {
PRINTM(MINFO,
"11H: DFS channel %d, and ap_seen=%d\n",
chan, pchan_pwr[i].ap_seen);
@ -229,11 +204,9 @@ wlan_11d_channel_known(pmlan_adapter pmadapter,
*
* @return N/A
*/
static t_void
wlan_11d_generate_parsed_region_chan(pmlan_adapter pmadapter,
region_chan_t *region_chan,
parsed_region_chan_11d_t
*parsed_region_chan)
static t_void wlan_11d_generate_parsed_region_chan(
pmlan_adapter pmadapter, region_chan_t *region_chan,
parsed_region_chan_11d_t *parsed_region_chan)
{
chan_freq_power_t *cfp;
t_u8 i;
@ -350,7 +323,7 @@ wlan_11d_generate_domain_info(pmlan_adapter pmadapter,
domain_info->no_of_sub_band);
HEXDUMP("11D: domain_info", (t_u8 *)domain_info,
COUNTRY_CODE_LEN + 1 +
sizeof(IEEEtypes_SubbandSet_t) * no_of_sub_band);
sizeof(IEEEtypes_SubbandSet_t) * no_of_sub_band);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
@ -364,8 +337,8 @@ wlan_11d_generate_domain_info(pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
wlan_11d_update_chan_pwr_table(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
static mlan_status wlan_11d_update_chan_pwr_table(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
mlan_adapter *pmadapter = pmpriv->adapter;
parsed_region_chan_11d_t *parsed_region_chan =
@ -388,16 +361,16 @@ wlan_11d_update_chan_pwr_table(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
/* Check whether the channel already exists in channel power table of
parsed region */
for (i = 0; ((i < parsed_region_chan->no_of_chan) &&
(i < MAX_NO_OF_CHAN)); i++) {
if (parsed_region_chan->chan_pwr[i].chan == chan
&& parsed_region_chan->chan_pwr[i].band ==
pbss_desc->bss_band) {
for (i = 0;
((i < parsed_region_chan->no_of_chan) && (i < MAX_NO_OF_CHAN));
i++) {
if (parsed_region_chan->chan_pwr[i].chan == chan &&
parsed_region_chan->chan_pwr[i].band ==
pbss_desc->bss_band) {
/* Channel already exists, use minimum of existing and
tx_power */
parsed_region_chan->chan_pwr[i].pwr =
MIN(parsed_region_chan->chan_pwr[i].pwr,
tx_power);
parsed_region_chan->chan_pwr[i].pwr = MIN(
parsed_region_chan->chan_pwr[i].pwr, tx_power);
parsed_region_chan->chan_pwr[i].ap_seen = MTRUE;
break;
}
@ -429,9 +402,8 @@ wlan_11d_update_chan_pwr_table(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
*
* @return MTRUE or MFALSE
*/
static t_u8
wlan_11d_get_chan(pmlan_adapter pmadapter, t_u8 band, t_u8 first_chan,
t_u8 no_of_chan, t_u8 *chan)
static t_u8 wlan_11d_get_chan(pmlan_adapter pmadapter, t_u8 band,
t_u8 first_chan, t_u8 no_of_chan, t_u8 *chan)
{
chan_freq_power_t *cfp = MNULL;
t_u8 i;
@ -479,8 +451,8 @@ wlan_11d_get_chan(pmlan_adapter pmadapter, t_u8 band, t_u8 first_chan,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
wlan_11d_process_country_info(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
static mlan_status wlan_11d_process_country_info(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
mlan_adapter *pmadapter = pmpriv->adapter;
parsed_region_chan_11d_t region_chan;
@ -507,18 +479,20 @@ wlan_11d_process_country_info(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
*/
for (i = 0; (i < region_chan.no_of_chan && i < MAX_NO_OF_CHAN);
i++) {
for (j = 0;
(j < parsed_region_chan->no_of_chan &&
j < MAX_NO_OF_CHAN); j++) {
for (j = 0; (j < parsed_region_chan->no_of_chan &&
j < MAX_NO_OF_CHAN);
j++) {
/*
* Channel already exists, update the tx power
* with new tx power, since country IE is valid
* here.
*/
if (region_chan.chan_pwr[i].chan ==
parsed_region_chan->chan_pwr[j].chan &&
parsed_region_chan->chan_pwr[j]
.chan &&
region_chan.chan_pwr[i].band ==
parsed_region_chan->chan_pwr[j].band) {
parsed_region_chan->chan_pwr[j]
.band) {
parsed_region_chan->chan_pwr[j].pwr =
region_chan.chan_pwr[i].pwr;
break;
@ -532,34 +506,33 @@ wlan_11d_process_country_info(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
* table, update this new chan and tx_power
* to the channel power table
*/
parsed_region_chan->
chan_pwr[parsed_region_chan->
no_of_chan +
num_chan_added].chan =
region_chan.chan_pwr[i].chan;
parsed_region_chan->
chan_pwr[parsed_region_chan->
no_of_chan +
num_chan_added].band =
region_chan.chan_pwr[i].band;
parsed_region_chan->
chan_pwr[parsed_region_chan->
no_of_chan +
num_chan_added].pwr =
region_chan.chan_pwr[i].pwr;
parsed_region_chan->
chan_pwr[parsed_region_chan->
no_of_chan +
num_chan_added].ap_seen =
MFALSE;
parsed_region_chan
->chan_pwr[parsed_region_chan
->no_of_chan +
num_chan_added]
.chan = region_chan.chan_pwr[i].chan;
parsed_region_chan
->chan_pwr[parsed_region_chan
->no_of_chan +
num_chan_added]
.band = region_chan.chan_pwr[i].band;
parsed_region_chan
->chan_pwr[parsed_region_chan
->no_of_chan +
num_chan_added]
.pwr = region_chan.chan_pwr[i].pwr;
parsed_region_chan
->chan_pwr[parsed_region_chan
->no_of_chan +
num_chan_added]
.ap_seen = MFALSE;
num_chan_added++;
}
}
parsed_region_chan->no_of_chan += num_chan_added;
} else {
/* Parsed region is empty, copy the first one */
memcpy_ext(pmadapter, parsed_region_chan,
&region_chan,
memcpy_ext(pmadapter, parsed_region_chan, &region_chan,
sizeof(parsed_region_chan_11d_t),
sizeof(parsed_region_chan_11d_t));
}
@ -576,8 +549,8 @@ wlan_11d_process_country_info(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
*
* @return N/A
*/
static t_void
wlan_11d_copy_chan_power(chan_power_11d_t *chan_dst, chan_power_11d_t *chan_src)
static t_void wlan_11d_copy_chan_power(chan_power_11d_t *chan_dst,
chan_power_11d_t *chan_src)
{
ENTER();
@ -636,18 +609,17 @@ wlan_11d_sort_parsed_region_chan(parsed_region_chan_11d_t *parsed_region_chan)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
wlan_11d_send_domain_info(mlan_private *pmpriv, t_void *pioctl_buf)
static mlan_status wlan_11d_send_domain_info(mlan_private *pmpriv,
t_void *pioctl_buf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
/* Send cmd to FW to set domain info */
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_802_11D_DOMAIN_INFO,
HostCmd_ACT_GEN_SET,
0, (t_void *)pioctl_buf, MNULL);
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11D_DOMAIN_INFO,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_buf,
MNULL);
if (ret)
PRINTM(MERROR, "11D: Failed to download domain Info\n");
@ -667,10 +639,8 @@ wlan_11d_send_domain_info(mlan_private *pmpriv, t_void *pioctl_buf)
* @return MLAN_STATUS_SUCCESS
*/
static mlan_status
wlan_11d_set_domain_info(mlan_private *pmpriv,
t_u8 band,
t_u8 country_code[COUNTRY_CODE_LEN],
t_u8 num_sub_band,
wlan_11d_set_domain_info(mlan_private *pmpriv, t_u8 band,
t_u8 country_code[COUNTRY_CODE_LEN], t_u8 num_sub_band,
IEEEtypes_SubbandSet_t *sub_band_list)
{
mlan_adapter *pmadapter = pmpriv->adapter;
@ -703,8 +673,7 @@ wlan_11d_set_domain_info(mlan_private *pmpriv,
*
* @return MTRUE or MFALSE
*/
t_bool
wlan_is_station(mlan_private *pmpriv)
t_bool wlan_is_station(mlan_private *pmpriv)
{
ENTER();
LEAVE();
@ -718,14 +687,14 @@ wlan_is_station(mlan_private *pmpriv)
*
* @return MTRUE or MFALSE
*/
t_bool
wlan_11d_is_enabled(mlan_private *pmpriv)
t_bool wlan_11d_is_enabled(mlan_private *pmpriv)
{
ENTER();
LEAVE();
return (pmpriv->state_11d.enable_11d == ENABLE_11D &&
pmpriv->state_11d.user_enable_11d ==
ENABLE_11D) ? MTRUE : MFALSE;
pmpriv->state_11d.user_enable_11d == ENABLE_11D) ?
MTRUE :
MFALSE;
}
/**
@ -735,8 +704,7 @@ wlan_11d_is_enabled(mlan_private *pmpriv)
*
* @return MTRUE or MFALSE
*/
t_bool
wlan_fw_11d_is_enabled(mlan_private *pmpriv)
t_bool wlan_fw_11d_is_enabled(mlan_private *pmpriv)
{
ENTER();
LEAVE();
@ -750,8 +718,7 @@ wlan_fw_11d_is_enabled(mlan_private *pmpriv)
*
* @return N/A
*/
t_void
wlan_11d_priv_init(mlan_private *pmpriv)
t_void wlan_11d_priv_init(mlan_private *pmpriv)
{
wlan_802_11d_state_t *state = &pmpriv->state_11d;
@ -762,9 +729,10 @@ wlan_11d_priv_init(mlan_private *pmpriv)
if (!pmpriv->adapter->init_para.cfg_11d)
state->user_enable_11d = DEFAULT_11D_STATE;
else
state->user_enable_11d =
(pmpriv->adapter->init_para.cfg_11d ==
MLAN_INIT_PARA_DISABLED) ? DISABLE_11D : ENABLE_11D;
state->user_enable_11d = (pmpriv->adapter->init_para.cfg_11d ==
MLAN_INIT_PARA_DISABLED) ?
DISABLE_11D :
ENABLE_11D;
LEAVE();
return;
@ -777,8 +745,7 @@ wlan_11d_priv_init(mlan_private *pmpriv)
*
* @return N/A
*/
t_void
wlan_11d_init(mlan_adapter *pmadapter)
t_void wlan_11d_init(mlan_adapter *pmadapter)
{
ENTER();
@ -804,8 +771,8 @@ wlan_11d_init(mlan_adapter *pmadapter)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_enable(mlan_private *pmpriv, t_void *pioctl_buf, state_11d_t flag)
mlan_status wlan_11d_enable(mlan_private *pmpriv, t_void *pioctl_buf,
state_11d_t flag)
{
#ifdef STA_SUPPORT
mlan_adapter *pmadapter = pmpriv->adapter;
@ -816,10 +783,9 @@ wlan_11d_enable(mlan_private *pmpriv, t_void *pioctl_buf, state_11d_t flag)
ENTER();
/* Send cmd to FW to enable/disable 11D function */
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET,
Dot11D_i, (t_void *)pioctl_buf, &enable);
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET, Dot11D_i,
(t_void *)pioctl_buf, &enable);
if (ret) {
PRINTM(MERROR, "11D: Failed to %s 11D\n",
@ -847,9 +813,9 @@ wlan_11d_enable(mlan_private *pmpriv, t_void *pioctl_buf, state_11d_t flag)
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd, t_u16 cmd_action)
mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd,
t_u16 cmd_action)
{
mlan_adapter *pmadapter = pmpriv->adapter;
HostCmd_DS_802_11D_DOMAIN_INFO *pdomain_info =
@ -875,9 +841,8 @@ wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
pdomain_info->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_GET) {
/* Dump domain info */
pcmd->size =
wlan_cpu_to_le16(sizeof(pdomain_info->action) +
S_DS_GEN);
pcmd->size = wlan_cpu_to_le16(sizeof(pdomain_info->action) +
S_DS_GEN);
HEXDUMP("11D: 802_11D_DOMAIN_INFO", (t_u8 *)pcmd,
wlan_le16_to_cpu(pcmd->size));
LEAVE();
@ -899,16 +864,14 @@ wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
pmadapter->domain_reg.sub_band,
no_of_sub_band * sizeof(IEEEtypes_SubbandSet_t),
MRVDRV_MAX_SUBBAND_802_11D *
sizeof(IEEEtypes_SubbandSet_t));
sizeof(IEEEtypes_SubbandSet_t));
pcmd->size = wlan_cpu_to_le16(sizeof(pdomain_info->action) +
domain->header.len +
sizeof(MrvlIEtypesHeader_t) +
S_DS_GEN);
pcmd->size = wlan_cpu_to_le16(
sizeof(pdomain_info->action) + domain->header.len +
sizeof(MrvlIEtypesHeader_t) + S_DS_GEN);
} else {
pcmd->size =
wlan_cpu_to_le16(sizeof(pdomain_info->action) +
S_DS_GEN);
pcmd->size = wlan_cpu_to_le16(sizeof(pdomain_info->action) +
S_DS_GEN);
}
domain->header.len = wlan_cpu_to_le16(domain->header.len);
@ -927,8 +890,8 @@ wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_ret_802_11d_domain_info(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp)
mlan_status wlan_ret_802_11d_domain_info(mlan_private *pmpriv,
HostCmd_DS_COMMAND *resp)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
HostCmd_DS_802_11D_DOMAIN_INFO_RSP *domain_info =
@ -942,9 +905,9 @@ wlan_ret_802_11d_domain_info(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp)
/* Dump domain info response data */
HEXDUMP("11D: DOMAIN Info Rsp Data", (t_u8 *)resp, resp->size);
no_of_sub_band =
(t_u8)((wlan_le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN)
/ sizeof(IEEEtypes_SubbandSet_t));
no_of_sub_band = (t_u8)(
(wlan_le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
sizeof(IEEEtypes_SubbandSet_t));
PRINTM(MINFO, "11D Domain Info Resp: number of sub-band=%d\n",
no_of_sub_band);
@ -957,7 +920,7 @@ wlan_ret_802_11d_domain_info(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp)
}
switch (action) {
case HostCmd_ACT_GEN_SET: /* Proc Set Action */
case HostCmd_ACT_GEN_SET: /* Proc Set Action */
break;
case HostCmd_ACT_GEN_GET:
break;
@ -980,8 +943,7 @@ wlan_ret_802_11d_domain_info(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp)
*
* @return Channel frequency
*/
t_u32
wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u8 band)
t_u32 wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u8 band)
{
chan_freq_power_t *cf;
t_u16 cnt;
@ -1020,11 +982,9 @@ wlan_11d_chan_2_freq(pmlan_adapter pmadapter, t_u8 chan, t_u8 band)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_parse_domain_info(pmlan_adapter pmadapter,
IEEEtypes_CountryInfoFullSet_t *country_info,
t_u8 band,
parsed_region_chan_11d_t *parsed_region_chan)
mlan_status wlan_11d_parse_domain_info(
pmlan_adapter pmadapter, IEEEtypes_CountryInfoFullSet_t *country_info,
t_u8 band, parsed_region_chan_11d_t *parsed_region_chan)
{
t_u8 no_of_sub_band, no_of_chan;
t_u8 last_chan, first_chan, cur_chan = 0;
@ -1054,12 +1014,12 @@ wlan_11d_parse_domain_info(pmlan_adapter pmadapter,
}
no_of_sub_band = (country_info->len - COUNTRY_CODE_LEN) /
sizeof(IEEEtypes_SubbandSet_t);
sizeof(IEEEtypes_SubbandSet_t);
for (j = 0, last_chan = 0; j < no_of_sub_band; j++) {
if (country_info->sub_band[j].first_chan <= last_chan) {
/* Step2&3: Check First Chan Num increment and no overlap */
/* Step2&3: Check First Chan Num increment and no
* overlap */
PRINTM(MINFO, "11D: Chan[%d>%d] Overlap\n",
country_info->sub_band[j].first_chan, last_chan);
continue;
@ -1070,9 +1030,8 @@ wlan_11d_parse_domain_info(pmlan_adapter pmadapter,
for (i = 0; idx < MAX_NO_OF_CHAN && i < no_of_chan; i++) {
/* Step 4 : Channel is supported? */
if (wlan_11d_get_chan
(pmadapter, band, first_chan, i,
&cur_chan) == MFALSE) {
if (wlan_11d_get_chan(pmadapter, band, first_chan, i,
&cur_chan) == MFALSE) {
/* Chan is not found in UN table */
PRINTM(MWARN,
"11D: channel is not supported: %d\n",
@ -1113,8 +1072,7 @@ wlan_11d_parse_domain_info(pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_11d_set_universaltable(mlan_private *pmpriv, t_u8 band)
mlan_status wlan_11d_set_universaltable(mlan_private *pmpriv, t_u8 band)
{
mlan_adapter *pmadapter = pmpriv->adapter;
t_u16 i = 0;
@ -1125,7 +1083,7 @@ wlan_11d_set_universaltable(mlan_private *pmpriv, t_u8 band)
sizeof(pmadapter->universal_channel));
if (band & (BAND_B | BAND_G | BAND_GN))
/* If band B, G or N */
/* If band B, G or N */
{
/* Set channel-frequency-power */
pmadapter->universal_channel[i].num_cfp =
@ -1184,10 +1142,8 @@ wlan_11d_set_universaltable(mlan_private *pmpriv, t_u8 band)
* @return PASSIVE if chan is unknown; ACTIVE
* if chan is known
*/
t_u8
wlan_11d_get_scan_type(pmlan_adapter pmadapter,
t_u8 band,
t_u8 chan, parsed_region_chan_11d_t *parsed_region_chan)
t_u8 wlan_11d_get_scan_type(pmlan_adapter pmadapter, t_u8 band, t_u8 chan,
parsed_region_chan_11d_t *parsed_region_chan)
{
t_u8 scan_type = MLAN_SCAN_TYPE_PASSIVE;
@ -1212,8 +1168,7 @@ wlan_11d_get_scan_type(pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_clear_parsedtable(mlan_private *pmpriv)
mlan_status wlan_11d_clear_parsedtable(mlan_private *pmpriv)
{
mlan_adapter *pmadapter = pmpriv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -1239,8 +1194,7 @@ wlan_11d_clear_parsedtable(mlan_private *pmpriv)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_create_dnld_countryinfo(mlan_private *pmpriv, t_u8 band)
mlan_status wlan_11d_create_dnld_countryinfo(mlan_private *pmpriv, t_u8 band)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
@ -1252,7 +1206,6 @@ wlan_11d_create_dnld_countryinfo(mlan_private *pmpriv, t_u8 band)
/* Only valid if 11D is enabled */
if (wlan_11d_is_enabled(pmpriv)) {
PRINTM(MINFO, "11D: Band[%d]\n", band);
/* Update parsed_region_chan; download domain info to FW */
@ -1338,9 +1291,8 @@ wlan_11d_create_dnld_countryinfo(mlan_private *pmpriv, t_u8 band)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_parse_dnld_countryinfo(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
mlan_status wlan_11d_parse_dnld_countryinfo(mlan_private *pmpriv,
BSSDescriptor_t *pbss_desc)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
@ -1352,7 +1304,6 @@ wlan_11d_parse_dnld_countryinfo(mlan_private *pmpriv,
/* Only valid if 11D is enabled */
if (wlan_11d_is_enabled(pmpriv)) {
memset(pmadapter, &region_chan, 0,
sizeof(parsed_region_chan_11d_t));
memset(pmadapter, &bssdesc_region_chan, 0,
@ -1365,44 +1316,46 @@ wlan_11d_parse_dnld_countryinfo(mlan_private *pmpriv,
if (pbss_desc) {
/* Parse domain info if available */
ret = wlan_11d_parse_domain_info(pmadapter,
&pbss_desc->
country_info,
(t_u8)pbss_desc->
bss_band,
&bssdesc_region_chan);
ret = wlan_11d_parse_domain_info(
pmadapter, &pbss_desc->country_info,
(t_u8)pbss_desc->bss_band,
&bssdesc_region_chan);
if (ret == MLAN_STATUS_SUCCESS) {
/* Update the channel-power table */
for (i = 0;
((i < bssdesc_region_chan.no_of_chan)
&& (i < MAX_NO_OF_CHAN)); i++) {
((i < bssdesc_region_chan.no_of_chan) &&
(i < MAX_NO_OF_CHAN));
i++) {
for (j = 0;
((j < region_chan.no_of_chan)
&& (j < MAX_NO_OF_CHAN)); j++) {
((j < region_chan.no_of_chan) &&
(j < MAX_NO_OF_CHAN));
j++) {
/*
* Channel already exists, use minimum
* of existing tx power and tx_power
* received from country info of the
* current AP
* Channel already exists, use
* minimum of existing tx power
* and tx_power received from
* country info of the current
* AP
*/
if (region_chan.chan_pwr[i].
chan ==
bssdesc_region_chan.
chan_pwr[j].chan &&
region_chan.chan_pwr[i].
band ==
bssdesc_region_chan.
chan_pwr[j].band) {
region_chan.chan_pwr[j].
pwr =
MIN(region_chan.
chan_pwr[j].
pwr,
bssdesc_region_chan.
chan_pwr[i].
pwr);
if (region_chan.chan_pwr[i]
.chan ==
bssdesc_region_chan
.chan_pwr[j]
.chan &&
region_chan.chan_pwr[i]
.band ==
bssdesc_region_chan
.chan_pwr[j]
.band) {
region_chan.chan_pwr[j]
.pwr = MIN(
region_chan
.chan_pwr[j]
.pwr,
bssdesc_region_chan
.chan_pwr[i]
.pwr);
break;
}
}
@ -1433,8 +1386,7 @@ wlan_11d_parse_dnld_countryinfo(mlan_private *pmpriv,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_prepare_dnld_domain_info_cmd(mlan_private *pmpriv)
mlan_status wlan_11d_prepare_dnld_domain_info_cmd(mlan_private *pmpriv)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
@ -1449,30 +1401,26 @@ wlan_11d_prepare_dnld_domain_info_cmd(mlan_private *pmpriv)
pcountry_full =
&pmadapter->pscan_table[idx].country_info;
ret = wlan_11d_update_chan_pwr_table(pmpriv,
&pmadapter->
pscan_table[idx]);
ret = wlan_11d_update_chan_pwr_table(
pmpriv, &pmadapter->pscan_table[idx]);
if (*(pcountry_full->country_code) != 0 &&
(pcountry_full->len > COUNTRY_CODE_LEN)) {
/* Country info found in the BSS Descriptor */
ret = wlan_11d_process_country_info(pmpriv,
&pmadapter->
pscan_table
[idx]);
ret = wlan_11d_process_country_info(
pmpriv, &pmadapter->pscan_table[idx]);
}
}
/* Sort parsed_region_chan in ascending channel number */
wlan_11d_sort_parsed_region_chan(&pmadapter->
parsed_region_chan);
wlan_11d_sort_parsed_region_chan(
&pmadapter->parsed_region_chan);
/* Check if connected */
if (pmpriv->media_connected == MTRUE) {
ret = wlan_11d_parse_dnld_countryinfo(pmpriv,
&pmpriv->
curr_bss_params.
bss_descriptor);
ret = wlan_11d_parse_dnld_countryinfo(
pmpriv,
&pmpriv->curr_bss_params.bss_descriptor);
} else {
ret = wlan_11d_parse_dnld_countryinfo(pmpriv, MNULL);
}
@ -1491,12 +1439,12 @@ wlan_11d_prepare_dnld_domain_info_cmd(mlan_private *pmpriv)
*
* @return Pointer to the mapped country code string
*/
static t_u8 *
wlan_11d_map_country_code(IN pmlan_adapter pmadapter, IN t_u8 *pcountry_code)
static t_u8 *wlan_11d_map_country_code(IN pmlan_adapter pmadapter,
IN t_u8 *pcountry_code)
{
/* Since firmware can only recognize EU as ETSI domain and there is no memory left
* for some devices to convert it in firmware, driver need to convert it before
* passing country code to firmware through tlv
/* Since firmware can only recognize EU as ETSI domain and there is no
* memory left for some devices to convert it in firmware, driver need
* to convert it before passing country code to firmware through tlv
*/
if (wlan_is_etsi_country(pmadapter, pcountry_code))
@ -1513,9 +1461,8 @@ wlan_11d_map_country_code(IN pmlan_adapter pmadapter, IN t_u8 *pcountry_code)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_cfg_domain_info(IN pmlan_adapter pmadapter,
IN mlan_ioctl_req *pioctl_req)
mlan_status wlan_11d_cfg_domain_info(IN pmlan_adapter pmadapter,
IN mlan_ioctl_req *pioctl_req)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
@ -1539,22 +1486,19 @@ wlan_11d_cfg_domain_info(IN pmlan_adapter pmadapter,
memcpy_ext(pmadapter, pmadapter->country_code,
domain_info->country_code, COUNTRY_CODE_LEN,
COUNTRY_CODE_LEN);
wlan_11d_set_domain_info(pmpriv, domain_info->band,
wlan_11d_map_country_code(pmadapter,
domain_info->
country_code),
domain_info->no_of_sub_band,
(IEEEtypes_SubbandSet_t *)domain_info->
sub_band);
wlan_11d_set_domain_info(
pmpriv, domain_info->band,
wlan_11d_map_country_code(pmadapter, domain_info->country_code),
domain_info->no_of_sub_band,
(IEEEtypes_SubbandSet_t *)domain_info->sub_band);
ret = wlan_11d_send_domain_info(pmpriv, pioctl_req);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
/* Update region code and table based on country code */
if (wlan_misc_country_2_cfp_table_code(pmadapter,
domain_info->country_code,
&cfp_bg, &cfp_a)) {
if (wlan_misc_country_2_cfp_table_code(
pmadapter, domain_info->country_code, &cfp_bg, &cfp_a)) {
PRINTM(MIOCTL, "Country code %c%c not found!\n",
domain_info->country_code[0],
domain_info->country_code[1]);
@ -1569,8 +1513,8 @@ wlan_11d_cfg_domain_info(IN pmlan_adapter pmadapter,
else
pmadapter->region_code = 0;
if (wlan_set_regiontable(pmpriv, pmadapter->region_code,
pmadapter->config_bands | pmadapter->
adhoc_start_band)) {
pmadapter->config_bands |
pmadapter->adhoc_start_band)) {
PRINTM(MIOCTL, "Fail to set regiontabl\n");
goto done;
}
@ -1591,9 +1535,9 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_11d_handle_uap_domain_info(mlan_private *pmpriv,
t_u8 band, t_u8 *domain_tlv, t_void *pioctl_buf)
mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u8 band,
t_u8 *domain_tlv,
t_void *pioctl_buf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
@ -1606,10 +1550,9 @@ wlan_11d_handle_uap_domain_info(mlan_private *pmpriv,
pdomain_tlv = (MrvlIEtypes_DomainParamSet_t *)domain_tlv;
/* update region code & table based on country string */
if (wlan_misc_country_2_cfp_table_code(pmadapter,
pdomain_tlv->country_code,
&cfp_bg,
&cfp_a) == MLAN_STATUS_SUCCESS) {
if (wlan_misc_country_2_cfp_table_code(
pmadapter, pdomain_tlv->country_code, &cfp_bg, &cfp_a) ==
MLAN_STATUS_SUCCESS) {
pmadapter->cfp_code_bg = cfp_bg;
pmadapter->cfp_code_a = cfp_a;
if (cfp_a)
@ -1619,8 +1562,8 @@ wlan_11d_handle_uap_domain_info(mlan_private *pmpriv,
else
pmadapter->region_code = 0;
if (wlan_set_regiontable(pmpriv, pmadapter->region_code,
pmadapter->config_bands | pmadapter->
adhoc_start_band)) {
pmadapter->config_bands |
pmadapter->adhoc_start_band)) {
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -1629,9 +1572,8 @@ wlan_11d_handle_uap_domain_info(mlan_private *pmpriv,
memcpy_ext(pmadapter, pmadapter->country_code,
pdomain_tlv->country_code, COUNTRY_CODE_LEN,
COUNTRY_CODE_LEN);
num_sub_band =
((pdomain_tlv->header.len -
COUNTRY_CODE_LEN) / sizeof(IEEEtypes_SubbandSet_t));
num_sub_band = ((pdomain_tlv->header.len - COUNTRY_CODE_LEN) /
sizeof(IEEEtypes_SubbandSet_t));
/* TODO: don't just clobber pmadapter->domain_reg.
* Add some checking or merging between STA & UAP domain_info

File diff suppressed because it is too large Load Diff

View File

@ -30,17 +30,17 @@ Change Log:
#define _MLAN_11H_
/** 11H OID bitmasks */
#define ENABLE_11H_MASK MBIT(0)
#define MASTER_RADAR_DET_MASK MBIT(1)
#define SLAVE_RADAR_DET_MASK MBIT(2)
#define ENABLE_11H_MASK MBIT(0)
#define MASTER_RADAR_DET_MASK MBIT(1)
#define SLAVE_RADAR_DET_MASK MBIT(2)
/** DFS Master Radar Detect global enable */
#define DFS_MASTER_RADAR_DETECT_EN (MTRUE)
#define DFS_MASTER_RADAR_DETECT_EN (MTRUE)
/** DFS Slave Radar Detect global enable */
#define DFS_SLAVE_RADAR_DETECT_EN (MFALSE)
#define DFS_SLAVE_RADAR_DETECT_EN (MFALSE)
#define CHANNEL_OFFSET_MASK 0x30
#define CHANNEL_BANDWIDTH_MASK 0x0C
#define CHANNEL_OFFSET_MASK 0x30
#define CHANNEL_BANDWIDTH_MASK 0x0C
/**
* 11H APIs
@ -104,17 +104,14 @@ extern t_s32 wlan_11h_issue_radar_detect(mlan_private *priv,
extern mlan_status wlan_11h_check_chan_report(mlan_private *priv, t_u8 chan);
/** Add any 11h TLVs necessary to complete an adhoc start command */
extern t_s32 wlan_11h_process_start(mlan_private *priv,
t_u8 **ppbuffer,
extern t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer,
IEEEtypes_CapInfo_t *pcap_info,
t_u32 channel,
wlan_11h_bss_info_t *p11h_bss_info);
/** Add any 11h TLVs necessary to complete a join command (adhoc or infra) */
extern t_s32 wlan_11h_process_join(mlan_private *priv,
t_u8 **ppbuffer,
IEEEtypes_CapInfo_t *pcap_info,
t_u8 band,
extern t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
IEEEtypes_CapInfo_t *pcap_info, t_u8 band,
t_u32 channel,
wlan_11h_bss_info_t *p11h_bss_info);
@ -148,17 +145,19 @@ mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv,
/** Handler for DFS_TESTING IOCTL */
extern mlan_status wlan_11h_ioctl_dfs_testing(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status wlan_11h_ioctl_get_channel_nop_info(pmlan_adapter pmadapter,
pmlan_ioctl_req
pioctl_req);
extern mlan_status
wlan_11h_ioctl_get_channel_nop_info(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status
wlan_11h_ioctl_dfs_cancel_chan_report(mlan_private *priv,
pmlan_ioctl_req pioctl_req);
extern
mlan_status wlan_11h_ioctl_chan_switch_count(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status wlan_11h_ioctl_chan_switch_count(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/** get/set dfs w53 cfg */
mlan_status wlan_11h_ioctl_dfs_w53_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/** Check if channel is under a NOP duration (should not be used) */
extern t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter,
@ -172,11 +171,13 @@ extern mlan_status wlan_11h_radar_detected_callback(t_void *priv);
/** set dfs check channel */
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan);
#ifdef UAP_SUPPORT
/** BW_change event Handler for dfs_repeater */
void wlan_dfs_rep_bw_change(mlan_adapter *pmadapter);
/** disconnect event Handler for dfs_repeater */
void wlan_dfs_rep_disconnect(mlan_adapter *pmadapter);
#endif
/** Handler for RADAR_DETECTED */
extern mlan_status wlan_11h_radar_detected_handling(mlan_adapter *pmadapter,

File diff suppressed because it is too large Load Diff

View File

@ -63,8 +63,8 @@ mlan_status wlan_ret_reject_addba_req(IN pmlan_private pmpriv,
IN mlan_ioctl_req *pioctl_buf);
/** Prepare TX BF configuration command */
mlan_status wlan_cmd_tx_bf_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *cmd,
IN t_u16 cmd_action, IN t_void *pdata_buf);
IN HostCmd_DS_COMMAND *cmd, IN t_u16 cmd_action,
IN t_void *pdata_buf);
/** Handle the command response TX BF configuration */
mlan_status wlan_ret_tx_bf_cfg(IN pmlan_private pmpriv,
IN HostCmd_DS_COMMAND *resp,
@ -118,16 +118,15 @@ mlan_status wlan_ret_amsdu_aggr_ctrl(pmlan_private pmpriv,
mlan_ioctl_req *pioctl_buf);
void wlan_set_tx_pause_flag(mlan_private *priv, t_u8 flag);
/** reconfigure tx buf size */
mlan_status wlan_cmd_recfg_tx_buf(mlan_private *priv,
HostCmd_DS_COMMAND *cmd,
mlan_status wlan_cmd_recfg_tx_buf(mlan_private *priv, HostCmd_DS_COMMAND *cmd,
int cmd_action, void *pdata_buf);
/** AMSDU aggr control cmd */
mlan_status wlan_cmd_amsdu_aggr_ctrl(mlan_private *priv,
HostCmd_DS_COMMAND *cmd,
int cmd_action, void *pdata_buf);
HostCmd_DS_COMMAND *cmd, int cmd_action,
void *pdata_buf);
t_u8 wlan_validate_chan_offset(IN mlan_private *pmpriv,
IN t_u16 band, IN t_u32 chan, IN t_u8 chan_bw);
t_u8 wlan_validate_chan_offset(IN mlan_private *pmpriv, IN t_u16 band,
IN t_u32 chan, IN t_u8 chan_bw);
/** get channel offset */
t_u8 wlan_get_second_channel_offset(int chan);
@ -142,8 +141,7 @@ void wlan_11n_cleanup_txbastream_tbl(mlan_private *priv, t_u8 *ra);
* @param mac station mac address
* @return MTRUE or MFALSE
*/
static INLINE t_u8
is_station_11n_enabled(mlan_private *priv, t_u8 *mac)
static INLINE t_u8 is_station_11n_enabled(mlan_private *priv, t_u8 *mac)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, mac);
@ -159,8 +157,7 @@ is_station_11n_enabled(mlan_private *priv, t_u8 *mac)
* @param mac station mac address
* @return max amsdu size statio supported
*/
static INLINE t_u16
get_station_max_amsdu_size(mlan_private *priv, t_u8 *mac)
static INLINE t_u16 get_station_max_amsdu_size(mlan_private *priv, t_u8 *mac)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, mac);
@ -177,8 +174,8 @@ get_station_max_amsdu_size(mlan_private *priv, t_u8 *mac)
* @param tid TID value for ptr
* @return MTRUE or MFALSE
*/
static INLINE t_u8
is_station_ampdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
static INLINE t_u8 is_station_ampdu_allowed(mlan_private *priv, raListTbl *ptr,
int tid)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, ptr->ra);
@ -188,8 +185,9 @@ is_station_ampdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
!sta_ptr->wapi_key_on)
return MFALSE;
}
return (sta_ptr->ampdu_sta[tid] != BA_STREAM_NOT_ALLOWED)
? MTRUE : MFALSE;
return (sta_ptr->ampdu_sta[tid] != BA_STREAM_NOT_ALLOWED) ?
MTRUE :
MFALSE;
}
return MFALSE;
}
@ -202,8 +200,7 @@ is_station_ampdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
* @param ra station mac address
* @return N/A
*/
static INLINE void
disable_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
static INLINE void disable_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, ra);
@ -220,8 +217,7 @@ disable_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
* @param ra station mac address
* @return N/A
*/
static INLINE void
reset_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
static INLINE void reset_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, ra);
@ -240,10 +236,9 @@ reset_station_ampdu(mlan_private *priv, t_u8 tid, t_u8 *ra)
*
* @return MTRUE or MFALSE
*/
static INLINE t_u8
wlan_is_ampdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
static INLINE t_u8 wlan_is_ampdu_allowed(mlan_private *priv, raListTbl *ptr,
int tid)
{
if ((!priv->is_data_rate_auto) && IS_BG_RATE)
return MFALSE;
#ifdef UAP_SUPPORT
@ -252,14 +247,15 @@ wlan_is_ampdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
#endif /* UAP_SUPPORT */
if (priv->sec_info.wapi_enabled && !priv->sec_info.wapi_key_on)
return MFALSE;
return (priv->aggr_prio_tbl[tid].ampdu_ap != BA_STREAM_NOT_ALLOWED)
? MTRUE : MFALSE;
return (priv->aggr_prio_tbl[tid].ampdu_ap != BA_STREAM_NOT_ALLOWED) ?
MTRUE :
MFALSE;
}
#define BA_RSSI_HIGH_THRESHOLD -70
#define BA_RSSI_HIGH_THRESHOLD -70
static INLINE void
wlan_update_station_del_ba_count(mlan_private *priv, raListTbl *ptr)
static INLINE void wlan_update_station_del_ba_count(mlan_private *priv,
raListTbl *ptr)
{
sta_node *sta_ptr = MNULL;
t_s8 rssi;
@ -272,8 +268,7 @@ wlan_update_station_del_ba_count(mlan_private *priv, raListTbl *ptr)
return;
}
static INLINE void
wlan_update_del_ba_count(mlan_private *priv, raListTbl *ptr)
static INLINE void wlan_update_del_ba_count(mlan_private *priv, raListTbl *ptr)
{
t_s8 rssi;
#ifdef UAP_802_11N
@ -296,8 +291,8 @@ wlan_update_del_ba_count(mlan_private *priv, raListTbl *ptr)
*
* @return MTRUE or MFALSE
*/
static INLINE t_u8
wlan_is_amsdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
static INLINE t_u8 wlan_is_amsdu_allowed(mlan_private *priv, raListTbl *ptr,
int tid)
{
#ifdef UAP_SUPPORT
sta_node *sta_ptr = MNULL;
@ -315,11 +310,12 @@ wlan_is_amsdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
}
#endif /* UAP_SUPPORT */
#define TXRATE_BITMAP_INDEX_MCS0_7 2
return ((priv->aggr_prio_tbl[tid].amsdu != BA_STREAM_NOT_ALLOWED)
&&((priv->is_data_rate_auto)
||
!(((priv->bitmap_rates[TXRATE_BITMAP_INDEX_MCS0_7]) & 0x03)
|| IS_BG_RATE))) ? MTRUE : MFALSE;
return ((priv->aggr_prio_tbl[tid].amsdu != BA_STREAM_NOT_ALLOWED) &&
((priv->is_data_rate_auto) ||
!(((priv->bitmap_rates[TXRATE_BITMAP_INDEX_MCS0_7]) & 0x03) ||
IS_BG_RATE))) ?
MTRUE :
MFALSE;
}
/**
@ -329,8 +325,7 @@ wlan_is_amsdu_allowed(mlan_private *priv, raListTbl *ptr, int tid)
*
* @return MTRUE or MFALSE
*/
static INLINE t_u8
wlan_is_bastream_avail(mlan_private *priv)
static INLINE t_u8 wlan_is_bastream_avail(mlan_private *priv)
{
mlan_private *pmpriv = MNULL;
t_u8 i = 0;
@ -339,9 +334,8 @@ wlan_is_bastream_avail(mlan_private *priv)
for (i = 0; i < priv->adapter->priv_num; i++) {
pmpriv = priv->adapter->priv[i];
if (pmpriv)
bastream_num +=
wlan_wmm_list_len((pmlan_list_head)&pmpriv->
tx_ba_stream_tbl_ptr);
bastream_num += wlan_wmm_list_len(
(pmlan_list_head)&pmpriv->tx_ba_stream_tbl_ptr);
}
bastream_max = ISSUPP_GETTXBASTREAM(priv->adapter->hw_dot_11n_dev_cap);
if (bastream_max == 0)
@ -360,9 +354,9 @@ wlan_is_bastream_avail(mlan_private *priv)
*
* @return MTRUE or MFALSE
*/
static INLINE t_u8
wlan_find_stream_to_delete(mlan_private *priv,
raListTbl *ptr, int ptr_tid, int *ptid, t_u8 *ra)
static INLINE t_u8 wlan_find_stream_to_delete(mlan_private *priv,
raListTbl *ptr, int ptr_tid,
int *ptid, t_u8 *ra)
{
int tid;
t_u8 ret = MFALSE;
@ -403,8 +397,7 @@ wlan_find_stream_to_delete(mlan_private *priv,
*
* @return MTRUE or MFALSE
*/
static INLINE int
wlan_is_11n_enabled(mlan_private *priv, t_u8 *ra)
static INLINE int wlan_is_11n_enabled(mlan_private *priv, t_u8 *ra)
{
int ret = MFALSE;
ENTER();

View File

@ -56,37 +56,33 @@ Change log:
*
* @return Final packet size
*/
static int
wlan_11n_form_amsdu_pkt(pmlan_adapter pmadapter, t_u8 *amsdu_buf, t_u8 *data,
int pkt_len, int *pad)
static int wlan_11n_form_amsdu_pkt(pmlan_adapter pmadapter, t_u8 *amsdu_buf,
t_u8 *data, int pkt_len, int *pad)
{
int dt_offset, amsdu_buf_offset;
Rfc1042Hdr_t snap = {
0xaa, /* LLC DSAP */
0xaa, /* LLC SSAP */
0x03, /* LLC CTRL */
{0x00, 0x00, 0x00}, /* SNAP OUI */
0x0000 /* SNAP type */
/*
* This field will be overwritten
* later with ethertype
*/
0xaa, /* LLC DSAP */
0xaa, /* LLC SSAP */
0x03, /* LLC CTRL */
{0x00, 0x00, 0x00}, /* SNAP OUI */
0x0000 /* SNAP type */
/*
* This field will be overwritten
* later with ethertype
*/
};
ENTER();
memcpy_ext(pmadapter, amsdu_buf, data, (MLAN_MAC_ADDR_LENGTH) * 2,
(MLAN_MAC_ADDR_LENGTH) * 2);
dt_offset = amsdu_buf_offset = (MLAN_MAC_ADDR_LENGTH) * 2;
memcpy_ext(pmadapter, amsdu_buf, data, (MLAN_MAC_ADDR_LENGTH)*2,
(MLAN_MAC_ADDR_LENGTH)*2);
dt_offset = amsdu_buf_offset = (MLAN_MAC_ADDR_LENGTH)*2;
snap.snap_type = *(t_u16 *)(data + dt_offset);
dt_offset += sizeof(t_u16);
*(t_u16 *)(amsdu_buf + amsdu_buf_offset) = mlan_htons(pkt_len +
LLC_SNAP_LEN -
((2 *
MLAN_MAC_ADDR_LENGTH)
+
sizeof(t_u16)));
*(t_u16 *)(amsdu_buf + amsdu_buf_offset) =
mlan_htons(pkt_len + LLC_SNAP_LEN -
((2 * MLAN_MAC_ADDR_LENGTH) + sizeof(t_u16)));
amsdu_buf_offset += sizeof(t_u16);
memcpy_ext(pmadapter, amsdu_buf + amsdu_buf_offset, &snap, LLC_SNAP_LEN,
LLC_SNAP_LEN);
@ -94,9 +90,9 @@ wlan_11n_form_amsdu_pkt(pmlan_adapter pmadapter, t_u8 *amsdu_buf, t_u8 *data,
memcpy_ext(pmadapter, amsdu_buf + amsdu_buf_offset, data + dt_offset,
pkt_len - dt_offset, pkt_len - dt_offset);
*pad = (((pkt_len + LLC_SNAP_LEN) & 3)) ? (4 -
(((pkt_len +
LLC_SNAP_LEN)) & 3)) : 0;
*pad = (((pkt_len + LLC_SNAP_LEN) & 3)) ?
(4 - (((pkt_len + LLC_SNAP_LEN)) & 3)) :
0;
LEAVE();
return pkt_len + LLC_SNAP_LEN + *pad;
@ -110,8 +106,7 @@ wlan_11n_form_amsdu_pkt(pmlan_adapter pmadapter, t_u8 *amsdu_buf, t_u8 *data,
*
* @return N/A
*/
static void
wlan_11n_form_amsdu_txpd(mlan_private *priv, mlan_buffer *mbuf)
static void wlan_11n_form_amsdu_txpd(mlan_private *priv, mlan_buffer *mbuf)
{
TxPD *ptx_pd;
mlan_adapter *pmadapter = priv->adapter;
@ -150,8 +145,8 @@ wlan_11n_form_amsdu_txpd(mlan_private *priv, mlan_buffer *mbuf)
*
* @return N/A
*/
static INLINE void
wlan_11n_update_pktlen_amsdu_txpd(mlan_private *priv, pmlan_buffer mbuf)
static INLINE void wlan_11n_update_pktlen_amsdu_txpd(mlan_private *priv,
pmlan_buffer mbuf)
{
TxPD *ptx_pd;
ENTER();
@ -179,8 +174,7 @@ wlan_11n_update_pktlen_amsdu_txpd(mlan_private *priv, pmlan_buffer mbuf)
*
* @return Number of packets
*/
static int
wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
static int wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
{
int pkt_count = 0, pkt_len, pad;
t_u8 hdr_len = sizeof(Eth803Hdr_t);
@ -188,15 +182,16 @@ wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
ENTER();
while (total_pkt_len >= hdr_len) {
/* Length will be in network format, change it to host */
pkt_len = mlan_ntohs((*(t_u16 *)(data + (2 *
MLAN_MAC_ADDR_LENGTH))));
pkt_len = mlan_ntohs(
(*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH))));
if (pkt_len > total_pkt_len) {
PRINTM(MERROR, "Error in packet length.\n");
break;
}
pad = (((pkt_len + sizeof(Eth803Hdr_t)) & 3)) ?
(4 - ((pkt_len + sizeof(Eth803Hdr_t)) & 3)) : 0;
(4 - ((pkt_len + sizeof(Eth803Hdr_t)) & 3)) :
0;
data += pkt_len + pad + sizeof(Eth803Hdr_t);
total_pkt_len -= pkt_len + pad + sizeof(Eth803Hdr_t);
++pkt_count;
@ -217,8 +212,7 @@ wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
mlan_status
wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
{
t_u16 pkt_len;
int total_pkt_len;
@ -229,11 +223,10 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
mlan_status ret = MLAN_STATUS_FAILURE;
RxPacketHdr_t *prx_pkt;
mlan_buffer *daggr_mbuf = MNULL;
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = { 0xaa, 0xaa, 0x03,
0x00, 0x00, 0x00
};
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = {0xaa, 0xaa, 0x03,
0x00, 0x00, 0x00};
t_u8 hdr_len = sizeof(Eth803Hdr_t);
t_u8 eapol_type[2] = { 0x88, 0x8e };
t_u8 eapol_type[2] = {0x88, 0x8e};
ENTER();
@ -250,16 +243,18 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
MLAN_USB_AGGR_MODE_NUM) {
max_rx_data_size *=
MAX(MLAN_USB_MAX_PKT_SIZE,
pmadapter->pcard_usb->usb_rx_deaggr.
aggr_ctrl.aggr_align);
pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_align);
max_rx_data_size =
MAX(max_rx_data_size, MLAN_RX_DATA_BUF_SIZE);
}
}
#endif
if (total_pkt_len > max_rx_data_size) {
PRINTM(MERROR, "Total packet length greater than tx buffer"
" size %d\n", total_pkt_len);
PRINTM(MERROR,
"Total packet length greater than tx buffer"
" size %d\n",
total_pkt_len);
goto done;
}
@ -268,8 +263,8 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
while (total_pkt_len >= hdr_len) {
prx_pkt = (RxPacketHdr_t *)data;
/* Length will be in network format, change it to host */
pkt_len = mlan_ntohs((*(t_u16 *)(data + (2 *
MLAN_MAC_ADDR_LENGTH))));
pkt_len = mlan_ntohs(
(*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH))));
if (pkt_len > total_pkt_len) {
PRINTM(MERROR,
"Error in packet length: total_pkt_len = %d, pkt_len = %d\n",
@ -279,25 +274,25 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
}
pad = (((pkt_len + sizeof(Eth803Hdr_t)) & 3)) ?
(4 - ((pkt_len + sizeof(Eth803Hdr_t)) & 3)) : 0;
(4 - ((pkt_len + sizeof(Eth803Hdr_t)) & 3)) :
0;
total_pkt_len -= pkt_len + pad + sizeof(Eth803Hdr_t);
if (memcmp(pmadapter, &prx_pkt->rfc1042_hdr,
rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr)) == 0) {
memmove(pmadapter, data + LLC_SNAP_LEN, data, (2 *
MLAN_MAC_ADDR_LENGTH));
if (memcmp(pmadapter, &prx_pkt->rfc1042_hdr, rfc1042_eth_hdr,
sizeof(rfc1042_eth_hdr)) == 0) {
memmove(pmadapter, data + LLC_SNAP_LEN, data,
(2 * MLAN_MAC_ADDR_LENGTH));
data += LLC_SNAP_LEN;
pkt_len += sizeof(Eth803Hdr_t) - LLC_SNAP_LEN;
} else {
*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH))
= (t_u16)0;
*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH)) =
(t_u16)0;
pkt_len += sizeof(Eth803Hdr_t);
}
daggr_mbuf =
wlan_alloc_mlan_buffer(pmadapter,
pkt_len + MLAN_NET_IP_ALIGN, 0,
MOAL_ALLOC_MLAN_BUFFER);
daggr_mbuf = wlan_alloc_mlan_buffer(pmadapter,
pkt_len + MLAN_NET_IP_ALIGN,
0, MOAL_ALLOC_MLAN_BUFFER);
if (daggr_mbuf == MNULL) {
PRINTM(MERROR, "Error allocating daggr mlan_buffer\n");
ret = MLAN_STATUS_FAILURE;
@ -320,28 +315,28 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
ret = wlan_uap_recv_packet(priv, daggr_mbuf);
} else {
#endif /* UAP_SUPPORT */
/** send EAPOL from AMSDU pkt to firmware */
/** send EAPOL from AMSDU pkt to firmware */
if (priv->sec_info.ewpa_enabled &&
(!memcmp
(pmadapter,
daggr_mbuf->pbuf + daggr_mbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET, eapol_type,
sizeof(eapol_type)))) {
ret = wlan_prepare_cmd(priv,
HostCmd_CMD_802_11_EAPOL_PKT,
0, 0, MNULL, daggr_mbuf);
(!memcmp(pmadapter,
daggr_mbuf->pbuf +
daggr_mbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET,
eapol_type, sizeof(eapol_type)))) {
ret = wlan_prepare_cmd(
priv, HostCmd_CMD_802_11_EAPOL_PKT, 0,
0, MNULL, daggr_mbuf);
if (ret == MLAN_STATUS_SUCCESS)
wlan_recv_event(priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_recv_event(
priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_free_mlan_buffer(pmadapter, daggr_mbuf);
data += pkt_len + pad;
continue;
}
ret = pmadapter->callbacks.moal_recv_packet(pmadapter->
pmoal_handle,
daggr_mbuf);
ret = pmadapter->callbacks.moal_recv_packet(
pmadapter->pmoal_handle, daggr_mbuf);
#ifdef UAP_SUPPORT
}
#endif /* UAP_SUPPORT */
@ -365,7 +360,7 @@ wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
done:
priv->msdu_in_rx_amsdu_cnt += pmbuf->use_count;
priv->amsdu_rx_cnt++;
/** we should free the aggr buffer after deaggr */
/** we should free the aggr buffer after deaggr */
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
LEAVE();
return ret;
@ -383,9 +378,8 @@ done:
*
* @return Final packet size or MLAN_STATUS_FAILURE
*/
int
wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
int headroom, int ptrindex)
int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
int headroom, int ptrindex)
{
int pkt_size = 0;
pmlan_adapter pmadapter = priv->adapter;
@ -405,19 +399,17 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
PRINTM(MDAT_D, "Handling Aggr packet\n");
pmbuf_src =
(pmlan_buffer)util_peek_list(pmadapter->pmoal_handle,
&pra_list->buf_head, MNULL, MNULL);
pmbuf_src = (pmlan_buffer)util_peek_list(
pmadapter->pmoal_handle, &pra_list->buf_head, MNULL, MNULL);
if (pmbuf_src) {
pmbuf_aggr = wlan_alloc_mlan_buffer(pmadapter,
pmadapter->tx_buf_size, 0,
MOAL_MALLOC_BUFFER);
if (!pmbuf_aggr) {
PRINTM(MERROR, "Error allocating mlan_buffer\n");
pmadapter->callbacks.moal_spin_unlock(pmadapter->
pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
priv->wmm.ra_list_spinlock);
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -442,18 +434,17 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
#endif
priv->msdu_in_tx_amsdu_cnt++;
} else {
pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle, priv->wmm.ra_list_spinlock);
goto exit;
}
while (pmbuf_src && ((pkt_size + (pmbuf_src->data_len + LLC_SNAP_LEN)
+ headroom) <= max_amsdu_size)) {
pmbuf_src = (pmlan_buffer)
util_dequeue_list(pmadapter->pmoal_handle,
&pra_list->buf_head, MNULL, MNULL);
while (pmbuf_src && ((pkt_size + (pmbuf_src->data_len + LLC_SNAP_LEN) +
headroom) <= max_amsdu_size)) {
pmbuf_src =
(pmlan_buffer)util_dequeue_list(pmadapter->pmoal_handle,
&pra_list->buf_head,
MNULL, MNULL);
pra_list->total_pkts--;
@ -462,18 +453,14 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
util_scalar_decrement(pmadapter->pmoal_handle,
&priv->wmm.tx_pkts_queued, MNULL, MNULL);
pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle, priv->wmm.ra_list_spinlock);
if (pmbuf_src) {
pkt_size += wlan_11n_form_amsdu_pkt(pmadapter,
(data + pkt_size),
pmbuf_src->pbuf +
pmbuf_src->
data_offset,
pmbuf_src->data_len,
&pad);
pkt_size += wlan_11n_form_amsdu_pkt(
pmadapter, (data + pkt_size),
pmbuf_src->pbuf + pmbuf_src->data_offset,
pmbuf_src->data_len, &pad);
DBG_HEXDUMP(MDAT_D, "pmbuf_src", pmbuf_src,
sizeof(mlan_buffer));
@ -485,10 +472,9 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
priv->wmm.ra_list_spinlock);
if (!wlan_is_ralist_valid(priv, pra_list, ptrindex)) {
pmadapter->callbacks.moal_spin_unlock(pmadapter->
pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
priv->wmm.ra_list_spinlock);
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -509,11 +495,11 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
wlan_11n_update_pktlen_amsdu_txpd(priv, pmbuf_aggr);
pmbuf_aggr->data_len += headroom;
pmbuf_aggr->pbuf = data - headroom;
tx_param.next_pkt_len = ((pmbuf_src) ?
pmbuf_src->data_len + sizeof(TxPD) : 0);
tx_param.next_pkt_len =
((pmbuf_src) ? pmbuf_src->data_len + sizeof(TxPD) : 0);
ret = pmadapter->ops.host_to_card(priv, MLAN_TYPE_DATA,
pmbuf_aggr, &tx_param);
ret = pmadapter->ops.host_to_card(priv, MLAN_TYPE_DATA, pmbuf_aggr,
&tx_param);
switch (ret) {
#ifdef USB
case MLAN_STATUS_PRESOURCE:
@ -525,10 +511,9 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
priv->wmm.ra_list_spinlock);
if (!wlan_is_ralist_valid(priv, pra_list, ptrindex)) {
pmadapter->callbacks.moal_spin_unlock(pmadapter->
pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
priv->wmm.ra_list_spinlock);
pmbuf_aggr->status_code = MLAN_ERROR_PKT_INVALID;
wlan_write_data_complete(pmadapter, pmbuf_aggr,
MLAN_STATUS_FAILURE);
@ -557,9 +542,8 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
util_scalar_increment(pmadapter->pmoal_handle,
&priv->wmm.tx_pkts_queued, MNULL, MNULL);
pmbuf_aggr->flags |= MLAN_BUF_FLAG_REQUEUED_PKT;
pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle, priv->wmm.ra_list_spinlock);
PRINTM(MINFO, "MLAN_STATUS_RESOURCE is returned\n");
pmbuf_aggr->status_code = MLAN_ERROR_PKT_INVALID;
break;
@ -584,11 +568,10 @@ wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
priv->wmm.tid_tbl_ptr[ptrindex].ra_list_curr = pra_list;
}
pmadapter->bssprio_tbl[priv->bss_priority].bssprio_cur =
pmadapter->bssprio_tbl[priv->bss_priority].bssprio_cur->
pnext;
pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
priv->wmm.
ra_list_spinlock);
pmadapter->bssprio_tbl[priv->bss_priority]
.bssprio_cur->pnext;
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle, priv->wmm.ra_list_spinlock);
}
PRINTM_GET_SYS_TIME(MDATA, &sec, &usec);
PRINTM_NETINTF(MDATA, priv);

View File

@ -32,7 +32,7 @@ Change log:
/** Aggregate 11N packets */
mlan_status wlan_11n_deaggregate_pkt(pmlan_private priv, pmlan_buffer pmbuf);
/** Deaggregate 11N packets */
int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *ptr,
int headroom, int ptrindex);
int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *ptr, int headroom,
int ptrindex);
#endif /* !_MLAN_11N_AGGR_H_ */

View File

@ -30,52 +30,52 @@ Change log:
#define _MLAN_11N_RXREORDER_H_
/** Max value a TID can take = 2^12 = 4096 */
#define MAX_TID_VALUE (2 << 11)
#define MAX_TID_VALUE (2 << 11)
/** 2^11 = 2048 */
#define TWOPOW11 (2 << 10)
#define TWOPOW11 (2 << 10)
/** Tid Mask used for extracting TID from BlockAckParamSet */
#define BLOCKACKPARAM_TID_MASK 0x3C
#define BLOCKACKPARAM_TID_MASK 0x3C
/** Tid position in BlockAckParamSet */
#define BLOCKACKPARAM_TID_POS 2
#define BLOCKACKPARAM_TID_POS 2
/** WinSize Mask used for extracting WinSize from BlockAckParamSet */
#define BLOCKACKPARAM_WINSIZE_MASK 0xffc0
#define BLOCKACKPARAM_WINSIZE_MASK 0xffc0
/** WinSize Mask used for extracting WinSize from BlockAckParamSet */
#define BLOCKACKPARAM_AMSDU_SUPP_MASK 0x1
#define BLOCKACKPARAM_AMSDU_SUPP_MASK 0x1
/** WinSize position in BlockAckParamSet */
#define BLOCKACKPARAM_WINSIZE_POS 6
#define BLOCKACKPARAM_WINSIZE_POS 6
/** Position of TID in DelBA Param set */
#define DELBA_TID_POS 12
#define DELBA_TID_POS 12
/** Position of INITIATOR in DelBA Param set */
#define DELBA_INITIATOR_POS 11
#define DELBA_INITIATOR_POS 11
/** Reason code: Requested from peer STA as it does not want to
* use the mechanism */
#define REASON_CODE_STA_DONT_WANT 37
* use the mechanism */
#define REASON_CODE_STA_DONT_WANT 37
/** Reason code: Requested from peer STA due to timeout*/
#define REASON_CODE_STA_TIMEOUT 39
#define REASON_CODE_STA_TIMEOUT 39
/** Type: send delba command */
#define TYPE_DELBA_SENT 1
#define TYPE_DELBA_SENT 1
/** Type: recieve delba command */
#define TYPE_DELBA_RECEIVE 2
#define TYPE_DELBA_RECEIVE 2
/** Set Initiator Bit */
#define DELBA_INITIATOR(paramset) (paramset = (paramset | (1 << 11)))
#define DELBA_INITIATOR(paramset) (paramset = (paramset | (1 << 11)))
/** Reset Initiator Bit for recipient */
#define DELBA_RECIPIENT(paramset) (paramset = (paramset & ~(1 << 11)))
#define DELBA_RECIPIENT(paramset) (paramset = (paramset & ~(1 << 11)))
/** Immediate block ack */
#define IMMEDIATE_BLOCK_ACK 0x2
#define IMMEDIATE_BLOCK_ACK 0x2
/** The request has been declined */
#define ADDBA_RSP_STATUS_DECLINED 37
#define ADDBA_RSP_STATUS_DECLINED 37
/** ADDBA response status : Reject */
#define ADDBA_RSP_STATUS_REJECT 1
/** ADDBA response status : Accept */
#define ADDBA_RSP_STATUS_ACCEPT 0
/** DEFAULT SEQ NUM */
#define DEFAULT_SEQ_NUM 0xffff
#define DEFAULT_SEQ_NUM 0xffff
/** Indicate packet has been dropped in FW */
#define RX_PKT_DROPPED_IN_FW 0xffffffff
#define RX_PKT_DROPPED_IN_FW 0xffffffff
mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seqNum, t_u16 tid,
t_u8 *ta, t_u8 pkttype, void *payload);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,77 +30,77 @@ Change log:
#define _MLAN_INIT_H_
/** Tx buffer size for firmware download*/
#define FW_DNLD_TX_BUF_SIZE 2312
#define FW_DNLD_TX_BUF_SIZE 2312
/** Rx buffer size for firmware download*/
#define FW_DNLD_RX_BUF_SIZE 2048
#define FW_DNLD_RX_BUF_SIZE 2048
/** Max firmware retry */
#define MAX_FW_RETRY 3
#define MAX_FW_RETRY 3
/** Firmware has last block */
#define FW_HAS_LAST_BLOCK 0x00000004
#define FW_HAS_LAST_BLOCK 0x00000004
/** CMD id for CMD4 */
#define FW_CMD_4 0x00000004
#define FW_CMD_4 0x00000004
/** CMD id for CMD6 */
#define FW_CMD_6 0x00000006
#define FW_CMD_6 0x00000006
/** CMD id for CMD7 */
#define FW_CMD_7 0x00000007
#define FW_CMD_7 0x00000007
/** CMD id for CMD10 */
#define FW_CMD_10 0x0000000a
#define FW_CMD_10 0x0000000a
/** Firmware data transmit size */
#define FW_DATA_XMIT_SIZE (sizeof(FWHeader) + DataLength + sizeof(t_u32))
/** FWHeader */
typedef MLAN_PACK_START struct _FWHeader {
/** FW download command */
/** FW download command */
t_u32 dnld_cmd;
/** FW base address */
/** FW base address */
t_u32 base_addr;
/** FW data length */
/** FW data length */
t_u32 data_length;
/** FW CRC */
/** FW CRC */
t_u32 crc;
} MLAN_PACK_END FWHeader;
/** FWData */
typedef MLAN_PACK_START struct _FWData {
/** FW data header */
/** FW data header */
FWHeader fw_header;
/** FW data sequence number */
/** FW data sequence number */
t_u32 seq_num;
/** FW data buffer */
/** FW data buffer */
t_u8 data[1];
} MLAN_PACK_END FWData;
/** FWSyncHeader */
typedef MLAN_PACK_START struct _FWSyncHeader {
/** FW sync header command */
/** FW sync header command */
t_u32 cmd;
/** FW sync header sequence number */
/** FW sync header sequence number */
t_u32 seq_num;
/** Extended header */
/** Extended header */
t_u32 magic;
/** Chip rev */
/** Chip rev */
t_u32 chip_rev;
/** Strap */
/** Strap */
t_u32 strap;
/** Status */
/** Status */
t_u32 status;
/** Offset */
/** Offset */
t_u32 offset;
} MLAN_PACK_END FWSyncHeader;
/** FW Sync pkt */
typedef MLAN_PACK_START struct _FWSyncPkt {
/** pkt type */
/** pkt type */
t_u32 pkt_type;
/** FW sync header command */
/** FW sync header command */
t_u32 cmd;
/** FW sync header sequence number */
/** FW sync header sequence number */
t_u32 seq_num;
/** chip rev */
/** chip rev */
t_u32 chip_rev;
/** fw status */
/** fw status */
t_u32 fw_ready;
} MLAN_PACK_END FWSyncPkt;
@ -108,11 +108,12 @@ typedef MLAN_PACK_START struct _FWSyncPkt {
/** Convert sequence number and command fields
* of fwheader to correct endian format
*/
#define endian_convert_syncfwheader(x) { \
(x)->cmd = wlan_le32_to_cpu((x)->cmd); \
(x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \
(x)->status = wlan_le32_to_cpu((x)->status); \
(x)->offset = wlan_le32_to_cpu((x)->offset); \
#define endian_convert_syncfwheader(x) \
{ \
(x)->cmd = wlan_le32_to_cpu((x)->cmd); \
(x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \
(x)->status = wlan_le32_to_cpu((x)->status); \
(x)->offset = wlan_le32_to_cpu((x)->offset); \
}
#else
/** Convert sequence number and command fields

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -34,9 +34,9 @@ Change log:
#define _MLAN_JOIN_H_
/** Size of buffer allocated to store the association response from firmware */
#define MRVDRV_ASSOC_RSP_BUF_SIZE 500
#define MRVDRV_ASSOC_RSP_BUF_SIZE 500
/** Size of buffer allocated to store IEs passed to firmware in the assoc req */
#define MRVDRV_GENIE_BUF_SIZE 256
#define MRVDRV_GENIE_BUF_SIZE 256
#endif /* _MLAN_JOIN_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ Change Log:
#include "mlan_meas.h"
/** Default measurement duration when not provided by the application */
#define WLAN_MEAS_DEFAULT_MEAS_DURATION 1000U /* TUs */
#define WLAN_MEAS_DEFAULT_MEAS_DURATION 1000U /* TUs */
#ifdef DEBUG_LEVEL2
/** String descriptions of the different measurement enums. Debug display */
@ -63,8 +63,7 @@ static const char *meas_type_str[WLAN_MEAS_NUM_TYPES] = {
*
* @return Constant string representing measurement type
*/
static const char *
wlan_meas_get_meas_type_str(MeasType_t meas_type)
static const char *wlan_meas_get_meas_type_str(MeasType_t meas_type)
{
if (meas_type <= WLAN_MEAS_11H_MAX_TYPE)
return meas_type_str[meas_type];
@ -80,8 +79,7 @@ wlan_meas_get_meas_type_str(MeasType_t meas_type)
*
* @return N/A
*/
static
void
static void
wlan_meas_dump_meas_req(const HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req)
{
ENTER();
@ -106,7 +104,8 @@ wlan_meas_dump_meas_req(const HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req)
switch (pmeas_req->meas_type) {
case WLAN_MEAS_BASIC:
/* Lazy cheat, fields of bas, cca, rpi union match on the request */
/* Lazy cheat, fields of bas, cca, rpi union match on the
* request */
PRINTM(MINFO, "Meas: Req: chan: %u\n",
pmeas_req->req.basic.channel);
PRINTM(MINFO, "Meas: Req: strt: %llu\n",
@ -130,8 +129,7 @@ wlan_meas_dump_meas_req(const HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req)
*
* @return N/A
*/
static
void
static void
wlan_meas_dump_meas_rpt(const HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt)
{
MeasType_t type;
@ -197,17 +195,16 @@ wlan_meas_dump_meas_rpt(const HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt)
*
* @return MLAN_STATUS_SUCCESS
*/
static int
wlan_meas_cmdresp_get_report(mlan_private *pmpriv,
const HostCmd_DS_COMMAND *resp)
static int wlan_meas_cmdresp_get_report(mlan_private *pmpriv,
const HostCmd_DS_COMMAND *resp)
{
mlan_adapter *pmadapter = pmpriv->adapter;
const HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt = &resp->params.meas_rpt;
ENTER();
PRINTM(MINFO, "Meas: Rpt: %#x-%u, Seq=%u, Ret=%u\n",
resp->command, resp->size, resp->seq_num, resp->result);
PRINTM(MINFO, "Meas: Rpt: %#x-%u, Seq=%u, Ret=%u\n", resp->command,
resp->size, resp->seq_num, resp->result);
/* Debug displays the measurement report */
wlan_meas_dump_meas_rpt(pmeas_rpt);
@ -216,16 +213,16 @@ wlan_meas_cmdresp_get_report(mlan_private *pmpriv,
* Check if we are pending on a measurement report and it matches
* the dialog token of the received report:
*/
if (pmadapter->state_meas.meas_rpt_pend_on
&& pmadapter->state_meas.meas_rpt_pend_on ==
pmeas_rpt->dialog_token) {
if (pmadapter->state_meas.meas_rpt_pend_on &&
pmadapter->state_meas.meas_rpt_pend_on == pmeas_rpt->dialog_token) {
PRINTM(MINFO, "Meas: Rpt: RCV'd Pend on meas #%d\n",
pmadapter->state_meas.meas_rpt_pend_on);
/* Clear the pending report indicator */
pmadapter->state_meas.meas_rpt_pend_on = 0;
/* Copy the received report into the measurement state for retrieval */
/* Copy the received report into the measurement state for
* retrieval */
memcpy_ext(pmadapter, &pmadapter->state_meas.meas_rpt_returned,
pmeas_rpt,
sizeof(pmadapter->state_meas.meas_rpt_returned),
@ -252,9 +249,9 @@ wlan_meas_cmdresp_get_report(mlan_private *pmpriv,
*
* @return MLAN_STATUS_SUCCESS
*/
static int
wlan_meas_cmd_request(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd_ptr, const void *pinfo_buf)
static int wlan_meas_cmd_request(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd_ptr,
const void *pinfo_buf)
{
const HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req =
(HostCmd_DS_MEASUREMENT_REQUEST *)pinfo_buf;
@ -268,9 +265,8 @@ wlan_meas_cmd_request(mlan_private *pmpriv,
sizeof(pcmd_ptr->params.meas_req),
sizeof(pcmd_ptr->params.meas_req));
PRINTM(MINFO, "Meas: Req: %#x-%u, Seq=%u, Ret=%u\n",
pcmd_ptr->command, pcmd_ptr->size, pcmd_ptr->seq_num,
pcmd_ptr->result);
PRINTM(MINFO, "Meas: Req: %#x-%u, Seq=%u, Ret=%u\n", pcmd_ptr->command,
pcmd_ptr->size, pcmd_ptr->seq_num, pcmd_ptr->result);
wlan_meas_dump_meas_req(pmeas_req);
@ -293,8 +289,8 @@ wlan_meas_cmd_request(mlan_private *pmpriv,
*
* @return MLAN_STATUS_SUCCESS
*/
static int
wlan_meas_cmd_get_report(mlan_private *pmpriv, HostCmd_DS_COMMAND *pcmd_ptr)
static int wlan_meas_cmd_get_report(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd_ptr)
{
ENTER();
@ -348,11 +344,11 @@ wlan_meas_cmd_get_report(mlan_private *pmpriv, HostCmd_DS_COMMAND *pcmd_ptr)
* the timeout expires
* - Error return from wlan_prepare_cmd routine otherwise
*/
int
wlan_meas_util_send_req(mlan_private *pmpriv,
HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req,
t_u32 wait_for_resp_timeout, pmlan_ioctl_req pioctl_req,
HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt)
int wlan_meas_util_send_req(mlan_private *pmpriv,
HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req,
t_u32 wait_for_resp_timeout,
pmlan_ioctl_req pioctl_req,
HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt)
{
static t_u8 auto_dialog_tok;
wlan_meas_state_t *pmeas_state = &pmpriv->adapter->state_meas;
@ -361,18 +357,19 @@ wlan_meas_util_send_req(mlan_private *pmpriv,
ENTER();
/* If dialogTok was set to 0 or not provided, autoset */
pmeas_req->dialog_token = (pmeas_req->dialog_token ?
pmeas_req->dialog_token : ++auto_dialog_tok);
pmeas_req->dialog_token =
(pmeas_req->dialog_token ? pmeas_req->dialog_token :
++auto_dialog_tok);
/* Check for rollover of the dialog token. Avoid using 0 as a token */
pmeas_req->dialog_token = (pmeas_req->dialog_token ?
pmeas_req->dialog_token : 1);
pmeas_req->dialog_token =
(pmeas_req->dialog_token ? pmeas_req->dialog_token : 1);
/*
* If the request is to pend waiting for the result, set the dialog token
* of this measurement request in the state structure. The measurement
* report handling routines can then check the incoming measurement
* reports for a match with this dialog token.
* If the request is to pend waiting for the result, set the dialog
* token of this measurement request in the state structure. The
* measurement report handling routines can then check the incoming
* measurement reports for a match with this dialog token.
*/
if (wait_for_resp_timeout) {
pmeas_state->meas_rpt_pend_on = pmeas_req->dialog_token;
@ -382,8 +379,8 @@ wlan_meas_util_send_req(mlan_private *pmpriv,
/* Send the measurement request to the firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_MEASUREMENT_REQUEST,
HostCmd_ACT_GEN_SET,
0, (t_void *)pioctl_req, (void *)pmeas_req);
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
(void *)pmeas_req);
LEAVE();
return ret;
@ -407,9 +404,8 @@ wlan_meas_util_send_req(mlan_private *pmpriv,
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*
*/
int
wlan_meas_cmd_process(mlan_private *pmpriv,
HostCmd_DS_COMMAND *pcmd_ptr, const void *pinfo_buf)
int wlan_meas_cmd_process(mlan_private *pmpriv, HostCmd_DS_COMMAND *pcmd_ptr,
const void *pinfo_buf)
{
int ret = MLAN_STATUS_SUCCESS;
@ -446,8 +442,8 @@ wlan_meas_cmd_process(mlan_private *pmpriv,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
int
wlan_meas_cmdresp_process(mlan_private *pmpriv, const HostCmd_DS_COMMAND *resp)
int wlan_meas_cmdresp_process(mlan_private *pmpriv,
const HostCmd_DS_COMMAND *resp)
{
int ret = MLAN_STATUS_SUCCESS;

View File

@ -34,15 +34,14 @@ Change Log:
#ifndef _MLAN_MEAS_H_
#define _MLAN_MEAS_H_
#include "mlan_fw.h"
#include "mlan_fw.h"
/* Send a given measurement request to the firmware, report back the result */
extern int
wlan_meas_util_send_req(mlan_private *pmpriv,
HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req,
t_u32 wait_for_resp_timeout, pmlan_ioctl_req pioctl_req,
HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt);
extern int wlan_meas_util_send_req(mlan_private *pmpriv,
HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req,
t_u32 wait_for_resp_timeout,
pmlan_ioctl_req pioctl_req,
HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt);
/* Setup a measurement command before it is sent to the firmware */
extern int wlan_meas_cmd_process(mlan_private *pmpriv,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -29,433 +29,432 @@ Change log:
#ifndef _MLAN_PCIE_H_
#define _MLAN_PCIE_H_
/** Tx DATA */
#define ADMA_TX_DATA 0
#define ADMA_TX_DATA 0
/** Rx DATA */
#define ADMA_RX_DATA 1
#define ADMA_RX_DATA 1
/** EVENT */
#define ADMA_EVENT 2
#define ADMA_EVENT 2
/** CMD */
#define ADMA_CMD 3
#define ADMA_CMD 3
/** CMD RESP */
#define ADMA_CMDRESP 4
#define ADMA_CMDRESP 4
/** ADMA direction */
#define ADMA_HOST_TO_DEVICE 0
#define ADMA_HOST_TO_DEVICE 0
/** ADMA direction Rx */
#define ADMA_DEVICE_TO_HOST 1
#define ADMA_DEVICE_TO_HOST 1
/** Direct Program mode */
#define DMA_MODE_DIRECT 0
#define DMA_MODE_DIRECT 0
/** Single descriptor mode */
#define DMA_MODE_SINGLE_DESC 1
#define DMA_MODE_SINGLE_DESC 1
/** dual discriptor mode */
#define DMA_MODE_DUAL_DESC 2
#define DMA_MODE_DUAL_DESC 2
/** descriptor mode: ring mode */
#define DESC_MODE_RING 0
#define DESC_MODE_RING 0
/** descriptor mode: chain mode */
#define DESC_MODE_CHAIN 1
#define DESC_MODE_CHAIN 1
/** DMA size start bit */
#define DMA_SIZE_BIT 16
#define DMA_SIZE_BIT 16
/** DMA size mask */
#define DMA_SIZE_MASK 0xffff0000
#define DMA_SIZE_MASK 0xffff0000
/** Descriptor mode */
#define DESC_MODE_MASK 0x0004
#define DESC_MODE_MASK 0x0004
/** DMA MODE MASK */
#define DMA_MODE_MASK 0x0003
#define DMA_MODE_MASK 0x0003
/** Dest Num Descriptor start bits */
#define DST_NUM_DESC_BIT 12
#define DST_NUM_DESC_BIT 12
/** Destination Num of Descriptor mask */
#define DST_NUM_DESC_MASK 0xf000
#define DST_NUM_DESC_MASK 0xf000
/** Src Num Descriptor start bits */
#define SRC_NUM_DESC_BIT 8
#define SRC_NUM_DESC_BIT 8
/** Destination Num of Descriptor mask */
#define SRC_NUM_DESC_MASK 0x0f00
#define SRC_NUM_DESC_MASK 0x0f00
/** Virtual Q priority mask */
#define Q_PRIO_WEIGHT_MASK 0x00f0
#define Q_PRIO_WEIGHT_MASK 0x00f0
/** DMA cfg register offset*/
#define ADMA_DMA_CFG 0x0000
#define ADMA_DMA_CFG 0x0000
/** source base low */
#define ADMA_SRC_LOW 0x0004
#define ADMA_SRC_LOW 0x0004
/** source base high */
#define ADMA_SRC_HIGH 0x0008
#define ADMA_SRC_HIGH 0x0008
/** destination base low */
#define ADMA_DST_LOW 0x000C
#define ADMA_DST_LOW 0x000C
/** destination base high */
#define ADMA_DST_HIGH 0x0010
#define ADMA_DST_HIGH 0x0010
/** source rd/wr pointer */
#define ADMA_SRC_RW_PTR 0x0014
#define ADMA_SRC_RW_PTR 0x0014
/** destination rd/wr pointer */
#define ADMA_DST_RW_PTR 0x0018
/** interrupt direction mapping reg, for each virtual Q, used for dual-descriptor only, only valid for Q0 */
#define ADMA_INT_MAPPING 0x001C
#define ADMA_DST_RW_PTR 0x0018
/** interrupt direction mapping reg, for each virtual Q, used for
* dual-descriptor only, only valid for Q0 */
#define ADMA_INT_MAPPING 0x001C
/** destination interrupt to device */
#define DEST_INT_TO_DEVICE MBIT(0)
#define DEST_INT_TO_DEVICE MBIT(0)
/** destination interrupt to host */
#define DEST_INT_TO_HOST MBIT(1)
#define DEST_INT_TO_HOST MBIT(1)
/** interrupt pending status for each virtual Q, only valid for Q0 */
#define ADMA_INT_PENDING 0x0020
#define ADMA_INT_PENDING 0x0020
/** Default ADMA INT mask, We only enable dma done */
#define DEF_ADMA_INT_MASK MBIT(0)
#define DEF_ADMA_INT_MASK MBIT(0)
/** source interrupt status mask reg */
#define ADMA_SRC_INT_STATUS_MASK 0x0024
#define ADMA_SRC_INT_STATUS_MASK 0x0024
/** source interrupt mask reg */
#define ADMA_SRC_INT_MASK 0x0028
#define ADMA_SRC_INT_MASK 0x0028
/** source interrupt status reg */
#define ADMA_SRC_INT_STATUS 0x002C
#define ADMA_SRC_INT_STATUS 0x002C
/** destination interrupt status mask reg */
#define ADMA_DST_INT_STATUS_MASK 0x0030
#define ADMA_DST_INT_STATUS_MASK 0x0030
/** destination interrupt mask reg */
#define ADMA_DST_INT_MASK 0x0034
#define ADMA_DST_INT_MASK 0x0034
/** destination interrupt status reg */
#define ADMA_DST_INT_STATUS 0x0038
#define ADMA_DST_INT_STATUS 0x0038
/** DMA cfg2 register */
#define ADMA_DMA_CFG2 0x003C
#define ADMA_DMA_CFG2 0x003C
/** ADMA_MSI_LEGACY_DST_DMA_DONE_INT_BYPASS_EN */
#define ADMA_MSI_LEGACY_DST_DMA_DONE_INT_BYPASS_EN MBIT(22)
#define ADMA_MSI_LEGACY_DST_DMA_DONE_INT_BYPASS_EN MBIT(22)
/** ADMA_MSI_LEGACY_SRC_DMA_DONE_INT_BYPASS_EN */
#define ADMA_MSI_LEGACY_SRC_DMA_DONE_INT_BYPASS_EN MBIT(21)
/* If this bit is set, MSIX trigger event will be from DST, other wise MSIX trigger event will be from SRC */
#define ADMA_MSIX_INT_SRC_DST_SEL MBIT(20)
#define ADMA_MSI_LEGACY_SRC_DMA_DONE_INT_BYPASS_EN MBIT(21)
/* If this bit is set, MSIX trigger event will be from DST, other wise MSIX
* trigger event will be from SRC */
#define ADMA_MSIX_INT_SRC_DST_SEL MBIT(20)
/** Enable MSI/Legacy for this Queue */
#define ADMA_MSI_LEGACY_ENABLE MBIT(19)
#define ADMA_MSI_LEGACY_ENABLE MBIT(19)
/** Enable MSIX for this queue */
#define ADMA_MSIX_ENABLE MBIT(18)
#define ADMA_MSIX_ENABLE MBIT(18)
/** ADMA_DST_DMA_DONE_INT_BYPASS_EN */
#define ADMA_DST_DMA_DONE_INT_BYPASS_EN MBIT(17)
#define ADMA_DST_DMA_DONE_INT_BYPASS_EN MBIT(17)
/** SRC_DMA_DONE_INT_BYPASS_EN */
#define ADMA_SRC_DMA_DONE_INT_BYPASS_EN MBIT(16)
#define ADMA_SRC_DMA_DONE_INT_BYPASS_EN MBIT(16)
/* Destination Read Pointer Memory Copy Enable */
#define ADMA_DST_RPTR_MEM_COPY_EN MBIT(11)
#define ADMA_DST_RPTR_MEM_COPY_EN MBIT(11)
/* Source Read Pointer Memory Copy Enable */
#define ADMA_SRC_RPTR_MEM_COPY_EN MBIT(10)
#define ADMA_SRC_RPTR_MEM_COPY_EN MBIT(10)
/** Destination address is host */
#define ADMA_DST_ADDR_IS_HOST MBIT(2)
#define ADMA_DST_ADDR_IS_HOST MBIT(2)
/** Source address is host */
#define ADMA_SRC_ADDR_IS_HOST MBIT(1)
#define ADMA_SRC_ADDR_IS_HOST MBIT(1)
/** DMA cfg3 register */
#define ADMA_DMA_CFG3 0x0040
#define ADMA_DMA_CFG3 0x0040
/** source rd ptr address low */
#define ADMA_SRC_RD_PTR_LOW 0x0044
#define ADMA_SRC_RD_PTR_LOW 0x0044
/** source rd ptr address high */
#define ADMA_SRC_RD_PTR_HIGH 0x0048
#define ADMA_SRC_RD_PTR_HIGH 0x0048
/** destination rd ptr address low */
#define ADMA_DST_RD_PTR_LOW 0x004C
#define ADMA_DST_RD_PTR_LOW 0x004C
/** destination rd ptr address high */
#define ADMA_DST_RD_PTR_HIGH 0x0050
#define ADMA_DST_RD_PTR_HIGH 0x0050
/** source active interrupt mask */
#define ADMA_SRC_ACTV_INT_MASK 0x0054
#define ADMA_SRC_ACTV_INT_MASK 0x0054
/** destination active interrupt mask */
#define ADMA_DST_ACTV_INT_MASK 0x0058
#define ADMA_DST_ACTV_INT_MASK 0x0058
/** Read pointer start from bit 16 */
#define ADMA_RPTR_START 16
#define ADMA_RPTR_START 16
/** write pointer start from bit 0 */
#define ADMA_WPTR_START 0
#define ADMA_WPTR_START 0
/** Tx/Rx Read/Write pointer's mask */
#define TXRX_RW_PTR_MASK (MLAN_MAX_TXRX_BD - 1)
#define TXRX_RW_PTR_MASK (MLAN_MAX_TXRX_BD - 1)
/** Tx/Rx Read/Write pointer's rollover indicate bit */
#define TXRX_RW_PTR_ROLLOVER_IND MLAN_MAX_TXRX_BD
#define TXRX_RW_PTR_ROLLOVER_IND MLAN_MAX_TXRX_BD
/** Start of packet flag */
#define ADMA_BD_FLAG_SOP MBIT(0)
#define ADMA_BD_FLAG_SOP MBIT(0)
/** End of packet flag */
#define ADMA_BD_FLAG_EOP MBIT(1)
#define ADMA_BD_FLAG_EOP MBIT(1)
/** interrupt enable flag */
#define ADMA_BD_FLAG_INT_EN MBIT(2)
#define ADMA_BD_FLAG_INT_EN MBIT(2)
/** Source address is host side flag */
#define ADMA_BD_FLAG_SRC_HOST MBIT(3)
#define ADMA_BD_FLAG_SRC_HOST MBIT(3)
/** Destination address is host side flag */
#define ADMA_BD_FLAG_DST_HOST MBIT(4)
#define ADMA_BD_FLAG_DST_HOST MBIT(4)
/** ADMA MIN PKT SIZE */
#define ADMA_MIN_PKT_SIZE 128
#define ADMA_MIN_PKT_SIZE 128
/** ADMA dual descriptor mode requir 8 bytes alignment in buf size */
#define ADMA_ALIGN_SIZE 8
#define ADMA_ALIGN_SIZE 8
/** ADMA RW_PTR wrap mask */
#define ADMA_RW_PTR_WRAP_MASK 0x00001FFF
#define ADMA_RW_PTR_WRAP_MASK 0x00001FFF
/** ADMA MSIX DOORBEEL DATA */
#define ADMA_MSIX_DOORBELL_DATA 0x0064
#define ADMA_MSIX_DOORBELL_DATA 0x0064
/** MSIX VECTOR MASK: BIT 0-10 */
#define ADMA_MSIX_VECTOR_MASK 0x3f
#define ADMA_MSIX_VECTOR_MASK 0x3f
/** PF mask: BIT 24-28 */
#define ADMA_MSIX_PF_MASK 0x1f000000
#define ADMA_MSIX_PF_MASK 0x1f000000
/** PF start bit */
#define ADMA_MSIX_PF_BIT 24
#define ADMA_MSIX_PF_BIT 24
#if defined(PCIE9098) || defined(PCIE9097)
/** PCIE9098 dev_id/vendor id reg */
#define PCIE9098_DEV_ID_REG 0x0000
#define PCIE9098_DEV_ID_REG 0x0000
/** PCIE revision ID register */
#define PCIE9098_REV_ID_REG 0x0008
#define PCIE9098_REV_ID_REG 0x0008
/** PCIE IP revision register */
#define PCIE9098_IP_REV_REG 0x1000
#define PCIE9098_IP_REV_REG 0x1000
/** PCIE CPU interrupt events */
#define PCIE9098_CPU_INT_EVENT 0x1C20
#define PCIE9098_CPU_INT_EVENT 0x1C20
/** PCIE CPU interrupt status */
#define PCIE9098_CPU_INT_STATUS 0x1C24
#define PCIE9098_CPU_INT_STATUS 0x1C24
/** PCIe CPU Interrupt Status Mask */
#define PCIE9098_CPU_INT2ARM_ISM 0x1C28
#define PCIE9098_CPU_INT2ARM_ISM 0x1C28
/** PCIE host interrupt status */
#define PCIE9098_HOST_INT_STATUS 0x1C44
#define PCIE9098_HOST_INT_STATUS 0x1C44
/** PCIE host interrupt mask */
#define PCIE9098_HOST_INT_MASK 0x1C48
#define PCIE9098_HOST_INT_MASK 0x1C48
/** PCIE host interrupt clear select*/
#define PCIE9098_HOST_INT_CLR_SEL 0x1C4C
#define PCIE9098_HOST_INT_CLR_SEL 0x1C4C
/** PCIE host interrupt status mask */
#define PCIE9098_HOST_INT_STATUS_MASK 0x1C50
#define PCIE9098_HOST_INT_STATUS_MASK 0x1C50
/** PCIE host interrupt status */
#define PCIE9097_B0_HOST_INT_STATUS 0x3C44
#define PCIE9097_B0_HOST_INT_STATUS 0x3C44
/** PCIE host interrupt mask */
#define PCIE9097_B0_HOST_INT_MASK 0x3C48
#define PCIE9097_B0_HOST_INT_MASK 0x3C48
/** PCIE host interrupt clear select*/
#define PCIE9097_B0_HOST_INT_CLR_SEL 0x3C4C
#define PCIE9097_B0_HOST_INT_CLR_SEL 0x3C4C
/** PCIE host interrupt status mask */
#define PCIE9097_B0_HOST_INT_STATUS_MASK 0x3C50
#define PCIE9097_B0_HOST_INT_STATUS_MASK 0x3C50
/** PCIE host interrupt select*/
#define PCIE9098_HOST_INT_SEL 0x1C58
#define PCIE9098_HOST_INT_SEL 0x1C58
/** PCIE data exchange register 0 */
#define PCIE9098_SCRATCH_0_REG 0x1C60
#define PCIE9098_SCRATCH_0_REG 0x1C60
/** PCIE data exchange register 1 */
#define PCIE9098_SCRATCH_1_REG 0x1C64
#define PCIE9098_SCRATCH_1_REG 0x1C64
/** PCIE data exchange register 2 */
#define PCIE9098_SCRATCH_2_REG 0x1C68
#define PCIE9098_SCRATCH_2_REG 0x1C68
/** PCIE data exchange register 3 */
#define PCIE9098_SCRATCH_3_REG 0x1C6C
#define PCIE9098_SCRATCH_3_REG 0x1C6C
/** PCIE data exchange register 4 */
#define PCIE9098_SCRATCH_4_REG 0x1C70
#define PCIE9098_SCRATCH_4_REG 0x1C70
/** PCIE data exchange register 5 */
#define PCIE9098_SCRATCH_5_REG 0x1C74
#define PCIE9098_SCRATCH_5_REG 0x1C74
/** PCIE data exchange register 6 */
#define PCIE9098_SCRATCH_6_REG 0x1C78
#define PCIE9098_SCRATCH_6_REG 0x1C78
/** PCIE data exchange register 7 */
#define PCIE9098_SCRATCH_7_REG 0x1C7C
#define PCIE9098_SCRATCH_7_REG 0x1C7C
/** PCIE data exchange register 8 */
#define PCIE9098_SCRATCH_8_REG 0x1C80
#define PCIE9098_SCRATCH_8_REG 0x1C80
/** PCIE data exchange register 9 */
#define PCIE9098_SCRATCH_9_REG 0x1C84
#define PCIE9098_SCRATCH_9_REG 0x1C84
/** PCIE data exchange register 10 */
#define PCIE9098_SCRATCH_10_REG 0x1C88
#define PCIE9098_SCRATCH_10_REG 0x1C88
/** PCIE data exchange register 11 */
#define PCIE9098_SCRATCH_11_REG 0x1C8C
#define PCIE9098_SCRATCH_11_REG 0x1C8C
/** PCIE data exchange register 12 */
#define PCIE9098_SCRATCH_12_REG 0x1C90
#define PCIE9098_SCRATCH_12_REG 0x1C90
/** PCIE data exchange register 13 */
#define PCIE9098_SCRATCH_13_REG 0x1C94
#define PCIE9098_SCRATCH_13_REG 0x1C94
/** PCIE data exchange register 14 */
#define PCIE9098_SCRATCH_14_REG 0x1C98
#define PCIE9098_SCRATCH_14_REG 0x1C98
/** PCIE data exchange register 15 */
#define PCIE9098_SCRATCH_15_REG 0x1C9C
#define PCIE9098_SCRATCH_15_REG 0x1C9C
/** ADMA CHAN0_Q0 start address, Tx Data */
#define ADMA_CHAN0_Q0 0x10000
#define ADMA_CHAN0_Q0 0x10000
/** ADMA CHAN1_Q0 start address, Rx Data */
#define ADMA_CHAN1_Q0 0x10800
#define ADMA_CHAN1_Q0 0x10800
/** ADMA CHAN1_Q1 start address, Rx Event */
#define ADMA_CHAN1_Q1 0x10880
#define ADMA_CHAN1_Q1 0x10880
/** ADMA CHAN2_Q0 start address, Tx Command */
#define ADMA_CHAN2_Q0 0x11000
#define ADMA_CHAN2_Q0 0x11000
/** ADMA CHAN2_Q1 start address, Command Resp */
#define ADMA_CHAN2_Q1 0x11080
#define ADMA_CHAN2_Q1 0x11080
/** CH0-Q0' src rd/wr ptr */
#define ADMA_SRC_PTR_CH0_Q0 (ADMA_CHAN0_Q0+ADMA_SRC_RW_PTR)
#define ADMA_SRC_PTR_CH0_Q0 (ADMA_CHAN0_Q0 + ADMA_SRC_RW_PTR)
/** CH1-Q1' dest rd/wr ptr */
#define ADMA_DST_PTR_CH1_Q0 (ADMA_CHAN1_Q0+ADMA_DST_RW_PTR)
#define ADMA_DST_PTR_CH1_Q0 (ADMA_CHAN1_Q0 + ADMA_DST_RW_PTR)
/** CH1-Q1' dest rd/wr ptr */
#define ADMA_DST_PTR_CH1_Q1 (ADMA_CHAN1_Q1+ADMA_DST_RW_PTR)
#define ADMA_DST_PTR_CH1_Q1 (ADMA_CHAN1_Q1 + ADMA_DST_RW_PTR)
/* TX buffer description read pointer */
#define PCIE9098_TXBD_RDPTR ADMA_SRC_PTR_CH0_Q0
#define PCIE9098_TXBD_RDPTR ADMA_SRC_PTR_CH0_Q0
/* TX buffer description write pointer */
#define PCIE9098_TXBD_WRPTR ADMA_SRC_PTR_CH0_Q0
#define PCIE9098_TXBD_WRPTR ADMA_SRC_PTR_CH0_Q0
/* RX buffer description read pointer */
#define PCIE9098_RXBD_RDPTR ADMA_DST_PTR_CH1_Q0
#define PCIE9098_RXBD_RDPTR ADMA_DST_PTR_CH1_Q0
/* RX buffer description write pointer */
#define PCIE9098_RXBD_WRPTR ADMA_DST_PTR_CH1_Q0
#define PCIE9098_RXBD_WRPTR ADMA_DST_PTR_CH1_Q0
/* Event buffer description read pointer */
#define PCIE9098_EVTBD_RDPTR ADMA_DST_PTR_CH1_Q1
#define PCIE9098_EVTBD_RDPTR ADMA_DST_PTR_CH1_Q1
/* Event buffer description write pointer */
#define PCIE9098_EVTBD_WRPTR ADMA_DST_PTR_CH1_Q1
#define PCIE9098_EVTBD_WRPTR ADMA_DST_PTR_CH1_Q1
/* Driver ready signature write pointer */
#define PCIE9098_DRV_READY PCIE9098_SCRATCH_12_REG
#define PCIE9098_DRV_READY PCIE9098_SCRATCH_12_REG
/** interrupt bit define for ADMA CHAN0 Q0, For Tx DATA */
#define ADMA_INT_CHAN0_Q0 MBIT(0)
#define ADMA_INT_CHAN0_Q0 MBIT(0)
/** interrupt bit define for ADMA CHAN1 Q0, For Rx Data */
#define AMDA_INT_CHAN1_Q0 MBIT(16)
#define AMDA_INT_CHAN1_Q0 MBIT(16)
/** interrupt bit define for ADMA CHAN1 Q1, For Rx Event */
#define AMDA_INT_CHAN1_Q1 MBIT(17)
#define AMDA_INT_CHAN1_Q1 MBIT(17)
/** interrupt bit define for ADMA CHAN2 Q0, For Tx Command */
#define AMDA_INT_CHAN2_Q0 MBIT(24)
#define AMDA_INT_CHAN2_Q0 MBIT(24)
/** interrupt bit define for ADMA CHAN2 Q1, For Rx Command Resp */
#define AMDA_INT_CHAN2_Q1 MBIT(25)
#define AMDA_INT_CHAN2_Q1 MBIT(25)
/** interrupt vector number for ADMA CHAN0 Q0, For Tx DATA */
#define ADMA_VECTOR_CHAN0_Q0 0
#define ADMA_VECTOR_CHAN0_Q0 0
/** interrupt vector number for ADMA CHAN1 Q0, For Rx Data */
#define AMDA_VECTOR_CHAN1_Q0 16
#define AMDA_VECTOR_CHAN1_Q0 16
/** interrupt vector number for ADMA CHAN1 Q1, For Rx Event */
#define AMDA_VECTOR_CHAN1_Q1 17
#define AMDA_VECTOR_CHAN1_Q1 17
/** interrupt vector number for ADMA CHAN2 Q0, For Tx Command */
#define AMDA_VECTOR_CHAN2_Q0 24
#define AMDA_VECTOR_CHAN2_Q0 24
/** interrupt vector number for ADMA CHAN2 Q1, For Rx Command Resp */
#define AMDA_VECTOR_CHAN2_Q1 25
#define AMDA_VECTOR_CHAN2_Q1 25
/** Data sent interrupt for host */
#define PCIE9098_HOST_INTR_DNLD_DONE ADMA_INT_CHAN0_Q0
#define PCIE9098_HOST_INTR_DNLD_DONE ADMA_INT_CHAN0_Q0
/** Data receive interrupt for host */
#define PCIE9098_HOST_INTR_UPLD_RDY AMDA_INT_CHAN1_Q0
#define PCIE9098_HOST_INTR_UPLD_RDY AMDA_INT_CHAN1_Q0
/** Command sent interrupt for host */
#define PCIE9098_HOST_INTR_CMD_DONE AMDA_INT_CHAN2_Q1
#define PCIE9098_HOST_INTR_CMD_DONE AMDA_INT_CHAN2_Q1
/** Event ready interrupt for host */
#define PCIE9098_HOST_INTR_EVENT_RDY AMDA_INT_CHAN1_Q1
#define PCIE9098_HOST_INTR_EVENT_RDY AMDA_INT_CHAN1_Q1
/** CMD sent interrupt for host */
#define PCIE9098_HOST_INTR_CMD_DNLD MBIT(7)
#define PCIE9098_HOST_INTR_CMD_DNLD MBIT(7)
/** Interrupt mask for host */
#define PCIE9098_HOST_INTR_MASK (PCIE9098_HOST_INTR_DNLD_DONE | \
PCIE9098_HOST_INTR_UPLD_RDY | \
PCIE9098_HOST_INTR_CMD_DONE | \
PCIE9098_HOST_INTR_CMD_DNLD | \
PCIE9098_HOST_INTR_EVENT_RDY)
#define PCIE9098_HOST_INTR_MASK \
(PCIE9098_HOST_INTR_DNLD_DONE | PCIE9098_HOST_INTR_UPLD_RDY | \
PCIE9098_HOST_INTR_CMD_DONE | PCIE9098_HOST_INTR_CMD_DNLD | \
PCIE9098_HOST_INTR_EVENT_RDY)
/** Interrupt select mask for host */
#define PCIE9098_HOST_INTR_SEL_MASK (PCIE9098_HOST_INTR_DNLD_DONE | \
PCIE9098_HOST_INTR_UPLD_RDY | \
PCIE9098_HOST_INTR_CMD_DONE | \
PCIE9098_HOST_INTR_EVENT_RDY)
#define PCIE9098_HOST_INTR_SEL_MASK \
(PCIE9098_HOST_INTR_DNLD_DONE | PCIE9098_HOST_INTR_UPLD_RDY | \
PCIE9098_HOST_INTR_CMD_DONE | PCIE9098_HOST_INTR_EVENT_RDY)
#endif
#if defined(PCIE8997) || defined(PCIE8897)
/* PCIE INTERNAL REGISTERS */
/** PCIE data exchange register 0 */
#define PCIE_SCRATCH_0_REG 0x0C10
#define PCIE_SCRATCH_0_REG 0x0C10
/** PCIE data exchange register 1 */
#define PCIE_SCRATCH_1_REG 0x0C14
#define PCIE_SCRATCH_1_REG 0x0C14
/** PCIE CPU interrupt events */
#define PCIE_CPU_INT_EVENT 0x0C18
#define PCIE_CPU_INT_EVENT 0x0C18
/** PCIE CPU interrupt status */
#define PCIE_CPU_INT_STATUS 0x0C1C
#define PCIE_CPU_INT_STATUS 0x0C1C
/** PCIe CPU Interrupt Status Mask */
#define PCIE_CPU_INT2ARM_ISM 0x0C28
#define PCIE_CPU_INT2ARM_ISM 0x0C28
/** PCIE host interrupt status */
#define PCIE_HOST_INT_STATUS 0x0C30
#define PCIE_HOST_INT_STATUS 0x0C30
/** PCIE host interrupt mask */
#define PCIE_HOST_INT_MASK 0x0C34
#define PCIE_HOST_INT_MASK 0x0C34
/** PCIE host interrupt status mask */
#define PCIE_HOST_INT_STATUS_MASK 0x0C3C
#define PCIE_HOST_INT_STATUS_MASK 0x0C3C
/** PCIE data exchange register 2 */
#define PCIE_SCRATCH_2_REG 0x0C40
#define PCIE_SCRATCH_2_REG 0x0C40
/** PCIE data exchange register 3 */
#define PCIE_SCRATCH_3_REG 0x0C44
#define PCIE_SCRATCH_3_REG 0x0C44
#define PCIE_IP_REV_REG 0x0C48
#define PCIE_IP_REV_REG 0x0C48
/** PCIE data exchange register 4 */
#define PCIE_SCRATCH_4_REG 0x0CD0
#define PCIE_SCRATCH_4_REG 0x0CD0
/** PCIE data exchange register 5 */
#define PCIE_SCRATCH_5_REG 0x0CD4
#define PCIE_SCRATCH_5_REG 0x0CD4
/** PCIE data exchange register 6 */
#define PCIE_SCRATCH_6_REG 0x0CD8
#define PCIE_SCRATCH_6_REG 0x0CD8
/** PCIE data exchange register 7 */
#define PCIE_SCRATCH_7_REG 0x0CDC
#define PCIE_SCRATCH_7_REG 0x0CDC
/** PCIE data exchange register 8 */
#define PCIE_SCRATCH_8_REG 0x0CE0
#define PCIE_SCRATCH_8_REG 0x0CE0
/** PCIE data exchange register 9 */
#define PCIE_SCRATCH_9_REG 0x0CE4
#define PCIE_SCRATCH_9_REG 0x0CE4
/** PCIE data exchange register 10 */
#define PCIE_SCRATCH_10_REG 0x0CE8
#define PCIE_SCRATCH_10_REG 0x0CE8
/** PCIE data exchange register 11 */
#define PCIE_SCRATCH_11_REG 0x0CEC
#define PCIE_SCRATCH_11_REG 0x0CEC
/** PCIE data exchange register 12 */
#define PCIE_SCRATCH_12_REG 0x0CF0
#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 */
#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 */
#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 */
#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 */
#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 */
#define PCIE8897_RD_DATA_PTR_Q0_Q1 0xC08C /* 0x8000C08C */
/* PCIE read data pointer for queue 2 and 3 */
#define PCIE8897_RD_DATA_PTR_Q2_Q3 0xC090 /* 0x8000C090 */
#define PCIE8897_RD_DATA_PTR_Q2_Q3 0xC090 /* 0x8000C090 */
/* PCIE write data pointer for queue 0 and 1 */
#define PCIE8897_WR_DATA_PTR_Q0_Q1 0xC05C /* 0x8000C05C */
#define PCIE8897_WR_DATA_PTR_Q0_Q1 0xC05C /* 0x8000C05C */
/* PCIE write data pointer for queue 2 and 3 */
#define PCIE8897_WR_DATA_PTR_Q2_Q3 0xC060 /* 0x8000C060 */
#define PCIE8897_WR_DATA_PTR_Q2_Q3 0xC060 /* 0x8000C060 */
#endif
/** Download ready interrupt for CPU */
#define CPU_INTR_DNLD_RDY MBIT(0)
#define CPU_INTR_DNLD_RDY MBIT(0)
/** Command ready interrupt for CPU */
#define CPU_INTR_DOOR_BELL MBIT(1)
#define CPU_INTR_DOOR_BELL MBIT(1)
/** Confirmation that sleep confirm message has been processed.
Device will enter sleep after receiving this interrupt */
#define CPU_INTR_SLEEP_CFM_DONE MBIT(2)
#define CPU_INTR_SLEEP_CFM_DONE MBIT(2)
/** Reset interrupt for CPU */
#define CPU_INTR_RESET MBIT(3)
#define CPU_INTR_RESET MBIT(3)
/** Set Event Done interupt to the FW*/
#define CPU_INTR_EVENT_DONE MBIT(5)
#define CPU_INTR_EVENT_DONE MBIT(5)
#if defined(PCIE8997) || defined(PCIE8897)
/** Data sent interrupt for host */
#define HOST_INTR_DNLD_DONE MBIT(0)
#define HOST_INTR_DNLD_DONE MBIT(0)
/** Data receive interrupt for host */
#define HOST_INTR_UPLD_RDY MBIT(1)
#define HOST_INTR_UPLD_RDY MBIT(1)
/** Command sent interrupt for host */
#define HOST_INTR_CMD_DONE MBIT(2)
#define HOST_INTR_CMD_DONE MBIT(2)
/** Event ready interrupt for host */
#define HOST_INTR_EVENT_RDY MBIT(3)
#define HOST_INTR_EVENT_RDY MBIT(3)
/** Interrupt mask for host */
#define HOST_INTR_MASK (HOST_INTR_DNLD_DONE | \
HOST_INTR_UPLD_RDY | \
HOST_INTR_CMD_DONE | \
HOST_INTR_EVENT_RDY)
#define HOST_INTR_MASK \
(HOST_INTR_DNLD_DONE | HOST_INTR_UPLD_RDY | HOST_INTR_CMD_DONE | \
HOST_INTR_EVENT_RDY)
/** Lower 32bits command address holding register */
#define REG_CMD_ADDR_LO PCIE_SCRATCH_0_REG
#define REG_CMD_ADDR_LO PCIE_SCRATCH_0_REG
/** Upper 32bits command address holding register */
#define REG_CMD_ADDR_HI PCIE_SCRATCH_1_REG
#define REG_CMD_ADDR_HI PCIE_SCRATCH_1_REG
/** Command length holding register */
#define REG_CMD_SIZE PCIE_SCRATCH_2_REG
#define REG_CMD_SIZE PCIE_SCRATCH_2_REG
/** Lower 32bits command response address holding register */
#define REG_CMDRSP_ADDR_LO PCIE_SCRATCH_4_REG
#define REG_CMDRSP_ADDR_LO PCIE_SCRATCH_4_REG
/** Upper 32bits command response address holding register */
#define REG_CMDRSP_ADDR_HI PCIE_SCRATCH_5_REG
#define REG_CMDRSP_ADDR_HI PCIE_SCRATCH_5_REG
/** TxBD's Read/Write pointer start from bit 16 */
#define TXBD_RW_PTR_START 16
#define TXBD_RW_PTR_START 16
/** RxBD's Read/Write pointer start from bit 0 */
#define RXBD_RW_PTR_STRAT 0
#define RXBD_RW_PTR_STRAT 0
#define MLAN_BD_FLAG_SOP MBIT(0)
#define MLAN_BD_FLAG_EOP MBIT(1)
#define MLAN_BD_FLAG_XS_SOP MBIT(2)
#define MLAN_BD_FLAG_XS_EOP MBIT(3)
#define MLAN_BD_FLAG_SOP MBIT(0)
#define MLAN_BD_FLAG_EOP MBIT(1)
#define MLAN_BD_FLAG_XS_SOP MBIT(2)
#define MLAN_BD_FLAG_XS_EOP MBIT(3)
/* Event buffer description write pointer */
#define REG_EVTBD_WRPTR PCIE_SCRATCH_10_REG
#define REG_EVTBD_WRPTR PCIE_SCRATCH_10_REG
/* Event buffer description read pointer */
#define REG_EVTBD_RDPTR PCIE_SCRATCH_11_REG
#define REG_EVTBD_RDPTR PCIE_SCRATCH_11_REG
/* Driver ready signature write pointer */
#define REG_DRV_READY PCIE_SCRATCH_12_REG
#define REG_DRV_READY PCIE_SCRATCH_12_REG
/** Event Read/Write pointer mask */
#define EVT_RW_PTR_MASK 0x0f
#define EVT_RW_PTR_MASK 0x0f
/** Event Read/Write pointer rollover bit */
#define EVT_RW_PTR_ROLLOVER_IND MBIT(7)
#define EVT_RW_PTR_ROLLOVER_IND MBIT(7)
#endif
/* Define PCIE block size for firmware download */
#define MLAN_PCIE_BLOCK_SIZE_FW_DNLD 256
#define MLAN_PCIE_BLOCK_SIZE_FW_DNLD 256
/** Extra added macros **/
#define MLAN_EVENT_HEADER_LEN 8
#define MLAN_EVENT_HEADER_LEN 8
/** Max interrupt status register read limit */
#define MAX_READ_REG_RETRY 10000
#define MAX_READ_REG_RETRY 10000
#ifdef PCIE8897
static const struct _mlan_pcie_card_reg mlan_reg_pcie8897 = {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/** @file mlan_sdio.h
*
* @brief This file contains definitions for SDIO interface.
* driver.
*
*
* @brief This file contains definitions for SDIO interface.
* driver.
*
*
* Copyright 2014-2020 NXP
*
@ -24,198 +24,204 @@
Change log:
****************************************************/
#ifndef _MLAN_SDIO_H
#define _MLAN_SDIO_H
#ifndef _MLAN_SDIO_H
#define _MLAN_SDIO_H
/** Block mode */
#ifndef BLOCK_MODE
#define BLOCK_MODE 1
#define BLOCK_MODE 1
#endif
/** Fixed address mode */
#ifndef FIXED_ADDRESS
#define FIXED_ADDRESS 0
#define FIXED_ADDRESS 0
#endif
/* Host Control Registers */
/** Host Control Registers : Host to Card Event */
#define HOST_TO_CARD_EVENT_REG 0x00
#define HOST_TO_CARD_EVENT_REG 0x00
/** Host Control Registers : Host terminates Command 53 */
#define HOST_TERM_CMD53 (0x1U << 2)
#define HOST_TERM_CMD53 (0x1U << 2)
/** Host Control Registers : Host without Command 53 finish host */
#define HOST_WO_CMD53_FINISH_HOST (0x1U << 2)
#define HOST_WO_CMD53_FINISH_HOST (0x1U << 2)
/** Host Control Registers : Host power up */
#define HOST_POWER_UP (0x1U << 1)
#define HOST_POWER_UP (0x1U << 1)
/** Host Control Registers : Host power down */
#define HOST_POWER_DOWN (0x1U << 0)
#define HOST_POWER_DOWN (0x1U << 0)
/** Host Control Registers : Upload host interrupt RSR */
#define UP_LD_HOST_INT_RSR (0x1U)
#define HOST_INT_RSR_MASK 0xFF
#define UP_LD_HOST_INT_RSR (0x1U)
#define HOST_INT_RSR_MASK 0xFF
/** Host Control Registers : Upload command port host interrupt status */
#define UP_LD_CMD_PORT_HOST_INT_STATUS (0x40U)
#define UP_LD_CMD_PORT_HOST_INT_STATUS (0x40U)
/** Host Control Registers : Download command port host interrupt status */
#define DN_LD_CMD_PORT_HOST_INT_STATUS (0x80U)
#define DN_LD_CMD_PORT_HOST_INT_STATUS (0x80U)
/** Host Control Registers : Upload host interrupt mask */
#define UP_LD_HOST_INT_MASK (0x1U)
#define UP_LD_HOST_INT_MASK (0x1U)
/** Host Control Registers : Download host interrupt mask */
#define DN_LD_HOST_INT_MASK (0x2U)
#define DN_LD_HOST_INT_MASK (0x2U)
/** Host Control Registers : Cmd port upload interrupt mask */
#define CMD_PORT_UPLD_INT_MASK (0x1U << 6)
#define CMD_PORT_UPLD_INT_MASK (0x1U << 6)
/** Host Control Registers : Cmd port download interrupt mask */
#define CMD_PORT_DNLD_INT_MASK (0x1U << 7)
#define CMD_PORT_DNLD_INT_MASK (0x1U << 7)
/** Enable Host interrupt mask */
#define HIM_ENABLE (UP_LD_HOST_INT_MASK | \
DN_LD_HOST_INT_MASK | \
CMD_PORT_UPLD_INT_MASK | \
CMD_PORT_DNLD_INT_MASK)
#define HIM_ENABLE \
(UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK | CMD_PORT_UPLD_INT_MASK | \
CMD_PORT_DNLD_INT_MASK)
/** Disable Host interrupt mask */
#define HIM_DISABLE 0xff
#define HIM_DISABLE 0xff
/** Host Control Registers : Upload host interrupt status */
#define UP_LD_HOST_INT_STATUS (0x1U)
#define UP_LD_HOST_INT_STATUS (0x1U)
/** Host Control Registers : Download host interrupt status */
#define DN_LD_HOST_INT_STATUS (0x2U)
#define DN_LD_HOST_INT_STATUS (0x2U)
/** Host Control Registers : Download CRC error */
#define DN_LD_CRC_ERR (0x1U << 2)
#define DN_LD_CRC_ERR (0x1U << 2)
/** Host Control Registers : Upload restart */
#define UP_LD_RESTART (0x1U << 1)
#define UP_LD_RESTART (0x1U << 1)
/** Host Control Registers : Download restart */
#define DN_LD_RESTART (0x1U << 0)
#define DN_LD_RESTART (0x1U << 0)
/** Card Control Registers : Command port upload ready */
#define UP_LD_CP_RDY (0x1U << 6)
#define UP_LD_CP_RDY (0x1U << 6)
/** Card Control Registers : Command port download ready */
#define DN_LD_CP_RDY (0x1U << 7)
#define DN_LD_CP_RDY (0x1U << 7)
/** Card Control Registers : Card I/O ready */
#define CARD_IO_READY (0x1U << 3)
#define CARD_IO_READY (0x1U << 3)
/** Card Control Registers : CIS card ready */
#define CIS_CARD_RDY (0x1U << 2)
#define CIS_CARD_RDY (0x1U << 2)
/** Card Control Registers : Upload card ready */
#define UP_LD_CARD_RDY (0x1U << 1)
#define UP_LD_CARD_RDY (0x1U << 1)
/** Card Control Registers : Download card ready */
#define DN_LD_CARD_RDY (0x1U << 0)
#define DN_LD_CARD_RDY (0x1U << 0)
/** Card Control Registers : Host power interrupt mask */
#define HOST_POWER_INT_MASK (0x1U << 3)
#define HOST_POWER_INT_MASK (0x1U << 3)
/** Card Control Registers : Abort card interrupt mask */
#define ABORT_CARD_INT_MASK (0x1U << 2)
#define ABORT_CARD_INT_MASK (0x1U << 2)
/** Card Control Registers : Upload card interrupt mask */
#define UP_LD_CARD_INT_MASK (0x1U << 1)
#define UP_LD_CARD_INT_MASK (0x1U << 1)
/** Card Control Registers : Download card interrupt mask */
#define DN_LD_CARD_INT_MASK (0x1U << 0)
#define DN_LD_CARD_INT_MASK (0x1U << 0)
/** Card Control Registers : Power up interrupt */
#define POWER_UP_INT (0x1U << 4)
#define POWER_UP_INT (0x1U << 4)
/** Card Control Registers : Power down interrupt */
#define POWER_DOWN_INT (0x1U << 3)
#define POWER_DOWN_INT (0x1U << 3)
/** Card Control Registers : Power up RSR */
#define POWER_UP_RSR (0x1U << 4)
#define POWER_UP_RSR (0x1U << 4)
/** Card Control Registers : Power down RSR */
#define POWER_DOWN_RSR (0x1U << 3)
#define POWER_DOWN_RSR (0x1U << 3)
/** Card Control Registers : SD test BUS 0 */
#define SD_TESTBUS0 (0x1U)
#define SD_TESTBUS0 (0x1U)
/** Card Control Registers : SD test BUS 1 */
#define SD_TESTBUS1 (0x1U)
#define SD_TESTBUS1 (0x1U)
/** Card Control Registers : SD test BUS 2 */
#define SD_TESTBUS2 (0x1U)
#define SD_TESTBUS2 (0x1U)
/** Card Control Registers : SD test BUS 3 */
#define SD_TESTBUS3 (0x1U)
#define SD_TESTBUS3 (0x1U)
/** Port for registers */
#define REG_PORT 0
#define REG_PORT 0
/** Port for memory */
#define MEM_PORT 0x10000
#define MEM_PORT 0x10000
/** Card Control Registers : cmd53 new mode */
#define CMD53_NEW_MODE (0x1U << 0)
#define CMD53_NEW_MODE (0x1U << 0)
/** Card Control Registers : cmd53 tx len format 1 (0x10) */
#define CMD53_TX_LEN_FORMAT_1 (0x1U << 4)
#define CMD53_TX_LEN_FORMAT_1 (0x1U << 4)
/** Card Control Registers : cmd53 tx len format 2 (0x20)*/
#define CMD53_TX_LEN_FORMAT_2 (0x1U << 5)
#define CMD53_TX_LEN_FORMAT_2 (0x1U << 5)
/** Card Control Registers : cmd53 rx len format 1 (0x40) */
#define CMD53_RX_LEN_FORMAT_1 (0x1U << 6)
#define CMD53_RX_LEN_FORMAT_1 (0x1U << 6)
/** Card Control Registers : cmd53 rx len format 2 (0x80)*/
#define CMD53_RX_LEN_FORMAT_2 (0x1U << 7)
#define CMD53_RX_LEN_FORMAT_2 (0x1U << 7)
#define CMD_PORT_RD_LEN_EN (0x1U << 2)
#define CMD_PORT_RD_LEN_EN (0x1U << 2)
/* Card Control Registers : cmd port auto enable */
#define CMD_PORT_AUTO_EN (0x1U << 0)
#define CMD_PORT_AUTO_EN (0x1U << 0)
/* Command port */
#define CMD_PORT_SLCT 0x8000
#define CMD_PORT_SLCT 0x8000
/** Misc. Config Register : Auto Re-enable interrupts */
#define AUTO_RE_ENABLE_INT MBIT(4)
#define AUTO_RE_ENABLE_INT MBIT(4)
/** Enable GPIO-1 as a duplicated signal of interrupt as appear of SDIO_DAT1*/
#define ENABLE_GPIO_1_INT_MODE 0x88
#define ENABLE_GPIO_1_INT_MODE 0x88
/** Scratch reg 3 2 : Configure GPIO-1 INT*/
#define SCRATCH_REG_32 0xEE
#define SCRATCH_REG_32 0xEE
/** Event header Len*/
#define MLAN_EVENT_HEADER_LEN 8
#define MLAN_EVENT_HEADER_LEN 8
/** SDIO byte mode size */
#define MAX_BYTE_MODE_SIZE 512
#define MAX_BYTE_MODE_SIZE 512
/** The base address for packet with multiple ports aggregation */
#define SDIO_MPA_ADDR_BASE 0x1000
#define SDIO_MPA_ADDR_BASE 0x1000
/** SDIO Tx aggregation in progress ? */
#define MP_TX_AGGR_IN_PROGRESS(a) (a->pcard_sd->mpa_tx.pkt_cnt > 0)
/** SDIO Tx aggregation buffer room for next packet ? */
#define MP_TX_AGGR_BUF_HAS_ROOM(a, mbuf, len) \
(((a->pcard_sd->mpa_tx.buf_len) + len) <= (a->pcard_sd->mpa_tx.buf_size))
#define MP_TX_AGGR_BUF_HAS_ROOM(a, mbuf, len) \
(((a->pcard_sd->mpa_tx.buf_len) + len) <= \
(a->pcard_sd->mpa_tx.buf_size))
/** Copy current packet (SDIO Tx aggregation buffer) to SDIO buffer */
#define MP_TX_AGGR_BUF_PUT(a, mbuf, port) do { \
pmadapter->callbacks.moal_memmove(a->pmoal_handle, \
&a->pcard_sd->mpa_tx.buf[a->pcard_sd->mpa_tx.buf_len], \
mbuf->pbuf+mbuf->data_offset, mbuf->data_len);\
a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \
a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \
*(t_u16 *)(mbuf->pbuf+mbuf->data_offset); \
if (!a->pcard_sd->mpa_tx.pkt_cnt) { \
a->pcard_sd->mpa_tx.start_port = port; \
} \
a->pcard_sd->mpa_tx.ports |= (1 << port); \
a->pcard_sd->mpa_tx.pkt_cnt++; \
} while (0)
#define MP_TX_AGGR_BUF_PUT(a, mbuf, port) \
do { \
pmadapter->callbacks.moal_memmove( \
a->pmoal_handle, \
&a->pcard_sd->mpa_tx.buf[a->pcard_sd->mpa_tx.buf_len], \
mbuf->pbuf + mbuf->data_offset, mbuf->data_len); \
a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \
a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \
*(t_u16 *)(mbuf->pbuf + mbuf->data_offset); \
if (!a->pcard_sd->mpa_tx.pkt_cnt) { \
a->pcard_sd->mpa_tx.start_port = port; \
} \
a->pcard_sd->mpa_tx.ports |= (1 << port); \
a->pcard_sd->mpa_tx.pkt_cnt++; \
} while (0)
#define MP_TX_AGGR_BUF_PUT_SG(a, mbuf, port) do { \
a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \
a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \
*(t_u16 *)(mbuf->pbuf+mbuf->data_offset); \
a->pcard_sd->mpa_tx.mbuf_arr[a->pcard_sd->mpa_tx.pkt_cnt] = mbuf; \
if (!a->pcard_sd->mpa_tx.pkt_cnt) { \
a->pcard_sd->mpa_tx.start_port = port; \
} \
a->pcard_sd->mpa_tx.ports |= (1 << port); \
a->pcard_sd->mpa_tx.pkt_cnt++; \
} while (0)
#define MP_TX_AGGR_BUF_PUT_SG(a, mbuf, port) \
do { \
a->pcard_sd->mpa_tx.buf_len += mbuf->data_len; \
a->pcard_sd->mpa_tx.mp_wr_info[a->pcard_sd->mpa_tx.pkt_cnt] = \
*(t_u16 *)(mbuf->pbuf + mbuf->data_offset); \
a->pcard_sd->mpa_tx.mbuf_arr[a->pcard_sd->mpa_tx.pkt_cnt] = \
mbuf; \
if (!a->pcard_sd->mpa_tx.pkt_cnt) { \
a->pcard_sd->mpa_tx.start_port = port; \
} \
a->pcard_sd->mpa_tx.ports |= (1 << port); \
a->pcard_sd->mpa_tx.pkt_cnt++; \
} while (0)
/** SDIO Tx aggregation limit ? */
#define MP_TX_AGGR_PKT_LIMIT_REACHED(a) ((a->pcard_sd->mpa_tx.pkt_cnt) \
== (a->pcard_sd->mpa_tx.pkt_aggr_limit))
#define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \
((a->pcard_sd->mpa_tx.pkt_cnt) == (a->pcard_sd->mpa_tx.pkt_aggr_limit))
/** Reset SDIO Tx aggregation buffer parameters */
#define MP_TX_AGGR_BUF_RESET(a) do { \
memset(a, a->pcard_sd->mpa_tx.mp_wr_info, 0, sizeof(a->pcard_sd->mpa_tx.mp_wr_info)); \
a->pcard_sd->mpa_tx.pkt_cnt = 0; \
a->pcard_sd->mpa_tx.buf_len = 0; \
a->pcard_sd->mpa_tx.ports = 0; \
a->pcard_sd->mpa_tx.start_port = 0; \
} while (0)
#define MP_TX_AGGR_BUF_RESET(a) \
do { \
memset(a, a->pcard_sd->mpa_tx.mp_wr_info, 0, \
sizeof(a->pcard_sd->mpa_tx.mp_wr_info)); \
a->pcard_sd->mpa_tx.pkt_cnt = 0; \
a->pcard_sd->mpa_tx.buf_len = 0; \
a->pcard_sd->mpa_tx.ports = 0; \
a->pcard_sd->mpa_tx.start_port = 0; \
} while (0)
/** SDIO Rx aggregation limit ? */
#define MP_RX_AGGR_PKT_LIMIT_REACHED(a) (a->pcard_sd->mpa_rx.pkt_cnt \
== a->pcard_sd->mpa_rx.pkt_aggr_limit)
#define MP_RX_AGGR_PKT_LIMIT_REACHED(a) \
(a->pcard_sd->mpa_rx.pkt_cnt == a->pcard_sd->mpa_rx.pkt_aggr_limit)
/** SDIO Rx aggregation port limit ? */
/** this is for test only, because port 0 is reserved for control port */
@ -223,44 +229,48 @@ Change log:
/* receive packets aggregated up to a half of mp_end_port */
/* note: hw rx wraps round only after port (MAX_PORT-1) */
#define MP_RX_AGGR_PORT_LIMIT_REACHED(a) \
(((a->pcard_sd->curr_rd_port < a->pcard_sd->mpa_rx.start_port) && \
(((MAX_PORT - a->pcard_sd->mpa_rx.start_port) + a->pcard_sd->curr_rd_port) \
>= (a->pcard_sd->mp_end_port >> 1))) || \
((a->pcard_sd->curr_rd_port - a->pcard_sd->mpa_rx.start_port) >= \
(a->pcard_sd->mp_end_port >> 1)))
#define MP_RX_AGGR_PORT_LIMIT_REACHED(a) \
(((a->pcard_sd->curr_rd_port < a->pcard_sd->mpa_rx.start_port) && \
(((MAX_PORT - a->pcard_sd->mpa_rx.start_port) + \
a->pcard_sd->curr_rd_port) >= (a->pcard_sd->mp_end_port >> 1))) || \
((a->pcard_sd->curr_rd_port - a->pcard_sd->mpa_rx.start_port) >= \
(a->pcard_sd->mp_end_port >> 1)))
/** SDIO Rx aggregation in progress ? */
#define MP_RX_AGGR_IN_PROGRESS(a) (a->pcard_sd->mpa_rx.pkt_cnt > 0)
/** SDIO Rx aggregation buffer room for next packet ? */
#define MP_RX_AGGR_BUF_HAS_ROOM(a, rx_len) \
#define MP_RX_AGGR_BUF_HAS_ROOM(a, rx_len) \
((a->pcard_sd->mpa_rx.buf_len + rx_len) <= a->pcard_sd->mpa_rx.buf_size)
/** Prepare to copy current packet from card to SDIO Rx aggregation buffer */
#define MP_RX_AGGR_SETUP(a, mbuf, port, rx_len) do { \
a->pcard_sd->mpa_rx.buf_len += rx_len; \
if (!a->pcard_sd->mpa_rx.pkt_cnt) { \
a->pcard_sd->mpa_rx.start_port = port; \
} \
a->pcard_sd->mpa_rx.ports |= (1 << port); \
a->pcard_sd->mpa_rx.mbuf_arr[a->pcard_sd->mpa_rx.pkt_cnt] = mbuf; \
a->pcard_sd->mpa_rx.len_arr[a->pcard_sd->mpa_rx.pkt_cnt] = rx_len; \
a->pcard_sd->mpa_rx.pkt_cnt++; \
} while (0)
#define MP_RX_AGGR_SETUP(a, mbuf, port, rx_len) \
do { \
a->pcard_sd->mpa_rx.buf_len += rx_len; \
if (!a->pcard_sd->mpa_rx.pkt_cnt) { \
a->pcard_sd->mpa_rx.start_port = port; \
} \
a->pcard_sd->mpa_rx.ports |= (1 << port); \
a->pcard_sd->mpa_rx.mbuf_arr[a->pcard_sd->mpa_rx.pkt_cnt] = \
mbuf; \
a->pcard_sd->mpa_rx.len_arr[a->pcard_sd->mpa_rx.pkt_cnt] = \
rx_len; \
a->pcard_sd->mpa_rx.pkt_cnt++; \
} while (0)
/** Reset SDIO Rx aggregation buffer parameters */
#define MP_RX_AGGR_BUF_RESET(a) do { \
a->pcard_sd->mpa_rx.pkt_cnt = 0; \
a->pcard_sd->mpa_rx.buf_len = 0; \
a->pcard_sd->mpa_rx.ports = 0; \
a->pcard_sd->mpa_rx.start_port = 0; \
} while (0)
#define MP_RX_AGGR_BUF_RESET(a) \
do { \
a->pcard_sd->mpa_rx.pkt_cnt = 0; \
a->pcard_sd->mpa_rx.buf_len = 0; \
a->pcard_sd->mpa_rx.ports = 0; \
a->pcard_sd->mpa_rx.start_port = 0; \
} while (0)
/** aggr buf size 32k */
#define SDIO_MP_AGGR_BUF_SIZE_32K (32768)
#define SDIO_MP_AGGR_BUF_SIZE_32K (32768)
/** max aggr buf size 64k-256 */
#define SDIO_MP_AGGR_BUF_SIZE_MAX (65280)
#define SDIO_MP_AGGR_BUF_SIZE_MAX (65280)
#ifdef SD8887
static const struct _mlan_sdio_card_reg mlan_reg_sd8887 = {
@ -270,9 +280,10 @@ static const struct _mlan_sdio_card_reg mlan_reg_sd8887 = {
.base_1_reg = 0x6D,
.poll_reg = 0x5C,
.host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK |
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
.host_int_status = DN_LD_HOST_INT_STATUS | UP_LD_HOST_INT_STATUS |
DN_LD_CMD_PORT_HOST_INT_STATUS | UP_LD_CMD_PORT_HOST_INT_STATUS,
DN_LD_CMD_PORT_HOST_INT_STATUS |
UP_LD_CMD_PORT_HOST_INT_STATUS,
.status_reg_0 = 0x90,
.status_reg_1 = 0x91,
.sdio_int_mask = 0xff,
@ -339,9 +350,10 @@ static const struct _mlan_sdio_card_reg mlan_reg_sd8897 = {
.base_1_reg = 0x61,
.poll_reg = 0x50,
.host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK |
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
.host_int_status = DN_LD_HOST_INT_STATUS | UP_LD_HOST_INT_STATUS |
DN_LD_CMD_PORT_HOST_INT_STATUS | UP_LD_CMD_PORT_HOST_INT_STATUS,
DN_LD_CMD_PORT_HOST_INT_STATUS |
UP_LD_CMD_PORT_HOST_INT_STATUS,
.status_reg_0 = 0xC0,
.status_reg_1 = 0xC1,
.sdio_int_mask = 0xff,
@ -400,7 +412,8 @@ static const struct _mlan_card_info mlan_card_info_sd8897 = {
};
#endif
#if defined(SD8977) || defined(SD8997) || defined(SD8987) || defined(SD9098) || defined(SD9097) || defined(SD8978)
#if defined(SD8977) || defined(SD8997) || defined(SD8987) || \
defined(SD9098) || defined(SD9097) || defined(SD8978)
static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
.start_rd_port = 0,
.start_wr_port = 0,
@ -408,9 +421,10 @@ static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
.base_1_reg = 0xf9,
.poll_reg = 0x5C,
.host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK |
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
.host_int_status = DN_LD_HOST_INT_STATUS | UP_LD_HOST_INT_STATUS |
DN_LD_CMD_PORT_HOST_INT_STATUS | UP_LD_CMD_PORT_HOST_INT_STATUS,
DN_LD_CMD_PORT_HOST_INT_STATUS |
UP_LD_CMD_PORT_HOST_INT_STATUS,
.status_reg_0 = 0xe8,
.status_reg_1 = 0xe9,
.sdio_int_mask = 0xff,

View File

@ -108,23 +108,21 @@ mlan_operations *mlan_ops[] = {
};
/** Global moal_assert callback */
t_void (*assert_callback) (IN t_void *pmoal_handle, IN t_u32 cond) = MNULL;
t_void (*assert_callback)(IN t_void *pmoal_handle, IN t_u32 cond) = MNULL;
#ifdef DEBUG_LEVEL1
#ifdef DEBUG_LEVEL2
#define DEFAULT_DEBUG_MASK (0xffffffff)
#define DEFAULT_DEBUG_MASK (0xffffffff)
#else
#define DEFAULT_DEBUG_MASK (MMSG | MFATAL | MERROR)
#define DEFAULT_DEBUG_MASK (MMSG | MFATAL | MERROR)
#endif
/** Global moal_print callback */
t_void (*print_callback) (IN t_void *pmoal_handle,
IN t_u32 level, IN char *pformat, IN ...
) = MNULL;
t_void (*print_callback)(IN t_void *pmoal_handle, IN t_u32 level,
IN char *pformat, IN...) = MNULL;
/** Global moal_get_system_time callback */
mlan_status (*get_sys_time_callback) (IN t_void *pmoal_handle,
OUT t_u32 *psec,
OUT t_u32 *pusec) = MNULL;
mlan_status (*get_sys_time_callback)(IN t_void *pmoal_handle, OUT t_u32 *psec,
OUT t_u32 *pusec) = MNULL;
/** Global driver debug mit masks */
t_u32 mlan_drvdbg = DEFAULT_DEBUG_MASK;
@ -142,8 +140,7 @@ extern mlan_status wlan_get_usb_device(pmlan_adapter pmadapter);
* @param pmadapter A pointer to mlan_adapter structure
*
*/
void
wlan_process_pending_ioctl(mlan_adapter *pmadapter)
void wlan_process_pending_ioctl(mlan_adapter *pmadapter)
{
pmlan_ioctl_req pioctl_buf;
mlan_status status = MLAN_STATUS_SUCCESS;
@ -158,11 +155,9 @@ wlan_process_pending_ioctl(mlan_adapter *pmadapter)
pcb = &pmadapter->callbacks;
while ((pioctl_buf =
(pmlan_ioctl_req)util_dequeue_list(pmadapter->pmoal_handle,
&pmadapter->ioctl_pending_q,
pcb->moal_spin_lock,
pcb->moal_spin_unlock))) {
while ((pioctl_buf = (pmlan_ioctl_req)util_dequeue_list(
pmadapter->pmoal_handle, &pmadapter->ioctl_pending_q,
pcb->moal_spin_lock, pcb->moal_spin_unlock))) {
switch (pioctl_buf->req_id) {
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
case MLAN_IOCTL_BSS:
@ -194,7 +189,6 @@ wlan_process_pending_ioctl(mlan_adapter *pmadapter)
}
LEAVE();
}
/********************************************************
Global Functions
********************************************************/
@ -235,8 +229,7 @@ extern mlan_adapter_operations mlan_sdio_ops;
* See Also
* mlan_unregister
*/
mlan_status
mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
mlan_status mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_adapter pmadapter = MNULL;
@ -285,8 +278,8 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
goto exit_register;
}
pmdevice->callbacks.moal_memset(pmdevice->pmoal_handle, pmadapter,
0, sizeof(mlan_adapter));
pmdevice->callbacks.moal_memset(pmdevice->pmoal_handle, pmadapter, 0,
sizeof(mlan_adapter));
pcb = &pmadapter->callbacks;
@ -467,6 +460,7 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
pmadapter->rx_data_ep = pmdevice->rx_data_ep;
}
#endif
pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg;
pmadapter->priv_num = 0;
pmadapter->priv[0] = MNULL;
@ -515,7 +509,7 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
break;
}
}
/** back up bss_attr table */
/** back up bss_attr table */
memcpy_ext(pmadapter, pmadapter->bss_attr, pmdevice->bss_attr,
sizeof(pmadapter->bss_attr), sizeof(pmadapter->bss_attr));
@ -525,7 +519,7 @@ mlan_register(IN pmlan_device pmdevice, OUT t_void **ppmlan_adapter)
goto error;
}
/** init lock varible for first priv */
/** init lock varible for first priv */
if (wlan_init_priv_lock_list(pmadapter, 0) != MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
goto error;
@ -581,9 +575,7 @@ exit_register:
* @return MLAN_STATUS_SUCCESS
* The deregistration succeeded.
*/
mlan_status
mlan_unregister(IN t_void *pmlan_adapter
)
mlan_status mlan_unregister(IN t_void *pmlan_adapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -633,8 +625,7 @@ mlan_unregister(IN t_void *pmlan_adapter
* MLAN_STATUS_FAILURE
* The firmware download failed.
*/
mlan_status
mlan_dnld_fw(IN t_void *pmlan_adapter, IN pmlan_fw_image pmfw)
mlan_status mlan_dnld_fw(IN t_void *pmlan_adapter, IN pmlan_fw_image pmfw)
{
mlan_status ret = MLAN_STATUS_FAILURE;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -666,8 +657,8 @@ mlan_dnld_fw(IN t_void *pmlan_adapter, IN pmlan_fw_image pmfw)
* @return MLAN_STATUS_SUCCESS
*
*/
mlan_status
mlan_set_init_param(IN t_void *pmlan_adapter, IN pmlan_init_param pparam)
mlan_status mlan_set_init_param(IN t_void *pmlan_adapter,
IN pmlan_init_param pparam)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -675,7 +666,7 @@ mlan_set_init_param(IN t_void *pmlan_adapter, IN pmlan_init_param pparam)
ENTER();
MASSERT(pmlan_adapter);
/** Save DPD data in MLAN */
/** Save DPD data in MLAN */
if ((pparam->pdpd_data_buf) && (pparam->dpd_data_len > 0)) {
pmadapter->pdpd_data = pparam->pdpd_data_buf;
pmadapter->dpd_data_len = pparam->dpd_data_len;
@ -684,7 +675,7 @@ mlan_set_init_param(IN t_void *pmlan_adapter, IN pmlan_init_param pparam)
pmadapter->ptxpwr_data = pparam->ptxpwr_data_buf;
pmadapter->txpwr_data_len = pparam->txpwr_data_len;
}
/** Save cal data in MLAN */
/** Save cal data in MLAN */
if ((pparam->pcal_data_buf) && (pparam->cal_data_len > 0)) {
pmadapter->pcal_data = pparam->pcal_data_buf;
pmadapter->cal_data_len = pparam->cal_data_len;
@ -707,9 +698,7 @@ mlan_set_init_param(IN t_void *pmlan_adapter, IN pmlan_init_param pparam)
* MLAN_STATUS_FAILURE
* The firmware initialization failed.
*/
mlan_status
mlan_init_fw(IN t_void *pmlan_adapter
)
mlan_status mlan_init_fw(IN t_void *pmlan_adapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -739,9 +728,7 @@ mlan_init_fw(IN t_void *pmlan_adapter
* MLAN_STATUS_FAILURE
* The firmware shutdown call failed.
*/
mlan_status
mlan_shutdown_fw(IN t_void *pmlan_adapter
)
mlan_status mlan_shutdown_fw(IN t_void *pmlan_adapter)
{
mlan_status ret = MLAN_STATUS_PENDING;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -780,23 +767,18 @@ mlan_shutdown_fw(IN t_void *pmlan_adapter
}
pcb = &pmadapter->callbacks;
/** cancel pending ioctl */
while ((pioctl_buf =
(pmlan_ioctl_req)util_dequeue_list(pmadapter->pmoal_handle,
&pmadapter->ioctl_pending_q,
pcb->moal_spin_lock,
pcb->moal_spin_unlock))) {
/** cancel pending ioctl */
while ((pioctl_buf = (pmlan_ioctl_req)util_dequeue_list(
pmadapter->pmoal_handle, &pmadapter->ioctl_pending_q,
pcb->moal_spin_lock, pcb->moal_spin_unlock))) {
pioctl_buf->status_code = MLAN_ERROR_CMD_CANCEL;
pcb->moal_ioctl_complete(pmadapter->pmoal_handle, pioctl_buf,
MLAN_STATUS_FAILURE);
}
while ((pmbuf = (pmlan_buffer)util_dequeue_list(pmadapter->pmoal_handle,
&pmadapter->
rx_data_queue,
pcb->moal_spin_lock,
pcb->
moal_spin_unlock))) {
while ((pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle, &pmadapter->rx_data_queue,
pcb->moal_spin_lock, pcb->moal_spin_unlock))) {
#ifdef USB
if (IS_USB(pmadapter->card_type))
pcb->moal_recv_complete(pmadapter->pmoal_handle, pmbuf,
@ -830,8 +812,7 @@ mlan_shutdown_fw(IN t_void *pmlan_adapter
*
* @return N/A
*/
static t_void
mlan_queue_main_work(mlan_adapter *pmadapter)
static t_void mlan_queue_main_work(mlan_adapter *pmadapter)
{
pmlan_callbacks pcb = &pmadapter->callbacks;
ENTER();
@ -860,8 +841,7 @@ mlan_queue_main_work(mlan_adapter *pmadapter)
*
* @return N/A
*/
static t_void
mlan_queue_rx_work(mlan_adapter *pmadapter)
static t_void mlan_queue_rx_work(mlan_adapter *pmadapter)
{
pmlan_callbacks pcb = &pmadapter->callbacks;
ENTER();
@ -891,8 +871,7 @@ mlan_queue_rx_work(mlan_adapter *pmadapter)
*
* @return N/A
*/
void
mlan_block_main_process(mlan_adapter *pmadapter, t_u8 block)
void mlan_block_main_process(mlan_adapter *pmadapter, t_u8 block)
{
pmlan_callbacks pcb = &pmadapter->callbacks;
pcb->moal_spin_lock(pmadapter->pmoal_handle,
@ -907,10 +886,9 @@ mlan_block_main_process(mlan_adapter *pmadapter, t_u8 block)
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->pmain_proc_lock);
PRINTM(MEVENT, "wlan: wait main work done...\n");
wlan_recv_event(wlan_get_priv
(pmadapter, MLAN_BSS_ROLE_ANY),
MLAN_EVENT_ID_DRV_FLUSH_MAIN_WORK,
MNULL);
wlan_recv_event(
wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY),
MLAN_EVENT_ID_DRV_FLUSH_MAIN_WORK, MNULL);
} else {
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->pmain_proc_lock);
@ -926,8 +904,7 @@ mlan_block_main_process(mlan_adapter *pmadapter, t_u8 block)
*
* @return N/A
*/
void
mlan_block_rx_process(mlan_adapter *pmadapter, t_u8 block)
void mlan_block_rx_process(mlan_adapter *pmadapter, t_u8 block)
{
pmlan_callbacks pcb = &pmadapter->callbacks;
pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->prx_proc_lock);
@ -941,8 +918,8 @@ mlan_block_rx_process(mlan_adapter *pmadapter, t_u8 block)
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->prx_proc_lock);
PRINTM(MEVENT, "wlan: wait rx work done...\n");
wlan_recv_event(wlan_get_priv
(pmadapter, MLAN_BSS_ROLE_ANY),
wlan_recv_event(wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MLAN_EVENT_ID_DRV_FLUSH_RX_WORK, MNULL);
} else {
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
@ -959,8 +936,7 @@ mlan_block_rx_process(mlan_adapter *pmadapter, t_u8 block)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
mlan_rx_process(IN t_void *pmlan_adapter, IN t_u8 *rx_pkts)
mlan_status mlan_rx_process(IN t_void *pmlan_adapter, IN t_u8 *rx_pkts)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -992,14 +968,12 @@ rx_process_start:
while (MTRUE) {
#ifdef DRV_EMBEDDED_AUTHENTICATOR
if (pmadapter->authenticator_priv) {
if (IsAuthenticatorEnabled
(pmadapter->authenticator_priv->psapriv)) {
AuthenticatorKeyMgmtInit(pmadapter->
authenticator_priv->
psapriv,
pmadapter->
authenticator_priv->
curr_addr);
if (IsAuthenticatorEnabled(
pmadapter->authenticator_priv->psapriv)) {
AuthenticatorKeyMgmtInit(
pmadapter->authenticator_priv->psapriv,
pmadapter->authenticator_priv
->curr_addr);
pmadapter->authenticator_priv = MNULL;
}
}
@ -1008,26 +982,23 @@ rx_process_start:
pmadapter->flush_data = MFALSE;
wlan_flush_rxreorder_tbl(pmadapter);
}
pmadapter->callbacks.moal_spin_lock(pmadapter->pmoal_handle,
pmadapter->rx_data_queue.
plock);
pmbuf = (pmlan_buffer)util_dequeue_list(pmadapter->pmoal_handle,
&pmadapter->
rx_data_queue, MNULL,
MNULL);
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle, &pmadapter->rx_data_queue,
MNULL, MNULL);
if (!pmbuf) {
pmadapter->callbacks.moal_spin_unlock(pmadapter->
pmoal_handle,
pmadapter->
rx_data_queue.
plock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
break;
}
pmadapter->rx_pkts_queued--;
rx_num++;
pmadapter->callbacks.moal_spin_unlock(pmadapter->pmoal_handle,
pmadapter->rx_data_queue.
plock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
if (pmadapter->delay_task_flag &&
(pmadapter->rx_pkts_queued < LOW_RX_PENDING)) {
PRINTM(MEVENT, "Run\n");
@ -1062,9 +1033,7 @@ exit_rx_proc:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
mlan_main_process(IN t_void *pmlan_adapter
)
mlan_status mlan_main_process(IN t_void *pmlan_adapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -1103,9 +1072,8 @@ process_start:
}
if (pmadapter->pending_disconnect_priv) {
PRINTM(MEVENT, "Reset connect state\n");
wlan_reset_connect_state(pmadapter->
pending_disconnect_priv,
MTRUE);
wlan_reset_connect_state(
pmadapter->pending_disconnect_priv, MTRUE);
pmadapter->pending_disconnect_priv = MNULL;
}
#if defined(SDIO) || defined(PCIE)
@ -1132,54 +1100,54 @@ process_start:
(pmadapter->pm_wakeup_card_req &&
!pmadapter->pm_wakeup_fw_try) &&
(wlan_is_cmd_pending(pmadapter) ||
!wlan_bypass_tx_list_empty(pmadapter)
|| !wlan_wmm_lists_empty(pmadapter)
)) {
!wlan_bypass_tx_list_empty(pmadapter) ||
!wlan_wmm_lists_empty(pmadapter))) {
pmadapter->ops.wakeup_card(pmadapter, MTRUE);
pmadapter->pm_wakeup_fw_try = MTRUE;
continue;
}
if (IS_CARD_RX_RCVD(pmadapter)
|| (!pmadapter->cmd_sent &&
pmadapter->vdll_ctrl.pending_block)
) {
if (IS_CARD_RX_RCVD(pmadapter) ||
(!pmadapter->cmd_sent &&
pmadapter->vdll_ctrl.pending_block)) {
pmadapter->data_received = MFALSE;
if (pmadapter->hs_activated == MTRUE) {
pmadapter->is_hs_configured = MFALSE;
wlan_host_sleep_activated_event(wlan_get_priv
(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
wlan_host_sleep_activated_event(
wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
}
pmadapter->pm_wakeup_fw_try = MFALSE;
if (pmadapter->ps_state == PS_STATE_SLEEP)
pmadapter->ps_state = PS_STATE_AWAKE;
if (pmadapter->wakeup_fw_timer_is_set) {
pcb->moal_stop_timer(pmadapter->pmoal_handle,
pmadapter->
pwakeup_fw_timer);
pcb->moal_stop_timer(
pmadapter->pmoal_handle,
pmadapter->pwakeup_fw_timer);
pmadapter->wakeup_fw_timer_is_set = MFALSE;
}
} else {
/* We have tried to wakeup the card already */
if (pmadapter->pm_wakeup_fw_try)
break;
/* Check if we need to confirm Sleep Request received previously */
/* Check if we need to confirm Sleep Request received
* previously */
if (pmadapter->ps_state == PS_STATE_PRE_SLEEP)
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd
&& !pmadapter->vdll_ctrl.pending_block)
if (!pmadapter->cmd_sent &&
!pmadapter->curr_cmd &&
!pmadapter->vdll_ctrl.pending_block)
wlan_check_ps_cond(pmadapter);
if (pmadapter->ps_state != PS_STATE_AWAKE ||
(pmadapter->tx_lock_flag == MTRUE))
break;
if (pmadapter->data_sent
|| (wlan_bypass_tx_list_empty(pmadapter) &&
wlan_wmm_lists_empty(pmadapter))
|| wlan_11h_radar_detected_tx_blocked(pmadapter)
) {
if (pmadapter->cmd_sent || pmadapter->curr_cmd
|| !wlan_is_cmd_pending(pmadapter)) {
if (pmadapter->data_sent ||
(wlan_bypass_tx_list_empty(pmadapter) &&
wlan_wmm_lists_empty(pmadapter)) ||
wlan_11h_radar_detected_tx_blocked(pmadapter)) {
if (pmadapter->cmd_sent ||
pmadapter->curr_cmd ||
!wlan_is_cmd_pending(pmadapter)) {
break;
}
}
@ -1191,7 +1159,8 @@ process_start:
wlan_process_cmdresp(pmadapter);
/* call moal back when init_fw is done */
if (pmadapter->hw_status == WlanHardwareStatusInitdone) {
if (pmadapter->hw_status ==
WlanHardwareStatusInitdone) {
pmadapter->hw_status = WlanHardwareStatusReady;
wlan_init_fw_complete(pmadapter);
} else if (pmadapter->hw_status ==
@ -1208,31 +1177,30 @@ process_start:
wlan_process_event(pmadapter);
}
/* Check if we need to confirm Sleep Request received previously */
/* Check if we need to confirm Sleep Request received previously
*/
if (pmadapter->ps_state == PS_STATE_PRE_SLEEP)
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd
&& !pmadapter->vdll_ctrl.pending_block)
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd &&
!pmadapter->vdll_ctrl.pending_block)
wlan_check_ps_cond(pmadapter);
/*
* The ps_state may have been changed during processing of
* Sleep Request event.
*/
if ((pmadapter->ps_state == PS_STATE_SLEEP)
|| (pmadapter->ps_state == PS_STATE_PRE_SLEEP)
|| (pmadapter->ps_state == PS_STATE_SLEEP_CFM)
|| (pmadapter->tx_lock_flag == MTRUE)
) {
if ((pmadapter->ps_state == PS_STATE_SLEEP) ||
(pmadapter->ps_state == PS_STATE_PRE_SLEEP) ||
(pmadapter->ps_state == PS_STATE_SLEEP_CFM) ||
(pmadapter->tx_lock_flag == MTRUE)) {
continue;
}
/* in a case of race condition, download the VDLL block here */
if (!pmadapter->cmd_sent && pmadapter->vdll_ctrl.pending_block) {
wlan_download_vdll_block(pmadapter,
pmadapter->vdll_ctrl.
pending_block,
pmadapter->vdll_ctrl.
pending_block_len);
if (!pmadapter->cmd_sent &&
pmadapter->vdll_ctrl.pending_block) {
wlan_download_vdll_block(
pmadapter, pmadapter->vdll_ctrl.pending_block,
pmadapter->vdll_ctrl.pending_block_len);
pmadapter->vdll_ctrl.pending_block = MNULL;
}
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd) {
@ -1250,23 +1218,22 @@ process_start:
wlan_process_bypass_tx(pmadapter);
if (pmadapter->hs_activated == MTRUE) {
pmadapter->is_hs_configured = MFALSE;
wlan_host_sleep_activated_event(wlan_get_priv
(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
wlan_host_sleep_activated_event(
wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
}
}
if (!pmadapter->data_sent && !wlan_wmm_lists_empty(pmadapter)
&& !wlan_11h_radar_detected_tx_blocked(pmadapter)
) {
if (!pmadapter->data_sent && !wlan_wmm_lists_empty(pmadapter) &&
!wlan_11h_radar_detected_tx_blocked(pmadapter)) {
wlan_wmm_process_tx(pmadapter);
if (pmadapter->hs_activated == MTRUE) {
pmadapter->is_hs_configured = MFALSE;
wlan_host_sleep_activated_event(wlan_get_priv
(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
wlan_host_sleep_activated_event(
wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MFALSE);
}
}
@ -1275,11 +1242,11 @@ process_start:
!pmadapter->curr_cmd && !wlan_is_cmd_pending(pmadapter) &&
wlan_bypass_tx_list_empty(pmadapter) &&
wlan_wmm_lists_empty(pmadapter)) {
if (wlan_send_null_packet
(wlan_get_priv(pmadapter, MLAN_BSS_ROLE_STA),
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET)
== MLAN_STATUS_SUCCESS) {
if (wlan_send_null_packet(
wlan_get_priv(pmadapter, MLAN_BSS_ROLE_STA),
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) ==
MLAN_STATUS_SUCCESS) {
pmadapter->delay_null_pkt = MFALSE;
}
break;
@ -1315,8 +1282,7 @@ exit_main_proc:
*
* @return MLAN_STATUS_PENDING
*/
mlan_status
mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
mlan_status mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
{
mlan_status ret = MLAN_STATUS_PENDING;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -1324,9 +1290,9 @@ mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
t_u16 eth_type = 0;
ENTER();
MASSERT(pmlan_adapter &&pmbuf);
MASSERT(pmlan_adapter && pmbuf);
if (!pmlan_adapter ||!pmbuf) {
if (!pmlan_adapter || !pmbuf) {
return MLAN_STATUS_FAILURE;
}
@ -1335,16 +1301,14 @@ mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
pmpriv = pmadapter->priv[pmbuf->bss_index];
eth_type =
mlan_ntohs(*(t_u16 *)&pmbuf->
pbuf[pmbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET]);
mlan_ntohs(*(t_u16 *)&pmbuf->pbuf[pmbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET]);
if (((pmadapter->priv[pmbuf->bss_index]->port_ctrl_mode == MTRUE) &&
((eth_type == MLAN_ETHER_PKT_TYPE_EAPOL)
|| (eth_type == MLAN_ETHER_PKT_TYPE_WAPI)
))
|| (pmbuf->buf_type == MLAN_BUF_TYPE_RAW_DATA)
((eth_type == MLAN_ETHER_PKT_TYPE_EAPOL) ||
(eth_type == MLAN_ETHER_PKT_TYPE_WAPI))) ||
(pmbuf->buf_type == MLAN_BUF_TYPE_RAW_DATA)
) {
) {
if (eth_type == MLAN_ETHER_PKT_TYPE_EAPOL) {
PRINTM_NETINTF(MMSG, pmpriv);
PRINTM(MMSG, "wlan: Send EAPOL pkt to " MACSTR "\n",
@ -1352,7 +1316,7 @@ mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
}
wlan_add_buf_bypass_txqueue(pmadapter, pmbuf);
} else {
/* Transmit the packet */
/* Transmit the packet*/
wlan_wmm_add_buf_txqueue(pmadapter, pmbuf);
}
@ -1366,10 +1330,10 @@ mlan_send_packet(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf)
* @param adapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise fail
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success,
* otherwise fail
*/
mlan_status
mlan_ioctl(IN t_void *adapter, IN pmlan_ioctl_req pioctl_req)
mlan_status mlan_ioctl(IN t_void *adapter, IN pmlan_ioctl_req pioctl_req)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_adapter pmadapter = (pmlan_adapter)adapter;
@ -1405,10 +1369,9 @@ exit:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
mlan_write_data_async_complete(IN t_void *pmlan_adapter,
IN pmlan_buffer pmbuf,
IN t_u32 port, IN mlan_status status)
mlan_status mlan_write_data_async_complete(IN t_void *pmlan_adapter,
IN pmlan_buffer pmbuf, IN t_u32 port,
IN mlan_status status)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -1436,10 +1399,11 @@ mlan_write_data_async_complete(IN t_void *pmlan_adapter,
* @param pmbuf A pointer to mlan_buffer structure
* @param port Data port
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE or MLAN_STATUS_PENDING
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE or
* MLAN_STATUS_PENDING
*/
mlan_status
mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
mlan_status mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf,
IN t_u32 port)
{
mlan_status ret = MLAN_STATUS_PENDING;
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -1453,7 +1417,7 @@ mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
ENTER();
MASSERT(pmlan_adapter &&pmbuf);
MASSERT(pmlan_adapter && pmbuf);
if (pmadapter->hs_activated == MTRUE)
wlan_process_hs_config(pmadapter);
@ -1480,11 +1444,11 @@ mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
if (pmadapter->ps_state == PS_STATE_SLEEP_CFM) {
pmbuf->data_offset += MLAN_TYPE_LEN;
pmbuf->data_len -= MLAN_TYPE_LEN;
wlan_process_sleep_confirm_resp
(pmadapter,
pmbuf->pbuf +
pmbuf->data_offset,
pmbuf->data_len);
wlan_process_sleep_confirm_resp(
pmadapter,
pmbuf->pbuf +
pmbuf->data_offset,
pmbuf->data_len);
pmbuf->flags |=
MLAN_BUF_FLAG_SLEEPCFM_RESP;
ret = MLAN_STATUS_SUCCESS;
@ -1534,18 +1498,16 @@ mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
PRINTM(MDATA, "mlan_recv: DATA (%lu.%06lu)\n", sec, usec);
#if defined(USB)
if (pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.enable) {
max_rx_data_size =
pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_max;
if (pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_mode == MLAN_USB_AGGR_MODE_NUM) {
max_rx_data_size = pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_max;
if (pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl
.aggr_mode == MLAN_USB_AGGR_MODE_NUM) {
max_rx_data_size *=
MAX(MLAN_USB_MAX_PKT_SIZE,
pmadapter->pcard_usb->usb_rx_deaggr.
aggr_ctrl.aggr_align);
max_rx_data_size =
MAX(max_rx_data_size,
MLAN_RX_DATA_BUF_SIZE);
pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_align);
max_rx_data_size = MAX(max_rx_data_size,
MLAN_RX_DATA_BUF_SIZE);
}
}
#endif
@ -1555,27 +1517,20 @@ mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
PRINTM(MERROR, "mlan_recv: DATA too large\n");
} else {
pmadapter->upld_len = len;
pmadapter->callbacks.moal_get_system_time(pmadapter->
pmoal_handle,
&pmbuf->
in_ts_sec,
&pmbuf->
in_ts_usec);
pmadapter->callbacks.moal_spin_lock(pmadapter->
pmoal_handle,
pmadapter->
rx_data_queue.
plock);
pmadapter->callbacks.moal_get_system_time(
pmadapter->pmoal_handle, &pmbuf->in_ts_sec,
&pmbuf->in_ts_usec);
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
util_enqueue_list_tail(pmadapter->pmoal_handle,
&pmadapter->rx_data_queue,
(pmlan_linked_list)pmbuf, MNULL,
MNULL);
pmadapter->rx_pkts_queued++;
pmadapter->callbacks.moal_spin_unlock(pmadapter->
pmoal_handle,
pmadapter->
rx_data_queue.
plock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
pmadapter->data_received = MTRUE;
mlan_queue_rx_work(pmadapter);
}
@ -1599,9 +1554,9 @@ mlan_recv(IN t_void *pmlan_adapter, IN pmlan_buffer pmbuf, IN t_u32 port)
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
mlan_recv_packet_complete(IN t_void *pmlan_adapter,
IN pmlan_buffer pmbuf, IN mlan_status status)
mlan_status mlan_recv_packet_complete(IN t_void *pmlan_adapter,
IN pmlan_buffer pmbuf,
IN mlan_status status)
{
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
@ -1620,8 +1575,8 @@ mlan_recv_packet_complete(IN t_void *pmlan_adapter,
*
* @return wmm queue priority (0 - 3)
*/
t_u8
mlan_select_wmm_queue(IN t_void *pmlan_adapter, IN t_u8 bss_num, IN t_u8 tid)
t_u8 mlan_select_wmm_queue(IN t_void *pmlan_adapter, IN t_u8 bss_num,
IN t_u8 tid)
{
mlan_adapter *pmadapter = (mlan_adapter *)pmlan_adapter;
pmlan_private pmpriv = pmadapter->priv[bss_num];
@ -1642,8 +1597,7 @@ mlan_select_wmm_queue(IN t_void *pmlan_adapter, IN t_u8 bss_num, IN t_u8 tid)
* @param adapter A pointer to mlan_adapter structure
* @return MLAN_STATUS_FAILURE -- if the intererupt is not for us
*/
mlan_status
mlan_interrupt(IN t_u16 msg_id, IN t_void *adapter)
mlan_status mlan_interrupt(IN t_u16 msg_id, IN t_void *adapter)
{
mlan_adapter *pmadapter = (mlan_adapter *)adapter;
mlan_status ret;
@ -1662,8 +1616,7 @@ mlan_interrupt(IN t_u16 msg_id, IN t_void *adapter)
* @param keep_wakeup keep wake up flag
* @return N/A
*/
t_void
mlan_pm_wakeup_card(IN t_void *adapter, IN t_u8 keep_wakeup)
t_void mlan_pm_wakeup_card(IN t_void *adapter, IN t_u8 keep_wakeup)
{
mlan_adapter *pmadapter = (mlan_adapter *)adapter;
@ -1681,8 +1634,7 @@ mlan_pm_wakeup_card(IN t_void *adapter, IN t_u8 keep_wakeup)
* @param adapter A pointer to mlan_adapter structure
* @return MTRUE/MFALSE
*/
t_u8
mlan_is_main_process_running(IN t_void *adapter)
t_u8 mlan_is_main_process_running(IN t_void *adapter)
{
mlan_adapter *pmadapter = (mlan_adapter *)adapter;
pmlan_callbacks pcb = &pmadapter->callbacks;
@ -1711,8 +1663,8 @@ mlan_is_main_process_running(IN t_void *adapter)
* @param func_num PCIE function num
* @return N/A
*/
t_void
mlan_set_int_mode(IN t_void *adapter, IN t_u32 int_mode, IN t_u8 func_num)
t_void mlan_set_int_mode(IN t_void *adapter, IN t_u32 int_mode,
IN t_u8 func_num)
{
mlan_adapter *pmadapter = (mlan_adapter *)adapter;
ENTER();

View File

@ -55,8 +55,7 @@ Change log:
* @param pmpriv A pointer to mlan_private structure
* @return N/A
*/
static t_void
wlan_handle_disconnect_event(pmlan_private pmpriv)
static t_void wlan_handle_disconnect_event(pmlan_private pmpriv)
{
ENTER();
@ -80,8 +79,7 @@ wlan_handle_disconnect_event(pmlan_private pmpriv)
*
* @return N/A
*/
t_void
wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
t_void wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
{
mlan_adapter *pmadapter = priv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -93,11 +91,13 @@ wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
PRINTM(MINFO, "Handles disconnect event.\n");
#ifdef UAP_SUPPORT
/* If DFS repeater mode is enabled and station interface disconnects
* then make sure that all uAPs are stopped.
*/
if (pmadapter->dfs_repeater)
wlan_dfs_rep_disconnect(pmadapter);
#endif
if (drv_disconnect) {
priv->media_connected = MFALSE;
@ -167,8 +167,7 @@ wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
wlan_clean_txrx(priv);
/* Need to erase the current SSID and BSSID info */
memset(pmadapter,
&priv->curr_bss_params, 0x00,
memset(pmadapter, &priv->curr_bss_params, 0x00,
sizeof(priv->curr_bss_params));
}
pmadapter->tx_lock_flag = MFALSE;
@ -179,15 +178,13 @@ wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
if ((wlan_fw_11d_is_enabled(priv)) &&
(priv->state_11d.user_enable_11d == DISABLE_11D)) {
priv->state_11d.enable_11d = DISABLE_11D;
enable = DISABLE_11D;
/* Send cmd to FW to enable/disable 11D function */
ret = wlan_prepare_cmd(priv,
HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET,
Dot11D_i, MNULL, &enable);
ret = wlan_prepare_cmd(priv, HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET, Dot11D_i, MNULL,
&enable);
if (ret)
PRINTM(MERROR, "11D: Failed to enable 11D\n");
}
@ -216,8 +213,7 @@ wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
*
* @return N/A
*/
t_void
wlan_2040_coex_event(pmlan_private pmpriv)
t_void wlan_2040_coex_event(pmlan_private pmpriv)
{
t_u8 event_buf[100];
mlan_event *pevent = (mlan_event *)event_buf;
@ -226,19 +222,18 @@ wlan_2040_coex_event(pmlan_private pmpriv)
ENTER();
if (pmpriv->curr_bss_params.bss_descriptor.poverlap_bss_scan_param &&
pmpriv->curr_bss_params.bss_descriptor.poverlap_bss_scan_param->
ieee_hdr.element_id == OVERLAPBSSSCANPARAM) {
ele_len =
pmpriv->curr_bss_params.bss_descriptor.
poverlap_bss_scan_param->ieee_hdr.len;
pmpriv->curr_bss_params.bss_descriptor.poverlap_bss_scan_param
->ieee_hdr.element_id == OVERLAPBSSSCANPARAM) {
ele_len = pmpriv->curr_bss_params.bss_descriptor
.poverlap_bss_scan_param->ieee_hdr.len;
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_DRV_OBSS_SCAN_PARAM;
pevent->event_len = ele_len;
/* Copy OBSS scan parameters */
memcpy_ext(pmpriv->adapter, (t_u8 *)pevent->event_buf,
(t_u8 *)&pmpriv->curr_bss_params.bss_descriptor.
poverlap_bss_scan_param->obss_scan_param, ele_len,
pevent->event_len);
(t_u8 *)&pmpriv->curr_bss_params.bss_descriptor
.poverlap_bss_scan_param->obss_scan_param,
ele_len, pevent->event_len);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_OBSS_SCAN_PARAM,
pevent);
}
@ -254,8 +249,8 @@ wlan_2040_coex_event(pmlan_private pmpriv)
*
* @return N/A
*/
static void
wlan_process_sta_tx_pause_event(pmlan_private priv, pmlan_buffer pevent)
static void wlan_process_sta_tx_pause_event(pmlan_private priv,
pmlan_buffer pevent)
{
t_u16 tlv_type, tlv_len;
int tlv_buf_left = pevent->data_len - sizeof(t_u32);
@ -290,7 +285,6 @@ wlan_process_sta_tx_pause_event(pmlan_private priv, pmlan_buffer pevent)
else
priv->tx_pause = MFALSE;
}
}
tlv_buf_left -= (sizeof(MrvlIEtypesHeader_t) + tlv_len);
tlv = (MrvlIEtypesHeader_t *)((t_u8 *)tlv + tlv_len +
@ -309,8 +303,7 @@ wlan_process_sta_tx_pause_event(pmlan_private priv, pmlan_buffer pevent)
* received from firmware
* @return N/A
*/
static void
wlan_print_disconnect_reason(t_u16 reason_code)
static void wlan_print_disconnect_reason(t_u16 reason_code)
{
ENTER();
@ -365,8 +358,7 @@ wlan_print_disconnect_reason(t_u16 reason_code)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_ops_sta_process_event(IN t_void *priv)
mlan_status wlan_ops_sta_process_event(IN t_void *priv)
{
pmlan_private pmpriv = (pmlan_private)priv;
pmlan_adapter pmadapter = pmpriv->adapter;
@ -409,8 +401,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
pevent = (pmlan_event)event_buf;
memset(pmadapter, event_buf, 0, MAX_EVENT_SIZE);
if (eventcause != EVENT_PS_SLEEP &&
eventcause != EVENT_PS_AWAKE &&
if (eventcause != EVENT_PS_SLEEP && eventcause != EVENT_PS_AWAKE &&
pmbuf->data_len > sizeof(eventcause))
DBG_HEXDUMP(MEVT_D, "EVENT", pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
@ -433,10 +424,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
"wlan: Receive deauth event in wps session\n");
break;
}
reason_code =
wlan_le16_to_cpu(*(t_u16 *)
(pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause)));
reason_code = wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause)));
PRINTM(MMSG, "wlan: EVENT: Deauthenticated (reason 0x%x)\n",
reason_code);
wlan_print_disconnect_reason(reason_code);
@ -452,10 +442,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
"wlan: Receive disassociate event in wps session\n");
break;
}
reason_code =
wlan_le16_to_cpu(*(t_u16 *)
(pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause)));
reason_code = wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause)));
PRINTM(MMSG, "wlan: EVENT: Disassociated (reason 0x%x)\n",
reason_code);
wlan_print_disconnect_reason(reason_code);
@ -465,10 +454,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
break;
case EVENT_LINK_LOST:
reason_code =
wlan_le16_to_cpu(*(t_u16 *)
(pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause)));
reason_code = wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause)));
PRINTM(MMSG, "wlan: EVENT: Link lost (reason 0x%x)\n",
reason_code);
pmpriv->disconnect_reason_code = reason_code;
@ -493,8 +481,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
PRINTM(MINFO, "EVENT: AWAKE\n");
PRINTM_NETINTF(MEVENT, pmpriv);
PRINTM(MEVENT, "|");
if (!pmadapter->pps_uapsd_mode &&
pmpriv->media_connected &&
if (!pmadapter->pps_uapsd_mode && pmpriv->media_connected &&
(pmpriv->port_open || !pmpriv->port_ctrl_mode) &&
pmadapter->sleep_period.period) {
pmadapter->pps_uapsd_mode = MTRUE;
@ -505,13 +492,14 @@ wlan_ops_sta_process_event(IN t_void *priv)
break;
pmadapter->tx_lock_flag = MFALSE;
if (pmadapter->pps_uapsd_mode && pmadapter->gen_null_pkt) {
if (MTRUE == wlan_check_last_packet_indication(pmpriv)) {
if (MTRUE ==
wlan_check_last_packet_indication(pmpriv)) {
if (!pmadapter->data_sent) {
if (wlan_send_null_packet(pmpriv,
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET
|
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET)
== MLAN_STATUS_SUCCESS) {
if (wlan_send_null_packet(
pmpriv,
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) ==
MLAN_STATUS_SUCCESS) {
LEAVE();
return MLAN_STATUS_SUCCESS;
}
@ -525,9 +513,8 @@ wlan_ops_sta_process_event(IN t_void *priv)
case EVENT_HS_ACT_REQ:
PRINTM(MEVENT, "EVENT: HS_ACT_REQ\n");
ret = wlan_prepare_cmd(priv,
HostCmd_CMD_802_11_HS_CFG_ENH,
0, 0, MNULL, MNULL);
ret = wlan_prepare_cmd(priv, HostCmd_CMD_802_11_HS_CFG_ENH, 0,
0, MNULL, MNULL);
break;
case EVENT_MIC_ERR_UNICAST:
PRINTM(MEVENT, "EVENT: UNICAST MIC ERROR\n");
@ -554,11 +541,10 @@ wlan_ops_sta_process_event(IN t_void *priv)
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_DEBUG_INFO;
pevent->event_len = pmbuf->data_len - sizeof(eventcause);
memcpy_ext(pmadapter,
(t_u8 *)pevent->event_buf,
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause), pevent->event_len,
pevent->event_len);
sizeof(eventcause),
pevent->event_len, pevent->event_len);
PRINTM(MEVENT, "EVENT: FW Debug Info %s\n",
(t_u8 *)pevent->event_buf);
wlan_recv_event(pmpriv, pevent->event_id, pevent);
@ -588,18 +574,20 @@ wlan_ops_sta_process_event(IN t_void *priv)
case EVENT_STOP_TX:
PRINTM(MEVENT, "EVENT: Stop Tx (%#x)\n", eventcause);
wlan_11h_tx_disable(pmpriv); /* this fn will send event up to MOAL */
wlan_11h_tx_disable(pmpriv); /* this fn will send event up to
MOAL */
break;
case EVENT_START_TX:
PRINTM(MEVENT, "EVENT: Start Tx (%#x)\n", eventcause);
wlan_11h_tx_enable(pmpriv); /* this fn will send event up to MOAL */
wlan_11h_tx_enable(pmpriv); /* this fn will send event up to
MOAL */
break;
case EVENT_CHANNEL_SWITCH:
PRINTM(MEVENT, "EVENT: Channel Switch (%#x)\n", eventcause);
if (pmadapter->ecsa_enable) {
MrvlIEtypes_channel_band_t *pchan_info =
(MrvlIEtypes_channel_band_t *)(pmadapter->
event_body);
(MrvlIEtypes_channel_band_t
*)(pmadapter->event_body);
t_u8 channel = pchan_info->channel;
chan_freq_power_t *cfp = MNULL;
DBG_HEXDUMP(MCMD_D, "chan band config",
@ -609,11 +597,11 @@ wlan_ops_sta_process_event(IN t_void *priv)
channel);
#define MAX_CHANNEL_BAND_B 14
if (channel <= MAX_CHANNEL_BAND_B)
cfp = wlan_find_cfp_by_band_and_channel
(pmadapter, BAND_B, channel);
cfp = wlan_find_cfp_by_band_and_channel(
pmadapter, BAND_B, channel);
else
cfp = wlan_find_cfp_by_band_and_channel
(pmadapter, BAND_A, channel);
cfp = wlan_find_cfp_by_band_and_channel(
pmadapter, BAND_A, channel);
pmpriv->curr_bss_params.bss_descriptor.channel =
channel;
if (cfp)
@ -634,7 +622,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
pevent->event_id =
MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE;
pevent->event_len = sizeof(chan_band_info);
pchan_band_info = (chan_band_info *) pevent->event_buf;
pchan_band_info = (chan_band_info *)pevent->event_buf;
/* Copy event data */
memcpy_ext(pmadapter, (t_u8 *)&pchan_band_info->bandcfg,
(t_u8 *)&pchan_info->bandcfg,
@ -643,10 +631,10 @@ wlan_ops_sta_process_event(IN t_void *priv)
pchan_band_info->channel = pchan_info->channel;
if (pchan_band_info->bandcfg.chanWidth == CHAN_BW_80MHZ)
pchan_band_info->center_chan =
wlan_get_center_freq_idx(priv, BAND_AAC,
pchan_info->
channel,
CHANNEL_BW_80MHZ);
wlan_get_center_freq_idx(
priv, BAND_AAC,
pchan_info->channel,
CHANNEL_BW_80MHZ);
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE,
pevent);
@ -656,8 +644,8 @@ wlan_ops_sta_process_event(IN t_void *priv)
PRINTM_NETINTF(MEVENT, pmpriv);
PRINTM(MEVENT, "EVENT: Channel Switch Announcement\n");
/* Here, pass up event first, as handling will send deauth */
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHANNEL_SWITCH_ANN, MNULL);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_CHANNEL_SWITCH_ANN,
MNULL);
wlan_11h_handle_event_chanswann(pmpriv);
break;
case EVENT_RADAR_DETECTED:
@ -678,7 +666,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
wlan_11h_radar_detected_handling(pmadapter, pmpriv);
} else {
PRINTM(MEVENT, "Ignore Event Radar Detected - handling"
" already in progress.\n");
" already in progress.\n");
}
break;
@ -692,8 +680,8 @@ wlan_ops_sta_process_event(IN t_void *priv)
/* Copy event data */
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause), pevent->event_len,
pevent->event_len);
sizeof(eventcause),
pevent->event_len, pevent->event_len);
/* Handle / pass event data */
ret = wlan_11h_handle_event_chanrpt_ready(pmpriv, pevent,
&radar_chan);
@ -726,18 +714,18 @@ wlan_ops_sta_process_event(IN t_void *priv)
HostCmd_ACT_GEN_SET, 0, 0, MNULL);
break;
case EVENT_WMM_STATUS_CHANGE:
if (pmbuf && pmbuf->data_len
> sizeof(eventcause) + sizeof(MrvlIEtypesHeader_t)) {
if (pmbuf &&
pmbuf->data_len >
sizeof(eventcause) + sizeof(MrvlIEtypesHeader_t)) {
PRINTM(MEVENT, "EVENT: WMM status changed: %d\n",
pmbuf->data_len);
evt_buf = (pmbuf->pbuf
+ pmbuf->data_offset + sizeof(eventcause));
evt_buf = (pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause));
wlan_ret_wmm_get_status(pmpriv,
evt_buf,
wlan_ret_wmm_get_status(pmpriv, evt_buf,
pmbuf->data_len -
sizeof(eventcause));
sizeof(eventcause));
} else {
PRINTM(MEVENT, "EVENT: WMM status changed\n");
ret = wlan_cmd_wmm_status_change(pmpriv);
@ -749,7 +737,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_BCN_RSSI_LOW;
pevent->event_len = sizeof(t_u16);
/** Fw send bcnRssi low value in event reason field*/
/** Fw send bcnRssi low value in event reason field*/
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
(t_u8 *)&pmadapter->event_body, pevent->event_len,
pevent->event_len);
@ -768,7 +756,7 @@ wlan_ops_sta_process_event(IN t_void *priv)
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_BCN_RSSI_HIGH;
pevent->event_len = sizeof(t_u16);
/** Fw send bcnRssi high value in event reason field*/
/** Fw send bcnRssi high value in event reason field*/
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
(t_u8 *)&pmadapter->event_body, pevent->event_len,
pevent->event_len);
@ -804,9 +792,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
break;
case EVENT_IBSS_COALESCED:
PRINTM(MEVENT, "EVENT: IBSS_COALESCED\n");
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
HostCmd_ACT_GEN_GET, 0, MNULL, MNULL);
ret = wlan_prepare_cmd(
pmpriv, HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
HostCmd_ACT_GEN_GET, 0, MNULL, MNULL);
break;
case EVENT_ADDBA:
PRINTM(MEVENT, "EVENT: ADDBA Request\n");
@ -830,9 +818,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
case EVENT_BA_STREAM_TIMEOUT:
PRINTM(MEVENT, "EVENT: BA Stream timeout\n");
if (pmpriv->media_connected == MTRUE)
wlan_11n_ba_stream_timeout(pmpriv,
(HostCmd_DS_11N_BATIMEOUT *)
pmadapter->event_body);
wlan_11n_ba_stream_timeout(
pmpriv, (HostCmd_DS_11N_BATIMEOUT *)
pmadapter->event_body);
else
PRINTM(MERROR,
"Ignore BA Stream timeout event in disconnected state\n");
@ -849,9 +837,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
MIN(pmadapter->curr_tx_buf_size,
wlan_le16_to_cpu(*(t_u16 *)pmadapter->event_body));
if (pmbuf->data_len == sizeof(eventcause) + sizeof(t_u32)) {
enable = wlan_le16_to_cpu(*(t_u16 *)
(pmadapter->event_body +
sizeof(t_u16)));
enable = wlan_le16_to_cpu(
*(t_u16 *)(pmadapter->event_body +
sizeof(t_u16)));
if (enable)
pmpriv->amsdu_disable = MFALSE;
else
@ -882,8 +870,10 @@ wlan_ops_sta_process_event(IN t_void *priv)
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmadapter->event_body, pevent->event_len,
pevent->event_len);
#ifdef UAP_SUPPORT
if (pmadapter->dfs_repeater)
wlan_dfs_rep_bw_change(pmadapter);
#endif
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_BW_CHANGED, pevent);
break;
@ -928,19 +918,16 @@ wlan_ops_sta_process_event(IN t_void *priv)
break;
case EVENT_IBSS_STATION_DISCONNECT:
break;
case EVENT_SAD_REPORT:
{
case EVENT_SAD_REPORT: {
#ifdef DEBUG_LEVEL1
t_u8 *pevt_dat =
pmbuf->pbuf + pmbuf->data_offset +
sizeof(t_u32);
t_u8 *pevt_dat =
pmbuf->pbuf + pmbuf->data_offset + sizeof(t_u32);
#endif
PRINTM(MEVENT,
"EVENT: Antenna Diversity %d (%d, %d, %d, %d)\n",
eventcause, pevt_dat[0] + 1, pevt_dat[1] + 1,
pevt_dat[2], pevt_dat[3]);
}
break;
PRINTM(MEVENT,
"EVENT: Antenna Diversity %d (%d, %d, %d, %d)\n",
eventcause, pevt_dat[0] + 1, pevt_dat[1] + 1,
pevt_dat[2], pevt_dat[3]);
} break;
case EVENT_FW_DUMP_INFO:
PRINTM(MEVENT, "EVENT: Dump FW info\n");
@ -974,27 +961,28 @@ wlan_ops_sta_process_event(IN t_void *priv)
if (!pmadapter->ssu_buf || !pmadapter->ssu_buf->pbuf)
break;
/* If ADMA is supported, SSU header could not be received with SSU data. Instead,
* SSU header is received through this event. So, copy the header into the buffer
* before passing the buffer to upper layer for file writting
/* If ADMA is supported, SSU header could not be received with
* SSU data. Instead, SSU header is received through this event.
* So, copy the header into the buffer before passing the buffer
* to upper layer for file writting
*/
memcpy_ext(pmadapter,
(t_u8 *)pmadapter->ssu_buf->pbuf +
pmadapter->ssu_buf->data_offset,
pmadapter->ssu_buf->data_offset,
pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause),
sizeof(eventcause),
(pmbuf->data_len - sizeof(eventcause)),
(pmbuf->data_len - sizeof(eventcause)));
DBG_HEXDUMP(MEVT_D, "SSU data",
(t_u8 *)pmadapter->ssu_buf->pbuf +
pmadapter->ssu_buf->data_offset, 512);
pmadapter->ssu_buf->data_offset,
512);
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_SSU_DUMP_FILE;
pevent->event_len = MLAN_SSU_BUF_SIZE;
*(t_u64 *)pevent->event_buf =
(t_u64)pmadapter->ssu_buf->pbuf +
pmadapter->ssu_buf->data_offset;
*(t_u64 *)pevent->event_buf = (t_u64)pmadapter->ssu_buf->pbuf +
pmadapter->ssu_buf->data_offset;
wlan_recv_event(pmpriv, pevent->event_id, pevent);
wlan_free_ssu_pcie_buf(pmadapter);
break;
@ -1019,9 +1007,9 @@ wlan_ops_sta_process_event(IN t_void *priv)
break;
}
PRINTM(MEVENT, "EVENT: EVENT_FW_HANG_REPORT reasoncode=%d\n",
wlan_le16_to_cpu(*(t_u16 *)
(pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause))));
wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause))));
pmadapter->fw_hang_report = MTRUE;
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
break;

View File

@ -43,64 +43,64 @@ Change log:
/** Ethernet II header */
typedef struct {
/** Ethernet II header destination address */
/** Ethernet II header destination address */
t_u8 dest_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header source address */
/** Ethernet II header source address */
t_u8 src_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header length */
/** Ethernet II header length */
t_u16 ethertype;
} EthII_Hdr_t;
/** IPv4 ARP request header */
typedef MLAN_PACK_START struct {
/** Hardware type */
/** Hardware type */
t_u16 Htype;
/** Protocol type */
/** Protocol type */
t_u16 Ptype;
/** Hardware address length */
/** Hardware address length */
t_u8 addr_len;
/** Protocol address length */
/** Protocol address length */
t_u8 proto_len;
/** Operation code */
/** Operation code */
t_u16 op_code;
/** Source mac address */
/** Source mac address */
t_u8 src_mac[MLAN_MAC_ADDR_LENGTH];
/** Sender IP address */
/** Sender IP address */
t_u8 src_ip[4];
/** Destination mac address */
/** Destination mac address */
t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH];
/** Destination IP address */
/** Destination IP address */
t_u8 dst_ip[4];
} MLAN_PACK_END IPv4_ARP_t;
/** IPv6 Nadv packet header */
typedef MLAN_PACK_START struct {
/** IP protocol version */
/** IP protocol version */
t_u8 version;
/** flow label */
/** flow label */
t_u8 flow_lab[3];
/** Payload length */
/** Payload length */
t_u16 payload_len;
/** Next header type */
/** Next header type */
t_u8 next_hdr;
/** Hot limit */
/** Hot limit */
t_u8 hop_limit;
/** Source address */
/** Source address */
t_u8 src_addr[16];
/** Destination address */
/** Destination address */
t_u8 dst_addr[16];
/** ICMP type */
/** ICMP type */
t_u8 icmp_type;
/** IPv6 Code */
/** IPv6 Code */
t_u8 ipv6_code;
/** IPv6 Checksum */
/** IPv6 Checksum */
t_u16 ipv6_checksum;
/** Flags */
/** Flags */
t_u32 flags;
/** Target address */
/** Target address */
t_u8 taget_addr[16];
/** Reserved */
/** Reserved */
t_u8 rev[8];
} MLAN_PACK_END IPv6_Nadv_t;
@ -108,17 +108,18 @@ typedef MLAN_PACK_START struct {
Global functions
********************************************************/
/**
* @brief This function check and discard IPv4 and IPv6 gratuitous broadcast packets
* @brief This function check and discard IPv4 and IPv6 gratuitous broadcast
* packets
*
* @param prx_pkt A pointer to RxPacketHdr_t structure of received packet
* @param pmadapter A pointer to pmlan_adapter structure
* @return TRUE if found such type of packets, FALSE not found
*/
static t_u8
discard_gratuitous_ARP_msg(RxPacketHdr_t *prx_pkt, pmlan_adapter pmadapter)
static t_u8 discard_gratuitous_ARP_msg(RxPacketHdr_t *prx_pkt,
pmlan_adapter pmadapter)
{
t_u8 proto_ARP_type[] = { 0x08, 0x06 };
t_u8 proto_ARP_type_v6[] = { 0x86, 0xDD };
t_u8 proto_ARP_type[] = {0x08, 0x06};
t_u8 proto_ARP_type_v6[] = {0x86, 0xDD};
IPv4_ARP_t *parp_hdr;
IPv6_Nadv_t *pNadv_hdr;
t_u8 ret = MFALSE;
@ -128,16 +129,14 @@ discard_gratuitous_ARP_msg(RxPacketHdr_t *prx_pkt, pmlan_adapter pmadapter)
* where the source and destination IP are both set to
* the IP of the machine issuing the packet.
*/
if (memcmp
(pmadapter, proto_ARP_type, &prx_pkt->eth803_hdr.h803_len,
sizeof(proto_ARP_type)) == 0) {
if (memcmp(pmadapter, proto_ARP_type, &prx_pkt->eth803_hdr.h803_len,
sizeof(proto_ARP_type)) == 0) {
parp_hdr = (IPv4_ARP_t *)(&prx_pkt->rfc1042_hdr);
/* Graguitous ARP can be ARP request or ARP reply */
/* Graguitous ARP can be ARP request or ARP reply*/
if ((parp_hdr->op_code == mlan_htons(0x01)) ||
(parp_hdr->op_code == mlan_htons(0x02)))
if (memcmp
(pmadapter, parp_hdr->src_ip, parp_hdr->dst_ip,
4) == 0)
if (memcmp(pmadapter, parp_hdr->src_ip,
parp_hdr->dst_ip, 4) == 0)
ret = MTRUE;
}
@ -145,9 +144,8 @@ discard_gratuitous_ARP_msg(RxPacketHdr_t *prx_pkt, pmlan_adapter pmadapter)
* An unsolicited Neighbor Advertisement pkt is
* marked by a cleared Solicited Flag
*/
if (memcmp
(pmadapter, proto_ARP_type_v6, &prx_pkt->eth803_hdr.h803_len,
sizeof(proto_ARP_type_v6)) == 0) {
if (memcmp(pmadapter, proto_ARP_type_v6, &prx_pkt->eth803_hdr.h803_len,
sizeof(proto_ARP_type_v6)) == 0) {
pNadv_hdr = (IPv6_Nadv_t *)(&prx_pkt->rfc1042_hdr);
/* Check Nadv type: next header is ICMPv6 and
* icmp type is Nadv */
@ -168,8 +166,7 @@ discard_gratuitous_ARP_msg(RxPacketHdr_t *prx_pkt, pmlan_adapter pmadapter)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_private priv = pmadapter->priv[pmbuf->bss_index];
@ -177,16 +174,14 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
RxPD *prx_pd;
int hdr_chop;
EthII_Hdr_t *peth_hdr;
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
t_u8 snap_oui_802_h[MLAN_MAC_ADDR_LENGTH] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
};
t_u8 appletalk_aarp_type[2] = { 0x80, 0xf3 };
t_u8 ipx_snap_type[2] = { 0x81, 0x37 };
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = {0xaa, 0xaa, 0x03,
0x00, 0x00, 0x00};
t_u8 snap_oui_802_h[MLAN_MAC_ADDR_LENGTH] = {0xaa, 0xaa, 0x03,
0x00, 0x00, 0xf8};
t_u8 appletalk_aarp_type[2] = {0x80, 0xf3};
t_u8 ipx_snap_type[2] = {0x81, 0x37};
#ifdef DRV_EMBEDDED_SUPPLICANT
t_u8 eapol_type[2] = { 0x88, 0x8e };
t_u8 eapol_type[2] = {0x88, 0x8e};
#endif
t_u8 ext_rate_info = 0;
@ -196,7 +191,7 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd + prx_pd->rx_pkt_offset);
/** Small debug type */
#define DBG_TYPE_SMALL 2
#define DBG_TYPE_SMALL 2
/** Size of debugging structure */
#define SIZE_OF_DBG_STRUCT 4
if (prx_pd->rx_pkt_type == PKT_TYPE_DEBUG) {
@ -223,29 +218,29 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
HEXDUMP("RX Data: Src", prx_pkt->eth803_hdr.src_addr,
sizeof(prx_pkt->eth803_hdr.src_addr));
if ((memcmp(pmadapter, &prx_pkt->rfc1042_hdr,
snap_oui_802_h, sizeof(snap_oui_802_h)) == 0) ||
((memcmp(pmadapter, &prx_pkt->rfc1042_hdr,
rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr)) == 0) &&
if ((memcmp(pmadapter, &prx_pkt->rfc1042_hdr, snap_oui_802_h,
sizeof(snap_oui_802_h)) == 0) ||
((memcmp(pmadapter, &prx_pkt->rfc1042_hdr, rfc1042_eth_hdr,
sizeof(rfc1042_eth_hdr)) == 0) &&
memcmp(pmadapter, &prx_pkt->rfc1042_hdr.snap_type,
appletalk_aarp_type, sizeof(appletalk_aarp_type)) &&
memcmp(pmadapter, &prx_pkt->rfc1042_hdr.snap_type,
ipx_snap_type, sizeof(ipx_snap_type)))) {
memcmp(pmadapter, &prx_pkt->rfc1042_hdr.snap_type, ipx_snap_type,
sizeof(ipx_snap_type)))) {
/*
* Replace the 803 header and rfc1042 header (llc/snap) with an
* EthernetII header, keep the src/dst and snap_type (ethertype).
* The firmware only passes up SNAP frames converting
* all RX Data from 802.11 to 802.2/LLC/SNAP frames.
* EthernetII header, keep the src/dst and snap_type
* (ethertype). The firmware only passes up SNAP frames
* converting all RX Data from 802.11 to 802.2/LLC/SNAP frames.
* To create the Ethernet II, just move the src, dst address
* right before the snap_type.
*/
peth_hdr = (EthII_Hdr_t *)
((t_u8 *)&prx_pkt->eth803_hdr
+ sizeof(prx_pkt->eth803_hdr) +
sizeof(prx_pkt->rfc1042_hdr)
- sizeof(prx_pkt->eth803_hdr.dest_addr)
- sizeof(prx_pkt->eth803_hdr.src_addr)
- sizeof(prx_pkt->rfc1042_hdr.snap_type));
peth_hdr =
(EthII_Hdr_t *)((t_u8 *)&prx_pkt->eth803_hdr +
sizeof(prx_pkt->eth803_hdr) +
sizeof(prx_pkt->rfc1042_hdr) -
sizeof(prx_pkt->eth803_hdr.dest_addr) -
sizeof(prx_pkt->eth803_hdr.src_addr) -
sizeof(prx_pkt->rfc1042_hdr.snap_type));
memcpy_ext(pmadapter, peth_hdr->src_addr,
prx_pkt->eth803_hdr.src_addr,
@ -261,8 +256,7 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
*/
hdr_chop = (t_u32)((t_ptr)peth_hdr - (t_ptr)prx_pd);
} else {
HEXDUMP("RX Data: LLC/SNAP",
(t_u8 *)&prx_pkt->rfc1042_hdr,
HEXDUMP("RX Data: LLC/SNAP", (t_u8 *)&prx_pkt->rfc1042_hdr,
sizeof(prx_pkt->rfc1042_hdr));
if ((priv->hotspot_cfg & HOTSPOT_ENABLED) &&
discard_gratuitous_ARP_msg(prx_pkt, pmadapter)) {
@ -298,10 +292,9 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
#ifdef DRV_EMBEDDED_SUPPLICANT
if (supplicantIsEnabled(priv->psapriv) &&
(!memcmp
(pmadapter, &prx_pkt->eth803_hdr.h803_len, eapol_type,
sizeof(eapol_type)))) {
//BML_SET_OFFSET(bufDesc, offset);
(!memcmp(pmadapter, &prx_pkt->eth803_hdr.h803_len, eapol_type,
sizeof(eapol_type)))) {
// BML_SET_OFFSET(bufDesc, offset);
if (ProcessEAPoLPkt(priv->psapriv, pmbuf)) {
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
ret = MLAN_STATUS_SUCCESS;
@ -315,7 +308,6 @@ wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
#endif
if (MFALSE || priv->rx_pkt_info) {
ext_rate_info = (t_u8)(prx_pd->rx_info >> 16);
pmbuf->u.rx_info.data_rate =
wlan_index_to_data_rate(priv->adapter, prx_pd->rx_rate,
@ -356,8 +348,8 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
mlan_status wlan_ops_sta_process_rx_packet(IN t_void *adapter,
IN pmlan_buffer pmbuf)
{
pmlan_adapter pmadapter = (pmlan_adapter)adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -383,8 +375,9 @@ wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
(t_u16)pmbuf->data_len) {
PRINTM(MERROR,
"Wrong rx packet: len=%d,rx_pkt_offset=%d,"
" rx_pkt_length=%d\n", pmbuf->data_len,
prx_pd->rx_pkt_offset, prx_pd->rx_pkt_length);
" rx_pkt_length=%d\n",
pmbuf->data_len, prx_pd->rx_pkt_offset,
prx_pd->rx_pkt_length);
pmbuf->status_code = MLAN_ERROR_PKT_SIZE_INVALID;
ret = MLAN_STATUS_FAILURE;
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
@ -397,23 +390,19 @@ wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
/* Check if this is mgmt packet and needs to
* forwarded to app as an event
*/
pmgmt_pkt_hdr =
(wlan_mgmt_pkt *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
pmgmt_pkt_hdr = (wlan_mgmt_pkt *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
pmgmt_pkt_hdr->frm_len =
wlan_le16_to_cpu(pmgmt_pkt_hdr->frm_len);
if ((pmgmt_pkt_hdr->wlan_header.frm_ctl
& IEEE80211_FC_MGMT_FRAME_TYPE_MASK) == 0)
wlan_process_802dot11_mgmt_pkt(pmadapter->
priv[pmbuf->bss_index],
(t_u8 *)&pmgmt_pkt_hdr->
wlan_header,
pmgmt_pkt_hdr->frm_len +
sizeof(wlan_mgmt_pkt)
-
sizeof(pmgmt_pkt_hdr->
frm_len), prx_pd);
if ((pmgmt_pkt_hdr->wlan_header.frm_ctl &
IEEE80211_FC_MGMT_FRAME_TYPE_MASK) == 0)
wlan_process_802dot11_mgmt_pkt(
pmadapter->priv[pmbuf->bss_index],
(t_u8 *)&pmgmt_pkt_hdr->wlan_header,
pmgmt_pkt_hdr->frm_len + sizeof(wlan_mgmt_pkt) -
sizeof(pmgmt_pkt_hdr->frm_len),
prx_pd);
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
goto done;
}
@ -423,17 +412,11 @@ wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
priv->rxpd_rx_info = (t_u8)(prx_pd->rx_info >> 16);
if (priv->bss_type == MLAN_BSS_TYPE_STA) {
antenna = wlan_adjust_antenna(priv, prx_pd);
adj_rx_rate =
wlan_adjust_data_rate(priv, priv->rxpd_rate,
priv->rxpd_rate_info);
pmadapter->callbacks.moal_hist_data_add(pmadapter->
pmoal_handle,
pmbuf->
bss_index,
adj_rx_rate,
prx_pd->snr,
prx_pd->nf,
antenna);
adj_rx_rate = wlan_adjust_data_rate(
priv, priv->rxpd_rate, priv->rxpd_rate_info);
pmadapter->callbacks.moal_hist_data_add(
pmadapter->pmoal_handle, pmbuf->bss_index,
adj_rx_rate, prx_pd->snr, prx_pd->nf, antenna);
}
}
@ -441,8 +424,7 @@ wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
* If the packet is not an unicast packet then send the packet
* directly to os. Don't pass thru rx reordering
*/
if ((!IS_11N_ENABLED(priv)
) ||
if ((!IS_11N_ENABLED(priv)) ||
memcmp(priv->adapter, priv->curr_addr,
prx_pkt->eth803_hdr.dest_addr, MLAN_MAC_ADDR_LENGTH)) {
priv->snr = prx_pd->snr;
@ -494,9 +476,9 @@ wlan_ops_sta_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
goto done;
}
/* Reorder and send to OS */
ret = mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num,
prx_pd->priority, ta,
(t_u8)prx_pd->rx_pkt_type, (void *)pmbuf);
ret = mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num, prx_pd->priority,
ta, (t_u8)prx_pd->rx_pkt_type,
(void *)pmbuf);
if (ret || (rx_pkt_type == PKT_TYPE_BAR))
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);

View File

@ -56,8 +56,7 @@ Change log:
*
* @return headptr or MNULL
*/
t_void *
wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
t_void *wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
{
mlan_private *pmpriv = (mlan_private *)priv;
pmlan_adapter pmadapter = pmpriv->adapter;
@ -85,8 +84,8 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
pmbuf->data_len -= sizeof(pkt_type) + sizeof(tx_control);
}
if (pmbuf->data_offset < (sizeof(TxPD) + pmpriv->intf_hr_len +
DMA_ALIGNMENT)) {
if (pmbuf->data_offset <
(sizeof(TxPD) + pmpriv->intf_hr_len + DMA_ALIGNMENT)) {
PRINTM(MERROR,
"not enough space for TxPD: headroom=%d pkt_len=%d, required=%d\n",
pmbuf->data_offset, pmbuf->data_len,
@ -96,9 +95,8 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
}
/* head_ptr should be aligned */
head_ptr =
pmbuf->pbuf + pmbuf->data_offset - sizeof(TxPD) -
pmpriv->intf_hr_len;
head_ptr = pmbuf->pbuf + pmbuf->data_offset - sizeof(TxPD) -
pmpriv->intf_hr_len;
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(DMA_ALIGNMENT - 1)));
plocal_tx_pd = (TxPD *)(head_ptr + pmpriv->intf_hr_len);
@ -118,10 +116,8 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
* Set the priority specific tx_control field, setting of 0 will
* cause the default value to be used later in this function
*/
plocal_tx_pd->tx_control
=
pmpriv->wmm.user_pri_pkt_tx_ctrl[plocal_tx_pd->
priority];
plocal_tx_pd->tx_control =
pmpriv->wmm.user_pri_pkt_tx_ctrl[plocal_tx_pd->priority];
if (pmadapter->pps_uapsd_mode) {
if (MTRUE == wlan_check_last_packet_indication(pmpriv)) {
pmadapter->tx_lock_flag = MTRUE;
@ -130,9 +126,8 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
}
}
/* Offset of actual data */
plocal_tx_pd->tx_pkt_offset =
(t_u16)((t_ptr)pmbuf->pbuf + pmbuf->data_offset -
(t_ptr)plocal_tx_pd);
plocal_tx_pd->tx_pkt_offset = (t_u16)(
(t_ptr)pmbuf->pbuf + pmbuf->data_offset - (t_ptr)plocal_tx_pd);
if (!plocal_tx_pd->tx_control) {
/* TxCtrl set by user or default */
@ -151,9 +146,10 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
if (pmbuf->flags & MLAN_BUF_FLAG_TX_CTRL) {
if (pmbuf->u.tx_info.data_rate) {
plocal_tx_pd->tx_control |=
(wlan_ieee_rateid_to_mrvl_rateid
(pmpriv, pmbuf->u.tx_info.data_rate,
MNULL) << 16);
(wlan_ieee_rateid_to_mrvl_rateid(
pmpriv, pmbuf->u.tx_info.data_rate,
MNULL)
<< 16);
plocal_tx_pd->tx_control |= TXPD_TXRATE_ENABLE;
}
plocal_tx_pd->tx_control_1 |= pmbuf->u.tx_info.channel << 21;
@ -165,8 +161,8 @@ wlan_ops_sta_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
plocal_tx_pd->tx_control |=
(t_u32)pmbuf->u.tx_info.tx_power.val;
if (pmbuf->u.tx_info.retry_limit) {
plocal_tx_pd->tx_control |=
pmbuf->u.tx_info.retry_limit << 8;
plocal_tx_pd->tx_control |= pmbuf->u.tx_info.retry_limit
<< 8;
plocal_tx_pd->tx_control |= TXPD_RETRY_ENABLE;
}
}
@ -188,10 +184,10 @@ done:
* @param priv A pointer to mlan_private structure
* @param flags Transmit Pkt Flags
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise failure
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise
* failure
*/
mlan_status
wlan_send_null_packet(pmlan_private priv, t_u8 flags)
mlan_status wlan_send_null_packet(pmlan_private priv, t_u8 flags)
{
pmlan_adapter pmadapter = MNULL;
TxPD *ptx_pd;
@ -297,8 +293,7 @@ done:
*
* @return MTRUE or MFALSE
*/
t_u8
wlan_check_last_packet_indication(pmlan_private priv)
t_u8 wlan_check_last_packet_indication(pmlan_private priv)
{
pmlan_adapter pmadapter = priv->adapter;
t_u8 ret = MFALSE;
@ -313,12 +308,13 @@ wlan_check_last_packet_indication(pmlan_private priv)
if (wlan_bypass_tx_list_empty(pmadapter) &&
wlan_wmm_lists_empty(pmadapter)) {
if (((priv->curr_bss_params.wmm_uapsd_enabled == MTRUE) &&
priv->wmm_qosinfo) || prop_ps)
priv->wmm_qosinfo) ||
prop_ps)
ret = MTRUE;
}
if (ret && !pmadapter->cmd_sent && !pmadapter->curr_cmd
&& !wlan_is_cmd_pending(pmadapter)) {
if (ret && !pmadapter->cmd_sent && !pmadapter->curr_cmd &&
!wlan_is_cmd_pending(pmadapter)) {
pmadapter->delay_null_pkt = MFALSE;
ret = MTRUE;
} else {

View File

@ -58,8 +58,7 @@ Change Log:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_handle_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
mlan_status wlan_handle_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_private priv = MNULL;
@ -98,10 +97,11 @@ done:
* @param pmbuf A pointer to the mlan_buffer for process
* @param tx_param A pointer to mlan_tx_param structure
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise failure
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise
* failure
*/
mlan_status
wlan_process_tx(pmlan_private priv, pmlan_buffer pmbuf, mlan_tx_param *tx_param)
mlan_status wlan_process_tx(pmlan_private priv, pmlan_buffer pmbuf,
mlan_tx_param *tx_param)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_adapter pmadapter = priv->adapter;
@ -187,9 +187,9 @@ done:
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_write_data_complete(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf, IN mlan_status status)
mlan_status wlan_write_data_complete(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf,
IN mlan_status status)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb;
@ -215,9 +215,9 @@ wlan_write_data_complete(IN pmlan_adapter pmadapter,
for (i = 0; i <= use_count; i++) {
pmbuf_next = pmbuf->pnext;
if (pmbuf->flags & MLAN_BUF_FLAG_MOAL_TX_BUF)
pcb->moal_send_packet_complete
(pmadapter->pmoal_handle, pmbuf,
status);
pcb->moal_send_packet_complete(
pmadapter->pmoal_handle, pmbuf,
status);
else
wlan_free_mlan_buffer(pmadapter, pmbuf);
pmbuf = pmbuf_next;
@ -226,9 +226,8 @@ wlan_write_data_complete(IN pmlan_adapter pmadapter,
#endif
if (pmbuf->flags & MLAN_BUF_FLAG_MOAL_TX_BUF) {
/* pmbuf was allocated by MOAL */
pcb->moal_send_packet_complete(pmadapter->
pmoal_handle,
pmbuf, status);
pcb->moal_send_packet_complete(
pmadapter->pmoal_handle, pmbuf, status);
} else {
/* pmbuf was allocated by MLAN */
wlan_free_mlan_buffer(pmadapter, pmbuf);
@ -251,9 +250,9 @@ wlan_write_data_complete(IN pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status
wlan_recv_packet_complete(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf, IN mlan_status status)
mlan_status wlan_recv_packet_complete(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf,
IN mlan_status status)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb;
@ -270,7 +269,7 @@ wlan_recv_packet_complete(IN pmlan_adapter pmadapter,
MASSERT(pmbuf->bss_index < pmadapter->priv_num);
if (pmbuf->pparent) {
/** we will free the pparaent at the end of deaggr */
/** we will free the pparaent at the end of deaggr */
wlan_free_mlan_buffer(pmadapter, pmbuf);
} else {
pmadapter->ops.data_complete(pmadapter, pmbuf, status);
@ -288,8 +287,7 @@ wlan_recv_packet_complete(IN pmlan_adapter pmadapter,
*
* @return N/A
*/
t_void
wlan_add_buf_bypass_txqueue(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
t_void wlan_add_buf_bypass_txqueue(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
{
pmlan_private priv = pmadapter->priv[pmbuf->bss_index];
ENTER();
@ -313,8 +311,7 @@ wlan_add_buf_bypass_txqueue(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
*
* @return MFALSE if not empty; MTRUE if empty
*/
INLINE t_u8
wlan_bypass_tx_list_empty(mlan_adapter *pmadapter)
INLINE t_u8 wlan_bypass_tx_list_empty(mlan_adapter *pmadapter)
{
return (pmadapter->bypass_pkt_count) ? MFALSE : MTRUE;
}
@ -326,18 +323,16 @@ wlan_bypass_tx_list_empty(mlan_adapter *pmadapter)
*
* @return N/A
*/
t_void
wlan_cleanup_bypass_txq(mlan_private *priv)
t_void wlan_cleanup_bypass_txq(mlan_private *priv)
{
pmlan_buffer pmbuf;
mlan_adapter *pmadapter = priv->adapter;
ENTER();
pmadapter->callbacks.moal_spin_lock(pmadapter->pmoal_handle,
priv->bypass_txq.plock);
while ((pmbuf =
(pmlan_buffer)util_peek_list(pmadapter->pmoal_handle,
&priv->bypass_txq, MNULL,
MNULL))) {
while ((pmbuf = (pmlan_buffer)util_peek_list(pmadapter->pmoal_handle,
&priv->bypass_txq, MNULL,
MNULL))) {
util_unlink_list(pmadapter->pmoal_handle, &priv->bypass_txq,
(pmlan_linked_list)pmbuf, MNULL, MNULL);
wlan_write_data_complete(pmadapter, pmbuf, MLAN_STATUS_FAILURE);
@ -355,8 +350,7 @@ wlan_cleanup_bypass_txq(mlan_private *priv)
*
* @return N/A
*/
t_void
wlan_process_bypass_tx(pmlan_adapter pmadapter)
t_void wlan_process_bypass_tx(pmlan_adapter pmadapter)
{
pmlan_buffer pmbuf;
mlan_tx_param tx_param;
@ -368,67 +362,51 @@ wlan_process_bypass_tx(pmlan_adapter pmadapter)
for (j = 0; j < pmadapter->priv_num; ++j) {
priv = pmadapter->priv[j];
if (priv) {
pmbuf = (pmlan_buffer)
util_dequeue_list(pmadapter->
pmoal_handle,
&priv->bypass_txq,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle,
&priv->bypass_txq,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
if (pmbuf) {
pmadapter->callbacks.
moal_spin_lock(pmadapter->
pmoal_handle,
priv->bypass_txq.
plock);
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
priv->bypass_txq.plock);
pmadapter->bypass_pkt_count--;
pmadapter->callbacks.
moal_spin_unlock(pmadapter->
pmoal_handle,
priv->
bypass_txq.
plock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
priv->bypass_txq.plock);
PRINTM(MINFO,
"Dequeuing bypassed packet %p\n",
pmbuf);
if (wlan_bypass_tx_list_empty
(pmadapter))
if (wlan_bypass_tx_list_empty(
pmadapter))
tx_param.next_pkt_len = 0;
else
tx_param.next_pkt_len =
pmbuf->data_len;
status = wlan_process_tx(pmadapter->
priv[pmbuf->
bss_index],
pmbuf,
&tx_param);
status = wlan_process_tx(
pmadapter->priv[pmbuf->bss_index],
pmbuf, &tx_param);
if (status == MLAN_STATUS_RESOURCE) {
/* Queue the packet again so that it will be TX'ed later */
pmadapter->callbacks.
moal_spin_lock
(pmadapter->
pmoal_handle,
priv->bypass_txq.
plock);
/* Queue the packet again so
* that it will be TX'ed later
*/
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
priv->bypass_txq.plock);
pmadapter->bypass_pkt_count++;
util_enqueue_list_head
(pmadapter->
pmoal_handle,
&priv->bypass_txq,
(pmlan_linked_list)
pmbuf,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
pmadapter->callbacks.
moal_spin_unlock
(pmadapter->
pmoal_handle,
priv->bypass_txq.
plock);
util_enqueue_list_head(
pmadapter->pmoal_handle,
&priv->bypass_txq,
(pmlan_linked_list)pmbuf,
pmadapter->callbacks
.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock);
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
priv->bypass_txq.plock);
}
break;
} else {
@ -436,7 +414,7 @@ wlan_process_bypass_tx(pmlan_adapter pmadapter)
}
}
}
} while (!pmadapter->data_sent && !pmadapter->tx_lock_flag
&& !wlan_bypass_tx_list_empty(pmadapter));
} while (!pmadapter->data_sent && !pmadapter->tx_lock_flag &&
!wlan_bypass_tx_list_empty(pmadapter));
LEAVE();
}

View File

@ -39,15 +39,12 @@ mlan_status wlan_uap_get_beacon_dtim(IN pmlan_private pmpriv);
mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req);
mlan_status wlan_ops_uap_prepare_cmd(IN t_void *priv,
IN t_u16 cmd_no,
IN t_u16 cmd_action,
IN t_u32 cmd_oid,
mlan_status wlan_ops_uap_prepare_cmd(IN t_void *priv, IN t_u16 cmd_no,
IN t_u16 cmd_action, IN t_u32 cmd_oid,
IN t_void *pioctl_buf,
IN t_void *pdata_buf, IN t_void *pcmd_buf);
mlan_status wlan_ops_uap_process_cmdresp(IN t_void *priv,
IN t_u16 cmdresp_no,
mlan_status wlan_ops_uap_process_cmdresp(IN t_void *priv, IN t_u16 cmdresp_no,
IN t_void *pcmd_buf,
IN t_void *pioctl);

View File

@ -53,8 +53,8 @@ Change log:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
wlan_upload_uap_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
static mlan_status wlan_upload_uap_rx_packet(pmlan_adapter pmadapter,
pmlan_buffer pmbuf)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef DEBUG_LEVEL1
@ -102,7 +102,6 @@ wlan_upload_uap_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
LEAVE();
return ret;
}
/**
@ -111,10 +110,10 @@ wlan_upload_uap_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
* @param priv A pointer to mlan_private
* @param mac mac address to find in station list table
*
* @return MLAN_STATUS_FAILURE -- drop packet, otherwise forward to network stack
* @return MLAN_STATUS_FAILURE -- drop packet, otherwise forward to
* network stack
*/
static mlan_status
wlan_check_unicast_packet(mlan_private *priv, t_u8 *mac)
static mlan_status wlan_check_unicast_packet(mlan_private *priv, t_u8 *mac)
{
int j;
sta_node *sta_ptr = MNULL;
@ -150,7 +149,6 @@ wlan_check_unicast_packet(mlan_private *priv, t_u8 *mac)
LEAVE();
return ret;
}
/********************************************************
Global Functions
********************************************************/
@ -162,8 +160,7 @@ wlan_check_unicast_packet(mlan_private *priv, t_u8 *mac)
*
* @return headptr or MNULL
*/
t_void *
wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
t_void *wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
{
pmlan_private pmpriv = (pmlan_private)priv;
TxPD *plocal_tx_pd;
@ -190,8 +187,8 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
pmbuf->data_offset += sizeof(pkt_type) + sizeof(tx_control);
pmbuf->data_len -= sizeof(pkt_type) + sizeof(tx_control);
}
if (pmbuf->data_offset < (sizeof(TxPD) + pmpriv->intf_hr_len +
DMA_ALIGNMENT)) {
if (pmbuf->data_offset <
(sizeof(TxPD) + pmpriv->intf_hr_len + DMA_ALIGNMENT)) {
PRINTM(MERROR,
"not enough space for TxPD: headroom=%d pkt_len=%d, required=%d\n",
pmbuf->data_offset, pmbuf->data_len,
@ -203,9 +200,8 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
}
/* head_ptr should be aligned */
head_ptr =
pmbuf->pbuf + pmbuf->data_offset - sizeof(TxPD) -
pmpriv->intf_hr_len;
head_ptr = pmbuf->pbuf + pmbuf->data_offset - sizeof(TxPD) -
pmpriv->intf_hr_len;
head_ptr = (t_u8 *)((t_ptr)head_ptr & ~((t_ptr)(DMA_ALIGNMENT - 1)));
plocal_tx_pd = (TxPD *)(head_ptr + pmpriv->intf_hr_len);
@ -227,10 +223,8 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
* Set the priority specific tx_control field, setting of 0 will
* cause the default value to be used later in this function
*/
plocal_tx_pd->tx_control
=
pmpriv->wmm.user_pri_pkt_tx_ctrl[plocal_tx_pd->
priority];
plocal_tx_pd->tx_control =
pmpriv->wmm.user_pri_pkt_tx_ctrl[plocal_tx_pd->priority];
if (pmbuf->flags & MLAN_BUF_FLAG_TX_STATUS) {
plocal_tx_pd->tx_control_1 |= pmbuf->tx_seq_num << 8;
@ -238,9 +232,8 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
}
/* Offset of actual data */
plocal_tx_pd->tx_pkt_offset =
(t_u16)((t_ptr)pmbuf->pbuf + pmbuf->data_offset -
(t_ptr)plocal_tx_pd);
plocal_tx_pd->tx_pkt_offset = (t_u16)(
(t_ptr)pmbuf->pbuf + pmbuf->data_offset - (t_ptr)plocal_tx_pd);
if (!plocal_tx_pd->tx_control) {
/* TxCtrl set by user or default */
@ -257,9 +250,10 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
pmbuf->pbuf + pmbuf->data_offset,
sizeof(dst_mac), sizeof(dst_mac));
plocal_tx_pd->tx_control |=
(wlan_ieee_rateid_to_mrvl_rateid
(pmpriv, pmbuf->u.tx_info.data_rate,
dst_mac) << 16);
(wlan_ieee_rateid_to_mrvl_rateid(
pmpriv, pmbuf->u.tx_info.data_rate,
dst_mac)
<< 16);
plocal_tx_pd->tx_control |= TXPD_TXRATE_ENABLE;
}
plocal_tx_pd->tx_control_1 |= pmbuf->u.tx_info.channel << 21;
@ -271,8 +265,8 @@ wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf)
plocal_tx_pd->tx_control |=
(t_u32)pmbuf->u.tx_info.tx_power.val;
if (pmbuf->u.tx_info.retry_limit) {
plocal_tx_pd->tx_control |=
pmbuf->u.tx_info.retry_limit << 8;
plocal_tx_pd->tx_control |= pmbuf->u.tx_info.retry_limit
<< 8;
plocal_tx_pd->tx_control |= TXPD_RETRY_ENABLE;
}
}
@ -298,8 +292,8 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
mlan_status wlan_ops_uap_process_rx_packet(IN t_void *adapter,
IN pmlan_buffer pmbuf)
{
pmlan_adapter pmadapter = (pmlan_adapter)adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -312,7 +306,7 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
t_u16 rx_pkt_type = 0;
sta_node *sta_ptr = MNULL;
#ifdef DRV_EMBEDDED_AUTHENTICATOR
t_u8 eapol_type[2] = { 0x88, 0x8e };
t_u8 eapol_type[2] = {0x88, 0x8e};
#endif
t_u16 adj_rx_rate = 0;
t_u8 antenna = 0;
@ -351,8 +345,9 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
(t_u16)pmbuf->data_len) {
PRINTM(MERROR,
"Wrong rx packet: len=%d,rx_pkt_offset=%d,"
" rx_pkt_length=%d\n", pmbuf->data_len,
prx_pd->rx_pkt_offset, prx_pd->rx_pkt_length);
" rx_pkt_length=%d\n",
pmbuf->data_len, prx_pd->rx_pkt_offset,
prx_pd->rx_pkt_length);
pmbuf->status_code = MLAN_ERROR_PKT_SIZE_INVALID;
ret = MLAN_STATUS_FAILURE;
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
@ -365,21 +360,17 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
/* Check if this is mgmt packet and needs to
* forwarded to app as an event
*/
puap_pkt_hdr =
(wlan_mgmt_pkt *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
puap_pkt_hdr = (wlan_mgmt_pkt *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
puap_pkt_hdr->frm_len = wlan_le16_to_cpu(puap_pkt_hdr->frm_len);
if ((puap_pkt_hdr->wlan_header.
frm_ctl & IEEE80211_FC_MGMT_FRAME_TYPE_MASK) == 0)
wlan_process_802dot11_mgmt_pkt(pmadapter->
priv[pmbuf->bss_index],
(t_u8 *)&puap_pkt_hdr->
wlan_header,
puap_pkt_hdr->frm_len +
sizeof(wlan_mgmt_pkt) -
sizeof(puap_pkt_hdr->
frm_len),
(RxPD *)prx_pd);
if ((puap_pkt_hdr->wlan_header.frm_ctl &
IEEE80211_FC_MGMT_FRAME_TYPE_MASK) == 0)
wlan_process_802dot11_mgmt_pkt(
pmadapter->priv[pmbuf->bss_index],
(t_u8 *)&puap_pkt_hdr->wlan_header,
puap_pkt_hdr->frm_len + sizeof(wlan_mgmt_pkt) -
sizeof(puap_pkt_hdr->frm_len),
(RxPD *)prx_pd);
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
goto done;
}
@ -390,17 +381,11 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
antenna = wlan_adjust_antenna(priv, (RxPD *)prx_pd);
adj_rx_rate =
wlan_adjust_data_rate(priv, priv->rxpd_rate,
priv->rxpd_rate_info);
pmadapter->callbacks.moal_hist_data_add(pmadapter->
pmoal_handle,
pmbuf->
bss_index,
adj_rx_rate,
prx_pd->snr,
prx_pd->nf,
antenna);
adj_rx_rate = wlan_adjust_data_rate(
priv, priv->rxpd_rate, priv->rxpd_rate_info);
pmadapter->callbacks.moal_hist_data_add(
pmadapter->pmoal_handle, pmbuf->bss_index,
adj_rx_rate, prx_pd->snr, prx_pd->nf, antenna);
}
}
@ -408,22 +393,20 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
if (sta_ptr) {
sta_ptr->snr = prx_pd->snr;
sta_ptr->nf = prx_pd->nf;
pmadapter->callbacks.moal_get_system_time(pmadapter->
pmoal_handle,
&last_rx_sec,
&last_rx_usec);
pmadapter->callbacks.moal_get_system_time(
pmadapter->pmoal_handle, &last_rx_sec, &last_rx_usec);
sta_ptr->stats.last_rx_in_msec =
(t_u64)last_rx_sec *1000 + (t_u64)last_rx_usec / 1000;
(t_u64)last_rx_sec * 1000 + (t_u64)last_rx_usec / 1000;
}
#ifdef DRV_EMBEDDED_AUTHENTICATOR
/**process eapol packet for uap*/
/**process eapol packet for uap*/
if (IsAuthenticatorEnabled(priv->psapriv) &&
(!memcmp(pmadapter, &prx_pkt->eth803_hdr.h803_len,
eapol_type, sizeof(eapol_type)))) {
ret = AuthenticatorProcessEapolPacket(priv->psapriv,
((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset),
prx_pd->rx_pkt_length);
(!memcmp(pmadapter, &prx_pkt->eth803_hdr.h803_len, eapol_type,
sizeof(eapol_type)))) {
ret = AuthenticatorProcessEapolPacket(
priv->psapriv, ((t_u8 *)prx_pd + prx_pd->rx_pkt_offset),
prx_pd->rx_pkt_length);
if (ret == MLAN_STATUS_SUCCESS) {
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
goto done;
@ -444,10 +427,9 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
}
/* check if UAP enable 11n */
if (!priv->is_11n_enabled ||
(!wlan_11n_get_rxreorder_tbl
((mlan_private *)priv, prx_pd->priority, ta)
&& (prx_pd->rx_pkt_type != PKT_TYPE_AMSDU)
)) {
(!wlan_11n_get_rxreorder_tbl((mlan_private *)priv, prx_pd->priority,
ta) &&
(prx_pd->rx_pkt_type != PKT_TYPE_AMSDU))) {
if (priv->pkt_fwd)
wlan_process_uap_rx_packet(priv, pmbuf);
else
@ -455,9 +437,9 @@ wlan_ops_uap_process_rx_packet(IN t_void *adapter, IN pmlan_buffer pmbuf)
goto done;
}
/* Reorder and send to OS */
ret = mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num,
prx_pd->priority, ta,
(t_u8)prx_pd->rx_pkt_type, (void *)pmbuf);
ret = mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num, prx_pd->priority,
ta, (t_u8)prx_pd->rx_pkt_type,
(void *)pmbuf);
if (ret || (rx_pkt_type == PKT_TYPE_BAR)) {
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
}
@ -475,8 +457,7 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
mlan_status wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
{
pmlan_adapter pmadapter = priv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -501,9 +482,10 @@ wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
if (prx_pkt->eth803_hdr.dest_addr[0] & 0x01) {
if (!(priv->pkt_fwd & PKT_FWD_INTRA_BCAST)) {
/* Multicast pkt */
newbuf = wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
newbuf =
wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
if (newbuf) {
newbuf->bss_index = pmbuf->bss_index;
newbuf->buf_type = pmbuf->buf_type;
@ -513,47 +495,45 @@ wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
newbuf->data_offset =
(sizeof(TxPD) + priv->intf_hr_len +
DMA_ALIGNMENT);
util_scalar_increment(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
util_scalar_increment(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
newbuf->flags |= MLAN_BUF_FLAG_BRIDGE_BUF;
/* copy the data */
memcpy_ext(pmadapter,
(t_u8 *)newbuf->pbuf +
newbuf->data_offset,
newbuf->data_offset,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len,
MLAN_TX_DATA_BUF_SIZE_2K);
newbuf->data_len = pmbuf->data_len;
wlan_wmm_add_buf_txqueue(pmadapter, newbuf);
if (util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock) >
if (util_scalar_read(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock) >
RX_HIGH_THRESHOLD)
wlan_drop_tx_pkts(priv);
wlan_recv_event(priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_recv_event(
priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
}
}
} else {
if ((!(priv->pkt_fwd & PKT_FWD_INTRA_UCAST)) &&
(wlan_get_station_entry
(priv, prx_pkt->eth803_hdr.dest_addr))) {
(wlan_get_station_entry(priv,
prx_pkt->eth803_hdr.dest_addr))) {
/* Intra BSS packet */
newbuf = wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
newbuf =
wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
if (newbuf) {
newbuf->bss_index = pmbuf->bss_index;
newbuf->buf_type = pmbuf->buf_type;
@ -563,42 +543,38 @@ wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
newbuf->data_offset =
(sizeof(TxPD) + priv->intf_hr_len +
DMA_ALIGNMENT);
util_scalar_increment(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
util_scalar_increment(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
newbuf->flags |= MLAN_BUF_FLAG_BRIDGE_BUF;
/* copy the data */
memcpy_ext(pmadapter,
(t_u8 *)newbuf->pbuf +
newbuf->data_offset,
newbuf->data_offset,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len,
MLAN_TX_DATA_BUF_SIZE_2K);
newbuf->data_len = pmbuf->data_len;
wlan_wmm_add_buf_txqueue(pmadapter, newbuf);
if (util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock) >
if (util_scalar_read(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock) >
RX_HIGH_THRESHOLD)
wlan_drop_tx_pkts(priv);
wlan_recv_event(priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_recv_event(
priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
}
goto done;
} else if (MLAN_STATUS_FAILURE ==
wlan_check_unicast_packet(priv,
prx_pkt->eth803_hdr.
dest_addr)) {
wlan_check_unicast_packet(
priv, prx_pkt->eth803_hdr.dest_addr)) {
/* drop packet */
PRINTM(MDATA, "Drop AMSDU dest " MACSTR "\n",
MAC2STR(prx_pkt->eth803_hdr.dest_addr));
@ -606,7 +582,7 @@ wlan_uap_recv_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
}
}
upload:
/** send packet to moal */
/** send packet to moal */
ret = pmadapter->callbacks.moal_recv_packet(pmadapter->pmoal_handle,
pmbuf);
done:
@ -623,8 +599,8 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_process_uap_rx_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
mlan_status wlan_process_uap_rx_packet(IN mlan_private *priv,
IN pmlan_buffer pmbuf)
{
pmlan_adapter pmadapter = priv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -659,9 +635,10 @@ wlan_process_uap_rx_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
if (prx_pkt->eth803_hdr.dest_addr[0] & 0x01) {
if (!(priv->pkt_fwd & PKT_FWD_INTRA_BCAST)) {
/* Multicast pkt */
newbuf = wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
newbuf =
wlan_alloc_mlan_buffer(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K,
0, MOAL_MALLOC_BUFFER);
if (newbuf) {
newbuf->bss_index = pmbuf->bss_index;
newbuf->buf_type = pmbuf->buf_type;
@ -671,53 +648,50 @@ wlan_process_uap_rx_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
newbuf->data_offset =
(sizeof(TxPD) + priv->intf_hr_len +
DMA_ALIGNMENT);
util_scalar_increment(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
util_scalar_increment(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
newbuf->flags |= MLAN_BUF_FLAG_BRIDGE_BUF;
/* copy the data, skip rxpd */
memcpy_ext(pmadapter,
(t_u8 *)newbuf->pbuf +
newbuf->data_offset,
newbuf->data_offset,
pmbuf->pbuf + pmbuf->data_offset +
prx_pd->rx_pkt_offset,
prx_pd->rx_pkt_offset,
pmbuf->data_len -
prx_pd->rx_pkt_offset,
prx_pd->rx_pkt_offset,
MLAN_TX_DATA_BUF_SIZE_2K);
newbuf->data_len =
pmbuf->data_len - prx_pd->rx_pkt_offset;
wlan_wmm_add_buf_txqueue(pmadapter, newbuf);
if (util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock) >
if (util_scalar_read(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock) >
RX_HIGH_THRESHOLD)
wlan_drop_tx_pkts(priv);
wlan_recv_event(priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_recv_event(
priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
}
}
} else {
if ((!(priv->pkt_fwd & PKT_FWD_INTRA_UCAST)) &&
(wlan_get_station_entry
(priv, prx_pkt->eth803_hdr.dest_addr))) {
(wlan_get_station_entry(priv,
prx_pkt->eth803_hdr.dest_addr))) {
/* Forwarding Intra-BSS packet */
#ifdef USB
if (IS_USB(pmadapter->card_type)) {
if (pmbuf->flags & MLAN_BUF_FLAG_RX_DEAGGR) {
newbuf = wlan_alloc_mlan_buffer
(pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K, 0,
MOAL_MALLOC_BUFFER);
newbuf = wlan_alloc_mlan_buffer(
pmadapter,
MLAN_TX_DATA_BUF_SIZE_2K, 0,
MOAL_MALLOC_BUFFER);
if (newbuf) {
newbuf->bss_index =
pmbuf->bss_index;
@ -733,59 +707,50 @@ wlan_process_uap_rx_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
(sizeof(TxPD) +
priv->intf_hr_len +
DMA_ALIGNMENT);
util_scalar_increment
(pmadapter->
pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
util_scalar_increment(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks
.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock);
newbuf->flags |=
MLAN_BUF_FLAG_BRIDGE_BUF;
/* copy the data, skip rxpd */
memcpy_ext(pmadapter,
(t_u8 *)newbuf->
pbuf +
newbuf->data_offset,
pmbuf->pbuf +
pmbuf->data_offset +
prx_pd->
rx_pkt_offset,
pmbuf->data_len -
prx_pd->
rx_pkt_offset,
pmbuf->data_len -
prx_pd->
rx_pkt_offset);
memcpy_ext(
pmadapter,
(t_u8 *)newbuf->pbuf +
newbuf->data_offset,
pmbuf->pbuf +
pmbuf->data_offset +
prx_pd->rx_pkt_offset,
pmbuf->data_len -
prx_pd->rx_pkt_offset,
pmbuf->data_len -
prx_pd->rx_pkt_offset);
newbuf->data_len =
pmbuf->data_len -
prx_pd->rx_pkt_offset;
wlan_wmm_add_buf_txqueue
(pmadapter, newbuf);
if (util_scalar_read
(pmadapter->pmoal_handle,
&pmadapter->
pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock) >
wlan_wmm_add_buf_txqueue(
pmadapter, newbuf);
if (util_scalar_read(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks
.moal_spin_lock,
pmadapter->callbacks
.moal_spin_unlock) >
RX_HIGH_THRESHOLD)
wlan_drop_tx_pkts(priv);
wlan_recv_event(priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
wlan_recv_event(
priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
}
pmadapter->callbacks.
moal_recv_complete(pmadapter->
pmoal_handle,
pmbuf,
pmadapter->
rx_data_ep,
ret);
pmadapter->callbacks.moal_recv_complete(
pmadapter->pmoal_handle, pmbuf,
pmadapter->rx_data_ep, ret);
goto done;
}
}
@ -793,28 +758,25 @@ wlan_process_uap_rx_packet(IN mlan_private *priv, IN pmlan_buffer pmbuf)
pmbuf->data_len -= prx_pd->rx_pkt_offset;
pmbuf->data_offset += prx_pd->rx_pkt_offset;
pmbuf->flags |= MLAN_BUF_FLAG_BRIDGE_BUF;
util_scalar_increment(pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock);
util_scalar_increment(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
wlan_wmm_add_buf_txqueue(pmadapter, pmbuf);
if (util_scalar_read(pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.
moal_spin_lock,
pmadapter->callbacks.
moal_spin_unlock) >
if (util_scalar_read(
pmadapter->pmoal_handle,
&pmadapter->pending_bridge_pkts,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock) >
RX_HIGH_THRESHOLD)
wlan_drop_tx_pkts(priv);
wlan_recv_event(priv, MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
goto done;
} else if (MLAN_STATUS_FAILURE ==
wlan_check_unicast_packet(priv,
prx_pkt->eth803_hdr.
dest_addr)) {
wlan_check_unicast_packet(
priv, prx_pkt->eth803_hdr.dest_addr)) {
PRINTM(MDATA, "Drop Pkts: Rx dest " MACSTR "\n",
MAC2STR(prx_pkt->eth803_hdr.dest_addr));
pmbuf->status_code = MLAN_ERROR_PKT_INVALID;

View File

@ -99,8 +99,7 @@ static const struct _mlan_card_info mlan_card_info_usb9097 = {
* @param rev_id A pointer to chip revision id
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_usb_check_revision(mlan_adapter *pmadapter, t_u32 *rev_id)
mlan_status wlan_usb_check_revision(mlan_adapter *pmadapter, t_u32 *rev_id)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
@ -174,8 +173,8 @@ cleanup:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
static mlan_status wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter,
IN pmlan_fw_image pmfw)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
@ -243,25 +242,25 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
sizeof(FWHeader));
DataLength = 0;
} else {
/* Copy the header of the firmware data to get the length */
/* Copy the header of the firmware data to get the
* length */
if (firmware)
memcpy_ext(pmadapter, &fwdata->fw_header,
&firmware[TotalBytes],
sizeof(FWHeader),
sizeof(fwdata->fw_header));
else
pcb->moal_get_fw_data(pmadapter->pmoal_handle,
TotalBytes,
sizeof(FWHeader),
(t_u8 *)&fwdata->
fw_header);
pcb->moal_get_fw_data(
pmadapter->pmoal_handle, TotalBytes,
sizeof(FWHeader),
(t_u8 *)&fwdata->fw_header);
DataLength =
wlan_le32_to_cpu(fwdata->fw_header.data_length);
DnldCmd = wlan_le32_to_cpu(fwdata->fw_header.dnld_cmd);
TotalBytes += sizeof(FWHeader);
/** CMD 7 don't have data_length field */
/** CMD 7 don't have data_length field */
if (DnldCmd == FW_CMD_4 || DnldCmd == FW_CMD_6 ||
DnldCmd == FW_CMD_7 || DnldCmd == FW_CMD_10)
DataLength = 0;
@ -297,10 +296,10 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
mbuf.pbuf = (t_u8 *)fwdata;
mbuf.data_len = length;
/* Send the firmware block */
ret = pcb->moal_write_data_sync(pmadapter->pmoal_handle,
&mbuf,
pmadapter->tx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
ret = pcb->moal_write_data_sync(
pmadapter->pmoal_handle, &mbuf,
pmadapter->tx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR,
"fw_dnld: write_data failed, ret %d\n",
@ -313,10 +312,10 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
mbuf.data_len = FW_DNLD_RX_BUF_SIZE;
/* Receive the firmware block response */
ret = pcb->moal_read_data_sync(pmadapter->pmoal_handle,
&mbuf,
pmadapter->rx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
ret = pcb->moal_read_data_sync(
pmadapter->pmoal_handle, &mbuf,
pmadapter->rx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR,
"fw_dnld: read_data failed, ret %d\n",
@ -326,7 +325,8 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
memcpy_ext(pmadapter, &SyncFWHeader, RecvBuff,
sizeof(FWSyncHeader), sizeof(SyncFWHeader));
endian_convert_syncfwheader(&SyncFWHeader);
/* Check the first firmware block response for highest bit set */
/* Check the first firmware block response for highest
* bit set */
if (check_winner) {
if (SyncFWHeader.cmd & 0x80000000) {
PRINTM(MMSG,
@ -343,7 +343,8 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
/* Check the firmware block response for CRC errors */
if (SyncFWHeader.cmd) {
/* Check firmware block response for CRC and MIC errors */
/* Check firmware block response for CRC and MIC
* errors */
if (check_fw_status) {
if (SyncFWHeader.status & MBIT(0)) {
PRINTM(MERROR,
@ -353,8 +354,8 @@ wlan_usb_prog_fw_w_helper(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
ret = MLAN_STATUS_FAILURE;
continue;
}
if (SyncFWHeader.
status & (MBIT(6) | MBIT(7))) {
if (SyncFWHeader.status &
(MBIT(6) | MBIT(7))) {
PRINTM(MERROR,
"FW received Blk with MIC error 0x%x offset\n",
SyncFWHeader.status,
@ -408,9 +409,8 @@ fw_exit:
*
* @return Number of packets
*/
static int
wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
int aggr_pkt_len)
static int wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
int aggr_pkt_len)
{
int pkt_count = 0, pkt_len;
RxPD *prx_pd;
@ -418,24 +418,23 @@ wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
ENTER();
while (aggr_pkt_len >= sizeof(RxPD)) {
prx_pd = (RxPD *)pdata;
pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length)
+ wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
if (pkt_len == 0) /* blank RxPD can be at the end */
pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length) +
wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
if (pkt_len == 0) /* blank RxPD can be at the end */
break;
++pkt_count;
if (aggr_pkt_len == pkt_len) /* last packet has no padding */
if (aggr_pkt_len == pkt_len) /* last packet has no padding */
break;
/* skip padding and goto next */
if (pkt_len %
pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.aggr_align)
pkt_len +=
(pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_align -
(pkt_len %
pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_align));
(pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl
.aggr_align -
(pkt_len % pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_align));
aggr_pkt_len -= pkt_len;
pdata += pkt_len;
}
@ -443,18 +442,13 @@ wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
return pkt_count;
}
static inline t_u32
usb_tx_aggr_pad_len(t_u32 len, usb_tx_aggr_params *pusb_tx_aggr)
static inline t_u32 usb_tx_aggr_pad_len(t_u32 len,
usb_tx_aggr_params *pusb_tx_aggr)
{
return (len % pusb_tx_aggr->aggr_ctrl.aggr_align) ? (len +
(pusb_tx_aggr->
aggr_ctrl.
aggr_align -
(len %
pusb_tx_aggr->
aggr_ctrl.
aggr_align))) :
len;
return (len % pusb_tx_aggr->aggr_ctrl.aggr_align) ?
(len + (pusb_tx_aggr->aggr_ctrl.aggr_align -
(len % pusb_tx_aggr->aggr_ctrl.aggr_align))) :
len;
}
/**
@ -468,8 +462,7 @@ usb_tx_aggr_pad_len(t_u32 len, usb_tx_aggr_params *pusb_tx_aggr)
* @return N/A
*/
static inline t_void
wlan_usb_tx_copy_buf_to_aggr(pmlan_adapter pmadapter,
pmlan_buffer pmbuf_aggr,
wlan_usb_tx_copy_buf_to_aggr(pmlan_adapter pmadapter, pmlan_buffer pmbuf_aggr,
pmlan_buffer pmbuf,
usb_tx_aggr_params *pusb_tx_aggr)
{
@ -478,13 +471,14 @@ wlan_usb_tx_copy_buf_to_aggr(pmlan_adapter pmadapter,
usb_tx_aggr_pad_len(pmbuf_aggr->data_len, pusb_tx_aggr);
memcpy_ext(pmadapter,
pmbuf_aggr->pbuf + pmbuf_aggr->data_offset +
pmbuf_aggr->data_len, pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len, pmbuf->data_len);
pmbuf_aggr->data_len,
pmbuf->pbuf + pmbuf->data_offset, pmbuf->data_len,
pmbuf->data_len);
pmbuf_aggr->data_len += pmbuf->data_len;
LEAVE();
}
#define MLAN_TYPE_AGGR_DATA_V2 11
#define MLAN_TYPE_AGGR_DATA_V2 11
/**
* @brief Copy pmbuf to aggregation buffer
*
@ -498,8 +492,7 @@ wlan_usb_tx_copy_buf_to_aggr(pmlan_adapter pmadapter,
*/
static inline t_void
wlan_usb_tx_copy_buf_to_aggr_v2(pmlan_adapter pmadapter,
pmlan_buffer pmbuf_aggr,
pmlan_buffer pmbuf,
pmlan_buffer pmbuf_aggr, pmlan_buffer pmbuf,
t_u8 last, usb_tx_aggr_params *pusb_tx_aggr)
{
t_u8 *payload;
@ -510,11 +503,11 @@ wlan_usb_tx_copy_buf_to_aggr_v2(pmlan_adapter pmadapter,
usb_tx_aggr_pad_len(pmbuf_aggr->data_len, pusb_tx_aggr);
memcpy_ext(pmadapter,
pmbuf_aggr->pbuf + pmbuf_aggr->data_offset +
pmbuf_aggr->data_len, pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len, pmbuf->data_len);
payload =
pmbuf_aggr->pbuf + pmbuf_aggr->data_offset +
pmbuf_aggr->data_len;
pmbuf_aggr->data_len,
pmbuf->pbuf + pmbuf->data_offset, pmbuf->data_len,
pmbuf->data_len);
payload = pmbuf_aggr->pbuf + pmbuf_aggr->data_offset +
pmbuf_aggr->data_len;
if (last) {
offset = pmbuf->data_len;
*(t_u16 *)&payload[2] =
@ -545,9 +538,8 @@ wlan_usb_copy_buf_to_aggr(pmlan_adapter pmadapter,
pmlan_buffer pmbuf_aggr = MNULL;
t_u8 i, use_count;
pmlan_buffer pmbuf_curr, pmbuf_next;
pmbuf_aggr =
wlan_alloc_mlan_buffer(pmadapter, pusb_tx_aggr->aggr_len, 0,
MOAL_MALLOC_BUFFER);
pmbuf_aggr = wlan_alloc_mlan_buffer(pmadapter, pusb_tx_aggr->aggr_len,
0, MOAL_MALLOC_BUFFER);
if (pmbuf_aggr) {
pmbuf_curr = pusb_tx_aggr->pmbuf_aggr;
pmbuf_aggr->bss_index = pmbuf_curr->bss_index;
@ -562,15 +554,15 @@ wlan_usb_copy_buf_to_aggr(pmlan_adapter pmadapter,
if (pusb_tx_aggr->aggr_ctrl.aggr_mode ==
MLAN_USB_AGGR_MODE_LEN_V2) {
if (i == use_count)
wlan_usb_tx_copy_buf_to_aggr_v2
(pmadapter, pmbuf_aggr,
pmbuf_curr, MTRUE,
pusb_tx_aggr);
wlan_usb_tx_copy_buf_to_aggr_v2(
pmadapter, pmbuf_aggr,
pmbuf_curr, MTRUE,
pusb_tx_aggr);
else
wlan_usb_tx_copy_buf_to_aggr_v2
(pmadapter, pmbuf_aggr,
pmbuf_curr, MFALSE,
pusb_tx_aggr);
wlan_usb_tx_copy_buf_to_aggr_v2(
pmadapter, pmbuf_aggr,
pmbuf_curr, MFALSE,
pusb_tx_aggr);
} else
wlan_usb_tx_copy_buf_to_aggr(pmadapter,
pmbuf_aggr,
@ -593,8 +585,7 @@ wlan_usb_copy_buf_to_aggr(pmlan_adapter pmadapter,
* @param pusb_tx_aggr Pointer to usb_tx_aggr_params
*/
static inline t_void
wlan_usb_tx_link_buf_to_aggr(pmlan_buffer pmbuf_aggr,
pmlan_buffer pmbuf,
wlan_usb_tx_link_buf_to_aggr(pmlan_buffer pmbuf_aggr, pmlan_buffer pmbuf,
usb_tx_aggr_params *pusb_tx_aggr)
{
/* link new buf at end of list */
@ -615,8 +606,8 @@ wlan_usb_tx_link_buf_to_aggr(pmlan_buffer pmbuf_aggr,
* @param pmadapter Pointer to mlan_adapter structure
* @param pusb_tx_aggr Pointer to usb_tx_aggr_params
*/
static inline t_void
wlan_usb_tx_send_aggr(pmlan_adapter pmadapter, usb_tx_aggr_params *pusb_tx_aggr)
static inline t_void wlan_usb_tx_send_aggr(pmlan_adapter pmadapter,
usb_tx_aggr_params *pusb_tx_aggr)
{
mlan_status ret;
pmlan_buffer pmbuf_aggr = pusb_tx_aggr->pmbuf_aggr;
@ -663,11 +654,9 @@ wlan_usb_tx_send_aggr(pmlan_adapter pmadapter, usb_tx_aggr_params *pusb_tx_aggr)
if (pmbuf_aggr && pmbuf_aggr->data_len) {
pmadapter->data_sent = MTRUE;
ret = pmadapter->callbacks.moal_write_data_async(pmadapter->
pmoal_handle,
pmbuf_aggr,
pusb_tx_aggr->
port);
ret = pmadapter->callbacks.moal_write_data_async(
pmadapter->pmoal_handle, pmbuf_aggr,
pusb_tx_aggr->port);
switch (ret) {
case MLAN_STATUS_PRESOURCE:
PRINTM(MINFO, "MLAN_STATUS_PRESOURCE is returned\n");
@ -675,7 +664,8 @@ wlan_usb_tx_send_aggr(pmlan_adapter pmadapter, usb_tx_aggr_params *pusb_tx_aggr)
case MLAN_STATUS_RESOURCE:
/* Shouldn't reach here due to next condition. */
/* TODO: (maybe) How to requeue the aggregate? */
/* It may occur when the pending tx urbs reach the high mark */
/* It may occur when the pending tx urbs reach the high
* mark */
/* Thus, block further pkts for a bit */
PRINTM(MERROR,
"Error: moal_write_data_async failed: 0x%X\n",
@ -720,8 +710,7 @@ wlan_usb_tx_send_aggr(pmlan_adapter pmadapter, usb_tx_aggr_params *pusb_tx_aggr)
* @param pmadapter A pointer to mlan_adapter structure
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_get_usb_device(pmlan_adapter pmadapter)
mlan_status wlan_get_usb_device(pmlan_adapter pmadapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 card_type = pmadapter->card_type;
@ -782,8 +771,7 @@ wlan_get_usb_device(pmlan_adapter pmadapter)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_usb_dnld_fw(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
mlan_status wlan_usb_dnld_fw(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -807,10 +795,10 @@ wlan_usb_dnld_fw(IN pmlan_adapter pmadapter, IN pmlan_fw_image pmfw)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_usb_deaggr_rx_pkt(IN pmlan_adapter pmadapter, IN pmlan_buffer pmbuf)
mlan_status wlan_usb_deaggr_rx_pkt(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf)
{
const t_u8 zero_rx_pd[sizeof(RxPD)] = { 0 };
const t_u8 zero_rx_pd[sizeof(RxPD)] = {0};
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u32 curr_pkt_len;
RxPD *prx_pd;
@ -822,13 +810,13 @@ wlan_usb_deaggr_rx_pkt(IN pmlan_adapter pmadapter, IN pmlan_buffer pmbuf)
pdata = pmbuf->pbuf + pmbuf->data_offset;
prx_pd = (RxPD *)pdata;
curr_pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length)
+ wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
curr_pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length) +
wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
/* if non-aggregate, just send through, dont process here */
aggr_len = pmbuf->data_len;
if ((aggr_len == curr_pkt_len)
|| (wlan_usb_deaggr_rx_num_pkts(pmadapter, pdata, aggr_len) == 1)
|| (pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.enable != MTRUE)) {
if ((aggr_len == curr_pkt_len) ||
(wlan_usb_deaggr_rx_num_pkts(pmadapter, pdata, aggr_len) == 1) ||
(pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.enable != MTRUE)) {
ret = wlan_handle_rx_packet(pmadapter, pmbuf);
LEAVE();
return ret;
@ -875,24 +863,22 @@ wlan_usb_deaggr_rx_pkt(IN pmlan_adapter pmadapter, IN pmlan_buffer pmbuf)
/* round up to next block boundary */
if (curr_pkt_len %
pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.aggr_align)
curr_pkt_len +=
(pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_align -
(curr_pkt_len %
pmadapter->pcard_usb->usb_rx_deaggr.aggr_ctrl.
aggr_align));
curr_pkt_len += (pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_align -
(curr_pkt_len %
pmadapter->pcard_usb->usb_rx_deaggr
.aggr_ctrl.aggr_align));
/* point to next packet */
aggr_len -= curr_pkt_len;
pdata += curr_pkt_len;
prx_pd = (RxPD *)pdata;
curr_pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length)
+ wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
curr_pkt_len = wlan_le16_to_cpu(prx_pd->rx_pkt_length) +
wlan_le16_to_cpu(prx_pd->rx_pkt_offset);
}
/* free original pmbuf (since not sent for processing) */
pmadapter->callbacks.moal_recv_complete(pmadapter->pmoal_handle,
pmbuf, pmadapter->rx_data_ep,
ret);
pmadapter->callbacks.moal_recv_complete(pmadapter->pmoal_handle, pmbuf,
pmadapter->rx_data_ep, ret);
LEAVE();
return ret;
}
@ -905,9 +891,8 @@ wlan_usb_deaggr_rx_pkt(IN pmlan_adapter pmadapter, IN pmlan_buffer pmbuf)
*
* @return MTRUE/MFALSE
*/
t_u8
wlan_is_port_tx_paused(pmlan_adapter pmadapter,
usb_tx_aggr_params *pusb_tx_aggr)
t_u8 wlan_is_port_tx_paused(pmlan_adapter pmadapter,
usb_tx_aggr_params *pusb_tx_aggr)
{
mlan_private *pmpriv = MNULL;
t_u8 i;
@ -930,10 +915,8 @@ wlan_is_port_tx_paused(pmlan_adapter pmadapter,
* @param function_context A pointer to function_context
* @return N/A
*/
t_void
wlan_usb_tx_aggr_timeout_func(t_void *function_context)
t_void wlan_usb_tx_aggr_timeout_func(t_void *function_context)
{
usb_tx_aggr_params *pusb_tx_aggr =
(usb_tx_aggr_params *)function_context;
pmlan_adapter pmadapter = (mlan_adapter *)pusb_tx_aggr->phandle;
@ -942,9 +925,8 @@ wlan_usb_tx_aggr_timeout_func(t_void *function_context)
ENTER();
pcb->moal_spin_lock(pmadapter->pmoal_handle, pusb_tx_aggr->paggr_lock);
pusb_tx_aggr->aggr_hold_timer_is_set = MFALSE;
if (pusb_tx_aggr->pmbuf_aggr && !pmadapter->data_sent
&& !wlan_is_port_tx_paused(pmadapter, pusb_tx_aggr)
)
if (pusb_tx_aggr->pmbuf_aggr && !pmadapter->data_sent &&
!wlan_is_port_tx_paused(pmadapter, pusb_tx_aggr))
wlan_usb_tx_send_aggr(pmadapter, pusb_tx_aggr);
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
pusb_tx_aggr->paggr_lock);
@ -968,11 +950,10 @@ wlan_usb_tx_aggr_timeout_func(t_void *function_context)
* in order to handle complete AFTER the aggregate is sent.
* pmbuf_aggr->data_len is used to keep track of bytes aggregated so far.
*/
mlan_status
wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf,
IN mlan_tx_param *tx_param,
IN usb_tx_aggr_params *pusb_tx_aggr)
mlan_status wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
IN pmlan_buffer pmbuf,
IN mlan_tx_param *tx_param,
IN usb_tx_aggr_params *pusb_tx_aggr)
{
pmlan_callbacks pcb = &pmadapter->callbacks;
pmlan_buffer pmbuf_aggr;
@ -1004,7 +985,8 @@ wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
pusb_tx_aggr->hold_timeout_msec =
MLAN_USB_TX_MIN_AGGR_TIMEOUT;
} else {
/* Increase timeout in milisecond if pkts are consecutive */
/* Increase timeout in milisecond if pkts are
* consecutive */
if (pusb_tx_aggr->hold_timeout_msec <
MLAN_USB_TX_MAX_AGGR_TIMEOUT)
pusb_tx_aggr->hold_timeout_msec++;
@ -1017,9 +999,8 @@ wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
max_aggr_size = max_aggr_num = pusb_tx_aggr->aggr_ctrl.aggr_max;
if (pusb_tx_aggr->aggr_ctrl.aggr_mode == MLAN_USB_AGGR_MODE_NUM) {
max_aggr_size *=
MAX(MLAN_USB_MAX_PKT_SIZE,
pusb_tx_aggr->aggr_ctrl.aggr_align);
max_aggr_size *= MAX(MLAN_USB_MAX_PKT_SIZE,
pusb_tx_aggr->aggr_ctrl.aggr_align);
}
if (pusb_tx_aggr->aggr_ctrl.aggr_mode == MLAN_USB_AGGR_MODE_LEN)
max_aggr_num /= pusb_tx_aggr->aggr_ctrl.aggr_align;
@ -1035,25 +1016,27 @@ wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
} else {
/* DECIDE what to do */
aggr_len_counter =
usb_tx_aggr_pad_len(pusb_tx_aggr->aggr_len,
pusb_tx_aggr);
aggr_len_counter = usb_tx_aggr_pad_len(pusb_tx_aggr->aggr_len,
pusb_tx_aggr);
if ((aggr_len_counter + pmbuf->data_len) < max_aggr_size) {
f_precopy_cur_buf = 1; /* can fit current packet in aggr */
f_precopy_cur_buf = 1; /* can fit current packet in aggr
*/
if (next_pkt_len) {
aggr_len_counter +=
usb_tx_aggr_pad_len(pmbuf->data_len,
pusb_tx_aggr);
aggr_len_counter += usb_tx_aggr_pad_len(
pmbuf->data_len, pusb_tx_aggr);
if ((aggr_len_counter + next_pkt_len) >=
max_aggr_size)
f_send_aggr_buf = 1; /* can't fit next packet, send now */
f_send_aggr_buf = 1; /* can't fit next
packet, send now
*/
}
} else {
/* can't fit current packet */
if (pusb_tx_aggr->aggr_len)
f_send_aggr_buf = 1; /* send aggr first */
f_postcopy_cur_buf = 1; /* then copy into new aggr_buf */
f_send_aggr_buf = 1; /* send aggr first */
f_postcopy_cur_buf = 1; /* then copy into new aggr_buf
*/
}
}
@ -1069,19 +1052,19 @@ wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
if (pmbuf_aggr->use_count + 1 >= max_aggr_num)
f_send_aggr_buf = 1;
if (pmbuf->flags & MLAN_BUF_FLAG_NULL_PKT
|| pmbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
if (pmbuf->flags & MLAN_BUF_FLAG_NULL_PKT ||
pmbuf->flags & MLAN_BUF_FLAG_TCP_ACK)
f_send_aggr_buf = 1;
if (f_send_aggr_buf) {
PRINTM(MIF_D, "%s: Send aggregate buffer.\n", __FUNCTION__);
wlan_usb_tx_send_aggr(pmadapter, pusb_tx_aggr);
pmbuf_aggr = pusb_tx_aggr->pmbuf_aggr; /* update ptr */
pmbuf_aggr = pusb_tx_aggr->pmbuf_aggr; /* update ptr */
}
if (f_postcopy_cur_buf) {
PRINTM(MIF_D, "%s: Postcopy current buffer.\n", __FUNCTION__);
if (!pmbuf_aggr) { /* this is possible if just sent (above) */
if (!pmbuf_aggr) { /* this is possible if just sent (above) */
/* use this buf to start linked list */
pmbuf->pnext = pmbuf->pprev = pmbuf;
pmbuf_aggr = pmbuf;
@ -1115,8 +1098,7 @@ wlan_usb_host_to_card_aggr(IN pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_pm_usb_wakeup_card(IN pmlan_adapter pmadapter, IN t_u8 timeout)
mlan_status wlan_pm_usb_wakeup_card(IN pmlan_adapter pmadapter, IN t_u8 timeout)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u32 age_ts_usec;
@ -1147,14 +1129,15 @@ wlan_pm_usb_wakeup_card(IN pmlan_adapter pmadapter, IN t_u8 timeout)
*
* @param pmpriv A pointer to pmlan_private structure
* @param type data or command
* @param pmbuf A pointer to mlan_buffer (pmbuf->data_len should include PCIE header)
* @param tx_param A pointer to mlan_tx_param (can be MNULL if type is command)
* @param pmbuf A pointer to mlan_buffer (pmbuf->data_len should include
* PCIE header)
* @param tx_param A pointer to mlan_tx_param (can be MNULL if type is
* command)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
mlan_buffer *pmbuf, mlan_tx_param *tx_param)
mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
mlan_buffer *pmbuf, mlan_tx_param *tx_param)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
usb_tx_aggr_params *pusb_tx_aggr = MNULL;
@ -1167,16 +1150,13 @@ wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
return MLAN_STATUS_FAILURE;
}
if (type == MLAN_TYPE_CMD
#if defined(FW_VDLL) && (defined(USB9098) || defined(USB9097))
#if (defined(USB9098) || defined(USB9097))
|| type == MLAN_TYPE_VDLL
#endif
) {
) {
pmadapter->cmd_sent = MTRUE;
ret = pmadapter->callbacks.moal_write_data_async(pmadapter->
pmoal_handle,
pmbuf,
pmadapter->
tx_cmd_ep);
ret = pmadapter->callbacks.moal_write_data_async(
pmadapter->pmoal_handle, pmbuf, pmadapter->tx_cmd_ep);
if (ret == MLAN_STATUS_FAILURE)
pmadapter->cmd_sent = MFALSE;
LEAVE();
@ -1188,10 +1168,8 @@ wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
pusb_tx_aggr);
} else {
pmadapter->data_sent = MTRUE;
ret = pmadapter->callbacks.moal_write_data_async(pmadapter->
pmoal_handle,
pmbuf,
pmpriv->port);
ret = pmadapter->callbacks.moal_write_data_async(
pmadapter->pmoal_handle, pmbuf, pmpriv->port);
switch (ret) {
case MLAN_STATUS_PRESOURCE:
PRINTM(MINFO, "MLAN_STATUS_PRESOURCE is returned\n");
@ -1210,7 +1188,6 @@ wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
default:
break;
}
}
LEAVE();
@ -1224,9 +1201,8 @@ wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
mlan_status
wlan_usb_cmdevt_complete(IN pmlan_adapter pmadapter, mlan_buffer *pmbuf,
mlan_status status)
mlan_status wlan_usb_cmdevt_complete(IN pmlan_adapter pmadapter,
mlan_buffer *pmbuf, mlan_status status)
{
ENTER();
@ -1244,9 +1220,8 @@ wlan_usb_cmdevt_complete(IN pmlan_adapter pmadapter, mlan_buffer *pmbuf,
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
mlan_status
wlan_usb_data_complete(IN pmlan_adapter pmadapter, mlan_buffer *pmbuf,
mlan_status status)
mlan_status wlan_usb_data_complete(IN pmlan_adapter pmadapter,
mlan_buffer *pmbuf, mlan_status status)
{
ENTER();
@ -1264,8 +1239,8 @@ wlan_usb_data_complete(IN pmlan_adapter pmadapter, mlan_buffer *pmbuf,
* @param pmbuf A pointer to the mlan_buffer
* @return
*/
mlan_status
wlan_usb_handle_rx_packet(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
mlan_status wlan_usb_handle_rx_packet(mlan_adapter *pmadapter,
pmlan_buffer pmbuf)
{
ENTER();

View File

@ -31,19 +31,19 @@ Change log:
/** Circular doubly linked list */
typedef struct _mlan_linked_list {
/** Pointer to previous node */
/** Pointer to previous node */
struct _mlan_linked_list *pprev;
/** Pointer to next node */
/** Pointer to next node */
struct _mlan_linked_list *pnext;
} mlan_linked_list, *pmlan_linked_list;
/** List head */
typedef struct _mlan_list_head {
/** Pointer to previous node */
/** Pointer to previous node */
struct _mlan_linked_list *pprev;
/** Pointer to next node */
/** Pointer to next node */
struct _mlan_linked_list *pnext;
/** Pointer to lock */
/** Pointer to lock */
t_void *plock;
} mlan_list_head, *pmlan_list_head;
@ -54,8 +54,7 @@ typedef struct _mlan_list_head {
*
* @return N/A
*/
static INLINE t_void
util_init_list(pmlan_linked_list phead)
static INLINE t_void util_init_list(pmlan_linked_list phead)
{
/* Both next and prev point to self */
phead->pprev = phead->pnext = (pmlan_linked_list)phead;
@ -70,12 +69,9 @@ util_init_list(pmlan_linked_list phead)
*
* @return N/A
*/
static INLINE t_void
util_init_list_head(t_void *pmoal_handle,
pmlan_list_head phead,
t_u8 lock_required,
mlan_status (*moal_init_lock) (t_void *handle,
t_void **pplock))
static INLINE t_void util_init_list_head(
t_void *pmoal_handle, pmlan_list_head phead, t_u8 lock_required,
mlan_status (*moal_init_lock)(t_void *handle, t_void **pplock))
{
/* Both next and prev point to self */
util_init_list((pmlan_linked_list)phead);
@ -93,11 +89,9 @@ util_init_list_head(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_free_list_head(t_void *pmoal_handle,
pmlan_list_head phead,
mlan_status (*moal_free_lock) (t_void *handle,
t_void *plock))
static INLINE t_void util_free_list_head(
t_void *pmoal_handle, pmlan_list_head phead,
mlan_status (*moal_free_lock)(t_void *handle, t_void *plock))
{
phead->pprev = phead->pnext = 0;
if (phead->plock)
@ -114,10 +108,9 @@ util_free_list_head(t_void *pmoal_handle,
* @return List node
*/
static INLINE pmlan_linked_list
util_peek_list(t_void *pmoal_handle,
pmlan_list_head phead,
mlan_status (*moal_spin_lock) (t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle, t_void *plock))
util_peek_list(t_void *pmoal_handle, pmlan_list_head phead,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
pmlan_linked_list pnode = 0;
@ -140,14 +133,10 @@ util_peek_list(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_enqueue_list_tail(t_void *pmoal_handle,
pmlan_list_head phead,
pmlan_linked_list pnode,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_enqueue_list_tail(
t_void *pmoal_handle, pmlan_list_head phead, pmlan_linked_list pnode,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
pmlan_linked_list pold_last;
@ -172,14 +161,10 @@ util_enqueue_list_tail(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_enqueue_list_head(t_void *pmoal_handle,
pmlan_list_head phead,
pmlan_linked_list pnode,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_enqueue_list_head(
t_void *pmoal_handle, pmlan_list_head phead, pmlan_linked_list pnode,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
pmlan_linked_list pold_first;
@ -204,13 +189,10 @@ util_enqueue_list_head(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_unlink_list(t_void *pmoal_handle,
pmlan_list_head phead,
pmlan_linked_list pnode,
mlan_status (*moal_spin_lock) (t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_unlink_list(
t_void *pmoal_handle, pmlan_list_head phead, pmlan_linked_list pnode,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
pmlan_linked_list pmy_prev;
pmlan_linked_list pmy_next;
@ -236,12 +218,10 @@ util_unlink_list(t_void *pmoal_handle,
*
* @return List node
*/
static INLINE pmlan_linked_list
util_dequeue_list(t_void *pmoal_handle,
pmlan_list_head phead,
mlan_status (*moal_spin_lock) (t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE pmlan_linked_list util_dequeue_list(
t_void *pmoal_handle, pmlan_list_head phead,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
pmlan_linked_list pnode;
@ -259,16 +239,16 @@ util_dequeue_list(t_void *pmoal_handle,
/** Access controlled scalar variable */
typedef struct _mlan_scalar {
/** Value */
/** Value */
t_s32 value;
/** Pointer to lock */
/** Pointer to lock */
t_void *plock;
/** Control flags */
/** Control flags */
t_u32 flags;
} mlan_scalar, *pmlan_scalar;
/** Flag to scalar lock acquired */
#define MLAN_SCALAR_FLAG_UNIQUE_LOCK MBIT(16)
#define MLAN_SCALAR_FLAG_UNIQUE_LOCK MBIT(16)
/** scalar conditional value list */
typedef enum _MLAN_SCALAR_CONDITIONAL {
@ -291,12 +271,9 @@ typedef enum _MLAN_SCALAR_CONDITIONAL {
* @return N/A
*/
static INLINE t_void
util_scalar_init(t_void *pmoal_handle,
pmlan_scalar pscalar,
t_s32 val,
util_scalar_init(t_void *pmoal_handle, pmlan_scalar pscalar, t_s32 val,
t_void *plock_to_use,
mlan_status (*moal_init_lock) (t_void *handle,
t_void **pplock))
mlan_status (*moal_init_lock)(t_void *handle, t_void **pplock))
{
pscalar->value = val;
pscalar->flags = 0;
@ -318,9 +295,8 @@ util_scalar_init(t_void *pmoal_handle,
* @return N/A
*/
static INLINE t_void
util_scalar_free(t_void *pmoal_handle,
pmlan_scalar pscalar,
mlan_status (*moal_free_lock) (t_void *handle, t_void *plock))
util_scalar_free(t_void *pmoal_handle, pmlan_scalar pscalar,
mlan_status (*moal_free_lock)(t_void *handle, t_void *plock))
{
if (pscalar->flags & MLAN_SCALAR_FLAG_UNIQUE_LOCK)
moal_free_lock(pmoal_handle, pscalar->plock);
@ -336,11 +312,9 @@ util_scalar_free(t_void *pmoal_handle,
* @return Stored value
*/
static INLINE t_s32
util_scalar_read(t_void *pmoal_handle,
pmlan_scalar pscalar,
mlan_status (*moal_spin_lock) (t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
util_scalar_read(t_void *pmoal_handle, pmlan_scalar pscalar,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
t_s32 val;
@ -363,13 +337,10 @@ util_scalar_read(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_scalar_write(t_void *pmoal_handle,
pmlan_scalar pscalar,
t_s32 val,
mlan_status (*moal_spin_lock) (t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_scalar_write(
t_void *pmoal_handle, pmlan_scalar pscalar, t_s32 val,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
if (moal_spin_lock)
moal_spin_lock(pmoal_handle, pscalar->plock);
@ -387,13 +358,10 @@ util_scalar_write(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_scalar_increment(t_void *pmoal_handle,
pmlan_scalar pscalar,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_scalar_increment(
t_void *pmoal_handle, pmlan_scalar pscalar,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
if (moal_spin_lock)
moal_spin_lock(pmoal_handle, pscalar->plock);
@ -411,13 +379,10 @@ util_scalar_increment(t_void *pmoal_handle,
*
* @return N/A
*/
static INLINE t_void
util_scalar_decrement(t_void *pmoal_handle,
pmlan_scalar pscalar,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_void util_scalar_decrement(
t_void *pmoal_handle, pmlan_scalar pscalar,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
if (moal_spin_lock)
moal_spin_lock(pmoal_handle, pscalar->plock);
@ -437,14 +402,10 @@ util_scalar_decrement(t_void *pmoal_handle,
*
* @return Value after offset
*/
static INLINE t_s32
util_scalar_offset(t_void *pmoal_handle,
pmlan_scalar pscalar,
t_s32 offset,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_s32 util_scalar_offset(
t_void *pmoal_handle, pmlan_scalar pscalar, t_s32 offset,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
t_s32 newval;
@ -471,16 +432,11 @@ util_scalar_offset(t_void *pmoal_handle,
*
* @return Comparison result (MTRUE or MFALSE)
*/
static INLINE t_u8
util_scalar_conditional_write(t_void *pmoal_handle,
pmlan_scalar pscalar,
MLAN_SCALAR_CONDITIONAL condition,
t_s32 val_compare,
t_s32 val_to_set,
mlan_status (*moal_spin_lock) (t_void *handle,
t_void *plock),
mlan_status (*moal_spin_unlock) (t_void *handle,
t_void *plock))
static INLINE t_u8 util_scalar_conditional_write(
t_void *pmoal_handle, pmlan_scalar pscalar,
MLAN_SCALAR_CONDITIONAL condition, t_s32 val_compare, t_s32 val_to_set,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
mlan_status (*moal_spin_unlock)(t_void *handle, t_void *plock))
{
t_u8 update;
if (moal_spin_lock)
@ -523,14 +479,11 @@ util_scalar_conditional_write(t_void *pmoal_handle,
* @param num number
* @return number of bits
*/
static INLINE t_u32
bitcount(t_u32 num)
static INLINE t_u32 bitcount(t_u32 num)
{
t_u32 count = 0;
static t_u32 nibblebits[] = {
0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4
};
static t_u32 nibblebits[] = {0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4};
for (; num != 0; num >>= 4)
count += nibblebits[num & 0x0f];
return count;

File diff suppressed because it is too large Load Diff

View File

@ -37,8 +37,7 @@ Change log:
*
* @return TID
*/
static INLINE t_u32
wlan_get_tid(pmlan_adapter pmadapter, raListTbl *ptr)
static INLINE t_u32 wlan_get_tid(pmlan_adapter pmadapter, raListTbl *ptr)
{
pmlan_buffer mbuf;
@ -48,7 +47,7 @@ wlan_get_tid(pmlan_adapter pmadapter, raListTbl *ptr)
LEAVE();
if (!mbuf) {
return 0; // The default TID,BE
return 0; // The default TID,BE
} else
return mbuf->priority;
}
@ -60,8 +59,7 @@ wlan_get_tid(pmlan_adapter pmadapter, raListTbl *ptr)
*
* @return Length of list
*/
static INLINE t_u32
wlan_wmm_list_len(pmlan_list_head head)
static INLINE t_u32 wlan_wmm_list_len(pmlan_list_head head)
{
pmlan_linked_list pos;
t_u32 count = 0;
@ -86,8 +84,7 @@ wlan_wmm_list_len(pmlan_list_head head)
*
* @return N/A
*/
static INLINE t_void
wlan_request_ralist_lock(IN mlan_private *priv)
static INLINE t_void wlan_request_ralist_lock(IN mlan_private *priv)
{
mlan_adapter *pmadapter = priv->adapter;
mlan_callbacks *pcb = (mlan_callbacks *)&pmadapter->callbacks;
@ -109,8 +106,7 @@ wlan_request_ralist_lock(IN mlan_private *priv)
*
* @return N/A
*/
static INLINE t_void
wlan_release_ralist_lock(IN mlan_private *priv)
static INLINE t_void wlan_release_ralist_lock(IN mlan_private *priv)
{
mlan_adapter *pmadapter = priv->adapter;
mlan_callbacks *pcb = (mlan_callbacks *)&pmadapter->callbacks;
@ -211,8 +207,8 @@ extern mlan_status wlan_cmd_wmm_ts_status(IN pmlan_private pmpriv,
* Functions used in the cmdresp handling routine
*/
/** WMM get status command response handler */
extern mlan_status wlan_ret_wmm_get_status(IN pmlan_private priv,
IN t_u8 *ptlv, IN int resp_len);
extern mlan_status wlan_ret_wmm_get_status(IN pmlan_private priv, IN t_u8 *ptlv,
IN int resp_len);
/** WMM ADDTS request command response handler */
extern mlan_status wlan_ret_wmm_addts_req(IN pmlan_private pmpriv,
const IN HostCmd_DS_COMMAND *resp,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +1,66 @@
/** @file moal_cfg80211.h
*
* @brief This file contains the CFG80211 specific defines.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains the CFG80211 specific defines.
*
*
* Copyright 2014-2020 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_CFG80211_H_
#define _MOAL_CFG80211_H_
#include "moal_main.h"
#include "moal_main.h"
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
#define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR
#define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
#if KERNEL_VERSION(3, 16, 0) <= CFG80211_VERSION_CODE
#define MAX_CSA_COUNTERS_NUM 2
#endif
/* Clear all key indexes */
#define KEY_INDEX_CLEAR_ALL (0x0000000F)
#define KEY_INDEX_CLEAR_ALL (0x0000000F)
/** RTS/FRAG disabled value */
#define MLAN_FRAG_RTS_DISABLED (0xFFFFFFFF)
#define MLAN_FRAG_RTS_DISABLED (0xFFFFFFFF)
#ifndef WLAN_CIPHER_SUITE_SMS4
#define WLAN_CIPHER_SUITE_SMS4 0x00000020
#define WLAN_CIPHER_SUITE_SMS4 0x00000020
#endif
#ifndef WLAN_CIPHER_SUITE_AES_CMAC
#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4,0,0)
#if KERNEL_VERSION(4, 0, 0) <= CFG80211_VERSION_CODE
#ifndef WLAN_CIPHER_SUITE_BIP_GMAC_256
#define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C
#endif
#endif
/* define for custom ie operation */
#define MLAN_CUSTOM_IE_AUTO_IDX_MASK 0xffff
#define MLAN_CUSTOM_IE_NEW_MASK 0x8000
#define IE_MASK_WPS 0x0001
#define IE_MASK_P2P 0x0002
#define IE_MASK_WFD 0x0004
#define IE_MASK_VENDOR 0x0008
#define IE_MASK_EXTCAP 0x0010
#define MLAN_CUSTOM_IE_AUTO_IDX_MASK 0xffff
#define MLAN_CUSTOM_IE_NEW_MASK 0x8000
#define IE_MASK_WPS 0x0001
#define IE_MASK_P2P 0x0002
#define IE_MASK_WFD 0x0004
#define IE_MASK_VENDOR 0x0008
#define IE_MASK_EXTCAP 0x0010
#define MRVL_PKT_TYPE_MGMT_FRAME 0xE5
@ -81,13 +81,13 @@ void *woal_get_netdev_priv(struct net_device *dev);
#ifdef STA_SUPPORT
/** get scan interface */
moal_private *woal_get_scan_interface(moal_handle *handle);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
/** AUTH pending flag */
#define HOST_MLME_AUTH_PENDING MBIT(0)
#define HOST_MLME_AUTH_PENDING MBIT(0)
/** AUTH complete flag */
#define HOST_MLME_AUTH_DONE MBIT(1)
#define HOST_MLME_ASSOC_PENDING MBIT(2)
#define HOST_MLME_ASSOC_DONE MBIT(3)
#define HOST_MLME_AUTH_DONE MBIT(1)
#define HOST_MLME_ASSOC_PENDING MBIT(2)
#define HOST_MLME_ASSOC_DONE MBIT(3)
void woal_host_mlme_disconnect(moal_private *priv, t_u16 reason_code, t_u8 *sa);
void woal_host_mlme_work_queue(struct work_struct *work);
#endif
@ -98,23 +98,23 @@ t_u8 woal_band_cfg_to_ieee_band(t_u32 band);
int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
enum nl80211_iftype type,
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
#if KERNEL_VERSION(4, 12, 0) > CFG80211_VERSION_CODE
u32 *flags,
#endif
struct vif_params *params);
int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
int woal_cfg80211_add_key(struct wiphy *wiphy,
struct net_device *dev, t_u8 key_index,
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
#endif
const t_u8 *mac_addr, struct key_params *params);
int woal_cfg80211_del_key(struct wiphy *wiphy,
struct net_device *dev, t_u8 key_index,
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
#endif
const t_u8 *mac_addr);
@ -133,33 +133,31 @@ int woal_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
int woal_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev);
#endif
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
struct net_device *dev,
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer,
const struct cfg80211_bitrate_mask *mask);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
#if KERNEL_VERSION(2, 6, 38) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
int woal_cfg80211_get_antenna(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
int woal_cfg80211_set_qos_map(struct wiphy *wiphy,
struct net_device *dev,
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_qos_map(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_qos_map *qos_map);
#endif
#ifdef STA_CFG80211
#ifdef STA_SUPPORT
int woal_set_rf_channel(moal_private *priv,
struct ieee80211_channel *chan,
int woal_set_rf_channel(moal_private *priv, struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type,
t_u8 wait_option);
static inline int
woal_cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
static inline int woal_cfg80211_scan_done(struct cfg80211_scan_request *request,
bool aborted)
{
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
#if KERNEL_VERSION(4, 8, 0) <= CFG80211_VERSION_CODE
struct cfg80211_scan_info info;
info.aborted = aborted;
cfg80211_scan_done(request, &info);
#else
@ -167,44 +165,42 @@ woal_cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
#endif
return 0;
}
mlan_status woal_inform_bss_from_scan_result(moal_private *priv,
mlan_ssid_bssid *ssid_bssid,
t_u8 wait_option);
#endif
#endif
#if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
#if KERNEL_VERSION(3, 5, 0) > CFG80211_VERSION_CODE
int woal_cfg80211_set_channel(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 34)
#if KERNEL_VERSION(2, 6, 34) < CFG80211_VERSION_CODE
struct net_device *dev,
#endif
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type);
#endif
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 37)
int woal_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *dev, t_u8 key_index,
bool ucast, bool mcast);
#if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE
int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
t_u8 key_index, bool ucast, bool mcast);
#else
int woal_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *dev, t_u8 key_index);
int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
t_u8 key_index);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
#if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *netdev,
t_u8 key_index);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if KERNEL_VERSION(3, 1, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_gtk_rekey_data *data);
#endif
void woal_mgmt_frame_register(moal_private *priv, u16 frame_type, bool reg);
void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *wdev,
#else
struct net_device *dev,
@ -212,30 +208,30 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
t_u16 frame_type, bool reg);
int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *wdev,
#else
struct net_device *dev,
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
struct cfg80211_mgmt_tx_params *params,
#else
struct ieee80211_channel *chan, bool offchan,
#if CFG80211_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
#if KERNEL_VERSION(3, 8, 0) > CFG80211_VERSION_CODE
enum nl80211_channel_type channel_type,
bool channel_type_valid,
#endif
unsigned int wait, const u8 *buf, size_t len,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
bool no_cck,
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
#if KERNEL_VERSION(3, 3, 0) <= CFG80211_VERSION_CODE
bool dont_wait_for_ack,
#endif
#endif
u64 * cookie);
u64 *cookie);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
void woal_update_radar_chans_dfs_state(struct wiphy *wiphy);
#endif
@ -249,47 +245,46 @@ extern struct ieee80211_supported_band mac1_cfg80211_band_5ghz;
int woal_cfg80211_bss_role_cfg(moal_private *priv, t_u16 action,
t_u8 *bss_role);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
struct wireless_dev *woal_cfg80211_add_virtual_intf(struct wiphy *wiphy,
const char *name,
unsigned char
name_assign_type,
enum nl80211_iftype type,
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
u32 *flags,
#if KERNEL_VERSION(4, 1, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *
woal_cfg80211_add_virtual_intf(struct wiphy *wiphy, const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type,
#if KERNEL_VERSION(4, 12, 0) > CFG80211_VERSION_CODE
u32 *flags,
#endif
struct vif_params *params);
struct vif_params *params);
#else
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
#if KERNEL_VERSION(3, 7, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *woal_cfg80211_add_virtual_intf(struct wiphy *wiphy,
const char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params);
#else
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *woal_cfg80211_add_virtual_intf(struct wiphy *wiphy,
char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params);
#else
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 37)
#if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE
struct net_device *woal_cfg80211_add_virtual_intf(struct wiphy *wiphy,
char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params);
#else
int woal_cfg80211_add_virtual_intf(struct wiphy *wiphy,
char *name, enum nl80211_iftype type,
u32 *flags, struct vif_params *params);
int woal_cfg80211_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params);
#endif
#endif
#endif
#endif
int woal_cfg80211_del_virt_if(struct wiphy *wiphy, struct net_device *dev);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy,
struct wireless_dev *wdev);
#else
@ -298,35 +293,35 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev);
#ifdef WIFI_DIRECT_SUPPORT
/* Group Owner Negotiation Req */
#define P2P_GO_NEG_REQ 0
#define P2P_GO_NEG_REQ 0
/* Group Owner Negotiation Rsp */
#define P2P_GO_NEG_RSP 1
#define P2P_GO_NEG_RSP 1
/* Group Owner Negotiation Confirm */
#define P2P_GO_NEG_CONF 2
#define P2P_GO_NEG_CONF 2
/* P2P Invitation Request */
#define P2P_INVITE_REQ 3
#define P2P_INVITE_REQ 3
/* P2P Invitation Response */
#define P2P_INVITE_RSP 4
#define P2P_INVITE_RSP 4
/* Device Discoverability Request */
#define P2P_DEVDIS_REQ 5
#define P2P_DEVDIS_REQ 5
/* Device Discoverability Response */
#define P2P_DEVDIS_RSP 6
#define P2P_DEVDIS_RSP 6
/* Provision Discovery Request */
#define P2P_PROVDIS_REQ 7
#define P2P_PROVDIS_REQ 7
/* Provision Discovery Response */
#define P2P_PROVDIS_RSP 8
#define P2P_PROVDIS_RSP 8
/** P2P category */
#define P2P_ACT_FRAME_CATEGORY 0x04
#define P2P_ACT_FRAME_CATEGORY 0x04
/** P2P oui offset */
#define P2P_ACT_FRAME_OUI_OFFSET 26
#define P2P_ACT_FRAME_OUI_OFFSET 26
/** P2P subtype offset */
#define P2P_ACT_FRAME_OUI_SUBTYPE_OFFSET 30
#define P2P_ACT_FRAME_OUI_SUBTYPE_OFFSET 30
void woal_cfg80211_display_p2p_actframe(const t_u8 *buf, int len,
struct ieee80211_channel *chan,
const t_u8 flag);
/** Define kernel version for wifi direct */
#define WIFI_DIRECT_KERNEL_VERSION KERNEL_VERSION(2, 6, 39)
#define WIFI_DIRECT_KERNEL_VERSION KERNEL_VERSION(2, 6, 39)
#if CFG80211_VERSION_CODE >= WIFI_DIRECT_KERNEL_VERSION
@ -342,76 +337,71 @@ void woal_remove_virtual_interface(moal_handle *handle);
#endif /* WIFI_DIRECT_SUPPORT */
/** Define for remain on channel duration timer */
#define MAX_REMAIN_ON_CHANNEL_DURATION (1000)
#define MAX_REMAIN_ON_CHANNEL_DURATION (1000)
int woal_cfg80211_remain_on_channel_cfg(moal_private *priv,
t_u8 wait_option, t_u8 remove,
t_u8 *status,
int woal_cfg80211_remain_on_channel_cfg(moal_private *priv, t_u8 wait_option,
t_u8 remove, t_u8 *status,
struct ieee80211_channel *chan,
enum mlan_channel_type channel_type,
t_u32 duration);
#ifdef UAP_CFG80211
int woal_uap_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
#if KERNEL_VERSION(3, 16, 0) <= CFG80211_VERSION_CODE
const u8 *mac,
#else
u8 *mac,
#endif
struct station_info *stainfo);
int woal_uap_cfg80211_dump_station(struct wiphy *wiphy,
struct net_device *dev, int idx,
t_u8 *mac, struct station_info *sinfo);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
int woal_uap_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
int idx, t_u8 *mac,
struct station_info *sinfo);
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev,
struct bss_parameters *params);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
#if KERNEL_VERSION(3, 9, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_mac_acl(struct wiphy *wiphy, struct net_device *dev,
const struct cfg80211_acl_data *params);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if KERNEL_VERSION(3, 1, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_txq_params(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_txq_params *params);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_coalesce(struct wiphy *wiphy,
struct cfg80211_coalesce *coalesce);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
int woal_cfg80211_add_beacon(struct wiphy *wiphy,
struct net_device *dev,
#if KERNEL_VERSION(3, 4, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *params);
int woal_cfg80211_set_beacon(struct wiphy *wiphy,
struct net_device *dev,
int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_beacon_data *params);
#else
int woal_cfg80211_add_beacon(struct wiphy *wiphy,
struct net_device *dev,
int woal_cfg80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params);
int woal_cfg80211_set_beacon(struct wiphy *wiphy,
struct net_device *dev,
int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params);
#endif
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev);
int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#if KERNEL_VERSION(3, 19, 0) <= CFG80211_VERSION_CODE
struct station_del_parameters *param);
#else
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
#if KERNEL_VERSION(3, 16, 0) <= CFG80211_VERSION_CODE
const u8 *mac_addr);
#else
u8 *mac_addr);
#endif
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef,
@ -422,8 +412,7 @@ int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef);
#endif
int woal_cfg80211_channel_switch(struct wiphy *wiphy,
struct net_device *dev,
int woal_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_csa_settings *params);
void woal_cac_timer_func(void *context);
@ -431,48 +420,45 @@ void woal_csa_work_queue(struct work_struct *work);
#endif
#endif /* UAP_CFG80211 */
#if defined(UAP_CFG80211) || defined(STA_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
#if KERNEL_VERSION(3, 5, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_notify_channel(moal_private *priv,
chan_band_info * pchan_info);
void woal_channel_switch_event(moal_private *priv, chan_band_info * pchan_info);
chan_band_info *pchan_info);
void woal_channel_switch_event(moal_private *priv, chan_band_info *pchan_info);
#endif
#endif
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
void woal_bgscan_stop_event(moal_private *priv);
void woal_cfg80211_notify_sched_scan_stop(moal_private *priv);
#endif
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
mlan_status woal_chandef_create(moal_private *priv,
struct cfg80211_chan_def *chandef,
chan_band_info * pchan_info);
chan_band_info *pchan_info);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
#if KERNEL_VERSION(4, 20, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_setup_he_cap(moal_private *priv,
struct ieee80211_supported_band *band);
void woal_cfg80211_free_iftype_data(struct wiphy *wiphy);
#endif
void woal_clear_all_mgmt_ies(moal_private *priv, t_u8 wait_option);
int woal_cfg80211_mgmt_frame_ie(moal_private *priv,
const t_u8 *beacon_ies, size_t beacon_ies_len,
const t_u8 *proberesp_ies,
size_t proberesp_ies_len,
const t_u8 *assocresp_ies,
size_t assocresp_ies_len,
const t_u8 *probereq_ies,
size_t probereq_ies_len, t_u16 mask,
t_u8 wait_option);
int woal_cfg80211_mgmt_frame_ie(
moal_private *priv, const t_u8 *beacon_ies, size_t beacon_ies_len,
const t_u8 *proberesp_ies, size_t proberesp_ies_len,
const t_u8 *assocresp_ies, size_t assocresp_ies_len,
const t_u8 *probereq_ies, size_t probereq_ies_len, t_u16 mask,
t_u8 wait_option);
int woal_get_active_intf_freq(moal_private *priv);
void woal_cfg80211_setup_ht_cap(struct ieee80211_sta_ht_cap *ht_info,
t_u32 dev_cap, t_u8 *mcs_set);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_setup_vht_cap(moal_private *priv,
struct ieee80211_sta_vht_cap *vht_cap);
#endif

View File

@ -1,31 +1,31 @@
/** @file moal_cfg80211_util.h
*
* @brief This file contains the CFG80211 vendor specific defines.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains the CFG80211 vendor specific defines.
*
*
* Copyright 2014-2020 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_CFGVENDOR_H_
#define _MOAL_CFGVENDOR_H_
#include "moal_main.h"
#include "moal_main.h"
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
#define RING_NAME_MAX 32
typedef int wifi_ring_buffer_id;
@ -33,52 +33,52 @@ typedef int wifi_ring_buffer_id;
/** WiFi ring control structure */
typedef struct _wifi_ring_ctrl {
/** Written bytes */
/** Written bytes */
t_u32 written_bytes;
/** Read Bytes */
/** Read Bytes */
t_u32 read_bytes;
/** Written records */
/** Written records */
t_u32 written_records;
} ring_buffer_ctrl;
enum ring_state {
/** ring is not initialized*/
/** ring is not initialized*/
RING_STOP = 0,
/** ring is live and logging*/
/** ring is live and logging*/
RING_ACTIVE,
/** ring is initialized but not logging*/
/** ring is initialized but not logging*/
RING_SUSPEND,
};
/** WiFi ring buffer sttructure */
typedef struct _wifi_ring_buffer {
/** Ring ID */
/** Ring ID */
wifi_ring_buffer_id ring_id;
/** Ring name */
/** Ring name */
t_u8 name[RING_NAME_MAX];
/** Ring size */
/** Ring size */
t_u32 ring_size;
/** Write pointer */
/** Write pointer */
t_u32 wp;
/** Read pointer */
/** Read pointer */
t_u32 rp;
/** Log level */
/** Log level */
t_u32 log_level;
/** Threshold */
/** Threshold */
t_u32 threshold;
/** Ring buffer */
/** Ring buffer */
void *ring_buf;
/** Lock */
/** Lock */
spinlock_t lock;
/** Buffer control */
/** Buffer control */
ring_buffer_ctrl ctrl;
/** Ring state */
/** Ring state */
enum ring_state state;
/** Delayed work */
/** Delayed work */
struct delayed_work work;
/** Interval */
/** Interval */
unsigned long interval;
/** Moal priv */
/** Moal priv */
moal_private *priv;
} wifi_ring_buffer;
@ -89,30 +89,32 @@ typedef struct _wifi_ring_buffer {
#define TLV_LOG_HEADER_LEN 4
#define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED MBIT(0) /* Memory dump of Fw */
#define WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORT MBIT(1) /*PKT status */
#define WIFI_LOGGER_CONNECT_EVENT_SUPPORTED MBIT(2) /* connectivity event */
#define WIFI_LOGGER_POWER_EVENT_SUPPORTED MBIT(3) /* Power of driver */
#define WIFI_LOGGER_WAKE_LOCK_SUPPORTED MBIT(4) /* Wake lock of driver */
#define WIFI_LOGGER_VERBOSE_SUPPORTED MBIT(5) /*verbose log of Fw */
#define WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED MBIT(6) /*monitor the health of Fw */
#define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED MBIT(0) /* Memory dump of Fw*/
#define WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORT MBIT(1) /*PKT status*/
#define WIFI_LOGGER_CONNECT_EVENT_SUPPORTED MBIT(2) /* connectivity event*/
#define WIFI_LOGGER_POWER_EVENT_SUPPORTED MBIT(3) /* Power of driver*/
#define WIFI_LOGGER_WAKE_LOCK_SUPPORTED MBIT(4) /* Wake lock of driver*/
#define WIFI_LOGGER_VERBOSE_SUPPORTED MBIT(5) /*verbose log of Fw*/
#define WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED \
MBIT(6) /*monitor the health of Fw*/
/**
* Parameters of wifi logger events are TLVs
* Event parameters tags are defined as:
*/
#define WIFI_TAG_VENDOR_SPECIFIC 0 // take a byte stream as parameter
#define WIFI_TAG_BSSID 1 // takes a 6 bytes MAC address as parameter
#define WIFI_TAG_ADDR 2 // takes a 6 bytes MAC address as parameter
#define WIFI_TAG_SSID 3 // takes a 32 bytes SSID address as parameter
#define WIFI_TAG_STATUS 4 // takes an integer as parameter
#define WIFI_TAG_REASON_CODE 14 // take a reason code as per 802.11 as parameter
#define WIFI_TAG_RSSI 21 // take an integer as parameter
#define WIFI_TAG_CHANNEL 22 // take an integer as parameter
#define WIFI_TAG_VENDOR_SPECIFIC 0 // take a byte stream as parameter
#define WIFI_TAG_BSSID 1 // takes a 6 bytes MAC address as parameter
#define WIFI_TAG_ADDR 2 // takes a 6 bytes MAC address as parameter
#define WIFI_TAG_SSID 3 // takes a 32 bytes SSID address as parameter
#define WIFI_TAG_STATUS 4 // takes an integer as parameter
#define WIFI_TAG_REASON_CODE 14 // take a reason code as per 802.11 as parameter
#define WIFI_TAG_RSSI 21 // take an integer as parameter
#define WIFI_TAG_CHANNEL 22 // take an integer as parameter
#define RING_ENTRY_SIZE (sizeof(wifi_ring_buffer_entry))
#define ENTRY_LENGTH(hdr) (hdr->entry_size + RING_ENTRY_SIZE)
#define READ_AVAIL_SPACE(ring) (ring->ctrl.written_bytes - ring->ctrl.read_bytes)
#define READ_AVAIL_SPACE(ring) \
(ring->ctrl.written_bytes - ring->ctrl.read_bytes)
enum logger_attributes {
ATTR_WIFI_LOGGER_INVALID = 0,
@ -139,93 +141,93 @@ enum logger_attributes {
ATTR_WIFI_LOGGER_MAX = ATTR_WIFI_LOGGER_AFTER_LAST - 1
};
/* Below events refer to the wifi_connectivity_event ring and shall be supported */
enum {
WIFI_EVENT_ASSOCIATION_REQUESTED = 0,
WIFI_EVENT_AUTH_COMPLETE,
WIFI_EVENT_ASSOC_COMPLETE,
/* Below events refer to the wifi_connectivity_event ring and shall be supported
*/
enum { WIFI_EVENT_ASSOCIATION_REQUESTED = 0,
WIFI_EVENT_AUTH_COMPLETE,
WIFI_EVENT_ASSOC_COMPLETE,
};
enum {
RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)), // set for binary entries
RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) // set if 64 bits timestamp is present
/* set for binary entries */
RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)),
/* set if 64 bits timestamp is present */
RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1))
};
enum {
ENTRY_TYPE_CONNECT_EVENT = 1,
ENTRY_TYPE_PKT,
ENTRY_TYPE_WAKE_LOCK,
ENTRY_TYPE_POWER_EVENT,
ENTRY_TYPE_DATA
};
enum { ENTRY_TYPE_CONNECT_EVENT = 1,
ENTRY_TYPE_PKT,
ENTRY_TYPE_WAKE_LOCK,
ENTRY_TYPE_POWER_EVENT,
ENTRY_TYPE_DATA };
/** WiFi ring buffer entry structure */
typedef struct {
/** size of payload excluding the header */
/** size of payload excluding the header */
t_u16 entry_size;
/** Flags */
/** Flags */
t_u8 flags;
/** entry type */
/** entry type */
t_u8 type;
/** present if has_timestamp bit is set. */
/** present if has_timestamp bit is set. */
t_u64 timestamp;
} __attribute__ ((packed)) wifi_ring_buffer_entry;
} __attribute__((packed)) wifi_ring_buffer_entry;
/** WiFi ring buffer status structure*/
typedef struct _wifi_ring_buffer_status {
/** Ring name */
/** Ring name */
t_u8 name[RING_NAME_MAX];
/** Flag */
/** Flag */
t_u32 flag;
/** Ring ID */
/** Ring ID */
wifi_ring_buffer_id ring_id;
/** Buffer size */
/** Buffer size */
t_u32 ring_buffer_byte_size;
/** Verbose Level */
/** Verbose Level */
t_u32 verbose_level;
/** Written bytes */
/** Written bytes */
t_u32 written_bytes;
/** Read bytes */
/** Read bytes */
t_u32 read_bytes;
/** Written records */
/** Written records */
t_u32 written_records;
} wifi_ring_buffer_status;
/** TLV log structure */
typedef struct {
/** Tag */
/** Tag */
u16 tag;
/** Length of value*/
/** Length of value*/
u16 length;
/** Value */
/** Value */
u8 value[];
} __attribute__ ((packed)) tlv_log;
} __attribute__((packed)) tlv_log;
/** WiFi ring buffer driver structure */
typedef struct {
/** event */
/** event */
u16 event;
/** TLV log structure array */
/** TLV log structure array */
tlv_log tlvs[];
/** separate parameter structure per event to be provided and optional data
* the event_data is expected to include an official android part, with some
* parameter as transmit rate, num retries, num scan result found etc...
* as well, event_data can include a vendor proprietary part which is
* understood by the developer only
*/
} __attribute__ ((packed)) wifi_ring_buffer_driver_connectivity_event;
/** separate parameter structure per event to be provided and optional
* data the event_data is expected to include an official android part,
* with some parameter as transmit rate, num retries, num scan result
* found etc... as well, event_data can include a vendor proprietary
* part which is understood by the developer only
*/
} __attribute__((packed)) wifi_ring_buffer_driver_connectivity_event;
/** Assoc logger data structure */
typedef struct _assoc_logger {
/** vendor specific */
/** vendor specific */
t_u8 oui[3];
/** BSSID */
/** BSSID */
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
/** SSID */
/** SSID */
t_u8 ssid[MLAN_MAX_SSID_LENGTH];
/** RSSI */
/** RSSI */
t_s32 rssi;
/** Channel */
/** Channel */
t_u32 channel;
} assoc_logger_data;
@ -235,10 +237,10 @@ int woal_ring_event_logger(moal_private *priv, int ring_id,
int woal_wake_reason_logger(moal_private *priv,
mlan_ds_hs_wakeup_reason wake_reason);
#define MD5_PREFIX_LEN 4
#define MAX_FATE_LOG_LEN 32
#define MAX_FRAME_LEN_ETHERNET 1518
#define MAX_FRAME_LEN_80211_MGMT 2352
#define MD5_PREFIX_LEN 4
#define MAX_FATE_LOG_LEN 32
#define MAX_FRAME_LEN_ETHERNET 1518
#define MAX_FRAME_LEN_80211_MGMT 2352
/** packet_fate_packet_type */
typedef enum {
@ -255,104 +257,111 @@ typedef enum {
/** wifi_tx_packet_fate */
typedef enum {
/** Sent over air and ACKed. */
/** Sent over air and ACKed. */
TX_PKT_FATE_ACKED,
/** Sent over air but not ACKed. (Normal for broadcast/multicast.) */
/** Sent over air but not ACKed. (Normal for broadcast/multicast.) */
TX_PKT_FATE_SENT,
/** Queued within firmware, but not yet sent over air. */
/** Queued within firmware, but not yet sent over air. */
TX_PKT_FATE_FW_QUEUED,
/** Dropped by firmware as invalid. E.g. bad source address, bad checksum, or invalid for current
state. */
/** Dropped by firmware as invalid. E.g. bad source address, bad
* checksum, or invalid for current state.
*/
TX_PKT_FATE_FW_DROP_INVALID,
/** Dropped by firmware due to lack of buffer space. */
/** Dropped by firmware due to lack of buffer space. */
TX_PKT_FATE_FW_DROP_NOBUFS,
/** Dropped by firmware for any other reason. Includes frames that were sent by driver to firmware, but
unaccounted for by firmware. */
/** Dropped by firmware for any other reason. Includes frames that were
* sent by driver to firmware, but unaccounted for by firmware.
*/
TX_PKT_FATE_FW_DROP_OTHER,
/** Queued within driver, not yet sent to firmware. */
/** Queued within driver, not yet sent to firmware. */
TX_PKT_FATE_DRV_QUEUED,
/** Dropped by driver as invalid. E.g. bad source address, or invalid for current state. */
/** Dropped by driver as invalid. E.g. bad source address, or invalid
* for current state.
*/
TX_PKT_FATE_DRV_DROP_INVALID,
/** Dropped by driver due to lack of buffer space. */
/** Dropped by driver due to lack of buffer space. */
TX_PKT_FATE_DRV_DROP_NOBUFS,
/** Dropped by driver for any other reason. */
/** Dropped by driver for any other reason. */
TX_PKT_FATE_DRV_DROP_OTHER,
} wifi_tx_packet_fate;
/** wifi_rx_packet_fate */
typedef enum {
/** Valid and delivered to network stack (e.g., netif_rx()). */
/** Valid and delivered to network stack (e.g., netif_rx()). */
RX_PKT_FATE_SUCCESS,
/** Queued within firmware, but not yet sent to driver. */
/** Queued within firmware, but not yet sent to driver. */
RX_PKT_FATE_FW_QUEUED,
/** Dropped by firmware due to host-programmable filters. */
/** Dropped by firmware due to host-programmable filters. */
RX_PKT_FATE_FW_DROP_FILTER,
/** Dropped by firmware as invalid. E.g. bad checksum, decrypt failed, or invalid for current state. */
/** Dropped by firmware as invalid. E.g. bad checksum, decrypt failed,
* or invalid for current state.
*/
RX_PKT_FATE_FW_DROP_INVALID,
/** Dropped by firmware due to lack of buffer space. */
/** Dropped by firmware due to lack of buffer space. */
RX_PKT_FATE_FW_DROP_NOBUFS,
/** Dropped by firmware for any other reason. */
/** Dropped by firmware for any other reason. */
RX_PKT_FATE_FW_DROP_OTHER,
/** Queued within driver, not yet delivered to network stack. */
/** Queued within driver, not yet delivered to network stack. */
RX_PKT_FATE_DRV_QUEUED,
/** Dropped by driver due to filter rules. */
/** Dropped by driver due to filter rules. */
RX_PKT_FATE_DRV_DROP_FILTER,
/** Dropped by driver as invalid. E.g. not permitted in current state. */
/** Dropped by driver as invalid. E.g. not permitted in current state.
*/
RX_PKT_FATE_DRV_DROP_INVALID,
/** Dropped by driver due to lack of buffer space. */
/** Dropped by driver due to lack of buffer space. */
RX_PKT_FATE_DRV_DROP_NOBUFS,
/** Dropped by driver for any other reason. */
/** Dropped by driver for any other reason. */
RX_PKT_FATE_DRV_DROP_OTHER,
} wifi_rx_packet_fate;
/** frame_info_i */
typedef struct {
/** Payload Type */
/** Payload Type */
frame_type payload_type;
/** Driver timestamp in uS */
/** Driver timestamp in uS */
u32 driver_timestamp_usec;
/** FW timestamp in uS */
/** FW timestamp in uS */
u32 firmware_timestamp_usec;
/** Frame Length */
/** Frame Length */
u32 frame_len;
} frame_info_i;
/** wifi_tx_report_i */
typedef struct {
/** MD5 prefix */
/** MD5 prefix */
char md5_prefix[MD5_PREFIX_LEN];
/** TX packet fate */
/** TX packet fate */
wifi_tx_packet_fate fate;
/** frame information */
/** frame information */
frame_info_i frame_inf;
} wifi_tx_report_i;
/** wifi_rx_report_i */
typedef struct {
/** MD5 prefix */
/** MD5 prefix */
char md5_prefix[MD5_PREFIX_LEN];
/** TX packet fate */
/** TX packet fate */
wifi_rx_packet_fate fate;
/** frame information */
/** frame information */
frame_info_i frame_inf;
} wifi_rx_report_i;
@ -382,7 +391,9 @@ int woal_packet_fate_monitor(moal_private *priv,
/* Age since filter installed in seconds. */
#define MEM_OFFSET_FILTER_AGE 15
/* Leave 0 opcode unused as it's a good indicator of accidental incorrect execution (e.g. data). */
/* Leave 0 opcode unused as it's a good indicator of accidental incorrect
* execution (e.g. data).
*/
/* Load 1 byte from immediate offset, e.g. "ldb R0, [5]" */
#define NXP_LDB_OPCODE 1
/* Load 2 bytes from immediate offset, e.g. "ldh R0, [5]" */
@ -425,13 +436,16 @@ int woal_packet_fate_monitor(moal_private *priv,
#define NXP_JNEBS_OPCODE 20
/* Immediate value is one of *_EXT_OPCODE
* Extended opcodes. These all have an opcode of EXT_OPCODE
* and specify the actual opcode in the immediate field.*/
* and specify the actual opcode in the immediate field.
*/
#define NXP_EXT_OPCODE 21
/* Load from memory, e.g. "ldm R0,5"
* Values 0-15 represent loading the different memory slots. */
* Values 0-15 represent loading the different memory slots.
*/
#define NXP_LDM_EXT_OPCODE 0
/* Store to memory, e.g. "stm R0,5" *
* Values 16-31 represent storing to the different memory slots. */
* Values 16-31 represent storing to the different memory slots.
*/
#define NXP_STM_EXT_OPCODE 16
/* Not, e.g. "not R0" */
#define NXP_NOT_EXT_OPCODE 32
@ -460,9 +474,11 @@ int woal_packet_fate_monitor(moal_private *priv,
#define PASS_PKT 1
/* Return code indicating "packet" should be dropped. */
#define DROP_PKT 0
/* If "c" is of an unsigned type, generate a compile warning that gets promoted to an error.
* This makes bounds checking simpler because ">= 0" can be avoided. Otherwise adding
* superfluous ">= 0" with unsigned expressions generates compile warnings. */
/* If "c" is of an unsigned type, generate a compile warning that gets promoted
* to an error. This makes bounds checking simpler because ">= 0" can be
* avoided. Otherwise adding superfluous ">= 0" with unsigned expressions
* generates compile warnings.
*/
#define ENFORCE_UNSIGNED(c) ((c) == (uint32_t)(c))
/** =========== Define Copied from apf_interpreter.c END =========== */
@ -470,10 +486,9 @@ int woal_packet_fate_monitor(moal_private *priv,
#define APF_FRAME_HEADER_SIZE 14
#define PACKET_FILTER_MAX_LEN 1024
enum {
PACKET_FILTER_STATE_INIT = 0,
PACKET_FILTER_STATE_STOP,
PACKET_FILTER_STATE_START,
enum { PACKET_FILTER_STATE_INIT = 0,
PACKET_FILTER_STATE_STOP,
PACKET_FILTER_STATE_START,
};
enum wifi_attr_packet_filter {
@ -502,42 +517,44 @@ int woal_filter_packet(moal_private *priv, t_u8 *data, t_u32 len,
int woal_init_wifi_hal(moal_private *priv);
int woal_deinit_wifi_hal(moal_private *priv);
#define ATTRIBUTE_U32_LEN (nla_total_size(NLA_HDRLEN + 4))
#define VENDOR_ID_OVERHEAD ATTRIBUTE_U32_LEN
#define VENDOR_SUBCMD_OVERHEAD ATTRIBUTE_U32_LEN
#define VENDOR_DATA_OVERHEAD (nla_total_size(NLA_HDRLEN))
#define ATTRIBUTE_U32_LEN (nla_total_size(NLA_HDRLEN + 4))
#define VENDOR_ID_OVERHEAD ATTRIBUTE_U32_LEN
#define VENDOR_SUBCMD_OVERHEAD ATTRIBUTE_U32_LEN
#define VENDOR_DATA_OVERHEAD (nla_total_size(NLA_HDRLEN))
#define VENDOR_REPLY_OVERHEAD (VENDOR_ID_OVERHEAD + \
VENDOR_SUBCMD_OVERHEAD + \
VENDOR_DATA_OVERHEAD)
#define VENDOR_REPLY_OVERHEAD \
(VENDOR_ID_OVERHEAD + VENDOR_SUBCMD_OVERHEAD + VENDOR_DATA_OVERHEAD)
/* Features Enums*/
#define WLAN_FEATURE_INFRA 0x0001 // Basic infrastructure mode support
#define WLAN_FEATURE_INFRA_5G 0x0002 // 5 GHz Band support
#define WLAN_FEATURE_HOTSPOT 0x0004 // GAS/ANQP support
#define WLAN_FEATURE_P2P 0x0008 // Wifi-Direct/P2P
#define WLAN_FEATURE_SOFT_AP 0x0010 // Soft AP support
#define WLAN_FEATURE_GSCAN 0x0020 // Google-Scan APIsi support
#define WLAN_FEATURE_NAN 0x0040 // Neighbor Awareness Networking (NAN)
#define WLAN_FEATURE_D2D_RTT 0x0080 // Device-to-device RTT support
#define WLAN_FEATURE_D2AP_RTT 0x0100 // Device-to-AP RTT support
#define WLAN_FEATURE_BATCH_SCAN 0x0200 // Batched Scan (legacy) support
#define WLAN_FEATURE_PNO 0x0400 // Preferred network offload support
#define WLAN_FEATURE_ADDITIONAL_STA 0x0800 // Two STAs support
#define WLAN_FEATURE_TDLS 0x1000 // Tunnel directed link setup (TDLS)
#define WLAN_FEATURE_TDLS_OFFCHANNEL 0x2000 // TDLS off channel support
#define WLAN_FEATURE_EPR 0x4000 // Enhanced power reporting support
#define WLAN_FEATURE_AP_STA 0x8000 // AP STA Concurrency support
#define WLAN_FEATURE_LINK_LAYER_STATS 0x10000 // Link layer stats collection support
#define WLAN_FEATURE_LOGGER 0x20000 // WiFi Logger support
#define WLAN_FEATURE_HAL_EPNO 0x40000 // WiFi enhanced PNO support
#define WLAN_FEATURE_RSSI_MONITOR 0x80000 // RSSI Monitor support
#define WLAN_FEATURE_MKEEP_ALIVE 0x100000 // WiFi mkeep_alive support
#define WLAN_FEATURE_CONFIG_NDO 0x200000 // ND offload configure support
#define WLAN_FEATURE_TX_TRANSMIT_POWER 0x400000 // Capture Tx transmit power levels
#define WLAN_FEATURE_CONTROL_ROAMING 0x800000 // Enable/Disable firmware roaming
#define WLAN_FEATURE_IE_WHITELIST 0x1000000 // Probe IE white listing support
#define WLAN_FEATURE_SCAN_RAND 0x2000000 // MAC & Probe Sequence Number randomization Support
#define WLAN_FEATURE_INFRA 0x0001 // Basic infrastructure mode support
#define WLAN_FEATURE_INFRA_5G 0x0002 // 5 GHz Band support
#define WLAN_FEATURE_HOTSPOT 0x0004 // GAS/ANQP support
#define WLAN_FEATURE_P2P 0x0008 // Wifi-Direct/P2P
#define WLAN_FEATURE_SOFT_AP 0x0010 // Soft AP support
#define WLAN_FEATURE_GSCAN 0x0020 // Google-Scan APIsi support
#define WLAN_FEATURE_NAN 0x0040 // Neighbor Awareness Networking (NAN)
#define WLAN_FEATURE_D2D_RTT 0x0080 // Device-to-device RTT support
#define WLAN_FEATURE_D2AP_RTT 0x0100 // Device-to-AP RTT support
#define WLAN_FEATURE_BATCH_SCAN 0x0200 // Batched Scan (legacy) support
#define WLAN_FEATURE_PNO 0x0400 // Preferred network offload support
#define WLAN_FEATURE_ADDITIONAL_STA 0x0800 // Two STAs support
#define WLAN_FEATURE_TDLS 0x1000 // Tunnel directed link setup (TDLS)
#define WLAN_FEATURE_TDLS_OFFCHANNEL 0x2000 // TDLS off channel support
#define WLAN_FEATURE_EPR 0x4000 // Enhanced power reporting support
#define WLAN_FEATURE_AP_STA 0x8000 // AP STA Concurrency support
#define WLAN_FEATURE_LINK_LAYER_STATS \
0x10000 // Link layer stats collection support
#define WLAN_FEATURE_LOGGER 0x20000 // WiFi Logger support
#define WLAN_FEATURE_HAL_EPNO 0x40000 // WiFi enhanced PNO support
#define WLAN_FEATURE_RSSI_MONITOR 0x80000 // RSSI Monitor support
#define WLAN_FEATURE_MKEEP_ALIVE 0x100000 // WiFi mkeep_alive support
#define WLAN_FEATURE_CONFIG_NDO 0x200000 // ND offload configure support
#define WLAN_FEATURE_TX_TRANSMIT_POWER \
0x400000 // Capture Tx transmit power levels
#define WLAN_FEATURE_CONTROL_ROAMING 0x800000 // Enable/Disable firmware roaming
#define WLAN_FEATURE_IE_WHITELIST 0x1000000 // Probe IE white listing support
#define WLAN_FEATURE_SCAN_RAND \
0x2000000 // MAC & Probe Sequence Number randomization Support
// Add more features here
#define MAX_CHANNEL_NUM 200
@ -545,20 +562,20 @@ int woal_deinit_wifi_hal(moal_private *priv);
/** Wifi Band */
typedef enum {
WIFI_BAND_UNSPECIFIED,
/** 2.4 GHz */
/** 2.4 GHz */
WIFI_BAND_BG = 1,
/** 5 GHz without DFS */
/** 5 GHz without DFS */
WIFI_BAND_A = 2,
/** 5 GHz DFS only */
/** 5 GHz DFS only */
WIFI_BAND_A_DFS = 4,
/** 5 GHz with DFS */
/** 5 GHz with DFS */
WIFI_BAND_A_WITH_DFS = 6,
/** 2.4 GHz + 5 GHz; no DFS */
/** 2.4 GHz + 5 GHz; no DFS */
WIFI_BAND_ABG = 3,
/** 2.4 GHz + 5 GHz with DFS */
/** 2.4 GHz + 5 GHz with DFS */
WIFI_BAND_ABG_WITH_DFS = 7,
/** Keep it last */
/** Keep it last */
WIFI_BAND_LAST,
WIFI_BAND_MAX = WIFI_BAND_LAST - 1,
} wifi_band;
@ -602,17 +619,17 @@ enum vendor_event {
/** struct dfs_event */
typedef struct _dfs_event {
/** Frequency */
/** Frequency */
int freq;
/** HT enable */
/** HT enable */
int ht_enabled;
/** Channel Offset */
/** Channel Offset */
int chan_offset;
/** Channel width */
/** Channel width */
enum nl80211_chan_width chan_width;
/** Center Frequency 1 */
/** Center Frequency 1 */
int cf1;
/** Center Frequency 2 */
/** Center Frequency 2 */
int cf2;
} dfs_event;
@ -672,7 +689,7 @@ enum vendor_sub_command {
sub_cmd_get_drv_mem_dump = 0x1407,
sub_cmd_start_packet_fate_monitor = 0x1408,
sub_cmd_rssi_monitor = 0x1500,
/*Sub-command for wifi hal */
/*Sub-command for wifi hal*/
sub_cmd_get_roaming_capability = 0x1700,
sub_cmd_fw_roaming_enable = 0x1701,
sub_cmd_fw_roaming_config = 0x1702,
@ -680,8 +697,8 @@ enum vendor_sub_command {
};
void woal_register_cfg80211_vendor_command(struct wiphy *wiphy);
int woal_cfg80211_vendor_event(IN moal_private *priv,
IN int event, IN t_u8 *data, IN int len);
int woal_cfg80211_vendor_event(IN moal_private *priv, IN int event,
IN t_u8 *data, IN int len);
enum mrvl_wlan_vendor_attr {
MRVL_WLAN_VENDOR_ATTR_INVALID = 0,
@ -699,7 +716,7 @@ typedef enum {
ATTR_ND_OFFLOAD_MAX = ATTR_ND_OFFLOAD_AFTER_LAST - 1,
} ND_OFFLOAD_ATTR;
#define MKEEP_ALIVE_IP_PKT_MAX 256
#define MKEEP_ALIVE_IP_PKT_MAX 256
enum mkeep_alive_attributes {
MKEEP_ALIVE_ATTRIBUTE_ID,
MKEEP_ALIVE_ATTRIBUTE_ETHER_TYPE,

View File

@ -1,33 +1,33 @@
/** @file moal_debug.c
*
* @brief This file contains functions for debug proc file.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains functions for debug proc file.
*
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
11/03/2008: initial version
********************************************************/
#include "moal_main.h"
#include "moal_main.h"
#ifdef USB
#include "moal_usb.h"
#include "moal_usb.h"
#endif
/********************************************************
@ -42,23 +42,23 @@ Change log:
/** Get info item size */
#define item_size(n) (sizeof(((mlan_debug_info *)0)->n))
/** Get info item address */
#define item_addr(n) ((t_ptr) &(((mlan_debug_info *)0)->n))
#define item_addr(n) ((t_ptr) & (((mlan_debug_info *)0)->n))
/** Get moal_private member size */
#define item_priv_size(n) (sizeof(((moal_private *)0)->n))
/** Get moal_private member address */
#define item_priv_addr(n) ((t_ptr) &(((moal_private *)0)->n))
#define item_priv_addr(n) ((t_ptr) & (((moal_private *)0)->n))
/** Get moal_handle member size */
#define item_handle_size(n) (sizeof(((moal_handle *)0)->n))
/** Get moal_handle member address */
#define item_handle_addr(n) ((t_ptr) &(((moal_handle *)0)->n))
#define item_handle_addr(n) ((t_ptr) & (((moal_handle *)0)->n))
#ifdef USB
/** Get moal card member size */
#define item_card_size(n) (sizeof(((struct usb_card_rec *)0)->n))
/** Get moal card member address */
#define item_card_addr(n) ((t_ptr) &(((struct usb_card_rec *)0)->n))
#define item_card_addr(n) ((t_ptr) & (((struct usb_card_rec *)0)->n))
#endif
#ifdef STA_SUPPORT
@ -446,8 +446,7 @@ static struct debug_data uap_items[] = {
*
* @return N/A
*/
void
woal_hist_do_reset(moal_private *priv, void *data)
void woal_hist_do_reset(moal_private *priv, void *data)
{
hgm_data *phist_data = (hgm_data *)data;
int ix;
@ -473,14 +472,12 @@ woal_hist_do_reset(moal_private *priv, void *data)
*
* @return N/A
*/
void
woal_hist_data_reset(moal_private *priv)
void woal_hist_data_reset(moal_private *priv)
{
int i = 0;
for (i = 0; i < priv->phandle->card_info->histogram_table_num; i++)
woal_hist_do_reset(priv, priv->hist_data[i]);
}
/**
* @brief This function reset histogram data according to antenna
*
@ -488,8 +485,7 @@ woal_hist_data_reset(moal_private *priv)
*
* @return N/A
*/
void
woal_hist_reset_table(moal_private *priv, t_u8 antenna)
void woal_hist_reset_table(moal_private *priv, t_u8 antenna)
{
hgm_data *phist_data = priv->hist_data[antenna];
@ -497,9 +493,9 @@ woal_hist_reset_table(moal_private *priv, t_u8 antenna)
}
/** NF calculation */
#define CAL_NF(NF) ((t_s8)(-(t_s8)(NF)))
#define CAL_NF(NF) ((t_s8)(-(t_s8)(NF)))
/** RSSI calculation */
#define CAL_RSSI(SNR, NF) ((t_s8)((t_s8)(SNR) + CAL_NF(NF)))
#define CAL_RSSI(SNR, NF) ((t_s8)((t_s8)(SNR) + CAL_NF(NF)))
/**
* @brief This function set histogram data
@ -511,9 +507,8 @@ woal_hist_reset_table(moal_private *priv, t_u8 antenna)
*
* @return N/A
*/
static void
woal_hist_data_set(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
t_u8 antenna)
static void woal_hist_data_set(moal_private *priv, t_u16 rx_rate, t_s8 snr,
t_s8 nflr, t_u8 antenna)
{
hgm_data *phist_data = priv->hist_data[antenna];
t_s8 nf = CAL_NF(nflr);
@ -537,9 +532,8 @@ woal_hist_data_set(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
*
* @return N/A
*/
void
woal_hist_data_add(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
t_u8 antenna)
void woal_hist_data_add(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
t_u8 antenna)
{
hgm_data *phist_data = NULL;
unsigned long curr_size;
@ -552,11 +546,10 @@ woal_hist_data_add(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
woal_hist_reset_table(priv, antenna);
woal_hist_data_set(priv, rx_rate, snr, nflr, antenna);
}
#define MAX_MCS_NUM_SUPP 16
#define MAX_MCS_NUM_AC 10
#define MAX_MCS_NUM_AX 12
#define RATE_INDEX_MCS0 12
#define MAX_MCS_NUM_SUPP 16
#define MAX_MCS_NUM_AC 10
#define MAX_MCS_NUM_AX 12
#define RATE_INDEX_MCS0 12
/**
* @brief histogram info in proc
*
@ -565,8 +558,7 @@ woal_hist_data_add(moal_private *priv, t_u16 rx_rate, t_s8 snr, t_s8 nflr,
*
* @return Number of output data or MLAN_STATUS_FAILURE
*/
static int
woal_histogram_info(struct seq_file *sfp, void *data)
static int woal_histogram_info(struct seq_file *sfp, void *data)
{
hgm_data *phist_data = (hgm_data *)data;
int i = 0;
@ -576,7 +568,7 @@ woal_histogram_info(struct seq_file *sfp, void *data)
t_u8 mcs_index = 0;
t_u8 nss = 0;
t_u8 gi = 0;
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *) sfp->private;
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *)sfp->private;
moal_private *priv = (moal_private *)hist_data->priv;
t_u16 rx_rate_max_size = priv->phandle->card_info->rx_rate_max;
@ -591,40 +583,57 @@ woal_histogram_info(struct seq_file *sfp, void *data)
seq_printf(sfp, "rx rates (in Mbps):\n");
seq_printf(sfp, "\t0-3: B-MCS 0-3\n");
seq_printf(sfp, "\t4-11: G-MCS 0-7\n");
seq_printf(sfp,
"\t12-27: N-MCS 0-15(BW20) 28-43: N-MCS 0-15(BW40)\n");
seq_printf(sfp,
"\t44-59: N-MCS 0-15(BW20:SGI) 60-75: N-MCS 0-15(BW40:SGI)\n");
seq_printf(sfp,
"\t76-85: AC-MCS 0-9(VHT:BW20:NSS1) 86-95: AC-MCS 0-9(VHT:BW20:NSS2)\n");
seq_printf(sfp,
"\t96-105: AC-MCS 0-9(VHT:BW40:NSS1) 106-115: AC-MCS 0-9(VHT:BW40:NSS2)\n");
seq_printf(sfp,
"\t116-125: AC-MCS 0-9(VHT:BW80:NSS1) 126-135: AC-MCS 0-9(VHT:BW80:NSS2)\n");
seq_printf(sfp,
"\t136-145: AC-MCS 0-9(VHT:BW20:NSS1:SGI) 146-155: AC-MCS 0-9(VHT:BW20:NSS2:SGI)\n");
seq_printf(sfp,
"\t156-165: AC-MCS 0-9(VHT:BW40:NSS1:SGI) 166-175: AC-MCS 0-9(VHT:BW40:NSS2:SGI)\n");
seq_printf(sfp,
"\t176-185: AC-MCS 0-9(VHT:BW80:NSS1:SGI) 186-195: AC-MCS 0-9(VHT:BW80:NSS2:SGI)\n\n");
seq_printf(sfp,
"\t196-207: AX-MCS 0-11(BW20:NSS1) 208-219: AX-MCS 0-11(BW20:NSS2)\n");
seq_printf(sfp,
"\t220-231: AX-MCS 0-11(BW40:NSS1) 232-243: AX-MCS 0-11(BW40:NSS2)\n");
seq_printf(sfp,
"\t244-255: AX-MCS 0-11(BW80:NSS1) 256-267: AX-MCS 0-11(BW80:NSS2)\n");
seq_printf(sfp,
"\t268-279: AX-MCS 0-11(BW20:NSS1:GI1) 280-291: AX-MCS 0-11(BW20:NSS2:GI1)\n");
seq_printf(sfp,
"\t292-303: AX-MCS 0-11(BW40:NSS1:GI1) 304-315: AX-MCS 0-11(BW40:NSS2:GI1)\n");
seq_printf(sfp,
"\t316-327: AX-MCS 0-11(BW80:NSS1:GI1) 328-339: AX-MCS 0-11(BW80:NSS2:GI1)\n");
seq_printf(sfp,
"\t340-351: AX-MCS 0-11(BW20:NSS1:GI2) 352-363: AX-MCS 0-11(BW20:NSS2:GI2)\n");
seq_printf(sfp,
"\t364-375: AX-MCS 0-11(BW40:NSS1:GI2) 376-387: AX-MCS 0-11(BW40:NSS2:GI2)\n");
seq_printf(sfp,
"\t388-399: AX-MCS 0-11(BW80:NSS1:GI2) 400-411: AX-MCS 0-11(BW80:NSS2:GI2)\n");
seq_printf(
sfp,
"\t12-27: N-MCS 0-15(BW20) 28-43: N-MCS 0-15(BW40)\n");
seq_printf(
sfp,
"\t44-59: N-MCS 0-15(BW20:SGI) 60-75: N-MCS 0-15(BW40:SGI)\n");
seq_printf(
sfp,
"\t76-85: AC-MCS 0-9(VHT:BW20:NSS1) 86-95: AC-MCS 0-9(VHT:BW20:NSS2)\n");
seq_printf(
sfp,
"\t96-105: AC-MCS 0-9(VHT:BW40:NSS1) 106-115: AC-MCS 0-9(VHT:BW40:NSS2)\n");
seq_printf(
sfp,
"\t116-125: AC-MCS 0-9(VHT:BW80:NSS1) 126-135: AC-MCS 0-9(VHT:BW80:NSS2)\n");
seq_printf(
sfp,
"\t136-145: AC-MCS 0-9(VHT:BW20:NSS1:SGI) 146-155: AC-MCS 0-9(VHT:BW20:NSS2:SGI)\n");
seq_printf(
sfp,
"\t156-165: AC-MCS 0-9(VHT:BW40:NSS1:SGI) 166-175: AC-MCS 0-9(VHT:BW40:NSS2:SGI)\n");
seq_printf(
sfp,
"\t176-185: AC-MCS 0-9(VHT:BW80:NSS1:SGI) 186-195: AC-MCS 0-9(VHT:BW80:NSS2:SGI)\n\n");
seq_printf(
sfp,
"\t196-207: AX-MCS 0-11(BW20:NSS1) 208-219: AX-MCS 0-11(BW20:NSS2)\n");
seq_printf(
sfp,
"\t220-231: AX-MCS 0-11(BW40:NSS1) 232-243: AX-MCS 0-11(BW40:NSS2)\n");
seq_printf(
sfp,
"\t244-255: AX-MCS 0-11(BW80:NSS1) 256-267: AX-MCS 0-11(BW80:NSS2)\n");
seq_printf(
sfp,
"\t268-279: AX-MCS 0-11(BW20:NSS1:GI1) 280-291: AX-MCS 0-11(BW20:NSS2:GI1)\n");
seq_printf(
sfp,
"\t292-303: AX-MCS 0-11(BW40:NSS1:GI1) 304-315: AX-MCS 0-11(BW40:NSS2:GI1)\n");
seq_printf(
sfp,
"\t316-327: AX-MCS 0-11(BW80:NSS1:GI1) 328-339: AX-MCS 0-11(BW80:NSS2:GI1)\n");
seq_printf(
sfp,
"\t340-351: AX-MCS 0-11(BW20:NSS1:GI2) 352-363: AX-MCS 0-11(BW20:NSS2:GI2)\n");
seq_printf(
sfp,
"\t364-375: AX-MCS 0-11(BW40:NSS1:GI2) 376-387: AX-MCS 0-11(BW40:NSS2:GI2)\n");
seq_printf(
sfp,
"\t388-399: AX-MCS 0-11(BW80:NSS1:GI2) 400-411: AX-MCS 0-11(BW80:NSS2:GI2)\n");
for (i = 0; i < rx_rate_max_size; i++) {
value = atomic_read(&(phist_data->rx_rate[i]));
@ -633,33 +642,49 @@ woal_histogram_info(struct seq_file *sfp, void *data)
seq_printf(sfp, "rx_rate[%03d] = %d\n", i,
value);
else if (i <= 75) {
sgi_enable = (i - 12) / (MAX_MCS_NUM_SUPP * 2); //0:LGI, 1:SGI
bw = ((i - 12) % (MAX_MCS_NUM_SUPP * 2)) / MAX_MCS_NUM_SUPP; //0:20MHz, 1:40MHz
sgi_enable = (i - 12) /
(MAX_MCS_NUM_SUPP * 2); // 0:LGI,
// 1:SGI
bw = ((i - 12) % (MAX_MCS_NUM_SUPP * 2)) /
MAX_MCS_NUM_SUPP; // 0:20MHz, 1:40MHz
mcs_index = (i - 12) % MAX_MCS_NUM_SUPP;
seq_printf(sfp,
"rx_rate[%03d] = %d (MCS:%d HT BW:%dMHz%s)\n",
i, value, mcs_index, (1 << bw) * 20,
sgi_enable ? " SGI" : "");
seq_printf(
sfp,
"rx_rate[%03d] = %d (MCS:%d HT BW:%dMHz%s)\n",
i, value, mcs_index, (1 << bw) * 20,
sgi_enable ? " SGI" : "");
} else if (i <= 195) {
sgi_enable = (i - 76) / (MAX_MCS_NUM_AC * 6); //0:LGI, 1:SGI
bw = ((i - 76) % (MAX_MCS_NUM_AC * 6)) / (MAX_MCS_NUM_AC * 2); //0:20MHz, 1:40MHz, 2:80MHz
nss = (((i - 76) % (MAX_MCS_NUM_AC * 6)) % (MAX_MCS_NUM_AC * 2)) / MAX_MCS_NUM_AC; //0:NSS1, 1:NSS2
sgi_enable = (i - 76) /
(MAX_MCS_NUM_AC * 6); // 0:LGI,
// 1:SGI
bw = ((i - 76) % (MAX_MCS_NUM_AC * 6)) /
(MAX_MCS_NUM_AC * 2); // 0:20MHz, 1:40MHz,
// 2:80MHz
nss = (((i - 76) % (MAX_MCS_NUM_AC * 6)) %
(MAX_MCS_NUM_AC * 2)) /
MAX_MCS_NUM_AC; // 0:NSS1, 1:NSS2
mcs_index = (i - 76) % MAX_MCS_NUM_AC;
seq_printf(sfp,
"rx_rate[%03d] = %d (MCS:%d VHT BW:%dMHz NSS:%d%s)\n",
i, value, mcs_index, (1 << bw) * 20,
nss + 1, sgi_enable ? " SGI" : "");
seq_printf(
sfp,
"rx_rate[%03d] = %d (MCS:%d VHT BW:%dMHz NSS:%d%s)\n",
i, value, mcs_index, (1 << bw) * 20,
nss + 1, sgi_enable ? " SGI" : "");
} else if (i <= 411) {
gi = (i - 196) / (MAX_MCS_NUM_AX * 6); //0,1,2
bw = ((i - 196) % (MAX_MCS_NUM_AX * 6)) / (MAX_MCS_NUM_AX * 2); //0:20MHz, 1:40MHz, 2:80MHz
nss = (((i - 196) % (MAX_MCS_NUM_AX * 6)) % (MAX_MCS_NUM_AX * 2)) / MAX_MCS_NUM_AX; //0:NSS1, 1:NSS2
gi = (i - 196) / (MAX_MCS_NUM_AX * 6); // 0,1,2
bw = ((i - 196) % (MAX_MCS_NUM_AX * 6)) /
(MAX_MCS_NUM_AX * 2); // 0:20MHz, 1:40MHz,
// 2:80MHz
nss = (((i - 196) % (MAX_MCS_NUM_AX * 6)) %
(MAX_MCS_NUM_AX * 2)) /
MAX_MCS_NUM_AX; // 0:NSS1, 1:NSS2
mcs_index = (i - 196) % MAX_MCS_NUM_AX;
seq_printf(sfp,
"rx_rate[%03d] = %d (MCS:%d AX BW:%dMHz NSS:%d GI:%d)\n",
i, value, mcs_index, (1 << bw) * 20,
nss + 1, gi);
seq_printf(
sfp,
"rx_rate[%03d] = %d (MCS:%d AX BW:%dMHz NSS:%d GI:%d)\n",
i, value, mcs_index, (1 << bw) * 20,
nss + 1, gi);
}
}
}
@ -695,10 +720,9 @@ woal_histogram_info(struct seq_file *sfp, void *data)
*
* @return Number of output data or MLAN_STATUS_FAILURE
*/
static int
woal_histogram_read(struct seq_file *sfp, void *data)
static int woal_histogram_read(struct seq_file *sfp, void *data)
{
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *) sfp->private;
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *)sfp->private;
moal_private *priv = (moal_private *)hist_data->priv;
ENTER();
@ -707,10 +731,6 @@ woal_histogram_read(struct seq_file *sfp, void *data)
return -EFAULT;
}
if (!priv->hist_data) {
LEAVE();
return -EFAULT;
}
if (hist_data->ant_idx < priv->phandle->card_info->histogram_table_num)
woal_histogram_info(sfp, priv->hist_data[hist_data->ant_idx]);
@ -718,8 +738,7 @@ woal_histogram_read(struct seq_file *sfp, void *data)
return 0;
}
static int
woal_histogram_proc_open(struct inode *inode, struct file *file)
static int woal_histogram_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_histogram_read, PDE_DATA(inode));
@ -738,12 +757,11 @@ woal_histogram_proc_open(struct inode *inode, struct file *file)
*
* @return number of data
*/
static ssize_t
woal_histogram_write(struct file *f, const char __user * buf, size_t count,
loff_t * off)
static ssize_t woal_histogram_write(struct file *f, const char __user *buf,
size_t count, loff_t *off)
{
struct seq_file *sfp = f->private_data;
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *) sfp->private;
wlan_hist_proc_data *hist_data = (wlan_hist_proc_data *)sfp->private;
moal_private *priv = (moal_private *)hist_data->priv;
woal_hist_reset_table(priv, hist_data->ant_idx);
return count;
@ -757,8 +775,7 @@ woal_histogram_write(struct file *f, const char __user * buf, size_t count,
*
* @return Number of output data or MLAN_STATUS_FAILURE
*/
static int
woal_log_read(struct seq_file *sfp, void *data)
static int woal_log_read(struct seq_file *sfp, void *data)
{
moal_private *priv = (moal_private *)sfp->private;
mlan_ds_get_stats stats;
@ -868,7 +885,8 @@ woal_log_read(struct seq_file *sfp, void *data)
for (i = 0; i < 8; i++) {
seq_printf(sfp, "%u ", stats.qos_retries_rx_cnt[i]);
}
seq_printf(sfp, "\ndot11RSNAStatsCMACICVErrors = %u\n"
seq_printf(sfp,
"\ndot11RSNAStatsCMACICVErrors = %u\n"
"dot11RSNAStatsCMACReplays = %u\n"
"dot11RSNAStatsRobustMgmtCCMPReplays = %u\n"
"dot11RSNAStatsTKIPICVErrors = %u\n"
@ -890,29 +908,20 @@ woal_log_read(struct seq_file *sfp, void *data)
"dot11MPDUInReceivedAMPDUCount = %u\n"
"dot11ReceivedOctetsInAMPDUCount = %llu\n"
"dot11AMPDUDelimiterCRCErrorCount = %u\n",
stats.cmacicv_errors,
stats.cmac_replays,
stats.mgmt_ccmp_replays,
stats.tkipicv_errors,
stats.tkip_replays,
stats.ccmp_decrypt_errors,
stats.ccmp_replays,
stats.tx_amsdu_cnt,
stats.failed_amsdu_cnt,
stats.retry_amsdu_cnt,
stats.cmacicv_errors, stats.cmac_replays,
stats.mgmt_ccmp_replays, stats.tkipicv_errors,
stats.tkip_replays, stats.ccmp_decrypt_errors,
stats.ccmp_replays, stats.tx_amsdu_cnt,
stats.failed_amsdu_cnt, stats.retry_amsdu_cnt,
stats.multi_retry_amsdu_cnt,
stats.tx_octets_in_amsdu_cnt,
stats.amsdu_ack_failure_cnt,
stats.rx_amsdu_cnt,
stats.rx_octets_in_amsdu_cnt,
stats.tx_ampdu_cnt,
stats.amsdu_ack_failure_cnt, stats.rx_amsdu_cnt,
stats.rx_octets_in_amsdu_cnt, stats.tx_ampdu_cnt,
stats.tx_mpdus_in_ampdu_cnt,
stats.tx_octets_in_ampdu_cnt,
stats.ampdu_rx_cnt,
stats.tx_octets_in_ampdu_cnt, stats.ampdu_rx_cnt,
stats.mpdu_in_rx_ampdu_cnt,
stats.rx_octets_in_ampdu_cnt,
stats.ampdu_delimiter_crc_error_cnt);
}
MODULE_PUT;
@ -928,8 +937,7 @@ woal_log_read(struct seq_file *sfp, void *data)
*
* @return number of data
*/
static int
woal_log_proc_open(struct inode *inode, struct file *file)
static int woal_log_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_log_read, PDE_DATA(inode));
@ -949,8 +957,7 @@ woal_log_proc_open(struct inode *inode, struct file *file)
*
* @return Number of output data or MLAN_STATUS_FAILURE
*/
static int
woal_debug_read(struct seq_file *sfp, void *data)
static int woal_debug_read(struct seq_file *sfp, void *data)
{
int val = 0;
unsigned int i;
@ -959,7 +966,7 @@ woal_debug_read(struct seq_file *sfp, void *data)
(struct debug_data_priv *)sfp->private;
struct debug_data *d = items_priv->items;
moal_private *priv = items_priv->priv;
mlan_debug_info *info = &(priv->phandle->debug_info);
mlan_debug_info *info = NULL;
t_u32 intf_mask = INTF_MASK << 8;
#ifdef SDIO
unsigned int j;
@ -973,6 +980,8 @@ woal_debug_read(struct seq_file *sfp, void *data)
return -EFAULT;
}
info = &(priv->phandle->debug_info);
if (MODULE_GET == 0) {
LEAVE();
return -EFAULT;
@ -984,10 +993,11 @@ woal_debug_read(struct seq_file *sfp, void *data)
goto exit;
for (i = 0; i < (unsigned int)items_priv->num_of_items; i++) {
/* If this item is interface specific but card interface is NOT correspond type, we will not count it. */
/* If this item is interface specific but card interface is NOT
* correspond type, we will not count it. */
if ((d[i].attr & intf_mask) &&
!((d[i].attr & intf_mask) & (priv->phandle->
card_type & intf_mask)))
!((d[i].attr & intf_mask) &
(priv->phandle->card_type & intf_mask)))
continue;
if (d[i].size == 1)
@ -1006,12 +1016,11 @@ woal_debug_read(struct seq_file *sfp, void *data)
seq_printf(sfp, "\n");
continue;
}
if (strstr(d[i].name, "id")
|| strstr(d[i].name, "bitmap")
if (strstr(d[i].name, "id") || strstr(d[i].name, "bitmap")
#ifdef PCIE
|| strstr(d[i].name, "ptr")
#endif
)
)
seq_printf(sfp, "%s=0x%x\n", d[i].name, val);
else
seq_printf(sfp, "%s=%d\n", d[i].name, val);
@ -1022,17 +1031,17 @@ woal_debug_read(struct seq_file *sfp, void *data)
seq_printf(sfp, "last_recv_wr_bitmap=0x%x last_mp_index=%d\n",
info->last_recv_wr_bitmap, info->last_mp_index);
for (i = 0; i < SDIO_MP_DBG_NUM; i++) {
seq_printf(sfp,
"mp_wr_bitmap: 0x%x mp_wr_ports=0x%x len=%d curr_wr_port=0x%x\n",
info->last_mp_wr_bitmap[i],
info->last_mp_wr_ports[i],
info->last_mp_wr_len[i],
info->last_curr_wr_port[i]);
seq_printf(
sfp,
"mp_wr_bitmap: 0x%x mp_wr_ports=0x%x len=%d curr_wr_port=0x%x\n",
info->last_mp_wr_bitmap[i],
info->last_mp_wr_ports[i],
info->last_mp_wr_len[i],
info->last_curr_wr_port[i]);
for (j = 0; j < mp_aggr_pkt_limit; j++) {
seq_printf(sfp, "0x%02x ",
info->last_mp_wr_info[i *
mp_aggr_pkt_limit
+ j]);
info->last_mp_wr_info
[i * mp_aggr_pkt_limit + j]);
}
seq_printf(sfp, "\n");
}
@ -1072,13 +1081,14 @@ woal_debug_read(struct seq_file *sfp, void *data)
if (info->tx_tbl_num) {
seq_printf(sfp, "Tx BA stream table:\n");
for (i = 0; i < info->tx_tbl_num; i++) {
seq_printf(sfp,
"tid = %d, ra = %02x:%02x:%02x:%02x:%02x:%02x amsdu=%d\n",
(int)info->tx_tbl[i].tid,
info->tx_tbl[i].ra[0], info->tx_tbl[i].ra[1],
info->tx_tbl[i].ra[2], info->tx_tbl[i].ra[3],
info->tx_tbl[i].ra[4], info->tx_tbl[i].ra[5],
(int)info->tx_tbl[i].amsdu);
seq_printf(
sfp,
"tid = %d, ra = %02x:%02x:%02x:%02x:%02x:%02x amsdu=%d\n",
(int)info->tx_tbl[i].tid, info->tx_tbl[i].ra[0],
info->tx_tbl[i].ra[1], info->tx_tbl[i].ra[2],
info->tx_tbl[i].ra[3], info->tx_tbl[i].ra[4],
info->tx_tbl[i].ra[5],
(int)info->tx_tbl[i].amsdu);
}
}
if (info->rx_tbl_num) {
@ -1086,16 +1096,17 @@ woal_debug_read(struct seq_file *sfp, void *data)
for (i = 0; i < info->rx_tbl_num; i++) {
unsigned int j;
seq_printf(sfp,
"tid = %d, ta = %02x:%02x:%02x:%02x:%02x:%02x, start_win = %d, "
"win_size = %d, amsdu=%d\n",
(int)info->rx_tbl[i].tid,
info->rx_tbl[i].ta[0], info->rx_tbl[i].ta[1],
info->rx_tbl[i].ta[2], info->rx_tbl[i].ta[3],
info->rx_tbl[i].ta[4], info->rx_tbl[i].ta[5],
(int)info->rx_tbl[i].start_win,
(int)info->rx_tbl[i].win_size,
(int)info->rx_tbl[i].amsdu);
seq_printf(
sfp,
"tid = %d, ta = %02x:%02x:%02x:%02x:%02x:%02x, start_win = %d, "
"win_size = %d, amsdu=%d\n",
(int)info->rx_tbl[i].tid, info->rx_tbl[i].ta[0],
info->rx_tbl[i].ta[1], info->rx_tbl[i].ta[2],
info->rx_tbl[i].ta[3], info->rx_tbl[i].ta[4],
info->rx_tbl[i].ta[5],
(int)info->rx_tbl[i].start_win,
(int)info->rx_tbl[i].win_size,
(int)info->rx_tbl[i].amsdu);
seq_printf(sfp, "buffer: ");
for (j = 0; j < info->rx_tbl[i].win_size; j++) {
if (info->rx_tbl[i].buffer[j] == MTRUE)
@ -1107,13 +1118,14 @@ woal_debug_read(struct seq_file *sfp, void *data)
}
}
for (i = 0; i < info->ralist_num; i++) {
seq_printf(sfp,
"ralist ra: %02x:%02x:%02x:%02x:%02x:%02x tid=%d pkts=%d pause=%d\n",
info->ralist[i].ra[0], info->ralist[i].ra[1],
info->ralist[i].ra[2], info->ralist[i].ra[3],
info->ralist[i].ra[4], info->ralist[i].ra[5],
info->ralist[i].tid, info->ralist[i].total_pkts,
info->ralist[i].tx_pause);
seq_printf(
sfp,
"ralist ra: %02x:%02x:%02x:%02x:%02x:%02x tid=%d pkts=%d pause=%d\n",
info->ralist[i].ra[0], info->ralist[i].ra[1],
info->ralist[i].ra[2], info->ralist[i].ra[3],
info->ralist[i].ra[4], info->ralist[i].ra[5],
info->ralist[i].tid, info->ralist[i].total_pkts,
info->ralist[i].tx_pause);
}
exit:
@ -1132,9 +1144,8 @@ exit:
*
* @return number of data
*/
static ssize_t
woal_debug_write(struct file *f, const char __user * buf, size_t count,
loff_t * off)
static ssize_t woal_debug_write(struct file *f, const char __user *buf,
size_t count, loff_t *off)
{
int r, i;
char *pdata;
@ -1159,7 +1170,7 @@ woal_debug_write(struct file *f, const char __user * buf, size_t count,
LEAVE();
return MLAN_STATUS_FAILURE;
}
flag = (in_atomic() || irqs_disabled())? GFP_ATOMIC : GFP_KERNEL;
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
pdata = kzalloc(count + 1, flag);
if (pdata == NULL) {
MODULE_PUT;
@ -1174,6 +1185,7 @@ woal_debug_write(struct file *f, const char __user * buf, size_t count,
LEAVE();
return 0;
}
pdata[count] = '\0';
if (woal_get_debug_info(priv, MOAL_IOCTL_WAIT, info)) {
kfree(pdata);
@ -1218,8 +1230,7 @@ woal_debug_write(struct file *f, const char __user * buf, size_t count,
return count;
}
static int
woal_debug_proc_open(struct inode *inode, struct file *file)
static int woal_debug_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_debug_read, PDE_DATA(inode));
@ -1264,8 +1275,7 @@ static const struct file_operations log_proc_fops = {
*
* @return N/A
*/
void
woal_debug_entry(moal_private *priv)
void woal_debug_entry(moal_private *priv)
{
struct proc_dir_entry *r;
int i;
@ -1278,6 +1288,7 @@ woal_debug_entry(moal_private *priv)
LEAVE();
return;
}
#ifdef STA_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) {
priv->items_priv.items = kmalloc(sizeof(items), GFP_KERNEL);
@ -1313,7 +1324,7 @@ woal_debug_entry(moal_private *priv)
d = priv->items_priv.items;
for (i = 0; i < priv->items_priv.num_of_items; i++) {
if (IS_INFO_ADDR(d[i].attr))
d[i].addr += (t_ptr)&(priv->phandle->debug_info);
d[i].addr += (t_ptr) & (priv->phandle->debug_info);
else if (IS_HANDLE_ADDR(d[i].attr))
d[i].addr += (t_ptr)(priv->phandle);
else if (IS_PRIV_ADDR(d[i].attr))
@ -1403,8 +1414,7 @@ woal_debug_entry(moal_private *priv)
*
* @return N/A
*/
void
woal_debug_remove(moal_private *priv)
void woal_debug_remove(moal_private *priv)
{
char hist_entry[50];
int i;

View File

@ -3,325 +3,326 @@
*
* @brief This file contains definition for private IOCTL call.
*
*
* Copyright 2014-2020 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.
*
*/
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
01/05/2012: initial version
********************************************************/
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#include "moal_cfg80211.h"
#include "moal_cfg80211.h"
#endif
#ifndef _WOAL_ETH_PRIV_H_
#define _WOAL_ETH_PRIV_H_
/** Command disabled */
#define CMD_DISABLED 0
#define CMD_DISABLED 0
/** Command enabled */
#define CMD_ENABLED 1
#define CMD_ENABLED 1
/** Command get */
#define CMD_GET 2
#define CMD_GET 2
/** 2K bytes */
#define WOAL_2K_BYTES 2000
#define WOAL_2K_BYTES 2000
/** NXP private command identifier string */
#define CMD_NXP "MRVL_CMD"
#define CMD_NXP "MRVL_CMD"
/** Private command: Version */
#define PRIV_CMD_VERSION "version"
#define PRIV_CMD_VERSION "version"
/** Private command: Band cfg */
#define PRIV_CMD_BANDCFG "bandcfg"
#define PRIV_CMD_BANDCFG "bandcfg"
/** Private command: Host cmd */
#define PRIV_CMD_HOSTCMD "hostcmd"
#define PRIV_CMD_HOSTCMD "hostcmd"
/** Private command: Custom IE config*/
#define PRIV_CMD_CUSTOMIE "customie"
#define PRIV_CMD_CUSTOMIE "customie"
/** Private command: HT Tx Cfg */
#define PRIV_CMD_HTTXCFG "httxcfg"
#define PRIV_CMD_HTTXCFG "httxcfg"
/** Private command: HT Cap Info */
#define PRIV_CMD_HTCAPINFO "htcapinfo"
#define PRIV_CMD_HTCAPINFO "htcapinfo"
/** Private command: Add BA para */
#define PRIV_CMD_ADDBAPARA "addbapara"
#define PRIV_CMD_ADDBAPARA "addbapara"
/** Private command: Aggragation priority table */
#define PRIV_CMD_AGGRPRIOTBL "aggrpriotbl"
#define PRIV_CMD_AGGRPRIOTBL "aggrpriotbl"
/** Private command: Add BA reject cfg */
#define PRIV_CMD_ADDBAREJECT "addbareject"
#define PRIV_CMD_ADDBAREJECT "addbareject"
/** Private command: Delete BA */
#define PRIV_CMD_DELBA "delba"
#define PRIV_CMD_DELBA "delba"
/** Private command: Reject Addba Req */
#define PRIV_CMD_REJECTADDBAREQ "rejectaddbareq"
#define PRIV_CMD_REJECTADDBAREQ "rejectaddbareq"
/** Private command: 11AC Cfg */
#define PRIV_CMD_VHTCFG "vhtcfg"
#define PRIV_CMD_VHTCFG "vhtcfg"
/** Private command: 11AC Oper Mode Cfg */
#define PRIV_CMD_OPERMODECFG "opermodecfg"
#define PRIV_CMD_DATARATE "getdatarate"
#define PRIV_CMD_TXRATECFG "txratecfg"
#define PRIV_CMD_GETLOG "getlog"
#define PRIV_CMD_ESUPPMODE "esuppmode"
#define PRIV_CMD_OPERMODECFG "opermodecfg"
#define PRIV_CMD_DATARATE "getdatarate"
#define PRIV_CMD_TXRATECFG "txratecfg"
#define PRIV_CMD_GETLOG "getlog"
#define PRIV_CMD_ESUPPMODE "esuppmode"
#define PRIV_CMD_PASSPHRASE "passphrase"
#define PRIV_CMD_DEAUTH "deauth"
#define PRIV_CMD_DEAUTH "deauth"
#ifdef UAP_SUPPORT
#define PRIV_CMD_AP_DEAUTH "apdeauth"
#define PRIV_CMD_GET_STA_LIST "getstalist"
#define PRIV_CMD_BSS_CONFIG "bssconfig"
#define PRIV_CMD_AP_DEAUTH "apdeauth"
#define PRIV_CMD_GET_STA_LIST "getstalist"
#define PRIV_CMD_BSS_CONFIG "bssconfig"
#endif
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
#define PRIV_CMD_BSSROLE "bssrole"
#define PRIV_CMD_BSSROLE "bssrole"
#endif
#endif
#ifdef STA_SUPPORT
#define PRIV_CMD_GETSCANTABLE "getscantable"
#define PRIV_CMD_GETCHANSTATS "getchanstats"
#define PRIV_CMD_GETSCANTABLE "getscantable"
#define PRIV_CMD_GETCHANSTATS "getchanstats"
typedef struct _chan_stats {
/** Number of records in the chan_stats */
/** Number of records in the chan_stats */
t_u32 num_in_chan_stats;
/** channel statistics */
/** channel statistics */
ChanStatistics_t stats[];
} chan_stats;
#define PRIV_CMD_SETUSERSCAN "setuserscan"
#define PRIV_CMD_EXTCAPCFG "extcapcfg"
#define PRIV_CMD_CANCELSCAN "cancelscan"
#define PRIV_CMD_SETUSERSCAN "setuserscan"
#define PRIV_CMD_EXTCAPCFG "extcapcfg"
#define PRIV_CMD_CANCELSCAN "cancelscan"
#endif
#define PRIV_CMD_DEEPSLEEP "deepsleep"
#define PRIV_CMD_IPADDR "ipaddr"
#define PRIV_CMD_WPSSESSION "wpssession"
#define PRIV_CMD_OTPUSERDATA "otpuserdata"
#define PRIV_CMD_COUNTRYCODE "countrycode"
#define PRIV_CMD_TCPACKENH "tcpackenh"
#define PRIV_CMD_DEEPSLEEP "deepsleep"
#define PRIV_CMD_IPADDR "ipaddr"
#define PRIV_CMD_WPSSESSION "wpssession"
#define PRIV_CMD_OTPUSERDATA "otpuserdata"
#define PRIV_CMD_COUNTRYCODE "countrycode"
#define PRIV_CMD_TCPACKENH "tcpackenh"
#ifdef REASSOCIATION
#define PRIV_CMD_ASSOCESSID "assocessid"
#define PRIV_CMD_ASSOCBSSID "assocessid_bssid"
#define PRIV_CMD_ASSOCESSID "assocessid"
#define PRIV_CMD_ASSOCBSSID "assocessid_bssid"
#endif
#define PRIV_CMD_WAKEUPREASON "wakeupreason"
#define PRIV_CMD_WAKEUPREASON "wakeupreason"
#ifdef STA_SUPPORT
#define PRIV_CMD_LISTENINTERVAL "listeninterval"
#endif
#ifdef DEBUG_LEVEL1
#define PRIV_CMD_DRVDBG "drvdbg"
#define PRIV_CMD_DRVDBG "drvdbg"
#endif
#define PRIV_CMD_HSCFG "hscfg"
#define PRIV_CMD_HSSETPARA "hssetpara"
#define PRIV_CMD_MGMT_FILTER "mgmtfilter"
#define PRIV_CMD_SCANCFG "scancfg"
#define PRIV_CMD_GETNLNUM "getnlnum"
#define PRIV_CMD_AGGRCTRL "aggrctrl"
#define PRIV_CMD_HSCFG "hscfg"
#define PRIV_CMD_HSSETPARA "hssetpara"
#define PRIV_CMD_MGMT_FILTER "mgmtfilter"
#define PRIV_CMD_SCANCFG "scancfg"
#define PRIV_CMD_GETNLNUM "getnlnum"
#define PRIV_CMD_AGGRCTRL "aggrctrl"
#ifdef USB
#define PRIV_CMD_USBAGGRCTRL "usbaggrctrl"
#define PRIV_CMD_USBAGGRCTRL "usbaggrctrl"
#endif
#define PRIV_CMD_SET_BSS_MODE "setbssmode"
#define PRIV_CMD_SET_BSS_MODE "setbssmode"
#ifdef STA_SUPPORT
#define PRIV_CMD_SET_AP "setap"
#define PRIV_CMD_SET_POWER "setpower"
#define PRIV_CMD_SET_ESSID "setessid"
#define PRIV_CMD_SET_AUTH "setauth"
#define PRIV_CMD_GET_AP "getap"
#define PRIV_CMD_GET_POWER "getpower"
#define PRIV_CMD_PSMODE "psmode"
#define PRIV_CMD_SET_AP "setap"
#define PRIV_CMD_SET_POWER "setpower"
#define PRIV_CMD_SET_ESSID "setessid"
#define PRIV_CMD_SET_AUTH "setauth"
#define PRIV_CMD_GET_AP "getap"
#define PRIV_CMD_GET_POWER "getpower"
#define PRIV_CMD_PSMODE "psmode"
#endif
#define PRIV_CMD_WARMRESET "warmreset"
#define PRIV_CMD_TXPOWERCFG "txpowercfg"
#define PRIV_CMD_PSCFG "pscfg"
#define PRIV_CMD_BCNTIMEOUTCFG "bcntimeoutcfg"
#define PRIV_CMD_SLEEPPD "sleeppd"
#define PRIV_CMD_TXCONTROL "txcontrol"
#define PRIV_CMD_REGRDWR "regrdwr"
#define PRIV_CMD_RDEEPROM "rdeeprom"
#define PRIV_CMD_MEMRDWR "memrdwr"
#define PRIV_CMD_WARMRESET "warmreset"
#define PRIV_CMD_TXPOWERCFG "txpowercfg"
#define PRIV_CMD_PSCFG "pscfg"
#define PRIV_CMD_BCNTIMEOUTCFG "bcntimeoutcfg"
#define PRIV_CMD_SLEEPPD "sleeppd"
#define PRIV_CMD_TXCONTROL "txcontrol"
#define PRIV_CMD_REGRDWR "regrdwr"
#define PRIV_CMD_RDEEPROM "rdeeprom"
#define PRIV_CMD_MEMRDWR "memrdwr"
#ifdef SDIO
#define PRIV_CMD_SDCMD52RW "sdcmd52rw"
#define PRIV_CMD_SDCMD52RW "sdcmd52rw"
#endif
#define PRIV_CMD_HOTSPOTCFG "hotspotcfg"
#define PRIV_CMD_MGMT_FRAME_CTRL "mgmtframectrl"
#define PRIV_CMD_QCONFIG "qconfig"
#define PRIV_CMD_ADDTS "addts"
#define PRIV_CMD_DELTS "delts"
#define PRIV_CMD_QSTATUS "qstatus"
#define PRIV_CMD_TS_STATUS "ts_status"
#define PRIV_CMD_QOS_CFG "qoscfg"
#define PRIV_CMD_MAC_CTRL "macctrl"
#define PRIV_CMD_GETWAP "getwap"
#define PRIV_CMD_REGION_CODE "regioncode"
#define PRIV_CMD_CFPINFO "cfpinfo"
#define PRIV_CMD_FWMACADDR "fwmacaddr"
#define PRIV_CMD_OFFCHANNEL "offchannel"
#define PRIV_CMD_DSCP_MAP "dscpmap"
#define PRIV_CMD_HOTSPOTCFG "hotspotcfg"
#define PRIV_CMD_MGMT_FRAME_CTRL "mgmtframectrl"
#define PRIV_CMD_QCONFIG "qconfig"
#define PRIV_CMD_ADDTS "addts"
#define PRIV_CMD_DELTS "delts"
#define PRIV_CMD_QSTATUS "qstatus"
#define PRIV_CMD_TS_STATUS "ts_status"
#define PRIV_CMD_QOS_CFG "qoscfg"
#define PRIV_CMD_MAC_CTRL "macctrl"
#define PRIV_CMD_GETWAP "getwap"
#define PRIV_CMD_REGION_CODE "regioncode"
#define PRIV_CMD_CFPINFO "cfpinfo"
#define PRIV_CMD_FWMACADDR "fwmacaddr"
#define PRIV_CMD_OFFCHANNEL "offchannel"
#define PRIV_CMD_DSCP_MAP "dscpmap"
/** Private command: Verext */
#define PRIV_CMD_VEREXT "verext"
#define PRIV_CMD_VEREXT "verext"
#ifdef CONFIG_USB_SUSPEND
#define PRIV_CMD_USB_SUSPEND "usbsuspend"
#define PRIV_CMD_USB_RESUME "usbresume"
#define PRIV_CMD_USB_SUSPEND "usbsuspend"
#define PRIV_CMD_USB_RESUME "usbresume"
#endif /* CONFIG_USB_SUSPEND */
#if defined(STA_SUPPORT) && defined(STA_WEXT)
#define PRIV_CMD_RADIO_CTRL "radioctrl"
#define PRIV_CMD_RADIO_CTRL "radioctrl"
#endif
#define PRIV_CMD_WMM_CFG "wmmcfg"
#define PRIV_CMD_MIN_BA_THRESH_CFG "min_ba_threshold"
#define PRIV_CMD_WMM_CFG "wmmcfg"
#define PRIV_CMD_MIN_BA_THRESH_CFG "min_ba_threshold"
#if defined(STA_SUPPORT)
#define PRIV_CMD_11D_CFG "11dcfg"
#define PRIV_CMD_11D_CLR_TBL "11dclrtbl"
#define PRIV_CMD_11D_CFG "11dcfg"
#define PRIV_CMD_11D_CLR_TBL "11dclrtbl"
#endif
#ifndef OPCHAN
#define PRIV_CMD_WWS_CFG "wwscfg"
#define PRIV_CMD_WWS_CFG "wwscfg"
#endif
#if defined(REASSOCIATION)
#define PRIV_CMD_REASSOCTRL "reassoctrl"
#define PRIV_CMD_REASSOCTRL "reassoctrl"
#endif
#define PRIV_CMD_TXBUF_CFG "txbufcfg"
#define PRIV_CMD_TXBUF_CFG "txbufcfg"
#ifdef STA_SUPPORT
#define PRIV_CMD_AUTH_TYPE "authtype"
#define PRIV_CMD_AUTH_TYPE "authtype"
#endif
#define PRIV_CMD_POWER_CONS "powercons"
#define PRIV_CMD_HT_STREAM_CFG "htstreamcfg"
#define PRIV_CMD_MIMO_SWITCH "mimoswitch"
#define PRIV_CMD_THERMAL "thermal"
#define PRIV_CMD_BCN_INTERVAL "bcninterval"
#define PRIV_CMD_POWER_CONS "powercons"
#define PRIV_CMD_HT_STREAM_CFG "htstreamcfg"
#define PRIV_CMD_MIMO_SWITCH "mimoswitch"
#define PRIV_CMD_THERMAL "thermal"
#define PRIV_CMD_BCN_INTERVAL "bcninterval"
#ifdef STA_SUPPORT
#define PRIV_CMD_GET_SIGNAL "getsignal"
#define PRIV_CMD_SIGNALEXT_CFG "signalextcfg"
#define PRIV_CMD_GET_SIGNAL_EXT_V2 "getsignalextv2"
#define PRIV_CMD_GET_SIGNAL_EXT "getsignalext"
#define PRIV_CMD_GET_SIGNAL "getsignal"
#define PRIV_CMD_SIGNALEXT_CFG "signalextcfg"
#define PRIV_CMD_GET_SIGNAL_EXT_V2 "getsignalextv2"
#define PRIV_CMD_GET_SIGNAL_EXT "getsignalext"
#endif
#if defined(STA_SUPPORT)
#define PRIV_CMD_PMFCFG "pmfcfg"
#define PRIV_CMD_PMFCFG "pmfcfg"
#endif
#define PRIV_CMD_INACTIVITYTO "inactivityto"
#define PRIV_CMD_AMSDU_AGGR_CTRL "amsduaggrctrl"
#define PRIV_CMD_TX_BF_CAP "httxbfcap"
#define PRIV_CMD_INACTIVITYTO "inactivityto"
#define PRIV_CMD_AMSDU_AGGR_CTRL "amsduaggrctrl"
#define PRIV_CMD_TX_BF_CAP "httxbfcap"
#ifdef SDIO
#define PRIV_CMD_SDIO_CLOCK "sdioclock"
#define PRIV_CMD_SDIO_CLOCK "sdioclock"
#endif
#ifdef SDIO
#define PRIV_CMD_MPA_CTRL "mpactrl"
#define PRIV_CMD_MPA_CTRL "mpactrl"
#endif
#define PRIV_CMD_SLEEP_PARAMS "sleepparams"
#define PRIV_CMD_DFS_TESTING "dfstesting"
#define PRIV_CMD_CFP_CODE "cfpcode"
#define PRIV_CMD_CWMODE "cwmode"
#define PRIV_CMD_ANT_CFG "antcfg"
#define PRIV_CMD_SYSCLOCK "sysclock"
#define PRIV_CMD_GET_KEY "getkey"
#define PRIV_CMD_ASSOCIATE "associate"
#define PRIV_CMD_TX_BF_CFG "httxbfcfg"
#define PRIV_CMD_PORT_CTRL "port_ctrl"
#define PRIV_CMD_PB_BYPASS "pb_bypass"
#define PRIV_CMD_SLEEP_PARAMS "sleepparams"
#define PRIV_CMD_DFS_TESTING "dfstesting"
#define PRIV_CMD_DFS53_CFG "dfs53cfg"
#define PRIV_CMD_CFP_CODE "cfpcode"
#define PRIV_CMD_CWMODE "cwmode"
#define PRIV_CMD_ANT_CFG "antcfg"
#define PRIV_CMD_SYSCLOCK "sysclock"
#define PRIV_CMD_GET_KEY "getkey"
#define PRIV_CMD_ASSOCIATE "associate"
#define PRIV_CMD_TX_BF_CFG "httxbfcfg"
#define PRIV_CMD_PORT_CTRL "port_ctrl"
#define PRIV_CMD_PB_BYPASS "pb_bypass"
#ifdef SDIO
#define PRIV_CMD_SD_CMD53_RW "sdcmd53rw"
#define PRIV_CMD_SD_CMD53_RW "sdcmd53rw"
#endif
#ifdef RX_PACKET_COALESCE
#define PRIV_CMD_RX_COAL_CFG "rxpktcoal_cfg"
#endif
#ifdef WIFI_DIRECT_SUPPORT
#if defined(UAP_CFG80211)
#define PRIV_CMD_CFG_NOA "cfg_noa"
#define PRIV_CMD_CFG_OPP_PS "cfg_opp_ps"
#define PRIV_CMD_CFG_NOA "cfg_noa"
#define PRIV_CMD_CFG_OPP_PS "cfg_opp_ps"
#endif
#endif
#define PRIV_CMD_DFS_REPEATER_CFG "dfs_repeater"
#define PRIV_CMD_DFS_REPEATER_CFG "dfs_repeater"
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#define PRIV_CMD_MIRACAST_CFG "miracastcfg"
#define PRIV_CMD_MIRACAST_CFG "miracastcfg"
#endif
#endif
#define PRIV_CMD_COEX_RX_WINSIZE "coex_rx_winsize"
#define PRIV_CMD_COEX_RX_WINSIZE "coex_rx_winsize"
#ifdef PCIE
#define PRIV_CMD_PCIE_REG_RW "pcieregrw"
#define PRIV_CMD_PCIE_BAR0_REG_RW "pciebar0regrw"
#define PRIV_CMD_PCIE_REG_RW "pcieregrw"
#define PRIV_CMD_PCIE_BAR0_REG_RW "pciebar0regrw"
#endif
#define PRIV_CMD_GET_SENSOR_TEMP "get_sensor_temp"
#define PRIV_CMD_GET_SENSOR_TEMP "get_sensor_temp"
#define PRIV_CMD_GET_CHNRGPWR "get_chnrgpwr"
#define PRIV_CMD_GET_TXPWR_LIMIT "get_txpwrlimit"
#define PRIV_CMD_GET_CFG_CHAN_LIST "getcfgchanlist"
#define PRIV_CMD_GET_CHNRGPWR "get_chnrgpwr"
#define PRIV_CMD_GET_TXPWR_LIMIT "get_txpwrlimit"
#define PRIV_CMD_GET_CFG_CHAN_LIST "getcfgchanlist"
#if defined(UAP_SUPPORT)
#define PRIV_CMD_EXTEND_CHAN_SWITCH "channel_switch"
#define PRIV_CMD_EXTEND_CHAN_SWITCH "channel_switch"
#endif
#define PRIV_CMD_DYN_BW "dyn_bw"
#define PRIV_CMD_DYN_BW "dyn_bw"
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#define PRIV_CMD_DFS_OFFLOAD "dfs_offload"
#define PRIV_CMD_DFS_OFFLOAD "dfs_offload"
#endif
#define PRIV_CMD_AUTO_ARP "auto_arp"
#define PRIV_CMD_AUTO_ARP "auto_arp"
#define PRIV_CMD_PER_PKT_CFG "per_pkt_cfg"
#define PRIV_CMD_PER_PKT_CFG "per_pkt_cfg"
#define PRIV_CMD_DEAUTH_CTRL "ctrldeauth"
#define PRIV_CMD_DEAUTH_CTRL "ctrldeauth"
#define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
#define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
/**Private command ID to set/get independent reset*/
#define PRIV_CMD_IND_RST_CFG "indrstcfg"
#define PRIV_CMD_IND_RST_CFG "indrstcfg"
/**Private command to configure static rx abort config */
#define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg"
#define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg"
/**Private command to configure dynamic rx abort config */
#define PRIV_CMD_RX_ABORT_CFG_EXT "rx_abort_cfg_ext"
#define TX_AMPDU_RTS_CTS 0
#define TX_AMPDU_CTS_2_SELF 1
#define TX_AMPDU_DISABLE_PROTECTION 2
#define TX_AMPDU_DYNAMIC_RTS_CTS 3
#define PRIV_CMD_RX_ABORT_CFG_EXT "rx_abort_cfg_ext"
#define TX_AMPDU_RTS_CTS 0
#define TX_AMPDU_CTS_2_SELF 1
#define TX_AMPDU_DISABLE_PROTECTION 2
#define TX_AMPDU_DYNAMIC_RTS_CTS 3
/**Private command to set tx ampdu protection mode */
#define PRIV_CMD_TX_AMPDU_PROT_MODE "tx_ampdu_prot_mode"
#define PRIV_CMD_TX_AMPDU_PROT_MODE "tx_ampdu_prot_mode"
/**Private command to configure tx rate adapt config */
#define PRIV_CMD_RATE_ADAPT_CFG "rate_adapt_cfg"
#define CCK_DESENSE_MODE_DISABLED 0
#define CCK_DESENSE_MODE_DYNAMIC 1
#define CCK_DESENSE_MODE_DYN_ENH 2
#define PRIV_CMD_RATE_ADAPT_CFG "rate_adapt_cfg"
#define CCK_DESENSE_MODE_DISABLED 0
#define CCK_DESENSE_MODE_DYNAMIC 1
#define CCK_DESENSE_MODE_DYN_ENH 2
/**Private command to configure cck desense config */
#define PRIV_CMD_CCK_DESENSE_CFG "cck_desense_cfg"
#define PRIV_CMD_CCK_DESENSE_CFG "cck_desense_cfg"
/** Private command ID for Android default commands */
#define WOAL_ANDROID_DEF_CMD (SIOCDEVPRIVATE + 1)
#define WOAL_ANDROID_DEF_CMD (SIOCDEVPRIVATE + 1)
/** Private command ID to pass mgmt frame */
#define WOAL_MGMT_FRAME_TX WOAL_MGMT_FRAME_TX_IOCTL
#define WOAL_MGMT_FRAME_TX WOAL_MGMT_FRAME_TX_IOCTL
/** Private command ID to pass custom IE list */
#define WOAL_CUSTOM_IE_CFG (SIOCDEVPRIVATE + 13)
#define WOAL_CUSTOM_IE_CFG (SIOCDEVPRIVATE + 13)
/** Private command ID for Android ICS priv CMDs */
#define WOAL_ANDROID_PRIV_CMD (SIOCDEVPRIVATE + 14)
#define WOAL_ANDROID_PRIV_CMD (SIOCDEVPRIVATE + 14)
/** Private command ID to get BSS type */
#define WOAL_GET_BSS_TYPE (SIOCDEVPRIVATE + 15)
#define WOAL_GET_BSS_TYPE (SIOCDEVPRIVATE + 15)
/** Private command ID for robustcoex */
#define PRIV_CMD_ROBUSTCOEX "robustcoex"
#define PRIV_CMD_ROBUSTCOEX "robustcoex"
#define PRIV_CMD_DMCS "dmcs"
#define PRIV_CMD_DMCS "dmcs"
#if defined(PCIE)
#define PRIV_CMD_SSU "ssu"
#define PRIV_CMD_SSU "ssu"
/** ssu_params_ctrl */
typedef struct _ssu_params_cfg {
/* ssu mode */
t_u8 ssu_mode;
/* 0-3; # of FFT samples to skip */
/* 0-3; # of FFT samples to skip*/
t_u32 nskip;
/* 0-3: # of FFT samples selected to dump */
t_u32 nsel;
/* 0-3: Down sample ADC input for buffering */
/* 0-3: Down sample ADC input for buffering*/
t_u32 adcdownsample;
/* 0-1: Mask out ADC Data from spectral packet */
t_u32 mask_adc_pkt;
@ -331,19 +332,24 @@ typedef struct _ssu_params_cfg {
t_u32 spec_pwr_enable;
/* 0-1: Enable spectral packet rate reduction in DB output format */
t_u32 rate_deduction;
/* 0-7: Number of spectral packets over which spectral data is to be averaged. */
/* 0-7: Number of spectral packets over which spectral data is to be
* averaged. */
t_u32 n_pkt_avg;
} __attribute__ ((packed)) ssu_params_cfg;
} __attribute__((packed)) ssu_params_cfg;
#endif
#define PRIV_CMD_BOOTSLEEP "bootsleep"
#define PRIV_CMD_BOOTSLEEP "bootsleep"
/** Private command: 11AX Cfg */
#define PRIV_CMD_11AXCFG "11axcfg"
#define PRIV_CMD_11AXCFG "11axcfg"
/** Private command: 11AX Cmd */
#define PRIV_CMD_11AXCMDCFG "11axcmd"
#define PRIV_CMD_11AXCMDCFG "11axcmd"
/** Private command: TWT Setup Cfg */
#define PRIV_CMD_TWT_SETUP "twt_setup"
/** Private command: TWT Teardown Cfg */
#define PRIV_CMD_TWT_TEARDOWN "twt_teardown"
#define PRIV_CMD_LPM "lpm"
#define PRIV_CMD_LPM "lpm"
int woal_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
@ -357,21 +363,20 @@ int woal_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
/** Private command structure from app */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
typedef struct _android_wifi_priv_cmd {
/** Buffer pointer */
/** Buffer pointer */
t_u64 buf;
/** buffer updated by driver */
/** buffer updated by driver */
int used_len;
/** buffer sent by application */
/** buffer sent by application */
int total_len;
} __attribute__ ((packed))
android_wifi_priv_cmd;
} __attribute__((packed)) android_wifi_priv_cmd;
#else
typedef struct _android_wifi_priv_cmd {
/** Buffer pointer */
/** Buffer pointer */
char *buf;
/** buffer updated by driver */
/** buffer updated by driver */
int used_len;
/** buffer sent by application */
/** buffer sent by application */
int total_len;
} android_wifi_priv_cmd;
#endif
@ -381,55 +386,55 @@ typedef struct _android_wifi_priv_cmd {
#endif
/* Maximum size of the ESSID and NICKN strings */
#define MW_ESSID_MAX_SIZE 32
#define MW_ESSID_MAX_SIZE 32
/* Modes of operation */
#define MW_MODE_AUTO 0 /* Let the driver decides */
#define MW_MODE_ADHOC 1 /* Single cell network */
#define MW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
#define MW_MODE_MASTER 3 /* Synchronisation master or Access Point */
#define MW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
#define MW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
#define MW_MODE_MONITOR 6 /* Passive monitor (listen only) */
#define MW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
#define MW_MODE_AUTO 0 /* Let the driver decides */
#define MW_MODE_ADHOC 1 /* Single cell network */
#define MW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
#define MW_MODE_MASTER 3 /* Synchronisation master or Access Point */
#define MW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
#define MW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
#define MW_MODE_MONITOR 6 /* Passive monitor (listen only) */
#define MW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
#define MW_POWER_TYPE 0xF000 /* Type of parameter */
#define MW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
#define MW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
#define MW_POWER_TYPE 0xF000 /* Type of parameter */
#define MW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
#define MW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
#define MW_AUTH_INDEX 0x0FFF
#define MW_AUTH_FLAGS 0xF000
#define MW_AUTH_WPA_VERSION 0
#define MW_AUTH_CIPHER_PAIRWISE 1
#define MW_AUTH_CIPHER_GROUP 2
#define MW_AUTH_KEY_MGMT 3
#define MW_AUTH_TKIP_COUNTERMEASURES 4
#define MW_AUTH_DROP_UNENCRYPTED 5
#define MW_AUTH_80211_AUTH_ALG 6
#define MW_AUTH_WPA_ENABLED 7
#define MW_AUTH_RX_UNENCRYPTED_EAPOL 8
#define MW_AUTH_ROAMING_CONTROL 9
#define MW_AUTH_PRIVACY_INVOKED 10
#define MW_AUTH_CIPHER_GROUP_MGMT 11
#define MW_AUTH_MFP 12
#define MW_AUTH_INDEX 0x0FFF
#define MW_AUTH_FLAGS 0xF000
#define MW_AUTH_WPA_VERSION 0
#define MW_AUTH_CIPHER_PAIRWISE 1
#define MW_AUTH_CIPHER_GROUP 2
#define MW_AUTH_KEY_MGMT 3
#define MW_AUTH_TKIP_COUNTERMEASURES 4
#define MW_AUTH_DROP_UNENCRYPTED 5
#define MW_AUTH_80211_AUTH_ALG 6
#define MW_AUTH_WPA_ENABLED 7
#define MW_AUTH_RX_UNENCRYPTED_EAPOL 8
#define MW_AUTH_ROAMING_CONTROL 9
#define MW_AUTH_PRIVACY_INVOKED 10
#define MW_AUTH_CIPHER_GROUP_MGMT 11
#define MW_AUTH_MFP 12
#define MW_AUTH_CIPHER_NONE 0x00000001
#define MW_AUTH_CIPHER_WEP40 0x00000002
#define MW_AUTH_CIPHER_WEP40 0x00000002
#define MW_AUTH_CIPHER_TKIP 0x00000004
#define MW_AUTH_CIPHER_CCMP 0x00000008
#define MW_AUTH_CIPHER_WEP104 0x00000010
#define MW_AUTH_CIPHER_WEP104 0x00000010
#define MW_AUTH_CIPHER_AES_CMAC 0x00000020
#define MW_AUTH_ALG_OPEN_SYSTEM 0x00000001
#define MW_AUTH_ALG_SHARED_KEY 0x00000002
#define MW_AUTH_ALG_LEAP 0x00000004
#define MW_AUTH_ALG_SHARED_KEY 0x00000002
#define MW_AUTH_ALG_LEAP 0x00000004
/* Generic format for most parameters that fit in an int */
struct mw_param {
t_s32 value; /* The value of the parameter itself */
t_u8 fixed; /* Hardware should not use auto select */
t_u8 disabled; /* Disable the feature */
t_u16 flags; /* Various specifc flags (if any) */
t_s32 value; /* The value of the parameter itself */
t_u8 fixed; /* Hardware should not use auto select */
t_u8 disabled; /* Disable the feature */
t_u16 flags; /* Various specifc flags (if any) */
};
/*
@ -437,9 +442,9 @@ struct mw_param {
* pointer to memory allocated in user space.
*/
struct mw_point {
t_u8 *pointer; /* Pointer to the data (in user space) */
t_u16 length; /* number of fields or size in bytes */
t_u16 flags; /* Optional params */
t_u8 *pointer; /* Pointer to the data (in user space) */
t_u16 length; /* number of fields or size in bytes */
t_u16 flags; /* Optional params */
};
/*
@ -450,18 +455,18 @@ union mwreq_data {
/* Config - generic */
char name[IFNAMSIZ];
struct mw_point essid; /* Extended network name */
t_u32 mode; /* Operation mode */
struct mw_param power; /* PM duration/timeout */
struct sockaddr ap_addr; /* Access point address */
struct mw_param param; /* Other small parameters */
struct mw_point data; /* Other large parameters */
struct mw_point essid; /* Extended network name */
t_u32 mode; /* Operation mode */
struct mw_param power; /* PM duration/timeout */
struct sockaddr ap_addr; /* Access point address */
struct mw_param param; /* Other small parameters */
struct mw_point data; /* Other large parameters */
};
/* The structure to exchange data for ioctl */
/* The structure to exchange data for ioctl */
struct mwreq {
union {
char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
} ifr_ifrn;
/* Data part */
@ -485,13 +490,13 @@ typedef struct woal_priv_addba {
typedef struct woal_priv_tx_rate_cfg {
/* LG rate: 0, HT rate: 1, VHT rate: 2 */
t_u32 rate_format;
/** Rate/MCS index (0xFF: auto) */
/** Rate/MCS index (0xFF: auto) */
t_u32 rate_index;
/** Data rate */
/** Data rate */
t_u32 rate;
/** NSS */
/** NSS */
t_u32 nss;
/** Rate Setting */
/** Rate Setting */
t_u16 rate_setting;
} woal_tx_rate_cfg;
@ -513,45 +518,45 @@ int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req);
#define PRIV_CMD_CLOUD_KEEP_ALIVE "cloud_keep_alive"
/** cloud keep alive parameters */
typedef struct _cloud_keep_alive {
/** id */
/** id */
t_u8 mkeep_alive_id;
/** enable/disable of this id */
/** enable/disable of this id */
t_u8 enable;
/** enable/disable reset*/
/** enable/disable reset*/
t_u8 reset;
/** Reserved */
/** Reserved */
t_u8 reserved;
/** Destination MAC address */
/** Destination MAC address */
t_u8 dst_mac[ETH_ALEN];
/** Source MAC address */
/** Source MAC address */
t_u8 src_mac[ETH_ALEN];
/** packet send period */
/** packet send period */
t_u32 sendInterval;
/** packet retry interval */
/** packet retry interval */
t_u32 retryInterval;
/** packet retry count */
/** packet retry count */
t_u8 retryCount;
/** packet length */
/** packet length */
t_u8 pkt_len;
/** packet content */
/** packet content */
t_u8 pkt[255];
} __ATTRIB_PACK__ cloud_keep_alive;
#define TLV_TYPE_PER_PKT_CFG 0x0001
#define TX_PKT_CTRL MBIT(0)
#define RX_PKT_INFO MBIT(1)
#define TX_PKT_CTRL MBIT(0)
#define RX_PKT_INFO MBIT(1)
#define FLAG_TX_HISTOGRAM 0x01
#define FLAG_RX_HISTOGRAM 0x02
#define DISABLE_TX_RX_HISTOGRAM 0x00
#define ENABLE_TX_RX_HISTOGRAM 0x01
#define GET_TX_RX_HISTOGRAM 0x02
#define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
#define FLAG_TX_HISTOGRAM 0x01
#define FLAG_RX_HISTOGRAM 0x02
#define DISABLE_TX_RX_HISTOGRAM 0x00
#define ENABLE_TX_RX_HISTOGRAM 0x01
#define GET_TX_RX_HISTOGRAM 0x02
#define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
/** TX and RX histogram statistic parameters*/
typedef struct _tx_rx_histogram {
/** Enable or disable get tx/rx histogram statistic */
/** Enable or disable get tx/rx histogram statistic */
t_u8 enable;
/** Choose to get TX, RX or both histogram statistic */
/** Choose to get TX, RX or both histogram statistic */
t_u8 action;
} __ATTRIB_PACK__ tx_rx_histogram;
@ -564,23 +569,23 @@ typedef enum _cw_modes_e {
/** wlan_ieee80211_chan */
typedef struct {
/** center freq */
/** center freq */
t_u16 center_freq;
/** chan num */
/** chan num */
t_u16 hw_value;
/** chan flags */
/** chan flags */
t_u32 flags;
/** max power */
/** max power */
int max_power;
/** dfs_state */
/** dfs_state */
t_u8 dfs_state;
} __ATTRIB_PACK__ wlan_ieee80211_chan;
/** wlan_ieee80211_chan_list*/
typedef struct {
/** num of chan */
/** num of chan */
t_u8 num_chan;
/** chan_list */
/** chan_list */
wlan_ieee80211_chan chan_list[];
} __ATTRIB_PACK__ wlan_ieee80211_chan_list;
#endif /* _WOAL_ETH_PRIV_H_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,25 @@
/** @file moal_pcie.h
*
* @brief This file contains definitions for PCIE interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains definitions for PCIE interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
@ -29,104 +29,105 @@ Change log:
#ifndef _MOAL_PCIE_H_
#define _MOAL_PCIE_H_
#define PCIE_VENDOR_ID_NXP (0x11ab)
#define PCIE_VENDOR_ID_V2_NXP (0x1b4b)
#define PCIE_VENDOR_ID_NXP (0x11ab)
#define PCIE_VENDOR_ID_V2_NXP (0x1b4b)
#ifdef PCIE8997
/** PCIE device ID for 8997 card */
#define PCIE_DEVICE_ID_NXP_88W8997P (0x2b42)
#define PCIE_DEVICE_ID_NXP_88W8997P (0x2b42)
#endif
#ifdef PCIE8897
/** PCIE device ID for 8897 card */
#define PCIE_DEVICE_ID_NXP_88W8897P (0x2b38)
#define PCIE_DEVICE_ID_NXP_88W8897P (0x2b38)
#endif
#ifdef PCIE9097
/** PCIE device ID for 9097 card */
#define PCIE_DEVICE_ID_NXP_88W9097 (0x2b56)
#define PCIE_DEVICE_ID_NXP_88W9097 (0x2b56)
#endif
#ifdef PCIE9098
/** PCIE device ID for 9098 card FN0 */
#define PCIE_DEVICE_ID_NXP_88W9098P_FN0 (0x2b43)
#define PCIE_DEVICE_ID_NXP_88W9098P_FN0 (0x2b43)
/** PCIE device ID for 9098 card FN1 */
#define PCIE_DEVICE_ID_NXP_88W9098P_FN1 (0x2b44)
#define PCIE_DEVICE_ID_NXP_88W9098P_FN1 (0x2b44)
#endif
#include <linux/version.h>
#include <linux/pci.h>
#include <linux/version.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
#include <linux/pcieport_if.h>
#include <linux/pcieport_if.h>
#endif
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include "moal_main.h"
#include "moal_main.h"
/** Default firmware name */
#ifdef PCIE8997
#define PCIE8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_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_COMBO_FW_NAME "nxp/pcieusb8997_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
#define PCIE8997_A0 0x10
#define PCIE8997_A1 0x11
#endif /* PCIE8997 */
#ifdef PCIE8897
#define PCIE8897_DEFAULT_COMBO_FW_NAME "nxp/pcie8897_uapsta.bin"
#define PCIE8897_DEFAULT_WLAN_FW_NAME "nxp/pcie8897_wlan.bin"
#endif /* PCIE8897 */
#endif /* PCIE8897*/
#ifdef PCIE9098
#define PCIE9098_Z1Z2 0x00
#define PCIE9098_A0 0x01
#define PCIE9098_A1 0x02
#define PCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEUART9098_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9098_combo.bin"
#define PCIEUSB9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEPCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pciepcie9098_combo.bin"
#define PCIEUART9098_COMBO_V1_FW_NAME "nxp/pcieuart9098_combo_v1.bin"
#define PCIEUSB9098_COMBO_V1_FW_NAME "nxp/pcieusb9098_combo_v1.bin"
#define PCIEPCIE9098_COMBO_V1_FW_NAME "nxp/pciepcie9098_combo_v1.bin"
#define PCIE9098_Z1Z2 0x00
#define PCIE9098_A0 0x01
#define PCIE9098_A1 0x02
#define PCIE9098_A2 0x03
#define PCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEUART9098_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9098_combo.bin"
#define PCIEUSB9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEPCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pciepcie9098_combo.bin"
#define PCIEUART9098_COMBO_V1_FW_NAME "nxp/pcieuart9098_combo_v1.bin"
#define PCIEUSB9098_COMBO_V1_FW_NAME "nxp/pcieusb9098_combo_v1.bin"
#define PCIEPCIE9098_COMBO_V1_FW_NAME "nxp/pciepcie9098_combo_v1.bin"
#define PCIE9098_DEFAULT_WLAN_FW_NAME "nxp/pcie9098_wlan.bin"
#define PCIE9098_WLAN_V1_FW_NAME "nxp/pcie9098_wlan_v1.bin"
#define PCIE9098_WLAN_V1_FW_NAME "nxp/pcie9098_wlan_v1.bin"
#endif /* PCIE9098 */
#ifdef PCIE9097
#define PCIE9097_A0 0x00
#define PCIE9097_B0 0x01
#define PCIE9097_B1 0x02
#define PCIE9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9097_combo.bin"
#define PCIEUART9097_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9097_combo.bin"
#define PCIEUSB9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9097_combo.bin"
#define PCIEUART9097_COMBO_V1_FW_NAME "nxp/pcieuart9097_combo_v1.bin"
#define PCIEUSB9097_COMBO_V1_FW_NAME "nxp/pcieusb9097_combo_v1.bin"
#define PCIE9097_A0 0x00
#define PCIE9097_B0 0x01
#define PCIE9097_B1 0x02
#define PCIE9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9097_combo.bin"
#define PCIEUART9097_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9097_combo.bin"
#define PCIEUSB9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9097_combo.bin"
#define PCIEUART9097_COMBO_V1_FW_NAME "nxp/pcieuart9097_combo_v1.bin"
#define PCIEUSB9097_COMBO_V1_FW_NAME "nxp/pcieusb9097_combo_v1.bin"
#define PCIE9097_DEFAULT_WLAN_FW_NAME "nxp/pcie9097_wlan.bin"
#define PCIE9097_WLAN_V1_FW_NAME "nxp/pcie9097_wlan_v1.bin"
#define PCIE9097_WLAN_V1_FW_NAME "nxp/pcie9097_wlan_v1.bin"
#endif /* PCIE9097 */
#if defined(PCIE9098) || defined(PCIE9097)
#define PCIE_NUM_MSIX_VECTORS 32
#define PCIE_NUM_MSIX_VECTORS 32
#else
#define PCIE_NUM_MSIX_VECTORS 4
#define PCIE_NUM_MSIX_VECTORS 4
#endif
typedef struct _msix_context {
/** pci_dev structure pointer */
/** pci_dev structure pointer */
struct pci_dev *dev;
/** message id related to msix vector */
/** message id related to msix vector */
t_u16 msg_id;
} msix_context;
/** Structure: PCIE service card */
typedef struct _pcie_service_card {
/** pci_dev structure pointer */
/** pci_dev structure pointer */
struct pci_dev *dev;
/** moal_handle structure pointer */
/** moal_handle structure pointer */
moal_handle *handle;
/** I/O memory regions pointer to the bus */
/** I/O memory regions pointer to the bus */
void __iomem *pci_mmap;
/** I/O memory regions pointer to the bus */
/** I/O memory regions pointer to the bus */
void __iomem *pci_mmap1;
#if defined(PCIE)
struct msix_entry msix_entries[PCIE_NUM_MSIX_VECTORS];

File diff suppressed because it is too large Load Diff

View File

@ -3,23 +3,23 @@
*
* @brief This file contains definition for extended private IOCTL call.
*
*
* Copyright 2014-2020 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.
*
*/
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
@ -30,22 +30,22 @@ Change log:
#define _WOAL_PRIV_H_
/** 2K bytes */
#define WOAL_2K_BYTES 2000
#define WOAL_2K_BYTES 2000
/** PRIVATE CMD ID */
#define WOAL_IOCTL (SIOCIWFIRSTPRIV) /* 0x8BE0 defined in wireless.h */
#define WOAL_IOCTL (SIOCIWFIRSTPRIV) /* 0x8BE0 defined in wireless.h */
/** Private command ID to set one int/get word char */
#define WOAL_SETONEINT_GETWORDCHAR (WOAL_IOCTL + 1)
#define WOAL_SETONEINT_GETWORDCHAR (WOAL_IOCTL + 1)
/** Private command ID to get version */
#define WOAL_VERSION 1
#define WOAL_VERSION 1
/** Private command ID to get extended version */
#define WOAL_VEREXT 2
#define WOAL_VEREXT 2
/** Private command ID to set/get none */
#define WOAL_SETNONE_GETNONE (WOAL_IOCTL + 2)
#define WOAL_SETNONE_GETNONE (WOAL_IOCTL + 2)
/** Private command ID for warm reset */
#define WOAL_WARMRESET 1
#define WOAL_WARMRESET 1
/**
* Linux Kernels later 3.9 use CONFIG_PM_RUNTIME instead of
@ -69,692 +69,404 @@ Change log:
#ifdef CONFIG_USB_SUSPEND
/** Private command ID for usb suspend */
#define WOAL_USB_SUSPEND 2
#define WOAL_USB_SUSPEND 2
/** Private command ID for usb resume */
#define WOAL_USB_RESUME 3
#define WOAL_USB_RESUME 3
#endif /* CONFIG_USB_SUSPEND */
/** Private command ID to clear 11d chan table */
#define WOAL_11D_CLR_CHAN_TABLE 4
#define WOAL_11D_CLR_CHAN_TABLE 4
/** Private command ID to set/get sixteen int */
#define WOAL_SET_GET_SIXTEEN_INT (WOAL_IOCTL + 3)
#define WOAL_SET_GET_SIXTEEN_INT (WOAL_IOCTL + 3)
/** Private command ID to set/get TX power configurations */
#define WOAL_TX_POWERCFG 1
#define WOAL_TX_POWERCFG 1
#ifdef DEBUG_LEVEL1
/** Private command ID to set/get driver debug */
#define WOAL_DRV_DBG 2
#define WOAL_DRV_DBG 2
#endif
/** Private command ID to set/get beacon interval */
#define WOAL_BEACON_INTERVAL 3
#define WOAL_BEACON_INTERVAL 3
/** Private command ID to get RSSI */
#define WOAL_SIGNAL 5
#define WOAL_SIGNAL 5
/** Private command ID to set/get Deep Sleep mode */
#define WOAL_DEEP_SLEEP 7
#define WOAL_DEEP_SLEEP 7
/** Private command ID for 11n ht configration */
#define WOAL_11N_TX_CFG 8
#define WOAL_11N_TX_CFG 8
/** Private command ID for 11n usr ht configration */
#define WOAL_11N_HTCAP_CFG 9
#define WOAL_11N_HTCAP_CFG 9
/** Private command ID for TX Aggregation */
#define WOAL_PRIO_TBL 10
#define WOAL_PRIO_TBL 10
/** Private command ID for Updating ADDBA variables */
#define WOAL_ADDBA_UPDT 11
#define WOAL_ADDBA_UPDT 11
/** Private command ID to set/get Host Sleep configuration */
#define WOAL_HS_CFG 12
#define WOAL_HS_CFG 12
/** Private command ID to set Host Sleep parameters */
#define WOAL_HS_SETPARA 13
#define WOAL_HS_SETPARA 13
/** Private command ID to read/write registers */
#define WOAL_REG_READ_WRITE 14
#define WOAL_REG_READ_WRITE 14
/** Private command ID to set/get band/adhocband */
#define WOAL_BAND_CFG 15
#define WOAL_BAND_CFG 15
/** Private command ID for TX Aggregation */
#define WOAL_11N_AMSDU_AGGR_CTRL 17
#define WOAL_11N_AMSDU_AGGR_CTRL 17
/** Private command ID to set/get Inactivity timeout */
#define WOAL_INACTIVITY_TIMEOUT_EXT 18
#ifdef SDIO
/** Private command ID to turn on/off sdio clock */
#define WOAL_SDIO_CLOCK 19
#define WOAL_SDIO_CLOCK 19
/** Private command ID to read/write Command 52 */
#define WOAL_CMD_52RDWR 20
#define WOAL_CMD_52RDWR 20
#endif
/** Private command ID to set/get scan configuration parameter */
#define WOAL_SCAN_CFG 21
#define WOAL_SCAN_CFG 21
/** Private command ID to set/get PS configuration parameter */
#define WOAL_PS_CFG 22
#define WOAL_PS_CFG 22
/** Private command ID to read/write memory */
#define WOAL_MEM_READ_WRITE 23
#define WOAL_MEM_READ_WRITE 23
#ifdef SDIO
/** Private command ID to control SDIO MP-A */
#define WOAL_SDIO_MPA_CTRL 25
#define WOAL_SDIO_MPA_CTRL 25
#endif
/** Private command ID for Updating ADDBA variables */
#define WOAL_ADDBA_REJECT 27
#define WOAL_ADDBA_REJECT 27
/** Private command ID to set/get sleep parameters */
#define WOAL_SLEEP_PARAMS 28
#define WOAL_SLEEP_PARAMS 28
/** Private command ID to set/get TX BF capabilities */
#define WOAL_TX_BF_CAP 31
#define WOAL_TX_BF_CAP 31
/** Private command ID to set/get dfs testing settings */
#define WOAL_DFS_TESTING 33
#define WOAL_DFS_TESTING 33
/** Private command ID to set/get CFP table codes */
#define WOAL_CFP_CODE 34
#define WOAL_CFP_CODE 34
/** Private command ID to set/get tx/rx antenna */
#define WOAL_SET_GET_TX_RX_ANT 35
#define WOAL_SET_GET_TX_RX_ANT 35
/** Private command ID to set/get management frame passthru mask */
#define WOAL_MGMT_FRAME_CTRL 36
#define WOAL_MGMT_FRAME_CTRL 36
/** Private command ID to configure gpio independent reset */
#define WOAL_IND_RST_CFG 37
#define WOAL_IND_RST_CFG 37
/** Private command ID to set one int/get one int */
#define WOAL_SETONEINT_GETONEINT (WOAL_IOCTL + 5)
#define WOAL_SETONEINT_GETONEINT (WOAL_IOCTL + 5)
/** Private command ID to set/get Tx rate */
#define WOAL_SET_GET_TXRATE 1
#define WOAL_SET_GET_TXRATE 1
/** Private command ID to set/get region code */
#define WOAL_SET_GET_REGIONCODE 2
#define WOAL_SET_GET_REGIONCODE 2
/** Private command ID to turn on/off radio */
#define WOAL_SET_RADIO 3
#define WOAL_SET_RADIO 3
/** Private command ID to enable WMM */
#define WOAL_WMM_ENABLE 4
#define WOAL_WMM_ENABLE 4
/** Private command ID to enable 802.11D */
#define WOAL_11D_ENABLE 5
#define WOAL_11D_ENABLE 5
/** Private command ID to set/get QoS configuration */
#define WOAL_SET_GET_QOS_CFG 7
#define WOAL_SET_GET_QOS_CFG 7
#if defined(REASSOCIATION)
/** Private command ID to set/get reassociation setting */
#define WOAL_SET_GET_REASSOC 9
#define WOAL_SET_GET_REASSOC 9
#endif /* REASSOCIATION */
/** Private command ID for Updating Transmit buffer configration */
#define WOAL_TXBUF_CFG 10
#define WOAL_TXBUF_CFG 10
/** Private command ID to set/get WWS mode */
#define WOAL_SET_GET_WWS_CFG 12
#define WOAL_SET_GET_WWS_CFG 12
/** Private command ID to set/get sleep period */
#define WOAL_SLEEP_PD 13
#define WOAL_SLEEP_PD 13
/** Private command ID to set/get auth type */
#define WOAL_AUTH_TYPE 18
#define WOAL_AUTH_TYPE 18
/** Private command ID to set/get port control */
#define WOAL_PORT_CTRL 19
#define WOAL_PORT_CTRL 19
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
/** Private command ID for set/get BSS role */
#define WOAL_SET_GET_BSS_ROLE 21
#define WOAL_SET_GET_BSS_ROLE 21
#endif
#endif
/** Private command ID for set/get 11h local power constraint */
#define WOAL_SET_GET_11H_LOCAL_PWR_CONSTRAINT 22
/** Private command ID to set/get 11N HT stream configuration */
#define WOAL_HT_STREAM_CFG 23
#define WOAL_HT_STREAM_CFG 23
/** Private command ID to set/get MAC control */
#define WOAL_MAC_CONTROL 24
#define WOAL_MAC_CONTROL 24
/** Private command ID to get thermal value */
#define WOAL_THERMAL 25
#define WOAL_THERMAL 25
/** Private command ID to set/get hs cfg param */
#define WOAL_CFG_HOTSPOT 26
#define WOAL_CFG_HOTSPOT 26
/** Private command ID to get log */
#define WOALGETLOG (WOAL_IOCTL + 7)
#define WOALGETLOG (WOAL_IOCTL + 7)
/** Private command ID to set a wext address variable */
#define WOAL_SETADDR_GETNONE (WOAL_IOCTL + 8)
#define WOAL_SETADDR_GETNONE (WOAL_IOCTL + 8)
/** Private command ID to send deauthentication */
#define WOAL_DEAUTH 1
#define WOAL_DEAUTH 1
/** Private command to get/set 256 chars */
#define WOAL_SET_GET_256_CHAR (WOAL_IOCTL + 9)
#define WOAL_SET_GET_256_CHAR (WOAL_IOCTL + 9)
/** Private command to read/write passphrase */
#define WOAL_PASSPHRASE 1
#define WOAL_ASSOCIATE 3
#define WOAL_PASSPHRASE 1
#define WOAL_ASSOCIATE 3
/** Private command ID to get WMM queue status */
#define WOAL_WMM_QUEUE_STATUS 4
#define WOAL_WMM_QUEUE_STATUS 4
/** Private command ID to get Traffic stream status */
#define WOAL_WMM_TS_STATUS 5
#define WOAL_IP_ADDRESS 7
#define WOAL_WMM_TS_STATUS 5
#define WOAL_IP_ADDRESS 7
/** Private command ID to set/get TX bemaforming */
#define WOAL_TX_BF_CFG 8
#define WOAL_TX_BF_CFG 8
/** Private command ID to get PTK/GTK */
#define WOAL_GET_KEY 9
#define WOAL_GET_KEY 9
/** Get log buffer size */
#define GETLOG_BUFSIZE 1500
#define GETLOG_BUFSIZE 1500
/** Private command ID to set none/get twelve chars*/
#define WOAL_SETNONE_GETTWELVE_CHAR (WOAL_IOCTL + 11)
/** Private command ID for WPS session */
#define WOAL_WPS_SESSION 1
#define WOAL_WPS_SESSION 1
/** Private command ID to set none/get four int */
#define WOAL_SETNONE_GET_FOUR_INT (WOAL_IOCTL + 13)
#define WOAL_SETNONE_GET_FOUR_INT (WOAL_IOCTL + 13)
/** Private command ID to get data rates */
#define WOAL_DATA_RATE 1
#define WOAL_DATA_RATE 1
/** Private command ID to get E-Supplicant mode */
#define WOAL_ESUPP_MODE 2
#define WOAL_ESUPP_MODE 2
/** Private command to get/set 64 ints */
#define WOAL_SET_GET_64_INT (WOAL_IOCTL + 15)
#define WOAL_SET_GET_64_INT (WOAL_IOCTL + 15)
/** Private command ID to set/get ECL system clock */
#define WOAL_ECL_SYS_CLOCK 1
#define WOAL_ECL_SYS_CLOCK 1
/** Private command ID for hostcmd */
#define WOAL_HOST_CMD (WOAL_IOCTL + 17)
#define WOAL_HOST_CMD (WOAL_IOCTL + 17)
/** Private command ID to set ints and get chars */
#define WOAL_SET_INTS_GET_CHARS (WOAL_IOCTL + 21)
#define WOAL_SET_INTS_GET_CHARS (WOAL_IOCTL + 21)
/** Private command ID to read EEPROM data */
#define WOAL_READ_EEPROM 1
#define WOAL_READ_EEPROM 1
/** Private command ID to set/get 2K bytes */
#define WOAL_SET_GET_2K_BYTES (WOAL_IOCTL + 23)
#define WOAL_SET_GET_2K_BYTES (WOAL_IOCTL + 23)
#ifdef SDIO
/** Private command ID to read/write Command 53 */
#define WOAL_CMD_53RDWR 2
#define WOAL_CMD_53RDWR 2
#endif
/** Private command ID for setuserscan */
#define WOAL_SET_USER_SCAN 3
#define WOAL_SET_USER_SCAN 3
/** Private command ID for getscantable */
#define WOAL_GET_SCAN_TABLE 4
#define WOAL_GET_SCAN_TABLE 4
/** Private command ID for setuserscanext: async without wait */
#define WOAL_SET_USER_SCAN_EXT 5
#define WOAL_SET_USER_SCAN_EXT 5
/** Private command ID to request ADDTS */
#define WOAL_WMM_ADDTS 7
#define WOAL_WMM_ADDTS 7
/** Private command ID to request DELTS */
#define WOAL_WMM_DELTS 8
#define WOAL_WMM_DELTS 8
/** Private command ID to queue configuration */
#define WOAL_WMM_QUEUE_CONFIG 9
#define WOAL_WMM_QUEUE_CONFIG 9
/** Private command ID to queue stats */
#define WOAL_WMM_QUEUE_STATS 10
#define WOAL_WMM_QUEUE_STATS 10
/** Private command ID to Bypass auth packet */
#define WOAL_BYPASSED_PACKET 11
#define WOAL_BYPASSED_PACKET 11
#ifdef UAP_WEXT
/** The following command IDs are for Froyo app */
/** Private command ID to start driver */
#define WOAL_FROYO_START (WOAL_IOCTL + 28)
#define WOAL_FROYO_START (WOAL_IOCTL + 28)
/** Private command ID to reload FW */
#define WOAL_FROYO_WL_FW_RELOAD (WOAL_IOCTL + 29)
#define WOAL_FROYO_WL_FW_RELOAD (WOAL_IOCTL + 29)
/** Private command ID to stop driver */
#define WOAL_FROYO_STOP (WOAL_IOCTL + 30)
#define WOAL_FROYO_STOP (WOAL_IOCTL + 30)
#endif
/**
* iwpriv ioctl handlers
*/
static const struct iw_priv_args woal_private_args[] = {
{
WOAL_SETONEINT_GETWORDCHAR,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
""},
{
WOAL_VERSION,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
{WOAL_SETONEINT_GETWORDCHAR, IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128, ""},
{WOAL_VERSION, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_CHAR | 128,
"version"},
{
WOAL_VEREXT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
"verext"},
{
WOAL_SETNONE_GETNONE,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
""},
{
WOAL_WARMRESET,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"warmreset"},
{WOAL_VEREXT, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_CHAR | 128, "verext"},
{WOAL_SETNONE_GETNONE, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, ""},
{WOAL_WARMRESET, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "warmreset"},
#ifdef CONFIG_USB_SUSPEND
{
WOAL_USB_SUSPEND,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"usbsuspend"},
{
WOAL_USB_RESUME,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"usbresume"},
{WOAL_USB_SUSPEND, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "usbsuspend"},
{WOAL_USB_RESUME, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "usbresume"},
#endif /* CONFIG_USB_SUSPEND */
{
WOAL_SETONEINT_GETONEINT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SETONEINT_GETONEINT, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
""},
{
WOAL_SET_GET_TXRATE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_TXRATE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"txratecfg"},
{
WOAL_SET_GET_REGIONCODE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_REGIONCODE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"regioncode"},
{
WOAL_SET_RADIO,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_RADIO, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"radioctrl"},
{
WOAL_WMM_ENABLE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
"wmmcfg"},
{
WOAL_11D_ENABLE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
"11dcfg"},
{
WOAL_11D_CLR_CHAN_TABLE,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
{WOAL_WMM_ENABLE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1, "wmmcfg"},
{WOAL_11D_ENABLE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1, "11dcfg"},
{WOAL_11D_CLR_CHAN_TABLE, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE,
"11dclrtbl"},
{
WOAL_SET_GET_QOS_CFG,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_QOS_CFG, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"qoscfg"},
#ifndef OPCHAN
{
WOAL_SET_GET_WWS_CFG,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_WWS_CFG, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"wwscfg"},
#endif
#if defined(REASSOCIATION)
{
WOAL_SET_GET_REASSOC,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_REASSOC, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"reassoctrl"},
#endif
{
WOAL_TXBUF_CFG,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_TXBUF_CFG, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"txbufcfg"},
{
WOAL_SLEEP_PD,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
"sleeppd"},
{
WOAL_AUTH_TYPE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SLEEP_PD, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1, "sleeppd"},
{WOAL_AUTH_TYPE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"authtype"},
{
WOAL_PORT_CTRL,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_PORT_CTRL, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"port_ctrl"},
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
{
WOAL_SET_GET_BSS_ROLE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_BSS_ROLE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"bssrole"},
#endif
#endif
{
WOAL_SET_GET_11H_LOCAL_PWR_CONSTRAINT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
"powercons"},
{
WOAL_HT_STREAM_CFG,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_SET_GET_11H_LOCAL_PWR_CONSTRAINT, IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1, "powercons"},
{WOAL_HT_STREAM_CFG, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"htstreamcfg"},
{
WOAL_MAC_CONTROL,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_MAC_CONTROL, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"macctrl"},
{
WOAL_THERMAL,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
"thermal"},
{
WOAL_CFG_HOTSPOT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_THERMAL, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1, "thermal"},
{WOAL_CFG_HOTSPOT, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"hotspotcfg"},
{
WOAL_SET_GET_SIXTEEN_INT,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SET_GET_SIXTEEN_INT, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
""},
{
WOAL_TX_POWERCFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_TX_POWERCFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"txpowercfg"},
#ifdef DEBUG_LEVEL1
{
WOAL_DRV_DBG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"drvdbg"},
{WOAL_DRV_DBG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16, "drvdbg"},
#endif
{
WOAL_BEACON_INTERVAL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_BEACON_INTERVAL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"bcninterval"},
{
WOAL_SIGNAL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SIGNAL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"getsignal"},
{
WOAL_DEEP_SLEEP,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"deepsleep",
},
{
WOAL_11N_TX_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
WOAL_DEEP_SLEEP,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"deepsleep",
},
{WOAL_11N_TX_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"httxcfg"},
{
WOAL_11N_HTCAP_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_11N_HTCAP_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"htcapinfo"},
{
WOAL_PRIO_TBL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_PRIO_TBL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"aggrpriotbl"},
{
WOAL_11N_AMSDU_AGGR_CTRL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_11N_AMSDU_AGGR_CTRL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"amsduaggrctrl"},
{
WOAL_ADDBA_UPDT,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_ADDBA_UPDT, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"addbapara"},
{
WOAL_ADDBA_REJECT,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_ADDBA_REJECT, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"addbareject"},
{
WOAL_TX_BF_CAP,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_TX_BF_CAP, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"httxbfcap"},
{
WOAL_HS_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"hscfg"},
{
WOAL_HS_SETPARA,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_HS_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16, "hscfg"},
{WOAL_HS_SETPARA, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"hssetpara"},
{
WOAL_REG_READ_WRITE,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_REG_READ_WRITE, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"regrdwr"},
{
WOAL_BAND_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_BAND_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"bandcfg"},
{
WOAL_INACTIVITY_TIMEOUT_EXT,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"inactivityto"},
{WOAL_INACTIVITY_TIMEOUT_EXT, IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16, "inactivityto"},
#ifdef SDIO
{
WOAL_SDIO_CLOCK,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SDIO_CLOCK, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"sdioclock"},
{
WOAL_CMD_52RDWR,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_CMD_52RDWR, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"sdcmd52rw"},
#endif
{
WOAL_SCAN_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SCAN_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"scancfg"},
{
WOAL_PS_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
"pscfg"},
{
WOAL_MEM_READ_WRITE,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_PS_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16, "pscfg"},
{WOAL_MEM_READ_WRITE, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"memrdwr"},
#ifdef SDIO
{
WOAL_SDIO_MPA_CTRL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SDIO_MPA_CTRL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"mpactrl"},
#endif
{
WOAL_SLEEP_PARAMS,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SLEEP_PARAMS, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"sleepparams"},
{
WOAL_DFS_TESTING,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_DFS_TESTING, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"dfstesting"},
{
WOAL_MGMT_FRAME_CTRL,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_MGMT_FRAME_CTRL, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"mgmtframectrl"},
{
WOAL_CFP_CODE,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_CFP_CODE, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"cfpcode"},
{
WOAL_SET_GET_TX_RX_ANT,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_SET_GET_TX_RX_ANT, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"antcfg"},
{
WOAL_IND_RST_CFG,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_INT | 16,
{WOAL_IND_RST_CFG, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_INT | 16,
"indrstcfg"},
{
WOALGETLOG,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_CHAR | GETLOG_BUFSIZE,
{WOALGETLOG, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_CHAR | GETLOG_BUFSIZE,
"getlog"},
{
WOAL_SETADDR_GETNONE,
IW_PRIV_TYPE_ADDR | 1,
IW_PRIV_TYPE_NONE,
""},
{
WOAL_DEAUTH,
IW_PRIV_TYPE_ADDR | 1,
IW_PRIV_TYPE_NONE,
"deauth"},
{
WOAL_SET_GET_256_CHAR,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
""},
{
WOAL_PASSPHRASE,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_SETADDR_GETNONE, IW_PRIV_TYPE_ADDR | 1, IW_PRIV_TYPE_NONE, ""},
{WOAL_DEAUTH, IW_PRIV_TYPE_ADDR | 1, IW_PRIV_TYPE_NONE, "deauth"},
{WOAL_SET_GET_256_CHAR, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, ""},
{WOAL_PASSPHRASE, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"passphrase"},
{
WOAL_GET_KEY,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_GET_KEY, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"getkey"},
{
WOAL_ASSOCIATE,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_ASSOCIATE, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"associate"},
{
WOAL_WMM_QUEUE_STATUS,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
"qstatus"},
{
WOAL_WMM_TS_STATUS,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_WMM_QUEUE_STATUS, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, "qstatus"},
{WOAL_WMM_TS_STATUS, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"ts_status"},
{
WOAL_IP_ADDRESS,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_IP_ADDRESS, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"ipaddr"},
{
WOAL_TX_BF_CFG,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_TX_BF_CFG, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"httxbfcfg"},
{
WOAL_SETNONE_GETTWELVE_CHAR,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_CHAR | 12,
{WOAL_SETNONE_GETTWELVE_CHAR, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_CHAR | 12,
""},
{
WOAL_WPS_SESSION,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_CHAR | 12,
{WOAL_WPS_SESSION, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_CHAR | 12,
"wpssession"},
{
WOAL_SETNONE_GET_FOUR_INT,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_INT | 4,
{WOAL_SETNONE_GET_FOUR_INT, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | 4,
""},
{
WOAL_DATA_RATE,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_INT | 4,
{WOAL_DATA_RATE, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | 4,
"getdatarate"},
{
WOAL_ESUPP_MODE,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_INT | 4,
"esuppmode"},
{
WOAL_SET_GET_64_INT,
IW_PRIV_TYPE_INT | 64,
IW_PRIV_TYPE_INT | 64,
""},
{
WOAL_ECL_SYS_CLOCK,
IW_PRIV_TYPE_INT | 64,
IW_PRIV_TYPE_INT | 64,
{WOAL_ESUPP_MODE, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | 4, "esuppmode"},
{WOAL_SET_GET_64_INT, IW_PRIV_TYPE_INT | 64, IW_PRIV_TYPE_INT | 64, ""},
{WOAL_ECL_SYS_CLOCK, IW_PRIV_TYPE_INT | 64, IW_PRIV_TYPE_INT | 64,
"sysclock"},
{
WOAL_HOST_CMD,
IW_PRIV_TYPE_BYTE | 2047,
IW_PRIV_TYPE_BYTE | 2047,
{WOAL_HOST_CMD, IW_PRIV_TYPE_BYTE | 2047, IW_PRIV_TYPE_BYTE | 2047,
"hostcmd"},
{
WOAL_SET_INTS_GET_CHARS,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_BYTE | 256,
""},
{
WOAL_READ_EEPROM,
IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_BYTE | 256,
{WOAL_SET_INTS_GET_CHARS, IW_PRIV_TYPE_INT | 16,
IW_PRIV_TYPE_BYTE | 256, ""},
{WOAL_READ_EEPROM, IW_PRIV_TYPE_INT | 16, IW_PRIV_TYPE_BYTE | 256,
"rdeeprom"},
{
WOAL_SET_GET_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
""},
{WOAL_SET_GET_2K_BYTES, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, ""},
#if defined(SDIO)
{
WOAL_CMD_53RDWR,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"sdcmd53rw"},
{WOAL_CMD_53RDWR, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "sdcmd53rw"},
#endif
{
WOAL_SET_USER_SCAN,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"setuserscan"},
{
WOAL_GET_SCAN_TABLE,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"getscantable"},
{
WOAL_SET_USER_SCAN_EXT,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"setuserscanext"},
{
WOAL_WMM_ADDTS,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"addts"},
{
WOAL_WMM_DELTS,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"delts"},
{
WOAL_WMM_QUEUE_CONFIG,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"qconfig"},
{
WOAL_WMM_QUEUE_STATS,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"qstats"},
{
WOAL_BYPASSED_PACKET,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
"pb_bypass"},
{WOAL_SET_USER_SCAN, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "setuserscan"},
{WOAL_GET_SCAN_TABLE, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "getscantable"},
{WOAL_SET_USER_SCAN_EXT, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "setuserscanext"},
{WOAL_WMM_ADDTS, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "addts"},
{WOAL_WMM_DELTS, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "delts"},
{WOAL_WMM_QUEUE_CONFIG, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "qconfig"},
{WOAL_WMM_QUEUE_STATS, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "qstats"},
{WOAL_BYPASSED_PACKET, IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES,
IW_PRIV_TYPE_BYTE | WOAL_2K_BYTES, "pb_bypass"},
#ifdef UAP_WEXT
{
WOAL_FROYO_START,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"START"},
{
WOAL_FROYO_STOP,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"STOP"},
{
WOAL_FROYO_WL_FW_RELOAD,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
"WL_FW_RELOAD"},
{WOAL_FROYO_START, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "START"},
{WOAL_FROYO_STOP, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "STOP"},
{WOAL_FROYO_WL_FW_RELOAD, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, "WL_FW_RELOAD"},
#endif
};

View File

@ -1,54 +1,54 @@
/** @file moal_proc.c
*
* @brief This file contains functions for proc file.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains functions for proc file.
*
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
10/21/2008: initial version
********************************************************/
#include "moal_main.h"
#include "moal_main.h"
#ifdef UAP_SUPPORT
#include "moal_uap.h"
#include "moal_uap.h"
#endif
#ifdef SDIO
#include "moal_sdio.h"
#include "moal_sdio.h"
#endif
/********************************************************
Local Variables
********************************************************/
#ifdef CONFIG_PROC_FS
#define STATUS_PROC "wifi_status"
#define MWLAN_PROC "mwlan"
#define WLAN_PROC "adapter%d"
#define STATUS_PROC "wifi_status"
#define MWLAN_PROC "mwlan"
#define WLAN_PROC "adapter%d"
/** Proc mwlan directory entry */
struct proc_dir_entry *proc_mwlan;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
#define PROC_DIR NULL
#define PROC_DIR NULL
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
#define PROC_DIR (&proc_root)
#define PROC_DIR (&proc_root)
#else
#define PROC_DIR proc_net
#define PROC_DIR proc_net
#endif
#ifdef STA_SUPPORT
@ -63,7 +63,7 @@ static char *szModes[] = {
/********************************************************
Global Variables
********************************************************/
int wifi_status = 0;
int wifi_status;
/********************************************************
Local Functions
@ -76,8 +76,7 @@ int wifi_status = 0;
*
* @return Number of output data
*/
static int
woal_info_proc_read(struct seq_file *sfp, void *data)
static int woal_info_proc_read(struct seq_file *sfp, void *data)
{
struct net_device *netdev = (struct net_device *)sfp->private;
char fmt[MLAN_MAX_VER_STR_LEN];
@ -121,7 +120,8 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
#ifdef UAP_SUPPORT
memset(&ustats, 0, sizeof(ustats));
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
seq_printf(sfp, "driver_name = " "\"uap\"\n");
seq_printf(sfp, "driver_name = "
"\"uap\"\n");
woal_uap_get_version(priv, fmt, sizeof(fmt) - 1);
if (MLAN_STATUS_SUCCESS !=
woal_uap_get_stats(priv, MOAL_IOCTL_WAIT, &ustats)) {
@ -130,7 +130,7 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
return -EFAULT;
}
}
#endif /* UAP_SUPPORT */
#endif /* UAP_SUPPORT*/
#ifdef STA_SUPPORT
memset(&info, 0, sizeof(info));
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) {
@ -141,7 +141,8 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
LEAVE();
return -EFAULT;
}
seq_printf(sfp, "driver_name = " "\"wlan\"\n");
seq_printf(sfp, "driver_name = "
"\"wlan\"\n");
}
#endif
seq_printf(sfp, "driver_version = %s", fmt);
@ -159,8 +160,8 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
seq_printf(sfp, "bss_mode =\"%s\"\n", szModes[info.bss_mode]);
#endif
seq_printf(sfp, "media_state=\"%s\"\n",
((priv->media_connected ==
MFALSE) ? "Disconnected" : "Connected"));
((priv->media_connected == MFALSE) ? "Disconnected" :
"Connected"));
seq_printf(sfp, "mac_address=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
netdev->dev_addr[0], netdev->dev_addr[1],
netdev->dev_addr[2], netdev->dev_addr[3],
@ -170,9 +171,8 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
seq_printf(sfp, "multicast_count=\"%d\"\n", mc_count);
seq_printf(sfp, "essid=\"%s\"\n", info.ssid.ssid);
seq_printf(sfp, "bssid=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
info.bssid[0], info.bssid[1],
info.bssid[2], info.bssid[3],
info.bssid[4], info.bssid[5]);
info.bssid[0], info.bssid[1], info.bssid[2],
info.bssid[3], info.bssid[4], info.bssid[5]);
seq_printf(sfp, "channel=\"%d\"\n", (int)info.bss_chan);
seq_printf(sfp, "region_code = \"%02x\"\n",
(t_u8)info.region_code);
@ -182,23 +182,23 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
for (i = 0; i < netdev->mc_count; i++) {
seq_printf(sfp,
"multicast_address[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
i,
mcptr->dmi_addr[0], mcptr->dmi_addr[1],
mcptr->dmi_addr[2], mcptr->dmi_addr[3],
mcptr->dmi_addr[4], mcptr->dmi_addr[5]);
seq_printf(
sfp,
"multicast_address[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
i, mcptr->dmi_addr[0], mcptr->dmi_addr[1],
mcptr->dmi_addr[2], mcptr->dmi_addr[3],
mcptr->dmi_addr[4], mcptr->dmi_addr[5]);
mcptr = mcptr->next;
}
#else
netdev_for_each_mc_addr(mcptr, netdev)
seq_printf(sfp,
"multicast_address[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
i++,
mcptr->addr[0], mcptr->addr[1],
mcptr->addr[2], mcptr->addr[3],
mcptr->addr[4], mcptr->addr[5]);
netdev_for_each_mc_addr (mcptr, netdev)
seq_printf(
sfp,
"multicast_address[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
i++, mcptr->addr[0], mcptr->addr[1],
mcptr->addr[2], mcptr->addr[3], mcptr->addr[4],
mcptr->addr[5]);
#endif /* < 2.6.35 */
}
#endif
@ -215,14 +215,15 @@ woal_info_proc_read(struct seq_file *sfp, void *data)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29)
for (i = 0; i < netdev->num_tx_queues; i++) {
seq_printf(sfp, "tx queue %d: %s\n", i,
((netif_tx_queue_stopped
(netdev_get_tx_queue(netdev, 0))) ? "stopped" :
"started"));
((netif_tx_queue_stopped(
netdev_get_tx_queue(netdev, 0))) ?
"stopped" :
"started"));
}
#else
seq_printf(sfp, "tx queue %s\n",
((netif_queue_stopped(priv->netdev)) ? "stopped" :
"started"));
"started"));
#endif
#ifdef UAP_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
@ -268,8 +269,7 @@ exit:
return 0;
}
static int
woal_info_proc_open(struct inode *inode, struct file *file)
static int woal_info_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_info_proc_read, PDE_DATA(inode));
@ -287,7 +287,7 @@ static const struct file_operations info_proc_fops = {
};
#ifdef SDIO
#define CMD52_STR_LEN 50
#define CMD52_STR_LEN 50
/*
* @brief Parse cmd52 string
*
@ -298,9 +298,8 @@ static const struct file_operations info_proc_fops = {
* @param val Parsed value to set
* @return BT_STATUS_SUCCESS
*/
static int
parse_cmd52_string(const char *buffer, size_t len, int *func, int *reg,
int *val)
static int parse_cmd52_string(const char *buffer, size_t len, int *func,
int *reg, int *val)
{
int ret = MLAN_STATUS_SUCCESS;
char *string = NULL;
@ -308,7 +307,7 @@ parse_cmd52_string(const char *buffer, size_t len, int *func, int *reg,
gfp_t flag;
ENTER();
flag = (in_atomic() || irqs_disabled())? GFP_ATOMIC : GFP_KERNEL;
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(CMD52_STR_LEN, flag);
if (string == NULL)
return -ENOMEM;
@ -351,9 +350,8 @@ parse_cmd52_string(const char *buffer, size_t len, int *func, int *reg,
*
* @return number of data
*/
static ssize_t
woal_config_write(struct file *f, const char __user * buf, size_t count,
loff_t * off)
static ssize_t woal_config_write(struct file *f, const char __user *buf,
size_t count, loff_t *off)
{
char databuf[101];
char *line = NULL;
@ -410,8 +408,8 @@ woal_config_write(struct file *f, const char __user * buf, size_t count,
if (IS_SD(handle->card_type)) {
if (!strncmp(databuf, "sdcmd52rw=", strlen("sdcmd52rw=")) &&
count > strlen("sdcmd52rw=")) {
parse_cmd52_string((const char *)databuf,
(size_t) count, &func, &reg, &val);
parse_cmd52_string((const char *)databuf, (size_t)count,
&func, &reg, &val);
woal_sdio_read_write_cmd52(handle, func, reg, val);
}
}
@ -445,14 +443,14 @@ woal_config_write(struct file *f, const char __user * buf, size_t count,
gfp_t flag;
if (len) {
kfree(handle->fwdump_fname);
flag = (in_atomic() ||
irqs_disabled())? GFP_ATOMIC : GFP_KERNEL;
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC :
GFP_KERNEL;
handle->fwdump_fname = kzalloc(len, flag);
if (handle->fwdump_fname)
moal_memcpy_ext(handle, handle->fwdump_fname,
databuf +
strlen("fwdump_file="), len - 1,
len - 1);
strlen("fwdump_file="),
len - 1, len - 1);
}
}
if (!strncmp(databuf, "fw_reload", strlen("fw_reload"))) {
@ -480,8 +478,7 @@ woal_config_write(struct file *f, const char __user * buf, size_t count,
*
* @return number of output data
*/
static int
woal_config_read(struct seq_file *sfp, void *data)
static int woal_config_read(struct seq_file *sfp, void *data)
{
moal_handle *handle = (moal_handle *)sfp->private;
@ -508,8 +505,7 @@ woal_config_read(struct seq_file *sfp, void *data)
return 0;
}
static int
woal_config_proc_open(struct inode *inode, struct file *file)
static int woal_config_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_config_read, PDE_DATA(inode));
@ -535,8 +531,7 @@ static const struct file_operations config_proc_fops = {
*
* @return number of output data
*/
static int
woal_wifi_status_read(struct seq_file *sfp, void *data)
static int woal_wifi_status_read(struct seq_file *sfp, void *data)
{
ENTER();
@ -552,8 +547,7 @@ woal_wifi_status_read(struct seq_file *sfp, void *data)
return 0;
}
static int
woal_wifi_status_proc_open(struct inode *inode, struct file *file)
static int woal_wifi_status_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
return single_open(file, woal_wifi_status_read, PDE_DATA(inode));
@ -580,8 +574,7 @@ static const struct file_operations wifi_status_proc_fops = {
*
* @return Converted number from string s
*/
int
woal_string_to_number(char *s)
int woal_string_to_number(char *s)
{
int r = 0;
int base = 0;
@ -617,8 +610,7 @@ woal_string_to_number(char *s)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_root_proc_init(void)
mlan_status woal_root_proc_init(void)
{
ENTER();
@ -646,8 +638,7 @@ woal_root_proc_init(void)
*
* @return N/A
*/
void
woal_root_proc_remove(void)
void woal_root_proc_remove(void)
{
ENTER();
@ -666,8 +657,7 @@ woal_root_proc_remove(void)
*
* @return N/A
*/
void
woal_proc_init(moal_handle *handle)
void woal_proc_init(moal_handle *handle)
{
struct proc_dir_entry *r;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
@ -690,7 +680,8 @@ woal_proc_init(moal_handle *handle)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
/* Check if directory already exists */
for (pde = pde->subdir; pde; pde = pde->next) {
if (pde->namelen && !strcmp(handle->proc_wlan_name, pde->name)) {
if (pde->namelen &&
!strcmp(handle->proc_wlan_name, pde->name)) {
/* Directory exists */
PRINTM(MWARN, "proc interface already exists!\n");
handle->proc_wlan = pde;
@ -739,8 +730,7 @@ done:
*
* @return N/A
*/
void
woal_proc_exit(moal_handle *handle)
void woal_proc_exit(moal_handle *handle)
{
char config_proc_dir[20];
@ -777,8 +767,7 @@ woal_proc_exit(moal_handle *handle)
*
* @return N/A
*/
void
woal_create_proc_entry(moal_private *priv)
void woal_create_proc_entry(moal_private *priv)
{
struct proc_dir_entry *r;
struct net_device *dev = priv->netdev;
@ -803,7 +792,8 @@ woal_create_proc_entry(moal_private *priv)
return;
}
strcat(proc_dir_name, dev->name);
/* Try to create adapterX/dev_name directory first under /proc/mwlan/ */
/* Try to create adapterX/dev_name directory first under
* /proc/mwlan/ */
priv->proc_entry = proc_mkdir(proc_dir_name, proc_mwlan);
if (priv->proc_entry) {
/* Success. Continue normally */
@ -815,10 +805,10 @@ woal_create_proc_entry(moal_private *priv)
atomic_inc(&(priv->phandle->proc_wlan->count));
#endif
} else {
/* Failure. adapterX/ may not exist. Try to create that first */
priv->phandle->proc_wlan =
proc_mkdir(priv->phandle->proc_wlan_name,
proc_mwlan);
/* Failure. adapterX/ may not exist. Try to create that
* first */
priv->phandle->proc_wlan = proc_mkdir(
priv->phandle->proc_wlan_name, proc_mwlan);
if (!priv->phandle->proc_wlan) {
/* Failure. Something broken */
LEAVE();
@ -867,8 +857,7 @@ woal_create_proc_entry(moal_private *priv)
*
* @return N/A
*/
void
woal_proc_remove(moal_private *priv)
void woal_proc_remove(moal_private *priv)
{
ENTER();
if (priv->phandle->proc_wlan && priv->proc_entry) {

View File

@ -1,59 +1,59 @@
/** @file moal_sdio.h
*
* @brief This file contains definitions for SDIO interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains definitions for SDIO interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
/****************************************************
Change log:
****************************************************/
#ifndef _MOAL_SDIO_H
#define _MOAL_SDIO_H
#ifndef _MOAL_SDIO_H
#define _MOAL_SDIO_H
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include "moal_main.h"
#ifndef BLOCK_MODE
/** Block mode */
#define BLOCK_MODE 1
#define BLOCK_MODE 1
#endif
#ifndef BYTE_MODE
/** Byte Mode */
#define BYTE_MODE 0
#define BYTE_MODE 0
#endif
#ifndef FIXED_ADDRESS
/** Fixed address mode */
#define FIXED_ADDRESS 0
#define FIXED_ADDRESS 0
#endif
#if defined(SD8977)
#define SD8977_V0 0x0
#define SD8977_V1 0x8
#define SD8977_V2 0x9
#define SD8977_V0 0x0
#define SD8977_V1 0x8
#define SD8977_V2 0x9
#define SD8977_V0_FW_NAME "nxp/sdsd8977_combo.bin"
#define SD8977_V1_FW_NAME "nxp/sdsd8977_combo_v1.bin"
#define SD8977_V2_FW_NAME "nxp/sdsd8977_combo_v2.bin"
@ -64,8 +64,8 @@ Change log:
#if defined(SD8887)
/** SD8887 chip revision ID */
#define SD8887_A0 0x0
#define SD8887_A2 0x2
#define SD8887_A0 0x0
#define SD8887_A2 0x2
#define SD8887_A0_FW_NAME "nxp/sd8887_uapsta.bin"
#define SD8887_A2_FW_NAME "nxp/sd8887_uapsta_a2.bin"
@ -80,57 +80,58 @@ Change log:
#endif /* SD8887 */
#ifdef SD8977
#define SD8977_DEFAULT_COMBO_FW_NAME "nxp/sdsd8977_combo_v2.bin"
#define SD8977_DEFAULT_COMBO_FW_NAME "nxp/sdsd8977_combo_v2.bin"
#define SD8977_DEFAULT_WLAN_FW_NAME "nxp/sd8977_wlan_v2.bin"
#endif /* SD8977 */
#ifdef SD8997
#define SD8997_DEFAULT_COMBO_FW_NAME "nxp/sdsd8997_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_COMBO_FW_NAME "nxp/sdsd8997_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/sdsd8987_combo.bin"
#define SDUART8987_DEFAULT_COMBO_FW_NAME "nxp/sduart8987_combo.bin"
#define SDSD8987_DEFAULT_COMBO_FW_NAME "nxp/sdsd8987_combo.bin"
#define SD8987_DEFAULT_COMBO_FW_NAME "nxp/sdsd8987_combo.bin"
#define SDUART8987_DEFAULT_COMBO_FW_NAME "nxp/sduart8987_combo.bin"
#define SDSD8987_DEFAULT_COMBO_FW_NAME "nxp/sdsd8987_combo.bin"
#define SD8987_DEFAULT_WLAN_FW_NAME "nxp/sd8987_wlan.bin"
#endif /* SD8987 */
#ifdef SD8897
#define SD8897_DEFAULT_COMBO_FW_NAME "nxp/sdsd8897_uapsta.bin"
#define SD8897_DEFAULT_COMBO_FW_NAME "nxp/sdsd8897_uapsta.bin"
#define SD8897_DEFAULT_WLAN_FW_NAME "nxp/sd8897_wlan.bin"
#endif /* SD8897 */
#ifdef SD8978
#define SD8978_DEFAULT_COMBO_FW_NAME "nxp/sdsd8978_combo.bin"
#define SD8978_DEFAULT_COMBO_FW_NAME "nxp/sdsd8978_combo.bin"
#define SDUART8978_DEFAULT_COMBO_FW_NAME "nxp/sduart8978_combo.bin"
#define SDSD8978_DEFAULT_COMBO_FW_NAME "nxp/sdsd8978_combo.bin"
#define SD8978_DEFAULT_WLAN_FW_NAME "nxp/sd8978_wlan.bin"
#define SDSD8978_DEFAULT_COMBO_FW_NAME "nxp/sdsd8978_combo.bin"
#define SD8978_DEFAULT_WLAN_FW_NAME "nxp/sd8978_wlan.bin"
#endif /* SD8978 */
#ifdef SD9098
#define SD9098_Z1Z2 0x00
#define SD9098_A0 0x01
#define SD9098_A1 0x02
#define SD9098_DEFAULT_COMBO_FW_NAME "nxp/sdsd9098_combo.bin"
#define SDUART9098_DEFAULT_COMBO_FW_NAME "nxp/sduart9098_combo.bin"
#define SDSD9098_DEFAULT_COMBO_FW_NAME "nxp/sdsd9098_combo.bin"
#define SD9098_Z1Z2 0x00
#define SD9098_A0 0x01
#define SD9098_A1 0x02
#define SD9098_A2 0x03
#define SD9098_DEFAULT_COMBO_FW_NAME "nxp/sdsd9098_combo.bin"
#define SDUART9098_DEFAULT_COMBO_FW_NAME "nxp/sduart9098_combo.bin"
#define SDSD9098_DEFAULT_COMBO_FW_NAME "nxp/sdsd9098_combo.bin"
#define SD9098_DEFAULT_WLAN_FW_NAME "nxp/sd9098_wlan.bin"
#define SDUART9098_COMBO_V1_FW_NAME "nxp/sduart9098_combo_v1.bin"
#define SDSD9098_COMBO_V1_FW_NAME "nxp/sdsd9098_combo_v1.bin"
#define SDUART9098_COMBO_V1_FW_NAME "nxp/sduart9098_combo_v1.bin"
#define SDSD9098_COMBO_V1_FW_NAME "nxp/sdsd9098_combo_v1.bin"
#define SD9098_WLAN_V1_FW_NAME "nxp/sd9098_wlan_v1.bin"
#endif /* SD9098 */
#ifdef SD9097
#define SD9097_B0 0x01
#define SD9097_B1 0x02
#define SD9097_DEFAULT_COMBO_FW_NAME "nxp/sdsd9097_combo_v1.bin"
#define SD9097_B0 0x01
#define SD9097_B1 0x02
#define SD9097_DEFAULT_COMBO_FW_NAME "nxp/sdsd9097_combo_v1.bin"
#define SD9097_DEFAULT_WLAN_FW_NAME "nxp/sd9097_wlan_v1.bin"
#define SDUART9097_COMBO_V1_FW_NAME "nxp/sduart9097_combo_v1.bin"
#define SDSD9097_COMBO_V1_FW_NAME "nxp/sdsd9097_combo_v1.bin"
#define SDUART9097_COMBO_V1_FW_NAME "nxp/sduart9097_combo_v1.bin"
#define SDSD9097_COMBO_V1_FW_NAME "nxp/sdsd9097_combo_v1.bin"
#define SD9097_WLAN_V1_FW_NAME "nxp/sd9097_wlan_v1.bin"
#endif /* SD9097 */

View File

@ -3,23 +3,23 @@
* @brief This file contains SDIO MMC IF (interface) module
* related functions.
*
*
* Copyright 2014-2020 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.
*
*/
*
* Copyright 2014-2020 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.
*
*/
/****************************************************
Change log:
02/25/09: Initial creation -
@ -44,41 +44,41 @@ static moal_if_ops sdiommc_ops;
#ifdef SD8887
/** Device ID for SD8887 */
#define SD_DEVICE_ID_8887 (0x9135)
#define SD_DEVICE_ID_8887 (0x9135)
#endif
#ifdef SD8897
/** Device ID for SD8897 */
#define SD_DEVICE_ID_8897 (0x912d)
#define SD_DEVICE_ID_8897 (0x912d)
#endif
#ifdef SD8977
/** Device ID for SD8977 */
#define SD_DEVICE_ID_8977 (0x9145)
#define SD_DEVICE_ID_8977 (0x9145)
#endif
#ifdef SD8978
/** Device ID for SD8978 */
#define SD_DEVICE_ID_8978 (0x9159)
#define SD_DEVICE_ID_8978 (0x9159)
#endif
#ifdef SD8997
/** Device ID for SD8997 */
#define SD_DEVICE_ID_8997 (0x9141)
#define SD_DEVICE_ID_8997 (0x9141)
#endif
#ifdef SD8987
/** Device ID for SD8987 */
#define SD_DEVICE_ID_8987 (0x9149)
#define SD_DEVICE_ID_8987 (0x9149)
#endif
#ifdef SD9098
/** Device ID for SD9098 */
#define SD_DEVICE_ID_9098_FN1 (0x914D)
#define SD_DEVICE_ID_9098_FN1 (0x914D)
/** Device ID for SD9098 */
#define SD_DEVICE_ID_9098_FN2 (0x914E)
#define SD_DEVICE_ID_9098_FN2 (0x914E)
#endif
#ifdef SD9097
/** Device ID for SD9097 */
#define SD_DEVICE_ID_9097 (0x9155)
#define SD_DEVICE_ID_9097 (0x9155)
#endif
/** Device ID any */
#ifndef SD_DEVICE_ANY
#define SD_DEVICE_ANY (0xffff)
#define SD_DEVICE_ANY (0xffff)
#endif /* SD_DEVICE_ANY */
/** WLAN IDs */
@ -130,6 +130,8 @@ static struct dev_pm_ops wlan_sdio_pm_ops = {
void woal_sdio_shutdown(struct device *dev);
#endif
#endif
// clang-format off
static struct sdio_driver REFDATA wlan_sdio = {
.name = "wlan_sdio",
.id_table = wlan_ids,
@ -145,18 +147,19 @@ static struct sdio_driver REFDATA wlan_sdio = {
#endif
#endif
}
}
#else
#ifdef SDIO_SUSPEND_RESUME
#ifdef MMC_PM_KEEP_POWER
.drv = {
.pm = &wlan_sdio_pm_ops,
.shutdown = woal_sdio_shutdown,
}
}
#endif
#endif
#endif
};
// clang-format on
/********************************************************
Local Functions
@ -168,22 +171,22 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle);
* @param handle A Pointer to the moal_handle structure
* @return N/A
*/
void
woal_dump_sdio_reg(moal_handle *handle)
void woal_dump_sdio_reg(moal_handle *handle)
{
int ret = 0;
t_u8 data, i;
int fun0_reg[] = { 0x05, 0x04 };
int fun0_reg[] = {0x05, 0x04};
t_u8 array_size = 0;
#ifdef SD8897
int fun1_reg_8897[] = { 0x03, 0x04, 0x05, 0x06, 0x07, 0xC0, 0xC1 };
int fun1_reg_8897[] = {0x03, 0x04, 0x05, 0x06, 0x07, 0xC0, 0xC1};
#endif
int fun1_reg_other[] = { 0x03, 0x04, 0x05, 0x60, 0x61 };
int fun1_reg_other[] = {0x03, 0x04, 0x05, 0x60, 0x61};
int *fun1_reg = NULL;
for (i = 0; i < ARRAY_SIZE(fun0_reg); i++) {
data = sdio_f0_readb(((struct sdio_mmc_card *)handle->card)->
func, fun0_reg[i], &ret);
data = sdio_f0_readb(
((struct sdio_mmc_card *)handle->card)->func,
fun0_reg[i], &ret);
PRINTM(MMSG, "fun0: reg 0x%02x=0x%02x ret=%d\n", fun0_reg[i],
data, ret);
}
@ -207,7 +210,6 @@ woal_dump_sdio_reg(moal_handle *handle)
}
return;
}
/********************************************************
Global Functions
********************************************************/
@ -217,8 +219,7 @@ woal_dump_sdio_reg(moal_handle *handle)
* @param func A pointer to the sdio_func structure
* @return N/A
*/
static void
woal_sdio_interrupt(struct sdio_func *func)
static void woal_sdio_interrupt(struct sdio_func *func)
{
moal_handle *handle;
struct sdio_mmc_card *card;
@ -265,8 +266,7 @@ woal_sdio_interrupt(struct sdio_func *func)
*
* @return N/A
*/
static t_u16
woal_update_card_type(t_void *card)
static t_u16 woal_update_card_type(t_void *card)
{
struct sdio_mmc_card *cardp_sd = (struct sdio_mmc_card *)card;
t_u16 card_type = 0;
@ -277,10 +277,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD8887;
moal_memcpy_ext(NULL, driver_version, CARD_SD8887,
strlen(CARD_SD8887), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V15, strlen(V15),
strlen(driver_version) -
moal_memcpy_ext(
NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
V15, strlen(V15),
strlen(driver_version) -
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
}
#endif
@ -289,10 +291,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD8897;
moal_memcpy_ext(NULL, driver_version, CARD_SD8897,
strlen(CARD_SD8897), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V15, strlen(V15),
strlen(driver_version) -
moal_memcpy_ext(
NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
V15, strlen(V15),
strlen(driver_version) -
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
}
#endif
@ -301,10 +305,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD8977;
moal_memcpy_ext(NULL, driver_version, CARD_SD8977,
strlen(CARD_SD8977), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V16, strlen(V16),
strlen(driver_version) -
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
@ -313,10 +319,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD8978;
moal_memcpy_ext(NULL, driver_version, CARD_SD8978,
strlen(CARD_SD8978), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V16, strlen(V16),
strlen(driver_version) -
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
@ -325,10 +333,12 @@ woal_update_card_type(t_void *card)
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),
strlen(driver_version) -
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
@ -337,10 +347,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD8987;
moal_memcpy_ext(NULL, driver_version, CARD_SD8987,
strlen(CARD_SD8987), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V16, strlen(V16),
strlen(driver_version) -
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
@ -349,10 +361,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD9097;
moal_memcpy_ext(NULL, driver_version, CARD_SD9097,
strlen(CARD_SD9097), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V17, strlen(V17),
strlen(driver_version) -
moal_memcpy_ext(
NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
V17, strlen(V17),
strlen(driver_version) -
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
}
#endif
@ -362,10 +376,12 @@ woal_update_card_type(t_void *card)
card_type = CARD_TYPE_SD9098;
moal_memcpy_ext(NULL, driver_version, CARD_SD9098,
strlen(CARD_SD9098), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V17, strlen(V17),
strlen(driver_version) -
moal_memcpy_ext(
NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
V17, strlen(V17),
strlen(driver_version) -
(strlen(INTF_CARDTYPE) + strlen(KERN_VERSION)));
}
#endif
@ -378,8 +394,7 @@ woal_update_card_type(t_void *card)
* @param id A pointer to sdio_device_id structure.
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE/error code
*/
int
woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
{
int ret = MLAN_STATUS_SUCCESS;
struct sdio_mmc_card *card = NULL;
@ -457,8 +472,7 @@ err:
* @param func A pointer to sdio_func structure.
* @return N/A
*/
void
woal_sdio_remove(struct sdio_func *func)
void woal_sdio_remove(struct sdio_func *func)
{
struct sdio_mmc_card *card;
@ -484,30 +498,28 @@ woal_sdio_remove(struct sdio_func *func)
* @param handle A Pointer to the moal_handle structure
* @return N/A
*/
void
woal_wlan_is_suspended(moal_handle *handle)
void woal_wlan_is_suspended(moal_handle *handle)
{
ENTER();
if (handle->suspend_notify_req == MTRUE) {
handle->is_suspended = MTRUE;
sdio_func_suspended(((struct sdio_mmc_card *)handle->card)->
func);
sdio_func_suspended(
((struct sdio_mmc_card *)handle->card)->func);
}
LEAVE();
}
#endif
#define SHUTDOWN_HOST_SLEEP_DEF_GAP 100
#define SHUTDOWN_HOST_SLEEP_DEF_GPIO 0x3
#define SHUTDOWN_HOST_SLEEP_DEF_COND 0x0
#define SHUTDOWN_HOST_SLEEP_DEF_GAP 100
#define SHUTDOWN_HOST_SLEEP_DEF_GPIO 0x3
#define SHUTDOWN_HOST_SLEEP_DEF_COND 0x0
/** @brief This function handles client driver shutdown
*
* @param dev A pointer to device structure
* @return N/A
*/
void
woal_sdio_shutdown(struct device *dev)
void woal_sdio_shutdown(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
moal_handle *handle = NULL;
@ -533,8 +545,8 @@ woal_sdio_shutdown(struct device *dev)
memset(&pm_info, 0, sizeof(pm_info));
for (i = 0; i < retry_num; i++) {
if (MLAN_STATUS_SUCCESS ==
woal_get_pm_info(woal_get_priv
(handle, MLAN_BSS_ROLE_ANY),
woal_get_pm_info(woal_get_priv(handle,
MLAN_BSS_ROLE_ANY),
&pm_info)) {
if (pm_info.is_suspend_allowed == MTRUE)
break;
@ -550,12 +562,9 @@ woal_sdio_shutdown(struct device *dev)
}
woal_enable_hs(woal_get_priv(handle, MLAN_BSS_ROLE_ANY));
timeout =
wait_event_interruptible_timeout(handle->
hs_activate_wait_q,
handle->
hs_activate_wait_q_woken,
HS_ACTIVE_TIMEOUT);
timeout = wait_event_interruptible_timeout(
handle->hs_activate_wait_q,
handle->hs_activate_wait_q_woken, HS_ACTIVE_TIMEOUT);
if (handle->hs_activated == MTRUE)
PRINTM(MMSG, "HS actived in shutdown\n");
else
@ -568,7 +577,7 @@ woal_sdio_shutdown(struct device *dev)
|| (GET_BSS_ROLE(handle->priv[i]) ==
MLAN_BSS_ROLE_UAP)
#endif
) {
) {
PRINTM(MIOCTL,
"disconnect on suspend\n");
woal_disconnect(handle->priv[i],
@ -590,8 +599,7 @@ done:
* @param dev A pointer to device structure
* @return MLAN_STATUS_SUCCESS or error code
*/
int
woal_sdio_suspend(struct device *dev)
int woal_sdio_suspend(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
mmc_pm_flag_t pm_flags = 0;
@ -607,13 +615,13 @@ woal_sdio_suspend(struct device *dev)
pm_flags = sdio_get_host_pm_caps(func);
PRINTM(MCMND, "%s: suspend: PM flags = 0x%x\n", sdio_func_id(func),
pm_flags);
cardp = sdio_get_drvdata(func);
if (!cardp || !cardp->handle) {
PRINTM(MERROR, "Card or moal_handle structure is not valid\n");
LEAVE();
return MLAN_STATUS_SUCCESS;
}
handle = cardp->handle;
if (moal_extflg_isset(handle, EXT_PM_KEEP_POWER) &&
@ -624,7 +632,6 @@ woal_sdio_suspend(struct device *dev)
LEAVE();
return -ENOSYS;
}
if (handle->is_suspended == MTRUE) {
PRINTM(MWARN, "Device already suspended\n");
LEAVE();
@ -670,9 +677,8 @@ woal_sdio_suspend(struct device *dev)
#ifdef MMC_PM_FUNC_SUSPENDED
handle->suspend_notify_req = MTRUE;
#endif
hs_actived =
woal_enable_hs(woal_get_priv
(handle, MLAN_BSS_ROLE_ANY));
hs_actived = woal_enable_hs(
woal_get_priv(handle, MLAN_BSS_ROLE_ANY));
#ifdef MMC_PM_FUNC_SUSPENDED
handle->suspend_notify_req = MFALSE;
#endif
@ -680,8 +686,9 @@ woal_sdio_suspend(struct device *dev)
#ifdef MMC_PM_SKIP_RESUME_PROBE
PRINTM(MCMND,
"suspend with MMC_PM_KEEP_POWER and MMC_PM_SKIP_RESUME_PROBE\n");
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER |
MMC_PM_SKIP_RESUME_PROBE);
ret = sdio_set_host_pm_flags(
func,
MMC_PM_KEEP_POWER | MMC_PM_SKIP_RESUME_PROBE);
#else
PRINTM(MCMND, "suspend with MMC_PM_KEEP_POWER\n");
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
@ -709,8 +716,7 @@ done:
* @param dev A pointer to device structure
* @return MLAN_STATUS_SUCCESS
*/
int
woal_sdio_resume(struct device *dev)
int woal_sdio_resume(struct device *dev)
{
struct sdio_func *func = dev_to_sdio_func(dev);
mmc_pm_flag_t pm_flags = 0;
@ -763,8 +769,8 @@ woal_sdio_resume(struct device *dev)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_sdiommc_write_reg(moal_handle *handle, t_u32 reg, t_u32 data)
static mlan_status woal_sdiommc_write_reg(moal_handle *handle, t_u32 reg,
t_u32 data)
{
mlan_status ret = MLAN_STATUS_FAILURE;
sdio_claim_host(((struct sdio_mmc_card *)handle->card)->func);
@ -783,8 +789,8 @@ woal_sdiommc_write_reg(moal_handle *handle, t_u32 reg, t_u32 data)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_sdiommc_read_reg(moal_handle *handle, t_u32 reg, t_u32 *data)
static mlan_status woal_sdiommc_read_reg(moal_handle *handle, t_u32 reg,
t_u32 *data)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 val;
@ -806,8 +812,7 @@ woal_sdiommc_read_reg(moal_handle *handle, t_u32 reg, t_u32 *data)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_sdio_writeb(moal_handle *handle, t_u32 reg, t_u8 data)
mlan_status woal_sdio_writeb(moal_handle *handle, t_u32 reg, t_u8 data)
{
mlan_status ret = MLAN_STATUS_FAILURE;
sdio_claim_host(((struct sdio_mmc_card *)handle->card)->func);
@ -826,8 +831,7 @@ woal_sdio_writeb(moal_handle *handle, t_u32 reg, t_u8 data)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_sdio_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
mlan_status woal_sdio_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 val;
@ -849,8 +853,7 @@ woal_sdio_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_sdio_f0_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
mlan_status woal_sdio_f0_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 val;
@ -873,9 +876,8 @@ woal_sdio_f0_readb(moal_handle *handle, t_u32 reg, t_u8 *data)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list, t_u32 port,
t_u8 write)
mlan_status woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list,
t_u32 port, t_u8 write)
{
struct scatterlist sg_list[SDIO_MP_AGGR_DEF_PKT_LIMIT_MAX];
int num_sg = pmbuf_list->use_count;
@ -917,8 +919,8 @@ woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list, t_u32 port,
mmc_cmd.opcode = SD_IO_RW_EXTENDED;
mmc_cmd.arg = write ? 1 << 31 : 0;
mmc_cmd.arg |= (func->num & 0x7) << 28;
mmc_cmd.arg |= 1 << 27; /* block basic */
mmc_cmd.arg |= 0; /* fix address */
mmc_cmd.arg |= 1 << 27; /* block basic */
mmc_cmd.arg |= 0; /* fix address */
mmc_cmd.arg |= (ioport & 0x1FFFF) << 9;
mmc_cmd.arg |= blkcnt & 0x1FF;
mmc_cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC;
@ -927,17 +929,17 @@ woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list, t_u32 port,
mmc_req.data = &mmc_dat;
sdio_claim_host(((struct sdio_mmc_card *)handle->card)->func);
mmc_set_data_timeout(&mmc_dat,
((struct sdio_mmc_card *)handle->card)->func->
card);
mmc_wait_for_req(((struct sdio_mmc_card *)handle->card)->func->card->
host, &mmc_req);
mmc_set_data_timeout(
&mmc_dat, ((struct sdio_mmc_card *)handle->card)->func->card);
mmc_wait_for_req(
((struct sdio_mmc_card *)handle->card)->func->card->host,
&mmc_req);
if (mmc_cmd.error || mmc_dat.error) {
PRINTM(MERROR, "CMD53 %s cmd_error = %d data_error=%d\n",
write ? "write" : "read", mmc_cmd.error, mmc_dat.error);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
/* issue abort cmd52 command through F0 */
/* issue abort cmd52 command through F0*/
sdio_f0_writeb(((struct sdio_mmc_card *)handle->card)->func,
0x01, SDIO_CCCR_ABORT, &status);
#endif
@ -958,19 +960,18 @@ woal_sdio_rw_mb(moal_handle *handle, pmlan_buffer pmbuf_list, t_u32 port,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_sdiommc_write_data_sync(moal_handle *handle, mlan_buffer *pmbuf,
t_u32 port, t_u32 timeout)
static mlan_status woal_sdiommc_write_data_sync(moal_handle *handle,
mlan_buffer *pmbuf, t_u32 port,
t_u32 timeout)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 *buffer = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode =
(port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blkcnt =
(blkmode ==
BLOCK_MODE) ? (pmbuf->data_len /
MLAN_SDIO_BLOCK_SIZE) : pmbuf->data_len;
t_u32 blkcnt = (blkmode == BLOCK_MODE) ?
(pmbuf->data_len / MLAN_SDIO_BLOCK_SIZE) :
pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
int status = 0;
if (pmbuf->use_count > 1)
@ -986,7 +987,7 @@ woal_sdiommc_write_data_sync(moal_handle *handle, mlan_buffer *pmbuf,
else {
PRINTM(MERROR, "cmd53 write error=%d\n", status);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
/* issue abort cmd52 command through F0 */
/* issue abort cmd52 command through F0*/
sdio_f0_writeb(((struct sdio_mmc_card *)handle->card)->func,
0x01, SDIO_CCCR_ABORT, &status);
#endif
@ -1008,19 +1009,18 @@ woal_sdiommc_write_data_sync(moal_handle *handle, mlan_buffer *pmbuf,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_sdiommc_read_data_sync(moal_handle *handle, mlan_buffer *pmbuf, t_u32 port,
t_u32 timeout)
static mlan_status woal_sdiommc_read_data_sync(moal_handle *handle,
mlan_buffer *pmbuf, t_u32 port,
t_u32 timeout)
{
mlan_status ret = MLAN_STATUS_FAILURE;
t_u8 *buffer = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
t_u8 blkmode =
(port & MLAN_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
t_u32 blksz = (blkmode == BLOCK_MODE) ? MLAN_SDIO_BLOCK_SIZE : 1;
t_u32 blkcnt =
(blkmode ==
BLOCK_MODE) ? (pmbuf->data_len /
MLAN_SDIO_BLOCK_SIZE) : pmbuf->data_len;
t_u32 blkcnt = (blkmode == BLOCK_MODE) ?
(pmbuf->data_len / MLAN_SDIO_BLOCK_SIZE) :
pmbuf->data_len;
t_u32 ioport = (port & MLAN_SDIO_IO_PORT_MASK);
int status = 0;
if (pmbuf->use_count > 1)
@ -1036,7 +1036,7 @@ woal_sdiommc_read_data_sync(moal_handle *handle, mlan_buffer *pmbuf, t_u32 port,
} else {
PRINTM(MERROR, "cmd53 read error=%d\n", status);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
/* issue abort cmd52 command through F0 */
/* issue abort cmd52 command through F0*/
sdio_f0_writeb(((struct sdio_mmc_card *)handle->card)->func,
0x01, SDIO_CCCR_ABORT, &status);
#endif
@ -1053,8 +1053,7 @@ woal_sdiommc_read_data_sync(moal_handle *handle, mlan_buffer *pmbuf, t_u32 port,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_sdiommc_bus_register(void)
mlan_status woal_sdiommc_bus_register(void)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -1076,8 +1075,7 @@ woal_sdiommc_bus_register(void)
*
* @return N/A
*/
void
woal_sdiommc_bus_unregister(void)
void woal_sdiommc_bus_unregister(void)
{
ENTER();
@ -1093,8 +1091,7 @@ woal_sdiommc_bus_unregister(void)
* @param handle A pointer to moal_handle structure
* @return N/A
*/
static void
woal_sdiommc_unregister_dev(moal_handle *handle)
static void woal_sdiommc_unregister_dev(moal_handle *handle)
{
ENTER();
if (handle->card) {
@ -1120,8 +1117,7 @@ woal_sdiommc_unregister_dev(moal_handle *handle)
* @param handle A pointer to moal_handle structure
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_sdiommc_register_dev(moal_handle *handle)
static mlan_status woal_sdiommc_register_dev(moal_handle *handle)
{
int ret = MLAN_STATUS_SUCCESS;
struct sdio_mmc_card *card = handle->card;
@ -1172,8 +1168,7 @@ release_host:
* @param option TRUE--on , FALSE--off
* @return MLAN_STATUS_SUCCESS
*/
int
woal_sdio_set_bus_clock(moal_handle *handle, t_u8 option)
int woal_sdio_set_bus_clock(moal_handle *handle, t_u8 option)
{
struct sdio_mmc_card *cardp = (struct sdio_mmc_card *)handle->card;
struct mmc_host *host = cardp->func->card->host;
@ -1196,7 +1191,8 @@ woal_sdio_set_bus_clock(moal_handle *handle, t_u8 option)
}
/**
* @brief This function updates card reg based on the Cmd52 value in dev structure
* @brief This function updates card reg based on the Cmd52 value in dev
* structure
*
* @param handle A pointer to moal_handle structure
* @param func A pointer to store func variable
@ -1204,8 +1200,7 @@ woal_sdio_set_bus_clock(moal_handle *handle, t_u8 option)
* @param val A pointer to store val variable
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
int
woal_sdio_read_write_cmd52(moal_handle *handle, int func, int reg, int val)
int woal_sdio_read_write_cmd52(moal_handle *handle, int func, int reg, int val)
{
int ret = MLAN_STATUS_SUCCESS;
struct sdio_mmc_card *card = (struct sdio_mmc_card *)handle->card;
@ -1258,8 +1253,7 @@ woal_sdio_read_write_cmd52(moal_handle *handle, int func, int reg, int val)
* @return MTRUE/MFALSE
*
*/
static t_u8
woal_sdiommc_is_second_mac(moal_handle *handle)
static t_u8 woal_sdiommc_is_second_mac(moal_handle *handle)
{
#ifdef SD9098
struct sdio_mmc_card *card = (struct sdio_mmc_card *)handle->card;
@ -1269,8 +1263,7 @@ woal_sdiommc_is_second_mac(moal_handle *handle)
return MFALSE;
}
static mlan_status
woal_sdiommc_get_fw_name(moal_handle *handle)
static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef SD9098
@ -1279,7 +1272,8 @@ 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(SD8978)
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || \
defined(SD9097) || defined(SD8978)
t_u32 magic_reg = handle->card_info->magic_reg;
t_u32 magic = 0;
t_u32 host_strap_reg = handle->card_info->host_strap_reg;
@ -1290,14 +1284,15 @@ woal_sdiommc_get_fw_name(moal_handle *handle)
if (handle->params.fw_name)
goto done;
/** Revision ID register */
/** Revision ID register */
woal_sdiommc_read_reg(handle, rev_id_reg, &revision_id);
PRINTM(MCMND, "revision_id=0x%x\n", revision_id);
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || defined(SD9097) || defined(SD8978)
/** Revision ID register */
#if defined(SD8987) || defined(SD8997) || defined(SD9098) || \
defined(SD9097) || defined(SD8978)
/** Revision ID register */
woal_sdiommc_read_reg(handle, magic_reg, &magic);
/** Revision ID register */
/** Revision ID register */
woal_sdiommc_read_reg(handle, host_strap_reg, &strap);
strap &= 0x1;
magic &= 0xFF;
@ -1404,6 +1399,7 @@ woal_sdiommc_get_fw_name(moal_handle *handle)
break;
case SD9098_A0:
case SD9098_A1:
case SD9098_A2:
if (magic == CHIP_MAGIC_VALUE) {
if (strap == CARD_TYPE_SD_UART)
strcpy(handle->card_info->fw_name,
@ -1448,9 +1444,9 @@ done:
return ret;
}
#define DEBUG_FW_DONE 0xFF
#define DEBUG_MEMDUMP_FINISH 0xFE
#define MAX_POLL_TRIES 100
#define DEBUG_FW_DONE 0xFF
#define DEBUG_MEMDUMP_FINISH 0xFE
#define MAX_POLL_TRIES 100
typedef enum {
DUMP_TYPE_ITCM = 0,
@ -1470,8 +1466,8 @@ typedef enum {
DUMP_TYPE_EXTEND_LAST = 14
} dumped_mem_type;
#define MAX_NAME_LEN 8
#define MAX_FULL_NAME_LEN 32
#define MAX_NAME_LEN 8
#define MAX_FULL_NAME_LEN 32
typedef struct {
t_u8 mem_name[MAX_NAME_LEN];
@ -1498,8 +1494,8 @@ memory_type_mapping mem_type_mapping_tbl[] = {
{"EXT13", NULL, NULL, 0xFD, 0},
{"EXTLAST", NULL, NULL, 0xFE, 0},
};
memory_type_mapping mem_type_mapping_tbl_8977_8997 =
{ "DUMP", NULL, NULL, 0xDD, 0 };
memory_type_mapping mem_type_mapping_tbl_8977_8997 = {"DUMP", NULL, NULL, 0xDD,
0};
typedef enum {
RDWR_STATUS_SUCCESS = 0,
@ -1515,8 +1511,7 @@ typedef enum {
*
* @return MLAN_STATUS_SUCCESS
*/
rdwr_status
woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
rdwr_status woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
{
int ret = 0;
int tries = 0;
@ -1565,10 +1560,8 @@ woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
*
* @return N/A
*/
void
woal_dump_firmware_info_v2(moal_handle *phandle)
void woal_dump_firmware_info_v2(moal_handle *phandle)
{
int ret = 0;
unsigned int reg, reg_start, reg_end;
t_u8 *dbg_ptr = NULL;
@ -1582,16 +1575,21 @@ woal_dump_firmware_info_v2(moal_handle *phandle)
t_u32 memory_size = 0;
t_u8 path_name[64], file_name[32], firmware_dump_file[128];
t_u8 *end_ptr = NULL;
t_u8 dbg_dump_start_reg = phandle->card_info->dump_fw_start_reg;
t_u8 dbg_dump_end_reg = phandle->card_info->dump_fw_end_reg;
t_u8 dbg_dump_ctrl_reg = phandle->card_info->dump_fw_ctrl_reg;
t_u8 dbg_dump_start_reg = 0;
t_u8 dbg_dump_end_reg = 0;
t_u8 dbg_dump_ctrl_reg = 0;
if (!phandle) {
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
dbg_dump_start_reg = phandle->card_info->dump_fw_start_reg;
dbg_dump_end_reg = phandle->card_info->dump_fw_end_reg;
dbg_dump_ctrl_reg = phandle->card_info->dump_fw_ctrl_reg;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/** Create dump directort*/
/** Create dump directort*/
woal_create_dump_dir(phandle, path_name, sizeof(path_name));
#else
memset(path_name, 0, sizeof(path_name));
@ -1643,9 +1641,9 @@ woal_dump_firmware_info_v2(moal_handle *phandle)
} else {
PRINTM(MMSG, "%s_SIZE=0x%x\n",
mem_type_mapping_tbl[idx].mem_name, memory_size);
ret = moal_vmalloc(phandle, memory_size + 1,
(t_u8 **)&mem_type_mapping_tbl[idx].
mem_Ptr);
ret = moal_vmalloc(
phandle, memory_size + 1,
(t_u8 **)&mem_type_mapping_tbl[idx].mem_Ptr);
if ((ret != MLAN_STATUS_SUCCESS) ||
!mem_type_mapping_tbl[idx].mem_Ptr) {
PRINTM(MERROR,
@ -1679,24 +1677,24 @@ woal_dump_firmware_info_v2(moal_handle *phandle)
"pre-allocced buf is not enough\n");
}
if (RDWR_STATUS_DONE == stat) {
PRINTM(MMSG, "%s done:"
PRINTM(MMSG,
"%s done:"
#ifdef MLAN_64BIT
"size = 0x%lx\n",
#else
"size = 0x%x\n",
#endif
mem_type_mapping_tbl[idx].mem_name,
dbg_ptr -
mem_type_mapping_tbl[idx].mem_Ptr);
dbg_ptr - mem_type_mapping_tbl[idx]
.mem_Ptr);
memset(file_name, 0, sizeof(file_name));
sprintf(file_name, "%s%s", "file_sdio_",
mem_type_mapping_tbl[idx].mem_name);
if (MLAN_STATUS_SUCCESS !=
woal_save_dump_info_to_file(path_name,
file_name,
mem_type_mapping_tbl
[idx].mem_Ptr,
memory_size))
woal_save_dump_info_to_file(
path_name, file_name,
mem_type_mapping_tbl[idx].mem_Ptr,
memory_size))
PRINTM(MERROR,
"Can't save dump file %s in %s\n",
file_name, path_name);
@ -1733,10 +1731,8 @@ done:
*
* @return N/A
*/
void
woal_dump_firmware_info_v3(moal_handle *phandle)
void woal_dump_firmware_info_v3(moal_handle *phandle)
{
int ret = 0;
int tries = 0;
unsigned int reg, reg_start, reg_end;
@ -1750,8 +1746,8 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
t_u8 path_name[64], file_name[32], firmware_dump_file[128];
moal_handle *ref_handle;
t_u8 *end_ptr = NULL;
t_u8 dbg_dump_start_reg = phandle->card_info->dump_fw_start_reg;
t_u8 dbg_dump_end_reg = phandle->card_info->dump_fw_end_reg;
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;
@ -1759,8 +1755,12 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
dbg_dump_start_reg = phandle->card_info->dump_fw_start_reg;
dbg_dump_end_reg = phandle->card_info->dump_fw_end_reg;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/** Create dump directort*/
/** Create dump directort*/
woal_create_dump_dir(phandle, path_name, sizeof(path_name));
#else
memset(path_name, 0, sizeof(path_name));
@ -1779,7 +1779,7 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
if (RDWR_STATUS_FAILURE == woal_cmd52_rdwr_firmware(phandle, doneflag))
goto done;
/** check the reg which indicate dump starting */
/** check the reg which indicate dump starting */
for (reg = dbg_dump_start_reg; reg <= dbg_dump_end_reg; reg++) {
for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
ret = woal_sdio_readb(phandle, reg, &start_flag);
@ -1787,7 +1787,7 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
PRINTM(MMSG, "SDIO READ ERR\n");
goto done;
}
/** 0 means dump starting*/
/** 0 means dump starting*/
if (start_flag == 0)
break;
udelay(100);
@ -1796,7 +1796,6 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
PRINTM(MMSG, "FW not ready to dump\n");
goto done;
}
}
memory_size = 0xF0000;
PRINTM(MMSG, "%s_SIZE=0x%x\n", pmem_type_mapping_tbl->mem_name,
@ -1846,17 +1845,16 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
pmem_type_mapping_tbl->mem_Ptr);
pmem_type_mapping_tbl->mem_Ptr = temp_Ptr;
temp_Ptr = NULL;
dbg_ptr =
pmem_type_mapping_tbl->mem_Ptr +
memory_size;
dbg_ptr = pmem_type_mapping_tbl->mem_Ptr +
memory_size;
memory_size += 0x4000;
end_ptr =
pmem_type_mapping_tbl->mem_Ptr +
memory_size;
end_ptr = pmem_type_mapping_tbl->mem_Ptr +
memory_size;
}
}
if (RDWR_STATUS_DONE == stat) {
PRINTM(MMSG, "%s done:"
PRINTM(MMSG,
"%s done:"
#ifdef MLAN_64BIT
"size = 0x%lx\n",
#else
@ -1868,12 +1866,10 @@ woal_dump_firmware_info_v3(moal_handle *phandle)
sprintf(file_name, "%s%s", "file_sdio_",
pmem_type_mapping_tbl->mem_name);
if (MLAN_STATUS_SUCCESS !=
woal_save_dump_info_to_file(path_name, file_name,
pmem_type_mapping_tbl->
mem_Ptr,
dbg_ptr -
pmem_type_mapping_tbl->
mem_Ptr))
woal_save_dump_info_to_file(
path_name, file_name,
pmem_type_mapping_tbl->mem_Ptr,
dbg_ptr - pmem_type_mapping_tbl->mem_Ptr))
PRINTM(MERROR,
"Can't save dump file %s in %s\n",
file_name, path_name);
@ -1906,8 +1902,7 @@ done:
*
* @return N/A
*/
static void
woal_sdiommc_reg_dbg(moal_handle *phandle)
static void woal_sdiommc_reg_dbg(moal_handle *phandle)
{
int ret = 0;
t_u8 loop, index = 0, func, data;
@ -1980,8 +1975,7 @@ woal_sdiommc_reg_dbg(moal_handle *phandle)
*
* @return N/A
*/
static void
woal_sdiommc_dump_fw_info(moal_handle *phandle)
static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
{
if (!phandle) {
PRINTM(MERROR, "Could not dump firmwware info\n");
@ -2008,16 +2002,15 @@ woal_sdiommc_dump_fw_info(moal_handle *phandle)
*
* @return The length of this log
*/
static int
woal_sdiommc_dump_reg_info(moal_handle *phandle, t_u8 *drv_buf)
static int woal_sdiommc_dump_reg_info(moal_handle *phandle, t_u8 *drv_buf)
{
char *drv_ptr = (char *)drv_buf;
int ret = 0;
t_u8 loop, index = 0, func, data;
unsigned int reg, reg_start, reg_end;
unsigned int scratch_reg = phandle->card_info->scratch_reg;
t_u8 *reg_table = phandle->card_info->dump_reg.reg_table;
t_u8 reg_table_size = phandle->card_info->dump_reg.reg_table_size;
unsigned int scratch_reg = 0;
t_u8 *reg_table = NULL;
t_u8 reg_table_size = 0;
char buf[256], *ptr;
ENTER();
@ -2027,6 +2020,11 @@ woal_sdiommc_dump_reg_info(moal_handle *phandle, t_u8 *drv_buf)
LEAVE();
return 0;
}
scratch_reg = phandle->card_info->scratch_reg;
reg_table = phandle->card_info->dump_reg.reg_table;
reg_table_size = phandle->card_info->dump_reg.reg_table_size;
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
drv_ptr += sprintf(drv_ptr, "--------sdio_reg_debug_info---------\n");

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,40 @@
/** @file moal_shim.h
*
* @brief This file contains declaration referring to
* functions defined in moal module
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains declaration referring to
* functions defined in moal module
*
*
* Copyright 2014-2020 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.
*
*/
/*************************************************************
Change Log:
10/21/2008: initial version
************************************************************/
* Change Log:
* 10/21/2008: initial version
************************************************************/
#ifndef _MOAL_H
#define _MOAL_H
mlan_status moal_get_fw_data(IN t_void *pmoal_handle,
IN t_u32 offset, IN t_u32 len, OUT t_u8 *pbuf);
mlan_status moal_get_vdll_data(IN t_void *pmoal_handle,
IN t_u32 len, OUT t_u8 *pbuf);
mlan_status moal_get_fw_data(IN t_void *pmoal_handle, IN t_u32 offset,
IN t_u32 len, OUT t_u8 *pbuf);
mlan_status moal_get_vdll_data(IN t_void *pmoal_handle, IN t_u32 len,
OUT t_u8 *pbuf);
mlan_status moal_get_hw_spec_complete(IN t_void *pmoal_handle,
IN mlan_status status,
IN mlan_hw_info * phw,
IN mlan_hw_info *phw,
IN pmlan_bss_tbl ptbl);
mlan_status moal_init_fw_complete(IN t_void *pmoal_handle,
IN mlan_status status);
@ -51,8 +51,7 @@ mlan_status moal_send_packet_complete(IN t_void *pmoal_handle,
IN pmlan_buffer pmbuf,
IN mlan_status status);
#ifdef USB
mlan_status moal_recv_complete(IN t_void *pmoal_handle,
IN pmlan_buffer pmbuf,
mlan_status moal_recv_complete(IN t_void *pmoal_handle, IN pmlan_buffer pmbuf,
IN t_u32 port, IN mlan_status status);
mlan_status moal_write_data_async(IN t_void *pmoal_handle,
IN pmlan_buffer pmbuf, IN t_u32 port);
@ -60,53 +59,47 @@ mlan_status moal_write_data_async(IN t_void *pmoal_handle,
#if defined(SDIO) || defined(PCIE)
/** moal_write_reg */
mlan_status moal_write_reg(IN t_void *pmoal_handle,
IN t_u32 reg, IN t_u32 data);
mlan_status moal_write_reg(IN t_void *pmoal_handle, IN t_u32 reg,
IN t_u32 data);
/** moal_read_reg */
mlan_status moal_read_reg(IN t_void *pmoal_handle,
IN t_u32 reg, OUT t_u32 *data);
mlan_status moal_read_reg(IN t_void *pmoal_handle, IN t_u32 reg,
OUT t_u32 *data);
#endif /* SDIO || PCIE */
mlan_status moal_write_data_sync(IN t_void *pmoal_handle,
IN pmlan_buffer pmbuf,
mlan_status moal_write_data_sync(IN t_void *pmoal_handle, IN pmlan_buffer pmbuf,
IN t_u32 port, IN t_u32 timeout);
mlan_status moal_read_data_sync(IN t_void *pmoal_handle,
IN OUT pmlan_buffer pmbuf,
IN t_u32 port, IN t_u32 timeout);
IN OUT pmlan_buffer pmbuf, IN t_u32 port,
IN t_u32 timeout);
mlan_status moal_recv_packet(IN t_void *pmoal_handle, IN pmlan_buffer pmbuf);
mlan_status moal_recv_event(IN t_void *pmoal_handle, IN pmlan_event pmevent);
mlan_status moal_malloc(IN t_void *pmoal_handle,
IN t_u32 size, IN t_u32 flag, OUT t_u8 **ppbuf);
mlan_status moal_malloc(IN t_void *pmoal_handle, IN t_u32 size, IN t_u32 flag,
OUT t_u8 **ppbuf);
mlan_status moal_mfree(IN t_void *pmoal_handle, IN t_u8 *pbuf);
mlan_status moal_vmalloc(IN t_void *pmoal_handle,
IN t_u32 size, OUT t_u8 **ppbuf);
mlan_status moal_vmalloc(IN t_void *pmoal_handle, IN t_u32 size,
OUT t_u8 **ppbuf);
mlan_status moal_vfree(IN t_void *pmoal_handle, IN t_u8 *pbuf);
#ifdef PCIE
mlan_status moal_malloc_consistent(IN t_void *pmoal_handle,
IN t_u32 size,
mlan_status moal_malloc_consistent(IN t_void *pmoal_handle, IN t_u32 size,
OUT t_u8 **ppbuf, OUT t_u64 *pbuf_pa);
mlan_status moal_mfree_consistent(IN t_void *pmoal_handle,
IN t_u32 size,
mlan_status moal_mfree_consistent(IN t_void *pmoal_handle, IN t_u32 size,
IN t_u8 *pbuf, IN t_u64 buf_pa);
mlan_status moal_map_memory(IN t_void *pmoal_handle,
IN t_u8 *pbuf,
mlan_status moal_map_memory(IN t_void *pmoal_handle, IN t_u8 *pbuf,
OUT t_u64 *pbuf_pa, IN t_u32 size, IN t_u32 flag);
mlan_status moal_unmap_memory(IN t_void *pmoal_handle,
IN t_u8 *pbuf,
mlan_status moal_unmap_memory(IN t_void *pmoal_handle, IN t_u8 *pbuf,
IN t_u64 buf_pa, IN t_u32 size, IN t_u32 flag);
#endif /* PCIE */
t_void *moal_memset(IN t_void *pmoal_handle,
IN t_void *pmem, IN t_u8 byte, IN t_u32 num);
t_void *moal_memcpy(IN t_void *pmoal_handle,
IN t_void *pdest, IN const t_void *psrc, IN t_u32 num);
t_void *moal_memcpy_ext(IN t_void *pmoal_handle,
IN t_void *pdest,
IN const t_void *psrc,
IN t_u32 num, IN t_u32 dest_size);
t_void *moal_memset(IN t_void *pmoal_handle, IN t_void *pmem, IN t_u8 byte,
IN t_u32 num);
t_void *moal_memcpy(IN t_void *pmoal_handle, IN t_void *pdest,
IN const t_void *psrc, IN t_u32 num);
t_void *moal_memcpy_ext(IN t_void *pmoal_handle, IN t_void *pdest,
IN const t_void *psrc, IN t_u32 num,
IN t_u32 dest_size);
t_void *moal_memmove(IN t_void *pmoal_handle,
IN t_void *pdest, IN const t_void *psrc, IN t_u32 num);
t_s32 moal_memcmp(IN t_void *pmoal_handle,
IN const t_void *pmem1, IN const t_void *pmem2, IN t_u32 num);
t_void *moal_memmove(IN t_void *pmoal_handle, IN t_void *pdest,
IN const t_void *psrc, IN t_u32 num);
t_s32 moal_memcmp(IN t_void *pmoal_handle, IN const t_void *pmem1,
IN const t_void *pmem2, IN t_u32 num);
/** moal_udelay */
t_void moal_udelay(IN t_void *pmoal_handle, IN t_u32 udelay);
mlan_status moal_get_boot_ktime(IN t_void *pmoal_handle, OUT t_u64 *pnsec);
@ -123,7 +116,7 @@ mlan_status moal_notify_hostcmd_complete(IN t_void *pmoal_handle,
IN t_u32 bss_index);
#endif
t_void moal_print(IN t_void *pmoal_handle, IN t_u32 level, IN char *pformat,
IN ...);
IN...);
t_void moal_print_netintf(IN t_void *pmoal_handle, IN t_u32 bss_index,
IN t_u32 level);
t_void moal_assert(IN t_void *pmoal_handle, IN t_u32 cond);
@ -133,13 +126,11 @@ t_void moal_hist_data_add(IN t_void *pmoal_handle, IN t_u32 bss_index,
t_u64 moal_do_div(IN t_u64 num, IN t_u32 base);
mlan_status moal_init_timer(IN t_void *pmoal_handle,
OUT t_void **pptimer,
IN t_void (*callback) (t_void *pcontext),
mlan_status moal_init_timer(IN t_void *pmoal_handle, OUT t_void **pptimer,
IN t_void (*callback)(t_void *pcontext),
IN t_void *pcontext);
mlan_status moal_free_timer(IN t_void *pmoal_handle, IN t_void *ptimer);
mlan_status moal_start_timer(IN t_void *pmoal_handle,
IN t_void *ptimer,
mlan_status moal_start_timer(IN t_void *pmoal_handle, IN t_void *ptimer,
IN t_u8 periodic, IN t_u32 msec);
mlan_status moal_stop_timer(IN t_void *pmoal_handle, IN t_void *ptimer);

View File

@ -1,43 +1,41 @@
/** @file moal_sta_cfg80211.h
*
* @brief This file contains the STA CFG80211 specific defines.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains the STA CFG80211 specific defines.
*
*
* Copyright 2014-2020 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_STA_CFG80211_H_
#define _MOAL_STA_CFG80211_H_
/** Convert RSSI signal strength from dBm to mBm (100*dBm) */
#define RSSI_DBM_TO_MDM(x) ((x) * 100)
#define RSSI_DBM_TO_MDM(x) ((x)*100)
mlan_status woal_register_sta_cfg80211(struct net_device *dev, t_u8 bss_type);
mlan_status
mlan_status woal_cfg80211_set_key(moal_private *priv, t_u8 is_enable_wep,
t_u32 cipher, const t_u8 *key, int key_len,
const t_u8 *seq, int seq_len, t_u8 key_index,
const t_u8 *addr, int disable,
t_u8 wait_option);
woal_cfg80211_set_key(moal_private *priv, t_u8 is_enable_wep,
t_u32 cipher, const t_u8 *key, int key_len,
const t_u8 *seq, int seq_len, t_u8 key_index,
const t_u8 *addr, int disable, t_u8 wait_option);
mlan_status
woal_cfg80211_set_wep_keys(moal_private *priv, const t_u8 *key, int key_len,
t_u8 index, t_u8 wait_option);
mlan_status woal_cfg80211_set_wep_keys(moal_private *priv, const t_u8 *key,
int key_len, t_u8 index,
t_u8 wait_option);
#endif /* _MOAL_STA_CFG80211_H_ */

View File

@ -1,24 +1,24 @@
/** @file moal_uap.h
*
* @brief This file contains uap driver specific defines etc.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains uap driver specific defines etc.
*
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
@ -29,149 +29,149 @@ Change log:
#define _MOAL_UAP_H
/** Maximum buffer length for WOAL_UAP_SET_GET_256_CHAR */
#define MAX_BUF_LEN 256
#define MAX_BUF_LEN 256
/** Private command ID to send ioctl */
#define UAP_IOCTL_CMD (SIOCDEVPRIVATE + 2)
#define UAP_IOCTL_CMD (SIOCDEVPRIVATE + 2)
/** Updating ADDBA variables */
#define UAP_ADDBA_PARA 0
#define UAP_ADDBA_PARA 0
/** Updating priority table for AMPDU/AMSDU */
#define UAP_AGGR_PRIOTBL 1
#define UAP_AGGR_PRIOTBL 1
/** Updating addbareject table */
#define UAP_ADDBA_REJECT 2
#define UAP_ADDBA_REJECT 2
/** Get FW INFO */
#define UAP_FW_INFO 4
#define UAP_FW_INFO 4
/** Updating Deep sleep variables */
#define UAP_DEEP_SLEEP 3
#define UAP_DEEP_SLEEP 3
/** Tx data pause subcommand */
#define UAP_TX_DATA_PAUSE 5
#define UAP_TX_DATA_PAUSE 5
#ifdef SDIO
/** sdcmd52 read write subcommand */
#define UAP_SDCMD52_RW 6
#define UAP_SDCMD52_RW 6
#endif
/** snmp mib subcommand */
#define UAP_SNMP_MIB 7
#define UAP_SNMP_MIB 7
/** domain info subcommand */
#define UAP_DOMAIN_INFO 8
#define UAP_DOMAIN_INFO 8
/** TX beamforming configuration */
#define UAP_TX_BF_CFG 9
#define UAP_TX_BF_CFG 9
/** dfs testing subcommand */
#define UAP_DFS_TESTING 10
#define UAP_DFS_TESTING 10
/** sub command ID to set/get Host Sleep configuration */
#define UAP_HS_CFG 11
#define UAP_HS_CFG 11
/** sub command ID to set/get Host Sleep Parameters */
#define UAP_HS_SET_PARA 12
#define UAP_HS_SET_PARA 12
/** Management Frame Control Mask */
#define UAP_MGMT_FRAME_CONTROL 13
#define UAP_MGMT_FRAME_CONTROL 13
#define UAP_TX_RATE_CFG 14
#define UAP_TX_RATE_CFG 14
/** Subcommand ID to set/get antenna configuration */
#define UAP_ANTENNA_CFG 15
#define UAP_ANTENNA_CFG 15
#define UAP_DFS_REPEATER_MODE 16
#define UAP_DFS_REPEATER_MODE 16
#define UAP_CAC_TIMER_STATUS 17
#define UAP_CAC_TIMER_STATUS 17
/** Skip CAC */
#define UAP_SKIP_CAC 18
#define UAP_SKIP_CAC 18
#define UAP_HT_TX_CFG 19
#define UAP_HT_TX_CFG 19
#define UAP_VHT_CFG 20
#define UAP_VHT_CFG 20
#define UAP_HT_STREAM_CFG 21
#define UAP_HT_STREAM_CFG 21
#define UAP_OPERATION_CTRL 22
#define UAP_OPERATION_CTRL 22
#define UAP_CHAN_SWITCH_COUNT_CFG 23
#define UAP_BAND_STEER 24
#define UAP_CHAN_SWITCH_COUNT_CFG 23
#define UAP_BAND_STEER 24
/** Private command ID to Power Mode */
#define UAP_POWER_MODE (SIOCDEVPRIVATE + 3)
#define UAP_POWER_MODE (SIOCDEVPRIVATE + 3)
/** Private command id to start/stop/reset bss */
#define UAP_BSS_CTRL (SIOCDEVPRIVATE + 4)
#define UAP_BSS_CTRL (SIOCDEVPRIVATE + 4)
/** BSS START */
#define UAP_BSS_START 0
#define UAP_BSS_START 0
/** BSS STOP */
#define UAP_BSS_STOP 1
#define UAP_BSS_STOP 1
/** BSS RESET */
#define UAP_BSS_RESET 2
#define UAP_BSS_RESET 2
/** wapi_msg */
typedef struct _wapi_msg {
/** message type */
/** message type */
t_u16 msg_type;
/** message len */
/** message len */
t_u16 msg_len;
/** message */
/** message */
t_u8 msg[96];
} wapi_msg;
/* wapi key msg */
typedef struct _wapi_key_msg {
/** mac address */
/** mac address */
t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
/** pad */
/** pad */
t_u8 pad;
/** key id */
/** key id */
t_u8 key_id;
/** key */
/** key */
t_u8 key[32];
} wapi_key_msg;
/** Private command ID to set wapi info */
#define UAP_WAPI_MSG (SIOCDEVPRIVATE + 10)
#define UAP_WAPI_MSG (SIOCDEVPRIVATE + 10)
/** set wapi flag */
#define P80211_PACKET_WAPIFLAG 0x0001
#define P80211_PACKET_WAPIFLAG 0x0001
/** set wapi key */
#define P80211_PACKET_SETKEY 0x0003
#define P80211_PACKET_SETKEY 0x0003
/** wapi mode psk */
#define WAPI_MODE_PSK 0x04
#define WAPI_MODE_PSK 0x04
/** wapi mode certificate */
#define WAPI_MODE_CERT 0x08
#define WAPI_MODE_CERT 0x08
typedef struct _tx_rate_cfg_t {
/** sub command */
/** sub command */
int subcmd;
/** Action */
/** Action */
int action;
/** Rate format */
/** Rate format */
int rate_format;
/** Rate configured */
/** Rate configured */
int rate;
/** nss */
/** nss */
int nss;
/** user_data_cnt */
/** user_data_cnt */
int user_data_cnt;
/** Rate bitmap */
/** Rate bitmap */
t_u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
/** Rate Setting */
/** Rate Setting */
t_u16 rate_setting;
} tx_rate_cfg_t;
/** ant_cfg structure */
typedef struct _ant_cfg_t {
/** Subcommand */
/** Subcommand */
int subcmd;
/** Action */
/** Action */
int action;
/** TX mode configured */
/** TX mode configured */
int tx_mode;
/** RX mode configured */
/** RX mode configured */
int rx_mode;
} ant_cfg_t;
/** htstream_cfg structure */
typedef struct _htstream_cfg_t {
/** Subcommand */
/** Subcommand */
int subcmd;
/** Action */
/** Action */
int action;
/** HT stream configuration */
/** HT stream configuration */
t_u32 stream_cfg;
} htstream_cfg_t;
@ -197,316 +197,318 @@ typedef struct _cac_timer_status {
/** skip_cac parameters */
typedef struct _skip_cac_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** enable/disable deepsleep*/
/** enable/disable deepsleep*/
t_u16 skip_cac;
} skip_cac_para;
/** radio control command */
#define UAP_RADIO_CTL (SIOCDEVPRIVATE + 5)
#define UAP_RADIO_CTL (SIOCDEVPRIVATE + 5)
/** Private command ID to BSS config */
#define UAP_BSS_CONFIG (SIOCDEVPRIVATE + 6)
#define UAP_BSS_CONFIG (SIOCDEVPRIVATE + 6)
/** deauth station */
#define UAP_STA_DEAUTH (SIOCDEVPRIVATE + 7)
#define UAP_STA_DEAUTH (SIOCDEVPRIVATE + 7)
/** enable UAP report mic error */
#define UAP_REPORT_MIC_ERR (SIOCDEVPRIVATE + 8)
#define UAP_REPORT_MIC_ERR (SIOCDEVPRIVATE + 8)
/** uap set key */
#define UAP_SET_KEY (SIOCDEVPRIVATE + 9)
#define UAP_SET_KEY (SIOCDEVPRIVATE + 9)
/** encrypt key */
typedef struct _encrypt_key {
/** Key index */
/** Key index */
t_u32 key_index;
/** Key length */
/** Key length */
t_u32 key_len;
/** Key */
/** Key */
t_u8 key_material[MLAN_MAX_KEY_LENGTH];
/** mac address */
/** mac address */
t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
} encrypt_key;
/** pkt_header */
typedef struct _pkt_header {
/** pkt_len */
/** pkt_len */
u32 pkt_len;
/** pkt_type */
/** pkt_type */
u32 TxPktType;
/** tx control */
/** tx control */
u32 TxControl;
} pkt_header;
/** uap get station list */
#define UAP_GET_STA_LIST (SIOCDEVPRIVATE + 11)
#define UAP_GET_STA_LIST (SIOCDEVPRIVATE + 11)
/** Packet inject command ioctl number */
#define UAPHOSTPKTINJECT WOAL_MGMT_FRAME_TX_IOCTL
#define UAPHOSTPKTINJECT WOAL_MGMT_FRAME_TX_IOCTL
/** Private command ID to set/get custom IE buffer */
#define UAP_CUSTOM_IE (SIOCDEVPRIVATE + 13)
#define UAP_CUSTOM_IE (SIOCDEVPRIVATE + 13)
/** HS WAKE UP event id */
#define UAP_EVENT_ID_HS_WAKEUP 0x80000001
#define UAP_EVENT_ID_HS_WAKEUP 0x80000001
/** HS_ACTIVATED event id */
#define UAP_EVENT_ID_DRV_HS_ACTIVATED 0x80000002
#define UAP_EVENT_ID_DRV_HS_ACTIVATED 0x80000002
/** HS DEACTIVATED event id */
#define UAP_EVENT_ID_DRV_HS_DEACTIVATED 0x80000003
#define UAP_EVENT_ID_DRV_HS_DEACTIVATED 0x80000003
/** Host sleep flag set */
#define HS_CFG_FLAG_GET 0
#define HS_CFG_FLAG_GET 0
/** Host sleep flag get */
#define HS_CFG_FLAG_SET 1
#define HS_CFG_FLAG_SET 1
/** Host sleep flag for condition */
#define HS_CFG_FLAG_CONDITION 2
#define HS_CFG_FLAG_CONDITION 2
/** Host sleep flag for GPIO */
#define HS_CFG_FLAG_GPIO 4
#define HS_CFG_FLAG_GPIO 4
/** Host sleep flag for Gap */
#define HS_CFG_FLAG_GAP 8
#define HS_CFG_FLAG_GAP 8
/** Host sleep flag for all */
#define HS_CFG_FLAG_ALL 0x0f
#define HS_CFG_FLAG_ALL 0x0f
/** Host sleep mask to get condition */
#define HS_CFG_CONDITION_MASK 0x0f
#define HS_CFG_CONDITION_MASK 0x0f
/** ds_hs_cfg */
typedef struct _ds_hs_cfg {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Bit0: 0 - Get, 1 Set
* Bit1: 1 - conditions is valid
* Bit2: 2 - gpio is valid
* Bit3: 3 - gap is valid
*/
/** Bit0: 0 - Get, 1 Set
* Bit1: 1 - conditions is valid
* Bit2: 2 - gpio is valid
* Bit3: 3 - gap is valid
*/
t_u32 flags;
/** Host sleep config condition */
/** Bit0: non-unicast data
* Bit1: unicast data
* Bit2: mac events
* Bit3: magic packet
*/
/** Host sleep config condition */
/** Bit0: non-unicast data
* Bit1: unicast data
* Bit2: mac events
* Bit3: magic packet
*/
t_u32 conditions;
/** GPIO */
/** GPIO */
t_u32 gpio;
/** Gap in milliseconds */
/** Gap in milliseconds */
t_u32 gap;
} ds_hs_cfg;
/** Private command ID to get BSS type */
#define UAP_GET_BSS_TYPE (SIOCDEVPRIVATE + 15)
#define UAP_GET_BSS_TYPE (SIOCDEVPRIVATE + 15)
/** addba_param */
typedef struct _addba_param {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** block ack timeout for ADDBA request */
/** block ack timeout for ADDBA request */
t_u32 timeout;
/** Buffer size for ADDBA request */
/** Buffer size for ADDBA request */
t_u32 txwinsize;
/** Buffer size for ADDBA response */
/** Buffer size for ADDBA response */
t_u32 rxwinsize;
/** amsdu for ADDBA request */
/** amsdu for ADDBA request */
t_u8 txamsdu;
/** amsdu for ADDBA response */
/** amsdu for ADDBA response */
t_u8 rxamsdu;
} addba_param;
/** aggr_prio_tbl */
typedef struct _aggr_prio_tbl {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** ampdu priority table */
/** ampdu priority table */
t_u8 ampdu[MAX_NUM_TID];
/** amsdu priority table */
/** amsdu priority table */
t_u8 amsdu[MAX_NUM_TID];
} aggr_prio_tbl;
/** addba_reject parameters */
typedef struct _addba_reject_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** BA Reject paramters */
/** BA Reject paramters */
t_u8 addba_reject[MAX_NUM_TID];
} addba_reject_para;
/** fw_info */
typedef struct _fw_info {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Get */
/** Get */
t_u32 action;
/** Firmware release number */
/** Firmware release number */
t_u32 fw_release_number;
/** Device support for MIMO abstraction of MCSs */
/** Device support for MIMO abstraction of MCSs */
t_u8 hw_dev_mcs_support;
/** fw_bands*/
/** fw_bands*/
t_u8 fw_bands;
/** Region Code */
/** Region Code */
t_u16 region_code;
/** 802.11n device capabilities */
/** 802.11n device capabilities */
t_u32 hw_dot_11n_dev_cap;
} fw_info;
typedef struct _ht_tx_cfg_para_hdr {
/** Sub command */
/** Sub command */
t_u32 subcmd;
/** Action: Set/Get */
/** Action: Set/Get */
t_u32 action;
} ht_tx_cfg_para_hdr;
typedef struct _tx_bf_cfg_para_hdr {
/** Sub command */
/** Sub command */
t_u32 subcmd;
/** Action: Set/Get */
/** Action: Set/Get */
t_u32 action;
} tx_bf_cfg_para_hdr;
typedef struct _vht_cfg_para_hdr {
/** Sub command */
/** Sub command */
t_u32 subcmd;
/** Action: Set/Get */
/** Action: Set/Get */
t_u32 action;
} vht_cfg_para_hdr;
typedef struct _uap_oper_para_hdr {
/** Sub command */
/** Sub command */
t_u32 subcmd;
/** Action: Set/Get */
/** Action: Set/Get */
t_u32 action;
} uap_oper_para_hdr;
#ifdef SDIO
/** sdcmd52rw parameters */
typedef struct _sdcmd52_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Write /Read */
/** Write /Read */
t_u32 action;
/** Command 52 paramters */
/** Command 52 paramters */
t_u8 cmd52_params[3];
} sdcmd52_para;
#endif
/** deep_sleep parameters */
typedef struct _deep_sleep_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** enable/disable deepsleep*/
/** enable/disable deepsleep*/
t_u16 deep_sleep;
/** idle_time */
/** idle_time */
t_u16 idle_time;
} deep_sleep_para;
/** band_steering parameters */
typedef struct _band_steer_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u8 action;
/** enable/disable band steering*/
/** enable/disable band steering*/
t_u8 state;
/** Probe Response will be blocked to 2G channel for first block_2g_prb_req probe requests*/
/** Probe Response will be blocked to 2G channel for first
* block_2g_prb_req probe requests*/
t_u8 block_2g_prb_req;
/** When band steering is enabled, limit the btm request sent to STA at <max_btm_req_allowed>*/
/** When band steering is enabled, limit the btm request sent to STA at
* <max_btm_req_allowed>*/
t_u8 max_btm_req_allowed;
} band_steer_para;
/** tx_data_pause parameters */
typedef struct _tx_data_pause_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** enable/disable Tx data pause*/
/** enable/disable Tx data pause*/
t_u16 txpause;
/** Max number of TX buffer allowed for all PS client*/
/** Max number of TX buffer allowed for all PS client*/
t_u16 txbufcnt;
} tx_data_pause_para;
/** mgmt_frame_ctrl */
typedef struct _mgmt_frame_ctrl {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** mask */
/** mask */
t_u32 mask;
} mgmt_frame_ctrl;
typedef struct _snmp_mib_para {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** oid to set/get */
/** oid to set/get */
t_u16 oid;
/** length of oid value */
/** length of oid value */
t_u16 oid_val_len;
/** oid value to set/get */
/** oid value to set/get */
t_u8 oid_value[];
} snmp_mib_para;
/** Max length for oid_value field */
#define MAX_SNMP_VALUE_SIZE 128
#define MAX_SNMP_VALUE_SIZE 128
/** Oid for 802.11D enable/disable */
#define OID_80211D_ENABLE 0x0009
#define OID_80211D_ENABLE 0x0009
/** Oid for 802.11H enable/disable */
#define OID_80211H_ENABLE 0x000a
#define OID_80211H_ENABLE 0x000a
/** dfs_testing parameters */
typedef struct _dfs_testing_param {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** user CAC period (msec) */
/** user CAC period (msec) */
t_u32 usr_cac_period;
/** user NOP period (sec) */
/** user NOP period (sec) */
t_u16 usr_nop_period;
/** don't change channel on radar */
/** don't change channel on radar */
t_u8 no_chan_change;
/** fixed channel to change to on radar */
/** fixed channel to change to on radar */
t_u8 fixed_new_chan;
} dfs_testing_para;
/** Channel switch count config */
typedef struct _cscount_cfg_t {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** user channel switch count */
/** user channel switch count */
t_u8 cs_count;
} cscount_cfg_t;
/** domain_info parameters */
typedef struct _domain_info_param {
/** subcmd */
/** subcmd */
t_u32 subcmd;
/** Set/Get */
/** Set/Get */
t_u32 action;
/** domain_param TLV (incl. header) */
/** domain_param TLV (incl. header) */
t_u8 tlv[];
} domain_info_para;
/** DOMAIN_INFO param sizes */
#define TLV_HEADER_LEN (2 + 2)
#define SUB_BAND_LEN 3
#define MAX_SUB_BANDS 40
#define TLV_HEADER_LEN (2 + 2)
#define SUB_BAND_LEN 3
#define MAX_SUB_BANDS 40
/** MAX domain TLV length */
#define MAX_DOMAIN_TLV_LEN (TLV_HEADER_LEN + COUNTRY_CODE_LEN \
+ (SUB_BAND_LEN * MAX_SUB_BANDS))
#define MAX_DOMAIN_TLV_LEN \
(TLV_HEADER_LEN + COUNTRY_CODE_LEN + (SUB_BAND_LEN * MAX_SUB_BANDS))
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt);
@ -516,12 +518,12 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data);
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
int woal_uap_get_channel_nop_info(moal_private *priv, t_u8 wait_option,
mlan_ds_11h_chan_nop_info * ch_info);
mlan_ds_11h_chan_nop_info *ch_info);
#endif
#endif
mlan_status woal_set_get_ap_channel(moal_private *priv, t_u16 action,
t_u8 wait_option,
chan_band_info * uap_channel);
chan_band_info *uap_channel);
#ifdef CONFIG_PROC_FS
void woal_uap_get_version(moal_private *priv, char *version, int max_len);
#endif
@ -536,8 +538,8 @@ int woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
/** Set invalid data for each member of mlan_uap_bss_param */
void woal_set_sys_config_invalid_data(mlan_uap_bss_param *config);
/** Set/Get system configuration parameters */
mlan_status woal_set_get_sys_config(moal_private *priv,
t_u16 action, t_u8 wait_option,
mlan_status woal_set_get_sys_config(moal_private *priv, t_u16 action,
t_u8 wait_option,
mlan_uap_bss_param *sys_cfg);
/** Set get AP wmm parameter */
mlan_status woal_set_get_ap_wmm_para(moal_private *priv, t_u16 action,
@ -545,10 +547,9 @@ mlan_status woal_set_get_ap_wmm_para(moal_private *priv, t_u16 action,
int woal_uap_set_ap_cfg(moal_private *priv, t_u8 *data, int len);
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40,
IEEEtypes_VHTCap_t *vhtcap_ie);
int woal_11ax_cfg(moal_private *priv, t_u8 action,
mlan_ds_11ax_he_cfg * he_cfg);
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg);
int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
IEEEtypes_HECap_t * hecap_ie);
IEEEtypes_HECap_t *hecap_ie);
int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg, t_u8 en);
mlan_status woal_uap_set_11n_status(moal_private *priv,
mlan_uap_bss_param *sys_cfg, t_u8 action);

View File

@ -1,29 +1,29 @@
/** @file moal_uap_cfg80211.h
*
* @brief This file contains the uAP CFG80211 specific defines.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains the uAP CFG80211 specific defines.
*
*
* Copyright 2014-2020 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_UAP_CFG80211_H_
#define _MOAL_UAP_CFG80211_H_
#include "moal_uap.h"
#include "moal_uap.h"
mlan_status woal_register_uap_cfg80211(struct net_device *dev, t_u8 bss_type);

View File

@ -1,33 +1,33 @@
/** @file moal_uap_priv.c
*
* @brief This file contains standard ioctl functions
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains standard ioctl functions
*
*
* Copyright 2014-2020 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.
*
*/
/************************************************************************
Change log:
08/06/2010: initial version
************************************************************************/
#include "moal_main.h"
#include "moal_uap.h"
#include "moal_uap_priv.h"
#include "moal_main.h"
#include "moal_uap.h"
#include "moal_uap_priv.h"
/********************************************************
Local Variables
@ -54,8 +54,7 @@ Change log:
*
* @return 0 --success, otherwise fail
*/
int
woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
int woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
struct iwreq *wrq = (struct iwreq *)req;
@ -162,8 +161,7 @@ woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
*
* @return N/A
*/
void
woal_ioctl_get_uap_info_resp(moal_private *priv, mlan_ds_get_info *info)
void woal_ioctl_get_uap_info_resp(moal_private *priv, mlan_ds_get_info *info)
{
ENTER();
switch (info->sub_command) {

View File

@ -1,24 +1,24 @@
/** @file moal_uap_priv.h
*
* @brief This file contains definition for extended private IOCTL call.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains definition for extended private IOCTL call.
*
*
* Copyright 2014-2020 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.
*
*/
/************************************************************************
Change log:
@ -29,167 +29,100 @@ Change log:
#define _MOAL_UAP_PRIV_H_
/** Private command ID */
#define WOAL_UAP_IOCTL 0x8BE0
#define WOAL_UAP_IOCTL 0x8BE0
/** Private command to get/set 256 chars */
#define WOAL_UAP_SET_GET_256_CHAR (WOAL_UAP_IOCTL + 1)
#define WOAL_UAP_SET_GET_256_CHAR (WOAL_UAP_IOCTL + 1)
/** Private command ID to FW reload */
#define WOAL_WL_FW_RELOAD 1
#define WOAL_WL_FW_RELOAD 1
/** Private command ID to set AP configuration */
#define WOAL_AP_SET_CFG 2
#define WOAL_AP_SET_CFG 2
/** Private command ID to set/get none */
#define WOAL_UAP_SETNONE_GETNONE (WOAL_UAP_IOCTL + 2)
#define WOAL_UAP_SETNONE_GETNONE (WOAL_UAP_IOCTL + 2)
/** Private command ID to start UAP */
#define WOAL_UAP_START 1
#define WOAL_UAP_START 1
/** Private command ID to stop UAP */
#define WOAL_UAP_STOP 2
#define WOAL_UAP_STOP 2
/** Private command ID to start AP BSS */
#define WOAL_AP_BSS_START 3
#define WOAL_AP_BSS_START 3
/** Private command ID to stop AP BSS */
#define WOAL_AP_BSS_STOP 4
#define WOAL_AP_BSS_STOP 4
/** Private command ID to set one int/get word char */
#define WOAL_UAP_SETONEINT_GETWORDCHAR (WOAL_UAP_IOCTL + 3)
#define WOAL_UAP_SETONEINT_GETWORDCHAR (WOAL_UAP_IOCTL + 3)
/** Private command ID to get version */
#define WOAL_UAP_VERSION 1
#define WOAL_UAP_VERSION 1
/** Private command ID to get extended version */
#define WOAL_UAP_VEREXT 2
#define WOAL_UAP_VEREXT 2
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
/** Private command ID to set one int/get one int */
#define WOAL_UAP_SETONEINT_GETONEINT (WOAL_UAP_IOCTL + 5)
#define WOAL_UAP_SETONEINT_GETONEINT (WOAL_UAP_IOCTL + 5)
/** Private command ID for set/get BSS role */
#define WOAL_UAP_SET_GET_BSS_ROLE 1
#define WOAL_UAP_SET_GET_BSS_ROLE 1
#endif
#endif
/** Private command ID for hostcmd */
#define WOAL_UAP_HOST_CMD (WOAL_UAP_IOCTL + 17)
#define WOAL_UAP_HOST_CMD (WOAL_UAP_IOCTL + 17)
/** The following command IDs are for Froyo app */
/** Private command ID to start AP BSS */
#define WOAL_UAP_FROYO_AP_BSS_START (WOAL_UAP_IOCTL + 24)
#define WOAL_UAP_FROYO_AP_BSS_START (WOAL_UAP_IOCTL + 24)
/** Private command ID to stop AP BSS */
#define WOAL_UAP_FROYO_AP_BSS_STOP (WOAL_UAP_IOCTL + 26)
#define WOAL_UAP_FROYO_AP_BSS_STOP (WOAL_UAP_IOCTL + 26)
/** Private command ID to set AP config */
#define WOAL_UAP_FROYO_AP_SET_CFG (WOAL_UAP_IOCTL + 27)
#define WOAL_UAP_FROYO_AP_SET_CFG (WOAL_UAP_IOCTL + 27)
/** Private command ID to start driver */
#define WOAL_UAP_FROYO_START (WOAL_UAP_IOCTL + 28)
#define WOAL_UAP_FROYO_START (WOAL_UAP_IOCTL + 28)
/** Private command ID to reload FW */
#define WOAL_UAP_FROYO_WL_FW_RELOAD (WOAL_UAP_IOCTL + 29)
#define WOAL_UAP_FROYO_WL_FW_RELOAD (WOAL_UAP_IOCTL + 29)
/** Private command ID to stop driver */
#define WOAL_UAP_FROYO_STOP (WOAL_UAP_IOCTL + 30)
#define WOAL_UAP_FROYO_STOP (WOAL_UAP_IOCTL + 30)
/**
* iwpriv ioctl handlers
*/
static const struct iw_priv_args woal_uap_priv_args[] = {
{
WOAL_UAP_SETNONE_GETNONE,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
""},
{
WOAL_UAP_START,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"start"},
{
WOAL_UAP_STOP,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"stop"},
{
WOAL_AP_BSS_START,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"bssstart"},
{
WOAL_AP_BSS_STOP,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"bssstop"},
{
WOAL_UAP_SETONEINT_GETWORDCHAR,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
""},
{
WOAL_UAP_VERSION,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
{WOAL_UAP_SETNONE_GETNONE, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, ""},
{WOAL_UAP_START, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "start"},
{WOAL_UAP_STOP, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "stop"},
{WOAL_AP_BSS_START, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "bssstart"},
{WOAL_AP_BSS_STOP, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "bssstop"},
{WOAL_UAP_SETONEINT_GETWORDCHAR, IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128, ""},
{WOAL_UAP_VERSION, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_CHAR | 128,
"version"},
{
WOAL_UAP_VEREXT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_CHAR | 128,
{WOAL_UAP_VEREXT, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_CHAR | 128,
"verext"},
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
{
WOAL_UAP_SETONEINT_GETONEINT,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
""},
{
WOAL_UAP_SET_GET_BSS_ROLE,
IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1,
{WOAL_UAP_SETONEINT_GETONEINT, IW_PRIV_TYPE_INT | 1,
IW_PRIV_TYPE_INT | 1, ""},
{WOAL_UAP_SET_GET_BSS_ROLE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
"bssrole"},
#endif
#endif
{
WOAL_UAP_SET_GET_256_CHAR,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
""},
{
WOAL_WL_FW_RELOAD,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_UAP_SET_GET_256_CHAR, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, ""},
{WOAL_WL_FW_RELOAD, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"fwreload"},
{
WOAL_AP_SET_CFG,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
{WOAL_AP_SET_CFG, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
"apcfg"},
{
WOAL_UAP_HOST_CMD,
IW_PRIV_TYPE_BYTE | 2047,
IW_PRIV_TYPE_BYTE | 2047,
{WOAL_UAP_HOST_CMD, IW_PRIV_TYPE_BYTE | 2047, IW_PRIV_TYPE_BYTE | 2047,
"hostcmd"},
{
WOAL_UAP_FROYO_START,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"START"},
{
WOAL_UAP_FROYO_STOP,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
"STOP"},
{
WOAL_UAP_FROYO_AP_BSS_START,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
{WOAL_UAP_FROYO_START, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "START"},
{WOAL_UAP_FROYO_STOP, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE, "STOP"},
{WOAL_UAP_FROYO_AP_BSS_START, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE,
"AP_BSS_START"},
{
WOAL_UAP_FROYO_AP_BSS_STOP,
IW_PRIV_TYPE_NONE,
IW_PRIV_TYPE_NONE,
{WOAL_UAP_FROYO_AP_BSS_STOP, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_NONE,
"AP_BSS_STOP"},
{
WOAL_UAP_FROYO_WL_FW_RELOAD,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
"WL_FW_RELOAD"},
{
WOAL_UAP_FROYO_AP_SET_CFG,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256,
"AP_SET_CFG"},
{WOAL_UAP_FROYO_WL_FW_RELOAD, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, "WL_FW_RELOAD"},
{WOAL_UAP_FROYO_AP_SET_CFG, IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | 256, "AP_SET_CFG"},
};
#endif /* _MOAL_UAP_PRIV_H_ */

View File

@ -1,109 +1,67 @@
/** @file moal_uap_wext.c
*
* @brief This file contains wireless extension standard ioctl functions
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains wireless extension standard ioctl functions
*
*
* Copyright 2014-2020 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.
*
*/
/************************************************************************
Change log:
08/06/2010: initial version
************************************************************************/
#include "moal_main.h"
#include "moal_uap.h"
#include "moal_wext.h"
#include "moal_uap_priv.h"
#include "moal_main.h"
#include "moal_uap.h"
#include "moal_wext.h"
#include "moal_uap_priv.h"
/********************************************************
Global Variables
********************************************************/
typedef struct _chan_to_freq_t {
/** Channel */
/** Channel */
t_u16 channel;
/** Frequency */
/** Frequency */
t_u32 freq;
/** Band */
/** Band */
t_u8 band;
} chan_to_freq_t;
const chan_to_freq_t chan_to_freq[] = {
{1, 2412, 0},
{2, 2417, 0},
{3, 2422, 0},
{4, 2427, 0},
{5, 2432, 0},
{6, 2437, 0},
{7, 2442, 0},
{8, 2447, 0},
{9, 2452, 0},
{10, 2457, 0},
{11, 2462, 0},
{12, 2467, 0},
{13, 2472, 0},
{14, 2484, 0},
{183, 4915, 1},
{184, 4920, 1},
{185, 4925, 1},
{187, 4935, 1},
{188, 4940, 1},
{189, 4945, 1},
{192, 4960, 1},
{196, 4980, 1},
{7, 5035, 1},
{8, 5040, 1},
{9, 5045, 1},
{11, 5055, 1},
{12, 5060, 1},
{16, 5080, 1},
{34, 5170, 1},
{36, 5180, 1},
{38, 5190, 1},
{40, 5200, 1},
{42, 5210, 1},
{44, 5220, 1},
{46, 5230, 1},
{48, 5240, 1},
{52, 5260, 1},
{56, 5280, 1},
{60, 5300, 1},
{64, 5320, 1},
{100, 5500, 1},
{104, 5520, 1},
{108, 5540, 1},
{112, 5560, 1},
{116, 5580, 1},
{120, 5600, 1},
{124, 5620, 1},
{128, 5640, 1},
{132, 5660, 1},
{136, 5680, 1},
{140, 5700, 1},
{144, 5720, 1},
{149, 5745, 1},
{153, 5765, 1},
{157, 5785, 1},
{161, 5805, 1},
{1, 2412, 0}, {2, 2417, 0}, {3, 2422, 0}, {4, 2427, 0},
{5, 2432, 0}, {6, 2437, 0}, {7, 2442, 0}, {8, 2447, 0},
{9, 2452, 0}, {10, 2457, 0}, {11, 2462, 0}, {12, 2467, 0},
{13, 2472, 0}, {14, 2484, 0}, {183, 4915, 1}, {184, 4920, 1},
{185, 4925, 1}, {187, 4935, 1}, {188, 4940, 1}, {189, 4945, 1},
{192, 4960, 1}, {196, 4980, 1}, {7, 5035, 1}, {8, 5040, 1},
{9, 5045, 1}, {11, 5055, 1}, {12, 5060, 1}, {16, 5080, 1},
{34, 5170, 1}, {36, 5180, 1}, {38, 5190, 1}, {40, 5200, 1},
{42, 5210, 1}, {44, 5220, 1}, {46, 5230, 1}, {48, 5240, 1},
{52, 5260, 1}, {56, 5280, 1}, {60, 5300, 1}, {64, 5320, 1},
{100, 5500, 1}, {104, 5520, 1}, {108, 5540, 1}, {112, 5560, 1},
{116, 5580, 1}, {120, 5600, 1}, {124, 5620, 1}, {128, 5640, 1},
{132, 5660, 1}, {136, 5680, 1}, {140, 5700, 1}, {144, 5720, 1},
{149, 5745, 1}, {153, 5765, 1}, {157, 5785, 1}, {161, 5805, 1},
{165, 5825, 1},
};
/** Convertion from frequency to channel */
#define freq_to_chan(x) ((((x) - 2412) / 5) + 1)
#define freq_to_chan(x) ((((x)-2412) / 5) + 1)
/********************************************************
Local Functions
@ -117,8 +75,7 @@ const chan_to_freq_t chan_to_freq[] = {
*
* @return N/A
*/
static inline void
woal_sort_channels(struct iw_freq *freq, int num)
static inline void woal_sort_channels(struct iw_freq *freq, int num)
{
int i, j;
struct iw_freq temp;
@ -145,8 +102,7 @@ woal_sort_channels(struct iw_freq *freq, int num)
*
* @return freq
*/
static int
channel_to_frequency(t_u16 channel, t_u8 band)
static int channel_to_frequency(t_u16 channel, t_u8 band)
{
int i = 0;
@ -172,9 +128,9 @@ channel_to_frequency(t_u16 channel, t_u8 band)
*
* @return 0 --success
*/
static int
woal_config_commit(struct net_device *dev,
struct iw_request_info *info, char *cwrq, char *extra)
static int woal_config_commit(struct net_device *dev,
struct iw_request_info *info, char *cwrq,
char *extra)
{
ENTER();
@ -192,9 +148,8 @@ woal_config_commit(struct net_device *dev,
*
* @return 0 --success
*/
static int
woal_get_name(struct net_device *dev, struct iw_request_info *info,
char *cwrq, char *extra)
static int woal_get_name(struct net_device *dev, struct iw_request_info *info,
char *cwrq, char *extra)
{
ENTER();
strcpy(cwrq, "IEEE 802.11-DS");
@ -212,9 +167,8 @@ woal_get_name(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success
*/
static int
woal_get_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
static int woal_get_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
int ret = 0;
@ -243,13 +197,12 @@ woal_get_wap(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
static int woal_set_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
const t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = { 0, 0, 0, 0, 0, 0 };
const t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0, 0, 0, 0, 0, 0};
ENTER();
@ -295,9 +248,8 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
static int woal_set_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *sys_cfg = NULL, *ap_cfg = NULL;
@ -317,8 +269,7 @@ woal_set_freq(struct net_device *dev, struct iw_request_info *info,
goto done;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -351,8 +302,7 @@ woal_set_freq(struct net_device *dev, struct iw_request_info *info,
goto done;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP confiruration\n");
@ -377,9 +327,8 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_get_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
static int woal_get_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *ap_cfg = NULL;
@ -394,8 +343,7 @@ woal_get_freq(struct net_device *dev, struct iw_request_info *info,
return -EFAULT;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -424,9 +372,9 @@ woal_get_freq(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_bss_mode(struct net_device *dev, struct iw_request_info *info,
t_u32 *uwrq, char *extra)
static int woal_set_bss_mode(struct net_device *dev,
struct iw_request_info *info, t_u32 *uwrq,
char *extra)
{
int ret = 0;
ENTER();
@ -455,9 +403,9 @@ woal_set_bss_mode(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success
*/
static int
woal_get_bss_mode(struct net_device *dev, struct iw_request_info *info,
t_u32 *uwrq, char *extra)
static int woal_get_bss_mode(struct net_device *dev,
struct iw_request_info *info, t_u32 *uwrq,
char *extra)
{
ENTER();
@ -477,9 +425,8 @@ woal_get_bss_mode(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_set_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
@ -509,8 +456,7 @@ woal_set_encode(struct net_device *dev, struct iw_request_info *info,
goto done;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -554,7 +500,8 @@ woal_set_encode(struct net_device *dev, struct iw_request_info *info,
pkey = &sys_cfg->wep_cfg.key2;
if (ap_cfg->wep_cfg.key3.is_default)
pkey = &sys_cfg->wep_cfg.key3;
else { /* Something wrong, select first key as default */
else { /* Something wrong, select first key as default
*/
PRINTM(MERROR,
"No default key set! Selecting first key.\n");
pkey = &sys_cfg->wep_cfg.key0;
@ -636,8 +583,7 @@ woal_set_encode(struct net_device *dev, struct iw_request_info *info,
}
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP confiruration\n");
@ -662,9 +608,8 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_get_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_get_encode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
int index = (dwrq->flags & IW_ENCODE_INDEX);
@ -685,8 +630,7 @@ woal_get_encode(struct net_device *dev, struct iw_request_info *info,
goto done;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -767,9 +711,8 @@ done:
*
* @return -EOPNOTSUPP
*/
static int
woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
ENTER();
LEAVE();
@ -790,9 +733,8 @@ woal_get_gen_ie(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *sys_cfg = NULL;
@ -839,7 +781,7 @@ woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
((t_u8 *)tlv),
sizeof(IEEEtypes_Header_t) + tlv->len,
sizeof(priv->bcn_ie_buf) -
priv->bcn_ie_len);
priv->bcn_ie_len);
priv->bcn_ie_len +=
sizeof(IEEEtypes_Header_t) + tlv->len;
}
@ -863,7 +805,7 @@ woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
((t_u8 *)tlv),
sizeof(IEEEtypes_Header_t) + tlv->len,
sizeof(priv->bcn_ie_buf) -
priv->bcn_ie_len);
priv->bcn_ie_len);
priv->bcn_ie_len +=
sizeof(IEEEtypes_Header_t) + tlv->len;
}
@ -882,10 +824,9 @@ woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
sys_cfg->key_mgmt_operation |= 0x03;
if (sys_cfg->protocol) {
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
if (MLAN_STATUS_SUCCESS !=
woal_set_get_sys_config(priv, MLAN_ACT_SET, MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP configuration\n");
ret = -EFAULT;
goto done;
@ -895,7 +836,7 @@ woal_set_gen_ie(struct net_device *dev, struct iw_request_info *info,
/* custom IE command to set priv->bcn_ie_buf */
if (MLAN_STATUS_SUCCESS !=
#define UAP_RSN_MASK (BIT(8) | BIT(5) | BIT(1) | BIT(3))
#define UAP_RSN_MASK (BIT(8) | BIT(5) | BIT(1) | BIT(3))
woal_set_get_custom_ie(priv, UAP_RSN_MASK, priv->bcn_ie_buf,
priv->bcn_ie_len)) {
PRINTM(MERROR, "Error setting wpa-rsn IE\n");
@ -928,10 +869,9 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_encode_ext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_set_encode_ext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
moal_private *priv = (moal_private *)netdev_priv(dev);
@ -1033,12 +973,13 @@ woal_set_encode_ext(struct net_device *dev,
sec->param.encrypt_key.pn, SEQ_MAX_SIZE);
}
PRINTM(MIOCTL,
"set uap wpa key key_index=%d, key_len=%d key_flags=0x%x "
MACSTR "\n", key_index, ext->key_len,
"set uap wpa key key_index=%d, key_len=%d key_flags=0x%x " MACSTR
"\n",
key_index, ext->key_len,
sec->param.encrypt_key.key_flags,
MAC2STR(sec->param.encrypt_key.mac_addr));
DBG_HEXDUMP(MCMD_D, "uap wpa key", pkey_material, ext->key_len);
#define IW_ENCODE_ALG_AES_CMAC 5
#define IW_ENCODE_ALG_AES_CMAC 5
if (ext->alg == IW_ENCODE_ALG_AES_CMAC)
sec->param.encrypt_key.key_flags |=
@ -1049,10 +990,9 @@ woal_set_encode_ext(struct net_device *dev,
/* Cipher set will be done in set generic IE */
priv->pairwise_cipher = ext->alg;
priv->group_cipher = ext->alg;
goto done; /* No AP configuration */
goto done; /* No AP configuration */
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP confiruration\n");
@ -1078,10 +1018,9 @@ done:
*
* @return -EOPNOTSUPP
*/
static int
woal_get_encode_ext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_get_encode_ext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
ENTER();
LEAVE();
@ -1098,9 +1037,8 @@ woal_get_encode_ext(struct net_device *dev,
*
* @return 0--success, otherwise fail
*/
static int
woal_set_mlme(struct net_device *dev,
struct iw_request_info *info, struct iw_point *dwrq, char *extra)
static int woal_set_mlme(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct iw_mlme *mlme = (struct iw_mlme *)extra;
moal_private *priv = (moal_private *)netdev_priv(dev);
@ -1108,7 +1046,7 @@ woal_set_mlme(struct net_device *dev,
mlan_ds_get_info *pinfo = NULL;
mlan_ioctl_req *req = NULL;
mlan_ds_sta_list *sta_list = NULL;
const t_u8 bc_addr[] = { 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF };
const t_u8 bc_addr[] = {0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF};
t_u8 sta_addr[ETH_ALEN];
int ret = 0, i;
mlan_status status = MLAN_STATUS_SUCCESS;
@ -1130,8 +1068,8 @@ woal_set_mlme(struct net_device *dev,
/* If deauth all station, get the connected STA list first */
if (!memcmp(bc_addr, sta_addr, ETH_ALEN)) {
PRINTM(MIOCTL, "Deauth all stations\n");
req = woal_alloc_mlan_ioctl_req(sizeof
(mlan_ds_get_info));
req = woal_alloc_mlan_ioctl_req(
sizeof(mlan_ds_get_info));
if (req == NULL) {
LEAVE();
return -ENOMEM;
@ -1171,13 +1109,12 @@ woal_set_mlme(struct net_device *dev,
if (sta_list && !memcmp(bc_addr, sta_addr, ETH_ALEN)) {
for (i = 0; i < sta_list->sta_count; i++) {
moal_memcpy_ext(priv->phandle,
bss->param.deauth_param.
mac_addr,
sta_list->info[i].mac_address,
ETH_ALEN,
sizeof(bss->param.deauth_param.
mac_addr));
moal_memcpy_ext(
priv->phandle,
bss->param.deauth_param.mac_addr,
sta_list->info[i].mac_address, ETH_ALEN,
sizeof(bss->param.deauth_param
.mac_addr));
bss->param.deauth_param.reason_code =
mlme->reason_code;
@ -1189,11 +1126,10 @@ woal_set_mlme(struct net_device *dev,
}
}
} else {
moal_memcpy_ext(priv->phandle,
bss->param.deauth_param.mac_addr,
sta_addr, ETH_ALEN,
sizeof(bss->param.deauth_param.
mac_addr));
moal_memcpy_ext(
priv->phandle, bss->param.deauth_param.mac_addr,
sta_addr, ETH_ALEN,
sizeof(bss->param.deauth_param.mac_addr));
bss->param.deauth_param.reason_code = mlme->reason_code;
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
@ -1221,9 +1157,8 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_auth(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
static int woal_set_auth(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
int ret = 0;
moal_private *priv = (moal_private *)netdev_priv(dev);
@ -1363,7 +1298,7 @@ woal_set_auth(struct net_device *dev, struct iw_request_info *info,
default:
kfree(sys_cfg);
LEAVE();
return -EOPNOTSUPP; /* No AP configuration */
return -EOPNOTSUPP; /* No AP configuration */
}
if (!sys_cfg->key_mgmt)
sys_cfg->key_mgmt = priv->uap_key_mgmt;
@ -1375,8 +1310,7 @@ woal_set_auth(struct net_device *dev, struct iw_request_info *info,
sys_cfg->protocol = priv->uap_protocol;
/* Set AP configuration */
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP confiruration\n");
@ -1400,9 +1334,8 @@ done:
*
* @return 0 --success, otherwise fail
*/
static int
woal_get_auth(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
static int woal_get_auth(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *ap_cfg = NULL;
@ -1416,8 +1349,7 @@ woal_get_auth(struct net_device *dev, struct iw_request_info *info,
return -EFAULT;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -1430,9 +1362,10 @@ woal_get_auth(struct net_device *dev, struct iw_request_info *info,
if (ap_cfg->wpa_cfg.pairwise_cipher_wpa == CIPHER_TKIP ||
ap_cfg->wpa_cfg.pairwise_cipher_wpa2 == CIPHER_TKIP)
vwrq->value = IW_AUTH_CIPHER_TKIP;
else if (ap_cfg->wpa_cfg.pairwise_cipher_wpa == CIPHER_AES_CCMP
|| ap_cfg->wpa_cfg.pairwise_cipher_wpa2 ==
CIPHER_AES_CCMP)
else if (ap_cfg->wpa_cfg.pairwise_cipher_wpa ==
CIPHER_AES_CCMP ||
ap_cfg->wpa_cfg.pairwise_cipher_wpa2 ==
CIPHER_AES_CCMP)
vwrq->value = IW_AUTH_CIPHER_CCMP;
else
vwrq->value = IW_AUTH_CIPHER_NONE;
@ -1504,9 +1437,8 @@ woal_get_auth(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_get_range(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_get_range(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *ap_cfg = NULL;
@ -1523,8 +1455,7 @@ woal_get_range(struct net_device *dev, struct iw_request_info *info,
return -EFAULT;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -1539,13 +1470,14 @@ woal_get_range(struct net_device *dev, struct iw_request_info *info,
range->max_nwid = 0;
range->num_bitrates = MAX_DATA_RATES;
for (i = 0; i < MIN(MAX_DATA_RATES, IW_MAX_BITRATES) &&
ap_cfg->rates[i]; i++) {
for (i = 0;
i < MIN(MAX_DATA_RATES, IW_MAX_BITRATES) && ap_cfg->rates[i];
i++) {
range->bitrate[i] = (ap_cfg->rates[i] & 0x7f) * 500000;
}
range->num_bitrates = i;
PRINTM(MINFO, "IW_MAX_BITRATES=%d num_bitrates=%d\n",
IW_MAX_BITRATES, range->num_bitrates);
PRINTM(MINFO, "IW_MAX_BITRATES=%d num_bitrates=%d\n", IW_MAX_BITRATES,
range->num_bitrates);
range->num_frequency = MIN(ap_cfg->num_of_chan, IW_MAX_FREQUENCIES);
@ -1553,8 +1485,9 @@ woal_get_range(struct net_device *dev, struct iw_request_info *info,
range->freq[i].i = (long)ap_cfg->chan_list[i].chan_number;
band = (ap_cfg->chan_list[i].bandcfg.chanBand == BAND_5GHZ);
range->freq[i].m =
(long)channel_to_frequency(ap_cfg->chan_list[i].
chan_number, band) * 100000;
(long)channel_to_frequency(
ap_cfg->chan_list[i].chan_number, band) *
100000;
range->freq[i].e = 1;
}
@ -1585,13 +1518,13 @@ woal_get_range(struct net_device *dev, struct iw_request_info *info,
range->max_encoding_tokens = 4;
/** Minimum power period */
#define IW_POWER_PERIOD_MIN 1000000 /* 1 sec */
#define IW_POWER_PERIOD_MIN 1000000 /* 1 sec */
/** Maximum power period */
#define IW_POWER_PERIOD_MAX 120000000 /* 2 min */
#define IW_POWER_PERIOD_MAX 120000000 /* 2 min */
/** Minimum power timeout value */
#define IW_POWER_TIMEOUT_MIN 1000 /* 1 ms */
#define IW_POWER_TIMEOUT_MIN 1000 /* 1 ms */
/** Maximim power timeout value */
#define IW_POWER_TIMEOUT_MAX 1000000 /* 1 sec */
#define IW_POWER_TIMEOUT_MAX 1000000 /* 1 sec */
/* Power Management duration & timeout */
range->min_pmp = IW_POWER_PERIOD_MIN;
@ -1647,9 +1580,8 @@ woal_get_range(struct net_device *dev, struct iw_request_info *info,
*
* @return 0 --success, otherwise fail
*/
static int
woal_set_priv(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
ENTER();
LEAVE();
@ -1666,9 +1598,8 @@ woal_set_priv(struct net_device *dev, struct iw_request_info *info,
*
* @return 0--success, otherwise fail
*/
static int
woal_set_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *sys_cfg = NULL;
@ -1707,12 +1638,11 @@ woal_set_essid(struct net_device *dev, struct iw_request_info *info,
goto done;
}
PRINTM(MINFO, "Requested new SSID = %s\n",
(sys_cfg->ssid.ssid_len > 0) ?
(char *)sys_cfg->ssid.ssid : "NULL");
(sys_cfg->ssid.ssid_len > 0) ? (char *)sys_cfg->ssid.ssid :
"NULL");
/* Set AP configuration */
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_SET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
sys_cfg)) {
PRINTM(MERROR, "Error setting AP confiruration\n");
@ -1736,9 +1666,8 @@ done:
*
* @return 0--success, otherwise fail
*/
static int
woal_get_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
static int woal_get_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
mlan_uap_bss_param *ap_cfg = NULL;
@ -1751,8 +1680,7 @@ woal_get_essid(struct net_device *dev, struct iw_request_info *info,
return -EFAULT;
}
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
MLAN_ACT_GET,
if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv, MLAN_ACT_GET,
MOAL_IOCTL_WAIT,
ap_cfg)) {
PRINTM(MERROR, "Error getting AP confiruration\n");
@ -1778,85 +1706,85 @@ woal_get_essid(struct net_device *dev, struct iw_request_info *info,
* iwconfig settable callbacks
*/
static const iw_handler woal_handler[] = {
(iw_handler) woal_config_commit, /* SIOCSIWCOMMIT */
(iw_handler) woal_get_name, /* SIOCGIWNAME */
(iw_handler) NULL, /* SIOCSIWNWID */
(iw_handler) NULL, /* SIOCGIWNWID */
(iw_handler) woal_set_freq, /* SIOCSIWFREQ */
(iw_handler) woal_get_freq, /* SIOCGIWFREQ */
(iw_handler) woal_set_bss_mode, /* SIOCSIWMODE */
(iw_handler) woal_get_bss_mode, /* SIOCGIWMODE */
(iw_handler) NULL, /* SIOCSIWSENS */
(iw_handler) NULL, /* SIOCGIWSENS */
(iw_handler) NULL, /* SIOCSIWRANGE */
(iw_handler) woal_get_range, /* SIOCGIWRANGE */
(iw_handler) woal_set_priv, /* SIOCSIWPRIV */
(iw_handler) NULL, /* SIOCGIWPRIV */
(iw_handler) NULL, /* SIOCSIWSTATS */
(iw_handler) NULL, /* SIOCGIWSTATS */
(iw_handler)woal_config_commit, /* SIOCSIWCOMMIT */
(iw_handler)woal_get_name, /* SIOCGIWNAME */
(iw_handler)NULL, /* SIOCSIWNWID */
(iw_handler)NULL, /* SIOCGIWNWID */
(iw_handler)woal_set_freq, /* SIOCSIWFREQ */
(iw_handler)woal_get_freq, /* SIOCGIWFREQ */
(iw_handler)woal_set_bss_mode, /* SIOCSIWMODE */
(iw_handler)woal_get_bss_mode, /* SIOCGIWMODE */
(iw_handler)NULL, /* SIOCSIWSENS */
(iw_handler)NULL, /* SIOCGIWSENS */
(iw_handler)NULL, /* SIOCSIWRANGE */
(iw_handler)woal_get_range, /* SIOCGIWRANGE */
(iw_handler)woal_set_priv, /* SIOCSIWPRIV */
(iw_handler)NULL, /* SIOCGIWPRIV */
(iw_handler)NULL, /* SIOCSIWSTATS */
(iw_handler)NULL, /* SIOCGIWSTATS */
#if WIRELESS_EXT > 15
#ifdef CONFIG_WEXT_SPY
iw_handler_set_spy, /* SIOCSIWSPY */
iw_handler_get_spy, /* SIOCGIWSPY */
iw_handler_set_thrspy, /* SIOCSIWTHRSPY */
iw_handler_get_thrspy, /* SIOCGIWTHRSPY */
iw_handler_set_spy, /* SIOCSIWSPY */
iw_handler_get_spy, /* SIOCGIWSPY */
iw_handler_set_thrspy, /* SIOCSIWTHRSPY */
iw_handler_get_thrspy, /* SIOCGIWTHRSPY */
#else
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
#endif
#else /* WIRELESS_EXT > 15 */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
#endif /* WIRELESS_EXT > 15 */
(iw_handler) woal_set_wap, /* SIOCSIWAP */
(iw_handler) woal_get_wap, /* SIOCGIWAP */
(iw_handler)woal_set_wap, /* SIOCSIWAP */
(iw_handler)woal_get_wap, /* SIOCGIWAP */
#if WIRELESS_EXT >= 18
(iw_handler) woal_set_mlme, /* SIOCSIWMLME */
(iw_handler)woal_set_mlme, /* SIOCSIWMLME */
#else
(iw_handler) NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
#endif
/* (iw_handler) wlan_get_aplist, *//* SIOCGIWAPLIST */
NULL, /* SIOCGIWAPLIST */
/* (iw_handler) wlan_get_aplist, */ /* SIOCGIWAPLIST */
NULL, /* SIOCGIWAPLIST */
#if WIRELESS_EXT > 13
(iw_handler) NULL, /* SIOCSIWSCAN */
(iw_handler) NULL, /* SIOCGIWSCAN */
(iw_handler)NULL, /* SIOCSIWSCAN */
(iw_handler)NULL, /* SIOCGIWSCAN */
#else /* WIRELESS_EXT > 13 */
(iw_handler) NULL, /* SIOCSIWSCAN */
(iw_handler) NULL, /* SIOCGIWSCAN */
(iw_handler)NULL, /* SIOCSIWSCAN */
(iw_handler)NULL, /* SIOCGIWSCAN */
#endif /* WIRELESS_EXT > 13 */
(iw_handler) woal_set_essid, /* SIOCSIWESSID */
(iw_handler) woal_get_essid, /* SIOCGIWESSID */
(iw_handler) NULL, /* SIOCSIWNICKN */
(iw_handler) NULL, /* SIOCGIWNICKN */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* SIOCSIWRATE */
(iw_handler) NULL, /* SIOCGIWRATE */
(iw_handler) NULL, /* SIOCSIWRTS */
(iw_handler) NULL, /* SIOCGIWRTS */
(iw_handler) NULL, /* SIOCSIWFRAG */
(iw_handler) NULL, /* SIOCGIWFRAG */
(iw_handler) NULL, /* SIOCSIWTXPOW */
(iw_handler) NULL, /* SIOCGIWTXPOW */
(iw_handler) NULL, /* SIOCSIWRETRY */
(iw_handler) NULL, /* SIOCGIWRETRY */
(iw_handler) woal_set_encode, /* SIOCSIWENCODE */
(iw_handler) woal_get_encode, /* SIOCGIWENCODE */
(iw_handler) NULL, /* SIOCSIWPOWER */
(iw_handler) NULL, /* SIOCGIWPOWER */
(iw_handler)woal_set_essid, /* SIOCSIWESSID */
(iw_handler)woal_get_essid, /* SIOCGIWESSID */
(iw_handler)NULL, /* SIOCSIWNICKN */
(iw_handler)NULL, /* SIOCGIWNICKN */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* SIOCSIWRATE */
(iw_handler)NULL, /* SIOCGIWRATE */
(iw_handler)NULL, /* SIOCSIWRTS */
(iw_handler)NULL, /* SIOCGIWRTS */
(iw_handler)NULL, /* SIOCSIWFRAG */
(iw_handler)NULL, /* SIOCGIWFRAG */
(iw_handler)NULL, /* SIOCSIWTXPOW */
(iw_handler)NULL, /* SIOCGIWTXPOW */
(iw_handler)NULL, /* SIOCSIWRETRY */
(iw_handler)NULL, /* SIOCGIWRETRY */
(iw_handler)woal_set_encode, /* SIOCSIWENCODE */
(iw_handler)woal_get_encode, /* SIOCGIWENCODE */
(iw_handler)NULL, /* SIOCSIWPOWER */
(iw_handler)NULL, /* SIOCGIWPOWER */
#if (WIRELESS_EXT >= 18)
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) woal_set_gen_ie, /* SIOCSIWGENIE */
(iw_handler) woal_get_gen_ie, /* SIOCGIWGENIE */
(iw_handler) woal_set_auth, /* SIOCSIWAUTH */
(iw_handler) woal_get_auth, /* SIOCGIWAUTH */
(iw_handler) woal_set_encode_ext, /* SIOCSIWENCODEEXT */
(iw_handler) woal_get_encode_ext, /* SIOCGIWENCODEEXT */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)NULL, /* -- hole -- */
(iw_handler)woal_set_gen_ie, /* SIOCSIWGENIE */
(iw_handler)woal_get_gen_ie, /* SIOCGIWGENIE */
(iw_handler)woal_set_auth, /* SIOCSIWAUTH */
(iw_handler)woal_get_auth, /* SIOCGIWAUTH */
(iw_handler)woal_set_encode_ext, /* SIOCSIWENCODEEXT */
(iw_handler)woal_get_encode_ext, /* SIOCGIWENCODEEXT */
#endif /* WIRELESSS_EXT >= 18 */
};
@ -1864,25 +1792,27 @@ static const iw_handler woal_handler[] = {
* iwpriv settable callbacks
*/
static const iw_handler woal_private_handler[] = {
NULL, /* SIOCIWFIRSTPRIV */
NULL, /* SIOCIWFIRSTPRIV */
};
/********************************************************
Global Functions
********************************************************/
// clang-format off
/** wlan_handler_def */
struct iw_handler_def woal_uap_handler_def = {
num_standard:ARRAY_SIZE(woal_handler),
num_private:ARRAY_SIZE(woal_private_handler),
num_private_args:ARRAY_SIZE(woal_uap_priv_args),
standard:(iw_handler *) woal_handler,
private:(iw_handler *) woal_private_handler,
private_args:(struct iw_priv_args *)woal_uap_priv_args,
num_standard: ARRAY_SIZE(woal_handler),
num_private : ARRAY_SIZE(woal_private_handler),
num_private_args : ARRAY_SIZE(woal_uap_priv_args),
standard : (iw_handler *)woal_handler,
private : (iw_handler *)woal_private_handler,
private_args : (struct iw_priv_args *)woal_uap_priv_args,
#if WIRELESS_EXT > 20
get_wireless_stats:woal_get_uap_wireless_stats,
get_wireless_stats : woal_get_uap_wireless_stats,
#endif
};
// clang-format on
/**
* @brief Get wireless statistics
@ -1891,8 +1821,7 @@ get_wireless_stats:woal_get_uap_wireless_stats,
*
* @return A pointer to iw_statistics buf
*/
struct iw_statistics *
woal_get_uap_wireless_stats(struct net_device *dev)
struct iw_statistics *woal_get_uap_wireless_stats(struct net_device *dev)
{
moal_private *priv = (moal_private *)netdev_priv(dev);
t_u16 wait_option = MOAL_IOCTL_WAIT;

View File

@ -1,33 +1,33 @@
/** @file moal_usb.c
*
* @brief This file contains the interfaceing to USB bus
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains the interfaceing to USB bus
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
10/21/2008: initial version
********************************************************/
#include "moal_main.h"
#include "moal_usb.h"
#include "moal_main.h"
#include "moal_usb.h"
extern struct semaphore AddRemoveCardSem;
/********************************************************
@ -37,38 +37,37 @@ extern struct semaphore AddRemoveCardSem;
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || defined(USB8978)
/** Card-type detection frame response */
typedef struct {
/** 32-bit ACK+WINNER field */
/** 32-bit ACK+WINNER field */
t_u32 ack_winner;
/** 32-bit Sequence number */
/** 32-bit Sequence number */
t_u32 seq;
/** 32-bit extend */
/** 32-bit extend */
t_u32 extend;
/** 32-bit chip-revision code */
/** 32-bit chip-revision code */
t_u32 chip_rev;
/** 32-bit strap setting */
/** 32-bit strap setting */
t_u32 strap;
} usb_ack_pkt;
#endif
/** NXP USB device */
#define NXP_USB_DEVICE(vid, pid, name) \
USB_DEVICE(vid, pid), \
.driver_info = (t_ptr)name
#define NXP_USB_DEVICE(vid, pid, name) \
USB_DEVICE(vid, pid), .driver_info = (t_ptr)name
/** Name of the USB driver */
const char usbdriver_name[] = "usbxxx";
/** This structure contains the device signature */
struct usb_device_id woal_usb_table[] = {
/* Enter the device signature inside */
/* Enter the device signature inside */
#ifdef USB8897
{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, 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")},
@ -77,11 +76,11 @@ struct usb_device_id woal_usb_table[] = {
#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, "NXP WLAN USB Adapter")},
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_1_BT,
"NXP WLAN USB Adapter")},
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_2, "NXP WLAN USB Adapter")},
{NXP_USB_DEVICE
(USB8978_VID_1, USB8978_PID_2_BT, "NXP WLAN USB Adapter")},
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_2_BT,
"NXP WLAN USB Adapter")},
#endif
#ifdef USB9098
{NXP_USB_DEVICE(USB9098_VID_1, USB9098_PID_1, "NXP WLAN USB Adapter")},
@ -97,7 +96,7 @@ struct usb_device_id woal_usb_table[] = {
/** This structure contains the device signature */
struct usb_device_id woal_usb_table_skip_fwdnld[] = {
/* Enter the device signature inside */
/* Enter the device signature inside */
#ifdef USB8897
{NXP_USB_DEVICE(USB8897_VID_1, USB8897_PID_2, "NXP WLAN USB Adapter")},
#endif
@ -106,8 +105,8 @@ struct usb_device_id woal_usb_table_skip_fwdnld[] = {
#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, "NXP WLAN USB Adapter")},
{NXP_USB_DEVICE(USB8978_VID_1, USB8978_PID_2_BT,
"NXP WLAN USB Adapter")},
#endif
#ifdef USB9098
{NXP_USB_DEVICE(USB9098_VID_1, USB9098_PID_2, "NXP WLAN USB Adapter")},
@ -191,8 +190,7 @@ extern int max_tx_buf;
*
* @return N/A
*/
static void
woal_usb_receive(struct urb *urb, struct pt_regs *regs)
static void woal_usb_receive(struct urb *urb, struct pt_regs *regs)
#else
/**
* @brief This function receive packet of the data/cmd/event packet
@ -202,8 +200,7 @@ woal_usb_receive(struct urb *urb, struct pt_regs *regs)
*
* @return N/A
*/
static void
woal_usb_receive(struct urb *urb)
static void woal_usb_receive(struct urb *urb)
#endif
{
urb_context *context = NULL;
@ -248,7 +245,8 @@ woal_usb_receive(struct urb *urb)
PRINTM(MERROR,
"EP %d Rx URB status failure: %d\n",
context->ep, urb->status);
/* Do not free mlan_buffer in case of command ep */
/* Do not free mlan_buffer in case of command ep
*/
if (cardp->rx_cmd_ep != context->ep)
woal_free_mlan_buffer(handle, pmbuf);
goto setup_for_next;
@ -263,8 +261,10 @@ woal_usb_receive(struct urb *urb)
status);
if (status == MLAN_STATUS_PENDING) {
queue_work(handle->workqueue, &handle->main_work);
/* urb for data_ep is re-submitted now, unless we reach HIGH_RX_PENDING */
/* urb for cmd_ep will be re-submitted in callback moal_recv_complete */
/* urb for data_ep is re-submitted now, unless we reach
* HIGH_RX_PENDING */
/* urb for cmd_ep will be re-submitted in callback
* moal_recv_complete */
if (cardp->rx_cmd_ep == context->ep)
goto rx_exit;
else if (atomic_read(&handle->rx_pending) >=
@ -278,8 +278,8 @@ woal_usb_receive(struct urb *urb)
PRINTM(MERROR,
"MLAN fail to process the receive data\n");
} else if ((status == MLAN_STATUS_SUCCESS) &&
(pmbuf->
flags & MLAN_BUF_FLAG_SLEEPCFM_RESP)) {
(pmbuf->flags &
MLAN_BUF_FLAG_SLEEPCFM_RESP)) {
pmbuf->flags &= ~MLAN_BUF_FLAG_SLEEPCFM_RESP;
queue_work(handle->workqueue,
&handle->main_work);
@ -289,9 +289,8 @@ woal_usb_receive(struct urb *urb)
woal_free_mlan_buffer(handle, pmbuf);
}
} else if (urb->status) {
if (!
((cardp->rx_data_ep == context->ep) &&
(cardp->resubmit_urbs == 1))) {
if (!((cardp->rx_data_ep == context->ep) &&
(cardp->resubmit_urbs == 1))) {
if (!handle->is_suspended) {
PRINTM(MMSG, "Card is removed: %d\n",
urb->status);
@ -339,8 +338,7 @@ rx_exit:
*
* @return N/A
*/
static void
woal_usb_tx_complete(struct urb *urb, struct pt_regs *regs)
static void woal_usb_tx_complete(struct urb *urb, struct pt_regs *regs)
#else
/**
* @brief Call back function to handle the status of the Tx data URB
@ -349,8 +347,7 @@ woal_usb_tx_complete(struct urb *urb, struct pt_regs *regs)
*
* @return N/A
*/
static void
woal_usb_tx_complete(struct urb *urb)
static void woal_usb_tx_complete(struct urb *urb)
#endif
{
urb_context *context = NULL;
@ -409,8 +406,7 @@ woal_usb_tx_complete(struct urb *urb)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_usb_submit_rx_urb(urb_context *ctx, int size)
static mlan_status woal_usb_submit_rx_urb(urb_context *ctx, int size)
{
moal_handle *handle = ctx->handle;
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
@ -453,8 +449,7 @@ woal_usb_submit_rx_urb(urb_context *ctx, int size)
cardp->rx_cmd_interval);
else
usb_fill_bulk_urb(ctx->urb, cardp->udev,
usb_rcvbulkpipe(cardp->udev, ctx->ep),
data,
usb_rcvbulkpipe(cardp->udev, ctx->ep), data,
size - ctx->pmbuf->data_offset,
woal_usb_receive, (void *)ctx);
if (cardp->rx_cmd_ep == ctx->ep)
@ -494,9 +489,8 @@ rx_ret:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_check_chip_revision(moal_handle *handle,
t_u32 *usb_chip_rev, t_u32 *usb_strap)
mlan_status woal_check_chip_revision(moal_handle *handle, t_u32 *usb_chip_rev,
t_u32 *usb_strap)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_buffer mbuf;
@ -536,8 +530,7 @@ woal_check_chip_revision(moal_handle *handle,
mbuf.data_len = tx_size;
/* Send the chip revision check frame */
ret = woal_usb_write_data_sync(handle,
&mbuf, cardp->tx_cmd_ep,
ret = woal_usb_write_data_sync(handle, &mbuf, cardp->tx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR,
@ -552,8 +545,7 @@ woal_check_chip_revision(moal_handle *handle,
mbuf.data_len = CHIP_REV_RX_BUF_SIZE;
/* Receive the chip revision check frame response */
ret = woal_usb_read_data_sync(handle,
&mbuf, cardp->rx_cmd_ep,
ret = woal_usb_read_data_sync(handle, &mbuf, cardp->rx_cmd_ep,
MLAN_USB_BULK_MSG_TIMEOUT);
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR,
@ -579,7 +571,6 @@ woal_check_chip_revision(moal_handle *handle,
*usb_strap = ack_pkt.strap & 0x7;
} else
PRINTM(MINFO, "chip_rev=0x%x\n", *usb_chip_rev);
}
cleanup:
kfree(recv_buff);
@ -596,8 +587,7 @@ cleanup:
* @param handle A pointer to moal_handle structure
* @return N/A
*/
static void
woal_usb_unlink_urb(void *card_desc)
static void woal_usb_unlink_urb(void *card_desc)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)card_desc;
int i;
@ -612,8 +602,8 @@ woal_usb_unlink_urb(void *card_desc)
if (atomic_read(&cardp->rx_data_urb_pending)) {
for (i = 0; i < MVUSB_RX_DATA_URB; i++) {
if (cardp->rx_data_list[i].urb)
usb_kill_urb(cardp->rx_data_list[i].
urb);
usb_kill_urb(
cardp->rx_data_list[i].urb);
}
}
/* Unlink Tx cmd URB */
@ -625,12 +615,11 @@ woal_usb_unlink_urb(void *card_desc)
if (atomic_read(&cardp->tx_data_urb_pending)) {
for (i = 0; i < MVUSB_TX_HIGH_WMARK; i++) {
if (cardp->tx_data_list[i].urb) {
usb_kill_urb(cardp->tx_data_list[i].
urb);
usb_kill_urb(
cardp->tx_data_list[i].urb);
}
}
}
}
LEAVE();
}
@ -642,8 +631,7 @@ woal_usb_unlink_urb(void *card_desc)
*
* @return N/A
*/
void
woal_usb_free(struct usb_card_rec *cardp)
void woal_usb_free(struct usb_card_rec *cardp)
{
int i;
@ -680,8 +668,7 @@ woal_usb_free(struct usb_card_rec *cardp)
return;
}
static t_u16
woal_update_card_type(t_void *card)
static t_u16 woal_update_card_type(t_void *card)
{
struct usb_card_rec *cardp_usb = (struct usb_card_rec *)card;
t_u16 card_type = 0;
@ -689,87 +676,92 @@ woal_update_card_type(t_void *card)
/* Update card type */
#ifdef USB8897
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8897_PID_1 ||
USB8897_PID_1 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8897_PID_2) {
USB8897_PID_2) {
card_type = CARD_TYPE_USB8897;
moal_memcpy_ext(NULL, driver_version, CARD_USB8897,
strlen(CARD_USB8897), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V15, strlen(V15),
strlen(KERN_VERSION),
V15, strlen(V15),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
strlen(KERN_VERSION));
}
#endif
#ifdef USB8997
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_1 ||
USB8997_PID_1 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_2 ||
USB8997_PID_2 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_3 ||
USB8997_PID_3 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_4 ||
USB8997_PID_4 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_5 ||
USB8997_PID_5 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997_PID_6 ||
USB8997_PID_6 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8997V2_PID_1) {
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),
strlen(KERN_VERSION),
V16, strlen(V16),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
strlen(KERN_VERSION));
}
#endif
#ifdef USB8978
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8978_PID_1 ||
USB8978_PID_1 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB8978_PID_2) {
USB8978_PID_2) {
card_type = CARD_TYPE_USB8978;
moal_memcpy_ext(NULL, driver_version, CARD_USB8978,
strlen(CARD_USB8978), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V16, strlen(V16),
strlen(KERN_VERSION),
V16, strlen(V16),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
strlen(KERN_VERSION));
}
#endif
#ifdef USB9098
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB9098_PID_1 ||
USB9098_PID_1 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB9098_PID_2) {
USB9098_PID_2) {
card_type = CARD_TYPE_USB9098;
moal_memcpy_ext(NULL, driver_version, CARD_USB9098,
strlen(CARD_USB9098), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V17, strlen(V17),
strlen(KERN_VERSION),
V17, strlen(V17),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
strlen(KERN_VERSION));
}
#endif
#ifdef USB9097
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB9097_PID_1 ||
USB9097_PID_1 ||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
USB9097_PID_2) {
USB9097_PID_2) {
card_type = CARD_TYPE_USB9097;
moal_memcpy_ext(NULL, driver_version, CARD_USB9097,
strlen(CARD_USB9097), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION), V17, strlen(V17),
strlen(KERN_VERSION),
V17, strlen(V17),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
strlen(KERN_VERSION));
}
#endif
return card_type;
@ -783,8 +775,8 @@ woal_update_card_type(t_void *card)
*
* @return Address of variable usb_cardp, error code otherwise
*/
static int
woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
static int woal_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_device *udev;
struct usb_host_interface *iface_desc;
@ -811,9 +803,9 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
/* Check probe is for our device */
for (i = 0; woal_usb_table[i].idVendor; i++) {
if (woal_cpu_to_le16(udev->descriptor.idVendor) ==
woal_usb_table[i].idVendor &&
woal_usb_table[i].idVendor &&
woal_cpu_to_le16(udev->descriptor.idProduct) ==
woal_usb_table[i].idProduct) {
woal_usb_table[i].idProduct) {
PRINTM(MMSG, "VID/PID = %X/%X, Boot2 version = %X\n",
woal_cpu_to_le16(udev->descriptor.idVendor),
woal_cpu_to_le16(udev->descriptor.idProduct),
@ -836,7 +828,8 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
#ifdef USB9097
case USB9097_PID_1:
#endif /* USB9097 */
/* If skip FW is set, we must return error so the next driver can download the FW */
/* If skip FW is set, we must return error so
* the next driver can download the FW */
if (skip_fwdnld)
goto error;
else
@ -861,12 +854,15 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_cardp->boot_state = USB_FW_READY;
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;
*/
/*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;
}
}
@ -876,7 +872,8 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
iface_desc = intf->cur_altsetting;
usb_cardp->intf = intf;
PRINTM(MINFO, "bcdUSB = 0x%X bDeviceClass = 0x%X"
PRINTM(MINFO,
"bcdUSB = 0x%X bDeviceClass = 0x%X"
" bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n",
woal_cpu_to_le16(udev->descriptor.bcdUSB),
udev->descriptor.bDeviceClass,
@ -886,12 +883,11 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
endpoint = &iface_desc->endpoint[i].desc;
if ((usb_endpoint_is_bulk_in(endpoint) ||
usb_endpoint_is_int_in(endpoint))
&& (usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT_IF2)
) {
usb_endpoint_is_int_in(endpoint)) &&
(usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT_IF2)) {
usb_cardp->rx_cmd_ep_type =
usb_endpoint_type(endpoint);
usb_cardp->rx_cmd_interval =
@ -899,13 +895,12 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
/* We found a bulk in command/event endpoint */
PRINTM(MCMND,
"Rx CMD/EVT: max packet size = %d, address = %d ep_type=%d\n",
woal_le16_to_cpu(endpoint->
wMaxPacketSize),
woal_le16_to_cpu(
endpoint->wMaxPacketSize),
endpoint->bEndpointAddress,
usb_cardp->rx_cmd_ep_type);
usb_cardp->rx_cmd_ep =
(endpoint->
bEndpointAddress &
(endpoint->bEndpointAddress &
USB_ENDPOINT_NUMBER_MASK);
atomic_set(&usb_cardp->rx_cmd_urb_pending, 0);
@ -914,48 +909,44 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_cardp->second_mac = MTRUE;
}
if (usb_endpoint_is_bulk_in(endpoint) &&
(usb_endpoint_num(endpoint) == MLAN_USB_EP_DATA
|| usb_endpoint_num(endpoint) ==
MLAN_USB_EP_DATA_IF2)
) {
(usb_endpoint_num(endpoint) == MLAN_USB_EP_DATA ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_DATA_IF2)) {
/* We found a bulk in data endpoint */
PRINTM(MINFO,
"Bulk IN: max packet size = %d, address = %d\n",
woal_le16_to_cpu(endpoint->
wMaxPacketSize),
woal_le16_to_cpu(
endpoint->wMaxPacketSize),
endpoint->bEndpointAddress);
usb_cardp->rx_data_ep =
(endpoint->
bEndpointAddress &
(endpoint->bEndpointAddress &
USB_ENDPOINT_NUMBER_MASK);
atomic_set(&usb_cardp->rx_data_urb_pending, 0);
}
if (usb_endpoint_is_bulk_out(endpoint) &&
(usb_endpoint_num(endpoint) == MLAN_USB_EP_DATA
|| usb_endpoint_num(endpoint) ==
MLAN_USB_EP_DATA_IF2)
) {
(usb_endpoint_num(endpoint) == MLAN_USB_EP_DATA ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_DATA_IF2)) {
/* We found a bulk out data endpoint */
PRINTM(MCMND,
"Bulk OUT: max packet size = %d, address = %d\n",
woal_le16_to_cpu(endpoint->
wMaxPacketSize),
woal_le16_to_cpu(
endpoint->wMaxPacketSize),
endpoint->bEndpointAddress);
usb_cardp->tx_data_ep =
endpoint->bEndpointAddress;
atomic_set(&usb_cardp->tx_data_urb_pending, 0);
usb_cardp->tx_data_maxpktsize =
woal_le16_to_cpu(endpoint->
wMaxPacketSize);
woal_le16_to_cpu(
endpoint->wMaxPacketSize);
}
if ((usb_endpoint_is_bulk_out(endpoint) ||
usb_endpoint_is_int_out(endpoint))
&& (usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT_IF2)
) {
usb_endpoint_is_int_out(endpoint)) &&
(usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT ||
usb_endpoint_num(endpoint) ==
MLAN_USB_EP_CMD_EVENT_IF2)) {
usb_cardp->tx_cmd_ep_type =
usb_endpoint_type(endpoint);
usb_cardp->tx_cmd_interval =
@ -963,16 +954,15 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
/* We found a bulk out command/event endpoint */
PRINTM(MCMND,
"Tx CMD: max packet size = %d, address = %d ep_type=%d\n",
woal_le16_to_cpu(endpoint->
wMaxPacketSize),
woal_le16_to_cpu(
endpoint->wMaxPacketSize),
endpoint->bEndpointAddress,
usb_cardp->tx_cmd_ep_type);
usb_cardp->tx_cmd_ep =
endpoint->bEndpointAddress;
atomic_set(&usb_cardp->tx_cmd_urb_pending, 0);
usb_cardp->tx_cmd_maxpktsize =
woal_le16_to_cpu(endpoint->
wMaxPacketSize);
usb_cardp->tx_cmd_maxpktsize = woal_le16_to_cpu(
endpoint->wMaxPacketSize);
}
}
@ -1012,9 +1002,8 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
}
/* At this point wlan_add_card() will be called */
if (!
(woal_add_card
(usb_cardp, &usb_cardp->udev->dev, &usb_ops, card_type))) {
if (!(woal_add_card(usb_cardp, &usb_cardp->udev->dev, &usb_ops,
card_type))) {
PRINTM(MERROR, "%s: woal_add_card failed\n",
__FUNCTION__);
goto error;
@ -1024,16 +1013,16 @@ woal_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
* default. So drivers wanting remote wakeup will have to enable
* this using -
* device_set_wakeup_enable(&udev->dev, 1);
* It has been observed that some cards having device attr = 0xa0
* do not support remote wakeup. These cards come immediately out
* of the suspend when power/wakeup file is set to 'enabled'.
* To support all types of cards i.e. with/without remote wakeup,
* we are NOT setting the 'power/wakeup' file from here.
* Also in principle, we are not supposed to change the wakeup
* policy, which is purely a userspace decision.
* It has been observed that some cards having device attr =
* 0xa0 do not support remote wakeup. These cards come
* immediately out of the suspend when power/wakeup file is set
* to 'enabled'. To support all types of cards i.e. with/without
* remote wakeup, we are NOT setting the 'power/wakeup' file
* from here. Also in principle, we are not supposed to change
* the wakeup policy, which is purely a userspace decision.
*/
/* if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP)
intf->needs_remote_wakeup = 1; */
/* if (udev->actconfig->desc.bmAttributes &
USB_CONFIG_ATT_WAKEUP) intf->needs_remote_wakeup = 1; */
#endif
usb_get_dev(udev);
LEAVE();
@ -1058,8 +1047,7 @@ error:
*
* @return N/A
*/
static void
woal_usb_disconnect(struct usb_interface *intf)
static void woal_usb_disconnect(struct usb_interface *intf)
{
struct usb_card_rec *cardp = usb_get_intfdata(intf);
moal_handle *phandle = NULL;
@ -1096,8 +1084,7 @@ woal_usb_disconnect(struct usb_interface *intf)
*
* @return N/A
*/
void
woal_kill_urbs(moal_handle *handle)
void woal_kill_urbs(moal_handle *handle)
{
ENTER();
handle->is_suspended = MTRUE;
@ -1113,8 +1100,7 @@ woal_kill_urbs(moal_handle *handle)
*
* @return N/A
*/
void
woal_resubmit_urbs(moal_handle *handle)
void woal_resubmit_urbs(moal_handle *handle)
{
struct usb_card_rec *cardp = handle->card;
@ -1144,8 +1130,7 @@ woal_resubmit_urbs(moal_handle *handle)
*
* @return MLAN_STATUS_SUCCESS
*/
static int
woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
struct usb_card_rec *cardp = usb_get_intfdata(intf);
moal_handle *handle = NULL;
@ -1227,8 +1212,7 @@ done:
*
* @return MLAN_STATUS_SUCCESS
*/
static int
woal_usb_resume(struct usb_interface *intf)
static int woal_usb_resume(struct usb_interface *intf)
{
struct usb_card_rec *cardp = usb_get_intfdata(intf);
moal_handle *handle = NULL;
@ -1278,8 +1262,8 @@ woal_usb_resume(struct usb_interface *intf)
MOAL_NO_WAIT);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
/* Resume handler may be called due to remote wakeup,
force to exit suspend anyway */
/* Resume handler may be called due to remote wakeup,
force to exit suspend anyway */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
cardp->udev->autosuspend_disabled = 1;
#else
@ -1311,8 +1295,7 @@ done:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_usb_tx_init(moal_handle *handle)
mlan_status woal_usb_tx_init(moal_handle *handle)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
int i;
@ -1355,8 +1338,7 @@ init_exit:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_usb_submit_rx_data_urbs(moal_handle *handle)
mlan_status woal_usb_submit_rx_data_urbs(moal_handle *handle)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
int i;
@ -1368,9 +1350,8 @@ woal_usb_submit_rx_data_urbs(moal_handle *handle)
if (cardp->rx_deaggr_ctrl.enable) {
buffer_len = cardp->rx_deaggr_ctrl.aggr_max;
if (cardp->rx_deaggr_ctrl.aggr_mode == MLAN_USB_AGGR_MODE_NUM) {
buffer_len *=
MAX(MLAN_USB_MAX_PKT_SIZE,
cardp->rx_deaggr_ctrl.aggr_align);
buffer_len *= MAX(MLAN_USB_MAX_PKT_SIZE,
cardp->rx_deaggr_ctrl.aggr_align);
buffer_len = MAX(buffer_len, MLAN_RX_DATA_BUF_SIZE);
}
}
@ -1378,8 +1359,8 @@ woal_usb_submit_rx_data_urbs(moal_handle *handle)
for (i = 0; i < MVUSB_RX_DATA_URB; i++) {
/* Submit Rx data URB */
if (!cardp->rx_data_list[i].pmbuf) {
if (woal_usb_submit_rx_urb
(&cardp->rx_data_list[i], buffer_len))
if (woal_usb_submit_rx_urb(&cardp->rx_data_list[i],
buffer_len))
continue;
}
ret = MLAN_STATUS_SUCCESS;
@ -1395,8 +1376,7 @@ woal_usb_submit_rx_data_urbs(moal_handle *handle)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_usb_rx_init(moal_handle *handle)
mlan_status woal_usb_rx_init(moal_handle *handle)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
int i;
@ -1418,8 +1398,8 @@ woal_usb_rx_init(moal_handle *handle)
woal_alloc_mlan_buffer(handle, MLAN_RX_CMD_BUF_SIZE);
if (cardp->rx_cmd.pmbuf) {
/* Submit Rx command URB */
if (woal_usb_submit_rx_urb
(&cardp->rx_cmd, MLAN_RX_CMD_BUF_SIZE)) {
if (woal_usb_submit_rx_urb(&cardp->rx_cmd,
MLAN_RX_CMD_BUF_SIZE)) {
ret = MLAN_STATUS_FAILURE;
goto init_exit;
}
@ -1456,9 +1436,9 @@ init_exit:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_usb_write_data_sync(moal_handle *handle, mlan_buffer *pmbuf,
t_u32 endpoint, t_u32 timeout)
static mlan_status woal_usb_write_data_sync(moal_handle *handle,
mlan_buffer *pmbuf, t_u32 endpoint,
t_u32 timeout)
{
struct usb_card_rec *cardp = handle->card;
t_u8 *data = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
@ -1500,9 +1480,9 @@ woal_usb_write_data_sync(moal_handle *handle, mlan_buffer *pmbuf,
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_usb_read_data_sync(moal_handle *handle, mlan_buffer *pmbuf, t_u32 endpoint,
t_u32 timeout)
static mlan_status woal_usb_read_data_sync(moal_handle *handle,
mlan_buffer *pmbuf, t_u32 endpoint,
t_u32 timeout)
{
struct usb_card_rec *cardp = handle->card;
t_u8 *data = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
@ -1531,10 +1511,11 @@ woal_usb_read_data_sync(moal_handle *handle, mlan_buffer *pmbuf, t_u32 endpoint,
* @param pmbuf Pointer to mlan_buffer structure
* @param ep Endpoint to send
*
* @return MLAN_STATUS_PENDING or MLAN_STATUS_FAILURE or MLAN_STATUS_RESOURCE
* @return MLAN_STATUS_PENDING or MLAN_STATUS_FAILURE or
* MLAN_STATUS_RESOURCE
*/
mlan_status
woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf, t_u8 ep)
mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
t_u8 ep)
{
struct usb_card_rec *cardp = handle->card;
urb_context *context = NULL;
@ -1600,11 +1581,11 @@ woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf, t_u8 ep)
(void *)context, cardp->tx_cmd_interval);
} else
usb_fill_bulk_urb(tx_urb, cardp->udev,
usb_sndbulkpipe(cardp->udev, ep),
data, data_len,
woal_usb_tx_complete, (void *)context);
/* We find on Ubuntu 12.10 this flag does not work */
//tx_urb->transfer_flags |= URB_ZERO_PACKET;
usb_sndbulkpipe(cardp->udev, ep), data,
data_len, woal_usb_tx_complete,
(void *)context);
/* We find on Ubuntu 12.10 this flag does not work */
// tx_urb->transfer_flags |= URB_ZERO_PACKET;
if (ep == cardp->tx_cmd_ep)
atomic_inc(&cardp->tx_cmd_urb_pending);
@ -1650,8 +1631,7 @@ tx_ret:
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status
woal_usb_register_dev(moal_handle *handle)
static mlan_status woal_usb_register_dev(moal_handle *handle)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
mlan_status ret = MLAN_STATUS_SUCCESS;
@ -1663,8 +1643,7 @@ woal_usb_register_dev(moal_handle *handle)
return ret;
}
static void
woal_usb_unregister_dev(moal_handle *handle)
static void woal_usb_unregister_dev(moal_handle *handle)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
PRINTM(MMSG, "USB: unregister device\n");
@ -1678,8 +1657,7 @@ woal_usb_unregister_dev(moal_handle *handle)
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status
woal_usb_bus_register(void)
mlan_status woal_usb_bus_register(void)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
@ -1704,8 +1682,7 @@ woal_usb_bus_register(void)
*
* @return N/A
*/
void
woal_usb_bus_unregister(void)
void woal_usb_bus_unregister(void)
{
ENTER();
/* API unregisters the driver from USB subsystem */
@ -1721,8 +1698,7 @@ woal_usb_bus_unregister(void)
* @return MTRUE/MFALSE
*
*/
static t_u8
woal_usb_is_second_mac(moal_handle *handle)
static t_u8 woal_usb_is_second_mac(moal_handle *handle)
{
return ((struct usb_card_rec *)(handle->card))->second_mac;
}
@ -1735,8 +1711,7 @@ woal_usb_is_second_mac(moal_handle *handle)
*
* @return 0 --success, otherwise fail
*/
int
woal_enter_usb_suspend(moal_handle *handle)
int woal_enter_usb_suspend(moal_handle *handle)
{
struct usb_device *udev = ((struct usb_card_rec *)(handle->card))->udev;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
@ -1762,12 +1737,14 @@ woal_enter_usb_suspend(moal_handle *handle)
/* Enter into USB suspend */
usb_lock_device(udev);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
udev->autosuspend_delay = 0; /* Autosuspend delay in jiffies */
udev->autosuspend_delay = 0; /* Autosuspend delay in jiffies */
#else
pm_runtime_set_autosuspend_delay(&udev->dev, 0); /* Autosuspend delay in jiffies */
pm_runtime_set_autosuspend_delay(&udev->dev, 0); /* Autosuspend delay in
jiffies */
#endif /* < 2.6.38 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
udev->autosuspend_disabled = 0; /* /sys/bus/usb/devices/.../power/level < auto */
udev->autosuspend_disabled = 0; /* /sys/bus/usb/devices/.../power/level
< auto */
#endif /* < 2.6.34 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
udev->autoresume_disabled = 0;
@ -1803,8 +1780,7 @@ woal_enter_usb_suspend(moal_handle *handle)
*
* @return 0 --success, otherwise fail
*/
int
woal_exit_usb_suspend(moal_handle *handle)
int woal_exit_usb_suspend(moal_handle *handle)
{
struct usb_device *udev = ((struct usb_card_rec *)(handle->card))->udev;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
@ -1824,11 +1800,13 @@ woal_exit_usb_suspend(moal_handle *handle)
LEAVE();
return -EFAULT;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
/* Exit from USB suspend */
usb_lock_device(udev);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
udev->autosuspend_disabled = 1; /* /sys/bus/usb/devices/.../power/level < on */
udev->autosuspend_disabled = 1; /* /sys/bus/usb/devices/.../power/level
< on */
#endif /* < 2.6.34 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
udev->autoresume_disabled = 0;
@ -1862,8 +1840,7 @@ woal_exit_usb_suspend(moal_handle *handle)
*
* @return N/A
*/
void
woal_submit_rx_urb(moal_handle *handle, t_u8 ep)
void woal_submit_rx_urb(moal_handle *handle, t_u8 ep)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
@ -1885,8 +1862,7 @@ woal_submit_rx_urb(moal_handle *handle, t_u8 ep)
*
* @return N/A
*/
void
woal_usb_dump_fw_info(moal_handle *phandle)
void woal_usb_dump_fw_info(moal_handle *phandle)
{
moal_private *priv = NULL;
mlan_ioctl_req *req = NULL;
@ -1924,8 +1900,7 @@ done:
return;
}
static mlan_status
woal_usb_get_fw_name(moal_handle *handle)
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)
@ -2001,6 +1976,7 @@ woal_usb_get_fw_name(moal_handle *handle)
break;
case USB9098_A0:
case USB9098_A1:
case USB9098_A2:
if (strap != 0) {
if (strap == CARD_TYPE_USB_UART)
strcpy(handle->card_info->fw_name,
@ -2013,7 +1989,6 @@ woal_usb_get_fw_name(moal_handle *handle)
USB9098_WLAN_V1_FW_NAME);
break;
}
}
#endif
#ifdef USB9097
@ -2033,7 +2008,6 @@ woal_usb_get_fw_name(moal_handle *handle)
USB9097_WLAN_V1_FW_NAME);
break;
}
}
#endif
done:

View File

@ -1,25 +1,25 @@
/** @file moal_usb.h
*
* @brief This file contains definitions for USB interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
*
* @brief This file contains definitions for USB interface.
* driver.
*
*
* Copyright 2014-2020 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.
*
*/
/*************************************************************
Change Log:
10/21/2008: initial version
@ -30,123 +30,124 @@ Change Log:
#ifdef USB8997
/** USB VID 1 */
#define USB8997_VID_1 0x1286
#define USB8997_VID_1 0x1286
/** USB PID 1 */
#define USB8997_PID_1 0x204D
#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 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
#define USB8978_VID_1 0x1286
/** USB PID 1 */
#define USB8978_PID_1 0x2062
#define USB8978_PID_1 0x2062
/** USB PID 2 */
#define USB8978_PID_2 0x2063
#define USB8978_PID_2 0x2063
/* BT downloaded combo firmware; register for WLAN enumeration */
#define USB8978_PID_1_BT 0x2064
#define USB8978_PID_2_BT 0x2065
#define USB8978_PID_1_BT 0x2064
#define USB8978_PID_2_BT 0x2065
#endif
#ifdef USB8897
/** USB VID 1 */
#define USB8897_VID_1 0x1286
#define USB8897_VID_1 0x1286
/** USB PID 1 */
#define USB8897_PID_1 0x2045
#define USB8897_PID_1 0x2045
/** USB PID 2 */
#define USB8897_PID_2 0x2046
#define USB8897_PID_2 0x2046
#endif /* USB8897 */
#ifdef USB9098
/** USB VID 1 */
#define USB9098_VID_1 0x1286
#define USB9098_VID_1 0x1286
/** USB PID 1 */
#define USB9098_PID_1 0x2056
#define USB9098_PID_1 0x2056
/** USB PID 2 */
#define USB9098_PID_2 0x2057
#define USB9098_PID_2 0x2057
#endif /* USB9098 */
#ifdef USB9097
/** USB VID 1 */
#define USB9097_VID_1 0x1286
#define USB9097_VID_1 0x1286
/** USB PID 1 */
#define USB9097_PID_1 0x2060
#define USB9097_PID_1 0x2060
/** USB PID 2 */
#define USB9097_PID_2 0x2061
#define USB9097_PID_2 0x2061
#endif /* USB9097 */
/** Boot state: FW download */
#define USB_FW_DNLD 1
#define USB_FW_DNLD 1
/** Boot state: FW ready */
#define USB_FW_READY 2
#define USB_FW_READY 2
/** High watermark for Tx data */
#define MVUSB_TX_HIGH_WMARK 12
#define MVUSB_TX_HIGH_WMARK 12
/** Number of Rx data URB */
#define MVUSB_RX_DATA_URB 6
#define MVUSB_RX_DATA_URB 6
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || defined(USB8978)
/* Transmit buffer size for chip revision check */
#define CHIP_REV_TX_BUF_SIZE 16
#define CHIP_REV_TX_BUF_SIZE 16
/* Receive buffer size for chip revision check */
#define CHIP_REV_RX_BUF_SIZE 2048
#define CHIP_REV_RX_BUF_SIZE 2048
/* Extensions */
#define EXTEND_HDR (0xAB950000)
#define EXTEND_V1 (0x00000001)
#define EXTEND_V2 (0x00000002)
#define EXTEND_HDR (0xAB950000)
#define EXTEND_V1 (0x00000001)
#define EXTEND_V2 (0x00000002)
#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"
#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/usbusb8978_combo.bin"
#define USB8978_DEFAULT_WLAN_FW_NAME "nxp/usb8978_wlan.bin"
#define USBUART8978_DEFAULT_COMBO_FW_NAME "nxp/usbuart8978_combo.bin"
#define USBUSB8978_DEFAULT_COMBO_FW_NAME "nxp/usbusb8978_combo.bin"
#define USB8978_DEFAULT_COMBO_FW_NAME "nxp/usbusb8978_combo.bin"
#define USB8978_DEFAULT_WLAN_FW_NAME "nxp/usb8978_wlan.bin"
#define USBUART8978_DEFAULT_COMBO_FW_NAME "nxp/usbuart8978_combo.bin"
#define USBUSB8978_DEFAULT_COMBO_FW_NAME "nxp/usbusb8978_combo.bin"
#endif /* USB8978 */
#ifdef USB8897
#define USB8897_DEFAULT_COMBO_FW_NAME "nxp/usb8897_uapsta.bin"
#define USB8897_DEFAULT_WLAN_FW_NAME "nxp/usb8897_wlan.bin"
#define USB8897_DEFAULT_COMBO_FW_NAME "nxp/usb8897_uapsta.bin"
#define USB8897_DEFAULT_WLAN_FW_NAME "nxp/usb8897_wlan.bin"
#endif /* USB8897 */
#ifdef USB9098
#define USB9098_Z1Z2 0x00
#define USB9098_A0 0x01
#define USB9098_A1 0x02
#define USB9098_DEFAULT_COMBO_FW_NAME "nxp/usbusb9098_combo.bin"
#define USB9098_DEFAULT_WLAN_FW_NAME "nxp/usb9098_wlan.bin"
#define USBUART9098_DEFAULT_COMBO_FW_NAME "nxp/usbuart9098_combo.bin"
#define USBUSB9098_DEFAULT_COMBO_FW_NAME "nxp/usbusb9098_combo.bin"
#define USB9098_WLAN_V1_FW_NAME "nxp/usb9098_wlan_v1.bin"
#define USBUART9098_COMBO_V1_FW_NAME "nxp/usbuart9098_combo_v1.bin"
#define USBUSB9098_COMBO_V1_FW_NAME "nxp/usbusb9098_combo_v1.bin"
#define USB9098_Z1Z2 0x00
#define USB9098_A0 0x01
#define USB9098_A1 0x02
#define USB9098_A2 0x03
#define USB9098_DEFAULT_COMBO_FW_NAME "nxp/usbusb9098_combo.bin"
#define USB9098_DEFAULT_WLAN_FW_NAME "nxp/usb9098_wlan.bin"
#define USBUART9098_DEFAULT_COMBO_FW_NAME "nxp/usbuart9098_combo.bin"
#define USBUSB9098_DEFAULT_COMBO_FW_NAME "nxp/usbusb9098_combo.bin"
#define USB9098_WLAN_V1_FW_NAME "nxp/usb9098_wlan_v1.bin"
#define USBUART9098_COMBO_V1_FW_NAME "nxp/usbuart9098_combo_v1.bin"
#define USBUSB9098_COMBO_V1_FW_NAME "nxp/usbusb9098_combo_v1.bin"
#endif /* USB9098 */
#ifdef USB9097
#define USB9097_B0 0x01
#define USB9097_B1 0x02
#define USB9097_DEFAULT_COMBO_FW_NAME "nxp/usbusb9097_combo_v1.bin"
#define USB9097_DEFAULT_WLAN_FW_NAME "nxp/usb9097_wlan_v1.bin"
#define USB9097_WLAN_V1_FW_NAME "nxp/usb9097_wlan_v1.bin"
#define USBUART9097_COMBO_V1_FW_NAME "nxp/usbuart9097_combo_v1.bin"
#define USBUSB9097_COMBO_V1_FW_NAME "nxp/usbusb9097_combo_v1.bin"
#define USB9097_B0 0x01
#define USB9097_B1 0x02
#define USB9097_DEFAULT_COMBO_FW_NAME "nxp/usbusb9097_combo_v1.bin"
#define USB9097_DEFAULT_WLAN_FW_NAME "nxp/usb9097_wlan_v1.bin"
#define USB9097_WLAN_V1_FW_NAME "nxp/usb9097_wlan_v1.bin"
#define USBUART9097_COMBO_V1_FW_NAME "nxp/usbuart9097_combo_v1.bin"
#define USBUSB9097_COMBO_V1_FW_NAME "nxp/usbusb9097_combo_v1.bin"
#endif /* USB9097 */
/** urb context */
@ -169,9 +170,9 @@ struct usb_card_rec {
moal_handle *phandle;
/** USB interface */
struct usb_interface *intf;
/** Rx command endpoint type */
/** Rx command endpoint type */
int rx_cmd_ep_type;
/** Rx command interval for INTR type */
/** Rx command interval for INTR type */
t_u8 rx_cmd_interval;
/** Rx data endpoint address */
t_u8 rx_cmd_ep;
@ -181,7 +182,7 @@ struct usb_card_rec {
atomic_t rx_cmd_urb_pending;
/** Rx data context list */
urb_context rx_data_list[MVUSB_RX_DATA_URB];
/** Flag to indicate boot state */
/** Flag to indicate boot state */
t_u8 boot_state;
/** Rx data endpoint address */
t_u8 rx_data_ep;
@ -189,9 +190,9 @@ struct usb_card_rec {
atomic_t rx_data_urb_pending;
/** Tx data endpoint address */
t_u8 tx_data_ep;
/** Tx command endpoint type */
/** Tx command endpoint type */
int tx_cmd_ep_type;
/** Tx command interval for INTR type */
/** Tx command interval for INTR type */
t_u8 tx_cmd_interval;
/** Tx command endpoint address */
t_u8 tx_cmd_ep;
@ -199,9 +200,9 @@ struct usb_card_rec {
atomic_t tx_data_urb_pending;
/** Tx command URB pending count */
atomic_t tx_cmd_urb_pending;
/** Tx data endpoint max pkt size */
/** Tx data endpoint max pkt size */
int tx_data_maxpktsize;
/** Tx cmd endpoint max pkt size */
/** Tx cmd endpoint max pkt size */
int tx_cmd_maxpktsize;
/** Pre-allocated urb for command */
urb_context tx_cmd;

View File

@ -2,23 +2,23 @@
*
* @brief This file contains definition for wireless extension IOCTL call.
*
*
* Copyright 2014-2020 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.
*
*/
*
* Copyright 2014-2020 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.
*
*/
/********************************************************
Change log:
@ -29,22 +29,28 @@ Change log:
#define _WOAL_WEXT_H_
/** NF value for default scan */
#define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
#define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
/** Add event */
#define IWE_STREAM_ADD_EVENT(i, c, e, w, l) iwe_stream_add_event((i), (c), (e), (w), (l))
#define IWE_STREAM_ADD_EVENT(i, c, e, w, l) \
iwe_stream_add_event((i), (c), (e), (w), (l))
/** Add point */
#define IWE_STREAM_ADD_POINT(i, c, e, w, p) iwe_stream_add_point((i), (c), (e), (w), (p))
#define IWE_STREAM_ADD_POINT(i, c, e, w, p) \
iwe_stream_add_point((i), (c), (e), (w), (p))
/** Add value */
#define IWE_STREAM_ADD_VALUE(i, c, v, e, w, l) iwe_stream_add_value((i), (c), (v), (e), (w), (l))
#define IWE_STREAM_ADD_VALUE(i, c, v, e, w, l) \
iwe_stream_add_value((i), (c), (v), (e), (w), (l))
#else
/** Add event */
#define IWE_STREAM_ADD_EVENT(i, c, e, w, l) iwe_stream_add_event((c), (e), (w), (l))
#define IWE_STREAM_ADD_EVENT(i, c, e, w, l) \
iwe_stream_add_event((c), (e), (w), (l))
/** Add point */
#define IWE_STREAM_ADD_POINT(i, c, e, w, p) iwe_stream_add_point((c), (e), (w), (p))
#define IWE_STREAM_ADD_POINT(i, c, e, w, p) \
iwe_stream_add_point((c), (e), (w), (p))
/** Add value */
#define IWE_STREAM_ADD_VALUE(i, c, v, e, w, l) iwe_stream_add_value((c), (v), (e), (w), (l))
#define IWE_STREAM_ADD_VALUE(i, c, v, e, w, l) \
iwe_stream_add_value((c), (v), (e), (w), (l))
#endif
extern struct iw_handler_def woal_handler_def;