qcacld-3.0: Add support for deauth retry for STA
Add support to retry the deauth frame if the Tx is not success if user configured the retry count. Change-Id: Id128b4a70a276ee86270372ff7954e40bde8123c CRs-Fixed: 2754305
This commit is contained in:

committed by
snandini

parent
c4036d58ad
commit
0044d8c41c
@@ -1389,6 +1389,7 @@ static void mlme_init_sta_cfg(struct wlan_objmgr_psoc *psoc,
|
|||||||
cfg_get(psoc, CFG_QCN_IE_SUPPORT);
|
cfg_get(psoc, CFG_QCN_IE_SUPPORT);
|
||||||
sta->fils_max_chan_guard_time =
|
sta->fils_max_chan_guard_time =
|
||||||
cfg_get(psoc, CFG_FILS_MAX_CHAN_GUARD_TIME);
|
cfg_get(psoc, CFG_FILS_MAX_CHAN_GUARD_TIME);
|
||||||
|
sta->deauth_retry_cnt = cfg_get(psoc, CFG_DEAUTH_RETRY_CNT);
|
||||||
sta->single_tid =
|
sta->single_tid =
|
||||||
cfg_get(psoc, CFG_SINGLE_TID_RC);
|
cfg_get(psoc, CFG_SINGLE_TID_RC);
|
||||||
sta->sta_miracast_mcc_rest_time =
|
sta->sta_miracast_mcc_rest_time =
|
||||||
|
@@ -193,6 +193,31 @@
|
|||||||
0, \
|
0, \
|
||||||
"send deauth before connection")
|
"send deauth before connection")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <ini>
|
||||||
|
* deauth_retry_cnt- No. of deauth retries if the Tx is failed
|
||||||
|
* @Min: 0
|
||||||
|
* @Max: 4
|
||||||
|
* @Default: 2
|
||||||
|
*
|
||||||
|
* This ini is used to set retry deauth if Tx is not success.
|
||||||
|
*
|
||||||
|
* Related: None
|
||||||
|
*
|
||||||
|
* Supported Feature: STA
|
||||||
|
*
|
||||||
|
* Usage: Internal/External
|
||||||
|
*
|
||||||
|
* </ini>
|
||||||
|
*/
|
||||||
|
#define CFG_DEAUTH_RETRY_CNT CFG_INI_UINT( \
|
||||||
|
"deauth_retry_cnt", \
|
||||||
|
0, \
|
||||||
|
4, \
|
||||||
|
2, \
|
||||||
|
CFG_VALUE_OR_DEFAULT, \
|
||||||
|
"Set Deauth retry count")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <ini>
|
* <ini>
|
||||||
* gDot11PMode - 802.11p mode
|
* gDot11PMode - 802.11p mode
|
||||||
@@ -441,6 +466,7 @@
|
|||||||
CFG(CFG_PPS_ENABLE_5G_EBT) \
|
CFG(CFG_PPS_ENABLE_5G_EBT) \
|
||||||
CFG(CFG_ENABLE_DEAUTH_BEFORE_CONNECTION) \
|
CFG(CFG_ENABLE_DEAUTH_BEFORE_CONNECTION) \
|
||||||
CFG(CFG_DOT11P_MODE) \
|
CFG(CFG_DOT11P_MODE) \
|
||||||
|
CFG(CFG_DEAUTH_RETRY_CNT) \
|
||||||
CFG(CFG_ENABLE_GO_CTS2SELF_FOR_STA) \
|
CFG(CFG_ENABLE_GO_CTS2SELF_FOR_STA) \
|
||||||
CFG(CFG_QCN_IE_SUPPORT) \
|
CFG(CFG_QCN_IE_SUPPORT) \
|
||||||
CFG(CFG_STA_MCAST_MCC_REST_TIME) \
|
CFG(CFG_STA_MCAST_MCC_REST_TIME) \
|
||||||
|
@@ -1331,6 +1331,7 @@ enum station_keepalive_method {
|
|||||||
* @dot11p_mode: Set 802.11p mode
|
* @dot11p_mode: Set 802.11p mode
|
||||||
* @fils_max_chan_guard_time: Set maximum channel guard time
|
* @fils_max_chan_guard_time: Set maximum channel guard time
|
||||||
* @current_rssi: Current rssi
|
* @current_rssi: Current rssi
|
||||||
|
* @deauth_retry_cnt: Deauth retry count
|
||||||
* @ignore_peer_erp_info: Ignore peer infrormation
|
* @ignore_peer_erp_info: Ignore peer infrormation
|
||||||
* @sta_prefer_80mhz_over_160mhz: Set Sta preference to connect in 80HZ/160HZ
|
* @sta_prefer_80mhz_over_160mhz: Set Sta preference to connect in 80HZ/160HZ
|
||||||
* @enable_5g_ebt: Set default 5G early beacon termination
|
* @enable_5g_ebt: Set default 5G early beacon termination
|
||||||
@@ -1351,6 +1352,7 @@ struct wlan_mlme_sta_cfg {
|
|||||||
enum dot11p_mode dot11p_mode;
|
enum dot11p_mode dot11p_mode;
|
||||||
uint8_t fils_max_chan_guard_time;
|
uint8_t fils_max_chan_guard_time;
|
||||||
uint8_t current_rssi;
|
uint8_t current_rssi;
|
||||||
|
uint8_t deauth_retry_cnt;
|
||||||
bool ignore_peer_erp_info;
|
bool ignore_peer_erp_info;
|
||||||
bool sta_prefer_80mhz_over_160mhz;
|
bool sta_prefer_80mhz_over_160mhz;
|
||||||
bool enable_5g_ebt;
|
bool enable_5g_ebt;
|
||||||
|
@@ -1366,6 +1366,18 @@ struct deauth_req {
|
|||||||
uint16_t reasonCode;
|
uint16_t reasonCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct deauth_retry_params - deauth retry params
|
||||||
|
* @peer_mac: peer mac
|
||||||
|
* @reason_code: reason for disconnect indication
|
||||||
|
* @retry_cnt: retry count
|
||||||
|
*/
|
||||||
|
struct deauth_retry_params {
|
||||||
|
struct qdf_mac_addr peer_macaddr;
|
||||||
|
uint16_t reason_code;
|
||||||
|
uint8_t retry_cnt;
|
||||||
|
};
|
||||||
|
|
||||||
/* / Definition for Deauthetication response */
|
/* / Definition for Deauthetication response */
|
||||||
struct deauth_rsp {
|
struct deauth_rsp {
|
||||||
uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
|
uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
|
||||||
|
@@ -539,6 +539,7 @@ struct pe_session {
|
|||||||
uint8_t bss_color_changing;
|
uint8_t bss_color_changing;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
struct deauth_retry_params deauth_retry;
|
||||||
bool enable_bcast_probe_rsp;
|
bool enable_bcast_probe_rsp;
|
||||||
uint8_t ht_client_cnt;
|
uint8_t ht_client_cnt;
|
||||||
bool force_24ghz_in_ht20;
|
bool force_24ghz_in_ht20;
|
||||||
|
@@ -3220,6 +3220,10 @@ static QDF_STATUS lim_deauth_tx_complete_cnf_handler(void *context,
|
|||||||
struct mac_context *mac_ctx = (struct mac_context *)context;
|
struct mac_context *mac_ctx = (struct mac_context *)context;
|
||||||
QDF_STATUS status_code;
|
QDF_STATUS status_code;
|
||||||
struct scheduler_msg msg = {0};
|
struct scheduler_msg msg = {0};
|
||||||
|
tLimMlmDeauthReq *deauth_req;
|
||||||
|
struct pe_session *session = NULL;
|
||||||
|
|
||||||
|
deauth_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
|
||||||
|
|
||||||
pe_debug("tx_complete = %s tx_success = %d",
|
pe_debug("tx_complete = %s tx_success = %d",
|
||||||
(tx_success == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK) ?
|
(tx_success == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK) ?
|
||||||
@@ -3227,6 +3231,22 @@ static QDF_STATUS lim_deauth_tx_complete_cnf_handler(void *context,
|
|||||||
|
|
||||||
if (buf)
|
if (buf)
|
||||||
qdf_nbuf_free(buf);
|
qdf_nbuf_free(buf);
|
||||||
|
if (deauth_req)
|
||||||
|
session = pe_find_session_by_session_id(mac_ctx,
|
||||||
|
deauth_req->sessionId);
|
||||||
|
if (tx_success != WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK && session &&
|
||||||
|
session->deauth_retry.retry_cnt) {
|
||||||
|
if (tx_timer_running(
|
||||||
|
&mac_ctx->lim.lim_timers.gLimDeauthAckTimer))
|
||||||
|
lim_deactivate_and_change_timer(mac_ctx,
|
||||||
|
eLIM_DEAUTH_ACK_TIMER);
|
||||||
|
lim_send_deauth_mgmt_frame(mac_ctx,
|
||||||
|
session->deauth_retry.reason_code,
|
||||||
|
session->deauth_retry.peer_macaddr.bytes,
|
||||||
|
session, true);
|
||||||
|
session->deauth_retry.retry_cnt--;
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
msg.type = (uint16_t) WMA_DEAUTH_TX_COMP;
|
msg.type = (uint16_t) WMA_DEAUTH_TX_COMP;
|
||||||
msg.bodyptr = params;
|
msg.bodyptr = params;
|
||||||
msg.bodyval = tx_success;
|
msg.bodyval = tx_success;
|
||||||
@@ -3594,6 +3614,15 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
|
|||||||
lim_diag_mgmt_tx_event_report(mac, pMacHdr,
|
lim_diag_mgmt_tx_event_report(mac, pMacHdr,
|
||||||
pe_session,
|
pe_session,
|
||||||
QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS);
|
QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS);
|
||||||
|
if (pe_session->opmode == QDF_STA_MODE &&
|
||||||
|
mac->mlme_cfg->sta.deauth_retry_cnt &&
|
||||||
|
!pe_session->deauth_retry.retry_cnt) {
|
||||||
|
pe_session->deauth_retry.retry_cnt =
|
||||||
|
mac->mlme_cfg->sta.deauth_retry_cnt;
|
||||||
|
pe_session->deauth_retry.reason_code = nReason;
|
||||||
|
qdf_mem_copy(pe_session->deauth_retry.peer_macaddr.bytes,
|
||||||
|
peer, QDF_MAC_ADDR_SIZE);
|
||||||
|
}
|
||||||
/* Queue Disassociation frame in high priority WQ */
|
/* Queue Disassociation frame in high priority WQ */
|
||||||
qdf_status =
|
qdf_status =
|
||||||
wma_tx_frameWithTxComplete(mac, pPacket, (uint16_t) nBytes,
|
wma_tx_frameWithTxComplete(mac, pPacket, (uint16_t) nBytes,
|
||||||
|
Reference in New Issue
Block a user