Module Name:    src
Committed By:   christos
Date:           Sun Feb 16 16:13:37 UTC 2014

Modified Files:
        src/sys/dev/usb: if_urtwn.c if_urtwnreg.h

Log Message:
move default last, add symbolic mask.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_urtwnreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.28 src/sys/dev/usb/if_urtwn.c:1.29
--- src/sys/dev/usb/if_urtwn.c:1.28	Sun Feb 16 11:10:27 2014
+++ src/sys/dev/usb/if_urtwn.c	Sun Feb 16 11:13:37 2014
@@ -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
 		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
 
 			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
 
 			msr |= R92C_MSR_AP;
 			break;
+		default:
+			msr |= R92C_MSR_ADHOC;
+			break;
 		}
 		urtwn_write_1(sc, R92C_MSR, msr);
 

Index: src/sys/dev/usb/if_urtwnreg.h
diff -u src/sys/dev/usb/if_urtwnreg.h:1.5 src/sys/dev/usb/if_urtwnreg.h:1.6
--- src/sys/dev/usb/if_urtwnreg.h:1.5	Sun Feb 16 03:18:28 2014
+++ src/sys/dev/usb/if_urtwnreg.h	Sun Feb 16 11:13:37 2014
@@ -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

Reply via email to