Fake the assoc id so that ndis can work on the latest net80211.

PR:		kern/128750
Submitted by:	Paul B. Mahol
This commit is contained in:
Andrew Thompson 2008-11-11 03:36:15 +00:00
parent 335a351231
commit a1f8daf412
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184833

View File

@ -2591,6 +2591,10 @@ ndis_get_assoc(sc, assoc)
struct ndis_softc *sc;
ndis_wlan_bssid_ex **assoc;
{
struct ifnet *ifp = sc->ifp;
struct ieee80211com *ic = ifp->if_l2com;
struct ieee80211vap *vap;
struct ieee80211_node *ni;
ndis_80211_bssid_list_ex *bl;
ndis_wlan_bssid_ex *bs;
ndis_80211_macaddr bssid;
@ -2606,6 +2610,9 @@ ndis_get_assoc(sc, assoc)
return(ENOENT);
}
vap = TAILQ_FIRST(&ic->ic_vaps);
ni = vap->iv_bss;
len = sizeof(uint32_t) + (sizeof(ndis_wlan_bssid_ex) * 16);
bl = malloc(len, M_TEMP, M_NOWAIT | M_ZERO);
if (bl == NULL)
@ -2636,8 +2643,10 @@ ndis_get_assoc(sc, assoc)
}
bcopy((char *)bs, (char *)*assoc, bs->nwbx_len);
free(bl, M_TEMP);
if (ic->ic_opmode == IEEE80211_M_STA)
ni->ni_associd = 1 | 0xc000; /* fake associd */
return(0);
}
}
bs = (ndis_wlan_bssid_ex *)((char *)bs + bs->nwbx_len);
}