Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci PR/50187: Don't use DS parameter set when 5GHz c...
details: https://anonhg.NetBSD.org/src/rev/f64b7bf961a4
branches: trunk
changeset: 340650:f64b7bf961a4
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Sep 22 23:23:06 2015 +0000
description:
PR/50187: Don't use DS parameter set when 5GHz channel is scanning.
XXX: pullup-7
diffstat:
sys/dev/pci/if_iwn.c | 26 +++++++++++++++++++-------
sys/dev/pci/if_iwnvar.h | 8 +++++---
2 files changed, 24 insertions(+), 10 deletions(-)
diffs (104 lines):
diff -r 39aa9937fddb -r f64b7bf961a4 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c Tue Sep 22 16:16:02 2015 +0000
+++ b/sys/dev/pci/if_iwn.c Tue Sep 22 23:23:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwn.c,v 1.75 2015/08/24 23:52:18 pooka Exp $ */
+/* $NetBSD: if_iwn.c,v 1.76 2015/09/22 23:23:06 nonaka Exp $ */
/* $OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $ */
/*-
@@ -22,7 +22,7 @@
* adapters.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.75 2015/08/24 23:52:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.76 2015/09/22 23:23:06 nonaka Exp $");
#define IWN_USE_RBUF /* Use local storage for RX */
#undef IWN_HWCRYPTO /* XXX does not even compile yet */
@@ -330,7 +330,8 @@
static u_int8_t *ieee80211_add_xrates(u_int8_t *,
const struct ieee80211_rateset *);
-static void iwn_fix_channel(struct ieee80211com *, struct mbuf *);
+static void iwn_fix_channel(struct ieee80211com *, struct mbuf *,
+ struct iwn_rx_stat *);
#ifdef IWN_DEBUG
#define DPRINTF(x) do { if (iwn_debug > 0) printf x; } while (0)
@@ -1866,7 +1867,7 @@
/* XXX Not sure if call and flags are needed. */
ieee80211_node_table_reset(&ic->ic_scan);
ic->ic_flags |= IEEE80211_F_SCAN | IEEE80211_F_ASCAN;
- sc->sc_flags |= IWN_FLAG_SCANNING;
+ sc->sc_flags |= IWN_FLAG_SCANNING_2GHZ;
/* Make the link LED blink while we're scanning. */
iwn_set_led(sc, IWN_LED_LINK, 10, 10);
@@ -2089,7 +2090,7 @@
/* XXX Added for NetBSD: scans never stop without it */
if (ic->ic_state == IEEE80211_S_SCAN)
- iwn_fix_channel(ic, m);
+ iwn_fix_channel(ic, m, stat);
if (sc->sc_drvbpf != NULL) {
struct iwn_rx_radiotap_header *tap = &sc->sc_rxtap;
@@ -2520,6 +2521,8 @@
* We just finished scanning 2GHz channels,
* start scanning 5GHz ones.
*/
+ sc->sc_flags &= ~IWN_FLAG_SCANNING_2GHZ;
+ sc->sc_flags |= IWN_FLAG_SCANNING_5GHZ;
if (iwn_scan(sc, IEEE80211_CHAN_5GHZ) == 0)
break;
}
@@ -6506,8 +6509,10 @@
* XXX: Duplicated from if_iwi.c
*/
static void
-iwn_fix_channel(struct ieee80211com *ic, struct mbuf *m)
-{
+iwn_fix_channel(struct ieee80211com *ic, struct mbuf *m,
+ struct iwn_rx_stat *stat)
+{
+ struct iwn_softc *sc = ic->ic_ifp->if_softc;
struct ieee80211_frame *wh;
uint8_t subtype;
uint8_t *frm, *efrm;
@@ -6523,6 +6528,13 @@
subtype != IEEE80211_FC0_SUBTYPE_PROBE_RESP)
return;
+ if (sc->sc_flags & IWN_FLAG_SCANNING_5GHZ) {
+ int chan = le16toh(stat->chan);
+ if (chan < __arraycount(ic->ic_channels))
+ ic->ic_curchan = &ic->ic_channels[chan];
+ return;
+ }
+
frm = (uint8_t *)(wh + 1);
efrm = mtod(m, uint8_t *) + m->m_len;
diff -r 39aa9937fddb -r f64b7bf961a4 sys/dev/pci/if_iwnvar.h
--- a/sys/dev/pci/if_iwnvar.h Tue Sep 22 16:16:02 2015 +0000
+++ b/sys/dev/pci/if_iwnvar.h Tue Sep 22 23:23:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwnvar.h,v 1.16 2014/10/30 13:05:58 nonaka Exp $ */
+/* $NetBSD: if_iwnvar.h,v 1.17 2015/09/22 23:23:06 nonaka Exp $ */
/* $OpenBSD: if_iwnvar.h,v 1.28 2014/09/09 18:55:08 sthen Exp $ */
/*-
@@ -221,8 +221,10 @@
#define IWN_FLAG_HAS_11N (1 << 6)
#define IWN_FLAG_ENH_SENS (1 << 7)
/* Added for NetBSD */
-#define IWN_FLAG_SCANNING (1 << 8)
-#define IWN_FLAG_HW_INITED (1 << 9)
+#define IWN_FLAG_HW_INITED (1 << 8)
+#define IWN_FLAG_SCANNING_2GHZ (1 << 9)
+#define IWN_FLAG_SCANNING_5GHZ (1 << 10)
+#define IWN_FLAG_SCANNING (IWN_FLAG_SCANNING_2GHZ|IWN_FLAG_SCANNING_5GHZ)
uint8_t hw_type;
Home |
Main Index |
Thread Index |
Old Index