qcacld-3.0: Code cleanup for connection manager CSR

Remove unused code related to ndef FEATURE_CM_ENABLE in CSR.

Change-Id: I156b7ee286f666ee5d660312bf5ba2fe364165c4
CRs-Fixed: 2977584
This commit is contained in:
Abhishek Singh
2021-05-27 19:42:45 +05:30
committed by Madan Koyyalamudi
parent 7b04d1ae9b
commit e9531a9d24
15 changed files with 18 additions and 12663 deletions

6
Kbuild
View File

@@ -732,15 +732,9 @@ SME_CSR_OBJS := $(SME_SRC_DIR)/csr/csr_api_roam.o \
$(SME_SRC_DIR)/csr/csr_api_scan.o \
$(SME_SRC_DIR)/csr/csr_cmd_process.o \
$(SME_SRC_DIR)/csr/csr_link_list.o \
$(SME_SRC_DIR)/csr/csr_neighbor_roam.o \
$(SME_SRC_DIR)/csr/csr_util.o \
ifeq ($(CONFIG_QCACLD_WLAN_LFR2), y)
SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_roam_preauth.o \
$(SME_SRC_DIR)/csr/csr_host_scan_roam.o
endif
SME_QOS_OBJS := $(SME_SRC_DIR)/qos/sme_qos.o
SME_CMN_OBJS := $(SME_SRC_DIR)/common/sme_api.o \

View File

