aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-01-15 10:14:02 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-15 16:41:32 -0500
commitb51f3beecfbbfc946749a91fb444cb8917cf444f (patch)
tree68ecd024ca26b392b48599dc3725e4416d053d1f /include
parent97d910d0aaa619ca530d08e2b1125b8014ccb030 (diff)
cfg80211: change bandwidth reporting to explicit field
For some reason, we made the bandwidth separate flags, which is rather confusing - a single rate cannot have different bandwidths at the same time. Change this to no longer be flags but use a separate field for the bandwidth ('bw') instead. While at it, add support for 5 and 10 MHz rates - these are reported as regular legacy rates with their real bitrate, but tagged as 5/10 now to make it easier to distinguish them. In the nl80211 API, the flags are preserved, but the code now can also clearly only set a single one of the flags. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h33
-rw-r--r--include/uapi/linux/nl80211.h8
2 files changed, 33 insertions, 8 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0322048fddab..7b44ba0a7632 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -873,20 +873,35 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
873 * 873 *
874 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS 874 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
875 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS 875 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
876 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission
877 * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission
878 * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission
879 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval 876 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
880 * @RATE_INFO_FLAGS_60G: 60GHz MCS 877 * @RATE_INFO_FLAGS_60G: 60GHz MCS
881 */ 878 */
882enum rate_info_flags { 879enum rate_info_flags {
883 RATE_INFO_FLAGS_MCS = BIT(0), 880 RATE_INFO_FLAGS_MCS = BIT(0),
884 RATE_INFO_FLAGS_VHT_MCS = BIT(1), 881 RATE_INFO_FLAGS_VHT_MCS = BIT(1),
885 RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), 882 RATE_INFO_FLAGS_SHORT_GI = BIT(2),
886 RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), 883 RATE_INFO_FLAGS_60G = BIT(3),
887 RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(4), 884};
888 RATE_INFO_FLAGS_SHORT_GI = BIT(5), 885
889 RATE_INFO_FLAGS_60G = BIT(6), 886/**
887 * enum rate_info_bw - rate bandwidth information
888 *
889 * Used by the driver to indicate the rate bandwidth.
890 *
891 * @RATE_INFO_BW_5: 5 MHz bandwidth
892 * @RATE_INFO_BW_10: 10 MHz bandwidth
893 * @RATE_INFO_BW_20: 20 MHz bandwidth
894 * @RATE_INFO_BW_40: 40 MHz bandwidth
895 * @RATE_INFO_BW_80: 80 MHz bandwidth
896 * @RATE_INFO_BW_160: 160 MHz bandwidth
897 */
898enum rate_info_bw {
899 RATE_INFO_BW_5,
900 RATE_INFO_BW_10,
901 RATE_INFO_BW_20,
902 RATE_INFO_BW_40,
903 RATE_INFO_BW_80,
904 RATE_INFO_BW_160,
890}; 905};
891 906
892/** 907/**
@@ -898,12 +913,14 @@ enum rate_info_flags {
898 * @mcs: mcs index if struct describes a 802.11n bitrate 913 * @mcs: mcs index if struct describes a 802.11n bitrate
899 * @legacy: bitrate in 100kbit/s for 802.11abg 914 * @legacy: bitrate in 100kbit/s for 802.11abg
900 * @nss: number of streams (VHT only) 915 * @nss: number of streams (VHT only)
916 * @bw: bandwidth (from &enum rate_info_bw)
901 */ 917 */
902struct rate_info { 918struct rate_info {
903 u8 flags; 919 u8 flags;
904 u8 mcs; 920 u8 mcs;
905 u16 legacy; 921 u16 legacy;
906 u8 nss; 922 u8 nss;
923 u8 bw;
907}; 924};
908 925
909/** 926/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 11cdb85ac646..f52797a90816 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2281,6 +2281,12 @@ struct nl80211_sta_flag_update {
2281 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the 2281 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the
2282 * same as 160 for purposes of the bitrates 2282 * same as 160 for purposes of the bitrates
2283 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate 2283 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
2284 * @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is
2285 * a legacy rate and will be reported as the actual bitrate, i.e.
2286 * half the base (20 MHz) rate
2287 * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is
2288 * a legacy rate and will be reported as the actual bitrate, i.e.
2289 * a quarter of the base (20 MHz) rate
2284 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 2290 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
2285 */ 2291 */
2286enum nl80211_rate_info { 2292enum nl80211_rate_info {
@@ -2295,6 +2301,8 @@ enum nl80211_rate_info {
2295 NL80211_RATE_INFO_80_MHZ_WIDTH, 2301 NL80211_RATE_INFO_80_MHZ_WIDTH,
2296 NL80211_RATE_INFO_80P80_MHZ_WIDTH, 2302 NL80211_RATE_INFO_80P80_MHZ_WIDTH,
2297 NL80211_RATE_INFO_160_MHZ_WIDTH, 2303 NL80211_RATE_INFO_160_MHZ_WIDTH,
2304 NL80211_RATE_INFO_10_MHZ_WIDTH,
2305 NL80211_RATE_INFO_5_MHZ_WIDTH,
2298 2306
2299 /* keep last */ 2307 /* keep last */
2300 __NL80211_RATE_INFO_AFTER_LAST, 2308 __NL80211_RATE_INFO_AFTER_LAST,