Search Linux Wireless

[PATCH 01/16] mac80211: add HT conf helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In HT capable drivers you often need to check if you
are currently using HT20 or HT40. This adds a few small
helpers to let drivers figure that out.

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 include/net/mac80211.h |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b3bd00a..33891f9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1963,4 +1963,44 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
 int ieee80211_rate_control_register(struct rate_control_ops *ops);
 void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
 
+static inline bool
+conf_is_ht20(struct ieee80211_conf *conf)
+{
+	if (conf->ht.channel_type == NL80211_CHAN_HT20)
+		return true;
+	return false;
+}
+
+static inline bool
+conf_is_ht40_minus(struct ieee80211_conf *conf)
+{
+	if (conf->ht.channel_type == NL80211_CHAN_HT40MINUS)
+		return true;
+	return false;
+}
+
+static inline bool
+conf_is_ht40_plus(struct ieee80211_conf *conf)
+{
+	if (conf->ht.channel_type == NL80211_CHAN_HT40PLUS)
+		return true;
+	return false;
+}
+
+static inline bool
+conf_is_ht40(struct ieee80211_conf *conf)
+{
+	if (conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf))
+		return true;
+	return false;
+}
+
+static inline bool
+conf_is_ht(struct ieee80211_conf *conf)
+{
+	if (conf_is_ht20(conf) || conf_is_ht40(conf))
+		return true;
+	return false;
+}
+
 #endif /* MAC80211_H */
-- 
1.5.6.rc2.15.g457bb.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux