Return-path: Received: from mail.atheros.com ([12.36.123.2]:32073 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751832AbYLTFz2 (ORCPT ); Sat, 20 Dec 2008 00:55:28 -0500 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Fri, 19 Dec 2008 21:55:28 -0800 From: "Luis R. Rodriguez" To: , , CC: "Luis R. Rodriguez" , , , Subject: [PATCH 01/16] mac80211: add HT conf helpers Date: Fri, 19 Dec 2008 21:55:07 -0800 Message-ID: <1229752522-1917-2-git-send-email-lrodriguez@atheros.com> (sfid-20081220_065537_568418_80618C3C) In-Reply-To: <1229752522-1917-1-git-send-email-lrodriguez@atheros.com> References: <1229752522-1917-1-git-send-email-lrodriguez@atheros.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 --- 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