From 34a60cf64e48ac48cd0bf659a001983a849c170e Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Thu, 18 Feb 2010 18:35:54 +0000 Subject: [PATCH] Second pass at converting the net80211 to DragonFly. --- sys/netproto/802_11/ieee80211_dragonfly.h | 9 +++-- sys/netproto/802_11/ieee80211_proto.h | 2 +- sys/netproto/802_11/ieee80211_var.h | 4 +-- sys/netproto/802_11/wlan/Makefile | 5 ++- sys/netproto/802_11/wlan/ieee80211.c | 21 ++++++++--- sys/netproto/802_11/wlan/ieee80211_ddb.c | 35 +++++++++---------- sys/netproto/802_11/wlan/ieee80211_hostap.c | 4 +-- sys/netproto/802_11/wlan/ieee80211_ht.c | 2 +- sys/netproto/802_11/wlan/ieee80211_hwmp.c | 2 +- sys/netproto/802_11/wlan/ieee80211_ioctl.c | 10 +++--- sys/netproto/802_11/wlan/ieee80211_mesh.c | 4 +-- sys/netproto/802_11/wlan/ieee80211_node.c | 2 +- sys/netproto/802_11/wlan/ieee80211_output.c | 11 +++--- sys/netproto/802_11/wlan/ieee80211_power.c | 4 +-- sys/netproto/802_11/wlan/ieee80211_proto.c | 22 ++++++------ sys/netproto/802_11/wlan/ieee80211_radiotap.c | 6 ++-- sys/netproto/802_11/wlan/ieee80211_scan.c | 1 - 17 files changed, 79 insertions(+), 65 deletions(-) diff --git a/sys/netproto/802_11/ieee80211_dragonfly.h b/sys/netproto/802_11/ieee80211_dragonfly.h index 2e8355a376..7d86c3e347 100644 --- a/sys/netproto/802_11/ieee80211_dragonfly.h +++ b/sys/netproto/802_11/ieee80211_dragonfly.h @@ -36,6 +36,9 @@ #include #include +#define IF_LOCK(_lock) /* */ +#define IF_UNLOCK(_lock) /* */ + /* * Common state locking definitions. */ @@ -181,7 +184,7 @@ void ieee80211_vap_destroy(struct ieee80211vap *); #define IFNET_IS_UP_RUNNING(_ifp) \ (((_ifp)->if_flags & IFF_UP) && \ - ((_ifp)->if_drv_flags & IFF_DRV_RUNNING)) + ((_ifp)->if_flags & IFF_RUNNING)) #define msecs_to_ticks(ms) (((ms)*hz)/1000) #define ticks_to_msecs(t) (1000*(t) / hz) @@ -249,8 +252,8 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); * Store the sequence number. */ #define M_SEQNO_SET(m, seqno) \ - ((m)->m_pkthdr.tso_segsz = (seqno)) -#define M_SEQNO_GET(m) ((m)->m_pkthdr.tso_segsz) + ((m)->m_pkthdr.wlan_seqno = (seqno)) +#define M_SEQNO_GET(m) ((m)->m_pkthdr.wlan_seqno) #define MTAG_ABI_NET80211 1132948340 /* net80211 ABI */ diff --git a/sys/netproto/802_11/ieee80211_proto.h b/sys/netproto/802_11/ieee80211_proto.h index 4d8aa439fb..a969d695a4 100644 --- a/sys/netproto/802_11/ieee80211_proto.h +++ b/sys/netproto/802_11/ieee80211_proto.h @@ -71,7 +71,7 @@ int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int, int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); int ieee80211_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *ro); + struct sockaddr *, struct rtentry *rt); void ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); diff --git a/sys/netproto/802_11/ieee80211_var.h b/sys/netproto/802_11/ieee80211_var.h index 8f3fe28242..b169ce3c2b 100644 --- a/sys/netproto/802_11/ieee80211_var.h +++ b/sys/netproto/802_11/ieee80211_var.h @@ -470,7 +470,7 @@ struct ieee80211vap { enum ieee80211_state, int); /* 802.3 output method for raw frame xmit */ int (*iv_output)(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); + struct sockaddr *, struct rtentry *); uint64_t iv_spare[8]; }; MALLOC_DECLARE(M_80211_VAP); @@ -657,7 +657,7 @@ void ieee80211_media_init(struct ieee80211com *); struct ieee80211com *ieee80211_find_vap(const uint8_t mac[IEEE80211_ADDR_LEN]); int ieee80211_media_change(struct ifnet *); void ieee80211_media_status(struct ifnet *, struct ifmediareq *); -int ieee80211_ioctl(struct ifnet *, u_long, caddr_t); +int ieee80211_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *); int ieee80211_rate2media(struct ieee80211com *, int, enum ieee80211_phymode); int ieee80211_media2rate(int); diff --git a/sys/netproto/802_11/wlan/Makefile b/sys/netproto/802_11/wlan/Makefile index 70a01e5769..9dd63ca735 100644 --- a/sys/netproto/802_11/wlan/Makefile +++ b/sys/netproto/802_11/wlan/Makefile @@ -12,7 +12,7 @@ SRCS += ieee80211_ratectl_none.c ieee80211_regdomain.c ieee80211_rssadapt.c SRCS += ieee80211_scan.c ieee80211_scan_sta.c ieee80211_sta.c SRCS += ieee80211_superg.c ieee80211_tdma.c ieee80211_wds.c SRCS += bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h -SRCS += opt_tdma.h +SRCS += opt_tdma.h opt_ddb.h .if !defined(BUILDING_WITH_KERNEL) opt_inet.h: @@ -31,6 +31,9 @@ opt_wlan.h: opt_tdma.h: echo "" > ${.TARGET} +opt_ddb.h: + echo "#define DDB 1" > ${.TARGET} + .endif .include diff --git a/sys/netproto/802_11/wlan/ieee80211.c b/sys/netproto/802_11/wlan/ieee80211.c index 59fb523fd9..e4ddabaeaa 100644 --- a/sys/netproto/802_11/wlan/ieee80211.c +++ b/sys/netproto/802_11/wlan/ieee80211.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -313,7 +314,7 @@ ieee80211_ifattach(struct ieee80211com *ic, sdl->sdl_type = IFT_ETHER; /* XXX IFT_IEEE80211? */ sdl->sdl_alen = IEEE80211_ADDR_LEN; IEEE80211_ADDR_COPY(LLADDR(sdl), macaddr); - ifa_free(ifa); + IFAFREE(ifa); } /* @@ -381,12 +382,16 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap, { struct ifnet *ifp; +#ifdef __FreeBSD__ ifp = if_alloc(IFT_ETHER); +#endif + ifp = kmalloc(sizeof(struct ifnet), M_TEMP, M_WAITOK|M_ZERO); if (ifp == NULL) { if_printf(ic->ic_ifp, "%s: unable to allocate ifnet\n", __func__); return ENOMEM; } + ifp->if_type = IFT_ETHER; if_initname(ifp, name, unit); ifp->if_softc = vap; /* back pointer */ ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; @@ -394,9 +399,8 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap, ifp->if_ioctl = ieee80211_ioctl; ifp->if_init = ieee80211_init; /* NB: input+output filled in by ether_ifattach */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; - IFQ_SET_READY(&ifp->if_snd); + ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); + ifq_set_ready(&ifp->if_snd); vap->iv_ifp = ifp; vap->iv_ic = ic; @@ -527,7 +531,9 @@ ieee80211_vap_attach(struct ieee80211vap *vap, ether_ifattach(ifp, vap->iv_myaddr, NULL); if (vap->iv_opmode == IEEE80211_M_MONITOR) { /* NB: disallow transmit */ +#ifdef __FreeBSD__ ifp->if_transmit = null_transmit; +#endif ifp->if_output = null_output; } else { /* hook output method setup by ether_ifattach */ @@ -580,8 +586,10 @@ ieee80211_vap_detach(struct ieee80211vap *vap) ieee80211_draintask(ic, &vap->iv_nstate_task); ieee80211_draintask(ic, &vap->iv_swbmiss_task); +#ifdef __FreeBSD__ /* XXX band-aid until ifnet handles this for us */ taskqueue_drain(taskqueue_swi, &ifp->if_linktask); +#endif IEEE80211_LOCK(ic); KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); @@ -616,7 +624,10 @@ ieee80211_vap_detach(struct ieee80211vap *vap) ieee80211_node_vdetach(vap); ieee80211_sysctl_vdetach(vap); +#ifdef __FreeBSD__ if_free(ifp); +#endif + kfree(ifp, M_TEMP); } /* @@ -656,7 +667,7 @@ ieee80211_syncifflag_locked(struct ieee80211com *ic, int flag) ifp->if_flags &= ~flag; if ((ifp->if_flags ^ oflags) & flag) { /* XXX should we return 1/0 and let caller do this? */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_flags & IFF_RUNNING) { if (flag == IFF_PROMISC) ieee80211_runtask(ic, &ic->ic_promisc_task); else if (flag == IFF_ALLMULTI) diff --git a/sys/netproto/802_11/wlan/ieee80211_ddb.c b/sys/netproto/802_11/wlan/ieee80211_ddb.c index 4223ae9623..d464f809a6 100644 --- a/sys/netproto/802_11/wlan/ieee80211_ddb.c +++ b/sys/netproto/802_11/wlan/ieee80211_ddb.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #ifdef IEEE80211_SUPPORT_TDMA @@ -153,7 +152,6 @@ DB_SHOW_COMMAND(com, db_show_com) DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps) { - VNET_ITERATOR_DECL(vnet_iter); const struct ifnet *ifp; int i, showall = 0; @@ -164,23 +162,22 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps) break; } - VNET_FOREACH(vnet_iter) { - TAILQ_FOREACH(ifp, &V_ifnet, if_list) - if (ifp->if_type == IFT_IEEE80211) { - const struct ieee80211com *ic = ifp->if_l2com; - - if (!showall) { - const struct ieee80211vap *vap; - db_printf("%s: com %p vaps:", - ifp->if_xname, ic); - TAILQ_FOREACH(vap, &ic->ic_vaps, - iv_next) - db_printf(" %s(%p)", - vap->iv_ifp->if_xname, vap); - db_printf("\n"); - } else - _db_show_com(ic, 1, 1, 1); - } + TAILQ_FOREACH(ifp, &ifnet, if_list) { + if (ifp->if_type == IFT_IEEE80211) { + const struct ieee80211com *ic = ifp->if_l2com; + + if (!showall) { + const struct ieee80211vap *vap; + db_printf("%s: com %p vaps:", + ifp->if_xname, ic); + TAILQ_FOREACH(vap, &ic->ic_vaps, + iv_next) + db_printf(" %s(%p)", + vap->iv_ifp->if_xname, vap); + db_printf("\n"); + } else + _db_show_com(ic, 1, 1, 1); + } } } diff --git a/sys/netproto/802_11/wlan/ieee80211_hostap.c b/sys/netproto/802_11/wlan/ieee80211_hostap.c index b1cf8d2d2f..ef607b0e62 100644 --- a/sys/netproto/802_11/wlan/ieee80211_hostap.c +++ b/sys/netproto/802_11/wlan/ieee80211_hostap.c @@ -433,7 +433,7 @@ hostap_deliver_data(struct ieee80211vap *vap, } if (ni->ni_vlan != 0) { /* attach vlan tag */ - m->m_pkthdr.ether_vtag = ni->ni_vlan; + m->m_pkthdr.ether_vlantag = ni->ni_vlan; m->m_flags |= M_VLANTAG; } ifp->if_input(ifp, m); @@ -2292,5 +2292,5 @@ hostap_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) else ifp = vap->iv_ifp; IF_ENQUEUE(&ifp->if_snd, m); - if_start(ifp); + ifp->if_start(ifp); } diff --git a/sys/netproto/802_11/wlan/ieee80211_ht.c b/sys/netproto/802_11/wlan/ieee80211_ht.c index 2c9958f94d..7b058f6d2f 100644 --- a/sys/netproto/802_11/wlan/ieee80211_ht.c +++ b/sys/netproto/802_11/wlan/ieee80211_ht.c @@ -1477,7 +1477,7 @@ ieee80211_setup_basic_htrates(struct ieee80211_node *ni, const uint8_t *ie) static void ampdu_tx_setup(struct ieee80211_tx_ampdu *tap) { - callout_init(&tap->txa_timer, CALLOUT_MPSAFE); + callout_init_mp(&tap->txa_timer); tap->txa_flags |= IEEE80211_AGGR_SETUP; } diff --git a/sys/netproto/802_11/wlan/ieee80211_hwmp.c b/sys/netproto/802_11/wlan/ieee80211_hwmp.c index b5f08ec0b5..4862c598fb 100644 --- a/sys/netproto/802_11/wlan/ieee80211_hwmp.c +++ b/sys/netproto/802_11/wlan/ieee80211_hwmp.c @@ -244,7 +244,7 @@ hwmp_vattach(struct ieee80211vap *vap) return; } hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; - callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); + callout_init_mp(&hs->hs_roottimer); vap->iv_hwmp = hs; } diff --git a/sys/netproto/802_11/wlan/ieee80211_ioctl.c b/sys/netproto/802_11/wlan/ieee80211_ioctl.c index 7c4c3435eb..7b90cc0d72 100644 --- a/sys/netproto/802_11/wlan/ieee80211_ioctl.c +++ b/sys/netproto/802_11/wlan/ieee80211_ioctl.c @@ -2348,7 +2348,7 @@ ieee80211_ioctl_scanreq(struct ieee80211vap *vap, struct ieee80211req *ireq) int error, i; /* NB: parent must be running */ - if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ic->ic_ifp->if_flags & IFF_RUNNING) == 0) return ENXIO; if (ireq->i_len != sizeof(sr)) @@ -3208,7 +3208,7 @@ ieee80211_ioctl_updatemulti(struct ieee80211com *ic) struct ifnet *ifp = vap->iv_ifp; struct ifmultiaddr *ifma; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; (void) if_addmulti(parent, ifma->ifma_addr, NULL); @@ -3220,7 +3220,7 @@ ieee80211_ioctl_updatemulti(struct ieee80211com *ic) } int -ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *ucred) { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; @@ -3242,7 +3242,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) */ if (vap->iv_state == IEEE80211_S_INIT) ieee80211_start_locked(vap); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_flags & IFF_RUNNING) { /* * Stop ourself. If we are the last vap to be * marked down the parent will also be taken down. @@ -3334,7 +3334,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSDRVSPEC: case SIOCGPRIVATE_0: { struct ifnet *parent = vap->iv_ic->ic_ifp; - error = parent->if_ioctl(parent, cmd, data); + error = parent->if_ioctl(parent, cmd, data, ucred); break; } default: diff --git a/sys/netproto/802_11/wlan/ieee80211_mesh.c b/sys/netproto/802_11/wlan/ieee80211_mesh.c index 1580f96329..07992b4182 100644 --- a/sys/netproto/802_11/wlan/ieee80211_mesh.c +++ b/sys/netproto/802_11/wlan/ieee80211_mesh.c @@ -533,7 +533,7 @@ mesh_vattach(struct ieee80211vap *vap) ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL; TAILQ_INIT(&ms->ms_routes); lockinit(&ms->ms_rt_lock, "MBSS", 0, 0); - callout_init(&ms->ms_cleantimer, CALLOUT_MPSAFE); + callout_init_mp(&ms->ms_cleantimer); mesh_select_proto_metric(vap, "AIRTIME"); KASSERT(ms->ms_pmetric, ("ms_pmetric == NULL")); mesh_select_proto_path(vap, "HWMP"); @@ -2521,7 +2521,7 @@ void ieee80211_mesh_node_init(struct ieee80211vap *vap, struct ieee80211_node *ni) { ni->ni_flags |= IEEE80211_NODE_QOS; - callout_init(&ni->ni_mltimer, CALLOUT_MPSAFE); + callout_init_mp(&ni->ni_mltimer); } /* diff --git a/sys/netproto/802_11/wlan/ieee80211_node.c b/sys/netproto/802_11/wlan/ieee80211_node.c index 906d890239..ffec8e5fc3 100644 --- a/sys/netproto/802_11/wlan/ieee80211_node.c +++ b/sys/netproto/802_11/wlan/ieee80211_node.c @@ -111,7 +111,7 @@ ieee80211_node_attach(struct ieee80211com *ic) "802.11 staging q"); ieee80211_node_table_init(ic, &ic->ic_sta, "station", IEEE80211_INACT_INIT, ic->ic_max_keyix); - callout_init(&ic->ic_inact, CALLOUT_MPSAFE); + callout_init_mp(&ic->ic_inact); callout_reset(&ic->ic_inact, IEEE80211_INACT_WAIT*hz, ieee80211_node_timeout, ic); diff --git a/sys/netproto/802_11/wlan/ieee80211_output.c b/sys/netproto/802_11/wlan/ieee80211_output.c index dbf47b3362..779662c294 100644 --- a/sys/netproto/802_11/wlan/ieee80211_output.c +++ b/sys/netproto/802_11/wlan/ieee80211_output.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -152,14 +153,14 @@ ieee80211_start(struct ifnet *ifp) "%s: ignore queue, in %s state\n", __func__, ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_tx_badstate++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + ifp->if_flags |= IFF_OACTIVE; IEEE80211_UNLOCK(ic); return; } IEEE80211_UNLOCK(ic); } for (;;) { - IFQ_DEQUEUE(&ifp->if_snd, m); + ifq_dequeue(&ifp->if_snd, m); if (m == NULL) break; /* @@ -376,7 +377,7 @@ ieee80211_start(struct ifnet *ifp) */ int ieee80211_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro) + struct sockaddr *dst, struct rtentry *rt) { #define senderr(e) do { error = (e); goto bad;} while (0) struct ieee80211_node *ni = NULL; @@ -384,7 +385,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct ieee80211_frame *wh; int error; - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (ifp->if_flags & IFF_OACTIVE) { /* * Short-circuit requests if the vap is marked OACTIVE * as this can happen because a packet came down through @@ -401,7 +402,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, * a raw 802.11 frame. */ if (dst->sa_family != AF_IEEE80211) - return vap->iv_output(ifp, m, dst, ro); + return vap->iv_output(ifp, m, dst, rt); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) diff --git a/sys/netproto/802_11/wlan/ieee80211_power.c b/sys/netproto/802_11/wlan/ieee80211_power.c index 5305eda06e..1b25bea382 100644 --- a/sys/netproto/802_11/wlan/ieee80211_power.c +++ b/sys/netproto/802_11/wlan/ieee80211_power.c @@ -450,9 +450,9 @@ pwrsave_flushq(struct ieee80211_node *ni) /* NB: do this outside the psq lock */ /* XXX packets might get reordered if parent is OACTIVE */ if (parent != NULL) - if_start(parent); + parent->if_start(parent); if (ifp != NULL) - if_start(ifp); + ifp->if_start(ifp); } /* diff --git a/sys/netproto/802_11/wlan/ieee80211_proto.c b/sys/netproto/802_11/wlan/ieee80211_proto.c index ba0ebf7dc1..0ca127d1b8 100644 --- a/sys/netproto/802_11/wlan/ieee80211_proto.c +++ b/sys/netproto/802_11/wlan/ieee80211_proto.c @@ -193,8 +193,8 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT; vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT; vap->iv_bmiss_max = IEEE80211_BMISS_MAX; - callout_init(&vap->iv_swbmiss, CALLOUT_MPSAFE); - callout_init(&vap->iv_mgtsend, CALLOUT_MPSAFE); + callout_init_mp(&vap->iv_swbmiss); + callout_init_mp(&vap->iv_mgtsend); TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); /* @@ -1090,7 +1090,7 @@ parent_updown(void *arg, int npending) { struct ifnet *parent = arg; - parent->if_ioctl(parent, SIOCSIFFLAGS, NULL); + parent->if_ioctl(parent, SIOCSIFFLAGS, NULL, curthread->td_ucred); } static void @@ -1155,7 +1155,7 @@ ieee80211_start_locked(struct ieee80211vap *vap) IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, "start running, %d vaps running\n", ic->ic_nrunning); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if ((ifp->if_flags & IFF_RUNNING) == 0) { /* * Mark us running. Note that it's ok to do this first; * if we need to bring the parent device up we defer that @@ -1164,13 +1164,13 @@ ieee80211_start_locked(struct ieee80211vap *vap) * through ieee80211_start_all at which point we'll come * back in here and complete the work. */ - ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_flags |= IFF_RUNNING; /* * We are not running; if this we are the first vap * to be brought up auto-up the parent if necessary. */ if (ic->ic_nrunning++ == 0 && - (parent->if_drv_flags & IFF_DRV_RUNNING) == 0) { + (parent->if_flags & IFF_RUNNING) == 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, "%s: up parent %s\n", __func__, parent->if_xname); @@ -1183,7 +1183,7 @@ ieee80211_start_locked(struct ieee80211vap *vap) * If the parent is up and running, then kick the * 802.11 state machine as appropriate. */ - if ((parent->if_drv_flags & IFF_DRV_RUNNING) && + if ((parent->if_flags & IFF_RUNNING) && vap->iv_roaming != IEEE80211_ROAMING_MANUAL) { if (vap->iv_opmode == IEEE80211_M_STA) { #if 0 @@ -1275,10 +1275,10 @@ ieee80211_stop_locked(struct ieee80211vap *vap) "stop running, %d vaps running\n", ic->ic_nrunning); ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* mark us stopped */ + if (ifp->if_flags & IFF_RUNNING) { + ifp->if_flags &= ~IFF_RUNNING; /* mark us stopped */ if (--ic->ic_nrunning == 0 && - (parent->if_drv_flags & IFF_DRV_RUNNING)) { + (parent->if_flags & IFF_RUNNING)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, "down parent %s\n", parent->if_xname); @@ -1677,7 +1677,7 @@ ieee80211_newstate_cb(void *xvap, int npending) * Note this can also happen as a result of SLEEP->RUN * (i.e. coming out of power save mode). */ - vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + vap->iv_ifp->if_flags &= ~IFF_OACTIVE; if_start(vap->iv_ifp); /* bring up any vaps waiting on us */ diff --git a/sys/netproto/802_11/wlan/ieee80211_radiotap.c b/sys/netproto/802_11/wlan/ieee80211_radiotap.c index 416fcf2ca4..2ee9240a9a 100644 --- a/sys/netproto/802_11/wlan/ieee80211_radiotap.c +++ b/sys/netproto/802_11/wlan/ieee80211_radiotap.c @@ -105,7 +105,7 @@ ieee80211_radiotap_vattach(struct ieee80211vap *vap) if (th != NULL && ic->ic_rh != NULL) { /* radiotap DLT for raw 802.11 frames */ - bpfattach2(vap->iv_ifp, DLT_IEEE802_11_RADIO, + bpfattach_dlt(vap->iv_ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + le16toh(th->it_len), &vap->iv_rawbpf); } @@ -185,7 +185,7 @@ spam_vaps(struct ieee80211vap *vap0, struct mbuf *m, vap->iv_opmode == IEEE80211_M_MONITOR && (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && vap->iv_state != IEEE80211_S_INIT) - bpf_mtap2(vap->iv_rawbpf, rh, len, m); + bpf_ptap(vap->iv_rawbpf, m, rh, len); } } @@ -203,7 +203,7 @@ ieee80211_radiotap_tx(struct ieee80211vap *vap0, struct mbuf *m) len = le16toh(th->it_len); if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) - bpf_mtap2(vap0->iv_rawbpf, th, len, m); + bpf_ptap(vap0->iv_rawbpf, m, th, len); /* * Spam monitor mode vaps. */ diff --git a/sys/netproto/802_11/wlan/ieee80211_scan.c b/sys/netproto/802_11/wlan/ieee80211_scan.c index e5b00d4d7b..8b5a3887c3 100644 --- a/sys/netproto/802_11/wlan/ieee80211_scan.c +++ b/sys/netproto/802_11/wlan/ieee80211_scan.c @@ -35,7 +35,6 @@ #include #include #include -#include #include -- 2.41.0