Lines Matching refs:vap

97 MALLOC_DEFINE(M_80211_VAP, "80211vap", "802.11 vap state");
274 * the driver on attach to prior to creating any vap's.
351 * all vap's and reclaim all common state prior to the
359 struct ieee80211vap *vap;
373 while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL)
374 ieee80211_vap_destroy(vap);
409 default_reset(struct ieee80211vap *vap, u_long cmd)
415 * Prepare a vap for use. Drivers use this call to
416 * setup net80211 state in new vap's prior attaching
420 ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
434 ifp->if_softc = vap; /* back pointer */
441 vap->iv_ifp = ifp;
442 vap->iv_ic = ic;
443 vap->iv_flags = ic->ic_flags; /* propagate common flags */
444 vap->iv_flags_ext = ic->ic_flags_ext;
445 vap->iv_flags_ven = ic->ic_flags_ven;
446 vap->iv_caps = ic->ic_caps &~ IEEE80211_C_OPMODE;
447 vap->iv_htcaps = ic->ic_htcaps;
448 vap->iv_htextcaps = ic->ic_htextcaps;
449 vap->iv_opmode = opmode;
450 vap->iv_caps |= ieee80211_opcap[opmode];
458 * vap to the proper node happens when the vap
461 IEEE80211_ADDR_COPY(vap->iv_des_bssid, bssid);
462 vap->iv_flags |= IEEE80211_F_DESBSSID;
464 vap->iv_flags_ext |= IEEE80211_FEXT_WDSLEGACY;
473 * Propagate TDMA capability to mark vap; this
477 vap->iv_caps |= IEEE80211_C_TDMA;
486 vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS;
489 vap->iv_flags_ext |= IEEE80211_FEXT_UNIQMAC;
494 if (vap->iv_caps & IEEE80211_C_WME)
495 vap->iv_flags |= IEEE80211_F_WME;
496 if (vap->iv_caps & IEEE80211_C_BURST)
497 vap->iv_flags |= IEEE80211_F_BURST;
499 if (vap->iv_opmode == IEEE80211_M_STA &&
500 (vap->iv_caps & IEEE80211_C_BGSCAN))
501 vap->iv_flags |= IEEE80211_F_BGSCAN;
502 vap->iv_flags |= IEEE80211_F_DOTH; /* XXX no cap, just ena */
504 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
505 (vap->iv_caps & IEEE80211_C_DFS))
506 vap->iv_flags_ext |= IEEE80211_FEXT_DFS;
508 vap->iv_des_chan = IEEE80211_CHAN_ANYC; /* any channel is ok */
509 vap->iv_bmissthreshold = IEEE80211_HWBMISS_DEFAULT;
510 vap->iv_dtim_period = IEEE80211_DTIM_DEFAULT;
515 vap->iv_reset = default_reset;
517 IEEE80211_ADDR_COPY(vap->iv_myaddr, macaddr);
519 ieee80211_sysctl_vattach(vap);
520 ieee80211_crypto_vattach(vap);
521 ieee80211_node_vattach(vap);
522 ieee80211_power_vattach(vap);
523 ieee80211_proto_vattach(vap);
525 ieee80211_superg_vattach(vap);
527 ieee80211_ht_vattach(vap);
528 ieee80211_scan_vattach(vap);
529 ieee80211_regdomain_vattach(vap);
530 ieee80211_radiotap_vattach(vap);
531 ieee80211_ratectl_set(vap, IEEE80211_RATECTL_NONE);
537 * Activate a vap. State should have been prepared with a
539 * from this call the vap is ready for use.
542 ieee80211_vap_attach(struct ieee80211vap *vap,
545 struct ifnet *ifp = vap->iv_ifp;
546 struct ieee80211com *ic = vap->iv_ic;
550 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
552 __func__, ieee80211_opmode_name[vap->iv_opmode],
553 ic->ic_ifp->if_xname, vap->iv_flags, vap->iv_flags_ext);
559 ieee80211_node_latevattach(vap);
560 ieee80211_power_latevattach(vap);
562 maxrate = ieee80211_media_setup(ic, &vap->iv_media, vap->iv_caps,
563 vap->iv_opmode == IEEE80211_M_STA, media_change, media_stat);
566 ifmedia_set(&vap->iv_media,
571 ether_ifattach(ifp, vap->iv_myaddr);
572 if (vap->iv_opmode == IEEE80211_M_MONITOR) {
578 vap->iv_output = ifp->if_output;
584 TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next);
601 * Tear down vap state and reclaim the ifnet.
607 ieee80211_vap_detach(struct ieee80211vap *vap)
609 struct ieee80211com *ic = vap->iv_ic;
610 struct ifnet *ifp = vap->iv_ifp;
614 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s parent %s\n",
615 __func__, ieee80211_opmode_name[vap->iv_opmode],
621 ieee80211_stop(vap);
624 * Flush any deferred vap tasks.
626 ieee80211_draintask(ic, &vap->iv_nstate_task);
627 ieee80211_draintask(ic, &vap->iv_swbmiss_task);
633 KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running"));
634 TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next);
649 ifmedia_removeall(&vap->iv_media);
651 ieee80211_radiotap_vdetach(vap);
652 ieee80211_regdomain_vdetach(vap);
653 ieee80211_scan_vdetach(vap);
655 ieee80211_superg_vdetach(vap);
657 ieee80211_ht_vdetach(vap);
659 ieee80211_proto_vdetach(vap);
660 ieee80211_crypto_vdetach(vap);
661 ieee80211_power_vdetach(vap);
662 ieee80211_node_vdetach(vap);
663 ieee80211_sysctl_vdetach(vap);
672 * according to the state of all vap ifnet's. This is used,
679 struct ieee80211vap *vap;
685 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
686 if (vap->iv_ifp->if_flags & flag) {
693 !(vap->iv_opmode == IEEE80211_M_MONITOR ||
694 (vap->iv_opmode == IEEE80211_M_AHDEMO &&
695 (vap->iv_caps & IEEE80211_C_TDMA) == 0)))
718 * according to the state of all vap's. This is used,
724 struct ieee80211vap *vap;
730 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
731 if (vap->iv_flags & flag) {
742 ieee80211_syncflag(struct ieee80211vap *vap, int flag)
744 struct ieee80211com *ic = vap->iv_ic;
749 vap->iv_flags &= ~flag;
751 vap->iv_flags |= flag;
758 * according to the state of all vap's. This is used,
764 struct ieee80211vap *vap;
770 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
771 if (vap->iv_flags_ht & flag) {
782 ieee80211_syncflag_ht(struct ieee80211vap *vap, int flag)
784 struct ieee80211com *ic = vap->iv_ic;
789 vap->iv_flags_ht &= ~flag;
791 vap->iv_flags_ht |= flag;
798 * according to the state of all vap's. This is used,
804 struct ieee80211vap *vap;
810 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
811 if (vap->iv_flags_ext & flag) {
822 ieee80211_syncflag_ext(struct ieee80211vap *vap, int flag)
824 struct ieee80211com *ic = vap->iv_ic;
829 vap->iv_flags_ext &= ~flag;
831 vap->iv_flags_ext |= flag;
1163 /* XXX need to propagate new media settings to vap's */
1304 * Handle a media change request on the vap interface.
1309 struct ieee80211vap *vap = ifp->if_softc;
1310 struct ifmedia_entry *ime = vap->iv_media.ifm_cur;
1313 if (!media2mode(ime, vap->iv_flags, &newmode))
1315 if (vap->iv_des_mode != newmode) {
1316 vap->iv_des_mode = newmode;
1384 struct ieee80211vap *vap;
1387 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
1388 if (vap->iv_ifp->if_flags & IFF_UP) {
1400 struct ieee80211vap *vap = ifp->if_softc;
1401 struct ieee80211com *ic = vap->iv_ic;
1410 if (vap->iv_state == IEEE80211_S_RUN) {
1415 imr->ifm_active = media_status(vap->iv_opmode, ic->ic_curchan);
1419 if (vap->iv_txparms[mode].ucastrate != IEEE80211_FIXED_RATE_NONE) {
1424 vap->iv_txparms[mode].ucastrate, mode);
1425 } else if (vap->iv_opmode == IEEE80211_M_STA) {
1430 vap->iv_bss->ni_txrate, mode);