aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_output.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2013-08-27 14:37:13 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2013-08-27 14:37:13 +0000
commit36ee7775f49fd0be16ffa563e40c6cd5d19e03f6 (patch)
treeddc02b53046e4599bb45d0d969f5b59d6287135b /sys/net80211/ieee80211_output.c
parent6ce540f397ff68fbbf02438dbb4fc22b1f5f41d0 (diff)
downloadsrc-36ee7775f49fd0be16ffa563e40c6cd5d19e03f6.tar.gz
src-36ee7775f49fd0be16ffa563e40c6cd5d19e03f6.zip
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)
Notes
Notes: svn path=/head/; revision=254956
Diffstat (limited to 'sys/net80211/ieee80211_output.c')
-rw-r--r--sys/net80211/ieee80211_output.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 96bf0ec18270..a7aa7d9e902b 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);
+}