@@ -893,7 +893,6 @@ enum policy_mgr_band {
* @POLICY_MGR_UPDATE_REASON_UT: Unit test related
* @POLICY_MGR_UPDATE_REASON_START_AP: Start AP
* @POLICY_MGR_UPDATE_REASON_NORMAL_STA: Connection to Normal STA
* @POLICY_MGR_UPDATE_REASON_HIDDEN_STA: Connection to Hidden STA
* @POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC: Opportunistic HW mode update
* @POLICY_MGR_UPDATE_REASON_NSS_UPDATE: NSS update
* @POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH: After Channel switch
@@ -912,7 +911,6 @@ enum policy_mgr_conn_update_reason {
POLICY_MGR_UPDATE_REASON_UT,
POLICY_MGR_UPDATE_REASON_START_AP,
POLICY_MGR_UPDATE_REASON_NORMAL_STA,
POLICY_MGR_UPDATE_REASON_HIDDEN_STA,
POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC,
POLICY_MGR_UPDATE_REASON_NSS_UPDATE,
POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH,

View File

@@ -746,9 +746,6 @@ struct mac_context {
struct wlan_mlme_chain_cfg fw_chain_cfg;
struct wlan_mlme_cfg *mlme_cfg;
tAniSirLim lim;
#ifndef FEATURE_CM_ENABLE
uint8_t nud_fail_behaviour;
#endif
struct sch_context sch;
tAniSirSys sys;

View File

@@ -274,27 +274,6 @@ typedef struct tagCsr11dinfo {
} tCsr11dinfo;
typedef enum {
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_CANCELLED = 1,
/*
* a CSR trigger roaming operation starts,
* callback may get a pointer to tCsrConnectedProfile
*/
eCSR_ROAM_ROAMING_START = 3,
/* a CSR trigger roaming operation is completed */
eCSR_ROAM_ROAMING_COMPLETION = 4,
/* Connection completed status. */
eCSR_ROAM_CONNECT_COMPLETION = 5,
/*
* a roaming operation is finish, see eCsrRoamResult for
* possible data passed back
*/
eCSR_ROAM_ASSOCIATION_COMPLETION = 7,
eCSR_ROAM_DISASSOCIATED = 8,
eCSR_ROAM_ASSOCIATION_FAILURE = 9,
/* when callback with this flag. it gets a pointer to the BSS desc. */
eCSR_ROAM_SHOULD_ROAM = 10,
#endif
/* CSR is done lostlink roaming and still cannot reconnect */
eCSR_ROAM_LOSTLINK = 12,
/*
@@ -306,21 +285,6 @@ typedef enum {
/* BSS in SoftAP mode status indication */
eCSR_ROAM_INFRA_IND = 18,
eCSR_ROAM_WPS_PBC_PROBE_REQ_IND = 19,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_FT_RESPONSE = 20,
eCSR_ROAM_FT_START = 21,
eCSR_ROAM_FT_REASSOC_FAILED = 23,
eCSR_ROAM_PMK_NOTIFY = 24,
/*
* Following 4 enums are used by FEATURE_WLAN_LFR_METRICS
* but they are needed for compilation even when
* FEATURE_WLAN_LFR_METRICS is not defined.
*/
eCSR_ROAM_PREAUTH_INIT_NOTIFY = 25,
eCSR_ROAM_PREAUTH_STATUS_SUCCESS = 26,
eCSR_ROAM_PREAUTH_STATUS_FAILURE = 27,
eCSR_ROAM_HANDOVER_SUCCESS = 28,
#endif
/* Disaconnect all the clients */
eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS = 31,
/* Stopbss triggered from SME due to different */
@@ -330,9 +294,6 @@ typedef enum {
#ifdef FEATURE_WLAN_ESE
eCSR_ROAM_TSM_IE_IND = 34,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_CCKM_PREAUTH_NOTIFY = 35,
#endif
eCSR_ROAM_ESE_ADJ_AP_REPORT_IND = 36,
eCSR_ROAM_ESE_BCN_REPORT_IND = 37,
#endif /* FEATURE_WLAN_ESE */
@@ -346,11 +307,6 @@ typedef enum {
eCSR_ROAM_EXT_CHG_CHNL_IND = 41,
eCSR_ROAM_STA_CHANNEL_SWITCH = 42,
eCSR_ROAM_NDP_STATUS_UPDATE = 43,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_START = 44,
eCSR_ROAM_ABORT = 45,
eCSR_ROAM_NAPI_OFF = 46,
#endif
eCSR_ROAM_CHANNEL_COMPLETE_IND = 47,
eCSR_ROAM_CAC_COMPLETE_IND = 48,
eCSR_ROAM_SAE_COMPUTE = 49,
@@ -435,27 +391,12 @@ typedef enum {
} eCsrRoamResult;
typedef enum {
#ifndef FEATURE_CM_ENABLE
eCSR_DISCONNECT_REASON_UNSPECIFIED = 0,
eCSR_DISCONNECT_REASON_MIC_ERROR,
eCSR_DISCONNECT_REASON_DISASSOC,
eCSR_DISCONNECT_REASON_DEAUTH,
eCSR_DISCONNECT_REASON_HANDOFF,
eCSR_DISCONNECT_REASON_STA_HAS_LEFT,
#endif
eCSR_DISCONNECT_REASON_NDI_DELETE = 6,
#ifndef FEATURE_CM_ENABLE
eCSR_DISCONNECT_REASON_ROAM_HO_FAIL,
#endif
} eCsrRoamDisconnectReason;
typedef enum {
/* Not associated in Infra or participating in an Ad-hoc */
eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED,
#ifndef FEATURE_CM_ENABLE
/* Associated in an Infrastructure network. */
eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED,
#endif
/* Participating in WDS network in AP/STA mode but not connected yet */
eCSR_ASSOC_STATE_TYPE_WDS_DISCONNECTED,
/* Participating in a WDS network and connected peer to peer */
@@ -468,10 +409,6 @@ typedef enum {
eCSR_CONNECT_STATE_TYPE_NDI_NOT_STARTED,
/* NAN Data interface started */
eCSR_CONNECT_STATE_TYPE_NDI_STARTED,
#ifndef FEATURE_CM_ENABLE
/* Disconnecting with AP or stop connecting process */
eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING,
#endif
} eCsrConnectState;
/*
@@ -643,59 +580,11 @@ struct csr_roam_profile {
tSirMacRateSet extended_rates;
uint32_t cac_duration_ms;
uint32_t dfs_regdomain;
#ifndef FEATURE_CM_ENABLE
eCsrEncryptionType negotiatedMCEncryptionType;
bool MFPEnabled;
uint32_t nWPAReqIELength; /* The byte count in the pWPAReqIE */
uint8_t *pWPAReqIE; /* If not null,it's IE byte stream for WPA */
#ifdef FEATURE_WLAN_WAPI
uint32_t nWAPIReqIELength;/* The byte count in the pWAPIReqIE */
uint8_t *pWAPIReqIE; /* If not null,it's IE byte stream for WAPI */
#endif /* FEATURE_WLAN_WAPI */
uint32_t nAddIEScanLength;/* pAddIE for scan (at the time of join) */
/*
* If not null,it's the IE byte stream for additional IE,
* which can be WSC IE and/or P2P IE
*/
uint8_t *pAddIEScan;
uint32_t nAddIEAssocLength; /* The byte count in the pAddIE for assoc */
/*
* If not null, it has the IE byte stream for additional IE,
* which can be WSC IE and/or P2P IE
*/
uint8_t *pAddIEAssoc;
#ifdef WLAN_FEATURE_FILS_SK
struct wlan_fils_connection_info *fils_con_info;
#endif
/* WPS Association if true => auth and ecryption should be ignored */
bool bWPSAssociation;
bool bOSENAssociation;
struct mobility_domain_info mdid;
struct qdf_mac_addr bssid_hint;
bool force_24ghz_in_ht20;
bool force_rsne_override;
#endif /* FEATURE_CM_ENABLE */
};
typedef struct tagCsrRoamConnectedProfile {
eCsrRoamBssType BSSType;
tCsrRoamModifyProfileFields modifyProfileFields;
#ifndef FEATURE_CM_ENABLE
enum csr_akm_type AuthType;
eCsrEncryptionType EncryptionType;
eCsrEncryptionType mcEncryptionType;
bool qosConnection; /* A connection is QoS enabled */
bool qap; /* AP supports QoS */
/*
* meaningless on connect. It's an OUT param from CSR's point of view
* During assoc response carries the ACM bit-mask i.e. what
* ACs have ACM=1 (if any),(Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE
* all other bits are ignored)
*/
uint8_t acm_mask;
uint8_t proxy_arp_service;
#endif
} tCsrRoamConnectedProfile;
struct csr_config_params {
@@ -1034,10 +923,6 @@ typedef QDF_STATUS (*csr_session_open_cb)(uint8_t session_id,
QDF_STATUS qdf_status);
typedef QDF_STATUS (*csr_session_close_cb)(uint8_t session_id);
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_INFRASTRUCTURE(pProfile) (eCSR_BSS_TYPE_INFRASTRUCTURE == \
(pProfile)->BSSType)
#endif
#define CSR_IS_ANY_BSS_TYPE(pProfile) (eCSR_BSS_TYPE_ANY == \
(pProfile)->BSSType)
#define CSR_IS_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
@@ -1055,53 +940,6 @@ typedef QDF_STATUS (*csr_session_close_cb)(uint8_t session_id);
#define CSR_IS_CONN_NDI(profile) (false)
#endif
#ifndef FEATURE_CM_ENABLE
#ifdef WLAN_FEATURE_SAE
#define CSR_IS_AUTH_TYPE_SAE(auth_type) \
(eCSR_AUTH_TYPE_SAE == auth_type)
#define CSR_IS_AKM_FT_SAE(auth_type) \
(eCSR_AUTH_TYPE_FT_SAE == (auth_type))
#define CSR_IS_FW_FT_SAE_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_FT_SAE)) ? true : false)
#define CSR_IS_FW_SAE_ROAM_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_SAE)) ? true : false)
#else
#define CSR_IS_AUTH_TYPE_SAE(auth_type) (false)
#define CSR_IS_AKM_FT_SAE(auth_type) (false)
#define CSR_IS_FW_FT_SAE_SUPPORTED(fw_akm_bitmap) (false)
#define CSR_IS_FW_SAE_ROAM_SUPPORTED(fw_akm_bitmap) (false)
#endif
#define CSR_IS_FW_OWE_ROAM_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_OWE)) ? true : false)
#define CSR_IS_AKM_FT_SUITEB_SHA384(auth_type) \
(eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384 == (auth_type))
#define CSR_IS_AKM_FILS(auth_type) \
((eCSR_AUTH_TYPE_FILS_SHA256 == auth_type) || \
(eCSR_AUTH_TYPE_FILS_SHA384 == auth_type))
#define CSR_IS_AKM_FT_FILS(auth_type) \
((eCSR_AUTH_TYPE_FT_FILS_SHA256 == (auth_type)) || \
(eCSR_AUTH_TYPE_FT_FILS_SHA384 == (auth_type)))
#define CSR_IS_FW_FT_SUITEB_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_FT_SUITEB_SHA384)) ? true : false)
#define CSR_IS_FW_FT_FILS_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_FT_FILS)) ? true : false)
#define CSR_IS_FW_SUITEB_ROAM_SUPPORTED(fw_akm_bitmap) \
(((fw_akm_bitmap) & (1 << AKM_SUITEB)) ? true : false)
#endif
QDF_STATUS csr_set_channels(struct mac_context *mac,
struct csr_config_params *pParam);
@@ -1116,58 +954,12 @@ typedef void (*tCsrTsmStatsCallback)(tAniTrafStrmMetrics tsmMetrics,
#endif /* FEATURE_WLAN_ESE */
typedef void (*tCsrSnrCallback)(int8_t snr, void *pContext);
#ifndef FEATURE_CM_ENABLE
/**
* csr_roam_issue_ft_preauth_req() - Initiate Preauthentication request
* @max_ctx: Global MAC context
* @session_id: SME Session ID
* @bss_desc: BSS descriptor
*
* Return: Success or Failure
*/
#ifdef WLAN_FEATURE_HOST_ROAM
QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
uint32_t session_id,
struct bss_description *bss_desc);
QDF_STATUS csr_continue_lfr2_connect(struct mac_context *mac,
uint32_t session_id);
#else
static inline
QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
uint32_t session_id,
struct bss_description *bss_desc)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline
QDF_STATUS csr_continue_lfr2_connect(struct mac_context *mac,
uint32_t session_id)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
#endif
typedef void (*csr_readyToSuspendCallback)(void *pContext, bool suspended);
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
typedef void (*csr_readyToExtWoWCallback)(void *pContext, bool status);
#endif
typedef void (*csr_link_status_callback)(uint8_t status, void *context);
#ifndef FEATURE_CM_ENABLE
#ifdef FEATURE_WLAN_TDLS
void csr_roam_fill_tdls_info(struct mac_context *mac_ctx,
struct csr_roam_info *roam_info,
struct wlan_objmgr_vdev *vdev);
#else
static inline void csr_roam_fill_tdls_info(struct mac_context *mac_ctx,
struct csr_roam_info *roam_info,
struct wlan_objmgr_vdev *vdev)
{}
#endif
#endif
typedef void (*sme_get_raom_scan_ch_callback)(
hdd_handle_t hdd_handle,
struct roam_scan_ch_resp *roam_ch,

View File

@@ -1,268 +0,0 @@
/*
* Copyright (c) 2011-2019,2021 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
#ifndef FEATURE_CM_ENABLE
#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 /* FEATURE_CM_ENABLE */
#endif /* CSR_HOST_SCAN_ROAM_H */

View File

@@ -32,10 +32,8 @@
#include "cds_reg_service.h"
#include "wlan_scan_public_structs.h"
#include "csr_neighbor_roam.h"
#include "sir_types.h"
#include "wlan_mlme_public_struct.h"
#include "csr_host_scan_roam.h"
#define CSR_ROAM_SCAN_CHANNEL_SWITCH_TIME 3
@@ -98,60 +96,21 @@ enum csr_scan_reason {
enum csr_roam_reason {
/* Roaming because we've not established the initial connection. */
eCsrNoConnection,
#ifndef FEATURE_CM_ENABLE
/* roaming because someone asked us to Disassoc & stay disassociated. */
eCsrForcedDisassoc,
#endif
/* roaming because an 802.11 request was issued to the driver. */
eCsrHddIssued,
#ifndef FEATURE_CM_ENABLE
/* roaming because we need to force a Disassoc due to MIC failure */
eCsrForcedDisassocMICFailure,
eCsrHddIssuedReassocToSameAP,
eCsrSmeIssuedReassocToSameAP,
/* roaming because someone asked us to deauth and stay disassociated. */
eCsrForcedDeauth,
/* will be issued by Handoff logic to disconect from current AP */
eCsrSmeIssuedDisassocForHandoff,
/* will be issued by Handoff logic to join a new AP with same profile */
eCsrSmeIssuedAssocToSimilarAP,
#endif
eCsrStopBss,
#ifndef FEATURE_CM_ENABLE
eCsrSmeIssuedFTReassoc,
#endif
eCsrForcedDisassocSta,
eCsrForcedDeauthSta,
#ifndef FEATURE_CM_ENABLE
eCsrPerformPreauth,
#endif
};
enum csr_roam_substate {
eCSR_ROAM_SUBSTATE_NONE = 0,
eCSR_ROAM_SUBSTATE_START_BSS_REQ,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_SUBSTATE_JOIN_REQ,
eCSR_ROAM_SUBSTATE_REASSOC_REQ,
#endif
eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
#ifndef FEATURE_CM_ENABLE
/* Continue the current roam command after disconnect */
eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING,
#endif
eCSR_ROAM_SUBSTATE_CONFIG,
eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
#endif
eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
#ifndef FEATURE_CM_ENABLE
eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
eCSR_ROAM_SUBSTATE_DISASSOC_STA_HAS_LEFT,
#endif
/* max is 15 unless the bitfield is expanded... */
};
@@ -165,22 +124,8 @@ enum csr_roam_state {
enum csr_join_state {
eCsrContinueRoaming,
eCsrStopRoaming,
#ifndef FEATURE_CM_ENABLE
eCsrReassocToSelfNoCapChange,
eCsrStopRoamingDueToConcurrency,
#endif
};
#ifndef FEATURE_CM_ENABLE
enum csr_roaming_reason {
eCsrNotRoaming,
eCsrLostlinkRoamingDisassoc,
eCsrLostlinkRoamingDeauth,
eCsrDynamicRoaming,
eCsrReassocRoaming,
};
#endif
enum csr_roam_wmstatus_changetypes {
eCsrDisassociated,
eCsrDeauthenticated
@@ -370,9 +315,6 @@ struct csr_scanstruct {
int8_t inScanResultBestAPRssi;
bool fcc_constraint;
bool pending_channel_list_req;
#ifndef FEATURE_CM_ENABLE
wlan_scan_requester requester_id;
#endif
};
/*
@@ -478,37 +420,6 @@ struct csr_roam_session {
* All member must be set every time we try to join
*/
struct csr_roamstart_bssparams bssParams;
#ifndef FEATURE_CM_ENABLE
struct csr_roam_connectedinfo prev_assoc_ap_info;
struct bss_description *pConnectBssDesc;
/* the byte count of pWpaRsnIE; */
uint32_t nWpaRsnReqIeLength;
/* contain the WPA/RSN IE in assoc req */
uint8_t *pWpaRsnReqIE;
#ifdef FEATURE_WLAN_WAPI
/* the byte count of pWapiReqIE; */
uint32_t nWapiReqIeLength;
/* this contain the WAPI IE in assoc req */
uint8_t *pWapiReqIE;
#endif /* FEATURE_WLAN_WAPI */
uint32_t nAddIEScanLength; /* the byte count of pAddIeScanIE; */
/* contains the additional IE in (unicast) probe req at time of join */
uint8_t *pAddIEScan;
/* This count represents the number of bssid's we try to join. */
uint8_t join_bssid_count;
enum wlan_reason_code disconnect_reason;
struct scan_cmd_info scan_info;
bool is_fils_connection;
uint16_t fils_seq_num;
bool discon_in_progress;
qdf_mc_timer_t roaming_offload_timer;
struct csr_timer_info roamingTimerInfo;
qdf_mc_timer_t hTimerRoaming;
enum csr_roaming_reason roamingReason;
bool fCancelRoaming;
uint8_t bRefAssocStartCnt; /* Tracking assoc start indication */
tftSMEContext ftSmeContext;
#endif /* ndef FEATURE_CM_ENABLE */
#ifdef WLAN_BCN_RECV_FEATURE
bool is_bcn_recv_start;
bool beacon_report_do_not_resume;
@@ -545,9 +456,6 @@ struct csr_roamstruct {
*/
int32_t sPendingCommands;
struct csr_roam_session *roamSession;
#ifndef FEATURE_CM_ENABLE
tCsrNeighborRoamControlInfo neighborRoamInfo[WLAN_MAX_VDEVS];
#endif
#ifdef FEATURE_WLAN_ESE
uint8_t isEseIniFeatureEnabled;
#endif
@@ -579,21 +487,6 @@ struct csr_roamstruct {
((subState) == (mac)->roam.curSubState[sessionId])
#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
#endif
#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
@@ -603,22 +496,12 @@ struct csr_roamstruct {
#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, sessionId)
#endif
#define CSR_IS_ROAM_SUBSTATE_CONFIG(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
#define CSR_IS_ROAM_SUBSTATE_WAITFORKEY(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId)
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(mac, sessionId) \
CSR_IS_ROAM_SUBSTATE((mac), \
eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
#endif
#define CSR_IS_PHY_MODE_B_ONLY(mac) \
((eCSR_DOT11_MODE_11b == (mac)->roam.configParam.phyMode) || \
(eCSR_DOT11_MODE_11b_ONLY == (mac)->roam.configParam.phyMode))
@@ -733,16 +616,6 @@ struct csr_roamstruct {
(CSR_IS_OPEARTING_DUAL_BAND((mac)) || \
CSR_IS_RADIO_BG_ONLY((mac)) || CSR_IS_24_BAND_ONLY((mac)))
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_ROAMING(pSession) \
((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
(eCsrDynamicRoaming == (pSession)->roamingReason) || \
(eCsrReassocRoaming == (pSession)->roamingReason))
#define CSR_IS_LOSTLINK_ROAMING(reason) \
((eCsrLostlinkRoamingDisassoc == (reason)) || \
(eCsrLostlinkRoamingDeauth == (reason)))
#endif
#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(mac) \
(mac->mlme_cfg->wmm_params.wmm_tspec_element.ts_acm_is_off)
@@ -778,12 +651,6 @@ bool csr_is_conn_state_disconnected(struct mac_context *mac,
uint8_t vdev_id);
bool csr_is_conn_state_connected(struct mac_context *mac,
uint32_t sessionId);
#ifndef FEATURE_CM_ENABLE
bool csr_is_conn_state_connected_infra(struct mac_context *mac,
uint32_t sessionId);
bool csr_is_conn_state_infra(struct mac_context *mac,
uint32_t sessionId);
#endif
bool csr_is_conn_state_wds(struct mac_context *mac, uint32_t sessionId);
bool csr_is_conn_state_connected_wds(struct mac_context *mac,
uint32_t sessionId);
@@ -868,23 +735,6 @@ QDF_STATUS csr_get_tsm_stats(struct mac_context *mac,
bool csr_roam_is_fast_roam_enabled(struct mac_context *mac, uint8_t vdev_id);
bool csr_roam_is_roam_offload_scan_enabled(
struct mac_context *mac);
#ifndef FEATURE_CM_ENABLE
#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
QDF_STATUS csr_roam_offload_scan_rsp_hdlr(struct mac_context *mac,
struct roam_offload_scan_rsp *scanOffloadRsp);
#else
static inline QDF_STATUS csr_roam_offload_scan_rsp_hdlr(
struct mac_context *mac,
struct roam_offload_scan_rsp *scanOffloadRsp)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
QDF_STATUS csr_handoff_request(struct mac_context *mac, uint8_t sessionId,
tCsrHandoffRequest
*pHandoffInfo);
bool csr_roam_is_sta_mode(struct mac_context *mac, uint8_t vdev_id);
#endif
/* Post Channel Change Indication */
QDF_STATUS csr_roam_channel_change_req(struct mac_context *mac,
@@ -907,36 +757,6 @@ QDF_STATUS csr_roam_modify_add_ies(struct mac_context *mac,
QDF_STATUS
csr_roam_update_add_ies(struct mac_context *mac,
tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
#ifndef FEATURE_CM_ENABLE
/**
* csr_scan_save_roam_offload_ap_to_scan_cache() - This function parses the
* received beacon/probe response from the firmware as part of the roam synch
* indication. The beacon or the probe response is parsed and is also
* saved into the scan cache
*
* @mac: mac Pointer to Global Mac
* @roam_sync_ind_ptr: Roam Synch Indication from firmware
*
* @Return QDF_STATUS
*/
QDF_STATUS
csr_rso_save_ap_to_scan_cache(struct mac_context *mac,
struct roam_offload_synch_ind *roam_synch_ind,
struct bss_description *bss_desc_ptr);
/**
* csr_process_ho_fail_ind - This function will process the Hand Off Failure
* indication received from the firmware. It will trigger a disconnect on
* the session which the firmware reported a hand off failure.
* @mac: Pointer to global Mac
* @msg_buf: Pointer to wma Ho fail indication message
*
* Return: None
*/
void csr_process_ho_fail_ind(struct mac_context *mac, void *msg_buf);
#endif
#endif
QDF_STATUS csr_get_channels_and_power(struct mac_context *mac);

View File

@@ -29,156 +29,7 @@
#include "sme_api.h"
#include "wlan_cm_roam_api.h"
#ifndef FEATURE_CM_ENABLE
#define ROAM_AP_AGE_LIMIT_MS 10000
/* Enumeration of various states in neighbor roam algorithm */
typedef enum {
eCSR_NEIGHBOR_ROAM_STATE_CLOSED,
eCSR_NEIGHBOR_ROAM_STATE_INIT,
eCSR_NEIGHBOR_ROAM_STATE_CONNECTED,
eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING,
eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING,
eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE,
eNEIGHBOR_STATE_MAX
} eCsrNeighborRoamState;
typedef struct sCsrNeighborRoamBSSInfo {
tListElem List;
uint8_t apPreferenceVal;
struct bss_description *pBssDescription;
} tCsrNeighborRoamBSSInfo, *tpCsrNeighborRoamBSSInfo;
#define CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT 1000 /* in milliseconds */
/* Max number of MAC addresses with which the pre-auth was failed */
#define MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS 10
#define CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES 3
/* Black listed APs. List of MAC Addresses with which the Preauth was failed */
typedef struct sCsrPreauthFailListInfo {
uint8_t numMACAddress;
tSirMacAddr macAddress[MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS];
} tCsrPreauthFailListInfo, *tpCsrPreauthFailListInfo;
typedef struct sCsr11rAssocNeighborInfo {
bool preauthRspPending;
bool neighborRptPending;
uint8_t currentNeighborRptRetryNum;
tCsrPreauthFailListInfo preAuthFailList;
uint32_t neighborReportTimeout;
uint8_t numPreAuthRetries;
tDblLinkList preAuthDoneList; /* llist which consists/preauth nodes */
} tCsr11rAssocNeighborInfo, *tpCsr11rAssocNeighborInfo;
/**
* struct sCsr11rAssocNeighborInfo - Control info for neighbor roam algorithm
*/
typedef struct sCsrNeighborRoamControlInfo {
eCsrNeighborRoamState neighborRoamState;
eCsrNeighborRoamState prevNeighborRoamState;
struct qdf_mac_addr currAPbssid; /* current assoc AP */
tDblLinkList roamableAPList; /* List of current FT candidates */
struct csr_roam_profile csrNeighborRoamProfile;
tCsr11rAssocNeighborInfo FTRoamInfo;
#ifdef FEATURE_WLAN_ESE
bool isVOAdmitted;
uint16_t MinQBssLoadRequired;
#endif
/* upper layer requested a reassoc */
uint8_t uOsRequestedHandoff;
/* handoff related info came with upper layer's req for reassoc */
tCsrHandoffRequest handoffReqInfo;
struct scan_result_list *scan_res_lfr2_roam_ap;
} tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo;
/* All the necessary Function declarations are here */
QDF_STATUS csr_neighbor_roam_indicate_connect(struct mac_context *mac,
uint8_t sessionId, QDF_STATUS status);
QDF_STATUS csr_neighbor_roam_indicate_disconnect(struct mac_context *mac,
uint8_t sessionId);
QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId);
void csr_neighbor_roam_close(struct mac_context *mac, uint8_t sessionId);
QDF_STATUS csr_neighbor_roam_preauth_rsp_handler(struct mac_context *mac,
uint8_t sessionId, QDF_STATUS limStatus);
#ifdef WLAN_FEATURE_HOST_ROAM
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);
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);
#else
static inline bool csr_neighbor_roam_state_preauth_done(struct mac_context *mac,
uint8_t sessionId)
{
return false;
}
static inline void csr_neighbor_roam_tranistion_preauth_done_to_disconnected(
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)
{}
#endif
bool csr_neighbor_middle_of_roaming(struct mac_context *mac, uint8_t sessionId);
#if defined(WLAN_FEATURE_FILS_SK)
/**
* csr_update_fils_config - Update FILS config to CSR roam session
* @mac: MAC context
* @session_id: session id
* @src_profile: Source profile having latest FILS config
*
* API to update FILS config to roam csr session
*
* Return: QDF_STATUS
*/
QDF_STATUS csr_update_fils_config(struct mac_context *mac, uint8_t session_id,
struct csr_roam_profile *src_profile);
#endif
QDF_STATUS csr_neighbor_roam_handoff_req_hdlr(struct mac_context *mac, void *pMsg);
QDF_STATUS csr_neighbor_roam_proceed_with_handoff_req(struct mac_context *mac,
uint8_t sessionId);
QDF_STATUS csr_neighbor_roam_sssid_scan_done(struct mac_context *mac,
uint8_t sessionId, QDF_STATUS status);
QDF_STATUS csr_neighbor_roam_start_lfr_scan(struct mac_context *mac,
uint8_t sessionId);
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);
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,
uint8_t sessionId, tSirMacAddr bssId);
#ifdef FEATURE_WLAN_LFR_METRICS
void csr_neighbor_roam_send_lfr_metric_event(struct mac_context *mac_ctx,
uint8_t session_id, tSirMacAddr bssid, eRoamCmdStatus status);
#else
static inline void csr_neighbor_roam_send_lfr_metric_event(
struct mac_context *mac_ctx, uint8_t session_id,
tSirMacAddr bssid, eRoamCmdStatus status)
{}
#endif
QDF_STATUS csr_roam_copy_connected_profile(struct mac_context *mac,
uint32_t sessionId, struct csr_roam_profile *pDstProfile);
#ifdef FEATURE_WLAN_ESE
QDF_STATUS csr_roam_read_tsf(struct mac_context *mac, uint8_t *pTimestamp,
const uint8_t sessionId);
#endif /* FEATURE_WLAN_ESE */
#endif /* FEATURE_CM_ENABLE */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
#ifndef FEATURE_CM_ENABLE
QDF_STATUS csr_roam_synch_callback(struct mac_context *mac,
struct roam_offload_synch_ind *roam_synch_data,
struct bss_description *bss_desc_ptr, enum sir_roam_op_code reason);
#endif
/**
* csr_roam_auth_offload_callback() - Registered CSR Callback function to handle
* WPA3 roam pre-auth event from firmware.
@@ -190,33 +41,7 @@ QDF_STATUS
csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
uint8_t vdev_id,
struct qdf_mac_addr bssid);
#ifndef FEATURE_CM_ENABLE
/**
* csr_fast_reassoc() - invokes FAST REASSOC command
* @mac_handle: handle returned by mac_open
* @profile: current connected profile
* @bssid: bssid to look for in scan cache
* @ch_freq: channel on which reassoc should be send
* @vdev_id: vdev id
* @connected_bssid: bssid of currently connected profile
*
* Return: QDF_STATUS
*/
QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
struct csr_roam_profile *profile,
const tSirMacAddr bssid, uint32_t ch_freq,
uint8_t vdev_id, const tSirMacAddr connected_bssid);
#endif
#else
#ifndef FEATURE_CM_ENABLE
static inline QDF_STATUS csr_roam_synch_callback(struct mac_context *mac,
struct roam_offload_synch_ind *roam_synch_data,
struct bss_description *bss_desc_ptr, enum sir_roam_op_code reason)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
static inline QDF_STATUS
csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
uint8_t vdev_id,
@@ -224,18 +49,8 @@ csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
#ifndef FEATURE_CM_ENABLE
static inline
QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
struct csr_roam_profile *profile,
const tSirMacAddr bssid, uint32_t ch_freq,
uint8_t vdev_id, const tSirMacAddr connected_bssid)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif
/**
* csr_invoke_neighbor_report_request - Send neighbor report invoke command to
* WMA

View File

@@ -193,58 +193,6 @@ tSirResultCodes csr_get_de_auth_rsp_status_code(struct deauth_rsp *pSmeRsp);
uint32_t csr_get_frag_thresh(struct mac_context *mac_ctx);
uint32_t csr_get_rts_thresh(struct mac_context *mac_ctx);
#ifndef FEATURE_CM_ENABLE
uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrRSNIe *pRSNIe);
uint8_t csr_construct_wpa_ie(struct mac_context *mac, uint8_t session_id,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe);
#ifdef FEATURE_WLAN_WAPI
bool csr_is_profile_wapi(struct csr_roam_profile *pProfile);
#endif /* FEATURE_WLAN_WAPI */
/*
* If a WPAIE exists in the profile, just use it.
* Or else construct one from the BSS Caller allocated memory for pWpaIe and
* guarrantee it can contain a max length WPA IE
*/
uint8_t csr_retrieve_wpa_ie(struct mac_context *mac, uint8_t session_id,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe);
bool csr_is_ssid_equal(struct mac_context *mac,
struct bss_description *pSirBssDesc1,
struct bss_description *pSirBssDesc2,
tDot11fBeaconIEs *pIes2);
/* Null ssid means match */
bool csr_is_ssid_in_list(tSirMacSSid *pSsid, tCsrSSIDs *pSsidList);
bool csr_is_profile_wpa(struct csr_roam_profile *pProfile);
bool csr_is_profile_rsn(struct csr_roam_profile *pProfile);
/*
* If a RSNIE exists in the profile, just use it. Or
* else construct one from the BSS Caller allocated memory for pWpaIe and
* guarantee it can contain a max length WPA IE
*/
uint8_t csr_retrieve_rsn_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrRSNIe *pRsnIe);
#ifdef FEATURE_WLAN_WAPI
/*
* If a WAPI IE exists in the profile, just use it.
* Or else construct one from the BSS. Caller allocated memory for pWapiIe and
* guarrantee it can contain a max length WAPI IE
*/
uint8_t csr_retrieve_wapi_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe);
#endif /* FEATURE_WLAN_WAPI */
#endif /* FEATURE_CM_ENABLE */
bool csr_rates_is_dot11_rate11b_supported_rate(uint8_t dot11Rate);
bool csr_rates_is_dot11_rate11a_supported_rate(uint8_t dot11Rate);
tAniEdType csr_translate_encrypt_type_to_ed_type(
@@ -271,21 +219,6 @@ QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
struct bss_description *pBSSDescription,
eCsrPhyMode *pPhyMode, tDot11fBeaconIEs *pIes);
#ifndef FEATURE_CM_ENABLE
/*
* fForce -- force reassoc regardless of whether there is any change.
* The reason is that for UAPSD-bypass, the code underneath this call determine
* whether to allow UAPSD. The information in pModProfileFields reflects what
* the user wants. There may be discrepency in it. UAPSD-bypass logic should
* decide if it needs to reassoc
*/
QDF_STATUS csr_reassoc(struct mac_context *mac, uint32_t sessionId,
tCsrRoamModifyProfileFields *pModProfileFields,
uint32_t *pRoamId, bool fForce);
#ifdef FEATURE_WLAN_ESE
bool csr_is_profile_ese(struct csr_roam_profile *pProfile);
#endif
#endif
/**
* csr_is_auth_type_ese() - Checks whether Auth type is ESE or not
* @AuthType: Authentication type

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -91,21 +91,6 @@ QDF_STATUS csr_msg_processor(struct mac_context *mac_ctx, void *msg_buf)
sme_err("Message 0x%04X is not handled by CSR state is %d session Id %d",
sme_rsp->messageType, cur_state,
vdev_id);
#ifndef FEATURE_CM_ENABLE
if (eWNI_SME_FT_PRE_AUTH_RSP ==
sme_rsp->messageType) {
sme_err("Dequeue eSmeCommandRoam command with reason eCsrPerformPreauth");
csr_dequeue_roam_command(mac_ctx,
eCsrPerformPreauth, vdev_id);
} else if (eWNI_SME_REASSOC_RSP ==
sme_rsp->messageType) {
sme_err("Dequeue eSmeCommandRoam command with reason eCsrSmeIssuedFTReassoc");
csr_dequeue_roam_command(mac_ctx,
eCsrSmeIssuedFTReassoc,
vdev_id);
}
#endif
}
break;
} /* switch */

View File

@@ -1,686 +0,0 @@
/*
* Copyright (c) 2016-2021 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.
*/
/**
* DOC: csr_host_scan_roam.c
*
* Host based roaming processing scan results and initiating the roaming
*/
#ifndef FEATURE_CM_ENABLE
#include "wma_types.h"
#include "csr_inside_api.h"
#include "sme_qos_internal.h"
#include "sme_inside.h"
#include "host_diag_core_event.h"
#include "host_diag_core_log.h"
#include "csr_api.h"
#include "sme_api.h"
#include "csr_neighbor_roam.h"
#include "mac_trace.h"
#include "wlan_policy_mgr_api.h"
#include <../../core/src/wlan_cm_vdev_api.h>
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, vdev_id);
/* Set the roaming substate to 'join attempt'... */
csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_REASSOC_REQ, vdev_id);
sme_debug("calling csr_send_join_req_msg (eWNI_SME_REASSOC_REQ)");
/* This is temp ifdef will be removed in near future */
/* attempt to Join this BSS... */
return csr_send_join_req_msg(mac, vdev_id, bss_desc, roam_profile, ies,
eWNI_SME_REASSOC_REQ);
}
QDF_STATUS
csr_roam_issue_reassociate_cmd(struct mac_context *mac, uint32_t sessionId)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tSmeCmd *pCommand = NULL;
bool fHighPriority = true;
bool fRemoveCmd = false;
tListElem *pEntry;
tSmeCmd *tmp_command;
pEntry = csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK);
if (pEntry) {
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if (!pCommand) {
sme_err("fail to get command buffer");
return QDF_STATUS_E_RESOURCES;
}
if (eSmeCommandRoam == pCommand->command) {
if (pCommand->u.roamCmd.roamReason ==
eCsrSmeIssuedAssocToSimilarAP)
fRemoveCmd =
csr_nonscan_active_ll_remove_entry(mac,
pEntry,
LL_ACCESS_LOCK);
else
sme_err("Unexpected roam cmd present");
if (fRemoveCmd == false)
pCommand = NULL;
}
}
if (!pCommand) {
sme_err("fail to get cmd buf based on prev roam command");
return QDF_STATUS_E_RESOURCES;
}
do {
/*
* Get a new sme command to save the necessary info for
* the following roaming process, such as BSS list and
* roam profile. Or those info will be freed in function
* csr_reinit_roam_cmd when releasing the current command.
*/
tmp_command = csr_get_command_buffer(mac);
if (!tmp_command) {
sme_err("fail to get cmd buf!");
csr_release_command(mac, pCommand);
return QDF_STATUS_E_RESOURCES;
}
qdf_mem_copy(tmp_command, pCommand, sizeof(*pCommand));
pCommand->u.roamCmd.fReleaseBssList = false;
pCommand->u.roamCmd.hBSSList = CSR_INVALID_SCANRESULT_HANDLE;
pCommand->u.roamCmd.fReleaseProfile = false;
/*
* Invoking csr_release_command to release the current command
* or the following command will be stuck in pending queue.
* Because the API csr_nonscan_active_ll_remove_entry does
* not remove the current command from active queue.
*/
csr_release_command(mac, pCommand);
pCommand = tmp_command;
/* Change the substate in case it is wait-for-key */
if (CSR_IS_WAIT_FOR_KEY(mac, sessionId)) {
cm_stop_wait_for_key_timer(mac->psoc, sessionId);
csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_NONE,
sessionId);
}
pCommand->command = eSmeCommandRoam;
pCommand->vdev_id = (uint8_t) sessionId;
pCommand->u.roamCmd.roamReason = eCsrSmeIssuedFTReassoc;
status = csr_queue_sme_command(mac, pCommand, fHighPriority);
if (!QDF_IS_STATUS_SUCCESS(status))
sme_err("fail to send message status: %d", status);
} while (0);
return status;
}
void csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx,
uint8_t sessionid, tScanResultHandle *scan_results_list)
{
tCsrScanResultInfo *scan_result;
tpCsrNeighborRoamControlInfo n_roam_info =
&mac_ctx->roam.neighborRoamInfo[sessionid];
tpCsrNeighborRoamBSSInfo bss_info;
uint64_t age = 0;
uint32_t bss_chan_freq;
uint8_t num_candidates = 0;
uint8_t num_dropped = 0;
struct cm_roam_values_copy config;
/*
* first iteration of scan list should consider
* age constraint for candidates
*/
bool age_constraint = true;
#ifdef FEATURE_WLAN_ESE
uint16_t qpresent;
uint16_t qavail;
bool voadmitted;
#endif
/*
* Expecting the scan result already to be in the sorted order based on
* RSSI. Based on the previous state we need to check whether the list
* should be sorted again taking neighbor score into consideration. If
* previous state is CFG_CHAN_LIST_SCAN, there should not be a neighbor
* score associated with any of the BSS. If the previous state is
* REPORT_QUERY, then there will be neighbor score for each of the APs.
* For now, let us take top of the list provided as it is by CSR Scan
* result API. Hence it is assumed that neighbor score and rssi score
* are in the same order. This will be taken care later.
*/
do {
while (true) {
struct bss_description *descr;
scan_result = csr_scan_result_get_next(
mac_ctx, *scan_results_list);
if (!scan_result)
break;
descr = &scan_result->BssDescriptor;
bss_chan_freq = descr->chan_freq;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("Scan result: BSSID " QDF_MAC_ADDR_FMT
" (Rssi %d, Ch:%d)"),
QDF_MAC_ADDR_REF(descr->bssId),
(int)abs(descr->rssi), descr->chan_freq);
if (!qdf_mem_cmp(descr->bssId,
n_roam_info->currAPbssid.bytes,
sizeof(tSirMacAddr))) {
/*
* currently associated AP. Do not have this
* in the roamable AP list
*/
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_DEBUG,
"SKIP-currently associated AP");
continue;
}
/*
* Continue if MCC is disabled in INI and if AP
* will create MCC
*/
if (policy_mgr_concurrent_open_sessions_running(
mac_ctx->psoc) &&
!mac_ctx->roam.configParam.fenableMCCMode) {
uint32_t conc_freq;
conc_freq =
csr_get_concurrent_operation_freq(mac_ctx);
if (conc_freq &&
(conc_freq != bss_chan_freq)) {
sme_debug("MCC not supported so Ignore AP on channel %d",
descr->chan_freq);
continue;
}
}
/*
* In case of reassoc requested by upper layer, look
* for exact match of bssid & channel. csr cache might
* have duplicates
*/
if ((n_roam_info->uOsRequestedHandoff) &&
((qdf_mem_cmp(
descr->bssId,
n_roam_info->handoffReqInfo.bssid.bytes,
sizeof(tSirMacAddr))) ||
(descr->chan_freq !=
n_roam_info->handoffReqInfo.ch_freq))) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_DEBUG,
"SKIP-not a candidate AP for OS requested roam");
continue;
}
wlan_cm_roam_cfg_get_value(mac_ctx->psoc, sessionid,
IS_11R_CONNECTION,
&config);
if ((config.bool_value) &&
(!csr_neighbor_roam_is_preauth_candidate(mac_ctx,
sessionid, descr->bssId))) {
sme_err("BSSID in preauth fail list. Ignore");
continue;
}
#ifdef FEATURE_WLAN_ESE
if (!csr_roam_is_roam_offload_scan_enabled(mac_ctx) &&
(wlan_cm_get_ese_assoc(mac_ctx->pdev, sessionid)) &&
!csr_neighbor_roam_is_preauth_candidate(mac_ctx,
sessionid, descr->bssId)) {
sme_err("BSSID in preauth faillist. Ignore");
continue;
}
qpresent = descr->QBSSLoad_present;
qavail = descr->QBSSLoad_avail;
voadmitted = n_roam_info->isVOAdmitted;
if (voadmitted)
sme_debug("New QBSS=%s,BWavail=0x%x,req=0x%x",
((qpresent) ? "yes" : "no"), qavail,
n_roam_info->MinQBssLoadRequired);
if (voadmitted && qpresent &&
(qavail < n_roam_info->MinQBssLoadRequired)) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_DEBUG,
"BSSID:" QDF_MAC_ADDR_FMT "has no BW",
QDF_MAC_ADDR_REF(descr->bssId));
continue;
}
if (voadmitted && !qpresent) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_DEBUG,
"BSSID:" QDF_MAC_ADDR_FMT "no LOAD IE",
QDF_MAC_ADDR_REF(descr->bssId));
continue;
}
#endif /* FEATURE_WLAN_ESE */
/*
* If we are supporting legacy roaming, and
* if the candidate is on the "pre-auth failed" list,
* ignore it.
*/
if (csr_roam_is_fast_roam_enabled(mac_ctx, sessionid) &&
!csr_neighbor_roam_is_preauth_candidate(mac_ctx,
sessionid, descr->bssId)) {
sme_err("BSSID in preauth faillist Ignore");
continue;
}
/* check the age of the AP */
age = (uint64_t) qdf_mc_timer_get_system_time() -
descr->received_time;
if (age_constraint == true &&
age > ROAM_AP_AGE_LIMIT_MS) {
num_dropped++;
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_WARN,
FL("Old AP (probe rsp/beacon) skipped.")
);
continue;
}
/* Finished all checks, now add it to candidate list */
bss_info =
qdf_mem_malloc(sizeof(tCsrNeighborRoamBSSInfo));
if (!bss_info)
continue;
bss_info->pBssDescription =
qdf_mem_malloc(descr->length +
sizeof(descr->length));
if (bss_info->pBssDescription) {
qdf_mem_copy(bss_info->pBssDescription, descr,
descr->length + sizeof(descr->length));
} else {
qdf_mem_free(bss_info);
continue;
}
/*
* Assign some preference value for now. Need to
* calculate theactual score based on RSSI and neighbor
* AP score
*/
bss_info->apPreferenceVal = 10;
num_candidates++;
csr_ll_insert_tail(&n_roam_info->roamableAPList,
&bss_info->List, LL_ACCESS_LOCK);
} /* end of while (csr_scan_result_get_next) */
/* if some candidates were found, then no need to repeat */
if (num_candidates)
break;
/*
* if age_constraint is already false, we have done two
* iterations and no candidate were found
*/
if (age_constraint == false) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: No roam able candidates found",
__func__);
break;
}
/*
* if all candidates were dropped rescan the scan
* list but this time without age constraint.
*/
age_constraint = false;
/* if no candidates were dropped no need to repeat */
} while (num_dropped);
/*
* Now we have all the scan results in our local list. Good time to free
* up the the list we got as a part of csrGetScanResult
*/
csr_scan_result_purge(mac_ctx, *scan_results_list);
}
void csr_neighbor_roam_trigger_handoff(struct mac_context *mac_ctx,
uint8_t vdev_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");
}
QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac,
uint8_t sessionId)
{
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&mac->roam.neighborRoamInfo[sessionId];
struct scan_filter *filter;
tScanResultHandle scanResult;
uint32_t tempVal = 0;
QDF_STATUS hstatus;
filter = qdf_mem_malloc(sizeof(*filter));
if (!filter)
return QDF_STATUS_E_NOMEM;
hstatus = csr_neighbor_roam_get_scan_filter_from_profile(mac,
filter,
sessionId);
sme_debug("Prepare scan to find neighbor AP filter status: %d",
hstatus);
if (QDF_STATUS_SUCCESS != hstatus) {
sme_err("Scan Filter prep fail for Assoc %d Bail out",
tempVal);
qdf_mem_free(filter);
return QDF_STATUS_E_FAILURE;
}
hstatus = csr_scan_get_result(mac, filter, &scanResult, true);
qdf_mem_free(filter);
if (hstatus != QDF_STATUS_SUCCESS)
sme_err("Get Scan Result status code %d", hstatus);
/* Process the scan results and update roamable AP list */
csr_neighbor_roam_process_scan_results(mac, sessionId, &scanResult);
tempVal = csr_ll_count(&pNeighborRoamInfo->roamableAPList);
if (tempVal) {
csr_neighbor_roam_trigger_handoff(mac, sessionId);
return QDF_STATUS_SUCCESS;
}
if (csr_roam_is_roam_offload_scan_enabled(mac)) {
if (pNeighborRoamInfo->uOsRequestedHandoff) {
wlan_cm_roam_send_rso_cmd(mac->psoc, sessionId,
ROAM_SCAN_OFFLOAD_START,
REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
pNeighborRoamInfo->uOsRequestedHandoff = 0;
} else {
/* There is no candidate or We are not roaming Now.
* Inform the FW to restart Roam Offload Scan
*/
wlan_cm_roam_send_rso_cmd(mac->psoc, sessionId,
ROAM_SCAN_OFFLOAD_RESTART,
REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
}
csr_neighbor_roam_state_transition(mac,
eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, sessionId);
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(struct mac_context *mac,
void *pMsg)
{
tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd =
(tSirSmeCandidateFoundInd *) pMsg;
uint32_t sessionId = pSirSmeCandidateFoundInd->sessionId;
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&mac->roam.neighborRoamInfo[sessionId];
QDF_STATUS status = QDF_STATUS_SUCCESS;
/* we must be in connected state, if not ignore it */
if ((eCSR_NEIGHBOR_ROAM_STATE_CONNECTED !=
pNeighborRoamInfo->neighborRoamState)
|| (pNeighborRoamInfo->uOsRequestedHandoff)) {
sme_err("Recvd in NotCONNECTED or OsReqHandoff. Ignore");
status = QDF_STATUS_E_FAILURE;
} else {
/* Future enhancements:
* If firmware tags candidate beacons, give them preference
* for roaming.
* Age out older entries so that new candidate beacons
* will get preference.
*/
status = csr_neighbor_roam_process_scan_complete(mac,
sessionId);
if (QDF_STATUS_SUCCESS != status) {
sme_err("scan process complete failed, status %d",
status);
return QDF_STATUS_E_FAILURE;
}
}
return status;
}
void csr_neighbor_roam_free_roamable_bss_list(struct mac_context *mac_ctx,
tDblLinkList *llist)
{
tpCsrNeighborRoamBSSInfo result = NULL;
/*
* Pick up the head, remove and free the node till
* the list becomes empty
*/
while ((result = csr_neighbor_roam_next_roamable_ap(mac_ctx, llist,
NULL)) != NULL) {
csr_neighbor_roam_remove_roamable_ap_list_entry(mac_ctx,
llist, result);
csr_neighbor_roam_free_neighbor_roam_bss_node(mac_ctx, result);
}
}
bool csr_neighbor_roam_remove_roamable_ap_list_entry(struct mac_context *mac,
tDblLinkList *pList,
tpCsrNeighborRoamBSSInfo
pNeighborEntry)
{
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));
return false;
}
tpCsrNeighborRoamBSSInfo csr_neighbor_roam_next_roamable_ap(
struct mac_context *mac_ctx, tDblLinkList *llist,
tpCsrNeighborRoamBSSInfo neighbor_entry)
{
tListElem *entry = NULL;
tpCsrNeighborRoamBSSInfo result = NULL;
if (llist) {
if (!neighbor_entry)
entry = csr_ll_peek_head(llist, LL_ACCESS_LOCK);
else
entry = csr_ll_next(llist, &neighbor_entry->List,
LL_ACCESS_LOCK);
if (entry)
result = GET_BASE_ADDR(entry, tCsrNeighborRoamBSSInfo,
List);
}
return result;
}
void csr_neighbor_roam_request_handoff(struct mac_context *mac_ctx,
uint8_t session_id)
{
struct csr_roam_info *roam_info;
tpCsrNeighborRoamControlInfo neighbor_roam_info =
&mac_ctx->roam.neighborRoamInfo[session_id];
tCsrNeighborRoamBSSInfo handoff_node;
uint32_t roamid = 0;
QDF_STATUS status;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, "%s session_id=%d",
__func__, session_id);
if (neighbor_roam_info->neighborRoamState !=
eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) {
sme_err("Roam requested when Neighbor roam is in %s state",
mac_trace_get_neighbour_roam_state(
neighbor_roam_info->neighborRoamState));
return;
}
if (false == csr_neighbor_roam_get_handoff_ap_info(mac_ctx,
&handoff_node, session_id)) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("failed to obtain handoff AP"));
return;
}
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("HANDOFF CANDIDATE BSSID "QDF_MAC_ADDR_FMT),
QDF_MAC_ADDR_REF(handoff_node.pBssDescription->bssId));
roam_info = qdf_mem_malloc(sizeof(*roam_info));
if (!roam_info)
return;
csr_roam_call_callback(mac_ctx, session_id, roam_info, roamid,
eCSR_ROAM_FT_START, eCSR_ROAM_RESULT_SUCCESS);
qdf_mem_zero(roam_info, sizeof(*roam_info));
csr_neighbor_roam_state_transition(mac_ctx,
eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING, session_id);
csr_neighbor_roam_send_lfr_metric_event(mac_ctx, session_id,
handoff_node.pBssDescription->bssId,
eCSR_ROAM_HANDOVER_SUCCESS);
/* Free the profile.. Just to make sure we dont leak memory here */
csr_release_profile(mac_ctx,
&neighbor_roam_info->csrNeighborRoamProfile);
/*
* Create the Handoff AP profile. Copy the currently connected profile
* and update only the BSSID and channel number. This should happen
* before issuing disconnect
*/
status = csr_roam_copy_connected_profile(mac_ctx, session_id,
&neighbor_roam_info->csrNeighborRoamProfile);
if (QDF_STATUS_SUCCESS != status) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("csr_roam_copy_connected_profile failed %d"),
status);
qdf_mem_free(roam_info);
return;
}
qdf_mem_copy(neighbor_roam_info->csrNeighborRoamProfile.BSSIDs.bssid,
handoff_node.pBssDescription->bssId, sizeof(tSirMacAddr));
neighbor_roam_info->csrNeighborRoamProfile.ChannelInfo.freq_list[0] =
handoff_node.pBssDescription->chan_freq;
sme_debug("csr_roamHandoffRequested: disassociating with current AP");
if (!QDF_IS_STATUS_SUCCESS(csr_roam_issue_disassociate_cmd(
mac_ctx,
session_id,
eCSR_DISCONNECT_REASON_HANDOFF,
REASON_UNSPEC_FAILURE))) {
sme_warn("csr_roamHandoffRequested: fail to issue disassoc");
qdf_mem_free(roam_info);
return;
}
/* notify HDD for handoff, providing the BSSID too */
roam_info->reasonCode = eCsrRoamReasonBetterAP;
qdf_mem_copy(roam_info->bssid.bytes,
handoff_node.pBssDescription->bssId,
sizeof(struct qdf_mac_addr));
csr_roam_call_callback(mac_ctx, session_id, roam_info, 0,
eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE);
qdf_mem_free(roam_info);
}
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];
tpCsrNeighborRoamBSSInfo bss_node = NULL;
struct cm_roam_values_copy config;
if (!hand_off_node) {
QDF_ASSERT(hand_off_node);
return false;
}
wlan_cm_roam_cfg_get_value(mac->psoc, session_id, IS_11R_CONNECTION,
&config);
if (config.bool_value) {
/* Always the BSS info in the head is the handoff candidate */
bss_node = csr_neighbor_roam_next_roamable_ap(
mac,
&ngbr_roam_info->FTRoamInfo.preAuthDoneList,
NULL);
sme_debug("Number of Handoff candidates: %d",
csr_ll_count(&
ngbr_roam_info->FTRoamInfo.preAuthDoneList));
} else
#ifdef FEATURE_WLAN_ESE
if (wlan_cm_get_ese_assoc(mac->pdev, session_id)) {
/* Always the BSS info in the head is the handoff candidate */
bss_node =
csr_neighbor_roam_next_roamable_ap(mac,
&ngbr_roam_info->FTRoamInfo.preAuthDoneList,
NULL);
sme_debug("Number of Handoff candidates: %d",
csr_ll_count(&ngbr_roam_info->FTRoamInfo.
preAuthDoneList));
} else
#endif
if (csr_roam_is_fast_roam_enabled(mac, session_id)) {
/* Always the BSS info in the head is the handoff candidate */
bss_node =
csr_neighbor_roam_next_roamable_ap(mac,
&ngbr_roam_info->FTRoamInfo.preAuthDoneList,
NULL);
sme_debug("Number of Handoff candidates: %d",
csr_ll_count(
&ngbr_roam_info->FTRoamInfo.preAuthDoneList));
} else {
bss_node =
csr_neighbor_roam_next_roamable_ap(mac,
&ngbr_roam_info->roamableAPList,
NULL);
sme_debug("Number of Handoff candidates: %d",
csr_ll_count(&ngbr_roam_info->roamableAPList));
}
if (!bss_node)
return false;
qdf_mem_copy(hand_off_node, bss_node, sizeof(tCsrNeighborRoamBSSInfo));
return true;
}
bool csr_neighbor_roam_is_handoff_in_progress(struct mac_context *mac,
uint8_t sessionId)
{
if (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING ==
mac->roam.neighborRoamInfo[sessionId].neighborRoamState)
return true;
return false;
}
void csr_neighbor_roam_free_neighbor_roam_bss_node(struct mac_context *mac,
tpCsrNeighborRoamBSSInfo
neighborRoamBSSNode)
{
if (!neighborRoamBSSNode)
return;
if (neighborRoamBSSNode->pBssDescription) {
qdf_mem_free(neighborRoamBSSNode->pBssDescription);
neighborRoamBSSNode->pBssDescription = NULL;
}
qdf_mem_free(neighborRoamBSSNode);
neighborRoamBSSNode = NULL;
}
#endif

