Lines Matching refs:vap

560  * The first vap uses the MAC address from the EEPROM.  For
561 * subsequent vap's we set the U/L bit (bit 1) in the MAC
599 struct ieee80211vap *vap, *apvap;
630 hvap = NULL; /* NB: we use associated AP vap */
632 return NULL; /* no existing AP vap */
647 * WDS vaps must have an associated AP vap; find one.
655 KASSERT(mvp->mv_ap_hvap != NULL, ("no ap vap"));
657 vap = &mvp->mv_vap;
658 ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid);
660 mvp->mv_newstate = vap->iv_newstate;
661 vap->iv_newstate = mwl_newstate;
662 vap->iv_max_keyix = 0; /* XXX */
663 vap->iv_key_alloc = mwl_key_alloc;
664 vap->iv_key_delete = mwl_key_delete;
665 vap->iv_key_set = mwl_key_set;
668 vap->iv_update_ps = mwl_update_ps;
669 mvp->mv_set_tim = vap->iv_set_tim;
670 vap->iv_set_tim = mwl_set_tim;
673 vap->iv_reset = mwl_reset;
674 vap->iv_update_beacon = mwl_beacon_update;
677 vap->iv_max_aid = MWL_MAXSTAID;
679 vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K;
680 vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_4;
683 ieee80211_vap_attach(vap, mwl_media_change, ieee80211_media_status,
686 switch (vap->iv_opmode) {
693 mwl_localstadb(vap);
694 if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
695 vap->iv_opmode == IEEE80211_M_MBSS)
716 return vap;
720 mwl_vap_delete(struct ieee80211vap *vap)
722 struct mwl_vap *mvp = MWL_VAP(vap);
723 struct mwl_softc *sc = vap->iv_ic->ic_softc;
726 enum ieee80211_opmode opmode = vap->iv_opmode;
728 /* XXX disallow ap vap delete if WDS still present */
730 /* quiesce h/w while we remove the vap */
733 ieee80211_vap_detach(vap);
738 KASSERT(hvap != NULL, ("no hal vap handle"));
739 (void) mwl_hal_delstation(hvap, vap->iv_myaddr);
746 reclaim_address(sc, vap->iv_myaddr);
754 mwl_cleartxq(sc, vap);
780 ieee80211_start_all(&sc->sc_ic); /* start all vap's */
1020 mwl_setrates(struct ieee80211vap *vap)
1022 struct mwl_vap *mvp = MWL_VAP(vap);
1023 struct ieee80211_node *ni = vap->iv_bss;
1027 KASSERT(vap->iv_state == IEEE80211_S_RUN, ("state %d", vap->iv_state));
1051 mwl_seteapolformat(struct ieee80211vap *vap)
1053 struct mwl_vap *mvp = MWL_VAP(vap);
1054 struct ieee80211_node *ni = vap->iv_bss;
1058 KASSERT(vap->iv_state == IEEE80211_S_RUN, ("state %d", vap->iv_state));
1063 * NB: this may violate POLA for sta and wds vap's.
1066 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
1067 rate = vap->iv_txparms[IEEE80211_MODE_11A].mgmtrate;
1069 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
1070 rate = vap->iv_txparms[IEEE80211_MODE_11G].mgmtrate;
1072 rate = vap->iv_txparms[mode].mgmtrate;
1150 * Push vap-independent state to the firmware.
1209 mwl_reset_vap(struct ieee80211vap *vap, int state)
1211 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1212 struct ieee80211com *ic = vap->iv_ic;
1215 mwl_setrates(vap);
1217 mwl_hal_setrtsthreshold(hvap, vap->iv_rtsthreshold);
1219 mwl_hal_sethtgi(hvap, (vap->iv_flags_ht &
1227 (vap->iv_opmode == IEEE80211_M_HOSTAP ||
1228 vap->iv_opmode == IEEE80211_M_MBSS ||
1229 vap->iv_opmode == IEEE80211_M_IBSS)) {
1230 mwl_setapmode(vap, vap->iv_bss->ni_chan);
1233 return mwl_beacon_setup(vap);
1240 * Used to reset or reload hardware state for a vap.
1243 mwl_reset(struct ieee80211vap *vap, u_long cmd)
1245 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1249 struct ieee80211com *ic = vap->iv_ic;
1253 /* XXX handle DWDS sta vap change */
1256 error = mwl_reset_vap(vap, vap->iv_state);
1471 struct ieee80211vap *vap = ifp->if_softc;
1477 mwl_setrates(vap);
1517 mwl_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
1520 struct mwl_softc *sc = vap->iv_ic->ic_softc;
1524 if (!(&vap->iv_nw_keys[0] <= k &&
1525 k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) {
1532 *keyix = *rxkeyix = k - vap->iv_nw_keys;
1546 mwl_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
1548 struct mwl_softc *sc = vap->iv_ic->ic_softc;
1549 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1555 if (vap->iv_opmode != IEEE80211_M_WDS) {
1559 vap->iv_opmode);
1562 hvap = MWL_VAP(vap)->mv_ap_hvap;
1607 mwl_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k)
1609 return (_mwl_key_set(vap, k, k->wk_macaddr));
1613 _mwl_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k,
1621 struct mwl_softc *sc = vap->iv_ic->ic_softc;
1622 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1631 if (vap->iv_opmode != IEEE80211_M_WDS) {
1635 vap->iv_opmode);
1638 hvap = MWL_VAP(vap)->mv_ap_hvap;
1646 if (k->wk_keyix == vap->iv_def_txkey)
1685 if (vap->iv_opmode == IEEE80211_M_STA) {
1693 macaddr = vap->iv_bss->ni_bssid;
1696 mwl_hal_keyset(hvap, &hk, vap->iv_myaddr);
1698 } else if (vap->iv_opmode == IEEE80211_M_WDS &&
1699 vap->iv_state != IEEE80211_S_RUN) {
1701 * Prior to RUN state a WDS vap will not it's BSS node
1706 macaddr = vap->iv_des_bssid;
1708 macaddr = vap->iv_myaddr;
1832 mwl_beacon_setup(struct ieee80211vap *vap)
1834 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1835 struct ieee80211_node *ni = vap->iv_bss;
1851 mwl_beacon_update(struct ieee80211vap *vap, int item)
1853 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
1854 struct ieee80211com *ic = vap->iv_ic;
1875 mwl_beacon_setup(vap);
1891 mwl_update_ps(struct ieee80211vap *vap, int nsta)
1893 struct mwl_vap *mvp = MWL_VAP(vap);
1906 struct ieee80211vap *vap = ni->ni_vap;
1907 struct mwl_vap *mvp = MWL_VAP(vap);
2242 mwl_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
2244 struct ieee80211com *ic = vap->iv_ic;
2269 struct ieee80211vap *vap = ni->ni_vap;
2272 if (vap->iv_opmode == IEEE80211_M_STA)
2273 mwl_hal_delstation(mn->mn_hvap, vap->iv_myaddr);
2280 * XXX can vap be NULL?
2282 else if (vap->iv_opmode == IEEE80211_M_WDS &&
2283 MWL_VAP(vap)->mv_ap_hvap != NULL)
2284 mwl_hal_delstation(MWL_VAP(vap)->mv_ap_hvap,
2360 DPRINTF(sc, MWL_DEBUG_NODE, "%s: ni %p vap %p staid %d\n",
3069 struct ieee80211vap *vap = ni->ni_vap;
3132 if (ieee80211_radiotap_active_vap(vap)) {
3142 ieee80211_radiotap_tx(vap, m0);
3246 const struct mwl_vap *mvp = MWL_VAP_CONST(vap);
3507 * specified vap. This is done when the vap is deleted so we
3508 * don't potentially reference the vap after it is gone.
3513 mwl_cleartxq(struct mwl_softc *sc, struct ieee80211vap *vap)
3524 if (ni != NULL && ni->ni_vap == vap) {
3559 struct ieee80211vap *vap = ni->ni_vap;
3598 sp = mwl_hal_bastream_alloc(MWL_VAP(vap)->mv_hvap,
3620 vap->iv_opmode == IEEE80211_M_STA ? vap->iv_myaddr : ni->ni_macaddr,
3643 struct ieee80211vap *vap = ni->ni_vap;
3654 error = mwl_hal_bastream_create(MWL_VAP(vap)->mv_hvap,
3748 mwl_getapmode(const struct ieee80211vap *vap, struct ieee80211_channel *chan)
3753 if (vap->iv_flags_ht & IEEE80211_FHT_PUREN)
3757 else if (vap->iv_flags & IEEE80211_F_PUREG)
3762 if (vap->iv_flags & IEEE80211_F_PUREG)
3776 mwl_setapmode(struct ieee80211vap *vap, struct ieee80211_channel *chan)
3778 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
3779 return mwl_hal_setapmode(hvap, mwl_getapmode(vap, chan));
3870 * multiple times if there are multiple vap's.
3873 mwl_startcsa(struct ieee80211vap *vap)
3875 struct ieee80211com *ic = vap->iv_ic;
3891 * global key table of the vap to each sta db entry.
3894 mwl_setanywepkey(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
3896 if ((vap->iv_flags & (IEEE80211_F_PRIVACY|IEEE80211_F_WPA)) ==
3898 vap->iv_def_txkey != IEEE80211_KEYIX_NONE &&
3899 vap->iv_nw_keys[vap->iv_def_txkey].wk_keyix != IEEE80211_KEYIX_NONE)
3900 (void) _mwl_key_set(vap, &vap->iv_nw_keys[vap->iv_def_txkey],
3908 struct ieee80211vap *vap = ni->ni_vap;
3912 if (vap->iv_opmode == IEEE80211_M_WDS) {
3914 * WDS vap's do not have a f/w vap; instead they piggyback
3915 * on an AP vap and we must install the sta db entry and
3916 * crypto state using that AP's handle (the WDS vap has none).
3918 hvap = MWL_VAP(vap)->mv_ap_hvap;
3920 hvap = MWL_VAP(vap)->mv_hvap;
3932 mwl_setanywepkey(vap, ni->ni_macaddr);
3939 mwl_setglobalkeys(struct ieee80211vap *vap)
3943 wk = &vap->iv_nw_keys[0];
3944 for (; wk < &vap->iv_nw_keys[IEEE80211_WEP_NKID]; wk++)
3946 (void) _mwl_key_set(vap, wk, vap->iv_myaddr);
4002 const struct ieee80211vap *vap = ni->ni_vap;
4019 if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0)
4021 if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0)
4030 * Re-create the local sta db entry for a vap to ensure
4036 mwl_localstadb(struct ieee80211vap *vap)
4039 struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap;
4044 switch (vap->iv_opmode) {
4046 bss = vap->iv_bss;
4047 error = mwl_hal_newstation(hvap, vap->iv_myaddr, 0, 0,
4048 vap->iv_state == IEEE80211_S_RUN ?
4054 mwl_setglobalkeys(vap);
4058 error = mwl_hal_newstation(hvap, vap->iv_myaddr,
4059 0, 0, NULL, vap->iv_flags & IEEE80211_F_WME, 0);
4061 mwl_setglobalkeys(vap);
4072 mwl_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
4074 struct mwl_vap *mvp = MWL_VAP(vap);
4076 struct ieee80211com *ic = vap->iv_ic;
4080 enum ieee80211_state ostate = vap->iv_state;
4084 vap->iv_ifp->if_xname, __func__,
4103 /* NB: only ap+sta vap's have a fw entity */
4116 ni = vap->iv_bss;
4121 if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
4122 vap->iv_opmode == IEEE80211_M_MBSS)
4123 mwl_startcsa(vap);
4133 error = mvp->mv_newstate(vap, nstate, arg);
4141 ni = vap->iv_bss;
4146 vap->iv_ifp->if_xname, __func__, vap->iv_flags,
4153 mwl_localstadb(vap);
4154 switch (vap->iv_opmode) {
4167 error = mwl_reset_vap(vap, IEEE80211_S_RUN);
4179 vap->iv_ifp->if_xname, __func__, ni->ni_associd);
4184 mwl_setrates(vap);
4185 mwl_hal_setrtsthreshold(hvap, vap->iv_rtsthreshold);
4186 if ((vap->iv_flags & IEEE80211_F_DWDS) &&
4192 vap->iv_ifp->if_xname, __func__,
4194 mwl_seteapolformat(vap);
4217 } else if ((vap->iv_flags & IEEE80211_F_DWDS) &&
4259 struct ieee80211vap *vap = ni->ni_vap;
4260 struct mwl_softc *sc = vap->iv_ic->ic_softc;
4269 mn->mn_hvap = MWL_VAP(vap)->mv_hvap;