diff options
| author | Antonio Quartulli <antonio@open-mesh.com> | 2014-05-19 15:53:19 -0400 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2014-05-20 09:13:32 -0400 |
| commit | 867d849fc844623a88ec7b380442952b5ffe5e68 (patch) | |
| tree | 6f45a836156a9e0f049fe68acf07eaeae0cd67ed /include | |
| parent | 922bd80fc33b5b90eb34b1485ebcf3c7b2e61618 (diff) | |
cfg80211: export expected throughput through get_station()
Users may need information about the expected throughput
towards a given peer.
This value is supposed to consider the size overhead
generated by the 802.11 header.
This value is exported in kbps through the get_station() API
by including it into the station_info object.
Moreover, it is sent to user space when replying to the
nl80211 GET_STATION command.
This information will be useful to the batman-adv module
which will use it for its new metric computation.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/cfg80211.h | 62 | ||||
| -rw-r--r-- | include/uapi/linux/nl80211.h | 3 |
2 files changed, 37 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, |
