Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2007 15:49:28 GMT
From:      Max Laier <mlaier@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 115208 for review
Message-ID:  <200703011549.l21FnS2O008490@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115208

Change 115208 by mlaier@mlaier_amd64 on 2007/03/01 15:48:38

	Catch up with ic_modcaps change in 114933.

Affected files ...

.. //depot/projects/wifi/sys/dev/if_ndis/if_ndis.c#27 edit

Differences ...

==== //depot/projects/wifi/sys/dev/if_ndis/if_ndis.c#27 (text+ko) ====

@@ -687,7 +687,7 @@
 		ic->ic_opmode = IEEE80211_M_STA;
 		ic->ic_caps = IEEE80211_C_IBSS;
 		ic->ic_state = IEEE80211_S_ASSOC;
-		ic->ic_modecaps = (1<<IEEE80211_MODE_AUTO);
+		setbit(ic->ic_modecaps, IEEE80211_MODE_AUTO);
 		len = 0;
 		r = ndis_get_info(sc, OID_802_11_NETWORK_TYPES_SUPPORTED,
 		    NULL, &len);
@@ -705,13 +705,13 @@
 			switch (ntl->ntl_type[i]) {
 			case NDIS_80211_NETTYPE_11FH:
 			case NDIS_80211_NETTYPE_11DS:
-				ic->ic_modecaps |= (1<<IEEE80211_MODE_11B);
+				setbit(ic->ic_modecaps, IEEE80211_MODE_11B);
 				break;
 			case NDIS_80211_NETTYPE_11OFDM5:
-				ic->ic_modecaps |= (1<<IEEE80211_MODE_11A);
+				setbit(ic->ic_modecaps, IEEE80211_MODE_11A);
 				break;
 			case NDIS_80211_NETTYPE_11OFDM24:
-				ic->ic_modecaps |= (1<<IEEE80211_MODE_11G);
+				setbit(ic->ic_modecaps, IEEE80211_MODE_11G);
 				break;
 			default:
 				break;
@@ -750,11 +750,11 @@
 	ic->ic_sup_rates[x].rs_nrates++
 
 		ic->ic_curmode = IEEE80211_MODE_AUTO;
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11A))
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11A))
 			ic->ic_sup_rates[IEEE80211_MODE_11A].rs_nrates = 0;
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11B))
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11B))
 			ic->ic_sup_rates[IEEE80211_MODE_11B].rs_nrates = 0;
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11G))
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11G))
 			ic->ic_sup_rates[IEEE80211_MODE_11G].rs_nrates = 0;
 		for (i = 0; i < len; i++) {
 			switch (rates[i] & IEEE80211_RATE_VAL) {
@@ -763,11 +763,11 @@
 			case 11:
 			case 10:
 			case 22:
-				if (!(ic->ic_modecaps &
-				    (1<<IEEE80211_MODE_11B))) {
+				if (isclr(ic->ic_modecaps,
+				    IEEE80211_MODE_11B)) {
 					/* Lazy-init 802.11b. */
-					ic->ic_modecaps |=
-					    (1<<IEEE80211_MODE_11B);
+					setbit(ic->ic_modecaps,
+					    IEEE80211_MODE_11B);
 					ic->ic_sup_rates[IEEE80211_MODE_11B].
 					    rs_nrates = 0;
 				}
@@ -775,11 +775,13 @@
 				INCRATE(IEEE80211_MODE_11B);
 				break;
 			default:
-				if (ic->ic_modecaps & (1<<IEEE80211_MODE_11A)) {
+				if (isset(ic->ic_modecaps,
+				    IEEE80211_MODE_11A)) {
 					SETRATE(IEEE80211_MODE_11A, rates[i]);
 					INCRATE(IEEE80211_MODE_11A);
 				}
-				if (ic->ic_modecaps & (1<<IEEE80211_MODE_11G)) {
+				if (isset(ic->ic_modecaps,
+				    IEEE80211_MODE_11G)) {
 					SETRATE(IEEE80211_MODE_11G, rates[i]);
 					INCRATE(IEEE80211_MODE_11G);
 				}
@@ -794,7 +796,7 @@
 		 * just cheat here.  Just how in the heck do
 		 * we detect turbo modes, though?
 		 */
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11B)) {
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11B)) {
 			TESTSETRATE(IEEE80211_MODE_11B,
 			    IEEE80211_RATE_BASIC|2);
 			TESTSETRATE(IEEE80211_MODE_11B,
@@ -804,13 +806,13 @@
 			TESTSETRATE(IEEE80211_MODE_11B,
 			    IEEE80211_RATE_BASIC|22);
 		}
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11G)) {
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11G)) {
 			TESTSETRATE(IEEE80211_MODE_11G, 47);
 			TESTSETRATE(IEEE80211_MODE_11G, 72);
 			TESTSETRATE(IEEE80211_MODE_11G, 96);
 			TESTSETRATE(IEEE80211_MODE_11G, 108);
 		}
-		if (ic->ic_modecaps & (1<<IEEE80211_MODE_11A)) {
+		if (isset(ic->ic_modecaps, IEEE80211_MODE_11A)) {
 			TESTSETRATE(IEEE80211_MODE_11A, 47);
 			TESTSETRATE(IEEE80211_MODE_11A, 72);
 			TESTSETRATE(IEEE80211_MODE_11A, 96);
@@ -2632,7 +2634,7 @@
 		device_printf (sc->ndis_dev, "get link speed failed: %d\n",
 		    rval);
 
-	if (ic->ic_modecaps & (1<<IEEE80211_MODE_11B)) {
+	if (isset(ic->ic_modecaps, IEEE80211_MODE_11B)) {
 		ic->ic_bss->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11B];
 		for (i = 0; i < ic->ic_bss->ni_rates.rs_nrates; i++) {
 			if ((ic->ic_bss->ni_rates.rs_rates[i] &
@@ -2642,7 +2644,7 @@
 	}
 
 	if (i == ic->ic_bss->ni_rates.rs_nrates &&
-	    ic->ic_modecaps & (1<<IEEE80211_MODE_11G)) {
+	    isset(ic->ic_modecaps, IEEE80211_MODE_11G)) {
 		ic->ic_bss->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11G];
 		for (i = 0; i < ic->ic_bss->ni_rates.rs_nrates; i++) {
 			if ((ic->ic_bss->ni_rates.rs_rates[i] &



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703011549.l21FnS2O008490>