diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2012-07-08 02:07:38 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2012-07-08 02:07:38 +0000 |
commit | 5e57ef50671b9402b1b9f458817fe30e9a004f1f (patch) | |
tree | 7737cd5eff2f4aa0719fbb740d58ca474689ac42 /ws80211_utils.c | |
parent | af3bd5b1c4f3e0a7b6e722858788f3ea5a040856 (diff) |
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.)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43608 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'ws80211_utils.c')
-rw-r--r-- | ws80211_utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |