mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
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
This commit is contained in:
parent
36f2d37fac
commit
c70afa3f53
16 changed files with 43 additions and 85 deletions
|
|
@ -151,7 +151,6 @@ struct pe_session {
|
|||
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 @@ struct pe_session *pe_find_session_by_bssid(struct mac_context *mac, uint8_t *bs
|
|||
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 @@ void pe_delete_session(struct mac_context *mac, struct pe_session *pe_session);
|
|||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1819,7 +1819,7 @@ void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac,
|
|||
{
|
||||
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 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
|
|||
}
|
||||
|
||||
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 =
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ lim_cleanup_rx_path(struct mac_context *mac, tpDphHashNode sta,
|
|||
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 @@ lim_delete_dph_hash_entry(struct mac_context *mac_ctx, tSirMacAddr sta_addr,
|
|||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -601,9 +601,9 @@ void ibss_bss_delete(struct mac_context *mac_ctx, struct pe_session *session)
|
|||
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 @@ lim_ibss_sta_add(struct mac_context *mac, void *pBody, struct pe_session *pe_ses
|
|||
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 @@ lim_ibss_coalesce(struct mac_context *mac,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -2013,7 +2013,7 @@ static void lim_process_messages(struct mac_context *mac_ctx,
|
|||
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 |=
|
||||
|
|
|
|||
|
|
@ -457,8 +457,6 @@ void lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context *mac,
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -1982,7 +1982,6 @@ static void lim_process_ap_mlm_add_bss_rsp(struct mac_context *mac,
|
|||
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 @@ lim_process_ibss_mlm_add_bss_rsp(struct mac_context *mac,
|
|||
*/
|
||||
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 @@ static void lim_process_sta_mlm_add_bss_rsp(struct mac_context *mac_ctx,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -2842,7 +2842,7 @@ QDF_STATUS lim_sta_send_del_bss(struct pe_session *session)
|
|||
|
||||
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 @@ QDF_STATUS lim_send_vdev_stop(struct pe_session *session)
|
|||
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 @@ static void __lim_process_sme_change_bi(struct mac_context *mac,
|
|||
/* 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;
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ void lim_send_set_bss_key_req(struct mac_context *mac,
|
|||
}
|
||||
|
||||
/* 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 =
|
||||
|
|
|
|||
|
|
@ -1243,7 +1243,7 @@ lim_send_assoc_rsp_mgmt_frame(struct mac_context *mac_ctx,
|
|||
*/
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx,
|
|||
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 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -2078,7 +2078,7 @@ lim_process_beacon_tx_success_ind(struct mac_context *mac_ctx, uint16_t msgType,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ static void pe_reset_protection_callback(void *ptr)
|
|||
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 @@ struct pe_session *pe_find_session_by_bssid(struct mac_context *mac, uint8_t *bs
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 @@ void pe_delete_session(struct mac_context *mac_ctx, struct pe_session *session)
|
|||
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);
|
||||
|
|
@ -1069,31 +1060,6 @@ struct pe_session *pe_find_session_by_peer_sta(struct mac_context *mac, uint8_t
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ void lim_handle_update_olbc_cache(struct mac_context *mac_ctx)
|
|||
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 @@ void lim_handle_heart_beat_timeout_for_session(struct mac_context *mac_ctx,
|
|||
* 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,
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ void lim_process_ndi_mlm_add_bss_rsp(struct mac_context *mac_ctx,
|
|||
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 =
|
||||
|
|
|
|||
|
|
@ -1053,7 +1053,7 @@ void sch_beacon_process_for_ap(struct mac_context *mac_ctx,
|
|||
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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue