qcacmn: Add security info in scan entry

Add security info in scan entry and print the same.

Change-Id: If8f0c05a526b86cb3ae0020c2e144beb3510cb98
CRs-Fixed: 2603004
This commit is contained in:
Abhishek Singh
2019-12-18 14:28:43 +05:30
gecommit door nshrivas
bovenliggende c5a417e285
commit 87a5ab62be
3 gewijzigde bestanden met toevoegingen van 31 en 2 verwijderingen

Bestand weergeven

@@ -850,6 +850,7 @@ static QDF_STATUS scm_add_update_entry(struct wlan_objmgr_psoc *psoc,
QDF_STATUS status;
struct scan_dbs *scan_db;
struct wlan_scan_obj *scan_obj;
uint8_t security_type;
scan_db = wlan_pdev_get_scan_db(psoc, pdev);
if (!scan_db) {
@@ -878,7 +879,8 @@ static QDF_STATUS scm_add_update_entry(struct wlan_objmgr_psoc *psoc,
is_dup_found = scm_find_duplicate(pdev, scan_obj, scan_db, scan_params,
&dup_node);
scm_nofl_debug("Received %s: BSSID: %pM tsf_delta %u Seq %d ssid: %.*s rssi: %d snr %d freq %d phy_mode %d hidden %d chan_mismatch %d pdev %d",
security_type = scan_params->security_type;
scm_nofl_debug("Received %s: BSSID: %pM tsf_delta %u Seq %d ssid: %.*s rssi: %d snr %d freq %d phy_mode %d hidden %d chan_mismatch %d %s%s%s%s pdev %d",
(scan_params->frm_subtype == MGMT_SUBTYPE_PROBE_RESP) ?
"Probe Rsp" : "Beacon", scan_params->bssid.bytes,
scan_params->tsf_delta, scan_params->seq_num,
@@ -887,6 +889,10 @@ static QDF_STATUS scm_add_update_entry(struct wlan_objmgr_psoc *psoc,
scan_params->channel.chan_freq, scan_params->phy_mode,
scan_params->is_hidden_ssid,
scan_params->channel_mismatch,
security_type & SCAN_SECURITY_TYPE_WPA ? "[WPA]" : "",
security_type & SCAN_SECURITY_TYPE_RSN ? "[RSN]" : "",
security_type & SCAN_SECURITY_TYPE_WAPI ? "[WAPI]" : "",
security_type & SCAN_SECURITY_TYPE_WEP ? "[WEP]" : "",
wlan_objmgr_pdev_get_pdev_id(pdev));
if (scan_obj->cb.inform_beacon)

Bestand weergeven

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020 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
@@ -359,6 +359,11 @@ struct reduced_neighbor_report {
struct rnr_bss_info bss_info[MAX_RNR_BSS];
};
#define SCAN_SECURITY_TYPE_WEP 0x01
#define SCAN_SECURITY_TYPE_WPA 0x02
#define SCAN_SECURITY_TYPE_WAPI 0x04
#define SCAN_SECURITY_TYPE_RSN 0x08
/**
* struct scan_cache_entry: structure containing scan entry
* @frm_subtype: updated from beacon/probe
@@ -366,6 +371,7 @@ struct reduced_neighbor_report {
* @mac_addr: mac address
* @ssid: ssid
* @is_hidden_ssid: is AP having hidden ssid.
* @security_type: security supported
* @seq_num: sequence number
* @phy_mode: Phy mode of the AP
* @avg_rssi: Average RSSI of the AP
@@ -409,6 +415,7 @@ struct scan_cache_entry {
struct qdf_mac_addr mac_addr;
struct wlan_ssid ssid;
bool is_hidden_ssid;
uint8_t security_type;
uint16_t seq_num;
enum wlan_phymode phy_mode;
int32_t avg_rssi;

Bestand weergeven

@@ -1371,6 +1371,21 @@ static void scm_fill_adaptive_11r_cap(struct scan_cache_entry *scan_entry)
}
#endif
static void util_scan_set_security(struct scan_cache_entry *scan_params)
{
if (util_scan_entry_wpa(scan_params))
scan_params->security_type |= SCAN_SECURITY_TYPE_WPA;
if (util_scan_entry_rsn(scan_params))
scan_params->security_type |= SCAN_SECURITY_TYPE_RSN;
if (util_scan_entry_wapi(scan_params))
scan_params->security_type |= SCAN_SECURITY_TYPE_WAPI;
if (!scan_params->security_type &&
scan_params->cap_info.wlan_caps.privacy)
scan_params->security_type |= SCAN_SECURITY_TYPE_WEP;
}
static QDF_STATUS
util_scan_gen_scan_entry(struct wlan_objmgr_pdev *pdev,
uint8_t *frame, qdf_size_t frame_len,
@@ -1521,6 +1536,7 @@ util_scan_gen_scan_entry(struct wlan_objmgr_pdev *pdev,
scan_entry->nss = util_scan_scm_calc_nss_supported_by_ap(scan_entry);
scm_fill_adaptive_11r_cap(scan_entry);
util_scan_set_security(scan_entry);
util_scan_scm_update_bss_with_esp_data(scan_entry);
qbss_load = (struct qbss_load_ie *)