View File

@@ -44,29 +44,10 @@
extern uint8_t csr_wpa_oui[][CSR_WPA_OUI_SIZE];
bool csr_is_supported_channel(struct mac_context *mac, uint32_t chan_freq);
#ifndef FEATURE_CM_ENABLE
enum csr_scancomplete_nextcommand {
eCsrNextScanNothing,
eCsrNexteScanForSsidSuccess,
eCsrNexteScanForSsidFailure,
eCsrNextCheckAllowConc,
};
#endif
enum csr_roamcomplete_result {
#ifndef FEATURE_CM_ENABLE
eCsrJoinSuccess,
#endif
eCsrJoinFailure,
eCsrReassocSuccess,
eCsrReassocFailure,
eCsrNothingToJoin,
eCsrStartBssSuccess,
eCsrStartBssFailure,
#ifndef FEATURE_CM_ENABLE
eCsrSilentlyStopRoamingSaveState,
#endif
eCsrJoinFailureDueToConcurrency,
eCsrStopBssSuccess,
eCsrStopBssFailure,
};
@@ -116,17 +97,6 @@ struct scan_result_list {
(eCSR_ENCRYPT_TYPE_WEP40 != (encType)) && \
(eCSR_ENCRYPT_TYPE_WEP104 != (encType)))
#ifndef FEATURE_CM_ENABLE
#define CSR_IS_DISCONNECT_COMMAND(pCommand) ((eSmeCommandRoam == \
(pCommand)->command) && \
((eCsrForcedDisassoc == (pCommand)->u.roamCmd.roamReason) || \
(eCsrForcedDeauth == (pCommand)->u.roamCmd.roamReason) || \
(eCsrSmeIssuedDisassocForHandoff == \
(pCommand)->u.roamCmd.roamReason) || \
(eCsrForcedDisassocMICFailure == \
(pCommand)->u.roamCmd.roamReason)))
#endif
enum csr_roam_state csr_roam_state_change(struct mac_context *mac,
enum csr_roam_state NewRoamState,
uint8_t sessionId);
@@ -134,13 +104,6 @@ void csr_roaming_state_msg_processor(struct mac_context *mac, void *msg_buf);
void csr_roam_joined_state_msg_processor(struct mac_context *mac,
void *msg_buf);
#ifndef FEATURE_CM_ENABLE
void csr_scan_callback(struct wlan_objmgr_vdev *vdev,
struct scan_event *event, void *arg);
QDF_STATUS csr_roam_save_connected_bss_desc(struct mac_context *mac,
uint32_t sessionId,
struct bss_description *bss_desc);
#endif
void csr_release_command_roam(struct mac_context *mac, tSmeCmd *pCommand);
void csr_release_command_wm_status_change(struct mac_context *mac,
tSmeCmd *pCommand);
@@ -152,28 +115,6 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
QDF_STATUS csr_scan_open(struct mac_context *mac);
QDF_STATUS csr_scan_close(struct mac_context *mac);
#ifndef FEATURE_CM_ENABLE
bool
csr_scan_append_bss_description(struct mac_context *mac,
struct bss_description *pSirBssDescription);
QDF_STATUS csr_scan_for_ssid(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile, uint32_t roamId,
bool notify);
/**
* csr_scan_abort_mac_scan() - Generic API to abort scan request
* @mac: pointer to pmac
* @vdev_id: pdev id
* @scan_id: scan id
*
* Generic API to abort scans
*
* Return: 0 for success, non zero for failure
*/
QDF_STATUS csr_scan_abort_mac_scan(struct mac_context *mac, uint32_t vdev_id,
uint32_t scan_id);
#endif
void csr_free_scan_result_entry(struct mac_context *mac, struct tag_csrscan_result
*pResult);
@@ -186,13 +127,6 @@ QDF_STATUS csr_roam_issue_connect(struct mac_context *mac, uint32_t sessionId,
tScanResultHandle hBSSList,
enum csr_roam_reason reason, uint32_t roamId,
bool fImediate, bool fClearScan);
#ifndef FEATURE_CM_ENABLE
QDF_STATUS csr_roam_issue_reassoc(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
tCsrRoamModifyProfileFields *pModProfileFields,
enum csr_roam_reason reason, uint32_t roamId,
bool fImediate);
#endif
void csr_roam_complete(struct mac_context *mac, enum csr_roamcomplete_result Result,
void *Context, uint8_t session_id);
@@ -220,12 +154,6 @@ csr_issue_set_context_req_helper(struct mac_context *mac,
bool unicast, tAniKeyDirection key_direction,
uint8_t key_id, uint16_t key_length,
uint8_t *key);
/* This is temp ifdef will be removed in near future */
#ifndef FEATURE_CM_ENABLE
QDF_STATUS csr_roam_process_disassoc_deauth(struct mac_context *mac,
tSmeCmd *pCommand,
bool fDisassoc, bool fMICFailure);
#endif
QDF_STATUS
csr_roam_save_connected_information(struct mac_context *mac,
uint32_t sessionId,
@@ -243,31 +171,11 @@ QDF_STATUS csr_roam_issue_start_bss(struct mac_context *mac, uint32_t sessionId,
uint32_t roamId);
QDF_STATUS csr_roam_issue_stop_bss(struct mac_context *mac, uint32_t sessionId,
enum csr_roam_substate NewSubstate);
#ifndef FEATURE_CM_ENABLE
bool csr_is_roam_command_waiting_for_session(struct mac_context *mac,
uint32_t sessionId);
eRoamCmdStatus csr_get_roam_complete_status(struct mac_context *mac,
uint32_t sessionId);
#endif
/* pBand can be NULL if caller doesn't need to get it */
QDF_STATUS csr_roam_issue_disassociate_cmd(struct mac_context *mac,
uint32_t sessionId,
eCsrRoamDisconnectReason reason,
enum wlan_reason_code mac_reason);
#ifndef FEATURE_CM_ENABLE
/* pCommand may be NULL */
void csr_roam_remove_duplicate_command(struct mac_context *mac, uint32_t sessionId,
tSmeCmd *pCommand,
enum csr_roam_reason eRoamReason);
bool csr_is_same_profile(struct mac_context *mac, tCsrRoamConnectedProfile
*pProfile1, struct csr_roam_profile *pProfile2,
uint8_t vdev_id);
QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
struct bss_description *pBssDescription,
struct csr_roam_profile *pProfile,
tDot11fBeaconIEs *pIes, uint16_t messageType);
#endif
QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac, uint32_t sessionId,
tSirMacAddr bssId, uint16_t reasonCode);
QDF_STATUS csr_send_mb_deauth_req_msg(struct mac_context *mac, uint32_t sessionId,
@@ -318,9 +226,6 @@ int8_t csr_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq);
/* To free the last roaming profile */
void csr_free_roam_profile(struct mac_context *mac, uint32_t sessionId);
#ifndef FEATURE_CM_ENABLE
void csr_free_connect_bss_desc(struct mac_context *mac, uint32_t sessionId);
#endif
/* to free memory allocated inside the profile structure */
void csr_release_profile(struct mac_context *mac,
@@ -338,16 +243,6 @@ void csr_apply_channel_power_info_to_fw(struct mac_context *mac,
struct csr_channel *pChannelList,
uint8_t *countryCode);
void csr_apply_power2_current(struct mac_context *mac);
#ifndef FEATURE_CM_ENABLE
/* return a bool to indicate whether roaming completed or continue. */
bool csr_roam_complete_roaming(struct mac_context *mac, uint32_t sessionId,
bool fForce, eCsrRoamResult roamResult);
void csr_roam_completion(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_info *roam_info, tSmeCmd *pCommand,
eCsrRoamResult roamResult, bool fSuccess);
void csr_roam_cancel_roaming(struct mac_context *mac, uint32_t sessionId);
#endif
void csr_apply_channel_power_info_wrapper(struct mac_context *mac);
QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
uint32_t tableSize,
@@ -382,63 +277,6 @@ QDF_STATUS csr_roam_get_session_id_from_bssid(struct mac_context *mac,
enum csr_cfgdot11mode csr_find_best_phy_mode(struct mac_context *mac,
uint32_t phyMode);
#ifndef FEATURE_CM_ENABLE
/*
* csr_copy_ssids_from_roam_params() - copy SSID from roam_params to scan filter
* @rso_usr_cfg: rso user config
* @filter: scan filter
*
* Return void
*/
void csr_copy_ssids_from_roam_params(struct rso_config_params *rso_usr_cfg,
struct scan_filter *filter);
/*
* csr_update_scan_filter_dot11mode() - update dot11mode for scan filter
* @mac_ctx: csr auth type
* @filter: scan filter
*
* Return void
*/
void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
struct scan_filter *filter);
/**
* csr_roam_get_scan_filter_from_profile() - prepare scan filter from
* given roam profile
* @mac: Pointer to Global MAC structure
* @profile: roam profile
* @filter: Populated scan filter based on the connected profile
* @is_roam: if filter is for roam
* @vdev_id: vdev
*
* This function creates a scan filter based on the roam profile. Based on this
* filter, scan results are obtained.
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE otherwise
*/
QDF_STATUS
csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
struct csr_roam_profile *profile,
struct scan_filter *filter,
bool is_roam, uint8_t vdev_id);
/**
* csr_neighbor_roam_get_scan_filter_from_profile() - prepare scan filter from
* connected profile
* @mac: Pointer to Global MAC structure
* @filter: Populated scan filter based on the connected profile
* @vdev_id: Session ID
*
* This function creates a scan filter based on the currently
* connected profile. Based on this filter, scan results are obtained
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE otherwise
*/
QDF_STATUS
csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
struct scan_filter *filter,
uint8_t vdev_id);
#endif
/*
* csr_scan_get_result() - Return scan results based on filter
* @mac: Pointer to Global MAC structure
@@ -525,11 +363,6 @@ tSmeCmd *csr_get_command_buffer(struct mac_context *mac);
void csr_release_command(struct mac_context *mac, tSmeCmd *pCommand);
void csr_release_command_buffer(struct mac_context *mac, tSmeCmd *pCommand);
#ifndef FEATURE_CM_ENABLE
#ifdef FEATURE_WLAN_WAPI
bool csr_is_profile_wapi(struct csr_roam_profile *pProfile);
#endif /* FEATURE_WLAN_WAPI */
#endif
/**
* csr_get_vdev_type_nss() - gets the nss value based on vdev type
* @dev_mode: current device operating mode.
@@ -609,47 +442,6 @@ QDF_STATUS csr_scan_result_purge(struct mac_context *mac,
/* /////////////////////////////////////////Common Scan ends */
#ifndef FEATURE_CM_ENABLE
/*
* csr_connect_security_valid_for_6ghz() - check if profile is vlid fro 6Ghz
* @psoc: psoc pointer
* @vdev_id: vdev id
* @profile: connect profile
*
* Return bool
*/
#ifdef CONFIG_BAND_6GHZ
bool csr_connect_security_valid_for_6ghz(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct csr_roam_profile *profile);
#else
static inline bool
csr_connect_security_valid_for_6ghz(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct csr_roam_profile *profile)
{
return true;
}
#endif
/*
* csr_roam_reassoc() -
* To inititiate a re-association
* pProfile - can be NULL to join the currently connected AP. In that
* case modProfileFields should carry the modified field(s) which could trigger
* reassoc
* modProfileFields - fields which are part of tCsrRoamConnectedProfile
* that might need modification dynamically once STA is up & running and this
* could trigger a reassoc
* pRoamId - to get back the request ID
* Return QDF_STATUS
*/
QDF_STATUS csr_roam_reassoc(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
tCsrRoamModifyProfileFields modProfileFields,
uint32_t *pRoamId);
#endif
/*
* csr_roam_connect() -
* To inititiate an association
@@ -692,21 +484,6 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint8_t vdev_id,
bool update_to_fw);
#endif
#ifndef FEATURE_CM_ENABLE
/*
* csr_roam_get_wpa_rsn_req_ie() -
* Return the WPA or RSN IE CSR passes to PE to JOIN request or START_BSS
* request
* pLen - caller allocated memory that has the length of pBuf as input.
* Upon returned, *pLen has the needed or IE length in pBuf.
* pBuf - Caller allocated memory that contain the IE field, if any, upon return
* Return QDF_STATUS - when fail, it usually means the buffer allocated is not
* big enough
*/
QDF_STATUS csr_roam_get_wpa_rsn_req_ie(struct mac_context *mac, uint32_t sessionId,
uint32_t *pLen, uint8_t *pBuf);
#endif
void csr_roam_free_connect_profile(tCsrRoamConnectedProfile *profile);
/*
@@ -739,13 +516,6 @@ QDF_STATUS csr_roam_disconnect(struct mac_context *mac, uint32_t session_id,
QDF_STATUS csr_roam_issue_stop_bss_cmd(struct mac_context *mac, uint32_t sessionId,
bool fHighPriority);
#ifndef FEATURE_CM_ENABLE
void csr_call_roaming_completion_callback(struct mac_context *mac,
struct csr_roam_session *pSession,
struct csr_roam_info *roam_info,
uint32_t roamId,
eCsrRoamResult roamResult);
#endif
/**
* csr_roam_issue_disassociate_sta_cmd() - disassociate a associated station
* @mac: Pointer to global structure for MAC
@@ -784,25 +554,6 @@ QDF_STATUS csr_roam_issue_deauth_sta_cmd(struct mac_context *mac,
QDF_STATUS
csr_send_chng_mcc_beacon_interval(struct mac_context *mac, uint32_t sessionId);
#ifndef FEATURE_CM_ENABLE
/**
* csr_roam_ft_pre_auth_rsp_processor() - Handle the preauth response
* @mac_ctx: Global MAC context
* @preauth_rsp: Received preauthentication response
*
* Return: None
*/
#ifdef WLAN_FEATURE_HOST_ROAM
void csr_roam_ft_pre_auth_rsp_processor(struct mac_context *mac_ctx,
tpSirFTPreAuthRsp pFTPreAuthRsp);
#else
static inline
void csr_roam_ft_pre_auth_rsp_processor(struct mac_context *mac_ctx,
tpSirFTPreAuthRsp pFTPreAuthRsp)
{}
#endif
#endif
#ifdef FEATURE_WLAN_ESE
void csr_update_prev_ap_info(struct csr_roam_session *session,
struct wlan_objmgr_vdev *vdev);
@@ -812,22 +563,6 @@ static inline void csr_update_prev_ap_info(struct csr_roam_session *session,
struct wlan_objmgr_vdev *vdev) {}
#endif
#ifndef FEATURE_CM_ENABLE
QDF_STATUS csr_roam_enqueue_preauth(struct mac_context *mac, uint32_t sessionId,
struct bss_description *pBssDescription,
enum csr_roam_reason reason,
bool fImmediate);
QDF_STATUS csr_dequeue_roam_command(struct mac_context *mac,
enum csr_roam_reason reason,
uint8_t session_id);
QDF_STATUS csr_scan_create_entry_in_scan_cache(struct mac_context *mac,
uint32_t sessionId,
struct qdf_mac_addr bssid,
uint32_t ch_freq);
#endif
QDF_STATUS csr_update_channel_list(struct mac_context *mac);
#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
@@ -875,26 +610,9 @@ QDF_STATUS csr_sta_continue_csa(struct mac_context *mac_ctx,
QDF_STATUS csr_set_ht2040_mode(struct mac_context *mac, uint32_t sessionId,
ePhyChanBondState cbMode, bool obssEnabled);
#endif
#ifndef FEATURE_CM_ENABLE
QDF_STATUS csr_scan_handle_search_for_ssid(struct mac_context *mac_ctx,
uint32_t session_id);
QDF_STATUS csr_scan_handle_search_for_ssid_failure(struct mac_context *mac,
uint32_t session_id);
void csr_saved_scan_cmd_free_fields(struct mac_context *mac_ctx,
struct csr_roam_session *session);
#endif
struct bss_description*
csr_get_fst_bssdescr_ptr(tScanResultHandle result_handle);
#ifndef FEATURE_CM_ENABLE
struct bss_description*
csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
struct bss_description *bss_descr);
bool is_disconnect_pending(struct mac_context *mac_ctx,
uint8_t sessionid);
#endif
QDF_STATUS
csr_roam_prepare_bss_config_from_profile(struct mac_context *mac_ctx,
struct csr_roam_profile *profile,
@@ -931,24 +649,6 @@ csr_roam_set_bss_config_cfg(struct mac_context *mac_ctx, uint32_t session_id,
void csr_prune_channel_list_for_mode(struct mac_context *mac,
struct csr_channel *pChannelList);
#ifndef FEATURE_CM_ENABLE
/**
* csr_lookup_fils_pmkid - Lookup FILS PMKID using ssid and cache id
* @mac: Pointer to mac context
* @vdev_id: vdev id
* @cache_id: FILS cache id
* @ssid: SSID pointer
* @ssid_len: SSID length
* @bssid: Pointer to the BSSID to lookup
*
* Return: True if lookup is successful
*/
bool csr_lookup_fils_pmkid(struct mac_context *mac, uint8_t vdev_id,
uint8_t *cache_id, uint8_t *ssid,
uint8_t ssid_len, struct qdf_mac_addr *bssid);
#endif
/**
* csr_is_pmkid_found_for_peer() - check if pmkid sent by peer is present
in PMK cache. Used in SAP mode.
@@ -992,52 +692,6 @@ static inline void csr_update_session_he_cap(struct mac_context *mac_ctx,
}
#endif
#ifndef FEATURE_CM_ENABLE
/**
* csr_get_channel_for_hw_mode_change() - This function to find
* out if HW mode change
* is needed for any of
* the candidate AP which
* STA could join
* @mac_ctx: mac context
* @result_handle: an object for the result.
* @session_id: STA session ID
*
* This function is written to find out for any bss from scan
* handle a HW mode change to DBS will be needed or not.
*
* Return: AP channel freq for which DBS HW mode will be needed. 0
* means no HW mode change is needed.
*/
uint32_t
csr_get_channel_for_hw_mode_change(struct mac_context *mac_ctx,
tScanResultHandle result_handle,
uint32_t session_id);
/**
* csr_scan_get_channel_for_hw_mode_change() - This function to find
* out if HW mode change
* is needed for any of
* the candidate AP which
* STA could join
* @mac_ctx: mac context
* @session_id: STA session ID
* @profile: profile
*
* This function is written to find out for any bss from scan
* handle a HW mode change to DBS will be needed or not.
* If there is no candidate AP which requires DBS, this function will return
* the first Candidate AP's chan.
*
* Return: AP channel freq for which HW mode change will be needed. 0
* means no candidate AP to connect.
*/
uint32_t
csr_scan_get_channel_for_hw_mode_change(
struct mac_context *mac_ctx, uint32_t session_id,
struct csr_roam_profile *profile);
#endif
/**
* csr_setup_vdev_session() - API to setup vdev mac session
* @vdev_mlme: vdev mlme private object

View File

@@ -1,813 +0,0 @@
/*
* Copyright (c) 2016-2021, 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.
*/
/**
* DOC: csr_roam_preauth.c
*
* Host based roaming preauthentication implementation
*/
#ifndef FEATURE_CM_ENABLE
#include "wma_types.h"
#include "csr_inside_api.h"
#include "sme_qos_internal.h"
#include "sme_inside.h"
#include "host_diag_core_event.h"
#include "host_diag_core_log.h"
#include "csr_api.h"
#include "sme_api.h"
#include "csr_neighbor_roam.h"
#include "mac_trace.h"
#include "wlan_policy_mgr_api.h"
#include "sir_api.h"
static QDF_STATUS csr_neighbor_roam_add_preauth_fail(struct mac_context *mac_ctx,
uint8_t session_id, tSirMacAddr bssid);
/**
* csr_neighbor_roam_state_preauth_done() - Check if state is preauth done
* @mac_ctx: Global MAC context
* @session_id: SME session ID
*
* Return: True if the state id preauth done, false otherwise
*/
bool csr_neighbor_roam_state_preauth_done(struct mac_context *mac_ctx,
uint8_t session_id)
{
return mac_ctx->roam.neighborRoamInfo[session_id].neighborRoamState ==
eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE;
}
/**
* csr_neighbor_roam_tranistion_preauth_done_to_disconnected() - Transition
* the state from preauth done to disconnected
* @mac_ctx: Global MAC Context
* @session_id: SME Session ID
*
* In the event that we are associated with AP1 and we have
* completed pre auth with AP2. Then we receive a deauth/disassoc from AP1.
* At this point neighbor roam is in pre auth done state, pre auth timer
* is running. We now handle this case by stopping timer and clearing
* the pre-auth state. We basically clear up and just go to disconnected
* state
*
* Return: None
*/
void csr_neighbor_roam_tranistion_preauth_done_to_disconnected(
struct mac_context *mac_ctx, uint8_t session_id)
{
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&mac_ctx->roam.neighborRoamInfo[session_id];
struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
if (!session) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("session is NULL"));
return;
}
if (pNeighborRoamInfo->neighborRoamState !=
eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE)
return;
qdf_mc_timer_stop(&session->ftSmeContext.preAuthReassocIntvlTimer);
csr_neighbor_roam_state_transition(mac_ctx,
eCSR_NEIGHBOR_ROAM_STATE_INIT, session_id);
pNeighborRoamInfo->uOsRequestedHandoff = 0;
}
/**
* csr_roam_enqueue_preauth() - Put the preauth command in the queue
* @mac_ctx: Global MAC Context
* @session_id: SME Session ID
* @bss_desc: BSS descriptor
* @reason: roaming reason
* @immediate: High priority in the queue or not
*
* Return: Success if queued properly, false otherwise.
*/
QDF_STATUS csr_roam_enqueue_preauth(struct mac_context *mac_ctx,
uint32_t session_id,
struct bss_description *bss_desc,
enum csr_roam_reason reason, bool immediate)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tSmeCmd *command;
command = csr_get_command_buffer(mac_ctx);
if (!command) {
sme_err("fail to get command buffer");
status = QDF_STATUS_E_RESOURCES;
} else {
if (bss_desc) {
command->command = eSmeCommandRoam;
command->vdev_id = (uint8_t) session_id;
command->u.roamCmd.roamReason = reason;
command->u.roamCmd.pLastRoamBss = bss_desc;
status = csr_queue_sme_command(mac_ctx, command,
immediate);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err("fail to queue preauth,status: %d",
status);
}
} else {
status = QDF_STATUS_E_RESOURCES;
}
}
return status;
}
/**
* csr_neighbor_roam_purge_preauth_failed_list() - Purge the preauth fail list
* @mac_ctx: Global MAC Context
*
* Return: None
*/
void csr_neighbor_roam_purge_preauth_failed_list(struct mac_context *mac_ctx)
{
uint8_t i;
uint8_t j;
uint8_t num_mac_addr;
tpCsrNeighborRoamControlInfo neigh_roam_info = NULL;
tpCsrPreauthFailListInfo fail_list;
for (j = 0; j < WLAN_MAX_VDEVS; j++) {
neigh_roam_info = &mac_ctx->roam.neighborRoamInfo[j];
fail_list = &neigh_roam_info->FTRoamInfo.preAuthFailList;
num_mac_addr = fail_list->numMACAddress;
for (i = 0; i < num_mac_addr; i++)
qdf_mem_zero(fail_list->macAddress[i],
sizeof(tSirMacAddr));
fail_list->numMACAddress = 0;
}
}
/**
* @csr_neighbor_roam_reset_preauth_control_info - Reset preauth info
* @mac_ctx: Global MAC Context
* @session_id: SME Session ID
*
* Return: None
*/
void csr_neighbor_roam_reset_preauth_control_info(struct mac_context *mac_ctx,
uint8_t session_id)
{
struct cm_roam_values_copy src_cfg;
tpCsrNeighborRoamControlInfo neigh_roam_info =
&mac_ctx->roam.neighborRoamInfo[session_id];
src_cfg.bool_value = false;
wlan_cm_roam_cfg_set_value(mac_ctx->psoc, session_id,
IS_11R_CONNECTION, &src_cfg);
csr_neighbor_roam_purge_preauth_failed_list(mac_ctx);
neigh_roam_info->FTRoamInfo.preauthRspPending = false;
neigh_roam_info->FTRoamInfo.numPreAuthRetries = 0;
neigh_roam_info->FTRoamInfo.currentNeighborRptRetryNum = 0;
neigh_roam_info->FTRoamInfo.neighborRptPending = false;
neigh_roam_info->uOsRequestedHandoff = 0;
qdf_mem_zero(&neigh_roam_info->handoffReqInfo,
sizeof(tCsrHandoffRequest));
}
/**
* csr_neighbor_roam_preauth_rsp_handler() - handle preauth response
* @mac_ctx: The handle returned by mac_open.
* @session_id: SME session
* @lim_status: QDF_STATUS_SUCCESS/QDF_STATUS_E_FAILURE/QDF_STATUS_E_NOSPC/
* eSIT_LIM_AUTH_RSP_TIMEOUT status from PE
*
* This function handle the Preauth response from PE
* Every preauth is allowed max 3 tries if it fails. If a bssid failed
* for more than MAX_TRIES, we will remove it from the list and try
* with the next node in the roamable AP list and add the BSSID to
* pre-auth failed list. If no more entries present in roamable AP list,
* transition to REPORT_SCAN state.
*
* Return: QDF_STATUS_SUCCESS on success (i.e. pre-auth processed),
* QDF_STATUS_E_FAILURE otherwise
*/
QDF_STATUS csr_neighbor_roam_preauth_rsp_handler(struct mac_context *mac_ctx,
uint8_t session_id,
QDF_STATUS lim_status)
{
tpCsrNeighborRoamControlInfo neighbor_roam_info =
&mac_ctx->roam.neighborRoamInfo[session_id];
QDF_STATUS status = QDF_STATUS_SUCCESS;
QDF_STATUS preauth_processed = QDF_STATUS_SUCCESS;
tpCsrNeighborRoamBSSInfo preauth_rsp_node = NULL;
uint8_t reason;
if (false == neighbor_roam_info->FTRoamInfo.preauthRspPending) {
/*
* This can happen when we disconnect immediately
* after sending a pre-auth request. During processing
* of the disconnect command, we would have reset
* preauthRspPending and transitioned to INIT state.
*/
sme_warn("Unexpected pre-auth response in state %d",
neighbor_roam_info->neighborRoamState);
preauth_processed = QDF_STATUS_E_FAILURE;
goto DEQ_PREAUTH;
}
/* We can receive it in these 2 states. */
if ((neighbor_roam_info->neighborRoamState !=
eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING)) {
sme_debug("Preauth response received in state %s",
mac_trace_get_neighbour_roam_state
(neighbor_roam_info->neighborRoamState));
preauth_processed = QDF_STATUS_E_FAILURE;
goto DEQ_PREAUTH;
}
neighbor_roam_info->FTRoamInfo.preauthRspPending = false;
if (QDF_STATUS_SUCCESS == lim_status)
preauth_rsp_node =
csr_neighbor_roam_next_roamable_ap(
mac_ctx, &neighbor_roam_info->roamableAPList,
NULL);
if ((QDF_STATUS_SUCCESS == lim_status) && (preauth_rsp_node)) {
sme_debug("Preauth completed successfully after %d tries",
neighbor_roam_info->FTRoamInfo.numPreAuthRetries);
sme_debug("After Pre-Auth: BSSID " QDF_MAC_ADDR_FMT ", ChFq:%d",
QDF_MAC_ADDR_REF(
preauth_rsp_node->pBssDescription->bssId),
preauth_rsp_node->pBssDescription->chan_freq);
csr_neighbor_roam_send_lfr_metric_event(mac_ctx, session_id,
preauth_rsp_node->pBssDescription->bssId,
eCSR_ROAM_PREAUTH_STATUS_SUCCESS);
/*
* Preauth completed successfully. Insert the preauthenticated
* node to tail of preAuthDoneList.
*/
csr_neighbor_roam_remove_roamable_ap_list_entry(mac_ctx,
&neighbor_roam_info->roamableAPList,
preauth_rsp_node);
csr_ll_insert_tail(
&neighbor_roam_info->FTRoamInfo.preAuthDoneList,
&preauth_rsp_node->List, LL_ACCESS_LOCK);
csr_neighbor_roam_state_transition(mac_ctx,
eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE, session_id);
neighbor_roam_info->FTRoamInfo.numPreAuthRetries = 0;
/*
* The caller of this function would start a timer and by
* the time it expires, supplicant should have provided
* the updated FTIEs to SME. So, when it expires, handoff
* will be triggered then.
*/
} else {
tpCsrNeighborRoamBSSInfo neighbor_bss_node = NULL;
tListElem *entry;
bool is_dis_pending = false;
sme_err("Preauth failed retry number %d, status: 0x%x",
neighbor_roam_info->FTRoamInfo.numPreAuthRetries,
lim_status);
/*
* Preauth failed. Add the bssId to the preAuth failed list
* of MAC Address. Also remove the AP from roamable AP list.
*/
if ((neighbor_roam_info->FTRoamInfo.numPreAuthRetries >=
CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES) ||
(QDF_STATUS_E_NOSPC == lim_status)) {
/*
* We are going to remove the node as it fails for
* more than MAX tries. Reset this count to 0
*/
neighbor_roam_info->FTRoamInfo.numPreAuthRetries = 0;
/*
* The one in the head of the list should be one with
* which we issued pre-auth and failed
*/
entry = csr_ll_remove_head(
&neighbor_roam_info->roamableAPList,
LL_ACCESS_LOCK);
if (!entry) {
sme_err("Preauth list is empty");
goto NEXT_PREAUTH;
}
neighbor_bss_node = GET_BASE_ADDR(entry,
tCsrNeighborRoamBSSInfo,
List);
/*
* Add the BSSID to pre-auth fail list if
* it is not requested by HDD
*/
if (!neighbor_roam_info->uOsRequestedHandoff)
status =
csr_neighbor_roam_add_preauth_fail(
mac_ctx, session_id,
neighbor_bss_node->
pBssDescription->bssId);
csr_neighbor_roam_send_lfr_metric_event(mac_ctx,
session_id,
neighbor_bss_node->pBssDescription->bssId,
eCSR_ROAM_PREAUTH_STATUS_FAILURE);
/* Now we can free this node */
csr_neighbor_roam_free_neighbor_roam_bss_node(
mac_ctx, neighbor_bss_node);
}
NEXT_PREAUTH:
is_dis_pending = is_disconnect_pending(mac_ctx, session_id);
if (is_dis_pending) {
sme_err("Disconnect in progress, Abort preauth");
goto ABORT_PREAUTH;
}
/* Issue preauth request for the same/next entry */
if (QDF_STATUS_SUCCESS == csr_neighbor_roam_issue_preauth_req(
mac_ctx, session_id))
goto DEQ_PREAUTH;
ABORT_PREAUTH:
if (csr_roam_is_roam_offload_scan_enabled(mac_ctx)) {
reason = REASON_PREAUTH_FAILED_FOR_ALL;
if (neighbor_roam_info->uOsRequestedHandoff) {
neighbor_roam_info->uOsRequestedHandoff = 0;
wlan_cm_roam_state_change(mac_ctx->pdev,
session_id,
WLAN_ROAM_RSO_ENABLED,
reason);
} else {
/* ROAM_SCAN_OFFLOAD_RESTART is a
* special command to trigger bmiss
* handler internally for LFR2 all candidate
* preauth failure.
* This should be decoupled from RSO.
*/
wlan_cm_roam_send_rso_cmd(mac_ctx->psoc,
session_id,
ROAM_SCAN_OFFLOAD_RESTART,
reason);
}
csr_neighbor_roam_state_transition(mac_ctx,
eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, session_id);
}
}
DEQ_PREAUTH:
csr_dequeue_roam_command(mac_ctx, eCsrPerformPreauth, session_id);
return preauth_processed;
}
/**
* csr_neighbor_roam_add_preauth_fail() - add bssid to preauth failed list
* @mac_ctx: The handle returned by mac_open.
* @bssid: BSSID to be added to the preauth fail list
*
* This function adds the given BSSID to the Preauth fail list
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE otherwise
*/
static QDF_STATUS csr_neighbor_roam_add_preauth_fail(struct mac_context *mac_ctx,
uint8_t session_id, tSirMacAddr bssid)
{
uint8_t i = 0;
tpCsrNeighborRoamControlInfo neighbor_roam_info =
&mac_ctx->roam.neighborRoamInfo[session_id];
uint8_t num_mac_addr = neighbor_roam_info->FTRoamInfo.preAuthFailList.
numMACAddress;
sme_warn("Added BSSID " QDF_MAC_ADDR_FMT " to Preauth failed list",
QDF_MAC_ADDR_REF(bssid));
for (i = 0;
i < neighbor_roam_info->FTRoamInfo.preAuthFailList.numMACAddress;
i++) {
if (!qdf_mem_cmp(
neighbor_roam_info->FTRoamInfo.preAuthFailList.macAddress[i],
bssid, sizeof(tSirMacAddr))) {
sme_warn("BSSID "QDF_MAC_ADDR_FMT" already fail list",
QDF_MAC_ADDR_REF(bssid));
return QDF_STATUS_SUCCESS;
}
}
if ((num_mac_addr + 1) > MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS) {
sme_err("Cannot add, preauth fail list is full");
return QDF_STATUS_E_FAILURE;
}
qdf_mem_copy(neighbor_roam_info->FTRoamInfo.preAuthFailList.
macAddress[num_mac_addr], bssid, sizeof(tSirMacAddr));
neighbor_roam_info->FTRoamInfo.preAuthFailList.numMACAddress++;
return QDF_STATUS_SUCCESS;
}
/**
* csr_neighbor_roam_is_preauth_candidate()
*
* @mac_ctx: Pointer to Global MAC structure
* @bssId : BSSID of the candidate
*
* This function checks whether the given MAC address is already present
* in the preauth fail list and returns true/false accordingly
*
* Return: true if preauth candidate, false otherwise
*/
bool csr_neighbor_roam_is_preauth_candidate(struct mac_context *mac,
uint8_t sessionId, tSirMacAddr bssId)
{
uint8_t i = 0;
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&mac->roam.neighborRoamInfo[sessionId];
if (csr_roam_is_roam_offload_scan_enabled(mac))
return true;
if (0 == pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress)
return true;
for (i = 0;
i < pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress;
i++) {
if (!qdf_mem_cmp(pNeighborRoamInfo->FTRoamInfo.
preAuthFailList.macAddress[i], bssId,
sizeof(tSirMacAddr))) {
sme_err("BSSID exists in fail list" QDF_MAC_ADDR_FMT,
QDF_MAC_ADDR_REF(bssId));
return false;
}
}
return true;
}
/**
* csr_get_dot11_mode() - Derives dot11mode
* @mac_ctx: Global MAC context
* @session_id: SME Session ID
* @bss_desc: BSS descriptor
*
* Return: dot11mode
*/
static uint32_t csr_get_dot11_mode(struct mac_context *mac_ctx,
uint32_t session_id,
struct bss_description *bss_desc)
{
struct csr_roam_session *csr_session = CSR_GET_SESSION(mac_ctx,
session_id);
enum csr_cfgdot11mode ucfg_dot11_mode, cfg_dot11_mode;
QDF_STATUS status;
tDot11fBeaconIEs *ies_local = NULL;
uint32_t dot11mode = 0;
if (!csr_session) {
sme_err("Invalid session id %d", session_id);
return 0;
}
sme_debug("phyMode %d", csr_session->pCurRoamProfile->phyMode);
/* Get IE's */
status = csr_get_parsed_bss_description_ies(mac_ctx, bss_desc,
&ies_local);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err("csr_get_parsed_bss_description_ies failed");
return 0;
}
if (!ies_local) {
sme_err("ies_local is NULL");
return 0;
}
if (csr_is_phy_mode_match(mac_ctx,
csr_session->pCurRoamProfile->phyMode,
bss_desc, csr_session->pCurRoamProfile,
&cfg_dot11_mode, ies_local))
ucfg_dot11_mode = cfg_dot11_mode;
else {
sme_err("Can not find match phy mode");
if (WLAN_REG_IS_5GHZ_CH_FREQ(bss_desc->chan_freq))
ucfg_dot11_mode = eCSR_CFG_DOT11_MODE_11A;
else
ucfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G;
}
/* dot11mode */
dot11mode = csr_translate_to_wni_cfg_dot11_mode(mac_ctx,
ucfg_dot11_mode);
sme_debug("dot11mode %d ucfg_dot11_mode %d",
dot11mode, ucfg_dot11_mode);
if (bss_desc->chan_freq <= CDS_CHAN_14_FREQ &&
!mac_ctx->mlme_cfg->vht_caps.vht_cap_info.b24ghz_band &&
MLME_DOT11_MODE_11AC == dot11mode) {
/* Need to disable VHT operation in 2.4 GHz band */
dot11mode = MLME_DOT11_MODE_11N;
}
qdf_mem_free(ies_local);
return dot11mode;
}
QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
uint32_t vdev_id,
struct bss_description *bss_desc)
{
tpSirFTPreAuthReq preauth_req;
uint16_t auth_req_len;
struct bss_description *buf;
uint32_t dot11mode, buf_len;
QDF_STATUS status;
struct csr_roam_session *csr_session = CSR_GET_SESSION(mac_ctx,
vdev_id);
struct wlan_objmgr_vdev *vdev;
struct mlme_legacy_priv *mlme_priv;
if (!csr_session) {
sme_err("Session does not exist for vdev_id: %d", vdev_id);
return QDF_STATUS_E_FAILURE;
}
dot11mode = csr_get_dot11_mode(mac_ctx, vdev_id, bss_desc);
if (!dot11mode) {
sme_err("dot11mode is zero");
return QDF_STATUS_E_FAILURE;
}
auth_req_len = sizeof(tSirFTPreAuthReq);
preauth_req = qdf_mem_malloc(auth_req_len);
if (!preauth_req)
return QDF_STATUS_E_NOMEM;
buf_len = sizeof(bss_desc->length) + bss_desc->length;
buf = qdf_mem_malloc(buf_len);
if (!buf) {
qdf_mem_free(preauth_req);
return QDF_STATUS_E_NOMEM;
}
vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev, vdev_id,
WLAN_LEGACY_SME_ID);
if (!vdev) {
qdf_mem_free(preauth_req);
qdf_mem_free(buf);
return QDF_STATUS_E_FAILURE;
}
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
qdf_mem_free(preauth_req);
qdf_mem_free(buf);
status = QDF_STATUS_E_FAILURE;
goto end;
}
preauth_req->messageType = eWNI_SME_FT_PRE_AUTH_REQ;
preauth_req->pre_auth_channel_freq = bss_desc->chan_freq;
preauth_req->dot11mode = dot11mode;
wlan_mlme_get_bssid_vdev_id(mac_ctx->pdev, vdev_id,
(struct qdf_mac_addr *)&preauth_req->currbssId);
qdf_mem_copy((void *)&preauth_req->preAuthbssId,
(void *)bss_desc->bssId, sizeof(tSirMacAddr));
qdf_mem_copy((void *)&preauth_req->self_mac_addr,
(void *)&csr_session->self_mac_addr.bytes, sizeof(tSirMacAddr));
if (csr_roam_is11r_assoc(mac_ctx, vdev_id) &&
(mac_ctx->roam.roamSession[vdev_id].connectedProfile.AuthType !=
eCSR_AUTH_TYPE_OPEN_SYSTEM) &&
mlme_priv->connect_info.ft_info.auth_ie_len) {
preauth_req->ft_ies_length =
mlme_priv->connect_info.ft_info.auth_ie_len;
qdf_mem_copy(preauth_req->ft_ies,
mlme_priv->connect_info.ft_info.auth_ft_ie,
mlme_priv->connect_info.ft_info.auth_ie_len);
} else {
preauth_req->ft_ies_length = 0;
}
qdf_mem_copy(buf, bss_desc, buf_len);
preauth_req->pbssDescription = buf;
preauth_req->length = auth_req_len;
status = umac_send_mb_message_to_mac(preauth_req);
if (QDF_IS_STATUS_ERROR(status))
qdf_mem_free(buf);
end:
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return status;
}
void csr_roam_ft_pre_auth_rsp_processor(struct mac_context *mac_ctx,
tpSirFTPreAuthRsp preauth_rsp)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct csr_roam_info *roam_info;
enum csr_akm_type conn_Auth_type;
uint32_t vdev_id = preauth_rsp->vdev_id;
struct csr_roam_session *csr_session = CSR_GET_SESSION(mac_ctx,
vdev_id);
tDot11fAuthentication *p_auth = NULL;
struct wlan_objmgr_vdev *vdev;
struct mlme_legacy_priv *mlme_priv;
if (!csr_session) {
sme_err("CSR session is NULL");
return;
}
status = csr_neighbor_roam_preauth_rsp_handler(mac_ctx,
preauth_rsp->vdev_id, preauth_rsp->status);
if (status != QDF_STATUS_SUCCESS) {
sme_err("Preauth was not processed: %d SessionID: %d",
status, vdev_id);
return;
}
if (QDF_STATUS_SUCCESS != (QDF_STATUS) preauth_rsp->status)
return;
vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev,
preauth_rsp->vdev_id,
WLAN_LEGACY_SME_ID);
if (!vdev)
return;
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv)
goto end;
mlme_priv->connect_info.ft_info.ft_state = FT_REASSOC_REQ_WAIT;
csr_session->ftSmeContext.psavedFTPreAuthRsp = preauth_rsp;
/* No need to notify qos module if this is a non 11r & ESE roam */
if (csr_roam_is11r_assoc(mac_ctx, preauth_rsp->vdev_id)
#ifdef FEATURE_WLAN_ESE
|| csr_roam_is_ese_assoc(mac_ctx, preauth_rsp->vdev_id)
#endif
) {
sme_qos_csr_event_ind(mac_ctx,
preauth_rsp->vdev_id,
SME_QOS_CSR_PREAUTH_SUCCESS_IND, NULL);
}
status =
qdf_mc_timer_start(
&csr_session->ftSmeContext.preAuthReassocIntvlTimer,
60);
if (QDF_STATUS_SUCCESS != status) {
sme_err("PreauthReassocInterval timer failed status %d",
status);
goto end;
}
roam_info = qdf_mem_malloc(sizeof(*roam_info));
if (!roam_info)
goto end;
qdf_mem_copy((void *)&csr_session->ftSmeContext.preAuthbssId,
(void *)preauth_rsp->preAuthbssId,
sizeof(struct qdf_mac_addr));
if (csr_roam_is11r_assoc(mac_ctx, preauth_rsp->vdev_id))
csr_roam_call_callback(mac_ctx, preauth_rsp->vdev_id,
NULL, 0, eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE);
#ifdef FEATURE_WLAN_ESE
if (csr_roam_is_ese_assoc(mac_ctx, preauth_rsp->vdev_id)) {
csr_roam_read_tsf(mac_ctx, (uint8_t *)&roam_info->timestamp,
preauth_rsp->vdev_id);
qdf_mem_copy((void *)&roam_info->bssid,
(void *)preauth_rsp->preAuthbssId,
sizeof(struct qdf_mac_addr));
csr_roam_call_callback(mac_ctx, preauth_rsp->vdev_id,
roam_info, 0,
eCSR_ROAM_CCKM_PREAUTH_NOTIFY, 0);
}
#endif
if (csr_roam_is_fast_roam_enabled(mac_ctx, preauth_rsp->vdev_id)) {
/* Save the bssid from the received response */
qdf_mem_copy((void *)&roam_info->bssid,
(void *)preauth_rsp->preAuthbssId,
sizeof(struct qdf_mac_addr));
csr_roam_call_callback(mac_ctx, preauth_rsp->vdev_id,
roam_info, 0, eCSR_ROAM_PMK_NOTIFY, 0);
}
qdf_mem_free(roam_info);
/* If its an Open Auth, FT IEs are not provided by supplicant */
/* Hence populate them here */
conn_Auth_type =
mac_ctx->roam.roamSession[vdev_id].connectedProfile.AuthType;
/* Done with it, init it. */
csr_session->ftSmeContext.psavedFTPreAuthRsp = NULL;
mlme_priv->connect_info.ft_info.add_mdie = false;
if (csr_roam_is11r_assoc(mac_ctx, preauth_rsp->vdev_id) &&
(conn_Auth_type == eCSR_AUTH_TYPE_OPEN_SYSTEM)) {
uint16_t ft_ies_length;
ft_ies_length = mlme_priv->connect_info.ft_info.ric_ies_length;
qdf_mem_zero(mlme_priv->connect_info.ft_info.reassoc_ft_ie,
MAX_FTIE_SIZE);
mlme_priv->connect_info.ft_info.reassoc_ie_len = 0;
p_auth = (tDot11fAuthentication *) qdf_mem_malloc(
sizeof(tDot11fAuthentication));
if (!p_auth)
goto end;
status = dot11f_unpack_authentication(mac_ctx,
preauth_rsp->ft_ies,
preauth_rsp->ft_ies_length, p_auth, false);
if (DOT11F_FAILED(status))
sme_err("Failed to parse an Authentication frame");
else if (p_auth->MobilityDomain.present)
mlme_priv->connect_info.ft_info.add_mdie = true;
qdf_mem_free(p_auth);
if (!ft_ies_length)
goto end;
/* Copy the RIC IEs to reassoc IEs */
qdf_mem_copy(mlme_priv->connect_info.ft_info.reassoc_ft_ie,
mlme_priv->connect_info.ft_info.ric_ies,
mlme_priv->connect_info.ft_info.ric_ies_length);
mlme_priv->connect_info.ft_info.reassoc_ie_len = ft_ies_length;
mlme_priv->connect_info.ft_info.add_mdie = true;
}
end:
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
}
/**
* csr_neighbor_roam_issue_preauth_req() - Send preauth request to first AP
* @mac_ctx: The handle returned by mac_open.
* @session_id: Session information
*
* This function issues preauth request to PE with the 1st AP entry in the
* roamable AP list
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE otherwise
*/
QDF_STATUS csr_neighbor_roam_issue_preauth_req(struct mac_context *mac_ctx,
uint8_t session_id)
{
tpCsrNeighborRoamControlInfo neighbor_roam_info =
&mac_ctx->roam.neighborRoamInfo[session_id];
QDF_STATUS status = QDF_STATUS_SUCCESS;
tpCsrNeighborRoamBSSInfo neighbor_bss_node;
if (false != neighbor_roam_info->FTRoamInfo.preauthRspPending) {
/* This must not be true here */
QDF_ASSERT(neighbor_roam_info->FTRoamInfo.preauthRspPending ==
false);
return QDF_STATUS_E_FAILURE;
}
/*
* Issue Preauth request to PE here.
* Need to issue the preauth request with the BSSID that is in the
* head of the roamable AP list. Parameters that should be passed are
* BSSID, Channel number and the neighborScanPeriod(probably). If
* roamableAPList gets empty, should transition to REPORT_SCAN state
*/
neighbor_bss_node = csr_neighbor_roam_next_roamable_ap(mac_ctx,
&neighbor_roam_info->roamableAPList, NULL);
if (!neighbor_bss_node) {
sme_err("Roamable AP list is empty");
return QDF_STATUS_E_FAILURE;
}
csr_neighbor_roam_send_lfr_metric_event(mac_ctx, session_id,
neighbor_bss_node->pBssDescription->bssId,
eCSR_ROAM_PREAUTH_INIT_NOTIFY);
status = csr_roam_enqueue_preauth(mac_ctx, session_id,
neighbor_bss_node->pBssDescription,
eCsrPerformPreauth, true);
sme_debug("Before Pre-Auth: BSSID " QDF_MAC_ADDR_FMT ", Ch:%d",
QDF_MAC_ADDR_REF(neighbor_bss_node->pBssDescription->bssId),
neighbor_bss_node->pBssDescription->chan_freq);
if (QDF_STATUS_SUCCESS != status) {
sme_err("Return failed preauth request status %d",
status);
return status;
}
neighbor_roam_info->FTRoamInfo.preauthRspPending = true;
neighbor_roam_info->FTRoamInfo.numPreAuthRetries++;
csr_neighbor_roam_state_transition(mac_ctx,
eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING, session_id);
return status;
}
#endif

