diff --git a/configs/default_defconfig b/configs/default_defconfig index 17de1d6a8d2c..248334af70f7 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -96,11 +96,12 @@ ifeq ($(CONFIG_ARCH_QCS405), y) CONFIG_TGT_NUM_MSDU_DESC := 900 endif CONFIG_WLAN_FEATURE_MBSSID := y -#Flag to enable Legacy Fast Roaming2(LFR2) -CONFIG_QCACLD_WLAN_LFR2 := y + #Flag to enable Legacy Fast Roaming3(LFR3) ifneq ($(CONFIG_ARCH_SDX20), y) -CONFIG_QCACLD_WLAN_LFR3 := y + CONFIG_QCACLD_WLAN_LFR3 := y +else + CONFIG_QCACLD_WLAN_LFR2 := y endif ifneq ($(CONFIG_MOBILE_ROUTER), y) diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 8a12e208086c..5634b23b4959 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -732,7 +732,16 @@ void lim_process_mlm_set_bss_key_rsp(struct mac_context *mac, void lim_process_switch_channel_rsp(struct mac_context *mac, void *); QDF_STATUS lim_sta_send_down_link(join_params *param); + +#ifdef WLAN_FEATURE_HOST_ROAM QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param); +#else +static inline +QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param) +{ + return QDF_STATUS_E_NOSUPPORT; +} +#endif #ifdef WLAN_FEATURE_11W /* 11w send SA query request action frame */ diff --git a/core/sme/inc/csr_host_scan_roam.h b/core/sme/inc/csr_host_scan_roam.h new file mode 100644 index 000000000000..292c93d74b54 --- /dev/null +++ b/core/sme/inc/csr_host_scan_roam.h @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef CSR_HOST_SCAN_ROAM_H +#define CSR_HOST_SCAN_ROAM_H + +#ifdef WLAN_FEATURE_HOST_ROAM +/** + * csr_roam_issue_reassociate() - Issue Reassociate + * @mac: Global MAC Context + * @vdev_id: SME vdev ID + * @bss_desc: BSS Descriptor + * @ies: Pointer to the IE's + * @roam_profile: Roaming profile + * + * Return: Success or Failure + */ +QDF_STATUS +csr_roam_issue_reassociate(struct mac_context *mac, uint32_t vdev_id, + struct bss_description *bss_desc, + tDot11fBeaconIEs *bcn_ies, + struct csr_roam_profile *roam_profile); + +/** + * csr_roam_issue_reassociate_cmd() - Issue the reassociate command + * @mac: Global MAC Context + * @vdev_id: SME vdev ID + * + * Return: Success or Failure status + */ +QDF_STATUS +csr_roam_issue_reassociate_cmd(struct mac_context *mac, uint32_t vdev_id); + +/** + * csr_neighbor_roam_process_scan_results() - build roaming candidate list + * + * @mac_ctx: The handle returned by mac_open. + * @sessionid: Session information + * @scan_results_list: List obtained from csr_scan_get_result() + * + * This function applies various candidate checks like LFR, 11r, preauth, ESE + * and builds a roamable AP list. It applies age limit only if no suitable + * recent candidates are found. + * + * Output list is built in mac_ctx->roam.neighborRoamInfo[sessionid]. + * + * Return: void + */ +void +csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx, + uint8_t vdev_id, + tScanResultHandle *scan_results_list); +/** + * csr_neighbor_roam_trigger_handoff() - Start roaming + * @mac_ctx: Global MAC Context + * @vdev_id: SME vdev ID + * + * Return: None + */ +void csr_neighbor_roam_trigger_handoff(struct mac_context *mac_ctx, + uint8_t vdev_id); +/** + * csr_neighbor_roam_process_scan_complete() - Post process the scan results + * @mac: Global MAC Context + * @vdev_id: SME vdev ID + * + * Return: Success or Failure + */ +QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac, + uint8_t vdev_id); + +/** + * csr_neighbor_roam_candidate_found_ind_hdlr() - Handle roam candidate found + * indication from firmware + * @mac_ctx: Pointer to Global MAC structure + * @msg_buf: pointer to msg buff + * + * This function is called by CSR as soon as TL posts the candidate + * found indication to SME via MC thread + * + * Return: QDF_STATUS_SUCCESS on success, corresponding error code otherwise + */ +QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac, + void *msg_buf); + +/** + * csr_neighbor_roam_free_roamable_bss_list() - Frees roamable APs list + * @mac_ctx: The handle returned by mac_open. + * @llist: Neighbor Roam BSS List to be emptied + * + * Empties and frees all the nodes in the roamable AP list + * + * Return: none + */ +void csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx, + tDblLinkList *llist); + +/** + * csr_neighbor_roam_remove_roamable_ap_list_entry() - Remove roamable + * candidate APs from list + * @mac_ctx: Pointer to Global MAC structure + * @list: The list from which the entry should be removed + * @neigh_entry: Neighbor Roam BSS Node to be removed + * + * This function removes a given entry from the given list + * + * Return: true if successfully removed, else false + */ +bool csr_neighbor_roam_remove_roamable_ap_list_entry(struct mac_context *mac, + tDblLinkList *list, tpCsrNeighborRoamBSSInfo neigh_entry); + +/** + * csr_neighbor_roam_next_roamable_ap() - Get next AP from roamable AP list + * @mac_ctx - The handle returned by mac_open. + * @plist - The list from which the entry should be returned + * @neighbor_entry - Neighbor Roam BSS Node whose next entry should be returned + * + * Gets the entry next to passed entry. If NULL is passed, return the entry + * in the head of the list + * + * Return: Neighbor Roam BSS Node to be returned + */ +tpCsrNeighborRoamBSSInfo +csr_neighbor_roam_next_roamable_ap(struct mac_context *mac_ctx, + tDblLinkList *llist, + tpCsrNeighborRoamBSSInfo neighbor_entry); + +/** + * csr_neighbor_roam_request_handoff() - Handoff to a different AP + * @mac_ctx: Pointer to Global MAC structure + * @vdev_id: vdev id + * + * This function triggers actual switching from one AP to the new AP. + * It issues disassociate with reason code as Handoff and CSR as a part of + * handling disassoc rsp, issues reassociate to the new AP + * + * Return: none + */ +void +csr_neighbor_roam_request_handoff(struct mac_context *mac, uint8_t vdev_id); + +/** + * csr_neighbor_roam_get_handoff_ap_info - Identifies the best AP for roaming + * @mac: mac context + * @session_id: vdev Id + * @hand_off_node: AP node that is the handoff candidate returned + * + * This function returns the best possible AP for handoff. For 11R case, it + * returns the 1st entry from pre-auth done list. For non-11r case, it returns + * the 1st entry from roamable AP list + * + * Return: true if able find handoff AP, false otherwise + */ +bool +csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, + tpCsrNeighborRoamBSSInfo hand_off_node, + uint8_t vdev_id); + +/** + * csr_neighbor_roam_is_handoff_in_progress() - Check whether roam handoff is + * in progress + * @mac_ctx: Pointer to Global MAC structure + * @vdev_id: vdev id + * + * This function returns whether handoff is in progress or not based on + * the current neighbor roam state + * + * Return: true if reassoc in progress, false otherwise + */ +bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, + uint8_t vdev_id); + +/** + * csr_neighbor_roam_free_neighbor_roam_bss_node() - Free Roam BSS node + * @mac_ctx: Pointer to Global MAC structure + * @roam_bss_node: Neighbor Roam BSS Node to be freed + * + * This function frees all the internal pointers CSR NeighborRoam BSS Info + * and also frees the node itself + * + * Return: None + */ +void +csr_neighbor_roam_free_neighbor_roam_bss_node(struct mac_context *mac, + tpCsrNeighborRoamBSSInfo roam_bss_node); + +#else +static inline QDF_STATUS +csr_roam_issue_reassociate(struct mac_context *mac, uint32_t vdev_id, + struct bss_description *bss_desc, + tDot11fBeaconIEs *bcn_ies, + struct csr_roam_profile *roam_profile) +{ + return QDF_STATUS_E_NOSUPPORT; +} + +static inline void +csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx, + uint8_t vdev_id, + tScanResultHandle *scan_results_list) +{} + +static inline void +csr_neighbor_roam_trigger_handoff(struct mac_context *mac_ctx, uint8_t vdev_id) +{} + +static inline void +csr_neighbor_roam_request_handoff(struct mac_context *mac, uint8_t vdev_id) +{} + +static inline bool +csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, + tpCsrNeighborRoamBSSInfo pHandoffNode, + uint8_t vdev_id) +{ + return false; +} + +static inline void +csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx, + tDblLinkList *llist) +{} + +static inline QDF_STATUS +csr_neighbor_roam_process_scan_complete(struct mac_context *mac, + uint8_t vdev_id) +{ + return QDF_STATUS_E_NOSUPPORT; +} + +static inline QDF_STATUS +csr_roam_issue_reassociate_cmd(struct mac_context *mac, uint32_t vdev_id) +{ + return QDF_STATUS_E_NOSUPPORT; +} + +static inline bool +csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, + uint8_t vdev_id) +{ + return false; +} + +static inline QDF_STATUS +csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac, + void *msg_buf) +{ + return QDF_STATUS_E_NOSUPPORT; +} +#endif /* WLAN_FEATURE_HOST_ROAM */ +#endif /* CSR_HOST_SCAN_ROAM_H */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 6cb1746ca586..5409690d3d39 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -35,6 +35,7 @@ #include "sir_types.h" #include "wlan_mlme_public_struct.h" +#include "csr_host_scan_roam.h" #define CSR_NUM_RSSI_CAT 15 #define CSR_ROAM_SCAN_CHANNEL_SWITCH_TIME 3 @@ -1179,12 +1180,6 @@ void csr_roam_substate_change( struct mac_context *mac, enum csr_roam_substate NewSubstate, uint32_t sessionId); -void csr_neighbor_roam_process_scan_results( - struct mac_context *mac_ctx, - uint8_t sessionid, tScanResultHandle *scan_results_list); - -void csr_neighbor_roam_trigger_handoff(struct mac_context *mac_ctx, - uint8_t session_id); bool csr_is_ndi_started(struct mac_context *mac_ctx, uint32_t session_id); QDF_STATUS csr_roam_update_config( diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index 9ef69539ad9b..0130688ce258 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -163,22 +163,6 @@ void csr_neighbor_roam_tranistion_preauth_done_to_disconnected( struct mac_context *mac, uint8_t sessionId); bool csr_neighbor_roam_state_preauth_done(struct mac_context *mac, uint8_t sessionId); -QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac, - uint32_t sessionId); -void csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx, - tDblLinkList *llist); -bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, - tpCsrNeighborRoamBSSInfo pHandoffNode, uint8_t sessionId); -QDF_STATUS csr_roam_issue_reassociate(struct mac_context *mac, - uint32_t sessionId, struct bss_description *pSirBssDesc, - tDot11fBeaconIEs *pIes, struct csr_roam_profile *pProfile); -void csr_neighbor_roam_request_handoff(struct mac_context *mac, uint8_t sessionId); -QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac, - void *pMsg); -QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac, - uint8_t sessionId); -bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, - uint8_t sessionId); void csr_neighbor_roam_reset_preauth_control_info( struct mac_context *mac_ctx, uint8_t session_id); void csr_neighbor_roam_purge_preauth_failed_list(struct mac_context *mac); @@ -188,52 +172,15 @@ static inline bool csr_neighbor_roam_state_preauth_done(struct mac_context *mac, { return false; } -static inline QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac, - uint32_t sessionId) -{ - return QDF_STATUS_E_NOSUPPORT; -} -static inline QDF_STATUS csr_roam_issue_reassociate(struct mac_context *mac, - uint32_t sessionId, struct bss_description *pSirBssDesc, - tDot11fBeaconIEs *pIes, struct csr_roam_profile *pProfile) -{ - return QDF_STATUS_E_NOSUPPORT; -} -static inline QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr( - struct mac_context *mac, void *pMsg) -{ - return QDF_STATUS_E_NOSUPPORT; -} -static inline QDF_STATUS csr_neighbor_roam_process_scan_complete( - struct mac_context *mac, uint8_t sessionId) -{ - return QDF_STATUS_E_NOSUPPORT; -} static inline void csr_neighbor_roam_tranistion_preauth_done_to_disconnected( struct mac_context *mac, uint8_t sessionId) {} -static inline void csr_neighbor_roam_free_roamable_bss_list( - struct mac_context *mac_ctx, tDblLinkList *llist) -{} -static inline void csr_neighbor_roam_request_handoff(struct mac_context *mac, - uint8_t sessionId) -{} static inline void csr_neighbor_roam_reset_preauth_control_info( struct mac_context *mac_ctx, uint8_t session_id) {} static inline void csr_neighbor_roam_purge_preauth_failed_list( struct mac_context *mac) {} -static inline bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, - tpCsrNeighborRoamBSSInfo pHandoffNode, uint8_t sessionId) -{ - return false; -} -static inline bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, - uint8_t sessionId) -{ - return false; -} #endif bool csr_neighbor_middle_of_roaming(struct mac_context *mac, uint8_t sessionId); QDF_STATUS csr_neighbor_roam_update_config(struct mac_context *mac_ctx, @@ -372,13 +319,6 @@ static inline QDF_STATUS csr_roam_synch_callback(struct mac_context *mac, void csr_neighbor_roam_state_transition(struct mac_context *mac_ctx, uint8_t newstate, uint8_t session); uint8_t *csr_neighbor_roam_state_to_string(uint8_t state); -tpCsrNeighborRoamBSSInfo csr_neighbor_roam_next_roamable_ap( - struct mac_context *mac_ctx, tDblLinkList *llist, - tpCsrNeighborRoamBSSInfo neighbor_entry); -bool csr_neighbor_roam_remove_roamable_ap_list_entry(struct mac_context *mac, - tDblLinkList *pList, tpCsrNeighborRoamBSSInfo pNeighborEntry); -void csr_neighbor_roam_free_neighbor_roam_bss_node(struct mac_context *mac, - tpCsrNeighborRoamBSSInfo neighborRoamBSSNode); QDF_STATUS csr_neighbor_roam_issue_preauth_req(struct mac_context *mac, uint8_t sessionId); bool csr_neighbor_roam_is_preauth_candidate(struct mac_context *mac, diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index 2b5188bd94a2..846809469b80 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -34,40 +34,22 @@ #include "mac_trace.h" #include "wlan_policy_mgr_api.h" -/** - * csr_roam_issue_reassociate() - Issue Reassociate - * @mac: Global MAC Context - * @sessionId: SME Session ID - * @pSirBssDesc: BSS Descriptor - * @pIes: Pointer to the IE's - * @pProfile: Roaming profile - * - * Return: Success or Failure - */ -QDF_STATUS csr_roam_issue_reassociate(struct mac_context *mac, - uint32_t sessionId, struct bss_description *pSirBssDesc, - tDot11fBeaconIEs *pIes, struct csr_roam_profile *pProfile) +QDF_STATUS csr_roam_issue_reassociate(struct mac_context *mac, uint32_t vdev_id, + struct bss_description *bss_desc, + tDot11fBeaconIEs *ies, + struct csr_roam_profile *roam_profile) { - csr_roam_state_change(mac, eCSR_ROAMING_STATE_JOINING, sessionId); + csr_roam_state_change(mac, eCSR_ROAMING_STATE_JOINING, vdev_id); /* Set the roaming substate to 'join attempt'... */ - csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_REASSOC_REQ, - sessionId); - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, - FL(" calling csr_send_join_req_msg (eWNI_SME_REASSOC_REQ)")); + csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_REASSOC_REQ, vdev_id); + sme_debug("calling csr_send_join_req_msg (eWNI_SME_REASSOC_REQ)"); /* attempt to Join this BSS... */ - return csr_send_join_req_msg(mac, sessionId, pSirBssDesc, pProfile, - pIes, eWNI_SME_REASSOC_REQ); + return csr_send_join_req_msg(mac, vdev_id, bss_desc, roam_profile, ies, + eWNI_SME_REASSOC_REQ); } -/** - * csr_roam_issue_reassociate_cmd() - Issue the reassociate command - * @mac: Global MAC Context - * @sessionId: SME Session ID - * - * Return: Success or Failure status - */ -QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac, - uint32_t sessionId) +QDF_STATUS +csr_roam_issue_reassociate_cmd(struct mac_context *mac, uint32_t sessionId) { QDF_STATUS status = QDF_STATUS_SUCCESS; tSmeCmd *pCommand = NULL; @@ -143,24 +125,8 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac, return status; } -/** - * csr_neighbor_roam_process_scan_results() - build roaming candidate list - * - * @mac_ctx: The handle returned by mac_open. - * @sessionid: Session information - * @scan_results_list: List obtained from csr_scan_get_result() - * - * This function applies various candidate checks like LFR, 11r, preauth, ESE - * and builds a roamable AP list. It applies age limit only if no suitable - * recent candidates are found. - * - * Output list is built in mac_ctx->roam.neighborRoamInfo[sessionid]. - * - * Return: void - */ - void csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx, - uint8_t sessionid, tScanResultHandle *scan_results_list) + uint8_t sessionid, tScanResultHandle *scan_results_list) { tCsrScanResultInfo *scan_result; tpCsrNeighborRoamControlInfo n_roam_info = @@ -375,31 +341,17 @@ void csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx, csr_scan_result_purge(mac_ctx, *scan_results_list); } -/** - * csr_neighbor_roam_trigger_handoff() - Start roaming - * @mac_ctx: Global MAC Context - * @session_id: SME Session ID - * - * Return: None - */ void csr_neighbor_roam_trigger_handoff(struct mac_context *mac_ctx, - uint8_t session_id) + uint8_t vdev_id) { - if (csr_roam_is_fast_roam_enabled(mac_ctx, session_id)) - csr_neighbor_roam_issue_preauth_req(mac_ctx, session_id); + if (csr_roam_is_fast_roam_enabled(mac_ctx, vdev_id)) + csr_neighbor_roam_issue_preauth_req(mac_ctx, vdev_id); else sme_err("Roaming is disabled"); } -/** - * csr_neighbor_roam_process_scan_complete() - Post process the scan results - * @mac: Global MAC Context - * @sessionId: SME Session ID - * - * Return: Success or Failure - */ QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac, - uint8_t sessionId) + uint8_t sessionId) { tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &mac->roam.neighborRoamInfo[sessionId]; @@ -455,19 +407,8 @@ QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac, } -/** - * csr_neighbor_roam_candidate_found_ind_hdlr() - * - * @mac_ctx: Pointer to Global MAC structure - * @msg_buf: pointer to msg buff - * - * This function is called by CSR as soon as TL posts the candidate - * found indication to SME via MC thread - * - * Return: QDF_STATUS_SUCCESS on success, corresponding error code otherwise - */ QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac, - void *pMsg) + void *pMsg) { tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd = (tSirSmeCandidateFoundInd *) pMsg; @@ -503,22 +444,13 @@ QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac, return status; } -/** - * csr_neighbor_roam_free_roamable_bss_list() - Frees roamable APs list - * @mac_ctx: The handle returned by mac_open. - * @llist: Neighbor Roam BSS List to be emptied - * - * Empties and frees all the nodes in the roamable AP list - * - * Return: none - */ void csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx, tDblLinkList *llist) { tpCsrNeighborRoamBSSInfo result = NULL; sme_debug("Emptying the BSS list. Current count: %d", - csr_ll_count(llist)); + csr_ll_count(llist)); /* * Pick up the head, remove and free the node till @@ -532,44 +464,21 @@ void csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx, } } -/** - * csr_neighbor_roam_remove_roamable_ap_list_entry() - * - * @mac_ctx: Pointer to Global MAC structure - * @pList: The list from which the entry should be removed - * @pNeighborEntry: Neighbor Roam BSS Node to be removed - * - * This function removes a given entry from the given list - * - * Return: true if successfully removed, else false - */ bool csr_neighbor_roam_remove_roamable_ap_list_entry(struct mac_context *mac, tDblLinkList *pList, tpCsrNeighborRoamBSSInfo pNeighborEntry) { - if (pList) { + if (pList) return csr_ll_remove_entry(pList, &pNeighborEntry->List, LL_ACCESS_LOCK); - } sme_debug("Remove neigh BSS node from fail list. Current count: %d", - csr_ll_count(pList)); + csr_ll_count(pList)); return false; } -/** - * csr_neighbor_roam_next_roamable_ap() - Get next AP from roamable AP list - * @mac_ctx - The handle returned by mac_open. - * @plist - The list from which the entry should be returned - * @neighbor_entry - Neighbor Roam BSS Node whose next entry should be returned - * - * Gets the entry next to passed entry. If NULL is passed, return the entry - * in the head of the list - * - * Return: Neighbor Roam BSS Node to be returned - */ tpCsrNeighborRoamBSSInfo csr_neighbor_roam_next_roamable_ap( struct mac_context *mac_ctx, tDblLinkList *llist, tpCsrNeighborRoamBSSInfo neighbor_entry) @@ -591,18 +500,6 @@ tpCsrNeighborRoamBSSInfo csr_neighbor_roam_next_roamable_ap( return result; } - -/** - * csr_neighbor_roam_request_handoff() - Handoff to a different AP - * @mac_ctx: Pointer to Global MAC structure - * @session_id: Session ID - * - * This function triggers actual switching from one AP to the new AP. - * It issues disassociate with reason code as Handoff and CSR as a part of - * handling disassoc rsp, issues reassociate to the new AP - * - * Return: none - */ void csr_neighbor_roam_request_handoff(struct mac_context *mac_ctx, uint8_t session_id) { @@ -692,24 +589,10 @@ void csr_neighbor_roam_request_handoff(struct mac_context *mac_ctx, } - -/** - * csr_neighbor_roam_get_handoff_ap_info - Identifies the best AP for roaming - * - * @mac: mac context - * @session_id: Session Id - * @hand_off_node: AP node that is the handoff candidate returned - * - * This function returns the best possible AP for handoff. For 11R case, it - * returns the 1st entry from pre-auth done list. For non-11r case, it returns - * the 1st entry from roamable AP list - * - * Return: true if able find handoff AP, false otherwise - */ - -bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, - tpCsrNeighborRoamBSSInfo hand_off_node, - uint8_t session_id) +bool +csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, + tpCsrNeighborRoamBSSInfo hand_off_node, + uint8_t session_id) { tpCsrNeighborRoamControlInfo ngbr_roam_info = &mac->roam.neighborRoamInfo[session_id]; @@ -764,19 +647,8 @@ bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac, return true; } -/** - * csr_neighbor_roam_is_handoff_in_progress() - * - * @mac_ctx: Pointer to Global MAC structure - * @session_id: Session ID - * - * This function returns whether handoff is in progress or not based on - * the current neighbor roam state - * - * Return: true if reassoc in progress, false otherwise - */ bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, - uint8_t sessionId) + uint8_t sessionId) { if (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == mac->roam.neighborRoamInfo[sessionId].neighborRoamState) @@ -785,28 +657,18 @@ bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac, return false; } -/** - * csr_neighbor_roam_free_neighbor_roam_bss_node() - * - * @mac_ctx: Pointer to Global MAC structure - * @neighborRoamBSSNode: Neighbor Roam BSS Node to be freed - * - * This function frees all the internal pointers CSR NeighborRoam BSS Info - * and also frees the node itself - * - * Return: None - */ void csr_neighbor_roam_free_neighbor_roam_bss_node(struct mac_context *mac, tpCsrNeighborRoamBSSInfo neighborRoamBSSNode) { - if (neighborRoamBSSNode) { - if (neighborRoamBSSNode->pBssDescription) { - qdf_mem_free(neighborRoamBSSNode->pBssDescription); - neighborRoamBSSNode->pBssDescription = NULL; - } - qdf_mem_free(neighborRoamBSSNode); - neighborRoamBSSNode = NULL; + if (!neighborRoamBSSNode) + return; + + if (neighborRoamBSSNode->pBssDescription) { + qdf_mem_free(neighborRoamBSSNode->pBssDescription); + neighborRoamBSSNode->pBssDescription = NULL; } + qdf_mem_free(neighborRoamBSSNode); + neighborRoamBSSNode = NULL; }