Add an error message if a unique BSSID is requested but the hardware does not support the BSSID mask

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3745 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mentor 2008-06-24 03:09:25 +00:00
parent 70e6e83fc8
commit 7a04e2c8e8

View File

@ -1301,30 +1301,31 @@ ath_vap_create(struct ieee80211com *ic, const char *name,
/* Use RadioTAP interface type for monitor mode. */ /* Use RadioTAP interface type for monitor mode. */
dev->type = ARPHRD_IEEE80211_RADIOTAP; dev->type = ARPHRD_IEEE80211_RADIOTAP;
if ((flags & IEEE80211_CLONE_BSSID) && sc->sc_hasbmask) { if (flags & IEEE80211_CLONE_BSSID) {
struct ieee80211vap *v; if (sc->sc_hasbmask) {
uint64_t id_mask; struct ieee80211vap *v;
unsigned int id; uint64_t id_mask = 0;
unsigned int id;
/* /* Hardware supports the BSSID mask and a unique
* Hardware supports the bssid mask and a unique * BSSID was requested. Assign a new MAC address
* bssid was requested. Assign a new mac address * and expand our BSSID mask to cover the active
* and expand our bssid mask to cover the active * virtual APs with distinct addresses. */
* virtual APs with distinct addresses. /* Do a full search to mark all the allocated VAPs. */
*/ TAILQ_FOREACH(v, &ic->ic_vaps, iv_next)
id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr));
/* do a full search to mark all the allocated VAPs */ for (id = 1; id < ath_maxvaps; id++) {
id_mask = 0; /* Get the first available slot. */
TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) if ((id_mask & (1 << id)) == 0) {
id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); ATH_SET_VAP_BSSID(vap->iv_myaddr, id);
ATH_SET_VAP_BSSID(vap->iv_bssid, id);
for (id = 1; id < ath_maxvaps; id++) { break;
/* get the first available slot */ }
if ((id_mask & (1 << id)) == 0) {
ATH_SET_VAP_BSSID(vap->iv_myaddr, id);
ATH_SET_VAP_BSSID(vap->iv_bssid, id);
break;
} }
} else {
EPRINTF(sc, "Unique BSSID requested on HW that does"
"does not support the necessary features.");
} }
} }
avp->av_bslot = -1; avp->av_bslot = -1;