|
@@ -5094,6 +5094,39 @@ static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw,
|
|
|
wlcore_hw_sta_rc_update(wl, wlvif, sta, changed);
|
|
|
}
|
|
|
|
|
|
+static int wlcore_op_get_rssi(struct ieee80211_hw *hw,
|
|
|
+ struct ieee80211_vif *vif,
|
|
|
+ struct ieee80211_sta *sta,
|
|
|
+ s8 *rssi_dbm)
|
|
|
+{
|
|
|
+ struct wl1271 *wl = hw->priv;
|
|
|
+ struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
|
|
|
+ int ret = 0;
|
|
|
+
|
|
|
+ wl1271_debug(DEBUG_MAC80211, "mac80211 get_rssi");
|
|
|
+
|
|
|
+ mutex_lock(&wl->mutex);
|
|
|
+
|
|
|
+ if (unlikely(wl->state != WLCORE_STATE_ON))
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ ret = wl1271_ps_elp_wakeup(wl);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out_sleep;
|
|
|
+
|
|
|
+ ret = wlcore_acx_average_rssi(wl, wlvif, rssi_dbm);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out_sleep;
|
|
|
+
|
|
|
+out_sleep:
|
|
|
+ wl1271_ps_elp_sleep(wl);
|
|
|
+
|
|
|
+out:
|
|
|
+ mutex_unlock(&wl->mutex);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw)
|
|
|
{
|
|
|
struct wl1271 *wl = hw->priv;
|
|
@@ -5293,6 +5326,7 @@ static const struct ieee80211_ops wl1271_ops = {
|
|
|
.assign_vif_chanctx = wlcore_op_assign_vif_chanctx,
|
|
|
.unassign_vif_chanctx = wlcore_op_unassign_vif_chanctx,
|
|
|
.sta_rc_update = wlcore_op_sta_rc_update,
|
|
|
+ .get_rssi = wlcore_op_get_rssi,
|
|
|
CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
|
|
|
};
|
|
|
|