summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Altshul <maxim.altshul@ti.com>2016-07-11 16:22:33 +0200
committerKalle Valo <kvalo@codeaurora.org>2016-07-18 21:37:33 +0200
commit5f6d4ca3c196814bef0cbbb195acd9ecc178588b (patch)
tree800eefdf14f71250b2d210a0cb5335c19b1ee6a2
parentwlcore/wl18xx: Add functionality to accept TX rate per link (diff)
downloadlinux-5f6d4ca3c196814bef0cbbb195acd9ecc178588b.tar.xz
linux-5f6d4ca3c196814bef0cbbb195acd9ecc178588b.zip
wlcore: Add support for get_expected_throughput opcode
Adding this opcode, allows the TI wireless driver, to report throughput directly from FW to mac80211. This is used mainly for mesh metric calculation. Signed-off-by: Maxim Altshul <maxim.altshul@ti.com> [kvalo@codeaurora.org: fix indentation] Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 45aab1041d7f..1d689169da76 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5700,6 +5700,16 @@ out:
mutex_unlock(&wl->mutex);
}
+static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta *sta)
+{
+ struct wl1271_station *wl_sta = (struct wl1271_station *)sta->drv_priv;
+ struct wl1271 *wl = wl_sta->wl;
+ u8 hlid = wl_sta->hlid;
+
+ /* return in units of Kbps */
+ return (wl->links[hlid].fw_rate_mbps * 1000);
+}
+
static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw)
{
struct wl1271 *wl = hw->priv;
@@ -5900,6 +5910,7 @@ static const struct ieee80211_ops wl1271_ops = {
.switch_vif_chanctx = wlcore_op_switch_vif_chanctx,
.sta_rc_update = wlcore_op_sta_rc_update,
.sta_statistics = wlcore_op_sta_statistics,
+ .get_expected_throughput = wlcore_op_get_expected_throughput,
CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
};