summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-08-27 14:37:13 +0000
committeradrian <adrian@FreeBSD.org>2013-08-27 14:37:13 +0000
commitd3ddbbbab853cf18073803b2efc196bec0016cf8 (patch)
treeddc02b53046e4599bb45d0d969f5b59d6287135b /sys/net80211
parent9a7e8d3357b941e823ab05a1bf8cfc06c76faa7a (diff)
downloadFreeBSD-src-d3ddbbbab853cf18073803b2efc196bec0016cf8.zip
FreeBSD-src-d3ddbbbab853cf18073803b2efc196bec0016cf8.tar.gz
Create a new function to complete 802.11 mbuf transmission.
The aim of this function is to eventually be the completion entry point for all 802.11 encapsulated mbufs. All the wifi drivers end up doing what is in this function so it's an easy win to turn it into a net80211 method and abstract out this code. Ideally the drivers will all eventually be modified to queue up completed mbufs and call this function with all the driver locks not held. This will allow for some much more interesting software queue handling in the future (like net80211 based A-MSDU, fast-frames, A-MPDU aggregation and retransmission.) Tested: * ath(4), iwn(4)
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_output.c31
-rw-r--r--sys/net80211/ieee80211_proto.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 96bf0ec..a7aa7d9 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -3353,3 +3353,34 @@ ieee80211_ff_encap1(struct ieee80211vap *vap, struct mbuf *m,
mtod(m, struct ether_header *)->ether_type = htons(payload);
return m;
}
+
+/*
+ * Complete an mbuf transmission.
+ *
+ * For now, this simply processes a completed frame after the
+ * driver has completed it's transmission and/or retransmission.
+ * It assumes the frame is an 802.11 encapsulated frame.
+ *
+ * Later on it will grow to become the exit path for a given frame
+ * from the driver and, depending upon how it's been encapsulated
+ * and already transmitted, it may end up doing A-MPDU retransmission,
+ * power save requeuing, etc.
+ *
+ * In order for the above to work, the driver entry point to this
+ * must not hold any driver locks. Thus, the driver needs to delay
+ * any actual mbuf completion until it can release said locks.
+ *
+ * This frees the mbuf and if the mbuf has a node reference,
+ * the node reference will be freed.
+ */
+void
+ieee80211_tx_complete(struct ieee80211_node *ni, struct mbuf *m, int status)
+{
+
+ if (ni != NULL) {
+ if (m->m_flags & M_TXCB)
+ ieee80211_process_callback(ni, m, status);
+ ieee80211_free_node(ni);
+ }
+ m_freem(m);
+}
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index b8f25da..5ec8459 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -127,6 +127,8 @@ int ieee80211_send_probereq(struct ieee80211_node *ni,
const uint8_t *ssid, size_t ssidlen);
struct mbuf * ieee80211_ff_encap1(struct ieee80211vap *, struct mbuf *,
const struct ether_header *);
+void ieee80211_tx_complete(struct ieee80211_node *,
+ struct mbuf *, int);
/*
* The formation of ProbeResponse frames requires guidance to
OpenPOWER on IntegriCloud