From b6cf30725ec7c0bf68218b95833e4fb549a928ef Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Mon, 18 Nov 2019 17:50:30 +0530 Subject: [PATCH] qcacld-3.0: Provide SNR value as SIGNAL_INFO to userspace for SAP Currently, userspace is expecting SNR value through NL80211_STA_INFO_SIGNAL for a disconnected client of SAP. But the driver sends RSSI value by doing noise floor to the SNR value received from firmware. Convert this back to SNR and provide to userspace as per the definition of NL80211_STA_INFO_SIGNAL and to be in sync with the existing implementation of userspace. Change-Id: Ia360424a9d44e48fae5a85cf0d2c577e92cd93be CRs-Fixed: 2552542 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_station_info.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 4d3680c5cf36..5fe5c3f94a76 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -403,6 +403,8 @@ enum hdd_driver_flags { #define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1) +#define HDD_NOISE_FLOOR_DBM (-96) + /** * enum hdd_auth_key_mgmt - auth key mgmt protocols * @HDD_AUTH_KEY_MGMT_802_1X: 802.1x diff --git a/core/hdd/src/wlan_hdd_station_info.c b/core/hdd/src/wlan_hdd_station_info.c index f485fa8bce74..076f2c571c95 100644 --- a/core/hdd/src/wlan_hdd_station_info.c +++ b/core/hdd/src/wlan_hdd_station_info.c @@ -821,7 +821,8 @@ static int32_t hdd_add_sta_info_sap(struct sk_buff *skb, int8_t rssi, if (!nla_attr) goto fail; - if (nla_put_u8(skb, NL80211_STA_INFO_SIGNAL, rssi)) { + if (nla_put_u8(skb, NL80211_STA_INFO_SIGNAL, + rssi - HDD_NOISE_FLOOR_DBM)) { hdd_err("put fail"); goto fail; }