diff options
author | adrian <adrian@FreeBSD.org> | 2013-08-08 05:09:35 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-08-08 05:09:35 +0000 |
commit | aa68907edaaef774817c1bf625fa8ca0424f4e84 (patch) | |
tree | 4291a4d39d439572a02fc5815d3ee2df5166c80a /sys/net80211/ieee80211_output.c | |
parent | 541895143dbcbc415fa4b23bf8f4db2d9996ba12 (diff) | |
download | FreeBSD-src-aa68907edaaef774817c1bf625fa8ca0424f4e84.zip FreeBSD-src-aa68907edaaef774817c1bf625fa8ca0424f4e84.tar.gz |
Convert net80211 over to using if_transmit for the dispatch from the
upper layer(s).
This eliminates the if_snd queue from net80211. Yay!
This unfortunately has a few side effects:
* It breaks ALTQ to net80211 for now - sorry everyone, but fixing
parallelism and eliminating the if_snd queue is more important
than supporting this broken traffic scheduling model. :-)
* There's no VAP and IC flush methods just yet - I think I'll add
some NULL methods for now just as placeholders.
* It reduces throughput a little because now net80211 will drop packets
rather than buffer them if the driver doesn't do its own buffering.
This will be addressed in the future as I implement per-node software
queues.
Tested:
* ath(4) and iwn(4) in STA operation
Diffstat (limited to 'sys/net80211/ieee80211_output.c')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 0b86ecc..7a88018 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -236,7 +236,7 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m, return (ENOBUFS); } } - error = ieee80211_parent_transmit(ic, m); + error = ieee80211_parent_xmitpkt(ic, m); /* * Unlock at this point - no need to hold it across @@ -397,13 +397,12 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) * through here. We handle common processing of the packets * before dispatching them to the underlying device. */ -void -ieee80211_start(struct ifnet *ifp) +int +ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; struct ifnet *parent = ic->ic_ifp; - struct mbuf *m; /* NB: parent must be up and running */ if (!IFNET_IS_UP_RUNNING(parent)) { @@ -411,14 +410,14 @@ ieee80211_start(struct ifnet *ifp) "%s: ignore queue, parent %s not up+running\n", __func__, parent->if_xname); /* XXX stat */ - return; + return (EINVAL); } if (vap->iv_state == IEEE80211_S_SLEEP) { /* * In power save, wakeup device for transmit. */ ieee80211_new_state(vap, IEEE80211_S_RUN, 0); - return; + return (0); } /* * No data frames go out unless we're running. @@ -435,34 +434,35 @@ ieee80211_start(struct ifnet *ifp) __func__, ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_tx_badstate++; IEEE80211_UNLOCK(ic); - IFQ_LOCK(&ifp->if_snd); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_UNLOCK(&ifp->if_snd); - return; + return (EINVAL); } IEEE80211_UNLOCK(ic); } - for (;;) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - /* - * Sanitize mbuf flags for net80211 use. We cannot - * clear M_PWR_SAV or M_MORE_DATA because these may - * be set for frames that are re-submitted from the - * power save queue. - * - * NB: This must be done before ieee80211_classify as - * it marks EAPOL in frames with M_EAPOL. - */ - m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA); - /* - * Bump to the packet transmission path. - */ - (void) ieee80211_start_pkt(vap, m); - /* mbuf is consumed here */ - } + /* + * Sanitize mbuf flags for net80211 use. We cannot + * clear M_PWR_SAV or M_MORE_DATA because these may + * be set for frames that are re-submitted from the + * power save queue. + * + * NB: This must be done before ieee80211_classify as + * it marks EAPOL in frames with M_EAPOL. + */ + m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA); + + /* + * Bump to the packet transmission path. + * The mbuf will be consumed here. + */ + return (ieee80211_start_pkt(vap, m)); +} + +void +ieee80211_vap_qflush(struct ifnet *ifp) +{ + + /* Empty for now */ } /* @@ -500,9 +500,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, int error; int ret; - IFQ_LOCK(&ifp->if_snd); if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - IFQ_UNLOCK(&ifp->if_snd); /* * Short-circuit requests if the vap is marked OACTIVE * as this can happen because a packet came down through @@ -513,7 +511,6 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, */ senderr(ENETDOWN); } - IFQ_UNLOCK(&ifp->if_snd); vap = ifp->if_softc; ic = vap->iv_ic; /* |