summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net80211/ieee80211.c18
-rw-r--r--sys/net80211/ieee80211_input.c5
-rw-r--r--sys/net80211/ieee80211_proto.c13
3 files changed, 14 insertions, 22 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 05eed9c0d35..10f5ffc95c1 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211.c,v 1.54 2016/01/04 12:23:53 stsp Exp $ */
+/* $OpenBSD: ieee80211.c,v 1.55 2016/01/04 12:25:46 stsp Exp $ */
/* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */
/*-
@@ -902,6 +902,10 @@ ieee80211_next_mode(struct ifnet *ifp)
* caller can select a rate set. This is problematic and the
* work here assumes how things work elsewhere in this code.
*
+ * Because the result of this function is ultimately used to select a
+ * rate from the rate set of the returned mode, it must not return
+ * IEEE80211_MODE_11N, which uses MCS instead of rates for unicast frames.
+ *
* XXX never returns turbo modes -dcy
*/
enum ieee80211_phymode
@@ -912,19 +916,15 @@ ieee80211_chan2mode(struct ieee80211com *ic,
* NB: this assumes the channel would not be supplied to us
* unless it was already compatible with the current mode.
*/
- if (ic->ic_curmode != IEEE80211_MODE_AUTO ||
- chan == IEEE80211_CHAN_ANYC)
+ if (ic->ic_curmode != IEEE80211_MODE_11N &&
+ (ic->ic_curmode != IEEE80211_MODE_AUTO ||
+ chan == IEEE80211_CHAN_ANYC))
return ic->ic_curmode;
/*
- * In autoselect mode; deduce a mode based on the channel
+ * In autoselect or 11n mode; deduce a mode based on the channel
* characteristics. We assume that turbo-only channels
* are not considered when the channel set is constructed.
*/
-#ifndef IEEE80211_NO_HT
- if (IEEE80211_IS_CHAN_N(chan))
- return IEEE80211_MODE_11N;
- else
-#endif
if (IEEE80211_IS_CHAN_T(chan))
return IEEE80211_MODE_TURBO;
else if (IEEE80211_IS_CHAN_5GHZ(chan))
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 8b415333973..22e532ef99a 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.146 2016/01/04 12:25:00 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.147 2016/01/04 12:25:46 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -210,8 +210,7 @@ ieee80211_input_print(struct ieee80211com *ic, struct ifnet *ifp,
"%s: received %s from %s rssi %d mode %s\n", ifp->if_xname,
ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT],
ether_sprintf(wh->i_addr2), rxi->rxi_rssi,
- ieee80211_phymode_name[ieee80211_chan2mode(
- ic, ic->ic_bss->ni_chan)]);
+ ieee80211_phymode_name[ic->ic_curmode]);
task_set(&msg->task, ieee80211_input_print_task, msg);
task_add(systq, &msg->task);
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 6417a197978..886dec99dea 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.56 2015/11/24 13:45:06 mpi Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.57 2016/01/04 12:25:46 stsp Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -894,15 +894,8 @@ justcleanup:
/* initialize bss for probe request */
IEEE80211_ADDR_COPY(ni->ni_macaddr, etherbroadcastaddr);
IEEE80211_ADDR_COPY(ni->ni_bssid, etherbroadcastaddr);
-#ifndef IEEE80211_NO_HT
- if (ic->ic_curmode == IEEE80211_MODE_11N)
- ni->ni_rates = ic->ic_sup_rates[
- IEEE80211_IS_CHAN_2GHZ(ni->ni_chan) ?
- IEEE80211_MODE_11G : IEEE80211_MODE_11A];
- else
-#endif
- ni->ni_rates = ic->ic_sup_rates[
- ieee80211_chan2mode(ic, ni->ni_chan)];
+ ni->ni_rates = ic->ic_sup_rates[
+ ieee80211_chan2mode(ic, ni->ni_chan)];
ni->ni_associd = 0;
ni->ni_rstamp = 0;
switch (ostate) {