summaryrefslogtreecommitdiff
path: root/ws80211_utils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-07-08 02:07:38 +0000
committerGuy Harris <guy@alum.mit.edu>2012-07-08 02:07:38 +0000
commit5f90f658fefce8a5883d5b5d954a1568c3ba6303 (patch)
tree7737cd5eff2f4aa0719fbb740d58ca474689ac42 /ws80211_utils.c
parentdb754f78219f2095d439c7f7e164972055bbd171 (diff)
downloadwireshark-5f90f658fefce8a5883d5b5d954a1568c3ba6303.tar.gz
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
Diffstat (limited to 'ws80211_utils.c')
-rw-r--r--ws80211_utils.c6
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);