summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2014-02-16 16:13:37 +0000
committerchristos <christos@NetBSD.org>2014-02-16 16:13:37 +0000
commitbc7895b14bd17e79fc1af7a0664d9c795cf8012c (patch)
tree124634c829396c9984fa190781a2185c2dbc40af /sys/dev
parentd8d1b871c557e8f25c2f9b91a973deaeb5c189cb (diff)
move default last, add symbolic mask.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/if_urtwn.c12
-rw-r--r--sys/dev/usb/if_urtwnreg.h3
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c
index 22ba4b06f5c..62d1759b198 100644
--- a/sys/dev/usb/if_urtwn.c
+++ b/sys/dev/usb/if_urtwn.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urtwn.c,v 1.28 2014/02/16 16:10:27 christos Exp $ */
+/* $NetBSD: if_urtwn.c,v 1.29 2014/02/16 16:13:37 christos Exp $ */
/* $OpenBSD: if_urtwn.c,v 1.20 2011/11/26 06:39:33 ckuethe Exp $ */
/*-
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.28 2014/02/16 16:10:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.29 2014/02/16 16:13:37 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1758,7 +1758,7 @@ urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
urtwn_write_2(sc, R92C_BCN_INTERVAL, ni->ni_intval);
msr = urtwn_read_1(sc, R92C_MSR);
- msr &= 0xfc;
+ msr &= R92C_MSR_MASK;
switch (ic->ic_opmode) {
case IEEE80211_M_STA:
/* Allow Rx from our BSSID only. */
@@ -1771,9 +1771,6 @@ urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
msr |= R92C_MSR_INFRA;
break;
- default:
- msr |= R92C_MSR_ADHOC;
- break;
case IEEE80211_M_HOSTAP:
urtwn_write_2(sc, R92C_BCNTCFG, 0x000f);
@@ -1791,6 +1788,9 @@ urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
msr |= R92C_MSR_AP;
break;
+ default:
+ msr |= R92C_MSR_ADHOC;
+ break;
}
urtwn_write_1(sc, R92C_MSR, msr);
diff --git a/sys/dev/usb/if_urtwnreg.h b/sys/dev/usb/if_urtwnreg.h
index 1864bdae04e..f790603cb0a 100644
--- a/sys/dev/usb/if_urtwnreg.h
+++ b/sys/dev/usb/if_urtwnreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urtwnreg.h,v 1.5 2014/02/16 08:18:28 nonaka Exp $ */
+/* $NetBSD: if_urtwnreg.h,v 1.6 2014/02/16 16:13:37 christos Exp $ */
/* $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ */
/*-
@@ -390,6 +390,7 @@
#define R92C_MSR_ADHOC 0x01
#define R92C_MSR_INFRA 0x02
#define R92C_MSR_AP 0x03
+#define R92C_MSR_MASK (~R92C_MSR_AP)
/* Bits for R92C_PBP. */
#define R92C_PBP_PSRX_M 0x0f