|
@@ -316,6 +316,17 @@ static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void rate_idx_to_bitrate(struct rate_info *rate, struct sta_info *sta, int idx)
|
|
|
|
+{
|
|
|
|
+ if (!(rate->flags & RATE_INFO_FLAGS_MCS)) {
|
|
|
|
+ struct ieee80211_supported_band *sband;
|
|
|
|
+ sband = sta->local->hw.wiphy->bands[
|
|
|
|
+ sta->local->hw.conf.channel->band];
|
|
|
|
+ rate->legacy = sband->bitrates[idx].bitrate;
|
|
|
|
+ } else
|
|
|
|
+ rate->mcs = idx;
|
|
|
|
+}
|
|
|
|
+
|
|
static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|
static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|
{
|
|
{
|
|
struct ieee80211_sub_if_data *sdata = sta->sdata;
|
|
struct ieee80211_sub_if_data *sdata = sta->sdata;
|
|
@@ -330,6 +341,7 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|
STATION_INFO_TX_RETRIES |
|
|
STATION_INFO_TX_RETRIES |
|
|
STATION_INFO_TX_FAILED |
|
|
STATION_INFO_TX_FAILED |
|
|
STATION_INFO_TX_BITRATE |
|
|
STATION_INFO_TX_BITRATE |
|
|
|
|
+ STATION_INFO_RX_BITRATE |
|
|
STATION_INFO_RX_DROP_MISC;
|
|
STATION_INFO_RX_DROP_MISC;
|
|
|
|
|
|
sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
|
|
sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
|
|
@@ -355,15 +367,16 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|
sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
|
|
sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
|
|
if (sta->last_tx_rate.flags & IEEE80211_TX_RC_SHORT_GI)
|
|
if (sta->last_tx_rate.flags & IEEE80211_TX_RC_SHORT_GI)
|
|
sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
|
|
sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
|
|
-
|
|
|
|
- if (!(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS)) {
|
|
|
|
- struct ieee80211_supported_band *sband;
|
|
|
|
- sband = sta->local->hw.wiphy->bands[
|
|
|
|
- sta->local->hw.conf.channel->band];
|
|
|
|
- sinfo->txrate.legacy =
|
|
|
|
- sband->bitrates[sta->last_tx_rate.idx].bitrate;
|
|
|
|
- } else
|
|
|
|
- sinfo->txrate.mcs = sta->last_tx_rate.idx;
|
|
|
|
|
|
+ rate_idx_to_bitrate(&sinfo->txrate, sta, sta->last_tx_rate.idx);
|
|
|
|
+
|
|
|
|
+ sinfo->rxrate.flags = 0;
|
|
|
|
+ if (sta->last_rx_rate_flag & RX_FLAG_HT)
|
|
|
|
+ sinfo->rxrate.flags |= RATE_INFO_FLAGS_MCS;
|
|
|
|
+ if (sta->last_rx_rate_flag & RX_FLAG_40MHZ)
|
|
|
|
+ sinfo->rxrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
|
|
|
|
+ if (sta->last_rx_rate_flag & RX_FLAG_SHORT_GI)
|
|
|
|
+ sinfo->rxrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
|
|
|
|
+ rate_idx_to_bitrate(&sinfo->rxrate, sta, sta->last_rx_rate_idx);
|
|
|
|
|
|
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
|
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
|
#ifdef CONFIG_MAC80211_MESH
|
|
#ifdef CONFIG_MAC80211_MESH
|