From: Johannes Berg Date: Mon, 22 Dec 2008 20:06:21 +0100 Subject: [ath9k-devel] [PATCH v2 01/18] mac80211: add HT conf helpers In-Reply-To: <1229970039-10561-2-git-send-email-lrodriguez@atheros.com> References: <1229970039-10561-1-git-send-email-lrodriguez@atheros.com> <1229970039-10561-2-git-send-email-lrodriguez@atheros.com> Message-ID: <1229972781.4406.12.camel@johannes> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Mon, 2008-12-22 at 10:20 -0800, Luis Rodriguez wrote: > 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 Acked-by: Johannes Berg > --- > include/net/mac80211.h | 30 ++++++++++++++++++++++++++++++ > 1 files changed, 30 insertions(+), 0 deletions(-) > > diff --git a/include/net/mac80211.h b/include/net/mac80211.h > index b3bd00a..ee2b75e 100644 > --- a/include/net/mac80211.h > +++ b/include/net/mac80211.h > @@ -1963,4 +1963,34 @@ 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) > +{ > + return conf->ht.channel_type == NL80211_CHAN_HT20; > +} > + > +static inline bool > +conf_is_ht40_minus(struct ieee80211_conf *conf) > +{ > + return conf->ht.channel_type == NL80211_CHAN_HT40MINUS; > +} > + > +static inline bool > +conf_is_ht40_plus(struct ieee80211_conf *conf) > +{ > + return conf->ht.channel_type == NL80211_CHAN_HT40PLUS; > +} > + > +static inline bool > +conf_is_ht40(struct ieee80211_conf *conf) > +{ > + return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf); > +} > + > +static inline bool > +conf_is_ht(struct ieee80211_conf *conf) > +{ > + return conf->ht.channel_type != NL80211_CHAN_NO_HT; > +} > + > #endif /* MAC80211_H */ > -- > 1.6.1.rc3.51.g5832d > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20081222/9bfdf839/attachment.pgp