qcacld-3.0: Remove duplicate bss_idx from struct pe_session
The bss_idx represent vdev id in pe session. pe session already
have smeSessionId/vdev_id to represent this.
Thus remove duplicate bss_idx from struct pe_session.
Change-Id: I18c59d49233dd547f38d7f8a23be5ebbe7d72c30
CRs-Fixed: 2531014
diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h
index 525210d..5de5057 100644
--- a/core/mac/src/pe/include/lim_session.h
+++ b/core/mac/src/pe/include/lim_session.h
@@ -151,7 +151,6 @@
tSirMacAddr bssId;
tSirMacAddr self_mac_addr;
tSirMacSSid ssId;
- uint8_t bss_idx;
uint8_t valid;
tLimMlmStates limMlmState; /* MLM State */
tLimMlmStates limPrevMlmState; /* Previous MLM State */
@@ -651,18 +650,14 @@
uint8_t *sessionId);
/**
- * pe_find_session_by_bss_idx() - looks up the PE session given the bss_idx.
- *
- * @mac: pointer to global adapter context
- * @bss_idx: bss index of the session
- *
- * This function returns the session context if the session
- * corresponding to the given bss_idx is found in the PE session table.
+ * pe_find_session_by_vdev_id() - looks up the PE session given the vdev_id.
+ * @mac: pointer to global adapter context
+ * @vdev_id: vdev id the session
*
* Return: pointer to the session context or NULL if session is not found.
*/
-struct pe_session *pe_find_session_by_bss_idx(struct mac_context *mac,
- uint8_t bss_idx);
+struct pe_session *pe_find_session_by_vdev_id(struct mac_context *mac,
+ uint8_t vdev_id);
/**
* pe_find_session_by_peer_sta() - looks up the PE session given the Peer
@@ -724,16 +719,20 @@
/**
* pe_find_session_by_sme_session_id() - looks up the PE session for given sme
- * session id
- * @mac_ctx: pointer to global adapter context
- * @sme_session_id: sme session id
+ * session id/vdev_id
+ * @mac_ctx: pointer to global adapter context
+ * @sme_session_id: sme session id/vdev id
*
- * looks up the PE session for given sme session id
+ * Looks up the PE session for given sme session id ie.e vdev id
*
* Return: pe session entry for given sme session if found else NULL
*/
+static inline
struct pe_session *pe_find_session_by_sme_session_id(struct mac_context *mac_ctx,
- uint8_t sme_session_id);
+ uint8_t sme_session_id)
+{
+ return pe_find_session_by_vdev_id(mac_ctx, sme_session_id);
+}
/**
* pe_find_session_by_scan_id() - looks up the PE session for given scan id
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index 728490c..3f8676f 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -1819,7 +1819,7 @@
{
struct missed_beacon_ind *missed_beacon_ind = msg->bodyptr;
struct pe_session *pe_session =
- pe_find_session_by_bss_idx(mac, missed_beacon_ind->bss_idx);
+ pe_find_session_by_vdev_id(mac, missed_beacon_ind->bss_idx);
if (!pe_session) {
pe_err("session does not exist for given BSSId");
@@ -2444,7 +2444,6 @@
}
add_bss_params->vdev_id = roam_sync_ind_ptr->roamed_vdev_id;
- ft_session_ptr->bss_idx = add_bss_params->vdev_id;
curr_sta_ds->staIndex = add_bss_params->staContext.staIdx;
mac_ctx->roam.reassocRespLen = roam_sync_ind_ptr->reassocRespLength;
mac_ctx->roam.pReassocResp =
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index adbea85..78d79eb 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -660,7 +660,7 @@
if (!pe_session->add_bss_failed) {
if (pe_session->limSmeState == eLIM_SME_JOIN_FAILURE_STATE) {
retCode =
- lim_del_bss(mac, sta, pe_session->bss_idx,
+ lim_del_bss(mac, sta, pe_session->vdev_id,
pe_session);
} else
retCode = lim_del_sta(mac,
@@ -2981,7 +2981,7 @@
return;
}
- beacon_params.bss_idx = session_entry->bss_idx;
+ beacon_params.bss_idx = session_entry->vdev_id;
sta_ds = dph_lookup_hash_entry(mac_ctx, sta_addr, &aid,
&session_entry->dph.dphHashTable);
diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
index 4355aa3..4db723e 100644
--- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
+++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
@@ -601,9 +601,9 @@
session->limMlmState);
return;
}
- status = lim_del_bss(mac_ctx, NULL, session->bss_idx, session);
+ status = lim_del_bss(mac_ctx, NULL, session->vdev_id, session);
if (QDF_IS_STATUS_ERROR(status))
- pe_err("delBss failed for bss: %d", session->bss_idx);
+ pe_err("delBss failed for bss: %d", session->vdev_id);
}
/**
@@ -964,7 +964,7 @@
sch_set_fixed_beacon_fields(mac,
pe_session);
beaconParams.bss_idx =
- pe_session->bss_idx;
+ pe_session->vdev_id;
lim_send_beacon_params(mac, &beaconParams,
pe_session);
}
@@ -1498,7 +1498,7 @@
if (beaconParams.paramChangeBitmap) {
pe_err("beaconParams.paramChangeBitmap=1 ---> Update Beacon Params");
sch_set_fixed_beacon_fields(mac, pe_session);
- beaconParams.bss_idx = pe_session->bss_idx;
+ beaconParams.bss_idx = pe_session->vdev_id;
lim_send_beacon_params(mac, &beaconParams, pe_session);
}
} else
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 7e588f2..210259d 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -2013,7 +2013,7 @@
wlan_reg_freq_to_chan(
mac_ctx->pdev, session_entry->curr_op_freq))
!= CHANNEL_STATE_DFS) {
- beacon_params.bss_idx = session_entry->bss_idx;
+ beacon_params.bss_idx = session_entry->vdev_id;
beacon_params.beaconInterval =
session_entry->beaconParams.beaconInterval;
beacon_params.paramChangeBitmap |=
diff --git a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c
index 2ab04a0..3ab935c 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c
@@ -457,8 +457,6 @@
pe_debug("Set the mlm state: %d session: %d",
pe_session->limMlmState, pe_session->peSessionId);
- pe_session->bss_idx = add_bss_rsp->vdev_id;
-
/* Success, handle below */
/* STA Index(genr by HAL) for the BSS entry is stored here */
sta->staIndex = wma_peer_get_peet_id(pe_session->bssId);
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index 58cf308..c1c967d 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -1982,7 +1982,6 @@
pe_session->statypeForBss = STA_ENTRY_PEER; /* to know session created for self/peer */
limResetHBPktCount(pe_session);
}
- pe_session->bss_idx = add_bss_rsp->vdev_id;
pe_session->limSystemRole = eLIM_STA_IN_IBSS_ROLE;
@@ -2065,7 +2064,6 @@
*/
pe_session->limIbssActive = false;
limResetHBPktCount(pe_session);
- pe_session->bss_idx = add_bss_rsp->vdev_id;
pe_session->limSystemRole = eLIM_STA_IN_IBSS_ROLE;
pe_session->statypeForBss = STA_ENTRY_SELF;
sch_edca_profile_update(mac, pe_session);
@@ -2265,8 +2263,6 @@
mlm_assoc_cnf.resultCode =
(tSirResultCodes) eSIR_SME_REFUSED;
} else {
- session_entry->bss_idx =
- add_bss_rsp->vdev_id;
/* Success, handle below */
/*
* STA Index(genr by HAL) for the BSS
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 5924567..a20f902 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -2842,7 +2842,7 @@
status = lim_del_bss(mac_ctx, sta_ds, 0, session);
if (QDF_IS_STATUS_ERROR(status))
- pe_err("delBss failed for bss %d", session->bss_idx);
+ pe_err("delBss failed for bss %d", session->vdev_id);
end:
return status;
@@ -2853,10 +2853,10 @@
struct mac_context *mac_ctx = session->mac_ctx;
QDF_STATUS status;
- status = lim_del_bss(mac_ctx, NULL, session->bss_idx, session);
+ status = lim_del_bss(mac_ctx, NULL, session->vdev_id, session);
if (QDF_IS_STATUS_ERROR(status)) {
- pe_err("delBss failed for bss %d", session->bss_idx);
+ pe_err("delBss failed for bss %d", session->vdev_id);
lim_send_stop_bss_failure_resp(mac_ctx, session);
}
@@ -3831,7 +3831,7 @@
/* Update beacon */
sch_set_fixed_beacon_fields(mac, pe_session);
- beaconParams.bss_idx = pe_session->bss_idx;
+ beaconParams.bss_idx = pe_session->vdev_id;
/* Set change in beacon Interval */
beaconParams.beaconInterval =
pChangeBIParams->beaconInterval;
diff --git a/core/mac/src/pe/lim/lim_security_utils.c b/core/mac/src/pe/lim/lim_security_utils.c
index 6f4b20d..5a301f9 100644
--- a/core/mac/src/pe/lim/lim_security_utils.c
+++ b/core/mac/src/pe/lim/lim_security_utils.c
@@ -800,7 +800,7 @@
}
/* Update the WMA_SET_BSSKEY_REQ parameters */
- pSetBssKeyParams->bss_idx = pe_session->bss_idx;
+ pSetBssKeyParams->bss_idx = pe_session->vdev_id;
pSetBssKeyParams->encType = pMlmSetKeysReq->edType;
pSetBssKeyParams->singleTidRc =
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index 558130c..520aaac 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -1243,7 +1243,7 @@
*/
populate_dot11f_capabilities(mac_ctx, &frm.Capabilities, pe_session);
- beacon_params.bss_idx = pe_session->bss_idx;
+ beacon_params.bss_idx = pe_session->vdev_id;
/* Send message to HAL about beacon parameter change. */
if ((false == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running)
diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c
index 7e3489c..568993f 100644
--- a/core/mac/src/pe/lim/lim_send_messages.c
+++ b/core/mac/src/pe/lim/lim_send_messages.c
@@ -561,7 +561,7 @@
return QDF_STATUS_E_FAILURE;
QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
"OBSS Scan Indication bss_idx- %d staId %d",
- session->bss_idx, session->staId);
+ session->vdev_id, session->staId);
ht40_obss_scanind->cmd = HT40_OBSS_SCAN_PARAM_START;
ht40_obss_scanind->scan_type = eSIR_ACTIVE_SCAN;
@@ -606,7 +606,7 @@
ht40_obss_scanind->channel_count = channel24gnum;
/* FW API requests BSS IDX */
ht40_obss_scanind->self_sta_idx = session->staId;
- ht40_obss_scanind->bss_id = session->bss_idx;
+ ht40_obss_scanind->bss_id = session->vdev_id;
ht40_obss_scanind->fortymhz_intolerent = 0;
ht40_obss_scanind->iefield_len = 0;
msg.type = WMA_HT40_OBSS_SCAN_IND;
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 7d6be05..740992e 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -2078,7 +2078,7 @@
tpSirFirstBeaconTxCompleteInd bcn_ind =
(tSirFirstBeaconTxCompleteInd *) event;
- session = pe_find_session_by_bss_idx(mac_ctx, bcn_ind->bss_idx);
+ session = pe_find_session_by_vdev_id(mac_ctx, bcn_ind->bss_idx);
if (!session) {
pe_err("Session Does not exist for given session id");
return;
diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c
index 31e5fec..cfb405d 100644
--- a/core/mac/src/pe/lim/lim_session.c
+++ b/core/mac/src/pe/lim/lim_session.c
@@ -228,7 +228,7 @@
pe_debug("protection changed, update beacon template");
/* update beacon fix params and send update to FW */
qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
- beacon_params.bss_idx = pe_session_entry->bss_idx;
+ beacon_params.bss_idx = pe_session_entry->vdev_id;
beacon_params.fShortPreamble =
pe_session_entry->beaconParams.fShortPreamble;
beacon_params.beaconInterval =
@@ -737,28 +737,19 @@
}
-/**
- * pe_find_session_by_bss_idx() - looks up the PE session given the bss_idx.
- *
- * This function returns the session context if the session
- * corresponding to the given bss_idx is found in the PE session table.
- * @mac: pointer to global adapter context
- * @bss_idx: bss index of the session
- *
- * Return: pointer to the session context or NULL if session is not found.
- */
-struct pe_session *pe_find_session_by_bss_idx(struct mac_context *mac,
- uint8_t bss_idx)
+struct pe_session *pe_find_session_by_vdev_id(struct mac_context *mac,
+ uint8_t vdev_id)
{
uint8_t i;
for (i = 0; i < mac->lim.maxBssId; i++) {
/* If BSSID matches return corresponding tables address */
if ((mac->lim.gpSession[i].valid) &&
- (mac->lim.gpSession[i].bss_idx == bss_idx))
+ (mac->lim.gpSession[i].vdev_id == vdev_id))
return &mac->lim.gpSession[i];
}
- pe_debug("Session lookup fails for bss_idx: %d", bss_idx);
+ pe_debug("Session lookup fails for vdev_id: %d", vdev_id);
+
return NULL;
}
@@ -849,9 +840,9 @@
return;
}
- pe_debug("Trying to delete PE session: %d Opmode: %d BssIdx: %d BSSID: "QDF_MAC_ADDR_STR,
+ pe_debug("Trying to delete PE session: %d Opmode: %d vdev_id: %d BSSID: "QDF_MAC_ADDR_STR,
session->peSessionId, session->operMode,
- session->bss_idx,
+ session->vdev_id,
QDF_MAC_ADDR_ARRAY(session->bssId));
lim_reset_bcn_probe_filter(mac_ctx, session);
@@ -1070,31 +1061,6 @@
}
/**
- * pe_find_session_by_sme_session_id() - looks up the PE session for given sme
- * session id
- * @mac_ctx: pointer to global adapter context
- * @sme_session_id: sme session id
- *
- * looks up the PE session for given sme session id
- *
- * Return: pe session entry for given sme session if found else NULL
- */
-struct pe_session *pe_find_session_by_sme_session_id(struct mac_context *mac_ctx,
- uint8_t sme_session_id)
-{
- uint8_t i;
-
- for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
- if ((mac_ctx->lim.gpSession[i].valid) &&
- (mac_ctx->lim.gpSession[i].smeSessionId ==
- sme_session_id)) {
- return &mac_ctx->lim.gpSession[i];
- }
- }
- return NULL;
-}
-
-/**
* pe_find_session_by_scan_id() - looks up the PE session for given scan id
* @mac_ctx: pointer to global adapter context
* @scan_id: scan id
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 7c89233..9f93093 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -878,7 +878,7 @@
return;
}
qdf_mem_zero((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams));
- beaconParams.bss_idx = pe_session->bss_idx;
+ beaconParams.bss_idx = pe_session->vdev_id;
beaconParams.paramChangeBitmap = 0;
/*
@@ -4657,7 +4657,7 @@
* Failure detected
*/
pe_debug("Sending Probe for Session: %d",
- psession_entry->bss_idx);
+ psession_entry->vdev_id);
lim_deactivate_and_change_timer(mac_ctx,
eLIM_PROBE_AFTER_HB_TIMER);
MTRACE(mac_trace(mac_ctx, TRACE_CODE_TIMER_ACTIVATE, 0,
diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c
index 07f2868..8172229 100644
--- a/core/mac/src/pe/nan/nan_datapath.c
+++ b/core/mac/src/pe/nan/nan_datapath.c
@@ -354,7 +354,7 @@
MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE,
session_entry->peSessionId,
session_entry->limMlmState));
- session_entry->bss_idx = add_bss_rsp->vdev_id;
+ session_entry->vdev_id = add_bss_rsp->vdev_id;
session_entry->limSystemRole = eLIM_NDI_ROLE;
session_entry->statypeForBss = STA_ENTRY_SELF;
session_entry->staId =
diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c
index 999a7de..abd22d6 100644
--- a/core/mac/src/pe/sch/sch_beacon_process.c
+++ b/core/mac/src/pe/sch/sch_beacon_process.c
@@ -1053,7 +1053,7 @@
qdf_mem_zero(&bcn_prm, sizeof(tUpdateBeaconParams));
bcn_prm.paramChangeBitmap = 0;
- bcn_prm.bss_idx = ap_session->bss_idx;
+ bcn_prm.bss_idx = ap_session->vdev_id;
if (!ap_session->is_session_obss_color_collision_det_enabled)
sch_check_bss_color_ie(mac_ctx, ap_session,