wil6210: Provide signal strength indication
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Thu, 27 Feb 2014 14:20:52 +0000 (16:20 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Feb 2014 19:33:36 +0000 (14:33 -0500)
When notifying about Rx mgmt (ex: during scan), extract
signal strength reported by the hardware.
signal is not MBM, it is arbitrary units 0..100

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/ath/wil6210/wmi.c

index 12e0539c8effa0a8695bf389ed14097fcaa2a1d1..c19e8954d8b3208b9e6e60039beb717cb642f884 100644 (file)
@@ -125,12 +125,13 @@ static int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
 
        wil_dbg_wmi(wil, "Link status for CID %d: {\n"
                    "  MCS %d TSF 0x%016llx\n"
-                   "  BF status 0x%08x SNR 0x%08x\n"
+                   "  BF status 0x%08x SNR 0x%08x SQI %d%%\n"
                    "  Tx Tpt %d goodput %d Rx goodput %d\n"
                    "  Sectors(rx:tx) my %d:%d peer %d:%d\n""}\n",
                    cid, le16_to_cpu(reply.evt.bf_mcs),
                    le64_to_cpu(reply.evt.tsf), reply.evt.status,
                    le32_to_cpu(reply.evt.snr_val),
+                   reply.evt.sqi,
                    le32_to_cpu(reply.evt.tx_tpt),
                    le32_to_cpu(reply.evt.tx_goodput),
                    le32_to_cpu(reply.evt.rx_goodput),
@@ -163,7 +164,7 @@ static int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
 
        if (test_bit(wil_status_fwconnected, &wil->status)) {
                sinfo->filled |= STATION_INFO_SIGNAL;
-               sinfo->signal = 12; /* TODO: provide real value */
+               sinfo->signal = reply.evt.sqi;
        }
 
        return rc;
@@ -698,7 +699,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)
        wiphy->bands[IEEE80211_BAND_60GHZ] = &wil_band_60ghz;
 
        /* TODO: figure this out */
-       wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+       wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
 
        wiphy->cipher_suites = wil_cipher_suites;
        wiphy->n_cipher_suites = ARRAY_SIZE(wil_cipher_suites);
index 8de7ffdc0f29d47cbee401236e0f7f334b2d75df..70b3a9b20450857ec4d371d8ef523738758167d1 100644 (file)
@@ -307,14 +307,14 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
        u32 freq = ieee80211_channel_to_frequency(ch_no,
                        IEEE80211_BAND_60GHZ);
        struct ieee80211_channel *channel = ieee80211_get_channel(wiphy, freq);
-       /* TODO convert LE to CPU */
-       s32 signal = 0; /* TODO */
+       s32 signal = data->info.sqi;
        __le16 fc = rx_mgmt_frame->frame_control;
        u32 d_len = le32_to_cpu(data->info.len);
        u16 d_status = le16_to_cpu(data->info.status);
 
-       wil_dbg_wmi(wil, "MGMT: channel %d MCS %d SNR %d\n",
-                   data->info.channel, data->info.mcs, data->info.snr);
+       wil_dbg_wmi(wil, "MGMT: channel %d MCS %d SNR %d SQI %d%%\n",
+                   data->info.channel, data->info.mcs, data->info.snr,
+                   data->info.sqi);
        wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len,
                    le16_to_cpu(fc));
        wil_dbg_wmi(wil, "qid %d mid %d cid %d\n",
@@ -487,11 +487,11 @@ static void wmi_evt_notify(struct wil6210_priv *wil, int id, void *d, int len)
        wil->stats.peer_rx_sector = le16_to_cpu(evt->other_rx_sector);
        wil->stats.peer_tx_sector = le16_to_cpu(evt->other_tx_sector);
        wil_dbg_wmi(wil, "Link status, MCS %d TSF 0x%016llx\n"
-                   "BF status 0x%08x SNR 0x%08x\n"
+                   "BF status 0x%08x SNR 0x%08x SQI %d%%\n"
                    "Tx Tpt %d goodput %d Rx goodput %d\n"
                    "Sectors(rx:tx) my %d:%d peer %d:%d\n",
                    wil->stats.bf_mcs, wil->stats.tsf, evt->status,
-                   wil->stats.snr, le32_to_cpu(evt->tx_tpt),
+                   wil->stats.snr, evt->sqi, le32_to_cpu(evt->tx_tpt),
                    le32_to_cpu(evt->tx_goodput), le32_to_cpu(evt->rx_goodput),
                    wil->stats.my_rx_sector, wil->stats.my_tx_sector,
                    wil->stats.peer_rx_sector, wil->stats.peer_tx_sector);
This page took 0.026778 seconds and 5 git commands to generate.