diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-02-27 09:20:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:36 -0500 |
commit | b8b33a3a67ef0b3ca57a647aa6966a2310ae60bb (patch) | |
tree | 71327ec46639114e092a22a64e458d1eea6fc07e | |
parent | 93ae6d49e2ddd05431184779d8ace0bc189a597b (diff) |
wil6210: Provide signal strength indication
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>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 12e0539c8eff..c19e8954d8b3 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -125,12 +125,13 @@ static int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, | |||
125 | 125 | ||
126 | wil_dbg_wmi(wil, "Link status for CID %d: {\n" | 126 | wil_dbg_wmi(wil, "Link status for CID %d: {\n" |
127 | " MCS %d TSF 0x%016llx\n" | 127 | " MCS %d TSF 0x%016llx\n" |
128 | " BF status 0x%08x SNR 0x%08x\n" | 128 | " BF status 0x%08x SNR 0x%08x SQI %d%%\n" |
129 | " Tx Tpt %d goodput %d Rx goodput %d\n" | 129 | " Tx Tpt %d goodput %d Rx goodput %d\n" |
130 | " Sectors(rx:tx) my %d:%d peer %d:%d\n""}\n", | 130 | " Sectors(rx:tx) my %d:%d peer %d:%d\n""}\n", |
131 | cid, le16_to_cpu(reply.evt.bf_mcs), | 131 | cid, le16_to_cpu(reply.evt.bf_mcs), |
132 | le64_to_cpu(reply.evt.tsf), reply.evt.status, | 132 | le64_to_cpu(reply.evt.tsf), reply.evt.status, |
133 | le32_to_cpu(reply.evt.snr_val), | 133 | le32_to_cpu(reply.evt.snr_val), |
134 | reply.evt.sqi, | ||
134 | le32_to_cpu(reply.evt.tx_tpt), | 135 | le32_to_cpu(reply.evt.tx_tpt), |
135 | le32_to_cpu(reply.evt.tx_goodput), | 136 | le32_to_cpu(reply.evt.tx_goodput), |
136 | le32_to_cpu(reply.evt.rx_goodput), | 137 | le32_to_cpu(reply.evt.rx_goodput), |
@@ -163,7 +164,7 @@ static int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, | |||
163 | 164 | ||
164 | if (test_bit(wil_status_fwconnected, &wil->status)) { | 165 | if (test_bit(wil_status_fwconnected, &wil->status)) { |
165 | sinfo->filled |= STATION_INFO_SIGNAL; | 166 | sinfo->filled |= STATION_INFO_SIGNAL; |
166 | sinfo->signal = 12; /* TODO: provide real value */ | 167 | sinfo->signal = reply.evt.sqi; |
167 | } | 168 | } |
168 | 169 | ||
169 | return rc; | 170 | return rc; |
@@ -698,7 +699,7 @@ static void wil_wiphy_init(struct wiphy *wiphy) | |||
698 | wiphy->bands[IEEE80211_BAND_60GHZ] = &wil_band_60ghz; | 699 | wiphy->bands[IEEE80211_BAND_60GHZ] = &wil_band_60ghz; |
699 | 700 | ||
700 | /* TODO: figure this out */ | 701 | /* TODO: figure this out */ |
701 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | 702 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; |
702 | 703 | ||
703 | wiphy->cipher_suites = wil_cipher_suites; | 704 | wiphy->cipher_suites = wil_cipher_suites; |
704 | wiphy->n_cipher_suites = ARRAY_SIZE(wil_cipher_suites); | 705 | wiphy->n_cipher_suites = ARRAY_SIZE(wil_cipher_suites); |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 8de7ffdc0f29..70b3a9b20450 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -307,14 +307,14 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len) | |||
307 | u32 freq = ieee80211_channel_to_frequency(ch_no, | 307 | u32 freq = ieee80211_channel_to_frequency(ch_no, |
308 | IEEE80211_BAND_60GHZ); | 308 | IEEE80211_BAND_60GHZ); |
309 | struct ieee80211_channel *channel = ieee80211_get_channel(wiphy, freq); | 309 | struct ieee80211_channel *channel = ieee80211_get_channel(wiphy, freq); |
310 | /* TODO convert LE to CPU */ | 310 | s32 signal = data->info.sqi; |
311 | s32 signal = 0; /* TODO */ | ||
312 | __le16 fc = rx_mgmt_frame->frame_control; | 311 | __le16 fc = rx_mgmt_frame->frame_control; |
313 | u32 d_len = le32_to_cpu(data->info.len); | 312 | u32 d_len = le32_to_cpu(data->info.len); |
314 | u16 d_status = le16_to_cpu(data->info.status); | 313 | u16 d_status = le16_to_cpu(data->info.status); |
315 | 314 | ||
316 | wil_dbg_wmi(wil, "MGMT: channel %d MCS %d SNR %d\n", | 315 | wil_dbg_wmi(wil, "MGMT: channel %d MCS %d SNR %d SQI %d%%\n", |
317 | data->info.channel, data->info.mcs, data->info.snr); | 316 | data->info.channel, data->info.mcs, data->info.snr, |
317 | data->info.sqi); | ||
318 | wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len, | 318 | wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len, |
319 | le16_to_cpu(fc)); | 319 | le16_to_cpu(fc)); |
320 | wil_dbg_wmi(wil, "qid %d mid %d cid %d\n", | 320 | 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) | |||
487 | wil->stats.peer_rx_sector = le16_to_cpu(evt->other_rx_sector); | 487 | wil->stats.peer_rx_sector = le16_to_cpu(evt->other_rx_sector); |
488 | wil->stats.peer_tx_sector = le16_to_cpu(evt->other_tx_sector); | 488 | wil->stats.peer_tx_sector = le16_to_cpu(evt->other_tx_sector); |
489 | wil_dbg_wmi(wil, "Link status, MCS %d TSF 0x%016llx\n" | 489 | wil_dbg_wmi(wil, "Link status, MCS %d TSF 0x%016llx\n" |
490 | "BF status 0x%08x SNR 0x%08x\n" | 490 | "BF status 0x%08x SNR 0x%08x SQI %d%%\n" |
491 | "Tx Tpt %d goodput %d Rx goodput %d\n" | 491 | "Tx Tpt %d goodput %d Rx goodput %d\n" |
492 | "Sectors(rx:tx) my %d:%d peer %d:%d\n", | 492 | "Sectors(rx:tx) my %d:%d peer %d:%d\n", |
493 | wil->stats.bf_mcs, wil->stats.tsf, evt->status, | 493 | wil->stats.bf_mcs, wil->stats.tsf, evt->status, |
494 | wil->stats.snr, le32_to_cpu(evt->tx_tpt), | 494 | wil->stats.snr, evt->sqi, le32_to_cpu(evt->tx_tpt), |
495 | le32_to_cpu(evt->tx_goodput), le32_to_cpu(evt->rx_goodput), | 495 | le32_to_cpu(evt->tx_goodput), le32_to_cpu(evt->rx_goodput), |
496 | wil->stats.my_rx_sector, wil->stats.my_tx_sector, | 496 | wil->stats.my_rx_sector, wil->stats.my_tx_sector, |
497 | wil->stats.peer_rx_sector, wil->stats.peer_tx_sector); | 497 | wil->stats.peer_rx_sector, wil->stats.peer_tx_sector); |