From 4b9273d71243f5000e84ec921fa9b1e9145fbdf7 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 17 Jun 2020 18:17:43 +0530 Subject: [PATCH] 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 --- Kbuild | 2 + .../policy_mgr/inc/wlan_policy_mgr_api.h | 5 +- .../src/wlan_policy_mgr_get_set_utils.c | 17 +- core/hdd/src/wlan_hdd_cfg80211.c | 3 +- core/hdd/src/wlan_hdd_main.c | 3 +- core/mac/inc/sir_api.h | 2 - core/sme/inc/sme_api.h | 39 +++- core/sme/src/common/sme_api.c | 38 +-- core/sme/src/csr/csr_api_roam.c | 171 ++++++++++---- core/sme/src/csr/csr_api_scan.c | 218 ++++++++++++++++-- core/sme/src/csr/csr_inside_api.h | 43 +++- core/sme/src/csr/csr_neighbor_roam.c | 42 +++- 12 files changed, 452 insertions(+), 131 deletions(-) diff --git a/Kbuild b/Kbuild index 3ab60d9b0cda..c0c5aefcefb1 100644 --- a/Kbuild +++ b/Kbuild @@ -2721,6 +2721,8 @@ cppflags-$(CONFIG_WLAN_OBJMGR_DEBUG) += -DWLAN_OBJMGR_REF_ID_DEBUG cppflags-$(CONFIG_WLAN_FEATURE_SAE) += -DWLAN_FEATURE_SAE +cppflags-y += -DWLAN_SCAN_SECURITY_FILTER_V1 + ifeq ($(BUILD_DIAG_VERSION), y) cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT cppflags-y += -DFEATURE_WLAN_DIAG_SUPPORT_CSR diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 2602f12f31cb..32028a700b64 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1372,7 +1372,7 @@ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_get_ap_channel_from_scan)( void *roam_profile, void **scan_cache, - uint32_t *ch_freq); + uint32_t *ch_freq, uint8_t vdev_id); QDF_STATUS (*sme_scan_result_purge)( void *scan_result); 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 * @roam_profile: pointer to roam profile * @ch_freq: channel frequency to be filled + * @vdev_id: vdev id * * This routine gets channel which most likely a candidate to which STA * will make connection. @@ -1616,7 +1617,7 @@ bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode, QDF_STATUS policy_mgr_get_channel_from_scan_result(struct wlan_objmgr_psoc *psoc, 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 diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index ca9b1a803d6d..b62ce9c52168 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -2650,20 +2650,9 @@ uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc) 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( 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; 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) { 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) { policy_mgr_err("Get AP channel failed"); return status; @@ -2754,7 +2743,7 @@ uint32_t policy_mgr_search_and_check_for_session_conc( return ch_freq; 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) { policy_mgr_err("%s error %d %d", __func__, status, ch_freq); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 76941432e41d..1763fa005176 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -18102,7 +18102,8 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter, * connect by passing its roam_profile. */ 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 diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c6ebef7f5a98..f4ed4224a2ce 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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); mac_handle = hdd_adapter_get_mac_handle(adapter); 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) { hdd_warn("sme_get_rssi_snr_by_bssid failed"); return -EINVAL; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9207953cb499..0fdd6f87c1fa 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -937,8 +937,6 @@ struct join_req { /* (Re) Association Request */ tAniEdType UCEncryptionType; - - tAniEdType MCEncryptionType; enum ani_akm_type akm; bool is11Rconnection; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index eb8f7ead862f..cba9c04a2859 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -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, struct scan_filter *filter, 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 - * AP's channel id from - * CSR by filtering the - * result which matches - * our roam profile. + * sme_get_ap_channel_from_scan_cache() - a wrapper function to get AP's channel + * 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 + * 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 * 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, 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, 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 * @rssi: rssi value found * @snr: snr value found + * @vdev_id: vdev id * * Return: QDF_STATUS */ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle, struct csr_roam_profile *profile, 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 @@ -2421,6 +2435,7 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle, * @frame_buf: frame buffer to populate * @frame_len: length of constructed frame * @ch_freq: Pointer to channel freq info to be filled + * @vdev_id: vdev id * * Return: QDF_STATUS */ @@ -2428,7 +2443,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle, struct csr_roam_profile *profile, const tSirMacAddr bssid, 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 /** diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 4bdaaabe73d6..9210f7883703 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -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, tScanResultHandle *scan_cache, - uint32_t *ap_ch_freq) + uint32_t *ap_ch_freq, + uint8_t vdev_id) { QDF_STATUS status; status = sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *) profile, scan_cache, - ap_ch_freq); + ap_ch_freq, vdev_id); 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( 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; 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)); if (!profile) { - /* No encryption */ - scan_filter->num_of_enc_type = 1; - scan_filter->enc_type[0] = WLAN_ENCRYPT_TYPE_NONE; + csr_set_open_mode_in_scan_filter(scan_filter); } else { /* Here is the profile we need to connect to */ - status = csr_roam_get_scan_filter_from_profile(mac_ctx, - profile, + status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile, scan_filter, - false); + false, vdev_id); } 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, struct csr_roam_profile *profile, 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 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, profile, scan_filter, - false); + false, vdev_id); if (QDF_STATUS_SUCCESS != status) { sme_err("prepare_filter failed"); 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, const tSirMacAddr bssid, 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; 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, profile, scan_filter, - false); + false, vdev_id); if (QDF_IS_STATUS_ERROR(status)) { sme_err("prepare_filter failed"); status = QDF_STATUS_E_FAULT; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a1bb43ace175..9ebf38ed1d61 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -3342,7 +3342,7 @@ csr_connect_info(struct mac_context *mac_ctx, sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx), session->pCurRoamProfile, &conn_stats.bssid[0], - &conn_stats.rssi, NULL); + &conn_stats.rssi, NULL, session->vdev_id); conn_stats.est_link_speed = 0; conn_stats.chnl_bw = 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), session->pCurRoamProfile, conn_profile->bssid.bytes, - &rssi, NULL); + &rssi, NULL, session->vdev_id); len += qdf_scnprintf(buf + len, buf_sz - len, "\n\trssi: %d", rssi); 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 = scan_result->mcEncryptionType; } + cmd->u.roamCmd.roamProfile.negotiatedAuthType = scan_result->authType; 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, struct csr_roam_profile *pProfile, 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 */ 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. * 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, filter); + csr_set_open_mode_in_scan_filter(filter); } else { /* Here is the profile we need to connect to */ status = csr_roam_get_scan_filter_from_profile(mac, pProfile, - filter, false); + filter, false, + sessionId); opmode = pProfile->csrPersona; } roamId = GET_NEXT_ROAM_ID(&mac->roam); @@ -9779,13 +9792,14 @@ csr_post_roam_failure(struct mac_context *mac_ctx, * @mac: mac global context * @neighbor_roam_info: roam info struct * @hBSSList: scan result + * @vdev_id: vdev id * * Return: true if found else false. */ static bool csr_check_profile_in_scan_cache(struct mac_context *mac_ctx, tpCsrNeighborRoamControlInfo neighbor_roam_info, - tScanResultHandle *hBSSList) + tScanResultHandle *hBSSList, uint8_t vdev_id) { QDF_STATUS status; 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, &neighbor_roam_info->csrNeighborRoamProfile, - scan_filter, true); + scan_filter, true, vdev_id); if (!QDF_IS_STATUS_SUCCESS(status)) { sme_err( "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 (!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; /* 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 +#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 csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx, struct csr_roam_profile *profile, struct scan_filter *filter, - bool is_roam) + bool is_roam, + uint8_t vdev_id) { tCsrChannelInfo *ch_info; struct roam_ext_params *roam_params; uint8_t i; uint32_t phy_mode; + QDF_STATUS status; if (!filter || !profile) { sme_err("filter or profile is NULL"); @@ -10872,42 +10980,10 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx, filter); } - 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; + status = csr_fill_crypto_params(mac_ctx, profile, filter, vdev_id); + if (QDF_IS_STATUS_ERROR(status)) + return status; - 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; 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 (pProfile->negotiatedUCEncryptionType); - csr_join_req->MCEncryptionType = - csr_translate_encrypt_type_to_ed_type - (pProfile->negotiatedMCEncryptionType); #ifdef FEATURE_WLAN_ESE ese_config = mac->mlme_cfg->lfr.ese_enabled; #endif @@ -20622,7 +20695,7 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle, status = sme_get_beacon_frm(mac_handle, profile, bssid, &fastreassoc->frame_buf, &fastreassoc->frame_len, - &ch_freq); + &ch_freq, vdev_id); if (!ch_freq) { sme_err("channel retrieval from BSS desc fails!"); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 42a3fa213efc..10a3e9404e79 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -159,7 +159,8 @@ QDF_STATUS csr_scan_handle_search_for_ssid(struct mac_context *mac_ctx, break; } status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile, - filter, false); + filter, false, + session_id); if (!QDF_IS_STATUS_SUCCESS(status)) { qdf_mem_free(filter); 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; 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 || !first_ap_ch_freq) { if (result_handle) @@ -1917,6 +1919,182 @@ csr_scan_get_channel_for_hw_mode_change(struct mac_context *mac_ctx, 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) { 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 /** * 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 + static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx, struct scan_cache_entry *scan_entry, 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) return QDF_STATUS_E_NOMEM; - bss->ucEncryptionType = - 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); + csr_fill_neg_crypto_info(bss, &scan_entry->neg_sec_info); bss->bss_score = scan_entry->bss_score; result_info = &bss->Result; @@ -2683,6 +2870,7 @@ void csr_init_occupied_channels_list(struct mac_context *mac_ctx, tpCsrNeighborRoamControlInfo neighbor_roam_info = &mac_ctx->roam.neighborRoamInfo[sessionId]; tCsrRoamConnectedProfile *profile = NULL; + QDF_STATUS status; if (!(mac_ctx && mac_ctx->roam.roamSession && CSR_IS_SESSION_VALID(mac_ctx, sessionId))) { @@ -2708,13 +2896,13 @@ void csr_init_occupied_channels_list(struct mac_context *mac_ctx, return; } - 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); + status = csr_fill_crypto_params_connected_profile(mac_ctx, profile, + filter, sessionId); + if (QDF_IS_STATUS_ERROR(status)) { + sme_err("fail to fill filter crypto"); + qdf_mem_free(filter); + return; + } filter->num_of_ssid = 1; filter->ssid_list[0].length = profile->SSID.length; qdf_mem_copy(filter->ssid_list[0].ssid, profile->SSID.ssId, diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index f4795329f1da..acb2838e8bde 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -418,6 +418,21 @@ csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx, } #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 * @enc: csr enc type @@ -433,6 +448,15 @@ enum wlan_enc_type csr_covert_enc_type_new(eCsrEncryptionType enc); * Return enum wlan_auth_type */ 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 @@ -441,6 +465,7 @@ enum wlan_auth_type csr_covert_auth_type_new(enum csr_akm_type auth); * @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. @@ -451,7 +476,23 @@ 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); + 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 diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 8689e109c92e..c8ea2b74e69b 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -340,6 +340,35 @@ csr_update_pmf_cap_from_connected_profile(tCsrRoamConnectedProfile *profile, {} #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 csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac, 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; tCsrChannelInfo *chan_info; uint8_t num_ch = 0; + QDF_STATUS status; if (!filter) 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->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); + status = csr_fill_crypto_params_connected_profile(mac, profile, filter, + vdev_id); + if (QDF_IS_STATUS_ERROR(status)) + return status; chan_info = &nbr_roam_info->roamChannelInfo.currentChannelListInfo; num_ch = chan_info->numOfChannels;