View File

@@ -167,41 +167,16 @@ uint8_t csr_group_mgmt_oui[][CSR_RSN_OUI_SIZE] = {
const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
{
switch (val) {
#ifndef FEATURE_CM_ENABLE
CASE_RETURN_STR(eCSR_ROAM_CANCELLED);
CASE_RETURN_STR(eCSR_ROAM_ROAMING_START);
CASE_RETURN_STR(eCSR_ROAM_ROAMING_COMPLETION);
CASE_RETURN_STR(eCSR_ROAM_CONNECT_COMPLETION);
CASE_RETURN_STR(eCSR_ROAM_ASSOCIATION_COMPLETION);
CASE_RETURN_STR(eCSR_ROAM_DISASSOCIATED);
CASE_RETURN_STR(eCSR_ROAM_ASSOCIATION_FAILURE);
CASE_RETURN_STR(eCSR_ROAM_SHOULD_ROAM);
#endif
CASE_RETURN_STR(eCSR_ROAM_LOSTLINK);
CASE_RETURN_STR(eCSR_ROAM_MIC_ERROR_IND);
CASE_RETURN_STR(eCSR_ROAM_SET_KEY_COMPLETE);
CASE_RETURN_STR(eCSR_ROAM_INFRA_IND);
CASE_RETURN_STR(eCSR_ROAM_WPS_PBC_PROBE_REQ_IND);
#ifndef FEATURE_CM_ENABLE
CASE_RETURN_STR(eCSR_ROAM_FT_RESPONSE);
CASE_RETURN_STR(eCSR_ROAM_FT_START);
CASE_RETURN_STR(eCSR_ROAM_FT_REASSOC_FAILED);
CASE_RETURN_STR(eCSR_ROAM_PMK_NOTIFY);
#ifdef FEATURE_WLAN_LFR_METRICS
CASE_RETURN_STR(eCSR_ROAM_PREAUTH_INIT_NOTIFY);
CASE_RETURN_STR(eCSR_ROAM_PREAUTH_STATUS_SUCCESS);
CASE_RETURN_STR(eCSR_ROAM_PREAUTH_STATUS_FAILURE);
CASE_RETURN_STR(eCSR_ROAM_HANDOVER_SUCCESS);
#endif
#endif
CASE_RETURN_STR(eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS);
CASE_RETURN_STR(eCSR_ROAM_SEND_P2P_STOP_BSS);
CASE_RETURN_STR(eCSR_ROAM_UNPROT_MGMT_FRAME_IND);
#ifdef FEATURE_WLAN_ESE
CASE_RETURN_STR(eCSR_ROAM_TSM_IE_IND);
#ifndef FEATURE_CM_ENABLE
CASE_RETURN_STR(eCSR_ROAM_CCKM_PREAUTH_NOTIFY);
#endif
CASE_RETURN_STR(eCSR_ROAM_ESE_ADJ_AP_REPORT_IND);
CASE_RETURN_STR(eCSR_ROAM_ESE_BCN_REPORT_IND);
#endif /* FEATURE_WLAN_ESE */
@@ -211,11 +186,6 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
CASE_RETURN_STR(eCSR_ROAM_EXT_CHG_CHNL_IND);
CASE_RETURN_STR(eCSR_ROAM_STA_CHANNEL_SWITCH);
CASE_RETURN_STR(eCSR_ROAM_NDP_STATUS_UPDATE);
#ifndef FEATURE_CM_ENABLE
CASE_RETURN_STR(eCSR_ROAM_START);
CASE_RETURN_STR(eCSR_ROAM_ABORT);
CASE_RETURN_STR(eCSR_ROAM_NAPI_OFF);
#endif
CASE_RETURN_STR(eCSR_ROAM_CHANNEL_COMPLETE_IND);
CASE_RETURN_STR(eCSR_ROAM_SAE_COMPUTE);
default:
@@ -466,30 +436,10 @@ static bool csr_is_conn_state(struct mac_context *mac_ctx, uint32_t session_id,
bool csr_is_conn_state_connected(struct mac_context *mac, uint32_t sessionId)
{
/* This is temp ifdef will be removed in near future */
#ifdef FEATURE_CM_ENABLE
return cm_is_vdevid_connected(mac->pdev, sessionId) ||
csr_is_conn_state_connected_wds(mac, sessionId);
#else
return csr_is_conn_state_connected_infra(mac, sessionId) ||
csr_is_conn_state_connected_wds(mac, sessionId);
#endif
}
#ifndef FEATURE_CM_ENABLE
bool csr_is_conn_state_connected_infra(struct mac_context *mac_ctx,
uint32_t session_id)
{
return csr_is_conn_state(mac_ctx, session_id,
eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED);
}
bool csr_is_conn_state_infra(struct mac_context *mac, uint32_t sessionId)
{
return csr_is_conn_state_connected_infra(mac, sessionId);
}
#endif
static tSirMacCapabilityInfo csr_get_bss_capabilities(struct bss_description *
pSirBssDesc)
{
@@ -613,12 +563,7 @@ bool csr_is_any_session_in_connect_state(struct mac_context *mac)
for (i = 0; i < WLAN_MAX_VDEVS; i++) {
if (CSR_IS_SESSION_VALID(mac, i) &&
/* This is temp ifdef will be removed in near future */
#ifdef FEATURE_CM_ENABLE
(cm_is_vdevid_connected(mac->pdev, i) ||
#else
(csr_is_conn_state_infra(mac, i) ||
#endif
csr_is_conn_state_ap(mac, i))) {
return true;
}
@@ -893,14 +838,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
op_mode = wlan_get_opmode_from_vdev_id(mac_ctx->pdev, i);
if ((op_mode == QDF_STA_MODE ||
op_mode == QDF_P2P_CLIENT_MODE) &&
/* This is temp ifdef will be removed in near future */
#ifdef FEATURE_CM_ENABLE
cm_is_vdevid_connected(mac_ctx->pdev, i)
#else
(session->connectState ==
eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED)
#endif
) {
cm_is_vdevid_connected(mac_ctx->pdev, i)) {
wlan_get_op_chan_freq_info_vdev_id(mac_ctx->pdev,
session->vdev_id,
&intf_ch_freq, &intf_cfreq,
@@ -1019,14 +957,8 @@ bool csr_is_concurrent_session_running(struct mac_context *mac)
for (vdev_id = 0; vdev_id < WLAN_MAX_VDEVS; vdev_id++) {
if (!CSR_IS_SESSION_VALID(mac, vdev_id))
continue;
/* This is temp ifdef will be removed in near future */
#ifdef FEATURE_CM_ENABLE
if (csr_is_conn_state_connected_infra_ap(mac, vdev_id) ||
cm_is_vdevid_connected(mac->pdev, vdev_id))
#else
if (csr_is_conn_state_connected_infra_ap(mac, vdev_id) ||
csr_is_conn_state_connected_infra(mac, vdev_id))
#endif
++noOfCocurrentSession;
}
@@ -1054,7 +986,6 @@ bool csr_is_infra_ap_started(struct mac_context *mac)
}
#ifdef FEATURE_CM_ENABLE
bool csr_is_conn_state_disconnected(struct mac_context *mac, uint8_t vdev_id)
{
enum QDF_OPMODE opmode;
@@ -1067,13 +998,6 @@ bool csr_is_conn_state_disconnected(struct mac_context *mac, uint8_t vdev_id)
return eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED ==
mac->roam.roamSession[vdev_id].connectState;
}
#else
bool csr_is_conn_state_disconnected(struct mac_context *mac, uint8_t vdev_id)
{
return eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED ==
mac->roam.roamSession[vdev_id].connectState;
}
#endif
bool csr_is_infra_bss_desc(struct bss_description *pSirBssDesc)
{
@@ -1107,55 +1031,6 @@ bool csr_is_wmm_supported(struct mac_context *mac)
return true;
}
#ifndef FEATURE_CM_ENABLE
/* pIes is the IEs for pSirBssDesc2 */
bool csr_is_ssid_equal(struct mac_context *mac,
struct bss_description *pSirBssDesc1,
struct bss_description *pSirBssDesc2,
tDot11fBeaconIEs *pIes2)
{
bool fEqual = false;
tSirMacSSid Ssid1, Ssid2;
tDot11fBeaconIEs *pIes1 = NULL;
tDot11fBeaconIEs *pIesLocal = pIes2;
do {
if ((!pSirBssDesc1) || (!pSirBssDesc2))
break;
if (!pIesLocal
&&
!QDF_IS_STATUS_SUCCESS(csr_get_parsed_bss_description_ies
(mac, pSirBssDesc2,
&pIesLocal))) {
sme_err("fail to parse IEs");
break;
}
if (!QDF_IS_STATUS_SUCCESS
(csr_get_parsed_bss_description_ies(mac,
pSirBssDesc1, &pIes1))) {
break;
}
if ((!pIes1->SSID.present) || (!pIesLocal->SSID.present))
break;
if (pIes1->SSID.num_ssid != pIesLocal->SSID.num_ssid)
break;
qdf_mem_copy(Ssid1.ssId, pIes1->SSID.ssid,
pIes1->SSID.num_ssid);
qdf_mem_copy(Ssid2.ssId, pIesLocal->SSID.ssid,
pIesLocal->SSID.num_ssid);
fEqual = (!qdf_mem_cmp(Ssid1.ssId, Ssid2.ssId,
pIesLocal->SSID.num_ssid));
} while (0);
if (pIes1)
qdf_mem_free(pIes1);
if (pIesLocal && !pIes2)
qdf_mem_free(pIesLocal);
return fEqual;
}
#endif
/* pIes can be passed in as NULL if the caller doesn't have one prepared */
static bool csr_is_bss_description_wme(struct mac_context *mac,
struct bss_description *pSirBssDesc,
@@ -2026,115 +1901,6 @@ eCsrPhyMode csr_convert_from_reg_phy_mode(enum reg_phymode phymode)
}
}
#ifndef FEATURE_CM_ENABLE
bool csr_is_profile_wpa(struct csr_roam_profile *pProfile)
{
bool fWpaProfile = false;
switch (pProfile->negotiatedAuthType) {
case eCSR_AUTH_TYPE_WPA:
case eCSR_AUTH_TYPE_WPA_PSK:
case eCSR_AUTH_TYPE_WPA_NONE:
#ifdef FEATURE_WLAN_ESE
case eCSR_AUTH_TYPE_CCKM_WPA:
#endif
fWpaProfile = true;
break;
default:
fWpaProfile = false;
break;
}
if (fWpaProfile) {
switch (pProfile->negotiatedUCEncryptionType) {
case eCSR_ENCRYPT_TYPE_WEP40:
case eCSR_ENCRYPT_TYPE_WEP104:
case eCSR_ENCRYPT_TYPE_TKIP:
case eCSR_ENCRYPT_TYPE_AES:
fWpaProfile = true;
break;
default:
fWpaProfile = false;
break;
}
}
return fWpaProfile;
}
bool csr_is_profile_rsn(struct csr_roam_profile *pProfile)
{
bool fRSNProfile = false;
switch (pProfile->negotiatedAuthType) {
case eCSR_AUTH_TYPE_RSN:
case eCSR_AUTH_TYPE_RSN_PSK:
case eCSR_AUTH_TYPE_FT_RSN:
case eCSR_AUTH_TYPE_FT_RSN_PSK:
#ifdef FEATURE_WLAN_ESE
case eCSR_AUTH_TYPE_CCKM_RSN:
#endif
case eCSR_AUTH_TYPE_RSN_PSK_SHA256:
case eCSR_AUTH_TYPE_RSN_8021X_SHA256:
/* fallthrough */
case eCSR_AUTH_TYPE_FILS_SHA256:
case eCSR_AUTH_TYPE_FILS_SHA384:
case eCSR_AUTH_TYPE_FT_FILS_SHA256:
case eCSR_AUTH_TYPE_FT_FILS_SHA384:
case eCSR_AUTH_TYPE_DPP_RSN:
case eCSR_AUTH_TYPE_OSEN:
fRSNProfile = true;
break;
case eCSR_AUTH_TYPE_OWE:
case eCSR_AUTH_TYPE_SUITEB_EAP_SHA256:
case eCSR_AUTH_TYPE_SUITEB_EAP_SHA384:
case eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384:
fRSNProfile = true;
break;
case eCSR_AUTH_TYPE_SAE:
case eCSR_AUTH_TYPE_FT_SAE:
fRSNProfile = true;
break;
default:
fRSNProfile = false;
break;
}
if (fRSNProfile) {
switch (pProfile->negotiatedUCEncryptionType) {
/* !!REVIEW - For WPA2, use of RSN IE mandates */
/* use of AES as encryption. Here, we qualify */
/* even if encryption type is WEP or TKIP */
case eCSR_ENCRYPT_TYPE_WEP40:
case eCSR_ENCRYPT_TYPE_WEP104:
case eCSR_ENCRYPT_TYPE_TKIP:
case eCSR_ENCRYPT_TYPE_AES:
case eCSR_ENCRYPT_TYPE_AES_GCMP:
case eCSR_ENCRYPT_TYPE_AES_GCMP_256:
fRSNProfile = true;
break;
default:
fRSNProfile = false;
break;
}
}
return fRSNProfile;
}
#ifdef FEATURE_WLAN_ESE
/* Function to return true if the profile is ESE */
bool csr_is_profile_ese(struct csr_roam_profile *pProfile)
{
return csr_is_auth_type_ese(pProfile->negotiatedAuthType);
}
#endif
#endif
bool csr_is_auth_type_ese(enum csr_akm_type AuthType)
{
switch (AuthType) {
@@ -2185,355 +1951,6 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
return false;
}
#ifndef FEATURE_CM_ENABLE
#ifdef FEATURE_WLAN_WAPI
bool csr_is_profile_wapi(struct csr_roam_profile *pProfile)
{
bool fWapiProfile = false;
switch (pProfile->negotiatedAuthType) {
case eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE:
case eCSR_AUTH_TYPE_WAPI_WAI_PSK:
fWapiProfile = true;
break;
default:
fWapiProfile = false;
break;
}
if (fWapiProfile) {
switch (pProfile->negotiatedUCEncryptionType) {
case eCSR_ENCRYPT_TYPE_WPI:
fWapiProfile = true;
break;
default:
fWapiProfile = false;
break;
}
}
return fWapiProfile;
}
#endif /* FEATURE_WLAN_WAPI */
bool csr_lookup_fils_pmkid(struct mac_context *mac,
uint8_t vdev_id, uint8_t *cache_id,
uint8_t *ssid, uint8_t ssid_len,
struct qdf_mac_addr *bssid)
{
struct wlan_crypto_pmksa *fils_ssid_pmksa, *bssid_lookup_pmksa;
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
WLAN_LEGACY_SME_ID);
if (!vdev) {
sme_err("Invalid vdev");
return false;
}
bssid_lookup_pmksa = wlan_crypto_get_pmksa(vdev, bssid);
fils_ssid_pmksa =
wlan_crypto_get_fils_pmksa(vdev, cache_id, ssid, ssid_len);
if (!fils_ssid_pmksa && !bssid_lookup_pmksa) {
sme_err("FILS_PMKSA: Lookup failed");
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return false;
}
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return true;
}
#ifdef WLAN_FEATURE_FILS_SK
/**
* csr_update_pmksa_to_profile() - update pmk and pmkid to profile which will be
* used in case of fils session
* @profile: profile
* @pmkid_cache: pmksa cache
*
* Return: None
*/
static inline void csr_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
struct wlan_crypto_pmksa *pmksa)
{
struct mlme_legacy_priv *mlme_priv;
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
mlme_err("vdev legacy private object is NULL");
return;
}
if (!mlme_priv->connect_info.fils_con_info)
return;
mlme_priv->connect_info.fils_con_info->pmk_len = pmksa->pmk_len;
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmk,
pmksa->pmk, pmksa->pmk_len);
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmkid,
pmksa->pmkid, PMKID_LEN);
}
#else
static inline void csr_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
struct wlan_crypto_pmksa *pmksa)
{
}
#endif
uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *ap_ie, tCsrRSNIe *pRSNIe)
{
struct wlan_objmgr_vdev *vdev;
uint8_t *rsn_ie_end = NULL;
uint8_t *rsn_ie = (uint8_t *)pRSNIe;
uint8_t ie_len = 0;
tDot11fBeaconIEs *local_ap_ie = ap_ie;
uint16_t rsn_cap = 0, self_rsn_cap;
int32_t rsn_val;
struct wlan_crypto_pmksa pmksa, *pmksa_peer;
if (!local_ap_ie &&
(!QDF_IS_STATUS_SUCCESS(csr_get_parsed_bss_description_ies
(mac, pSirBssDesc, &local_ap_ie))))
return ie_len;
/* get AP RSN cap */
qdf_mem_copy(&rsn_cap, local_ap_ie->RSN.RSN_Cap, sizeof(rsn_cap));
if (!ap_ie && local_ap_ie)
/* locally allocated */
qdf_mem_free(local_ap_ie);
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, sessionId,
WLAN_LEGACY_SME_ID);
if (!vdev) {
sme_err("Invalid vdev");
return ie_len;
}
rsn_val = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_RSN_CAP);
if (rsn_val < 0) {
sme_err("Invalid mgmt cipher");
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return ie_len;
}
self_rsn_cap = (uint16_t)rsn_val;
/* If AP is capable then use self capability else set PMF as 0 */
if (rsn_cap & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED &&
pProfile->MFPCapable) {
self_rsn_cap |= WLAN_CRYPTO_RSN_CAP_MFP_ENABLED;
if (pProfile->MFPRequired)
self_rsn_cap |= WLAN_CRYPTO_RSN_CAP_MFP_REQUIRED;
if (!(rsn_cap & WLAN_CRYPTO_RSN_CAP_OCV_SUPPORTED))
self_rsn_cap &= ~WLAN_CRYPTO_RSN_CAP_OCV_SUPPORTED;
} else {
self_rsn_cap &= ~WLAN_CRYPTO_RSN_CAP_MFP_ENABLED;
self_rsn_cap &= ~WLAN_CRYPTO_RSN_CAP_MFP_REQUIRED;
self_rsn_cap &= ~WLAN_CRYPTO_RSN_CAP_OCV_SUPPORTED;
}
wlan_crypto_set_vdev_param(vdev, WLAN_CRYPTO_PARAM_RSN_CAP,
self_rsn_cap);
qdf_mem_zero(&pmksa, sizeof(pmksa));
if (pSirBssDesc->fils_info_element.is_cache_id_present) {
pmksa.ssid_len =
pProfile->SSIDs.SSIDList[0].SSID.length;
qdf_mem_copy(pmksa.ssid,
pProfile->SSIDs.SSIDList[0].SSID.ssId,
pProfile->SSIDs.SSIDList[0].SSID.length);
qdf_mem_copy(pmksa.cache_id,
pSirBssDesc->fils_info_element.cache_id,
CACHE_ID_LEN);
qdf_mem_copy(&pmksa.bssid,
pSirBssDesc->bssId, QDF_MAC_ADDR_SIZE);
} else {
qdf_mem_copy(&pmksa.bssid,
pSirBssDesc->bssId, QDF_MAC_ADDR_SIZE);
}
pmksa_peer = wlan_crypto_get_peer_pmksa(vdev, &pmksa);
qdf_mem_zero(&pmksa, sizeof(pmksa));
/*
* TODO: Add support for Adaptive 11r connection after
* call to csr_get_rsn_information is added here
*/
rsn_ie_end = wlan_crypto_build_rsnie_with_pmksa(vdev, rsn_ie,
pmksa_peer);
if (rsn_ie_end)
ie_len = rsn_ie_end - rsn_ie;
/*
* If a PMK cache is found for the BSSID, then
* update the PMK in CSR session also as this
* will be sent to the FW during RSO.
*/
if (pmksa_peer) {
wlan_cm_set_psk_pmk(mac->pdev, sessionId,
pmksa_peer->pmk, pmksa_peer->pmk_len);
csr_update_pmksa_to_profile(vdev, pmksa_peer);
}
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return ie_len;
}
uint8_t csr_construct_wpa_ie(struct mac_context *mac, uint8_t session_id,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe)
{
struct wlan_objmgr_vdev *vdev;
uint8_t *wpa_ie_end = NULL;
uint8_t *wpa_ie = (uint8_t *)pWpaIe;
uint8_t ie_len = 0;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, session_id,
WLAN_LEGACY_SME_ID);
if (!vdev) {
sme_err("Invalid vdev");
return ie_len;
}
wpa_ie_end = wlan_crypto_build_wpaie(vdev, wpa_ie);
if (wpa_ie_end)
ie_len = wpa_ie_end - wpa_ie;
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return ie_len;
}
#ifdef FEATURE_WLAN_WAPI
uint8_t csr_construct_wapi_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe)
{
struct wlan_objmgr_vdev *vdev;
uint8_t *wapi_ie_end = NULL;
uint8_t *wapi_ie = (uint8_t *)pWapiIe;
uint8_t ie_len = 0;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, sessionId,
WLAN_LEGACY_SME_ID);
if (!vdev) {
sme_err("Invalid vdev");
return ie_len;
}
wapi_ie_end = wlan_crypto_build_wapiie(vdev, wapi_ie);
if (wapi_ie_end)
ie_len = wapi_ie_end - wapi_ie;
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return ie_len;
}
#endif
/* If a WPAIE exists in the profile, just use it. Or else construct
* one from the BSS Caller allocated memory for pWpaIe and guarrantee
* it can contain a max length WPA IE
*/
uint8_t csr_retrieve_wpa_ie(struct mac_context *mac, uint8_t session_id,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe)
{
uint8_t cbWpaIe = 0;
do {
if (!csr_is_profile_wpa(pProfile))
break;
if (pProfile->nWPAReqIELength && pProfile->pWPAReqIE) {
if (pProfile->nWPAReqIELength <=
DOT11F_IE_RSN_MAX_LEN) {
cbWpaIe = (uint8_t) pProfile->nWPAReqIELength;
qdf_mem_copy(pWpaIe, pProfile->pWPAReqIE,
cbWpaIe);
} else {
sme_warn("Invalid WPA IE length %d",
pProfile->nWPAReqIELength);
}
break;
}
cbWpaIe = csr_construct_wpa_ie(mac, session_id, pProfile,
pSirBssDesc, pIes, pWpaIe);
} while (0);
return cbWpaIe;
}
/* If a RSNIE exists in the profile, just use it. Or else construct
* one from the BSS Caller allocated memory for pWpaIe and guarrantee
* it can contain a max length WPA IE
*/
uint8_t csr_retrieve_rsn_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrRSNIe *pRsnIe)
{
uint8_t cbRsnIe = 0;
do {
if (!csr_is_profile_rsn(pProfile))
break;
/* copy RSNIE from user as it is if test mode is enabled */
if (pProfile->force_rsne_override &&
pProfile->nRSNReqIELength && pProfile->pRSNReqIE) {
sme_debug("force_rsne_override, copy RSN IE provided by user");
if (pProfile->nRSNReqIELength <=
DOT11F_IE_RSN_MAX_LEN) {
cbRsnIe = (uint8_t) pProfile->nRSNReqIELength;
qdf_mem_copy(pRsnIe, pProfile->pRSNReqIE,
cbRsnIe);
} else {
sme_warn("Invalid RSN IE length: %d",
pProfile->nRSNReqIELength);
}
break;
}
cbRsnIe = csr_construct_rsn_ie(mac, sessionId, pProfile,
pSirBssDesc, pIes, pRsnIe);
} while (0);
return cbRsnIe;
}
#ifdef FEATURE_WLAN_WAPI
/* If a WAPI IE exists in the profile, just use it. Or else construct
* one from the BSS Caller allocated memory for pWapiIe and guarrantee
* it can contain a max length WAPI IE
*/
uint8_t csr_retrieve_wapi_ie(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile,
struct bss_description *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe)
{
uint8_t cbWapiIe = 0;
do {
if (!csr_is_profile_wapi(pProfile))
break;
if (pProfile->nWAPIReqIELength && pProfile->pWAPIReqIE) {
if (DOT11F_IE_WAPI_MAX_LEN >=
pProfile->nWAPIReqIELength) {
cbWapiIe = (uint8_t) pProfile->nWAPIReqIELength;
qdf_mem_copy(pWapiIe, pProfile->pWAPIReqIE,
cbWapiIe);
} else {
sme_warn("Invalid WAPI IE length %d",
pProfile->nWAPIReqIELength);
}
break;
}
cbWapiIe = csr_construct_wapi_ie(mac, sessionId,
pProfile, pSirBssDesc,
pIes, pWapiIe);
} while (0);
return cbWapiIe;
}
#endif /* FEATURE_WLAN_WAPI */
#endif
bool csr_rates_is_dot11_rate11b_supported_rate(uint8_t dot11Rate)
{
bool fSupported = false;
@@ -2676,33 +2093,6 @@ bool csr_is_ssid_match(struct mac_context *mac, uint8_t *ssid1, uint8_t ssid1Len
return fMatch;
}
#ifndef FEATURE_CM_ENABLE
/* Null ssid means match */
bool csr_is_ssid_in_list(tSirMacSSid *pSsid, tCsrSSIDs *pSsidList)
{
bool fMatch = false;
uint32_t i;
if (pSsidList && pSsid) {
for (i = 0; i < pSsidList->numOfSSIDs; i++) {
if (csr_is_nullssid
(pSsidList->SSIDList[i].SSID.ssId,
pSsidList->SSIDList[i].SSID.length)
||
((pSsidList->SSIDList[i].SSID.length ==
pSsid->length)
&& (!qdf_mem_cmp(pSsid->ssId,
pSsidList->SSIDList[i].SSID.
ssId, pSsid->length)))) {
fMatch = true;
break;
}
}
}
return fMatch;
}
#endif
bool csr_is_bssid_match(struct qdf_mac_addr *pProfBssid,
struct qdf_mac_addr *BssBssid)
{
@@ -2740,24 +2130,6 @@ bool csr_rates_is_dot11_rate_supported(struct mac_context *mac_ctx,
return wlan_rates_is_dot11_rate_supported(mac_ctx, rate);
}
#ifndef FEATURE_CM_ENABLE
#ifdef WLAN_FEATURE_FILS_SK
static inline
void csr_free_fils_profile_info(struct mac_context *mac,
struct csr_roam_profile *profile)
{
if (profile->fils_con_info) {
qdf_mem_free(profile->fils_con_info);
profile->fils_con_info = NULL;
}
}
#else
static inline void csr_free_fils_profile_info(struct mac_context *mac,
struct csr_roam_profile *profile)
{ }
#endif
#endif
void csr_release_profile(struct mac_context *mac,
struct csr_roam_profile *pProfile)
{
@@ -2779,29 +2151,6 @@ void csr_release_profile(struct mac_context *mac,
qdf_mem_free(pProfile->pRSNReqIE);
pProfile->pRSNReqIE = NULL;
}
#ifndef FEATURE_CM_ENABLE
if (pProfile->pWPAReqIE) {
qdf_mem_free(pProfile->pWPAReqIE);
pProfile->pWPAReqIE = NULL;
}
#ifdef FEATURE_WLAN_WAPI
if (pProfile->pWAPIReqIE) {
qdf_mem_free(pProfile->pWAPIReqIE);
pProfile->pWAPIReqIE = NULL;
}
#endif /* FEATURE_WLAN_WAPI */
if (pProfile->pAddIEAssoc) {
qdf_mem_free(pProfile->pAddIEAssoc);
pProfile->pAddIEAssoc = NULL;
}
if (pProfile->pAddIEScan) {
qdf_mem_free(pProfile->pAddIEScan);
pProfile->pAddIEScan = NULL;
}
csr_free_fils_profile_info(mac, pProfile);
#endif
qdf_mem_zero(pProfile, sizeof(struct csr_roam_profile));
}
}
@@ -2817,18 +2166,6 @@ void csr_free_roam_profile(struct mac_context *mac, uint32_t sessionId)
}
}
#ifndef FEATURE_CM_ENABLE
void csr_free_connect_bss_desc(struct mac_context *mac, uint32_t sessionId)
{
struct csr_roam_session *pSession = &mac->roam.roamSession[sessionId];
if (pSession->pConnectBssDesc) {
qdf_mem_free(pSession->pConnectBssDesc);
pSession->pConnectBssDesc = NULL;
}
}
#endif
tSirResultCodes csr_get_de_auth_rsp_status_code(struct deauth_rsp *pSmeRsp)
{
uint8_t *pBuffer = (uint8_t *) pSmeRsp;
@@ -3168,14 +2505,7 @@ bool csr_is_mcc_channel(struct mac_context *mac_ctx, uint32_t chan_freq)
wlan_get_opmode_from_vdev_id(mac_ctx->pdev, vdev_id);
if ((((oper_mode == QDF_STA_MODE) ||
(oper_mode == QDF_P2P_CLIENT_MODE)) &&
/* This is temp ifdef will be removed in near future */
#ifdef FEATURE_CM_ENABLE
cm_is_vdevid_connected(mac_ctx->pdev, vdev_id)
#else
(session->connectState ==
eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED)
#endif
) ||
cm_is_vdevid_connected(mac_ctx->pdev, vdev_id)) ||
(((oper_mode == QDF_P2P_GO_MODE) ||
(oper_mode == QDF_SAP_MODE)) &&
(session->connectState !=