diff options
-rw-r--r-- | include/net/cfg80211.h | 62 | ||||
-rw-r--r-- | include/uapi/linux/nl80211.h | 3 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 4 |
3 files changed, 41 insertions, 28 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index fe4fa287f788..857d6476a128 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -873,36 +873,38 @@ int cfg80211_check_station_change(struct wiphy *wiphy, | |||
873 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled | 873 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled |
874 | * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled | 874 | * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled |
875 | * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled | 875 | * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled |
876 | * @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled | ||
876 | */ | 877 | */ |
877 | enum station_info_flags { | 878 | enum station_info_flags { |
878 | STATION_INFO_INACTIVE_TIME = 1<<0, | 879 | STATION_INFO_INACTIVE_TIME = BIT(0), |
879 | STATION_INFO_RX_BYTES = 1<<1, | 880 | STATION_INFO_RX_BYTES = BIT(1), |
880 | STATION_INFO_TX_BYTES = 1<<2, | 881 | STATION_INFO_TX_BYTES = BIT(2), |
881 | STATION_INFO_LLID = 1<<3, | 882 | STATION_INFO_LLID = BIT(3), |
882 | STATION_INFO_PLID = 1<<4, | 883 | STATION_INFO_PLID = BIT(4), |
883 | STATION_INFO_PLINK_STATE = 1<<5, | 884 | STATION_INFO_PLINK_STATE = BIT(5), |
884 | STATION_INFO_SIGNAL = 1<<6, | 885 | STATION_INFO_SIGNAL = BIT(6), |
885 | STATION_INFO_TX_BITRATE = 1<<7, | 886 | STATION_INFO_TX_BITRATE = BIT(7), |
886 | STATION_INFO_RX_PACKETS = 1<<8, | 887 | STATION_INFO_RX_PACKETS = BIT(8), |
887 | STATION_INFO_TX_PACKETS = 1<<9, | 888 | STATION_INFO_TX_PACKETS = BIT(9), |
888 | STATION_INFO_TX_RETRIES = 1<<10, | 889 | STATION_INFO_TX_RETRIES = BIT(10), |
889 | STATION_INFO_TX_FAILED = 1<<11, | 890 | STATION_INFO_TX_FAILED = BIT(11), |
890 | STATION_INFO_RX_DROP_MISC = 1<<12, | 891 | STATION_INFO_RX_DROP_MISC = BIT(12), |
891 | STATION_INFO_SIGNAL_AVG = 1<<13, | 892 | STATION_INFO_SIGNAL_AVG = BIT(13), |
892 | STATION_INFO_RX_BITRATE = 1<<14, | 893 | STATION_INFO_RX_BITRATE = BIT(14), |
893 | STATION_INFO_BSS_PARAM = 1<<15, | 894 | STATION_INFO_BSS_PARAM = BIT(15), |
894 | STATION_INFO_CONNECTED_TIME = 1<<16, | 895 | STATION_INFO_CONNECTED_TIME = BIT(16), |
895 | STATION_INFO_ASSOC_REQ_IES = 1<<17, | 896 | STATION_INFO_ASSOC_REQ_IES = BIT(17), |
896 | STATION_INFO_STA_FLAGS = 1<<18, | 897 | STATION_INFO_STA_FLAGS = BIT(18), |
897 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19, | 898 | STATION_INFO_BEACON_LOSS_COUNT = BIT(19), |
898 | STATION_INFO_T_OFFSET = 1<<20, | 899 | STATION_INFO_T_OFFSET = BIT(20), |
899 | STATION_INFO_LOCAL_PM = 1<<21, | 900 | STATION_INFO_LOCAL_PM = BIT(21), |
900 | STATION_INFO_PEER_PM = 1<<22, | 901 | STATION_INFO_PEER_PM = BIT(22), |
901 | STATION_INFO_NONPEER_PM = 1<<23, | 902 | STATION_INFO_NONPEER_PM = BIT(23), |
902 | STATION_INFO_RX_BYTES64 = 1<<24, | 903 | STATION_INFO_RX_BYTES64 = BIT(24), |
903 | STATION_INFO_TX_BYTES64 = 1<<25, | 904 | STATION_INFO_TX_BYTES64 = BIT(25), |
904 | STATION_INFO_CHAIN_SIGNAL = 1<<26, | 905 | STATION_INFO_CHAIN_SIGNAL = BIT(26), |
905 | STATION_INFO_CHAIN_SIGNAL_AVG = 1<<27, | 906 | STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27), |
907 | STATION_INFO_EXPECTED_THROUGHPUT = BIT(28), | ||
906 | }; | 908 | }; |
907 | 909 | ||
908 | /** | 910 | /** |
@@ -1024,6 +1026,8 @@ struct sta_bss_parameters { | |||
1024 | * @local_pm: local mesh STA power save mode | 1026 | * @local_pm: local mesh STA power save mode |
1025 | * @peer_pm: peer mesh STA power save mode | 1027 | * @peer_pm: peer mesh STA power save mode |
1026 | * @nonpeer_pm: non-peer mesh STA power save mode | 1028 | * @nonpeer_pm: non-peer mesh STA power save mode |
1029 | * @expected_throughput: expected throughput in kbps (including 802.11 headers) | ||
1030 | * towards this station. | ||
1027 | */ | 1031 | */ |
1028 | struct station_info { | 1032 | struct station_info { |
1029 | u32 filled; | 1033 | u32 filled; |
@@ -1062,6 +1066,8 @@ struct station_info { | |||
1062 | enum nl80211_mesh_power_mode peer_pm; | 1066 | enum nl80211_mesh_power_mode peer_pm; |
1063 | enum nl80211_mesh_power_mode nonpeer_pm; | 1067 | enum nl80211_mesh_power_mode nonpeer_pm; |
1064 | 1068 | ||
1069 | u32 expected_throughput; | ||
1070 | |||
1065 | /* | 1071 | /* |
1066 | * Note: Add a new enum station_info_flags value for each new field and | 1072 | * Note: Add a new enum station_info_flags value for each new field and |
1067 | * use it to check which fields are initialized. | 1073 | * use it to check which fields are initialized. |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 0cfa827123ff..fb0efa1f9066 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -2199,6 +2199,8 @@ enum nl80211_sta_bss_param { | |||
2199 | * Contains a nested array of signal strength attributes (u8, dBm) | 2199 | * Contains a nested array of signal strength attributes (u8, dBm) |
2200 | * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average | 2200 | * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average |
2201 | * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. | 2201 | * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. |
2202 | * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the | ||
2203 | * 802.11 header (u32, kbps) | ||
2202 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 2204 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
2203 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 2205 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
2204 | */ | 2206 | */ |
@@ -2230,6 +2232,7 @@ enum nl80211_sta_info { | |||
2230 | NL80211_STA_INFO_TX_BYTES64, | 2232 | NL80211_STA_INFO_TX_BYTES64, |
2231 | NL80211_STA_INFO_CHAIN_SIGNAL, | 2233 | NL80211_STA_INFO_CHAIN_SIGNAL, |
2232 | NL80211_STA_INFO_CHAIN_SIGNAL_AVG, | 2234 | NL80211_STA_INFO_CHAIN_SIGNAL_AVG, |
2235 | NL80211_STA_INFO_EXPECTED_THROUGHPUT, | ||
2233 | 2236 | ||
2234 | /* keep last */ | 2237 | /* keep last */ |
2235 | __NL80211_STA_INFO_AFTER_LAST, | 2238 | __NL80211_STA_INFO_AFTER_LAST, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 49adf58646e6..62bdb1adaa4d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3650,6 +3650,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq, | |||
3650 | nla_put_u32(msg, NL80211_STA_INFO_TX_FAILED, | 3650 | nla_put_u32(msg, NL80211_STA_INFO_TX_FAILED, |
3651 | sinfo->tx_failed)) | 3651 | sinfo->tx_failed)) |
3652 | goto nla_put_failure; | 3652 | goto nla_put_failure; |
3653 | if ((sinfo->filled & STATION_INFO_EXPECTED_THROUGHPUT) && | ||
3654 | nla_put_u32(msg, NL80211_STA_INFO_EXPECTED_THROUGHPUT, | ||
3655 | sinfo->expected_throughput)) | ||
3656 | goto nla_put_failure; | ||
3653 | if ((sinfo->filled & STATION_INFO_BEACON_LOSS_COUNT) && | 3657 | if ((sinfo->filled & STATION_INFO_BEACON_LOSS_COUNT) && |
3654 | nla_put_u32(msg, NL80211_STA_INFO_BEACON_LOSS, | 3658 | nla_put_u32(msg, NL80211_STA_INFO_BEACON_LOSS, |
3655 | sinfo->beacon_loss_count)) | 3659 | sinfo->beacon_loss_count)) |