PERFORCE change 135819 for review
Sam Leffler
sam at FreeBSD.org
Wed Feb 20 18:36:40 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=135819
Change 135819 by sam at sam_ebb on 2008/02/20 18:36:19
set bssid mask according to mac addresses being used
Affected files ...
.. //depot/projects/vap/sys/dev/ath/if_ath.c#32 edit
.. //depot/projects/vap/sys/dev/ath/if_athvar.h#16 edit
Differences ...
==== //depot/projects/vap/sys/dev/ath/if_ath.c#32 (text+ko) ====
@@ -590,6 +590,8 @@
/* get mac address from hardware */
ath_hal_getmac(ah, ic->ic_myaddr);
+ if (sc->sc_hasbmask)
+ ath_hal_getbssidmask(ah, sc->sc_hwbssidmask);
/* NB: used to size node table key mapping array */
ic->ic_max_keyix = sc->sc_keymax;
@@ -690,8 +692,10 @@
for (i = 0; i < 32; i++)
if ((sc->sc_bssidmask & (1<<i)) == 0)
break;
- if (i != 0)
+ if (i != 0) {
mac[0] |= (i << 2)|0x2;
+ sc->sc_hwbssidmask[0] &= ~mac[0];
+ }
} else
i = 0;
sc->sc_bssidmask |= 1<<i;
@@ -700,12 +704,18 @@
}
static void
-reclaim_address(struct ath_softc *sc, uint8_t mac[IEEE80211_ADDR_LEN])
+reclaim_address(struct ath_softc *sc, const uint8_t mac[IEEE80211_ADDR_LEN])
{
int i = mac[0] >> 2;
- if (i != 0 || --sc->sc_nbssid0 == 0)
+ if (i != 0 || --sc->sc_nbssid0 == 0) {
sc->sc_bssidmask &= ~(1<<i);
+ sc->sc_hwbssidmask[0] |= mac[0];
+ /* put back U/L bit if any other vaps need it */
+ if (sc->sc_bssidmask & ~1)
+ sc->sc_hwbssidmask[0] &= ~0x2;
+ }
}
+
/*
* Assign a beacon xmit slot. We try to space out
* assignments so when beacons are staggered the
@@ -816,8 +826,10 @@
}
/* STA, AHDEMO? */
- if (opmode == IEEE80211_M_HOSTAP)
+ if (opmode == IEEE80211_M_HOSTAP) {
assign_address(sc, mac, flags & IEEE80211_CLONE_BSSID);
+ ath_hal_setbssidmask(sc->sc_ah, sc->sc_hwbssidmask);
+ }
vap = &avp->av_vap;
/* XXX can't hold mutex across if_alloc */
@@ -967,6 +979,7 @@
sc->sc_swbmiss = 0;
} else if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
reclaim_address(sc, vap->iv_myaddr);
+ ath_hal_setbssidmask(ah, sc->sc_hwbssidmask);
}
if (vap->iv_opmode != IEEE80211_M_WDS)
sc->sc_nvaps--;
==== //depot/projects/vap/sys/dev/ath/if_athvar.h#16 (text+ko) ====
@@ -206,6 +206,7 @@
int sc_debug;
int sc_nvaps; /* # vaps */
int sc_nstavaps; /* # station vaps */
+ u_int8_t sc_hwbssidmask[IEEE80211_ADDR_LEN];
u_int8_t sc_nbssid0; /* # vap's using base mac */
uint32_t sc_bssidmask; /* bssid mask */
@@ -373,6 +374,10 @@
((*(_ah)->ah_getMacAddress)((_ah), (_mac)))
#define ath_hal_setmac(_ah, _mac) \
((*(_ah)->ah_setMacAddress)((_ah), (_mac)))
+#define ath_hal_getbssidmask(_ah, _mask) \
+ ((*(_ah)->ah_getBssIdMask)((_ah), (_mask)))
+#define ath_hal_setbssidmask(_ah, _mask) \
+ ((*(_ah)->ah_setBssIdMask)((_ah), (_mask)))
#define ath_hal_intrset(_ah, _mask) \
((*(_ah)->ah_setInterrupts)((_ah), (_mask)))
#define ath_hal_intrget(_ah) \
More information about the p4-projects
mailing list