qcacld-3.0: use crypto from vdev to fill the scan filter

use crypto from vdev to fill the scan filter.

Change-Id: I2c4bd9b85d9dac14c4d331a84cc7f3307d06818d
CRs-Fixed: 2718080
This commit is contained in:
Abhishek Singh
2020-06-17 18:17:43 +05:30
committed by nshrivas
parent cc554981a4
commit 4b9273d712
12 changed files with 452 additions and 131 deletions

2
Kbuild
View File

@@ -2721,6 +2721,8 @@ cppflags-$(CONFIG_WLAN_OBJMGR_DEBUG) += -DWLAN_OBJMGR_REF_ID_DEBUG
cppflags-$(CONFIG_WLAN_FEATURE_SAE) += -DWLAN_FEATURE_SAE cppflags-$(CONFIG_WLAN_FEATURE_SAE) += -DWLAN_FEATURE_SAE
cppflags-y += -DWLAN_SCAN_SECURITY_FILTER_V1
ifeq ($(BUILD_DIAG_VERSION), y) ifeq ($(BUILD_DIAG_VERSION), y)
cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT
cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT_CSR cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT_CSR

View File

@@ -1372,7 +1372,7 @@ struct policy_mgr_sme_cbacks {
QDF_STATUS (*sme_get_ap_channel_from_scan)( QDF_STATUS (*sme_get_ap_channel_from_scan)(
void *roam_profile, void *roam_profile,
void **scan_cache, void **scan_cache,
uint32_t *ch_freq); uint32_t *ch_freq, uint8_t vdev_id);
QDF_STATUS (*sme_scan_result_purge)( QDF_STATUS (*sme_scan_result_purge)(
void *scan_result); void *scan_result);
QDF_STATUS (*sme_rso_start_cb)( QDF_STATUS (*sme_rso_start_cb)(
@@ -1607,6 +1607,7 @@ bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode,
* @psoc: PSOC object information * @psoc: PSOC object information
* @roam_profile: pointer to roam profile * @roam_profile: pointer to roam profile
* @ch_freq: channel frequency to be filled * @ch_freq: channel frequency to be filled
* @vdev_id: vdev id
* *
* This routine gets channel which most likely a candidate to which STA * This routine gets channel which most likely a candidate to which STA
* will make connection. * will make connection.
@@ -1616,7 +1617,7 @@ bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode,
QDF_STATUS QDF_STATUS
policy_mgr_get_channel_from_scan_result(struct wlan_objmgr_psoc *psoc, policy_mgr_get_channel_from_scan_result(struct wlan_objmgr_psoc *psoc,
void *roam_profile, void *roam_profile,
uint32_t *ch_freq); uint32_t *ch_freq, uint8_t vdev_id);
/** /**
* policy_mgr_mode_specific_num_open_sessions() - to get number of open sessions * policy_mgr_mode_specific_num_open_sessions() - to get number of open sessions

View File

@@ -2650,20 +2650,9 @@ uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc)
return pm_ctx->concurrency_mode; return pm_ctx->concurrency_mode;
} }
/**
* policy_mgr_get_channel_from_scan_result() - to get channel from scan result
* @psoc: PSOC object information
* @roam_profile: pointer to roam profile
* @channel: channel to be filled
*
* This routine gets channel which most likely a candidate to which STA
* will make connection.
*
* Return: QDF_STATUS
*/
QDF_STATUS policy_mgr_get_channel_from_scan_result( QDF_STATUS policy_mgr_get_channel_from_scan_result(
struct wlan_objmgr_psoc *psoc, struct wlan_objmgr_psoc *psoc,
void *roam_profile, uint32_t *ch_freq) void *roam_profile, uint32_t *ch_freq, uint8_t vdev_id)
{ {
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
void *scan_cache = NULL; void *scan_cache = NULL;
@@ -2682,7 +2671,7 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result(
if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan) { if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan) {
status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan
(roam_profile, &scan_cache, ch_freq); (roam_profile, &scan_cache, ch_freq, vdev_id);
if (status != QDF_STATUS_SUCCESS) { if (status != QDF_STATUS_SUCCESS) {
policy_mgr_err("Get AP channel failed"); policy_mgr_err("Get AP channel failed");
return status; return status;
@@ -2754,7 +2743,7 @@ uint32_t policy_mgr_search_and_check_for_session_conc(
return ch_freq; return ch_freq;
status = policy_mgr_get_channel_from_scan_result( status = policy_mgr_get_channel_from_scan_result(
psoc, roam_profile, &ch_freq); psoc, roam_profile, &ch_freq, session_id);
if (QDF_STATUS_SUCCESS != status || ch_freq == 0) { if (QDF_STATUS_SUCCESS != status || ch_freq == 0) {
policy_mgr_err("%s error %d %d", policy_mgr_err("%s error %d %d",
__func__, status, ch_freq); __func__, status, ch_freq);

View File

@@ -18102,7 +18102,8 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
* connect by passing its roam_profile. * connect by passing its roam_profile.
*/ */
status = policy_mgr_get_channel_from_scan_result( status = policy_mgr_get_channel_from_scan_result(
hdd_ctx->psoc, roam_profile, &ch_freq); hdd_ctx->psoc, roam_profile, &ch_freq,
adapter->vdev_id);
/* /*
* If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz * If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz

View File

@@ -17194,7 +17194,8 @@ int hdd_get_rssi_snr_by_bssid(struct hdd_adapter *adapter, const uint8_t *bssid,
roam_profile = hdd_roam_profile(adapter); roam_profile = hdd_roam_profile(adapter);
mac_handle = hdd_adapter_get_mac_handle(adapter); mac_handle = hdd_adapter_get_mac_handle(adapter);
status = sme_get_rssi_snr_by_bssid(mac_handle, status = sme_get_rssi_snr_by_bssid(mac_handle,
roam_profile, bssid, rssi, snr); roam_profile, bssid, rssi, snr,
adapter->vdev_id);
if (QDF_STATUS_SUCCESS != status) { if (QDF_STATUS_SUCCESS != status) {
hdd_warn("sme_get_rssi_snr_by_bssid failed"); hdd_warn("sme_get_rssi_snr_by_bssid failed");
return -EINVAL; return -EINVAL;

View File

@@ -937,8 +937,6 @@ struct join_req {
/* (Re) Association Request */ /* (Re) Association Request */
tAniEdType UCEncryptionType; tAniEdType UCEncryptionType;
tAniEdType MCEncryptionType;
enum ani_akm_type akm; enum ani_akm_type akm;
bool is11Rconnection; bool is11Rconnection;

View File

@@ -518,19 +518,31 @@ QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg);
QDF_STATUS sme_scan_get_result(mac_handle_t mac_handle, uint8_t vdev_id, QDF_STATUS sme_scan_get_result(mac_handle_t mac_handle, uint8_t vdev_id,
struct scan_filter *filter, struct scan_filter *filter,
tScanResultHandle *phResult); tScanResultHandle *phResult);
QDF_STATUS sme_get_ap_channel_from_scan_cache(
struct csr_roam_profile *profile,
tScanResultHandle *scan_cache,
uint32_t *ap_ch_freq);
/** /**
* sme_get_ap_channel_from_scan() - a wrapper function to get * sme_get_ap_channel_from_scan_cache() - a wrapper function to get AP's channel
* AP's channel id from * from CSR by filtering the result which matches our roam profile.
* CSR by filtering the
* result which matches
* our roam profile.
* @profile: SAP profile * @profile: SAP profile
* @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the * @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the
* best ap from scan cache. * best ap from scan cache.
* @vdev_id: vdev id
*
* This function is written to get AP's channel id from CSR by filtering
* the result which matches our roam profile. This is a synchronous call.
*
* Return: QDF_STATUS.
*/
QDF_STATUS sme_get_ap_channel_from_scan_cache(struct csr_roam_profile *profile,
tScanResultHandle *scan_cache,
uint32_t *ap_ch_freq,
uint8_t vdev_id);
/**
* sme_get_ap_channel_from_scan() - a wrapper function to get AP's channel id
* from CSR by filtering the result which matches our roam profile.
* @profile: SAP profile
* @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the
* best ap from scan cache.
* @vdev_id: vdev id
* *
* This function is written to get AP's channel id from CSR by filtering * This function is written to get AP's channel id from CSR by filtering
* the result which matches our roam profile. This is a synchronous call. * the result which matches our roam profile. This is a synchronous call.
@@ -539,7 +551,8 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
*/ */
QDF_STATUS sme_get_ap_channel_from_scan(void *profile, QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
tScanResultHandle *scan_cache, tScanResultHandle *scan_cache,
uint32_t *ap_ch_freq); uint32_t *ap_ch_freq,
uint8_t vdev_id);
tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t, tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t,
tScanResultHandle hScanResult); tScanResultHandle hScanResult);
@@ -2404,13 +2417,14 @@ void sme_set_chan_info_callback(mac_handle_t mac_handle,
* @bssid: bssid to look for in scan cache * @bssid: bssid to look for in scan cache
* @rssi: rssi value found * @rssi: rssi value found
* @snr: snr value found * @snr: snr value found
* @vdev_id: vdev id
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle, QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
const uint8_t *bssid, int8_t *rssi, const uint8_t *bssid, int8_t *rssi,
int8_t *snr); int8_t *snr, uint8_t vdev_id);
/** /**
* sme_get_beacon_frm() - gets the bss descriptor from scan cache and prepares * sme_get_beacon_frm() - gets the bss descriptor from scan cache and prepares
@@ -2421,6 +2435,7 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
* @frame_buf: frame buffer to populate * @frame_buf: frame buffer to populate
* @frame_len: length of constructed frame * @frame_len: length of constructed frame
* @ch_freq: Pointer to channel freq info to be filled * @ch_freq: Pointer to channel freq info to be filled
* @vdev_id: vdev id
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
@@ -2428,7 +2443,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
const tSirMacAddr bssid, const tSirMacAddr bssid,
uint8_t **frame_buf, uint32_t *frame_len, uint8_t **frame_buf, uint32_t *frame_len,
uint32_t *ch_freq); uint32_t *ch_freq, uint8_t vdev_id);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD #ifdef WLAN_FEATURE_ROAM_OFFLOAD
/** /**

View File

@@ -2576,33 +2576,21 @@ QDF_STATUS sme_scan_get_result_for_bssid(mac_handle_t mac_handle,
QDF_STATUS sme_get_ap_channel_from_scan(void *profile, QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
tScanResultHandle *scan_cache, tScanResultHandle *scan_cache,
uint32_t *ap_ch_freq) uint32_t *ap_ch_freq,
uint8_t vdev_id)
{ {
QDF_STATUS status; QDF_STATUS status;
status = sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *) status = sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *)
profile, profile,
scan_cache, scan_cache,
ap_ch_freq); ap_ch_freq, vdev_id);
return status; return status;
} }
/**
* sme_get_ap_channel_from_scan_cache() - a wrapper function to get AP's
* channel id from CSR by filtering the
* result which matches our roam profile.
* @profile: SAP adapter
* @ap_ch_freq: pointer to channel freq of SAP. Fill the value after finding the
* best ap from scan cache.
*
* This function is written to get AP's channel id from CSR by filtering
* the result which matches our roam profile. This is a synchronous call.
*
* Return: QDF_STATUS.
*/
QDF_STATUS sme_get_ap_channel_from_scan_cache( QDF_STATUS sme_get_ap_channel_from_scan_cache(
struct csr_roam_profile *profile, tScanResultHandle *scan_cache, struct csr_roam_profile *profile, tScanResultHandle *scan_cache,
uint32_t *ap_ch_freq) uint32_t *ap_ch_freq, uint8_t vdev_id)
{ {
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct mac_context *mac_ctx = sme_get_mac_context(); struct mac_context *mac_ctx = sme_get_mac_context();
@@ -2621,15 +2609,12 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
qdf_mem_zero(&first_ap_profile, sizeof(struct bss_description)); qdf_mem_zero(&first_ap_profile, sizeof(struct bss_description));
if (!profile) { if (!profile) {
/* No encryption */ csr_set_open_mode_in_scan_filter(scan_filter);
scan_filter->num_of_enc_type = 1;
scan_filter->enc_type[0] = WLAN_ENCRYPT_TYPE_NONE;
} else { } else {
/* Here is the profile we need to connect to */ /* Here is the profile we need to connect to */
status = csr_roam_get_scan_filter_from_profile(mac_ctx, status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile,
profile,
scan_filter, scan_filter,
false); false, vdev_id);
} }
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {
@@ -13809,7 +13794,8 @@ static void sme_prepare_beacon_from_bss_descp(uint8_t *frame_buf,
QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle, QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
const uint8_t *bssid, const uint8_t *bssid,
int8_t *rssi, int8_t *snr) int8_t *rssi, int8_t *snr,
uint8_t vdev_id)
{ {
struct bss_description *bss_descp; struct bss_description *bss_descp;
struct scan_filter *scan_filter; struct scan_filter *scan_filter;
@@ -13826,7 +13812,7 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
status = csr_roam_get_scan_filter_from_profile(mac_ctx, status = csr_roam_get_scan_filter_from_profile(mac_ctx,
profile, scan_filter, profile, scan_filter,
false); false, vdev_id);
if (QDF_STATUS_SUCCESS != status) { if (QDF_STATUS_SUCCESS != status) {
sme_err("prepare_filter failed"); sme_err("prepare_filter failed");
qdf_mem_free(scan_filter); qdf_mem_free(scan_filter);
@@ -13873,7 +13859,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
const tSirMacAddr bssid, const tSirMacAddr bssid,
uint8_t **frame_buf, uint32_t *frame_len, uint8_t **frame_buf, uint32_t *frame_len,
uint32_t *ch_freq) uint32_t *ch_freq, uint8_t vdev_id)
{ {
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status = QDF_STATUS_SUCCESS;
tScanResultHandle result_handle = NULL; tScanResultHandle result_handle = NULL;
@@ -13890,7 +13876,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
} }
status = csr_roam_get_scan_filter_from_profile(mac_ctx, status = csr_roam_get_scan_filter_from_profile(mac_ctx,
profile, scan_filter, profile, scan_filter,
false); false, vdev_id);
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {
sme_err("prepare_filter failed"); sme_err("prepare_filter failed");
status = QDF_STATUS_E_FAULT; status = QDF_STATUS_E_FAULT;

View File

@@ -3342,7 +3342,7 @@ csr_connect_info(struct mac_context *mac_ctx,
sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx), sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx),
session->pCurRoamProfile, session->pCurRoamProfile,
&conn_stats.bssid[0], &conn_stats.bssid[0],
&conn_stats.rssi, NULL); &conn_stats.rssi, NULL, session->vdev_id);
conn_stats.est_link_speed = 0; conn_stats.est_link_speed = 0;
conn_stats.chnl_bw = conn_stats.chnl_bw =
diag_ch_width_from_csr_type(conn_profile->vht_channel_width); diag_ch_width_from_csr_type(conn_profile->vht_channel_width);
@@ -3411,7 +3411,7 @@ void csr_get_sta_cxn_info(struct mac_context *mac_ctx,
sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx), sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx),
session->pCurRoamProfile, session->pCurRoamProfile,
conn_profile->bssid.bytes, conn_profile->bssid.bytes,
&rssi, NULL); &rssi, NULL, session->vdev_id);
len += qdf_scnprintf(buf + len, buf_sz - len, len += qdf_scnprintf(buf + len, buf_sz - len,
"\n\trssi: %d", rssi); "\n\trssi: %d", rssi);
ch_width = diag_ch_width_from_csr_type(conn_profile->vht_channel_width); ch_width = diag_ch_width_from_csr_type(conn_profile->vht_channel_width);
@@ -5541,6 +5541,7 @@ static void csr_roam_join_handle_profile(struct mac_context *mac_ctx,
cmd->u.roamCmd.roamProfile.negotiatedMCEncryptionType = cmd->u.roamCmd.roamProfile.negotiatedMCEncryptionType =
scan_result->mcEncryptionType; scan_result->mcEncryptionType;
} }
cmd->u.roamCmd.roamProfile.negotiatedAuthType = cmd->u.roamCmd.roamProfile.negotiatedAuthType =
scan_result->authType; scan_result->authType;
if (cmd->u.roamCmd.fReassocToSelfNoCapChange) { if (cmd->u.roamCmd.fReassocToSelfNoCapChange) {
@@ -8274,6 +8275,19 @@ static void csr_roam_print_candidate_aps(tScanResultHandle results)
} }
} }
#ifdef WLAN_SCAN_SECURITY_FILTER_V1
void csr_set_open_mode_in_scan_filter(struct scan_filter *filter)
{
QDF_SET_PARAM(filter->authmodeset, WLAN_CRYPTO_AUTH_OPEN);
}
#else
void csr_set_open_mode_in_scan_filter(struct scan_filter *filter)
{
/* No encryption */
filter->num_of_enc_type = 1;
filter->enc_type[0] = WLAN_ENCRYPT_TYPE_NONE;
}
#endif
QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId, QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
struct csr_roam_profile *pProfile, struct csr_roam_profile *pProfile,
uint32_t *pRoamId) uint32_t *pRoamId)
@@ -8344,9 +8358,6 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
/* Try to connect to any BSS */ /* Try to connect to any BSS */
if (!pProfile) { if (!pProfile) {
/* No encryption */
filter->num_of_enc_type = 1;
filter->enc_type[0] = WLAN_ENCRYPT_TYPE_NONE;
/* /*
* Dual STA roaming is supported only for DBS mode. * Dual STA roaming is supported only for DBS mode.
* So if dual sta roaming is enabled, fill the channels * So if dual sta roaming is enabled, fill the channels
@@ -8355,10 +8366,12 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
*/ */
wlan_cm_dual_sta_roam_update_connect_channels(mac->psoc, wlan_cm_dual_sta_roam_update_connect_channels(mac->psoc,
filter); filter);
csr_set_open_mode_in_scan_filter(filter);
} else { } else {
/* Here is the profile we need to connect to */ /* Here is the profile we need to connect to */
status = csr_roam_get_scan_filter_from_profile(mac, pProfile, status = csr_roam_get_scan_filter_from_profile(mac, pProfile,
filter, false); filter, false,
sessionId);
opmode = pProfile->csrPersona; opmode = pProfile->csrPersona;
} }
roamId = GET_NEXT_ROAM_ID(&mac->roam); roamId = GET_NEXT_ROAM_ID(&mac->roam);
@@ -9779,13 +9792,14 @@ csr_post_roam_failure(struct mac_context *mac_ctx,
* @mac: mac global context * @mac: mac global context
* @neighbor_roam_info: roam info struct * @neighbor_roam_info: roam info struct
* @hBSSList: scan result * @hBSSList: scan result
* @vdev_id: vdev id
* *
* Return: true if found else false. * Return: true if found else false.
*/ */
static bool static bool
csr_check_profile_in_scan_cache(struct mac_context *mac_ctx, csr_check_profile_in_scan_cache(struct mac_context *mac_ctx,
tpCsrNeighborRoamControlInfo neighbor_roam_info, tpCsrNeighborRoamControlInfo neighbor_roam_info,
tScanResultHandle *hBSSList) tScanResultHandle *hBSSList, uint8_t vdev_id)
{ {
QDF_STATUS status; QDF_STATUS status;
struct scan_filter *scan_filter; struct scan_filter *scan_filter;
@@ -9796,7 +9810,7 @@ csr_check_profile_in_scan_cache(struct mac_context *mac_ctx,
status = csr_roam_get_scan_filter_from_profile(mac_ctx, status = csr_roam_get_scan_filter_from_profile(mac_ctx,
&neighbor_roam_info->csrNeighborRoamProfile, &neighbor_roam_info->csrNeighborRoamProfile,
scan_filter, true); scan_filter, true, vdev_id);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err( sme_err(
"failed to prepare scan filter, status %d", "failed to prepare scan filter, status %d",
@@ -9931,7 +9945,8 @@ void csr_handle_disassoc_ho(struct mac_context *mac, uint32_t session_id)
* If not, post a reassoc failure and disconnect. * If not, post a reassoc failure and disconnect.
*/ */
if (!csr_check_profile_in_scan_cache(mac, neighbor_roam_info, if (!csr_check_profile_in_scan_cache(mac, neighbor_roam_info,
(tScanResultHandle *)&scan_handle_roam_ap)) (tScanResultHandle *)&scan_handle_roam_ap,
session_id))
goto POST_ROAM_FAILURE; goto POST_ROAM_FAILURE;
/* notify HDD about handoff and provide the BSSID too */ /* notify HDD about handoff and provide the BSSID too */
@@ -10803,16 +10818,109 @@ void csr_update_pmf_cap_from_profile(struct csr_roam_profile *profile,
{} {}
#endif #endif
#ifdef WLAN_SCAN_SECURITY_FILTER_V1
QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
struct scan_filter *filter,
uint8_t vdev_id)
{
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
WLAN_LEGACY_SME_ID);
if (!vdev) {
sme_err("Invalid vdev");
return QDF_STATUS_E_FAILURE;
}
filter->authmodeset =
wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_AUTH_MODE);
filter->mcastcipherset =
wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MCAST_CIPHER);
filter->ucastcipherset =
wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_UCAST_CIPHER);
filter->key_mgmt =
wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
filter->mgmtcipherset =
wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MGMT_CIPHER);
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS csr_fill_crypto_params(struct mac_context *mac_ctx,
struct csr_roam_profile *profile,
struct scan_filter *filter,
uint8_t vdev_id)
{
if (profile->force_rsne_override) {
sme_debug("force_rsne_override do not set authmode and set ignore pmf cap");
filter->ignore_pmf_cap = true;
return QDF_STATUS_SUCCESS;
}
return csr_fill_filter_from_vdev_crypto(mac_ctx, filter, vdev_id);
}
#else
static QDF_STATUS csr_fill_crypto_params(struct mac_context *mac_ctx,
struct csr_roam_profile *profile,
struct scan_filter *filter,
uint8_t vdev_id)
{
uint8_t i;
if (profile->force_rsne_override) {
sme_debug("force_rsne_override set auth type and enctype to any and ignore pmf cap");
filter->num_of_auth = 1;
filter->auth_type[0] = WLAN_AUTH_TYPE_ANY;
filter->num_of_enc_type = 1;
filter->enc_type[0] = WLAN_ENCRYPT_TYPE_ANY;
filter->num_of_mc_enc_type = 1;
filter->mc_enc_type[0] = WLAN_ENCRYPT_TYPE_ANY;
filter->ignore_pmf_cap = true;
} else {
filter->num_of_auth =
profile->AuthType.numEntries;
if (filter->num_of_auth > WLAN_NUM_OF_SUPPORT_AUTH_TYPE)
filter->num_of_auth = WLAN_NUM_OF_SUPPORT_AUTH_TYPE;
for (i = 0; i < filter->num_of_auth; i++)
filter->auth_type[i] =
csr_covert_auth_type_new(
profile->AuthType.authType[i]);
filter->num_of_enc_type =
profile->EncryptionType.numEntries;
if (filter->num_of_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE)
filter->num_of_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE;
for (i = 0; i < filter->num_of_enc_type; i++)
filter->enc_type[i] =
csr_covert_enc_type_new(
profile->EncryptionType.encryptionType[i]);
filter->num_of_mc_enc_type =
profile->mcEncryptionType.numEntries;
if (filter->num_of_mc_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE)
filter->num_of_mc_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE;
for (i = 0; i < filter->num_of_mc_enc_type; i++)
filter->mc_enc_type[i] =
csr_covert_enc_type_new(
profile->mcEncryptionType.encryptionType[i]);
}
return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS QDF_STATUS
csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx, csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
struct scan_filter *filter, struct scan_filter *filter,
bool is_roam) bool is_roam,
uint8_t vdev_id)
{ {
tCsrChannelInfo *ch_info; tCsrChannelInfo *ch_info;
struct roam_ext_params *roam_params; struct roam_ext_params *roam_params;
uint8_t i; uint8_t i;
uint32_t phy_mode; uint32_t phy_mode;
QDF_STATUS status;
if (!filter || !profile) { if (!filter || !profile) {
sme_err("filter or profile is NULL"); sme_err("filter or profile is NULL");
@@ -10872,42 +10980,10 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
filter); filter);
} }
if (profile->force_rsne_override) { status = csr_fill_crypto_params(mac_ctx, profile, filter, vdev_id);
sme_debug("force_rsne_override set auth type and enctype to any and ignore pmf cap"); if (QDF_IS_STATUS_ERROR(status))
filter->num_of_auth = 1; return status;
filter->auth_type[0] = WLAN_AUTH_TYPE_ANY;
filter->num_of_enc_type = 1;
filter->enc_type[0] = WLAN_ENCRYPT_TYPE_ANY;
filter->num_of_mc_enc_type = 1;
filter->mc_enc_type[0] = WLAN_ENCRYPT_TYPE_ANY;
filter->ignore_pmf_cap = true;
} else {
filter->num_of_auth =
profile->AuthType.numEntries;
if (filter->num_of_auth > WLAN_NUM_OF_SUPPORT_AUTH_TYPE)
filter->num_of_auth = WLAN_NUM_OF_SUPPORT_AUTH_TYPE;
for (i = 0; i < filter->num_of_auth; i++)
filter->auth_type[i] =
csr_covert_auth_type_new(
profile->AuthType.authType[i]);
filter->num_of_enc_type =
profile->EncryptionType.numEntries;
if (filter->num_of_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE)
filter->num_of_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE;
for (i = 0; i < filter->num_of_enc_type; i++)
filter->enc_type[i] =
csr_covert_enc_type_new(
profile->EncryptionType.encryptionType[i]);
filter->num_of_mc_enc_type =
profile->mcEncryptionType.numEntries;
if (filter->num_of_mc_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE)
filter->num_of_mc_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE;
for (i = 0; i < filter->num_of_mc_enc_type; i++)
filter->mc_enc_type[i] =
csr_covert_enc_type_new(
profile->mcEncryptionType.encryptionType[i]);
}
phy_mode = profile->phyMode; phy_mode = profile->phyMode;
csr_update_phy_mode(profile, &phy_mode); csr_update_phy_mode(profile, &phy_mode);
@@ -15342,9 +15418,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
csr_translate_encrypt_type_to_ed_type csr_translate_encrypt_type_to_ed_type
(pProfile->negotiatedUCEncryptionType); (pProfile->negotiatedUCEncryptionType);
csr_join_req->MCEncryptionType =
csr_translate_encrypt_type_to_ed_type
(pProfile->negotiatedMCEncryptionType);
#ifdef FEATURE_WLAN_ESE #ifdef FEATURE_WLAN_ESE
ese_config = mac->mlme_cfg->lfr.ese_enabled; ese_config = mac->mlme_cfg->lfr.ese_enabled;
#endif #endif
@@ -20622,7 +20695,7 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
status = sme_get_beacon_frm(mac_handle, profile, bssid, status = sme_get_beacon_frm(mac_handle, profile, bssid,
&fastreassoc->frame_buf, &fastreassoc->frame_buf,
&fastreassoc->frame_len, &fastreassoc->frame_len,
&ch_freq); &ch_freq, vdev_id);
if (!ch_freq) { if (!ch_freq) {
sme_err("channel retrieval from BSS desc fails!"); sme_err("channel retrieval from BSS desc fails!");

View File

@@ -159,7 +159,8 @@ QDF_STATUS csr_scan_handle_search_for_ssid(struct mac_context *mac_ctx,
break; break;
} }
status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile, status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile,
filter, false); filter, false,
session_id);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
qdf_mem_free(filter); qdf_mem_free(filter);
break; break;
@@ -1888,7 +1889,8 @@ csr_scan_get_channel_for_hw_mode_change(struct mac_context *mac_ctx,
uint32_t first_ap_ch_freq = 0, candidate_ch_freq; uint32_t first_ap_ch_freq = 0, candidate_ch_freq;
status = sme_get_ap_channel_from_scan_cache(profile, &result_handle, status = sme_get_ap_channel_from_scan_cache(profile, &result_handle,
&first_ap_ch_freq); &first_ap_ch_freq,
session_id);
if (status != QDF_STATUS_SUCCESS || !result_handle || if (status != QDF_STATUS_SUCCESS || !result_handle ||
!first_ap_ch_freq) { !first_ap_ch_freq) {
if (result_handle) if (result_handle)
@@ -1917,6 +1919,182 @@ csr_scan_get_channel_for_hw_mode_change(struct mac_context *mac_ctx,
return candidate_ch_freq; return candidate_ch_freq;
} }
#ifdef WLAN_SCAN_SECURITY_FILTER_V1
static void csr_fill_rsn_auth_type(enum csr_akm_type *auth_type, uint32_t akm)
{
/* Try the more preferred ones first. */
if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384))
*auth_type = eCSR_AUTH_TYPE_FT_FILS_SHA384;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA256))
*auth_type = eCSR_AUTH_TYPE_FT_FILS_SHA256;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384))
*auth_type = eCSR_AUTH_TYPE_FILS_SHA384;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA256))
*auth_type = eCSR_AUTH_TYPE_FILS_SHA256;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE))
*auth_type = eCSR_AUTH_TYPE_FT_SAE;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_SAE))
*auth_type = eCSR_AUTH_TYPE_SAE;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_DPP))
*auth_type = eCSR_AUTH_TYPE_DPP_RSN;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_OSEN))
*auth_type = eCSR_AUTH_TYPE_OSEN;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_OWE))
*auth_type = eCSR_AUTH_TYPE_OWE;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X))
*auth_type = eCSR_AUTH_TYPE_FT_RSN;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_PSK))
*auth_type = eCSR_AUTH_TYPE_FT_RSN_PSK;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X))
*auth_type = eCSR_AUTH_TYPE_RSN;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK))
*auth_type = eCSR_AUTH_TYPE_RSN_PSK;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_CCKM))
*auth_type = eCSR_AUTH_TYPE_CCKM_RSN;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK_SHA256))
*auth_type = eCSR_AUTH_TYPE_RSN_PSK_SHA256;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SHA256))
*auth_type = eCSR_AUTH_TYPE_RSN_8021X_SHA256;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SUITE_B))
*auth_type = eCSR_AUTH_TYPE_SUITEB_EAP_SHA256;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SUITE_B_192))
*auth_type = eCSR_AUTH_TYPE_SUITEB_EAP_SHA384;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384))
*auth_type = eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384;
else
*auth_type = eCSR_AUTH_TYPE_NONE;
}
static void csr_fill_wpa_auth_type(enum csr_akm_type *auth_type, uint32_t akm)
{
/* Try the more preferred ones first. */
if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X))
*auth_type = eCSR_AUTH_TYPE_WPA;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK))
*auth_type = eCSR_AUTH_TYPE_WPA_PSK;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_CCKM))
*auth_type = eCSR_AUTH_TYPE_CCKM_WPA;
else
*auth_type = eCSR_AUTH_TYPE_WPA_NONE;
}
static void csr_fill_wapi_auth_type(enum csr_akm_type *auth_type, uint32_t akm)
{
/* Try the more preferred ones first. */
if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_WAPI_CERT))
*auth_type = eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE;
else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_WAPI_PSK))
*auth_type = eCSR_AUTH_TYPE_WAPI_WAI_PSK;
else
*auth_type = eCSR_AUTH_TYPE_NONE;
}
static void csr_fill_auth_type(enum csr_akm_type *auth_type,
uint32_t authmodeset, uint32_t akm,
uint32_t ucastcipherset)
{
if (!authmodeset) {
*auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM;
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_NONE) ||
QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_OPEN)) {
*auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM;
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_AUTO)) {
if ((QDF_HAS_PARAM(ucastcipherset, WLAN_CRYPTO_CIPHER_WEP) ||
QDF_HAS_PARAM(ucastcipherset, WLAN_CRYPTO_CIPHER_WEP_40) ||
QDF_HAS_PARAM(ucastcipherset, WLAN_CRYPTO_CIPHER_WEP_104)))
*auth_type = eCSR_AUTH_TYPE_AUTOSWITCH;
else
*auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM;
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_SHARED)) {
*auth_type = eCSR_AUTH_TYPE_SHARED_KEY;
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_8021X) ||
QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_RSNA) ||
QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_CCKM) ||
QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_SAE) ||
QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_FILS_SK)) {
csr_fill_rsn_auth_type(auth_type, akm);
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_WPA)) {
csr_fill_wpa_auth_type(auth_type, akm);
return;
}
if (QDF_HAS_PARAM(authmodeset, WLAN_CRYPTO_AUTH_SHARED)) {
csr_fill_wapi_auth_type(auth_type, akm);
return;
}
*auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM;
}
static void csr_fill_enc_type(eCsrEncryptionType *cipher_type,
uint32_t cipherset)
{
if (!cipherset) {
*cipher_type = eCSR_ENCRYPT_TYPE_NONE;
return;
}
if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_GCM_256))
*cipher_type = eCSR_ENCRYPT_TYPE_AES_GCMP_256;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_GCM))
*cipher_type = eCSR_ENCRYPT_TYPE_AES_GCMP;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_CCM) ||
QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_OCB) ||
QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_CCM_256))
*cipher_type = eCSR_ENCRYPT_TYPE_AES;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_TKIP))
*cipher_type = eCSR_ENCRYPT_TYPE_TKIP;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_CMAC) ||
QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_CMAC_256))
*cipher_type = eCSR_ENCRYPT_TYPE_AES_CMAC;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_WAPI_GCM4) ||
QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_WAPI_SMS4))
*cipher_type = eCSR_ENCRYPT_TYPE_WPI;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_GMAC))
*cipher_type = eCSR_ENCRYPT_TYPE_AES_GMAC_128;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_AES_GMAC_256))
*cipher_type = eCSR_ENCRYPT_TYPE_AES_GMAC_256;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_WEP))
*cipher_type = eCSR_ENCRYPT_TYPE_WEP40;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_WEP_40))
*cipher_type = eCSR_ENCRYPT_TYPE_WEP40;
else if (QDF_HAS_PARAM(cipherset, WLAN_CRYPTO_CIPHER_WEP_104))
*cipher_type = eCSR_ENCRYPT_TYPE_WEP104;
else
*cipher_type = eCSR_ENCRYPT_TYPE_NONE;
}
static void csr_fill_neg_crypto_info(struct tag_csrscan_result *bss,
struct security_info *sec_info)
{
csr_fill_enc_type(&bss->ucEncryptionType, sec_info->ucastcipherset);
csr_fill_enc_type(&bss->mcEncryptionType, sec_info->mcastcipherset);
csr_fill_auth_type(&bss->authType, sec_info->authmodeset,
sec_info->key_mgmt, sec_info->ucastcipherset);
sme_debug("Authmode %x, AKM %x, Cipher Uc %x Mc %x CSR: Auth %d, Cipher Uc %d Mc %d",
sec_info->authmodeset, sec_info->key_mgmt,
sec_info->ucastcipherset, sec_info->mcastcipherset,
bss->authType, bss->ucEncryptionType, bss->mcEncryptionType);
}
#else
enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth) enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth)
{ {
switch (auth) { switch (auth) {
@@ -2118,6 +2296,19 @@ static eCsrEncryptionType csr_covert_enc_type_old(enum wlan_enc_type enc)
} }
} }
static void csr_fill_neg_crypto_info(struct tag_csrscan_result *bss,
struct security_info *sec_info)
{
bss->ucEncryptionType =
csr_covert_enc_type_old(sec_info->uc_enc);
bss->mcEncryptionType =
csr_covert_enc_type_old(sec_info->mc_enc);
bss->authType =
csr_covert_auth_type_old(sec_info->auth_type);
}
#endif
#ifdef WLAN_FEATURE_FILS_SK #ifdef WLAN_FEATURE_FILS_SK
/** /**
* csr_update_bss_with_fils_data: Fill FILS params in bss desc from scan entry * csr_update_bss_with_fils_data: Fill FILS params in bss desc from scan entry
@@ -2225,6 +2416,7 @@ csr_fill_single_pmk_ap_cap_from_scan_entry(struct bss_description *bss_desc,
{ {
} }
#endif #endif
static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx, static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx,
struct scan_cache_entry *scan_entry, struct scan_cache_entry *scan_entry,
struct tag_csrscan_result **p_result) struct tag_csrscan_result **p_result)
@@ -2262,12 +2454,7 @@ static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx,
if (!bss) if (!bss)
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
bss->ucEncryptionType = csr_fill_neg_crypto_info(bss, &scan_entry->neg_sec_info);
csr_covert_enc_type_old(scan_entry->neg_sec_info.uc_enc);
bss->mcEncryptionType =
csr_covert_enc_type_old(scan_entry->neg_sec_info.mc_enc);
bss->authType =
csr_covert_auth_type_old(scan_entry->neg_sec_info.auth_type);
bss->bss_score = scan_entry->bss_score; bss->bss_score = scan_entry->bss_score;
result_info = &bss->Result; result_info = &bss->Result;
@@ -2683,6 +2870,7 @@ void csr_init_occupied_channels_list(struct mac_context *mac_ctx,
tpCsrNeighborRoamControlInfo neighbor_roam_info = tpCsrNeighborRoamControlInfo neighbor_roam_info =
&mac_ctx->roam.neighborRoamInfo[sessionId]; &mac_ctx->roam.neighborRoamInfo[sessionId];
tCsrRoamConnectedProfile *profile = NULL; tCsrRoamConnectedProfile *profile = NULL;
QDF_STATUS status;
if (!(mac_ctx && mac_ctx->roam.roamSession && if (!(mac_ctx && mac_ctx->roam.roamSession &&
CSR_IS_SESSION_VALID(mac_ctx, sessionId))) { CSR_IS_SESSION_VALID(mac_ctx, sessionId))) {
@@ -2708,13 +2896,13 @@ void csr_init_occupied_channels_list(struct mac_context *mac_ctx,
return; return;
} }
filter->num_of_auth = 1; status = csr_fill_crypto_params_connected_profile(mac_ctx, profile,
filter->auth_type[0] = csr_covert_auth_type_new(profile->AuthType); filter, sessionId);
filter->num_of_enc_type = 1; if (QDF_IS_STATUS_ERROR(status)) {
filter->enc_type[0] = csr_covert_enc_type_new(profile->EncryptionType); sme_err("fail to fill filter crypto");
filter->num_of_mc_enc_type = 1; qdf_mem_free(filter);
filter->mc_enc_type[0] = return;
csr_covert_enc_type_new(profile->mcEncryptionType); }
filter->num_of_ssid = 1; filter->num_of_ssid = 1;
filter->ssid_list[0].length = profile->SSID.length; filter->ssid_list[0].length = profile->SSID.length;
qdf_mem_copy(filter->ssid_list[0].ssid, profile->SSID.ssId, qdf_mem_copy(filter->ssid_list[0].ssid, profile->SSID.ssId,

View File

@@ -418,6 +418,21 @@ csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx,
} }
#endif #endif
#ifdef WLAN_SCAN_SECURITY_FILTER_V1
/*
* csr_fill_filter_from_vdev_crypto() - fill scan filter crypto from vdev crypto
* @mac_ctx: csr auth type
* @filter: scan filter
* @vdev_id: vdev
*
* Return QDF_STATUS
*/
QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
struct scan_filter *filter,
uint8_t vdev_id);
#else
/* /*
* csr_covert_enc_type_new() - convert csr enc type to wlan enc type * csr_covert_enc_type_new() - convert csr enc type to wlan enc type
* @enc: csr enc type * @enc: csr enc type
@@ -433,6 +448,15 @@ enum wlan_enc_type csr_covert_enc_type_new(eCsrEncryptionType enc);
* Return enum wlan_auth_type * Return enum wlan_auth_type
*/ */
enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth); enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth);
#endif
/*
* csr_set_open_mode_in_scan_filter() - set open mode in scan filter
* @filter: scan filter
*
* Return void
*/
void csr_set_open_mode_in_scan_filter(struct scan_filter *filter);
/** /**
* csr_roam_get_scan_filter_from_profile() - prepare scan filter from * csr_roam_get_scan_filter_from_profile() - prepare scan filter from
@@ -441,6 +465,7 @@ enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth);
* @profile: roam profile * @profile: roam profile
* @filter: Populated scan filter based on the connected profile * @filter: Populated scan filter based on the connected profile
* @is_roam: if filter is for roam * @is_roam: if filter is for roam
* @vdev_id: vdev
* *
* This function creates a scan filter based on the roam profile. Based on this * This function creates a scan filter based on the roam profile. Based on this
* filter, scan results are obtained. * filter, scan results are obtained.
@@ -451,7 +476,23 @@ QDF_STATUS
csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx, csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
struct scan_filter *filter, struct scan_filter *filter,
bool is_roam); bool is_roam, uint8_t vdev_id);
/*
* csr_fill_crypto_params_connected_profile() - fill scan filter crypto from
* connected profile
* @mac_ctx: csr auth type
* @profile: connected profile
* @filter: scan filter
* @vdev_id: vdev
*
* Return QDF_STATUS
*/
QDF_STATUS
csr_fill_crypto_params_connected_profile(struct mac_context *mac_ctx,
tCsrRoamConnectedProfile *profile,
struct scan_filter *filter,
uint8_t vdev_id);
/** /**
* csr_neighbor_roam_get_scan_filter_from_profile() - prepare scan filter from * csr_neighbor_roam_get_scan_filter_from_profile() - prepare scan filter from

View File

@@ -340,6 +340,35 @@ csr_update_pmf_cap_from_connected_profile(tCsrRoamConnectedProfile *profile,
{} {}
#endif #endif
#ifdef WLAN_SCAN_SECURITY_FILTER_V1
QDF_STATUS
csr_fill_crypto_params_connected_profile(struct mac_context *mac_ctx,
tCsrRoamConnectedProfile *profile,
struct scan_filter *filter,
uint8_t vdev_id)
{
return csr_fill_filter_from_vdev_crypto(mac_ctx, filter, vdev_id);
}
#else
QDF_STATUS
csr_fill_crypto_params_connected_profile(struct mac_context *mac_ctx,
tCsrRoamConnectedProfile *profile,
struct scan_filter *filter,
uint8_t vdev_id)
{
filter->num_of_auth = 1;
filter->auth_type[0] = csr_covert_auth_type_new(profile->AuthType);
filter->num_of_enc_type = 1;
filter->enc_type[0] =
csr_covert_enc_type_new(profile->EncryptionType);
filter->num_of_mc_enc_type = 1;
filter->mc_enc_type[0] =
csr_covert_enc_type_new(profile->mcEncryptionType);
return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS QDF_STATUS
csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac, csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
struct scan_filter *filter, struct scan_filter *filter,
@@ -350,6 +379,7 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
struct roam_ext_params *roam_params; struct roam_ext_params *roam_params;
tCsrChannelInfo *chan_info; tCsrChannelInfo *chan_info;
uint8_t num_ch = 0; uint8_t num_ch = 0;
QDF_STATUS status;
if (!filter) if (!filter)
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
@@ -390,14 +420,10 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
filter->ssid_list[0].length); filter->ssid_list[0].length);
} }
filter->num_of_auth = 1; status = csr_fill_crypto_params_connected_profile(mac, profile, filter,
filter->auth_type[0] = csr_covert_auth_type_new(profile->AuthType); vdev_id);
filter->num_of_enc_type = 1; if (QDF_IS_STATUS_ERROR(status))
filter->enc_type[0] = return status;
csr_covert_enc_type_new(profile->EncryptionType);
filter->num_of_mc_enc_type = 1;
filter->mc_enc_type[0] =
csr_covert_enc_type_new(profile->mcEncryptionType);
chan_info = &nbr_roam_info->roamChannelInfo.currentChannelListInfo; chan_info = &nbr_roam_info->roamChannelInfo.currentChannelListInfo;
num_ch = chan_info->numOfChannels; num_ch = chan_info->numOfChannels;