qcacld-3.0: deauth and disassoc process for mlo sap
When triggering or receiving deauth/disassoc frames, free the peer and its partner peer Change-Id: Ibfa1c9e471f36537d25e6110529477c61cf89b7e CRs-Fixed: 2973319
这个提交包含在:
@@ -329,10 +329,11 @@ lim_release_peer_idx(struct mac_context *mac, uint16_t peer_idx,
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
void
|
||||
lim_release_mlo_conn_idx(struct mac_context *mac, uint16_t peer_idx,
|
||||
struct pe_session *session)
|
||||
struct pe_session *session, bool free_aid)
|
||||
{
|
||||
session->gLimNumOfCurrentSTAs--;
|
||||
if (wlan_mlo_get_mlpeer_by_aid(session->vdev->mlo_dev_ctx, peer_idx))
|
||||
if (free_aid &&
|
||||
wlan_mlo_get_mlpeer_by_aid(session->vdev->mlo_dev_ctx, peer_idx))
|
||||
mlo_free_aid(session->vdev, peer_idx);
|
||||
}
|
||||
#endif
|
||||
|
@@ -58,6 +58,7 @@
|
||||
|
||||
#include <cdp_txrx_cfg.h>
|
||||
#include <cdp_txrx_cmn.h>
|
||||
#include <lim_mlo.h>
|
||||
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
#define IS_TDLS_PEER(type) ((type) == STA_ENTRY_TDLS_PEER)
|
||||
@@ -358,6 +359,8 @@ QDF_STATUS lim_del_sta_all(struct mac_context *mac,
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct vdev_mlme_obj *mlme_obj;
|
||||
uint32_t i;
|
||||
tpDphHashNode sta_ds;
|
||||
|
||||
if (!LIM_IS_AP_ROLE(pe_session))
|
||||
return QDF_STATUS_E_INVAL;
|
||||
@@ -368,6 +371,17 @@ QDF_STATUS lim_del_sta_all(struct mac_context *mac,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (wlan_vdev_mlme_is_mlo_ap(pe_session->vdev)) {
|
||||
for (i = 1; i < pe_session->dph.dphHashTable.size; i++) {
|
||||
sta_ds = dph_get_hash_entry(
|
||||
mac, i,
|
||||
&pe_session->dph.dphHashTable);
|
||||
if (!sta_ds)
|
||||
continue;
|
||||
if (lim_is_mlo_conn(pe_session, sta_ds))
|
||||
lim_mlo_delete_link_peer(pe_session, sta_ds);
|
||||
}
|
||||
}
|
||||
status = vdev_mgr_peer_delete_all_send(mlme_obj);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
pe_err("failed status = %d", status);
|
||||
@@ -2668,6 +2682,11 @@ lim_del_sta(struct mac_context *mac,
|
||||
pDelStaParams->respReqd = 1;
|
||||
}
|
||||
|
||||
/* notify mlo peer to detach reference of the
|
||||
* link peer before post WMA_DELETE_STA_REQ, which will free
|
||||
* wlan_objmgr_peer of the link peer
|
||||
*/
|
||||
lim_mlo_delete_link_peer(pe_session, sta);
|
||||
/* Update PE session ID */
|
||||
pDelStaParams->sessionId = pe_session->peSessionId;
|
||||
pDelStaParams->smesessionId = pe_session->smeSessionId;
|
||||
@@ -4237,9 +4256,14 @@ void lim_prepare_and_send_del_all_sta_cnf(struct mac_context *mac,
|
||||
&pe_session->dph.dphHashTable);
|
||||
if (!sta_ds)
|
||||
continue;
|
||||
|
||||
lim_delete_dph_hash_entry(mac, sta_ds->staAddr,
|
||||
sta_ds->assocId, pe_session);
|
||||
lim_release_peer_idx(mac, sta_ds->assocId, pe_session);
|
||||
if (lim_is_mlo_conn(pe_session, sta_ds))
|
||||
lim_release_mlo_conn_idx(mac, sta_ds->assocId,
|
||||
pe_session, false);
|
||||
else
|
||||
lim_release_peer_idx(mac, sta_ds->assocId, pe_session);
|
||||
}
|
||||
|
||||
qdf_set_macaddr_broadcast(&mlm_deauth.peer_macaddr);
|
||||
@@ -4272,18 +4296,29 @@ lim_prepare_and_send_del_sta_cnf(struct mac_context *mac, tpDphHashNode sta,
|
||||
uint16_t staDsAssocId = 0;
|
||||
struct qdf_mac_addr sta_dsaddr;
|
||||
struct lim_sta_context mlmStaContext;
|
||||
bool mlo_conn = false;
|
||||
bool mlo_recv_assoc_frm = false;
|
||||
|
||||
if (!sta) {
|
||||
pe_err("sta is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
staDsAssocId = sta->assocId;
|
||||
qdf_mem_copy((uint8_t *) sta_dsaddr.bytes,
|
||||
sta->staAddr, QDF_MAC_ADDR_SIZE);
|
||||
|
||||
mlmStaContext = sta->mlmStaContext;
|
||||
if (LIM_IS_AP_ROLE(pe_session))
|
||||
lim_release_peer_idx(mac, sta->assocId, pe_session);
|
||||
mlo_conn = lim_is_mlo_conn(pe_session, sta);
|
||||
mlo_recv_assoc_frm = lim_is_mlo_recv_assoc(sta);
|
||||
|
||||
if (LIM_IS_AP_ROLE(pe_session)) {
|
||||
if (mlo_conn)
|
||||
lim_release_mlo_conn_idx(mac, sta->assocId,
|
||||
pe_session, false);
|
||||
else
|
||||
lim_release_peer_idx(mac, sta->assocId, pe_session);
|
||||
}
|
||||
|
||||
lim_delete_dph_hash_entry(mac, sta->staAddr, sta->assocId,
|
||||
pe_session);
|
||||
@@ -4294,6 +4329,9 @@ lim_prepare_and_send_del_sta_cnf(struct mac_context *mac, tpDphHashNode sta,
|
||||
pe_session->peSessionId,
|
||||
pe_session->limMlmState));
|
||||
}
|
||||
if (mlo_conn && !mlo_recv_assoc_frm)
|
||||
return;
|
||||
|
||||
lim_send_del_sta_cnf(mac, sta_dsaddr, staDsAssocId, mlmStaContext,
|
||||
status_code, pe_session);
|
||||
}
|
||||
|
@@ -542,3 +542,34 @@ void lim_mlo_ap_sta_assoc_fail(struct wlan_objmgr_peer *peer)
|
||||
STATUS_UNSPECIFIED_FAILURE,
|
||||
pe_session);
|
||||
}
|
||||
|
||||
void lim_mlo_delete_link_peer(struct pe_session *pe_session,
|
||||
tpDphHashNode sta_ds)
|
||||
{
|
||||
struct wlan_objmgr_peer *peer;
|
||||
struct mac_context *mac;
|
||||
|
||||
mac = cds_get_context(QDF_MODULE_ID_PE);
|
||||
if (!mac) {
|
||||
pe_err("mac ctx is null");
|
||||
return;
|
||||
}
|
||||
if (!pe_session) {
|
||||
pe_err("pe session is null");
|
||||
return;
|
||||
}
|
||||
if (!sta_ds) {
|
||||
pe_err("sta ds is null");
|
||||
return;
|
||||
}
|
||||
if (!lim_is_mlo_conn(pe_session, sta_ds))
|
||||
return;
|
||||
|
||||
peer = wlan_objmgr_get_peer_by_mac(mac->psoc,
|
||||
sta_ds->staAddr,
|
||||
WLAN_LEGACY_MAC_ID);
|
||||
|
||||
wlan_mlo_link_peer_delete(peer);
|
||||
|
||||
wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
|
||||
}
|
||||
|
@@ -203,6 +203,17 @@ bool lim_mlo_partner_auth_type(struct pe_session *session,
|
||||
* Return: void
|
||||
*/
|
||||
void lim_mlo_ap_sta_assoc_fail(struct wlan_objmgr_peer *peer);
|
||||
|
||||
/**
|
||||
* lim_mlo_delete_link_peer() - notify mlo mgr peer obj is deleted
|
||||
* @pe_session: pe session
|
||||
* @sta_ds: Pointer to internal STA Datastructure
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void lim_mlo_delete_link_peer(struct pe_session *pe_session,
|
||||
tpDphHashNode sta_ds);
|
||||
|
||||
#else
|
||||
|
||||
static inline void lim_mlo_notify_peer_disconn(struct pe_session *pe_session,
|
||||
@@ -250,5 +261,10 @@ static inline void lim_ap_mlo_sta_peer_ind(struct mac_context *mac,
|
||||
bool add_sta_rsp_status)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void lim_mlo_delete_link_peer(struct pe_session *pe_session,
|
||||
tpDphHashNode sta_ds)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1804,7 +1804,16 @@ static bool lim_update_sta_ds(struct mac_context *mac_ctx, tSirMacAddr sa,
|
||||
peer_idx, QDF_MAC_ADDR_REF(sa));
|
||||
|
||||
/* Release AID */
|
||||
lim_release_peer_idx(mac_ctx, peer_idx, session);
|
||||
if (lim_is_mlo_conn(session, sta_ds)) {
|
||||
if (lim_is_mlo_recv_assoc(sta_ds))
|
||||
lim_release_mlo_conn_idx(mac_ctx, peer_idx,
|
||||
session, true);
|
||||
else
|
||||
lim_release_mlo_conn_idx(mac_ctx, peer_idx,
|
||||
session, false);
|
||||
} else {
|
||||
lim_release_peer_idx(mac_ctx, peer_idx, session);
|
||||
}
|
||||
|
||||
lim_reject_association(mac_ctx, sa, sub_type, true,
|
||||
auth_type, peer_idx, false,
|
||||
@@ -2199,6 +2208,7 @@ bool lim_send_assoc_ind_to_sme(struct mac_context *mac_ctx,
|
||||
pe_err("mlo partner PeerIdx not avaialble. Reject associaton");
|
||||
lim_send_sme_max_assoc_exceeded_ntf(mac_ctx, sa,
|
||||
session->smeSessionId);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Add an entry to hash table maintained by DPH module */
|
||||
@@ -2212,18 +2222,24 @@ bool lim_send_assoc_ind_to_sme(struct mac_context *mac_ctx,
|
||||
QDF_MAC_ADDR_FMT, peer_idx, QDF_MAC_ADDR_REF(sa));
|
||||
|
||||
/* Release AID */
|
||||
lim_release_peer_idx(mac_ctx, peer_idx, session);
|
||||
if (assoc_req->eht_cap.present &&
|
||||
IS_DOT11_MODE_EHT(session->dot11mode))
|
||||
lim_release_mlo_conn_idx(mac_ctx, peer_idx, session,
|
||||
true);
|
||||
else
|
||||
lim_release_peer_idx(mac_ctx, peer_idx, session);
|
||||
|
||||
lim_reject_association(mac_ctx, sa, sub_type,
|
||||
true, auth_type, peer_idx, false,
|
||||
STATUS_UNSPECIFIED_FAILURE,
|
||||
session);
|
||||
return false;
|
||||
} else if (!peer_idx) {
|
||||
} else if (!sta_ds) {
|
||||
pe_err("mlo partner peer couldn't add hash entry at DPH for aid: %d MacAddr:"
|
||||
QDF_MAC_ADDR_FMT, peer_idx, QDF_MAC_ADDR_REF(sa));
|
||||
lim_send_sme_max_assoc_exceeded_ntf(mac_ctx, sa,
|
||||
session->smeSessionId);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*only mlo partner peer get valid aid before proc assoc req*/
|
||||
@@ -3179,8 +3195,13 @@ QDF_STATUS lim_send_mlm_assoc_ind(struct mac_context *mac_ctx,
|
||||
|
||||
assoc_ind = qdf_mem_malloc(temp);
|
||||
if (!assoc_ind) {
|
||||
lim_release_peer_idx(mac_ctx, sta_ds->assocId,
|
||||
session_entry);
|
||||
if (lim_is_mlo_conn(session_entry, sta_ds))
|
||||
lim_release_mlo_conn_idx(mac_ctx,
|
||||
sta_ds->assocId,
|
||||
session_entry, false);
|
||||
else
|
||||
lim_release_peer_idx(mac_ctx, sta_ds->assocId,
|
||||
session_entry);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
if (!lim_fill_lim_assoc_ind_params(assoc_ind, mac_ctx,
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "wlan_pmo_ucfg_api.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include <wlan_cm_api.h>
|
||||
#include <lim_mlo.h>
|
||||
|
||||
static void lim_process_mlm_auth_req(struct mac_context *, uint32_t *);
|
||||
static void lim_process_mlm_assoc_req(struct mac_context *, uint32_t *);
|
||||
@@ -1095,6 +1096,7 @@ lim_process_mlm_disassoc_req_ntf(struct mac_context *mac_ctx,
|
||||
if (LIM_IS_STA_ROLE(session))
|
||||
wma_tx_abort(session->smeSessionId);
|
||||
} else {
|
||||
lim_mlo_notify_peer_disconn(session, stads);
|
||||
/* Disassoc frame is not sent OTA */
|
||||
send_disassoc_frame = 1;
|
||||
/* Receive path cleanup with dummy packet */
|
||||
|
@@ -5184,6 +5184,8 @@ void __lim_process_sme_disassoc_cnf(struct mac_context *mac, uint32_t *msg_buf)
|
||||
return;
|
||||
}
|
||||
|
||||
lim_mlo_notify_peer_disconn(pe_session, sta);
|
||||
|
||||
/* Delete FT session if there exists one */
|
||||
lim_ft_cleanup_pre_auth_info(mac, pe_session);
|
||||
lim_cleanup_rx_path(mac, sta, pe_session, true);
|
||||
@@ -5448,7 +5450,13 @@ void lim_delete_all_peers(struct pe_session *session)
|
||||
if (QDF_STATUS_SUCCESS == status) {
|
||||
lim_delete_dph_hash_entry(mac_ctx, sta_ds->staAddr,
|
||||
sta_ds->assocId, session);
|
||||
lim_release_peer_idx(mac_ctx, sta_ds->assocId, session);
|
||||
if (lim_is_mlo_conn(session, sta_ds))
|
||||
lim_release_mlo_conn_idx(mac_ctx,
|
||||
sta_ds->assocId,
|
||||
session, false);
|
||||
else
|
||||
lim_release_peer_idx(mac_ctx, sta_ds->assocId,
|
||||
session);
|
||||
} else {
|
||||
pe_err("lim_del_sta failed with Status: %d", status);
|
||||
QDF_ASSERT(0);
|
||||
|
@@ -3200,6 +3200,7 @@ QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac_ctx)
|
||||
tLimMlmDeauthCnf deauth_cnf;
|
||||
struct pe_session *session_entry;
|
||||
QDF_STATUS qdf_status;
|
||||
uint32_t i;
|
||||
|
||||
deauth_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
|
||||
if (deauth_req) {
|
||||
@@ -3218,6 +3219,22 @@ QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac_ctx)
|
||||
}
|
||||
if (qdf_is_macaddr_broadcast(&deauth_req->peer_macaddr) &&
|
||||
mac_ctx->mlme_cfg->sap_cfg.is_sap_bcast_deauth_enabled) {
|
||||
if (wlan_vdev_mlme_is_mlo_ap(session_entry->vdev)) {
|
||||
for (i = 1;
|
||||
i < session_entry->dph.dphHashTable.size;
|
||||
i++) {
|
||||
sta_ds = dph_get_hash_entry(
|
||||
mac_ctx, i,
|
||||
&session_entry->dph.dphHashTable);
|
||||
if (!sta_ds)
|
||||
continue;
|
||||
if (lim_is_mlo_conn(session_entry,
|
||||
sta_ds))
|
||||
lim_mlo_notify_peer_disconn(
|
||||
session_entry,
|
||||
sta_ds);
|
||||
}
|
||||
}
|
||||
qdf_status = lim_del_sta_all(mac_ctx, session_entry);
|
||||
qdf_mem_free(deauth_req);
|
||||
mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq =
|
||||
@@ -3236,6 +3253,8 @@ QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac_ctx)
|
||||
goto end;
|
||||
}
|
||||
|
||||
lim_mlo_notify_peer_disconn(session_entry, sta_ds);
|
||||
|
||||
/* / Receive path cleanup with dummy packet */
|
||||
lim_ft_cleanup_pre_auth_info(mac_ctx, session_entry);
|
||||
lim_cleanup_rx_path(mac_ctx, sta_ds, session_entry, true);
|
||||
@@ -3340,6 +3359,9 @@ QDF_STATUS lim_send_disassoc_cnf(struct mac_context *mac_ctx)
|
||||
disassoc_cnf.resultCode = eSIR_SME_INVALID_PARAMETERS;
|
||||
goto end;
|
||||
}
|
||||
|
||||
lim_mlo_notify_peer_disconn(pe_session, sta_ds);
|
||||
|
||||
/* Receive path cleanup with dummy packet */
|
||||
if (QDF_STATUS_SUCCESS !=
|
||||
lim_cleanup_rx_path(mac_ctx, sta_ds, pe_session, true)) {
|
||||
|
@@ -242,12 +242,15 @@ uint16_t lim_assign_mlo_conn_idx(struct mac_context *mac,
|
||||
* @mac: mac context
|
||||
* @peer_idx: given aid
|
||||
* @pe_session: session entry
|
||||
* @free_aid: trigger mlo mgr to free AID or not. It only can be
|
||||
* true before mlo peer is created. Once mlo peer is
|
||||
* created, AID is freed in mlo peer context.
|
||||
*
|
||||
* Return: Void
|
||||
*/
|
||||
void
|
||||
lim_release_mlo_conn_idx(struct mac_context *mac, uint16_t peer_idx,
|
||||
struct pe_session *pe_session);
|
||||
struct pe_session *pe_session, bool free_aid);
|
||||
#else
|
||||
static inline uint16_t lim_assign_mlo_conn_idx(struct mac_context *mac,
|
||||
struct pe_session *pe_session,
|
||||
@@ -258,7 +261,7 @@ static inline uint16_t lim_assign_mlo_conn_idx(struct mac_context *mac,
|
||||
|
||||
static inline void
|
||||
lim_release_mlo_conn_idx(struct mac_context *mac, uint16_t peer_idx,
|
||||
struct pe_session *pe_session)
|
||||
struct pe_session *pe_session, bool free_aid)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
在新工单中引用
屏蔽一个用户