mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2025-01-15 16:25:35 +00:00
MA-21616 [Android_8MP_EVK] WiFi: Device reboot when accessing webpage
Reason: this issue same as WCSWREL-468,which WCS has provide the p3 patch to fix this issue Test: i.MX 8MP Change-Id: I07327ba3f784e7c842c477e883f985a8ebbf1e26 Signed-off-by: yunjie <yunjie.jia@nxp.com>
This commit is contained in:
parent
5de735a978
commit
e6e7751008
27 changed files with 688 additions and 273 deletions
|
@ -93,10 +93,8 @@ CONFIG_BIG_ENDIAN=n
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SDIO_MMC
|
|
||||||
# SDIO suspend/resume
|
# SDIO suspend/resume
|
||||||
CONFIG_SDIO_SUSPEND_RESUME=y
|
CONFIG_SDIO_SUSPEND_RESUME=y
|
||||||
#endif
|
|
||||||
|
|
||||||
# DFS testing support
|
# DFS testing support
|
||||||
CONFIG_DFS_TESTING_SUPPORT=y
|
CONFIG_DFS_TESTING_SUPPORT=y
|
||||||
|
@ -108,6 +106,8 @@ CONFIG_MULTI_CHAN_SUPPORT=y
|
||||||
|
|
||||||
CONFIG_DUMP_TO_PROC=y
|
CONFIG_DUMP_TO_PROC=y
|
||||||
|
|
||||||
|
CONFIG_TASKLET_SUPPORT=n
|
||||||
|
|
||||||
|
|
||||||
#32bit app over 64bit kernel support
|
#32bit app over 64bit kernel support
|
||||||
CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
|
CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
|
||||||
|
@ -200,11 +200,9 @@ ifeq ($(CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT),y)
|
||||||
ccflags-y += -DUSERSPACE_32BIT_OVER_KERNEL_64BIT
|
ccflags-y += -DUSERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#ifdef SDIO_MMC
|
|
||||||
ifeq ($(CONFIG_SDIO_SUSPEND_RESUME),y)
|
ifeq ($(CONFIG_SDIO_SUSPEND_RESUME),y)
|
||||||
ccflags-y += -DSDIO_SUSPEND_RESUME
|
ccflags-y += -DSDIO_SUSPEND_RESUME
|
||||||
endif
|
endif
|
||||||
#endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MULTI_CHAN_SUPPORT),y)
|
ifeq ($(CONFIG_MULTI_CHAN_SUPPORT),y)
|
||||||
ccflags-y += -DMULTI_CHAN_SUPPORT
|
ccflags-y += -DMULTI_CHAN_SUPPORT
|
||||||
|
@ -224,6 +222,10 @@ ifeq ($(CONFIG_DUMP_TO_PROC), y)
|
||||||
ccflags-y += -DDUMP_TO_PROC
|
ccflags-y += -DDUMP_TO_PROC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_TASKLET_SUPPORT), y)
|
||||||
|
ccflags-y += -DTASKLET_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
|
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
|
||||||
ccflags-y += -DOPENWRT
|
ccflags-y += -DOPENWRT
|
||||||
endif
|
endif
|
||||||
|
@ -330,12 +332,10 @@ ifeq ($(CONFIG_PCIEIW624),y)
|
||||||
CONFIG_PCIE=y
|
CONFIG_PCIE=y
|
||||||
ccflags-y += -DPCIEIW624
|
ccflags-y += -DPCIEIW624
|
||||||
endif
|
endif
|
||||||
#ifdef PCIEAW693_OPT
|
|
||||||
ifeq ($(CONFIG_PCIEAW693),y)
|
ifeq ($(CONFIG_PCIEAW693),y)
|
||||||
CONFIG_PCIE=y
|
CONFIG_PCIE=y
|
||||||
ccflags-y += -DPCIEAW693
|
ccflags-y += -DPCIEAW693
|
||||||
endif
|
endif
|
||||||
#endif
|
|
||||||
ifeq ($(CONFIG_SDIO),y)
|
ifeq ($(CONFIG_SDIO),y)
|
||||||
ccflags-y += -DSDIO
|
ccflags-y += -DSDIO
|
||||||
ccflags-y += -DSDIO_MMC
|
ccflags-y += -DSDIO_MMC
|
||||||
|
|
|
@ -947,9 +947,9 @@ mlan_status wlan_ret_802_11d_domain_info(mlan_private *pmpriv,
|
||||||
/* Dump domain info response data */
|
/* Dump domain info response data */
|
||||||
HEXDUMP("11D: DOMAIN Info Rsp Data", (t_u8 *)resp, resp->size);
|
HEXDUMP("11D: DOMAIN Info Rsp Data", (t_u8 *)resp, resp->size);
|
||||||
|
|
||||||
no_of_sub_band = (t_u8)(
|
no_of_sub_band = (t_u8)((wlan_le16_to_cpu(domain->header.len) -
|
||||||
(wlan_le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
|
COUNTRY_CODE_LEN) /
|
||||||
sizeof(IEEEtypes_SubbandSet_t));
|
sizeof(IEEEtypes_SubbandSet_t));
|
||||||
|
|
||||||
PRINTM(MINFO, "11D Domain Info Resp: number of sub-band=%d\n",
|
PRINTM(MINFO, "11D Domain Info Resp: number of sub-band=%d\n",
|
||||||
no_of_sub_band);
|
no_of_sub_band);
|
||||||
|
|
|
@ -3019,10 +3019,11 @@ int wlan_send_addba(mlan_private *priv, int tid, t_u8 *peer_mac)
|
||||||
PRINTM(MCMND, "Send addba: TID %d, " MACSTR "\n", tid,
|
PRINTM(MCMND, "Send addba: TID %d, " MACSTR "\n", tid,
|
||||||
MAC2STR(peer_mac));
|
MAC2STR(peer_mac));
|
||||||
|
|
||||||
add_ba_req.block_ack_param_set = (t_u16)(
|
add_ba_req.block_ack_param_set =
|
||||||
(tid << BLOCKACKPARAM_TID_POS) |
|
(t_u16)((tid << BLOCKACKPARAM_TID_POS) |
|
||||||
(priv->add_ba_param.tx_win_size << BLOCKACKPARAM_WINSIZE_POS) |
|
(priv->add_ba_param.tx_win_size
|
||||||
IMMEDIATE_BLOCK_ACK);
|
<< BLOCKACKPARAM_WINSIZE_POS) |
|
||||||
|
IMMEDIATE_BLOCK_ACK);
|
||||||
/** enable AMSDU inside AMPDU */
|
/** enable AMSDU inside AMPDU */
|
||||||
if (priv->add_ba_param.tx_amsdu &&
|
if (priv->add_ba_param.tx_amsdu &&
|
||||||
(priv->aggr_prio_tbl[tid].amsdu != BA_STREAM_NOT_ALLOWED))
|
(priv->aggr_prio_tbl[tid].amsdu != BA_STREAM_NOT_ALLOWED))
|
||||||
|
|
|
@ -209,7 +209,11 @@ static mlan_status wlan_11n_dispatch_pkt_until_start_win(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear the bits of reorder bitmap that has been dispatched */
|
/* clear the bits of reorder bitmap that has been dispatched */
|
||||||
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> no_pkt_to_send;
|
if (no_pkt_to_send < (8 * (sizeof(rx_reor_tbl_ptr->bitmap))))
|
||||||
|
rx_reor_tbl_ptr->bitmap =
|
||||||
|
rx_reor_tbl_ptr->bitmap >> no_pkt_to_send;
|
||||||
|
else
|
||||||
|
rx_reor_tbl_ptr->bitmap = 0;
|
||||||
|
|
||||||
rx_reor_tbl_ptr->start_win = start_win;
|
rx_reor_tbl_ptr->start_win = start_win;
|
||||||
pmpriv->adapter->callbacks.moal_spin_unlock(
|
pmpriv->adapter->callbacks.moal_spin_unlock(
|
||||||
|
@ -290,7 +294,10 @@ static mlan_status wlan_11n_scan_and_dispatch(t_void *priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear the bits of reorder bitmap that has been dispatched */
|
/* clear the bits of reorder bitmap that has been dispatched */
|
||||||
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> i;
|
if (i < (8 * sizeof(rx_reor_tbl_ptr->bitmap)))
|
||||||
|
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> i;
|
||||||
|
else
|
||||||
|
rx_reor_tbl_ptr->bitmap = 0;
|
||||||
|
|
||||||
rx_reor_tbl_ptr->start_win =
|
rx_reor_tbl_ptr->start_win =
|
||||||
(rx_reor_tbl_ptr->start_win + i) & (MAX_TID_VALUE - 1);
|
(rx_reor_tbl_ptr->start_win + i) & (MAX_TID_VALUE - 1);
|
||||||
|
|
|
@ -691,20 +691,21 @@ static cfp_table_t cfp_table_A[] = {
|
||||||
/** Number of the CFP tables for 5GHz */
|
/** Number of the CFP tables for 5GHz */
|
||||||
#define MLAN_CFP_TABLE_SIZE_A (NELEMENTS(cfp_table_A))
|
#define MLAN_CFP_TABLE_SIZE_A (NELEMENTS(cfp_table_A))
|
||||||
|
|
||||||
enum { RATEID_DBPSK1Mbps, //(0)
|
enum {
|
||||||
RATEID_DQPSK2Mbps, //(1)
|
RATEID_DBPSK1Mbps, //(0)
|
||||||
RATEID_CCK5_5Mbps, //(2)
|
RATEID_DQPSK2Mbps, //(1)
|
||||||
RATEID_CCK11Mbps, //(3)
|
RATEID_CCK5_5Mbps, //(2)
|
||||||
RATEID_CCK22Mbps, //(4)
|
RATEID_CCK11Mbps, //(3)
|
||||||
RATEID_OFDM6Mbps, //(5)
|
RATEID_CCK22Mbps, //(4)
|
||||||
RATEID_OFDM9Mbps, //(6)
|
RATEID_OFDM6Mbps, //(5)
|
||||||
RATEID_OFDM12Mbps, //(7)
|
RATEID_OFDM9Mbps, //(6)
|
||||||
RATEID_OFDM18Mbps, //(8)
|
RATEID_OFDM12Mbps, //(7)
|
||||||
RATEID_OFDM24Mbps, //(9)
|
RATEID_OFDM18Mbps, //(8)
|
||||||
RATEID_OFDM36Mbps, //(10)
|
RATEID_OFDM24Mbps, //(9)
|
||||||
RATEID_OFDM48Mbps, //(11)
|
RATEID_OFDM36Mbps, //(10)
|
||||||
RATEID_OFDM54Mbps, //(12)
|
RATEID_OFDM48Mbps, //(11)
|
||||||
RATEID_OFDM72Mbps, //(13)
|
RATEID_OFDM54Mbps, //(12)
|
||||||
|
RATEID_OFDM72Mbps, //(13)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const t_u8 rateUnit_500Kbps[] = {
|
static const t_u8 rateUnit_500Kbps[] = {
|
||||||
|
@ -1685,12 +1686,12 @@ t_u32 wlan_index_to_data_rate(pmlan_adapter pmadapter, t_u8 index,
|
||||||
if (gi > 0)
|
if (gi > 0)
|
||||||
gi = gi - 1;
|
gi = gi - 1;
|
||||||
|
|
||||||
//#ifdef ENABLE_802_11AX
|
// #ifdef ENABLE_802_11AX
|
||||||
// TODO: hardcode he_tone here, wait for FW value ready.
|
// TODO: hardcode he_tone here, wait for FW value ready.
|
||||||
// he_tone = 4;
|
// he_tone = 4;
|
||||||
|
|
||||||
// he_tone = (ext_rate_info & 0xE) >> 1;
|
// he_tone = (ext_rate_info & 0xE) >> 1;
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
if ((index >> 4) == 1) {
|
if ((index >> 4) == 1) {
|
||||||
switch (mcs_index) {
|
switch (mcs_index) {
|
||||||
|
@ -1936,9 +1937,9 @@ t_u8 wlan_get_txpwr_of_chan_from_cfp(mlan_private *pmpriv, t_u16 band,
|
||||||
(cfp_a + j)
|
(cfp_a + j)
|
||||||
->max_tx_power);
|
->max_tx_power);
|
||||||
else
|
else
|
||||||
tx_power = (t_u8)(
|
tx_power =
|
||||||
(cfp_a + j)
|
(t_u8)((cfp_a + j)
|
||||||
->max_tx_power);
|
->max_tx_power);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3537,14 +3537,16 @@ t_void wlan_check_ps_cond(mlan_adapter *pmadapter)
|
||||||
|
|
||||||
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd &&
|
if (!pmadapter->cmd_sent && !pmadapter->curr_cmd &&
|
||||||
!pmadapter->keep_wakeup && !wlan_is_tx_pending(pmadapter) &&
|
!pmadapter->keep_wakeup && !wlan_is_tx_pending(pmadapter) &&
|
||||||
!pmadapter->event_cause && !IS_CARD_RX_RCVD(pmadapter)) {
|
!wlan_is_rx_pending(pmadapter) && !pmadapter->event_cause &&
|
||||||
|
!IS_CARD_RX_RCVD(pmadapter)) {
|
||||||
wlan_dnld_sleep_confirm_cmd(pmadapter);
|
wlan_dnld_sleep_confirm_cmd(pmadapter);
|
||||||
} else {
|
} else {
|
||||||
PRINTM(MCMND, "Delay Sleep Confirm (%s%s%s%s)\n",
|
PRINTM(MCMND, "Delay Sleep Confirm (%s%s%s%s%s%s)\n",
|
||||||
(pmadapter->cmd_sent) ? "D" : "",
|
(pmadapter->cmd_sent) ? "D" : "",
|
||||||
(pmadapter->curr_cmd) ? "C" : "",
|
(pmadapter->curr_cmd) ? "C" : "",
|
||||||
(pmadapter->event_cause) ? "V" : "",
|
(pmadapter->event_cause) ? "V" : "",
|
||||||
(wlan_is_tx_pending(pmadapter)) ? "T" : "",
|
(wlan_is_tx_pending(pmadapter)) ? "T" : "",
|
||||||
|
(wlan_is_rx_pending(pmadapter)) ? "P" : "",
|
||||||
(IS_CARD_RX_RCVD(pmadapter)) ? "R" : "");
|
(IS_CARD_RX_RCVD(pmadapter)) ? "R" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5372,8 +5374,9 @@ mlan_status wlan_process_csi_event(pmlan_private pmpriv)
|
||||||
MLAN_MEM_DEF, &evt_buf);
|
MLAN_MEM_DEF, &evt_buf);
|
||||||
if ((status == MLAN_STATUS_SUCCESS) && evt_buf) {
|
if ((status == MLAN_STATUS_SUCCESS) && evt_buf) {
|
||||||
t_u16 csi_sig;
|
t_u16 csi_sig;
|
||||||
pcsi_record_ds csi_record = (pcsi_record_ds)(
|
pcsi_record_ds csi_record =
|
||||||
pmbuf->pbuf + pmbuf->data_offset + sizeof(eventcause));
|
(pcsi_record_ds)(pmbuf->pbuf + pmbuf->data_offset +
|
||||||
|
sizeof(eventcause));
|
||||||
/* Check CSI signature */
|
/* Check CSI signature */
|
||||||
csi_sig = csi_record->CSI_Sign;
|
csi_sig = csi_record->CSI_Sign;
|
||||||
if (csi_sig != CSI_SIGNATURE) {
|
if (csi_sig != CSI_SIGNATURE) {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define _MLAN_DECL_H_
|
#define _MLAN_DECL_H_
|
||||||
|
|
||||||
/** MLAN release version */
|
/** MLAN release version */
|
||||||
#define MLAN_RELEASE_VERSION "408.p2"
|
#define MLAN_RELEASE_VERSION "408.p3"
|
||||||
|
|
||||||
/** Re-define generic data types for MLAN/MOAL */
|
/** Re-define generic data types for MLAN/MOAL */
|
||||||
/** Signed char (1-byte) */
|
/** Signed char (1-byte) */
|
||||||
|
@ -275,7 +275,7 @@ typedef t_s32 t_sval;
|
||||||
|
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
/* Interrupt type */
|
/* Interrupt type */
|
||||||
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP };
|
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP, RX_CMD_DNLD };
|
||||||
#endif
|
#endif
|
||||||
#ifdef USB
|
#ifdef USB
|
||||||
#define MLAN_USB_BLOCK_SIZE (512)
|
#define MLAN_USB_BLOCK_SIZE (512)
|
||||||
|
@ -936,29 +936,34 @@ enum mlan_channel_type {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** channel band */
|
/** channel band */
|
||||||
enum { BAND_2GHZ = 0,
|
enum {
|
||||||
BAND_5GHZ = 1,
|
BAND_2GHZ = 0,
|
||||||
BAND_6GHZ = 2,
|
BAND_5GHZ = 1,
|
||||||
BAND_4GHZ = 3,
|
BAND_6GHZ = 2,
|
||||||
|
BAND_4GHZ = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** channel offset */
|
/** channel offset */
|
||||||
enum { SEC_CHAN_NONE = 0,
|
enum {
|
||||||
SEC_CHAN_ABOVE = 1,
|
SEC_CHAN_NONE = 0,
|
||||||
SEC_CHAN_5MHZ = 2,
|
SEC_CHAN_ABOVE = 1,
|
||||||
SEC_CHAN_BELOW = 3 };
|
SEC_CHAN_5MHZ = 2,
|
||||||
|
SEC_CHAN_BELOW = 3
|
||||||
|
};
|
||||||
|
|
||||||
/** channel bandwidth */
|
/** channel bandwidth */
|
||||||
enum { CHAN_BW_20MHZ = 0,
|
enum {
|
||||||
CHAN_BW_10MHZ,
|
CHAN_BW_20MHZ = 0,
|
||||||
CHAN_BW_40MHZ,
|
CHAN_BW_10MHZ,
|
||||||
CHAN_BW_80MHZ,
|
CHAN_BW_40MHZ,
|
||||||
|
CHAN_BW_80MHZ,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** scan mode */
|
/** scan mode */
|
||||||
enum { SCAN_MODE_MANUAL = 0,
|
enum {
|
||||||
SCAN_MODE_ACS,
|
SCAN_MODE_MANUAL = 0,
|
||||||
SCAN_MODE_USER,
|
SCAN_MODE_ACS,
|
||||||
|
SCAN_MODE_USER,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** DFS state */
|
/** DFS state */
|
||||||
|
|
|
@ -672,7 +672,7 @@ static int wlan_update_rsn_ie(mlan_private *pmpriv,
|
||||||
t_u8 preference_selected;
|
t_u8 preference_selected;
|
||||||
t_u8 cipher_selected_id;
|
t_u8 cipher_selected_id;
|
||||||
#if 0 // defined(ENABLE_GCMP_SUPPORT)
|
#if 0 // defined(ENABLE_GCMP_SUPPORT)
|
||||||
// embedded supplicant doesn't support GCMP yet
|
// embedded supplicant doesn't support GCMP yet
|
||||||
t_u8 cipher_preference[11] = {0, 0, 1, 0, 2, 0, 0, 0, 4, 5, 3};
|
t_u8 cipher_preference[11] = {0, 0, 1, 0, 2, 0, 0, 0, 4, 5, 3};
|
||||||
#else
|
#else
|
||||||
t_u8 cipher_preference[5] = {0, 0, 1, 0, 2};
|
t_u8 cipher_preference[5] = {0, 0, 1, 0, 2};
|
||||||
|
|
|
@ -2189,6 +2189,8 @@ typedef struct _mlan_pcie_card {
|
||||||
t_u32 pcie_int_mode;
|
t_u32 pcie_int_mode;
|
||||||
/** PCIE function number */
|
/** PCIE function number */
|
||||||
t_u8 func_num;
|
t_u8 func_num;
|
||||||
|
/** rx interrupt pending */
|
||||||
|
t_u8 rx_pending;
|
||||||
/** pending num of tx ring buffer in firmware */
|
/** pending num of tx ring buffer in firmware */
|
||||||
t_u8 txbd_pending;
|
t_u8 txbd_pending;
|
||||||
/** Write pointer for TXBD ring */
|
/** Write pointer for TXBD ring */
|
||||||
|
@ -2351,6 +2353,16 @@ struct _mlan_adapter {
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
/** rx data lock to synchronize wlan_pcie_process_recv_data */
|
/** rx data lock to synchronize wlan_pcie_process_recv_data */
|
||||||
t_void *pmlan_rx_lock;
|
t_void *pmlan_rx_lock;
|
||||||
|
/** PCIe rx process */
|
||||||
|
t_u8 pcie_rx_processing;
|
||||||
|
/** PCIe event process */
|
||||||
|
t_u8 pcie_event_processing;
|
||||||
|
/** PCIe tx process */
|
||||||
|
t_u8 pcie_tx_processing;
|
||||||
|
/** pcie cmd_dnld_int flag */
|
||||||
|
t_u8 pcie_cmd_dnld_int;
|
||||||
|
/** more_tx_task_flag */
|
||||||
|
t_u32 more_tx_task_flag;
|
||||||
/** tx data lock to synchronize send_data and send_data_complete */
|
/** tx data lock to synchronize send_data and send_data_complete */
|
||||||
t_void *pmlan_tx_lock;
|
t_void *pmlan_tx_lock;
|
||||||
/** event lock to synchronize process_event and event_ready */
|
/** event lock to synchronize process_event and event_ready */
|
||||||
|
@ -2731,6 +2743,8 @@ struct _mlan_adapter {
|
||||||
t_u8 wakeup_fw_timer_is_set;
|
t_u8 wakeup_fw_timer_is_set;
|
||||||
/** Number of wake up timeouts */
|
/** Number of wake up timeouts */
|
||||||
t_u32 pm_wakeup_timeout;
|
t_u32 pm_wakeup_timeout;
|
||||||
|
/** Card wakeup flag */
|
||||||
|
t_u8 pm_wakeup_flag;
|
||||||
|
|
||||||
/** Host Sleep configured flag */
|
/** Host Sleep configured flag */
|
||||||
t_u8 is_hs_configured;
|
t_u8 is_hs_configured;
|
||||||
|
@ -2988,6 +3002,21 @@ static inline t_u8 wlan_is_tx_pending(mlan_adapter *pmadapter)
|
||||||
return MFALSE;
|
return MFALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief check if Rx pending
|
||||||
|
*
|
||||||
|
* @param pmadapter Pointer to mlan_adapter
|
||||||
|
* @return MTRUE/MFALSE;
|
||||||
|
*/
|
||||||
|
static inline t_u8 wlan_is_rx_pending(mlan_adapter *pmadapter)
|
||||||
|
{
|
||||||
|
#ifdef PCIE
|
||||||
|
if (IS_PCIE(pmadapter->card_type) && pmadapter->pcard_pcie->rx_pending)
|
||||||
|
return MTRUE;
|
||||||
|
#endif
|
||||||
|
return MFALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/** process host cmd */
|
/** process host cmd */
|
||||||
mlan_status wlan_misc_ioctl_host_cmd(pmlan_adapter pmadapter,
|
mlan_status wlan_misc_ioctl_host_cmd(pmlan_adapter pmadapter,
|
||||||
pmlan_ioctl_req pioctl_req);
|
pmlan_ioctl_req pioctl_req);
|
||||||
|
|
|
@ -693,7 +693,9 @@ t_void wlan_wakeup_card_timeout_func(void *function_context)
|
||||||
PRINTM(MERROR, "Wakeup card timeout(%d)!\n",
|
PRINTM(MERROR, "Wakeup card timeout(%d)!\n",
|
||||||
pmadapter->pm_wakeup_timeout);
|
pmadapter->pm_wakeup_timeout);
|
||||||
pmadapter->pm_wakeup_timeout++;
|
pmadapter->pm_wakeup_timeout++;
|
||||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
|
pmadapter->pm_wakeup_flag = MTRUE;
|
||||||
|
wlan_recv_event(wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY),
|
||||||
|
MLAN_EVENT_ID_DRV_DEFER_HANDLING, MNULL);
|
||||||
}
|
}
|
||||||
pmadapter->wakeup_fw_timer_is_set = MFALSE;
|
pmadapter->wakeup_fw_timer_is_set = MFALSE;
|
||||||
|
|
||||||
|
|
|
@ -1718,7 +1718,7 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
||||||
wrptr = rdptr & 0xffff;
|
wrptr = rdptr & 0xffff;
|
||||||
rdptr = rdptr >> ADMA_RPTR_START;
|
rdptr = rdptr >> ADMA_RPTR_START;
|
||||||
if (wrptr != pmadapter->pcard_pcie->txbd_wrptr)
|
if (wrptr != pmadapter->pcard_pcie->txbd_wrptr)
|
||||||
PRINTM(MERROR, "wlan: Unexpected wrptr 0x%x 0x%x\n",
|
PRINTM(MINFO, "wlan: Unexpected wrptr 0x%x 0x%x\n",
|
||||||
wrptr, pmadapter->pcard_pcie->txbd_wrptr);
|
wrptr, pmadapter->pcard_pcie->txbd_wrptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1742,7 +1742,6 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
unmap_count++;
|
unmap_count++;
|
||||||
pmadapter->pcard_pcie->txbd_pending--;
|
|
||||||
#if defined(PCIE8997) || defined(PCIE8897)
|
#if defined(PCIE8997) || defined(PCIE8897)
|
||||||
if (pmadapter->pcard_pcie->txbd_flush)
|
if (pmadapter->pcard_pcie->txbd_flush)
|
||||||
wlan_write_data_complete(pmadapter, pmbuf,
|
wlan_write_data_complete(pmadapter, pmbuf,
|
||||||
|
@ -1800,10 +1799,57 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
done:
|
done:
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_pcie_lock);
|
||||||
|
pmadapter->pcard_pcie->txbd_pending -= unmap_count;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_pcie_lock);
|
||||||
|
|
||||||
LEAVE();
|
LEAVE();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function process pcie tx_complete
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pmadapter A pointer to mlan_adapter structure
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
static void wlan_pcie_process_tx_complete(mlan_adapter *pmadapter)
|
||||||
|
{
|
||||||
|
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||||
|
ENTER();
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->pmlan_tx_lock);
|
||||||
|
if (pmadapter->pcie_tx_processing) {
|
||||||
|
pmadapter->more_tx_task_flag = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_tx_lock);
|
||||||
|
goto exit_tx_proc;
|
||||||
|
} else {
|
||||||
|
pmadapter->pcie_tx_processing = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_tx_lock);
|
||||||
|
}
|
||||||
|
tx_process_start:
|
||||||
|
wlan_pcie_send_data_complete(pmadapter);
|
||||||
|
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->pmlan_tx_lock);
|
||||||
|
if (pmadapter->more_tx_task_flag) {
|
||||||
|
pmadapter->more_tx_task_flag = MFALSE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_tx_lock);
|
||||||
|
goto tx_process_start;
|
||||||
|
}
|
||||||
|
pmadapter->pcie_tx_processing = MFALSE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_tx_lock);
|
||||||
|
exit_tx_proc:
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(PCIE8997) || defined(PCIE8897)
|
#if defined(PCIE8997) || defined(PCIE8897)
|
||||||
#define PCIE_TXBD_NOT_FULL(wrptr, rdptr, mask, rollover_ind) \
|
#define PCIE_TXBD_NOT_FULL(wrptr, rdptr, mask, rollover_ind) \
|
||||||
(((wrptr & mask) != (rdptr & mask)) || \
|
(((wrptr & mask) != (rdptr & mask)) || \
|
||||||
|
@ -1921,6 +1967,10 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
||||||
PRINTM(MDAT_D,
|
PRINTM(MDAT_D,
|
||||||
"SEND DATA: Attach pmbuf %p at tx_ring[%d], txbd_wrptr=0x%x\n",
|
"SEND DATA: Attach pmbuf %p at tx_ring[%d], txbd_wrptr=0x%x\n",
|
||||||
pmbuf, wrindx, pmadapter->pcard_pcie->txbd_wrptr);
|
pmbuf, wrindx, pmadapter->pcard_pcie->txbd_wrptr);
|
||||||
|
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_pcie_lock);
|
||||||
|
|
||||||
pmadapter->pcard_pcie->tx_buf_list[wrindx] = pmbuf;
|
pmadapter->pcard_pcie->tx_buf_list[wrindx] = pmbuf;
|
||||||
#if defined(PCIE8997) || defined(PCIE8897)
|
#if defined(PCIE8997) || defined(PCIE8897)
|
||||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||||
|
@ -1938,8 +1988,6 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
||||||
pmadapter->pcard_pcie->last_tx_pkt_size[wrindx] =
|
pmadapter->pcard_pcie->last_tx_pkt_size[wrindx] =
|
||||||
pmbuf->data_len;
|
pmbuf->data_len;
|
||||||
|
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_pcie_lock);
|
|
||||||
pmadapter->pcard_pcie->txbd_wrptr++;
|
pmadapter->pcard_pcie->txbd_wrptr++;
|
||||||
if ((pmadapter->pcard_pcie->txbd_wrptr &
|
if ((pmadapter->pcard_pcie->txbd_wrptr &
|
||||||
txrx_rw_ptr_mask) == num_tx_buffs)
|
txrx_rw_ptr_mask) == num_tx_buffs)
|
||||||
|
@ -1986,12 +2034,9 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
||||||
(pmadapter->pcard_pcie->txbd_wrptr << wr_ptr_start) |
|
(pmadapter->pcard_pcie->txbd_wrptr << wr_ptr_start) |
|
||||||
rxbd_val);
|
rxbd_val);
|
||||||
|
|
||||||
#if defined(PCIE8997) || defined(PCIE8897)
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
pmadapter->pmlan_pcie_lock);
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_pcie_lock);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (status) {
|
if (status) {
|
||||||
PRINTM(MERROR,
|
PRINTM(MERROR,
|
||||||
"SEND DATA: failed to write REG_TXBD_WRPTR\n");
|
"SEND DATA: failed to write REG_TXBD_WRPTR\n");
|
||||||
|
@ -2006,7 +2051,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
|
||||||
if (wlan_check_txbd_not_full(pmadapter))
|
if (wlan_check_txbd_not_full(pmadapter))
|
||||||
pmadapter->data_sent = MFALSE;
|
pmadapter->data_sent = MFALSE;
|
||||||
else
|
else
|
||||||
wlan_pcie_send_data_complete(pmadapter);
|
wlan_pcie_process_tx_complete(pmadapter);
|
||||||
if (pmadapter->data_sent)
|
if (pmadapter->data_sent)
|
||||||
pmadapter->data_sent_cnt++;
|
pmadapter->data_sent_cnt++;
|
||||||
|
|
||||||
|
@ -2044,8 +2089,13 @@ done_unmap:
|
||||||
PRINTM(MERROR, "SEND DATA: failed to moal_unmap_memory\n");
|
PRINTM(MERROR, "SEND DATA: failed to moal_unmap_memory\n");
|
||||||
ret = MLAN_STATUS_FAILURE;
|
ret = MLAN_STATUS_FAILURE;
|
||||||
}
|
}
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_pcie_lock);
|
||||||
pmadapter->pcard_pcie->txbd_pending--;
|
pmadapter->pcard_pcie->txbd_pending--;
|
||||||
pmadapter->pcard_pcie->tx_buf_list[wrindx] = MNULL;
|
pmadapter->pcard_pcie->tx_buf_list[wrindx] = MNULL;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_pcie_lock);
|
||||||
|
|
||||||
#if defined(PCIE8997) || defined(PCIE8897)
|
#if defined(PCIE8997) || defined(PCIE8897)
|
||||||
if (!pmadapter->pcard_pcie->reg->use_adma && ptx_bd_buf) {
|
if (!pmadapter->pcard_pcie->reg->use_adma && ptx_bd_buf) {
|
||||||
ptx_bd_buf->paddr = 0;
|
ptx_bd_buf->paddr = 0;
|
||||||
|
@ -2809,13 +2859,6 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
|
||||||
adma_dual_desc_buf *padma_bd_buf;
|
adma_dual_desc_buf *padma_bd_buf;
|
||||||
ENTER();
|
ENTER();
|
||||||
|
|
||||||
if (pmadapter->event_received || pmadapter->event_cause) {
|
|
||||||
PRINTM(MINFO, "Event being processed, do not "
|
|
||||||
"process this interrupt just yet\n");
|
|
||||||
LEAVE();
|
|
||||||
return MLAN_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rd_index >= MLAN_MAX_EVT_BD) {
|
if (rd_index >= MLAN_MAX_EVT_BD) {
|
||||||
PRINTM(MINFO, "Invalid rd_index...\n");
|
PRINTM(MINFO, "Invalid rd_index...\n");
|
||||||
LEAVE();
|
LEAVE();
|
||||||
|
@ -2929,6 +2972,42 @@ static mlan_status wlan_pcie_process_event_ready(mlan_adapter *pmadapter)
|
||||||
return MLAN_STATUS_SUCCESS;
|
return MLAN_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function process pcie received event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pmadapter A pointer to mlan_adapter structure
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
static void wlan_pcie_process_event(mlan_adapter *pmadapter)
|
||||||
|
{
|
||||||
|
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||||
|
ENTER();
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_event_lock);
|
||||||
|
if (pmadapter->pcie_event_processing || pmadapter->event_received ||
|
||||||
|
pmadapter->event_cause) {
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_event_lock);
|
||||||
|
goto exit_event_proc;
|
||||||
|
} else {
|
||||||
|
pmadapter->pcie_event_processing = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_event_lock);
|
||||||
|
}
|
||||||
|
wlan_pcie_process_event_ready(pmadapter);
|
||||||
|
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_event_lock);
|
||||||
|
pmadapter->pcie_event_processing = MFALSE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_event_lock);
|
||||||
|
exit_event_proc:
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function handles event completion
|
* @brief This function handles event completion
|
||||||
*
|
*
|
||||||
|
@ -2952,11 +3031,6 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
|
||||||
adma_dual_desc_buf *padma_bd_buf;
|
adma_dual_desc_buf *padma_bd_buf;
|
||||||
|
|
||||||
ENTER();
|
ENTER();
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_event_lock);
|
|
||||||
|
|
||||||
pmadapter->event_cause = 0;
|
|
||||||
pmadapter->pmlan_buffer_event = MNULL;
|
|
||||||
|
|
||||||
if (!pmbuf) {
|
if (!pmbuf) {
|
||||||
ret = MLAN_STATUS_FAILURE;
|
ret = MLAN_STATUS_FAILURE;
|
||||||
|
@ -3060,11 +3134,18 @@ done:
|
||||||
if (ret && pmbuf)
|
if (ret && pmbuf)
|
||||||
wlan_free_mlan_buffer(pmadapter, pmbuf);
|
wlan_free_mlan_buffer(pmadapter, pmbuf);
|
||||||
|
|
||||||
PRINTM(MINFO, "EvtCom: Check Events Again\n");
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
ret = wlan_pcie_process_event_ready(pmadapter);
|
pmadapter->pmlan_event_lock);
|
||||||
|
|
||||||
|
pmadapter->event_cause = 0;
|
||||||
|
pmadapter->pmlan_buffer_event = MNULL;
|
||||||
|
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
pmadapter->pmlan_event_lock);
|
pmadapter->pmlan_event_lock);
|
||||||
|
|
||||||
|
PRINTM(MINFO, "EvtCom: Check Events Again\n");
|
||||||
|
wlan_pcie_process_event(pmadapter);
|
||||||
|
|
||||||
LEAVE();
|
LEAVE();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3660,6 +3741,11 @@ mlan_status wlan_process_msix_int(mlan_adapter *pmadapter)
|
||||||
}
|
}
|
||||||
if (pcie_ireg & pmadapter->pcard_pcie->reg->host_intr_upld_rdy) {
|
if (pcie_ireg & pmadapter->pcard_pcie->reg->host_intr_upld_rdy) {
|
||||||
PRINTM(MINFO, "Rx DATA\n");
|
PRINTM(MINFO, "Rx DATA\n");
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
|
pmadapter->pcard_pcie->rx_pending = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
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_DEFER_RX_DATA, MNULL);
|
MLAN_EVENT_ID_DRV_DEFER_RX_DATA, MNULL);
|
||||||
}
|
}
|
||||||
|
@ -3678,10 +3764,7 @@ mlan_status wlan_process_msix_int(mlan_adapter *pmadapter)
|
||||||
}
|
}
|
||||||
if (pmadapter->pcard_pcie->reg->host_intr_cmd_dnld &&
|
if (pmadapter->pcard_pcie->reg->host_intr_cmd_dnld &&
|
||||||
(pcie_ireg & pmadapter->pcard_pcie->reg->host_intr_cmd_dnld)) {
|
(pcie_ireg & pmadapter->pcard_pcie->reg->host_intr_cmd_dnld)) {
|
||||||
if (pmadapter->cmd_sent)
|
pmadapter->pcie_cmd_dnld_int = MTRUE;
|
||||||
pmadapter->cmd_sent = MFALSE;
|
|
||||||
if (pmadapter->pcard_pcie->vdll_cmd_buf)
|
|
||||||
wlan_pcie_send_vdll_complete(pmadapter);
|
|
||||||
PRINTM(MINFO, "<--- CMD DNLD DONE Interrupt --->\n");
|
PRINTM(MINFO, "<--- CMD DNLD DONE Interrupt --->\n");
|
||||||
}
|
}
|
||||||
PRINTM(MINFO, "cmd_sent=%d data_sent=%d\n", pmadapter->cmd_sent,
|
PRINTM(MINFO, "cmd_sent=%d data_sent=%d\n", pmadapter->cmd_sent,
|
||||||
|
@ -3769,6 +3852,11 @@ static mlan_status wlan_process_pcie_int_status(mlan_adapter *pmadapter)
|
||||||
pcie_ireg &=
|
pcie_ireg &=
|
||||||
~pmadapter->pcard_pcie->reg->host_intr_upld_rdy;
|
~pmadapter->pcard_pcie->reg->host_intr_upld_rdy;
|
||||||
PRINTM(MINFO, "Rx DATA\n");
|
PRINTM(MINFO, "Rx DATA\n");
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
|
pmadapter->pcard_pcie->rx_pending = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
pmadapter->callbacks.moal_tp_accounting_rx_param(
|
pmadapter->callbacks.moal_tp_accounting_rx_param(
|
||||||
pmadapter->pmoal_handle, 0, 0);
|
pmadapter->pmoal_handle, 0, 0);
|
||||||
wlan_recv_event(wlan_get_priv(pmadapter,
|
wlan_recv_event(wlan_get_priv(pmadapter,
|
||||||
|
@ -3802,10 +3890,7 @@ static mlan_status wlan_process_pcie_int_status(mlan_adapter *pmadapter)
|
||||||
pmadapter->pcard_pcie->reg->host_intr_cmd_dnld)) {
|
pmadapter->pcard_pcie->reg->host_intr_cmd_dnld)) {
|
||||||
pcie_ireg &=
|
pcie_ireg &=
|
||||||
~pmadapter->pcard_pcie->reg->host_intr_cmd_dnld;
|
~pmadapter->pcard_pcie->reg->host_intr_cmd_dnld;
|
||||||
if (pmadapter->cmd_sent)
|
pmadapter->pcie_cmd_dnld_int = MTRUE;
|
||||||
pmadapter->cmd_sent = MFALSE;
|
|
||||||
if (pmadapter->pcard_pcie->vdll_cmd_buf)
|
|
||||||
wlan_pcie_send_vdll_complete(pmadapter);
|
|
||||||
PRINTM(MINFO, "<--- CMD DNLD DONE Interrupt --->\n");
|
PRINTM(MINFO, "<--- CMD DNLD DONE Interrupt --->\n");
|
||||||
}
|
}
|
||||||
if (pmadapter->pcard_pcie->pcie_int_mode == PCIE_INT_MODE_MSI) {
|
if (pmadapter->pcard_pcie->pcie_int_mode == PCIE_INT_MODE_MSI) {
|
||||||
|
@ -4079,7 +4164,6 @@ mlan_status wlan_pcie_host_to_card(pmlan_private pmpriv, t_u8 type,
|
||||||
{
|
{
|
||||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||||
pmlan_adapter pmadapter = pmpriv->adapter;
|
pmlan_adapter pmadapter = pmpriv->adapter;
|
||||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
|
||||||
|
|
||||||
ENTER();
|
ENTER();
|
||||||
|
|
||||||
|
@ -4089,13 +4173,7 @@ mlan_status wlan_pcie_host_to_card(pmlan_private pmpriv, t_u8 type,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == MLAN_TYPE_DATA) {
|
if (type == MLAN_TYPE_DATA) {
|
||||||
/* synchronize with send_data_complete to sync both txbd_rdptr
|
|
||||||
* and txbd_wrptr */
|
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_tx_lock);
|
|
||||||
ret = wlan_pcie_send_data(pmadapter, type, pmbuf, tx_param);
|
ret = wlan_pcie_send_data(pmadapter, type, pmbuf, tx_param);
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_tx_lock);
|
|
||||||
} else if (type == MLAN_TYPE_CMD)
|
} else if (type == MLAN_TYPE_CMD)
|
||||||
ret = wlan_pcie_send_cmd(pmadapter, pmbuf);
|
ret = wlan_pcie_send_cmd(pmadapter, pmbuf);
|
||||||
else if (type == MLAN_TYPE_VDLL)
|
else if (type == MLAN_TYPE_VDLL)
|
||||||
|
@ -4342,21 +4420,24 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv)
|
||||||
/* Send the ring base addresses and count to firmware */
|
/* Send the ring base addresses and count to firmware */
|
||||||
host_spec.txbd_addr_lo = wlan_cpu_to_le32(
|
host_spec.txbd_addr_lo = wlan_cpu_to_le32(
|
||||||
(t_u32)(pmadapter->pcard_pcie->txbd_ring_pbase));
|
(t_u32)(pmadapter->pcard_pcie->txbd_ring_pbase));
|
||||||
host_spec.txbd_addr_hi = wlan_cpu_to_le32((t_u32)(
|
host_spec.txbd_addr_hi = wlan_cpu_to_le32((
|
||||||
((t_u64)pmadapter->pcard_pcie->txbd_ring_pbase) >> 32));
|
t_u32)(((t_u64)pmadapter->pcard_pcie->txbd_ring_pbase) >>
|
||||||
|
32));
|
||||||
host_spec.txbd_count =
|
host_spec.txbd_count =
|
||||||
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
|
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
|
||||||
host_spec.rxbd_addr_lo = wlan_cpu_to_le32(
|
host_spec.rxbd_addr_lo = wlan_cpu_to_le32(
|
||||||
(t_u32)(pmadapter->pcard_pcie->rxbd_ring_pbase));
|
(t_u32)(pmadapter->pcard_pcie->rxbd_ring_pbase));
|
||||||
host_spec.rxbd_addr_hi = wlan_cpu_to_le32((t_u32)(
|
host_spec.rxbd_addr_hi = wlan_cpu_to_le32((
|
||||||
((t_u64)pmadapter->pcard_pcie->rxbd_ring_pbase) >> 32));
|
t_u32)(((t_u64)pmadapter->pcard_pcie->rxbd_ring_pbase) >>
|
||||||
|
32));
|
||||||
host_spec.rxbd_count =
|
host_spec.rxbd_count =
|
||||||
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
|
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
|
||||||
host_spec.evtbd_addr_lo = wlan_cpu_to_le32(
|
host_spec.evtbd_addr_lo = wlan_cpu_to_le32(
|
||||||
(t_u32)(pmadapter->pcard_pcie->evtbd_ring_pbase));
|
(t_u32)(pmadapter->pcard_pcie->evtbd_ring_pbase));
|
||||||
host_spec.evtbd_addr_hi = wlan_cpu_to_le32((t_u32)(
|
host_spec.evtbd_addr_hi =
|
||||||
((t_u64)pmadapter->pcard_pcie->evtbd_ring_pbase) >>
|
wlan_cpu_to_le32((t_u32)(((t_u64)pmadapter->pcard_pcie
|
||||||
32));
|
->evtbd_ring_pbase) >>
|
||||||
|
32));
|
||||||
host_spec.evtbd_count = wlan_cpu_to_le32(MLAN_MAX_EVT_BD);
|
host_spec.evtbd_count = wlan_cpu_to_le32(MLAN_MAX_EVT_BD);
|
||||||
|
|
||||||
ret = wlan_prepare_cmd(pmpriv,
|
ret = wlan_prepare_cmd(pmpriv,
|
||||||
|
@ -4523,6 +4604,61 @@ static mlan_status wlan_pcie_interrupt_ext(t_u16 msg_id,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function process pcie receive data
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pmadapter A pointer to mlan_adapter structure
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
static void wlan_pcie_process_rx(mlan_adapter *pmadapter)
|
||||||
|
{
|
||||||
|
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||||
|
ENTER();
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->pmlan_rx_lock);
|
||||||
|
if (pmadapter->pcie_rx_processing) {
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
|
goto exit_rx_proc;
|
||||||
|
} else {
|
||||||
|
pmadapter->pcie_rx_processing = MTRUE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
wlan_pcie_process_recv_data(pmadapter);
|
||||||
|
|
||||||
|
pcb->moal_spin_lock(pmadapter->pmoal_handle, pmadapter->pmlan_rx_lock);
|
||||||
|
pmadapter->pcie_rx_processing = MFALSE;
|
||||||
|
pmadapter->pcard_pcie->rx_pending = MFALSE;
|
||||||
|
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
||||||
|
pmadapter->pmlan_rx_lock);
|
||||||
|
exit_rx_proc:
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function process pcie_cmd_dnld interrupt
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pmadapter A pointer to mlan_adapter structure
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
static void wlan_pcie_process_cmd_dnld(mlan_adapter *pmadapter)
|
||||||
|
{
|
||||||
|
ENTER();
|
||||||
|
if (pmadapter->cmd_sent)
|
||||||
|
pmadapter->cmd_sent = MFALSE;
|
||||||
|
if (pmadapter->pcard_pcie->vdll_cmd_buf)
|
||||||
|
wlan_pcie_send_vdll_complete(pmadapter);
|
||||||
|
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function checks the interrupt status and
|
* @brief This function checks the interrupt status and
|
||||||
* handle it accordingly.
|
* handle it accordingly.
|
||||||
|
@ -4534,36 +4670,23 @@ static mlan_status wlan_pcie_interrupt_ext(t_u16 msg_id,
|
||||||
static mlan_status wlan_process_pcie_int_status_ext(mlan_adapter *pmadapter,
|
static mlan_status wlan_process_pcie_int_status_ext(mlan_adapter *pmadapter,
|
||||||
t_u8 type)
|
t_u8 type)
|
||||||
{
|
{
|
||||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
|
||||||
|
|
||||||
ENTER();
|
ENTER();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case RX_DATA: // Rx Data
|
case RX_DATA: // Rx Data
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
wlan_pcie_process_rx(pmadapter);
|
||||||
pmadapter->pmlan_rx_lock);
|
|
||||||
wlan_pcie_process_recv_data(pmadapter);
|
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_rx_lock);
|
|
||||||
break;
|
break;
|
||||||
case RX_EVENT: // Rx event
|
case RX_EVENT: // Rx event
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
wlan_pcie_process_event(pmadapter);
|
||||||
pmadapter->pmlan_event_lock);
|
|
||||||
wlan_pcie_process_event_ready(pmadapter);
|
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_event_lock);
|
|
||||||
break;
|
break;
|
||||||
case TX_COMPLETE: // Tx data complete
|
case TX_COMPLETE: // Tx data complete
|
||||||
/* synchronize with send_data to sync both txbd_rdptr and
|
wlan_pcie_process_tx_complete(pmadapter);
|
||||||
* txbd_wrptr */
|
|
||||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_tx_lock);
|
|
||||||
wlan_pcie_send_data_complete(pmadapter);
|
|
||||||
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
|
|
||||||
pmadapter->pmlan_tx_lock);
|
|
||||||
break;
|
break;
|
||||||
case RX_CMD_RESP: // Rx CMD Resp
|
case RX_CMD_RESP: // Rx CMD Resp
|
||||||
wlan_pcie_process_cmd_resp(pmadapter);
|
wlan_pcie_process_cmd_resp(pmadapter);
|
||||||
break;
|
break;
|
||||||
|
case RX_CMD_DNLD:
|
||||||
|
wlan_pcie_process_cmd_dnld(pmadapter);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -904,8 +904,9 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
|
||||||
* compensates for any TLVs that were appended
|
* compensates for any TLVs that were appended
|
||||||
* before the channel list.
|
* before the channel list.
|
||||||
*/
|
*/
|
||||||
pscan_cfg_out->tlv_buf_len = (t_u32)(
|
pscan_cfg_out->tlv_buf_len =
|
||||||
(t_u8 *)pchan_tlv_out - pscan_cfg_out->tlv_buf);
|
(t_u32)((t_u8 *)pchan_tlv_out -
|
||||||
|
pscan_cfg_out->tlv_buf);
|
||||||
|
|
||||||
/* Add the size of the channel tlv header and the data
|
/* Add the size of the channel tlv header and the data
|
||||||
* length */
|
* length */
|
||||||
|
@ -1246,9 +1247,10 @@ static mlan_status wlan_scan_setup_scan_config(
|
||||||
(MrvlIEtypes_WildCardSsIdParamSet_t *)ptlv_pos;
|
(MrvlIEtypes_WildCardSsIdParamSet_t *)ptlv_pos;
|
||||||
pwildcard_ssid_tlv->header.type =
|
pwildcard_ssid_tlv->header.type =
|
||||||
wlan_cpu_to_le16(TLV_TYPE_WILDCARDSSID);
|
wlan_cpu_to_le16(TLV_TYPE_WILDCARDSSID);
|
||||||
pwildcard_ssid_tlv->header.len = (t_u16)(
|
pwildcard_ssid_tlv->header.len =
|
||||||
ssid_len +
|
(t_u16)(ssid_len +
|
||||||
sizeof(pwildcard_ssid_tlv->max_ssid_length));
|
sizeof(pwildcard_ssid_tlv
|
||||||
|
->max_ssid_length));
|
||||||
pwildcard_ssid_tlv->max_ssid_length =
|
pwildcard_ssid_tlv->max_ssid_length =
|
||||||
puser_scan_in->ssid_list[ssid_idx].max_len;
|
puser_scan_in->ssid_list[ssid_idx].max_len;
|
||||||
|
|
||||||
|
@ -2055,8 +2057,9 @@ static mlan_status wlan_interpret_bss_desc_with_ie(pmlan_adapter pmadapter,
|
||||||
pbss_entry->pwpa_ie =
|
pbss_entry->pwpa_ie =
|
||||||
(IEEEtypes_VendorSpecific_t *)
|
(IEEEtypes_VendorSpecific_t *)
|
||||||
pcurrent_ptr;
|
pcurrent_ptr;
|
||||||
pbss_entry->wpa_offset = (t_u16)(
|
pbss_entry->wpa_offset =
|
||||||
pcurrent_ptr - pbss_entry->pbeacon_buf);
|
(t_u16)(pcurrent_ptr -
|
||||||
|
pbss_entry->pbeacon_buf);
|
||||||
HEXDUMP("InterpretIE: Resp WPA_IE",
|
HEXDUMP("InterpretIE: Resp WPA_IE",
|
||||||
(t_u8 *)pbss_entry->pwpa_ie,
|
(t_u8 *)pbss_entry->pwpa_ie,
|
||||||
((*(pbss_entry->pwpa_ie)).vend_hdr.len +
|
((*(pbss_entry->pwpa_ie)).vend_hdr.len +
|
||||||
|
@ -2132,8 +2135,9 @@ static mlan_status wlan_interpret_bss_desc_with_ie(pmlan_adapter pmadapter,
|
||||||
osen_oui, sizeof(osen_oui))) {
|
osen_oui, sizeof(osen_oui))) {
|
||||||
pbss_entry->posen_ie =
|
pbss_entry->posen_ie =
|
||||||
(IEEEtypes_Generic_t *)pcurrent_ptr;
|
(IEEEtypes_Generic_t *)pcurrent_ptr;
|
||||||
pbss_entry->osen_offset = (t_u16)(
|
pbss_entry->osen_offset =
|
||||||
pcurrent_ptr - pbss_entry->pbeacon_buf);
|
(t_u16)(pcurrent_ptr -
|
||||||
|
pbss_entry->pbeacon_buf);
|
||||||
HEXDUMP("InterpretIE: Resp OSEN_IE",
|
HEXDUMP("InterpretIE: Resp OSEN_IE",
|
||||||
(t_u8 *)pbss_entry->posen_ie,
|
(t_u8 *)pbss_entry->posen_ie,
|
||||||
(*(pbss_entry->posen_ie)).ieee_hdr.len +
|
(*(pbss_entry->posen_ie)).ieee_hdr.len +
|
||||||
|
@ -2308,13 +2312,15 @@ static mlan_status wlan_interpret_bss_desc_with_ie(pmlan_adapter pmadapter,
|
||||||
case HE_CAPABILITY:
|
case HE_CAPABILITY:
|
||||||
pbss_entry->phe_cap =
|
pbss_entry->phe_cap =
|
||||||
(IEEEtypes_HECap_t *)pcurrent_ptr;
|
(IEEEtypes_HECap_t *)pcurrent_ptr;
|
||||||
pbss_entry->he_cap_offset = (t_u16)(
|
pbss_entry->he_cap_offset =
|
||||||
pcurrent_ptr - pbss_entry->pbeacon_buf);
|
(t_u16)(pcurrent_ptr -
|
||||||
|
pbss_entry->pbeacon_buf);
|
||||||
break;
|
break;
|
||||||
case HE_OPERATION:
|
case HE_OPERATION:
|
||||||
pbss_entry->phe_oprat = pext_tlv;
|
pbss_entry->phe_oprat = pext_tlv;
|
||||||
pbss_entry->he_oprat_offset = (t_u16)(
|
pbss_entry->he_oprat_offset =
|
||||||
pcurrent_ptr - pbss_entry->pbeacon_buf);
|
(t_u16)(pcurrent_ptr -
|
||||||
|
pbss_entry->pbeacon_buf);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -4977,10 +4983,10 @@ mlan_status wlan_cmd_802_11_scan_ext(mlan_private *pmpriv,
|
||||||
else
|
else
|
||||||
pext_scan_cmd->ext_scan_type = EXT_SCAN_DEFAULT;
|
pext_scan_cmd->ext_scan_type = EXT_SCAN_DEFAULT;
|
||||||
} else {
|
} else {
|
||||||
pcmd->size = wlan_cpu_to_le16((t_u16)(
|
pcmd->size = wlan_cpu_to_le16((
|
||||||
sizeof(pext_scan_cmd->ext_scan_type) +
|
t_u16)(sizeof(pext_scan_cmd->ext_scan_type) +
|
||||||
(t_u16)(sizeof(pext_scan_cmd->reserved)) +
|
(t_u16)(sizeof(pext_scan_cmd->reserved)) +
|
||||||
S_DS_GEN));
|
S_DS_GEN));
|
||||||
pext_scan_cmd->ext_scan_type = EXT_SCAN_CANCEL;
|
pext_scan_cmd->ext_scan_type = EXT_SCAN_CANCEL;
|
||||||
LEAVE();
|
LEAVE();
|
||||||
return MLAN_STATUS_SUCCESS;
|
return MLAN_STATUS_SUCCESS;
|
||||||
|
@ -5760,8 +5766,8 @@ static mlan_status wlan_parse_ext_scan_result(mlan_private *pmpriv,
|
||||||
*/
|
*/
|
||||||
if (pscan_info_tlv) {
|
if (pscan_info_tlv) {
|
||||||
/* RSSI is 2 byte long */
|
/* RSSI is 2 byte long */
|
||||||
bss_new_entry->rssi = -(t_s32)(
|
bss_new_entry->rssi = -(t_s32)(wlan_le16_to_cpu(
|
||||||
wlan_le16_to_cpu(pscan_info_tlv->rssi));
|
pscan_info_tlv->rssi));
|
||||||
PRINTM(MINFO, "EXT_SCAN: RSSI=%d\n",
|
PRINTM(MINFO, "EXT_SCAN: RSSI=%d\n",
|
||||||
bss_new_entry->rssi);
|
bss_new_entry->rssi);
|
||||||
memcpy_ext(pmpriv->adapter, &tsf_val,
|
memcpy_ext(pmpriv->adapter, &tsf_val,
|
||||||
|
@ -6437,8 +6443,9 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
|
||||||
pwildcard_ssid_tlv = (MrvlIEtypes_WildCardSsIdParamSet_t *)tlv;
|
pwildcard_ssid_tlv = (MrvlIEtypes_WildCardSsIdParamSet_t *)tlv;
|
||||||
pwildcard_ssid_tlv->header.type =
|
pwildcard_ssid_tlv->header.type =
|
||||||
wlan_cpu_to_le16(TLV_TYPE_WILDCARDSSID);
|
wlan_cpu_to_le16(TLV_TYPE_WILDCARDSSID);
|
||||||
pwildcard_ssid_tlv->header.len = (t_u16)(
|
pwildcard_ssid_tlv->header.len =
|
||||||
ssid_len + sizeof(pwildcard_ssid_tlv->max_ssid_length));
|
(t_u16)(ssid_len +
|
||||||
|
sizeof(pwildcard_ssid_tlv->max_ssid_length));
|
||||||
pwildcard_ssid_tlv->max_ssid_length =
|
pwildcard_ssid_tlv->max_ssid_length =
|
||||||
bg_scan_in->ssid_list[ssid_idx].max_len;
|
bg_scan_in->ssid_list[ssid_idx].max_len;
|
||||||
memcpy_ext(pmadapter, pwildcard_ssid_tlv->ssid,
|
memcpy_ext(pmadapter, pwildcard_ssid_tlv->ssid,
|
||||||
|
|
|
@ -588,8 +588,8 @@ static mlan_status wlan_get_rd_port(mlan_adapter *pmadapter, t_u8 *pport)
|
||||||
} else {
|
} else {
|
||||||
if (pmadapter->pcard_sd->mp_rd_bitmap &
|
if (pmadapter->pcard_sd->mp_rd_bitmap &
|
||||||
(1 << pmadapter->pcard_sd->curr_rd_port)) {
|
(1 << pmadapter->pcard_sd->curr_rd_port)) {
|
||||||
pmadapter->pcard_sd->mp_rd_bitmap &= (t_u32)(
|
pmadapter->pcard_sd->mp_rd_bitmap &= (t_u32)(~(
|
||||||
~(1 << pmadapter->pcard_sd->curr_rd_port));
|
1 << pmadapter->pcard_sd->curr_rd_port));
|
||||||
*pport = pmadapter->pcard_sd->curr_rd_port;
|
*pport = pmadapter->pcard_sd->curr_rd_port;
|
||||||
|
|
||||||
/* hw rx wraps round only after port (MAX_PORT-1) */
|
/* hw rx wraps round only after port (MAX_PORT-1) */
|
||||||
|
|
|
@ -1194,7 +1194,29 @@ process_start:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef PCIE
|
||||||
|
if (IS_PCIE(pmadapter->card_type) &&
|
||||||
|
pmadapter->pcie_cmd_dnld_int) {
|
||||||
|
pmadapter->pcie_cmd_dnld_int = MFALSE;
|
||||||
|
mlan_process_pcie_interrupt_cb(pmadapter, RX_CMD_DNLD);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* wake up timeout happened */
|
||||||
|
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
|
||||||
|
pmadapter->pm_wakeup_flag) {
|
||||||
|
pmadapter->pm_wakeup_flag = MFALSE;
|
||||||
|
if (pmadapter->pm_wakeup_timeout > 2)
|
||||||
|
wlan_recv_event(
|
||||||
|
wlan_get_priv(pmadapter,
|
||||||
|
MLAN_BSS_ROLE_ANY),
|
||||||
|
MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
|
||||||
|
else {
|
||||||
|
pmadapter->ops.wakeup_card(pmadapter, MTRUE);
|
||||||
|
pmadapter->pm_wakeup_fw_try = MTRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Need to wake up the card ? */
|
/* Need to wake up the card ? */
|
||||||
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
|
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
|
||||||
(pmadapter->pm_wakeup_card_req &&
|
(pmadapter->pm_wakeup_card_req &&
|
||||||
|
@ -1868,6 +1890,12 @@ void mlan_process_pcie_interrupt_cb(t_void *padapter, int type)
|
||||||
ENTER();
|
ENTER();
|
||||||
|
|
||||||
if (type == RX_DATA) {
|
if (type == RX_DATA) {
|
||||||
|
if ((pmadapter->ps_state == PS_STATE_SLEEP) ||
|
||||||
|
(pmadapter->ps_state == PS_STATE_SLEEP_CFM)) {
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pmadapter->rx_pkts_queued > HIGH_RX_PENDING) {
|
if (pmadapter->rx_pkts_queued > HIGH_RX_PENDING) {
|
||||||
pcb->moal_tp_accounting_rx_param(
|
pcb->moal_tp_accounting_rx_param(
|
||||||
pmadapter->pmoal_handle, 2, 0);
|
pmadapter->pmoal_handle, 2, 0);
|
||||||
|
@ -1896,6 +1924,7 @@ void mlan_process_pcie_interrupt_cb(t_void *padapter, int type)
|
||||||
case RX_CMD_RESP: // Rx CMD Resp
|
case RX_CMD_RESP: // Rx CMD Resp
|
||||||
mlan_main_process(pmadapter);
|
mlan_main_process(pmadapter);
|
||||||
break;
|
break;
|
||||||
|
case RX_CMD_DNLD:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3394,76 +3394,93 @@ static mlan_status wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
|
||||||
(!memcmp(priv->adapter, pvendor_ie->oui, wpa_oui,
|
(!memcmp(priv->adapter, pvendor_ie->oui, wpa_oui,
|
||||||
sizeof(wpa_oui)))) ||
|
sizeof(wpa_oui)))) ||
|
||||||
(pvendor_ie->element_id == RSN_IE)) {
|
(pvendor_ie->element_id == RSN_IE)) {
|
||||||
/* IE is a WPA/WPA2 IE so call set_wpa function */
|
/* IE is a WPA/WPA2 IE so call set_wpa function
|
||||||
ret = wlan_set_wpa_ie_helper(priv, ie_data_ptr, ie_len);
|
|
||||||
priv->wps.session_enable = MFALSE;
|
|
||||||
} else if (pvendor_ie->element_id == WAPI_IE) {
|
|
||||||
/* IE is a WAPI IE so call set_wapi function */
|
|
||||||
ret = wlan_set_wapi_ie(priv, ie_data_ptr, ie_len);
|
|
||||||
} else if ((pvendor_ie->element_id == VENDOR_SPECIFIC_221) &&
|
|
||||||
(!memcmp(priv->adapter, pvendor_ie->oui, osen_oui,
|
|
||||||
sizeof(osen_oui)))) {
|
|
||||||
/* IE is a OSEN IE so call set_osen function */
|
|
||||||
ret = wlan_set_osen_ie(priv, ie_data_ptr, ie_len);
|
|
||||||
|
|
||||||
} else if ((pvendor_ie->element_id == WPS_IE) &&
|
|
||||||
(priv->wps.session_enable == MFALSE) &&
|
|
||||||
(!memcmp(priv->adapter, pvendor_ie->oui, wps_oui,
|
|
||||||
sizeof(wps_oui)))) {
|
|
||||||
/*
|
|
||||||
* Discard first two byte (Element ID and Length)
|
|
||||||
* because they are not needed in the case of setting
|
|
||||||
* WPS_IE
|
|
||||||
*/
|
|
||||||
if (pvendor_ie->len > 4) {
|
|
||||||
memcpy_ext(priv->adapter,
|
|
||||||
(t_u8 *)&priv->wps.wps_ie,
|
|
||||||
ie_data_ptr, ie_len,
|
|
||||||
sizeof(IEEEtypes_VendorSpecific_t));
|
|
||||||
HEXDUMP("wps_ie", (t_u8 *)&priv->wps.wps_ie,
|
|
||||||
priv->wps.wps_ie.vend_hdr.len + 2);
|
|
||||||
} else {
|
|
||||||
/* Only wps oui exist, reset driver wps buffer
|
|
||||||
*/
|
*/
|
||||||
memset(priv->adapter, (t_u8 *)&priv->wps.wps_ie,
|
ret = wlan_set_wpa_ie_helper(priv, ie_data_ptr,
|
||||||
0x00, sizeof(priv->wps.wps_ie));
|
ie_len);
|
||||||
PRINTM(MINFO, "wps_ie cleared\n");
|
priv->wps.session_enable = MFALSE;
|
||||||
}
|
} else if (pvendor_ie->element_id == WAPI_IE) {
|
||||||
} else {
|
/* IE is a WAPI IE so call set_wapi function */
|
||||||
/*
|
ret = wlan_set_wapi_ie(priv, ie_data_ptr,
|
||||||
* Verify that the passed length is not larger than
|
ie_len);
|
||||||
* the available space remaining in the buffer
|
} else if ((pvendor_ie->element_id ==
|
||||||
*/
|
VENDOR_SPECIFIC_221) &&
|
||||||
if (ie_len <
|
(!memcmp(priv->adapter, pvendor_ie->oui,
|
||||||
(sizeof(priv->gen_ie_buf) - priv->gen_ie_buf_len)) {
|
osen_oui, sizeof(osen_oui)))) {
|
||||||
/* Test to see if it is a WPS IE, if so, enable
|
/* IE is a OSEN IE so call set_osen function */
|
||||||
* wps session flag */
|
ret = wlan_set_osen_ie(priv, ie_data_ptr,
|
||||||
pvendor_ie =
|
ie_len);
|
||||||
(IEEEtypes_VendorHeader_t *)ie_data_ptr;
|
|
||||||
if ((pvendor_ie->element_id == WPS_IE) &&
|
|
||||||
(!memcmp(priv->adapter, pvendor_ie->oui,
|
|
||||||
wps_oui, sizeof(wps_oui)))) {
|
|
||||||
priv->wps.session_enable = MTRUE;
|
|
||||||
PRINTM(MINFO, "WPS Session Enabled.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Append the passed data to the end of
|
} else if ((pvendor_ie->element_id == WPS_IE) &&
|
||||||
* the genIeBuffer */
|
(priv->wps.session_enable == MFALSE) &&
|
||||||
memcpy_ext(priv->adapter,
|
(!memcmp(priv->adapter, pvendor_ie->oui,
|
||||||
priv->gen_ie_buf +
|
wps_oui, sizeof(wps_oui)))) {
|
||||||
priv->gen_ie_buf_len,
|
/*
|
||||||
ie_data_ptr, ie_len,
|
* Discard first two byte (Element ID and
|
||||||
MRVDRV_GENIE_BUF_SIZE -
|
* Length) because they are not needed in the
|
||||||
priv->gen_ie_buf_len);
|
* case of setting WPS_IE
|
||||||
/* Increment the stored buffer length by
|
*/
|
||||||
* the size passed */
|
if (pvendor_ie->len > 4) {
|
||||||
priv->gen_ie_buf_len += ie_len;
|
memcpy_ext(
|
||||||
|
priv->adapter,
|
||||||
|
(t_u8 *)&priv->wps.wps_ie,
|
||||||
|
ie_data_ptr, ie_len,
|
||||||
|
sizeof(IEEEtypes_VendorSpecific_t));
|
||||||
|
HEXDUMP("wps_ie",
|
||||||
|
(t_u8 *)&priv->wps.wps_ie,
|
||||||
|
priv->wps.wps_ie.vend_hdr.len +
|
||||||
|
2);
|
||||||
|
} else {
|
||||||
|
/* Only wps oui exist, reset driver wps
|
||||||
|
* buffer
|
||||||
|
*/
|
||||||
|
memset(priv->adapter,
|
||||||
|
(t_u8 *)&priv->wps.wps_ie, 0x00,
|
||||||
|
sizeof(priv->wps.wps_ie));
|
||||||
|
PRINTM(MINFO, "wps_ie cleared\n");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Passed data does not fit in the
|
/*
|
||||||
* remaining buffer space */
|
* Verify that the passed length is not larger
|
||||||
ret = MLAN_STATUS_FAILURE;
|
* than the available space remaining in the
|
||||||
|
* buffer
|
||||||
|
*/
|
||||||
|
if (ie_len < (sizeof(priv->gen_ie_buf) -
|
||||||
|
priv->gen_ie_buf_len)) {
|
||||||
|
/* Test to see if it is a WPS IE, if so,
|
||||||
|
* enable wps session flag */
|
||||||
|
pvendor_ie =
|
||||||
|
(IEEEtypes_VendorHeader_t *)
|
||||||
|
ie_data_ptr;
|
||||||
|
if ((pvendor_ie->element_id ==
|
||||||
|
WPS_IE) &&
|
||||||
|
(!memcmp(priv->adapter,
|
||||||
|
pvendor_ie->oui, wps_oui,
|
||||||
|
sizeof(wps_oui)))) {
|
||||||
|
priv->wps.session_enable =
|
||||||
|
MTRUE;
|
||||||
|
PRINTM(MINFO,
|
||||||
|
"WPS Session Enabled.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Append the passed data to the end of
|
||||||
|
* the genIeBuffer */
|
||||||
|
memcpy_ext(
|
||||||
|
priv->adapter,
|
||||||
|
priv->gen_ie_buf +
|
||||||
|
priv->gen_ie_buf_len,
|
||||||
|
ie_data_ptr, ie_len,
|
||||||
|
MRVDRV_GENIE_BUF_SIZE -
|
||||||
|
priv->gen_ie_buf_len);
|
||||||
|
/* Increment the stored buffer length by
|
||||||
|
* the size passed */
|
||||||
|
priv->gen_ie_buf_len += ie_len;
|
||||||
|
} else {
|
||||||
|
/* Passed data does not fit in the
|
||||||
|
* remaining buffer space */
|
||||||
|
ret = MLAN_STATUS_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return MLAN_STATUS_SUCCESS, or MLAN_STATUS_FAILURE for error case */
|
/* Return MLAN_STATUS_SUCCESS, or MLAN_STATUS_FAILURE for error case */
|
||||||
|
|
|
@ -133,8 +133,9 @@ t_void *wlan_ops_sta_process_txpd(t_void *priv, pmlan_buffer pmbuf)
|
||||||
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
|
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
|
||||||
}
|
}
|
||||||
/* Offset of actual data */
|
/* Offset of actual data */
|
||||||
plocal_tx_pd->tx_pkt_offset = (t_u16)(
|
plocal_tx_pd->tx_pkt_offset =
|
||||||
(t_ptr)pmbuf->pbuf + pmbuf->data_offset - (t_ptr)plocal_tx_pd);
|
(t_u16)((t_ptr)pmbuf->pbuf + pmbuf->data_offset -
|
||||||
|
(t_ptr)plocal_tx_pd);
|
||||||
|
|
||||||
if (!plocal_tx_pd->tx_control) {
|
if (!plocal_tx_pd->tx_control) {
|
||||||
/* TxCtrl set by user or default */
|
/* TxCtrl set by user or default */
|
||||||
|
|
|
@ -234,8 +234,9 @@ t_void *wlan_ops_uap_process_txpd(t_void *priv, pmlan_buffer pmbuf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Offset of actual data */
|
/* Offset of actual data */
|
||||||
plocal_tx_pd->tx_pkt_offset = (t_u16)(
|
plocal_tx_pd->tx_pkt_offset =
|
||||||
(t_ptr)pmbuf->pbuf + pmbuf->data_offset - (t_ptr)plocal_tx_pd);
|
(t_u16)((t_ptr)pmbuf->pbuf + pmbuf->data_offset -
|
||||||
|
(t_ptr)plocal_tx_pd);
|
||||||
|
|
||||||
if (!plocal_tx_pd->tx_control) {
|
if (!plocal_tx_pd->tx_control) {
|
||||||
/* TxCtrl set by user or default */
|
/* TxCtrl set by user or default */
|
||||||
|
|
|
@ -487,11 +487,11 @@ static int wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
|
||||||
static inline t_u32 usb_tx_aggr_pad_len(t_u32 len,
|
static inline t_u32 usb_tx_aggr_pad_len(t_u32 len,
|
||||||
usb_tx_aggr_params *pusb_tx_aggr)
|
usb_tx_aggr_params *pusb_tx_aggr)
|
||||||
{
|
{
|
||||||
return (t_u32)(
|
return (t_u32)((len % pusb_tx_aggr->aggr_ctrl.aggr_align) ?
|
||||||
(len % pusb_tx_aggr->aggr_ctrl.aggr_align) ?
|
(len +
|
||||||
(len + (pusb_tx_aggr->aggr_ctrl.aggr_align -
|
(pusb_tx_aggr->aggr_ctrl.aggr_align -
|
||||||
(len % pusb_tx_aggr->aggr_ctrl.aggr_align))) :
|
(len % pusb_tx_aggr->aggr_ctrl.aggr_align))) :
|
||||||
len);
|
len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define _MLAN_DECL_H_
|
#define _MLAN_DECL_H_
|
||||||
|
|
||||||
/** MLAN release version */
|
/** MLAN release version */
|
||||||
#define MLAN_RELEASE_VERSION "408.p2"
|
#define MLAN_RELEASE_VERSION "408.p3"
|
||||||
|
|
||||||
/** Re-define generic data types for MLAN/MOAL */
|
/** Re-define generic data types for MLAN/MOAL */
|
||||||
/** Signed char (1-byte) */
|
/** Signed char (1-byte) */
|
||||||
|
@ -275,7 +275,7 @@ typedef t_s32 t_sval;
|
||||||
|
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
/* Interrupt type */
|
/* Interrupt type */
|
||||||
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP };
|
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP, RX_CMD_DNLD };
|
||||||
#endif
|
#endif
|
||||||
#ifdef USB
|
#ifdef USB
|
||||||
#define MLAN_USB_BLOCK_SIZE (512)
|
#define MLAN_USB_BLOCK_SIZE (512)
|
||||||
|
@ -936,29 +936,34 @@ enum mlan_channel_type {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** channel band */
|
/** channel band */
|
||||||
enum { BAND_2GHZ = 0,
|
enum {
|
||||||
BAND_5GHZ = 1,
|
BAND_2GHZ = 0,
|
||||||
BAND_6GHZ = 2,
|
BAND_5GHZ = 1,
|
||||||
BAND_4GHZ = 3,
|
BAND_6GHZ = 2,
|
||||||
|
BAND_4GHZ = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** channel offset */
|
/** channel offset */
|
||||||
enum { SEC_CHAN_NONE = 0,
|
enum {
|
||||||
SEC_CHAN_ABOVE = 1,
|
SEC_CHAN_NONE = 0,
|
||||||
SEC_CHAN_5MHZ = 2,
|
SEC_CHAN_ABOVE = 1,
|
||||||
SEC_CHAN_BELOW = 3 };
|
SEC_CHAN_5MHZ = 2,
|
||||||
|
SEC_CHAN_BELOW = 3
|
||||||
|
};
|
||||||
|
|
||||||
/** channel bandwidth */
|
/** channel bandwidth */
|
||||||
enum { CHAN_BW_20MHZ = 0,
|
enum {
|
||||||
CHAN_BW_10MHZ,
|
CHAN_BW_20MHZ = 0,
|
||||||
CHAN_BW_40MHZ,
|
CHAN_BW_10MHZ,
|
||||||
CHAN_BW_80MHZ,
|
CHAN_BW_40MHZ,
|
||||||
|
CHAN_BW_80MHZ,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** scan mode */
|
/** scan mode */
|
||||||
enum { SCAN_MODE_MANUAL = 0,
|
enum {
|
||||||
SCAN_MODE_ACS,
|
SCAN_MODE_MANUAL = 0,
|
||||||
SCAN_MODE_USER,
|
SCAN_MODE_ACS,
|
||||||
|
SCAN_MODE_USER,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** DFS state */
|
/** DFS state */
|
||||||
|
|
|
@ -163,9 +163,10 @@ enum logger_attributes {
|
||||||
|
|
||||||
/* Below events refer to the wifi_connectivity_event ring and shall be supported
|
/* Below events refer to the wifi_connectivity_event ring and shall be supported
|
||||||
*/
|
*/
|
||||||
enum { WIFI_EVENT_ASSOCIATION_REQUESTED = 0,
|
enum {
|
||||||
WIFI_EVENT_AUTH_COMPLETE,
|
WIFI_EVENT_ASSOCIATION_REQUESTED = 0,
|
||||||
WIFI_EVENT_ASSOC_COMPLETE,
|
WIFI_EVENT_AUTH_COMPLETE,
|
||||||
|
WIFI_EVENT_ASSOC_COMPLETE,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -175,11 +176,13 @@ enum {
|
||||||
RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1))
|
RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1))
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { ENTRY_TYPE_CONNECT_EVENT = 1,
|
enum {
|
||||||
ENTRY_TYPE_PKT,
|
ENTRY_TYPE_CONNECT_EVENT = 1,
|
||||||
ENTRY_TYPE_WAKE_LOCK,
|
ENTRY_TYPE_PKT,
|
||||||
ENTRY_TYPE_POWER_EVENT,
|
ENTRY_TYPE_WAKE_LOCK,
|
||||||
ENTRY_TYPE_DATA };
|
ENTRY_TYPE_POWER_EVENT,
|
||||||
|
ENTRY_TYPE_DATA
|
||||||
|
};
|
||||||
|
|
||||||
/** WiFi ring buffer entry structure */
|
/** WiFi ring buffer entry structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -506,9 +509,10 @@ int woal_packet_fate_monitor(moal_private *priv,
|
||||||
#define APF_FRAME_HEADER_SIZE 14
|
#define APF_FRAME_HEADER_SIZE 14
|
||||||
#define PACKET_FILTER_MAX_LEN 1024
|
#define PACKET_FILTER_MAX_LEN 1024
|
||||||
|
|
||||||
enum { PACKET_FILTER_STATE_INIT = 0,
|
enum {
|
||||||
PACKET_FILTER_STATE_STOP,
|
PACKET_FILTER_STATE_INIT = 0,
|
||||||
PACKET_FILTER_STATE_START,
|
PACKET_FILTER_STATE_STOP,
|
||||||
|
PACKET_FILTER_STATE_START,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wifi_attr_packet_filter {
|
enum wifi_attr_packet_filter {
|
||||||
|
|
|
@ -2213,7 +2213,7 @@ static int woal_setget_priv_txratecfg(moal_private *priv, t_u8 *respbuf,
|
||||||
data[3]);
|
data[3]);
|
||||||
|
|
||||||
/* HE Preamble type */
|
/* HE Preamble type */
|
||||||
//#define HE_SU_PREAMBLE 0
|
// #define HE_SU_PREAMBLE 0
|
||||||
#define HE_ER_PREAMBLE 1
|
#define HE_ER_PREAMBLE 1
|
||||||
|
|
||||||
/* HE ER SU Type */
|
/* HE ER SU Type */
|
||||||
|
|
|
@ -5952,7 +5952,11 @@ void woal_queue_rx_task(moal_handle *handle)
|
||||||
ENTER();
|
ENTER();
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
if (IS_PCIE(handle->card_type)) {
|
if (IS_PCIE(handle->card_type)) {
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_schedule(&handle->pcie_rx_task);
|
tasklet_schedule(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
queue_work(handle->pcie_rx_workqueue, &handle->pcie_rx_work);
|
||||||
|
#endif
|
||||||
LEAVE();
|
LEAVE();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -5998,8 +6002,15 @@ void woal_flush_workqueue(moal_handle *handle)
|
||||||
flush_workqueue(handle->pcie_rx_event_workqueue);
|
flush_workqueue(handle->pcie_rx_event_workqueue);
|
||||||
if (handle->pcie_cmd_resp_workqueue)
|
if (handle->pcie_cmd_resp_workqueue)
|
||||||
flush_workqueue(handle->pcie_cmd_resp_workqueue);
|
flush_workqueue(handle->pcie_cmd_resp_workqueue);
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_kill(&handle->pcie_tx_complete_task);
|
tasklet_kill(&handle->pcie_tx_complete_task);
|
||||||
tasklet_kill(&handle->pcie_rx_task);
|
tasklet_kill(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
if (handle->pcie_tx_complete_workqueue)
|
||||||
|
flush_workqueue(handle->pcie_tx_complete_workqueue);
|
||||||
|
if (handle->pcie_rx_workqueue)
|
||||||
|
flush_workqueue(handle->pcie_rx_workqueue);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LEAVE();
|
LEAVE();
|
||||||
|
@ -6055,8 +6066,21 @@ void woal_terminate_workqueue(moal_handle *handle)
|
||||||
destroy_workqueue(handle->pcie_cmd_resp_workqueue);
|
destroy_workqueue(handle->pcie_cmd_resp_workqueue);
|
||||||
handle->pcie_cmd_resp_workqueue = NULL;
|
handle->pcie_cmd_resp_workqueue = NULL;
|
||||||
}
|
}
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_kill(&handle->pcie_tx_complete_task);
|
tasklet_kill(&handle->pcie_tx_complete_task);
|
||||||
tasklet_kill(&handle->pcie_rx_task);
|
tasklet_kill(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
if (handle->pcie_rx_workqueue) {
|
||||||
|
flush_workqueue(handle->pcie_rx_workqueue);
|
||||||
|
destroy_workqueue(handle->pcie_rx_workqueue);
|
||||||
|
handle->pcie_rx_workqueue = NULL;
|
||||||
|
}
|
||||||
|
if (handle->pcie_tx_complete_workqueue) {
|
||||||
|
flush_workqueue(handle->pcie_tx_complete_workqueue);
|
||||||
|
destroy_workqueue(handle->pcie_tx_complete_workqueue);
|
||||||
|
handle->pcie_tx_complete_workqueue = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LEAVE();
|
LEAVE();
|
||||||
|
@ -11464,6 +11488,7 @@ t_void woal_rx_work_queue(struct work_struct *work)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
/**
|
/**
|
||||||
* @brief This tasklet handles rx_data
|
* @brief This tasklet handles rx_data
|
||||||
*
|
*
|
||||||
|
@ -11529,6 +11554,74 @@ t_void woal_pcie_tx_complete_task(unsigned long data)
|
||||||
mlan_process_pcie_interrupt_cb(handle->pmlan_adapter, TX_COMPLETE);
|
mlan_process_pcie_interrupt_cb(handle->pmlan_adapter, TX_COMPLETE);
|
||||||
LEAVE();
|
LEAVE();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* @brief This work queue handles rx_data interrupt
|
||||||
|
*
|
||||||
|
* @param work A pointer to work_struct
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
t_void woal_pcie_rx_work_queue(struct work_struct *work)
|
||||||
|
{
|
||||||
|
moal_handle *handle = container_of(work, moal_handle, pcie_rx_work);
|
||||||
|
wifi_timeval start_timeval;
|
||||||
|
wifi_timeval end_timeval;
|
||||||
|
|
||||||
|
ENTER();
|
||||||
|
|
||||||
|
if (!handle || handle->surprise_removed == MTRUE) {
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||||
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
|
||||||
|
if (handle->cfg80211_suspend == MTRUE) {
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
woal_get_monotonic_time(&start_timeval);
|
||||||
|
|
||||||
|
mlan_process_pcie_interrupt_cb(handle->pmlan_adapter, RX_DATA);
|
||||||
|
|
||||||
|
woal_get_monotonic_time(&end_timeval);
|
||||||
|
handle->rx_time += (t_u64)(timeval_to_usec(end_timeval) -
|
||||||
|
timeval_to_usec(start_timeval));
|
||||||
|
PRINTM(MINFO,
|
||||||
|
"%s : start_timeval=%d:%d end_timeval=%d:%d inter=%llu rx_time=%llu\n",
|
||||||
|
__func__, start_timeval.time_sec, start_timeval.time_usec,
|
||||||
|
end_timeval.time_sec, end_timeval.time_usec,
|
||||||
|
(t_u64)(timeval_to_usec(end_timeval) -
|
||||||
|
timeval_to_usec(start_timeval)),
|
||||||
|
handle->rx_time);
|
||||||
|
LEAVE();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This workqueue handles tx_complete interrupt
|
||||||
|
*
|
||||||
|
* @param work A pointer to work_struct
|
||||||
|
*
|
||||||
|
* @return N/A
|
||||||
|
*/
|
||||||
|
t_void woal_pcie_tx_complete_work_queue(struct work_struct *work)
|
||||||
|
{
|
||||||
|
moal_handle *handle =
|
||||||
|
container_of(work, moal_handle, pcie_tx_complete_work);
|
||||||
|
ENTER();
|
||||||
|
|
||||||
|
if (!handle || handle->surprise_removed == MTRUE) {
|
||||||
|
LEAVE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mlan_process_pcie_interrupt_cb(handle->pmlan_adapter, TX_COMPLETE);
|
||||||
|
LEAVE();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This workqueue handles rx_event
|
* @brief This workqueue handles rx_event
|
||||||
|
@ -12178,10 +12271,55 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops,
|
||||||
}
|
}
|
||||||
MLAN_INIT_WORK(&handle->pcie_cmd_resp_work,
|
MLAN_INIT_WORK(&handle->pcie_cmd_resp_work,
|
||||||
woal_pcie_cmd_resp_work_queue);
|
woal_pcie_cmd_resp_work_queue);
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_init(&handle->pcie_tx_complete_task,
|
tasklet_init(&handle->pcie_tx_complete_task,
|
||||||
woal_pcie_tx_complete_task, (unsigned long)handle);
|
woal_pcie_tx_complete_task, (unsigned long)handle);
|
||||||
tasklet_init(&handle->pcie_rx_task, woal_pcie_rx_data_task,
|
tasklet_init(&handle->pcie_rx_task, woal_pcie_rx_data_task,
|
||||||
(unsigned long)handle);
|
(unsigned long)handle);
|
||||||
|
#else
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
|
||||||
|
/* For kernel less than 2.6.14 name can not be
|
||||||
|
* greater than 10 characters */
|
||||||
|
handle->pcie_rx_workqueue =
|
||||||
|
create_workqueue("MOAL_PCIE_RX_WORKQ");
|
||||||
|
#else
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
|
||||||
|
handle->pcie_rx_workqueue = alloc_workqueue(
|
||||||
|
"MOAL_PCIE_RX_WORK_QUEUE",
|
||||||
|
WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1);
|
||||||
|
#else
|
||||||
|
handle->pcie_rx_workqueue =
|
||||||
|
create_workqueue("MOAL_PCIE_RX_WORK_QUEUE");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
if (!handle->pcie_rx_workqueue) {
|
||||||
|
woal_terminate_workqueue(handle);
|
||||||
|
goto err_kmalloc;
|
||||||
|
}
|
||||||
|
MLAN_INIT_WORK(&handle->pcie_rx_work, woal_pcie_rx_work_queue);
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
|
||||||
|
/* For kernel less than 2.6.14 name can not be
|
||||||
|
* greater than 10 characters */
|
||||||
|
handle->pcie_tx_complete_workqueue =
|
||||||
|
create_workqueue("MOAL_PCIE_TX_COMPLETE_WORKQ");
|
||||||
|
#else
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
|
||||||
|
handle->pcie_tx_complete_workqueue = alloc_workqueue(
|
||||||
|
"MOAL_PCIE_TX_COMPLETE_WORKQ",
|
||||||
|
WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1);
|
||||||
|
#else
|
||||||
|
handle->pcie_tx_complete_workqueue =
|
||||||
|
create_workqueue("MOAL_PCIE_TX_COMPLETE_WORKQ");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
if (!handle->pcie_tx_complete_workqueue) {
|
||||||
|
woal_terminate_workqueue(handle);
|
||||||
|
goto err_kmalloc;
|
||||||
|
}
|
||||||
|
MLAN_INIT_WORK(&handle->pcie_tx_complete_work,
|
||||||
|
woal_pcie_tx_complete_work_queue);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif // PCIE
|
#endif // PCIE
|
||||||
|
|
||||||
|
|
|
@ -162,10 +162,6 @@ Change log:
|
||||||
#define IMX_ANDROID_13 0
|
#define IMX_ANDROID_13 0
|
||||||
#define IMX_ANDROID_12_BACKPORT 0
|
#define IMX_ANDROID_12_BACKPORT 0
|
||||||
|
|
||||||
#if defined(IMX_SUPPORT)
|
|
||||||
|
|
||||||
#if defined(IMX_ANDROID)
|
|
||||||
|
|
||||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 52)
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 52)
|
||||||
#undef IMX_ANDROID_13
|
#undef IMX_ANDROID_13
|
||||||
#define IMX_ANDROID_13 1
|
#define IMX_ANDROID_13 1
|
||||||
|
@ -174,8 +170,6 @@ Change log:
|
||||||
#undef IMX_ANDROID_12_BACKPORT
|
#undef IMX_ANDROID_12_BACKPORT
|
||||||
#define IMX_ANDROID_12_BACKPORT 1
|
#define IMX_ANDROID_12_BACKPORT 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reason Code 3: STA is leaving (or has left) IBSS or ESS
|
* Reason Code 3: STA is leaving (or has left) IBSS or ESS
|
||||||
|
@ -385,11 +379,13 @@ typedef enum _MOAL_HARDWARE_STATUS {
|
||||||
enum { MOAL_NO_WAIT, MOAL_IOCTL_WAIT, MOAL_IOCTL_WAIT_TIMEOUT };
|
enum { MOAL_NO_WAIT, MOAL_IOCTL_WAIT, MOAL_IOCTL_WAIT_TIMEOUT };
|
||||||
|
|
||||||
/** moal_main_state */
|
/** moal_main_state */
|
||||||
enum { MOAL_STATE_IDLE,
|
enum {
|
||||||
MOAL_RECV_INT,
|
MOAL_STATE_IDLE,
|
||||||
MOAL_ENTER_WORK_QUEUE,
|
MOAL_RECV_INT,
|
||||||
MOAL_START_MAIN_PROCESS,
|
MOAL_ENTER_WORK_QUEUE,
|
||||||
MOAL_END_MAIN_PROCESS };
|
MOAL_START_MAIN_PROCESS,
|
||||||
|
MOAL_END_MAIN_PROCESS
|
||||||
|
};
|
||||||
|
|
||||||
/** HostCmd_Header */
|
/** HostCmd_Header */
|
||||||
typedef struct _HostCmd_Header {
|
typedef struct _HostCmd_Header {
|
||||||
|
@ -2153,7 +2149,8 @@ extern t_u8 ru_signal_52[9];
|
||||||
y = (y + 1) - TONE_MAX_USERS_242; \
|
y = (y + 1) - TONE_MAX_USERS_242; \
|
||||||
} else { \
|
} else { \
|
||||||
tone = (y == 2) ? RU_TONE_106 : \
|
tone = (y == 2) ? RU_TONE_106 : \
|
||||||
(y == 1) ? 0 : RU_TONE_106; \
|
(y == 1) ? 0 : \
|
||||||
|
RU_TONE_106; \
|
||||||
} \
|
} \
|
||||||
} else if (x == RU_40_242_TONE) { \
|
} else if (x == RU_40_242_TONE) { \
|
||||||
if (!y) { \
|
if (!y) { \
|
||||||
|
@ -2739,10 +2736,21 @@ struct _moal_handle {
|
||||||
struct workqueue_struct *pcie_cmd_resp_workqueue;
|
struct workqueue_struct *pcie_cmd_resp_workqueue;
|
||||||
/** pcie rx cmd resp work */
|
/** pcie rx cmd resp work */
|
||||||
struct work_struct pcie_cmd_resp_work;
|
struct work_struct pcie_cmd_resp_work;
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
/* pcie rx data tasklet */
|
/* pcie rx data tasklet */
|
||||||
struct tasklet_struct pcie_rx_task;
|
struct tasklet_struct pcie_rx_task;
|
||||||
/* pcie tx complete tasklet */
|
/* pcie tx complete tasklet */
|
||||||
struct tasklet_struct pcie_tx_complete_task;
|
struct tasklet_struct pcie_tx_complete_task;
|
||||||
|
#else
|
||||||
|
/** Driver pcie rx workqueue */
|
||||||
|
struct workqueue_struct *pcie_rx_workqueue;
|
||||||
|
/* pcie rx work */
|
||||||
|
struct work_struct pcie_rx_work;
|
||||||
|
/** Driver pcie tx complete workqueue */
|
||||||
|
struct workqueue_struct *pcie_tx_complete_workqueue;
|
||||||
|
/* pcie tx complete work */
|
||||||
|
struct work_struct pcie_tx_complete_work;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/** event spin lock */
|
/** event spin lock */
|
||||||
spinlock_t evt_lock;
|
spinlock_t evt_lock;
|
||||||
|
@ -4043,6 +4051,10 @@ t_void woal_mclist_work_queue(struct work_struct *work);
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
t_void woal_pcie_rx_event_work_queue(struct work_struct *work);
|
t_void woal_pcie_rx_event_work_queue(struct work_struct *work);
|
||||||
t_void woal_pcie_cmd_resp_work_queue(struct work_struct *work);
|
t_void woal_pcie_cmd_resp_work_queue(struct work_struct *work);
|
||||||
|
#ifndef TASKLET_SUPPORT
|
||||||
|
t_void woal_pcie_rx_work_queue(struct work_struct *work);
|
||||||
|
t_void woal_pcie_tx_complete_work_queue(struct work_struct *work);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STA_CFG80211
|
#ifdef STA_CFG80211
|
||||||
|
|
|
@ -2578,7 +2578,11 @@ static mlan_status wlan_process_defer_event(moal_handle *handle,
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
case MLAN_EVENT_ID_DRV_DEFER_RX_DATA:
|
case MLAN_EVENT_ID_DRV_DEFER_RX_DATA:
|
||||||
status = MLAN_STATUS_SUCCESS;
|
status = MLAN_STATUS_SUCCESS;
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_schedule(&handle->pcie_rx_task);
|
tasklet_schedule(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
queue_work(handle->pcie_rx_workqueue, &handle->pcie_rx_work);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case MLAN_EVENT_ID_DRV_DEFER_RX_EVENT:
|
case MLAN_EVENT_ID_DRV_DEFER_RX_EVENT:
|
||||||
status = MLAN_STATUS_SUCCESS;
|
status = MLAN_STATUS_SUCCESS;
|
||||||
|
@ -2592,7 +2596,12 @@ static mlan_status wlan_process_defer_event(moal_handle *handle,
|
||||||
break;
|
break;
|
||||||
case MLAN_EVENT_ID_DRV_DEFER_TX_COMPLTE:
|
case MLAN_EVENT_ID_DRV_DEFER_TX_COMPLTE:
|
||||||
status = MLAN_STATUS_SUCCESS;
|
status = MLAN_STATUS_SUCCESS;
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_schedule(&handle->pcie_tx_complete_task);
|
tasklet_schedule(&handle->pcie_tx_complete_task);
|
||||||
|
#else
|
||||||
|
queue_work(handle->pcie_tx_complete_workqueue,
|
||||||
|
&handle->pcie_tx_complete_work);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif /* PCIE */
|
#endif /* PCIE */
|
||||||
|
|
||||||
|
@ -2604,7 +2613,11 @@ static mlan_status wlan_process_defer_event(moal_handle *handle,
|
||||||
}
|
}
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
if (IS_PCIE(handle->card_type)) {
|
if (IS_PCIE(handle->card_type)) {
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_kill(&handle->pcie_rx_task);
|
tasklet_kill(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
flush_workqueue(handle->pcie_rx_workqueue);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2628,7 +2641,12 @@ static mlan_status wlan_process_defer_event(moal_handle *handle,
|
||||||
}
|
}
|
||||||
#ifdef PCIE
|
#ifdef PCIE
|
||||||
if (IS_PCIE(handle->card_type)) {
|
if (IS_PCIE(handle->card_type)) {
|
||||||
|
#ifdef TASKLET_SUPPORT
|
||||||
tasklet_schedule(&handle->pcie_rx_task);
|
tasklet_schedule(&handle->pcie_rx_task);
|
||||||
|
#else
|
||||||
|
queue_work(handle->pcie_rx_workqueue,
|
||||||
|
&handle->pcie_rx_work);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2916,10 +2934,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
|
||||||
|
|
||||||
if (!is_zero_timeval(priv->phandle->scan_time_start)) {
|
if (!is_zero_timeval(priv->phandle->scan_time_start)) {
|
||||||
woal_get_monotonic_time(&priv->phandle->scan_time_end);
|
woal_get_monotonic_time(&priv->phandle->scan_time_end);
|
||||||
priv->phandle->scan_time += (t_u64)(
|
priv->phandle->scan_time +=
|
||||||
timeval_to_usec(priv->phandle->scan_time_end) -
|
(t_u64)(timeval_to_usec(
|
||||||
timeval_to_usec(
|
priv->phandle->scan_time_end) -
|
||||||
priv->phandle->scan_time_start));
|
timeval_to_usec(
|
||||||
|
priv->phandle->scan_time_start));
|
||||||
PRINTM(MINFO,
|
PRINTM(MINFO,
|
||||||
"%s : start_timeval=%d:%d end_timeval=%d:%d inter=%llu scan_time=%llu\n",
|
"%s : start_timeval=%d:%d end_timeval=%d:%d inter=%llu scan_time=%llu\n",
|
||||||
__func__,
|
__func__,
|
||||||
|
|
|
@ -210,6 +210,9 @@ int woal_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
||||||
const u8 *peer,
|
const u8 *peer,
|
||||||
#else
|
#else
|
||||||
u8 *peer,
|
u8 *peer,
|
||||||
|
#endif
|
||||||
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
|
||||||
|
int link_id,
|
||||||
#endif
|
#endif
|
||||||
u8 action_code, u8 dialog_token, u16 status_code,
|
u8 action_code, u8 dialog_token, u16 status_code,
|
||||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
|
||||||
|
@ -8171,7 +8174,6 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
|
|
||||||
/**
|
/**
|
||||||
* @brief Tx TDLS packet
|
* @brief Tx TDLS packet
|
||||||
*
|
*
|
||||||
|
@ -8188,6 +8190,14 @@ fail:
|
||||||
*
|
*
|
||||||
* @return 0 -- success, otherwise fail
|
* @return 0 -- success, otherwise fail
|
||||||
*/
|
*/
|
||||||
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
|
||||||
|
int woal_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
||||||
|
const t_u8 *peer, int link_id, u8 action_code,
|
||||||
|
t_u8 dialog_token, t_u16 status_code,
|
||||||
|
t_u32 peer_capability, bool initiator,
|
||||||
|
const t_u8 *extra_ies, size_t extra_ies_len)
|
||||||
|
#else
|
||||||
|
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
|
||||||
int woal_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
int woal_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
||||||
const t_u8 *peer, u8 action_code, t_u8 dialog_token,
|
const t_u8 *peer, u8 action_code, t_u8 dialog_token,
|
||||||
t_u16 status_code, t_u32 peer_capability,
|
t_u16 status_code, t_u32 peer_capability,
|
||||||
|
@ -8240,6 +8250,7 @@ int woal_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
||||||
size_t extra_ies_len)
|
size_t extra_ies_len)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
|
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -3398,9 +3398,9 @@ int woal_uap_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
|
||||||
if (info->param.sta_list.info[idx].stats.last_rx_in_msec) {
|
if (info->param.sta_list.info[idx].stats.last_rx_in_msec) {
|
||||||
moal_get_system_time(priv->phandle, &sec, &usec);
|
moal_get_system_time(priv->phandle, &sec, &usec);
|
||||||
cur_msec = (t_u64)sec * 1000 + (t_u64)usec / 1000;
|
cur_msec = (t_u64)sec * 1000 + (t_u64)usec / 1000;
|
||||||
sinfo->inactive_time = (t_u32)(
|
sinfo->inactive_time =
|
||||||
cur_msec -
|
(t_u32)(cur_msec - info->param.sta_list.info[idx]
|
||||||
info->param.sta_list.info[idx].stats.last_rx_in_msec);
|
.stats.last_rx_in_msec);
|
||||||
PRINTM(MIOCTL,
|
PRINTM(MIOCTL,
|
||||||
"cur:%llu - [%d].last_rx:%llu = inactive_time:%d\n",
|
"cur:%llu - [%d].last_rx:%llu = inactive_time:%d\n",
|
||||||
cur_msec, idx,
|
cur_msec, idx,
|
||||||
|
|
|
@ -3212,8 +3212,8 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
||||||
|
|
||||||
while ((unsigned int)beacon_size >=
|
while ((unsigned int)beacon_size >=
|
||||||
sizeof(IEEEtypes_Header_t)) {
|
sizeof(IEEEtypes_Header_t)) {
|
||||||
element_id = (IEEEtypes_ElementId_e)(
|
element_id = (IEEEtypes_ElementId_e)(*(
|
||||||
*(t_u8 *)pbeacon);
|
t_u8 *)pbeacon);
|
||||||
element_len = *((t_u8 *)pbeacon + 1);
|
element_len = *((t_u8 *)pbeacon + 1);
|
||||||
if ((unsigned int)beacon_size <
|
if ((unsigned int)beacon_size <
|
||||||
(unsigned int)element_len +
|
(unsigned int)element_len +
|
||||||
|
|
Loading…
Reference in a new issue