mwifiex: update signal strength in mBm units
authorAmitkumar Karwar <akarwar@marvell.com>
Fri, 16 Mar 2012 03:51:47 +0000 (20:51 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Apr 2012 20:05:57 +0000 (16:05 -0400)
During wiphy registration signal_type is initialized to
CFG80211_SIGNAL_TYPE_MBM. So convert signal strength from dBm to
mBm. Also, the value is absolute. Make it negative before
sending to cfg80211.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/scan.c

index 5948905ff615337e572c90054ebd87e43283ba6c..ef84a1a6742f7e7aaa56b1cd5c3261d230609bfe 100644 (file)
@@ -1667,8 +1667,9 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 
                memcpy(bssid, bcn_param->bssid, ETH_ALEN);
 
-               rssi = (s32) (bcn_param->rssi);
-               dev_dbg(adapter->dev, "info: InterpretIE: RSSI=%02X\n", rssi);
+               rssi = (s32) bcn_param->rssi;
+               rssi = (-rssi) * 100;           /* Convert dBm to mBm */
+               dev_dbg(adapter->dev, "info: InterpretIE: RSSI=%d\n", rssi);
 
                beacon_period = le16_to_cpu(bcn_param->beacon_period);