From 5f90f658fefce8a5883d5b5d954a1568c3ba6303 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 8 Jul 2012 02:07:38 +0000 Subject: Unless NL80211_BAND_ATTR_HT_CAPA is defined, assume we don't have channel-type-setting capabilities, and don't build the code to set the channel type or fetch any channel types other than "no HT". (It *looks* as if nl80211.h defines NL80211_BAND_ATTR_HT_CAPA as a member of an enum *and* as a #define, at least in the kernels I've looked at, so we can test for it with #ifdef - perhaps that's *why* it's #defined.) svn path=/trunk/; revision=43608 --- ws80211_utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ws80211_utils.c') diff --git a/ws80211_utils.c b/ws80211_utils.c index d3c167f480..5131f03bd7 100644 --- a/ws80211_utils.c +++ b/ws80211_utils.c @@ -218,6 +218,7 @@ static int get_phys_handler(struct nl_msg *msg, void *arg) nla_parse(tb_band, NL80211_BAND_ATTR_MAX, nla_data(nl_band), nla_len(nl_band), NULL); +#ifdef NL80211_BAND_ATTR_HT_CAPA if (tb_band[NL80211_BAND_ATTR_HT_CAPA]) { gboolean ht40; iface->channel_types |= 1 << WS80211_CHAN_HT20; @@ -227,6 +228,7 @@ static int get_phys_handler(struct nl_msg *msg, void *arg) iface->channel_types |= 1 << WS80211_CHAN_HT40PLUS; } } +#endif /* NL80211_BAND_ATTR_HT_CAPA */ nla_for_each_nested(nl_freq, tb_band[NL80211_BAND_ATTR_FREQS], rem_freq) { uint32_t freq; @@ -544,6 +546,7 @@ int ws80211_set_freq(const char *name, int freq, int chan_type) switch (chan_type) { +#ifdef NL80211_BAND_ATTR_HT_CAPA case WS80211_CHAN_NO_HT: NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, NL80211_CHAN_NO_HT); break; @@ -559,8 +562,9 @@ int ws80211_set_freq(const char *name, int freq, int chan_type) case WS80211_CHAN_HT40PLUS: NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, NL80211_CHAN_HT40PLUS); break; +#endif - case -1: + default: break; } err = nl80211_do_cmd(msg, cb); -- cgit v1.2.1