summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-08-29 13:56:44 +0000
committeradrian <adrian@FreeBSD.org>2013-08-29 13:56:44 +0000
commit4212d5ac38bc35cd7d1671a7a93ad65425dbdded (patch)
tree3c5f4a6862fa047b87b4c35bed984c254ce6be33 /sys
parent41d7ccf6058970539d902fb65f9d959b871a3d8e (diff)
downloadFreeBSD-src-4212d5ac38bc35cd7d1671a7a93ad65425dbdded.zip
FreeBSD-src-4212d5ac38bc35cd7d1671a7a93ad65425dbdded.tar.gz
Migrate iwn(4) to use the new ieee80211_tx_complete() API.
Tested: * Intel 5100, STA mode
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/iwn/if_iwn.c58
1 files changed, 23 insertions, 35 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 90a602a..14fb002 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -2668,11 +2668,7 @@ iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc,
KASSERT(ni != NULL, ("no node"));
KASSERT(m != NULL, ("no mbuf"));
- if (m->m_flags & M_TXCB)
- ieee80211_process_callback(ni, m, 1);
-
- m_freem(m);
- ieee80211_free_node(ni);
+ ieee80211_tx_complete(ni, m, 1);
txq->queued--;
txq->read = (txq->read + 1) % IWN_TX_RING_COUNT;
@@ -2934,29 +2930,6 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
ni = data->ni, data->ni = NULL;
vap = ni->ni_vap;
- if (m->m_flags & M_TXCB) {
- /*
- * Channels marked for "radar" require traffic to be received
- * to unlock before we can transmit. Until traffic is seen
- * any attempt to transmit is returned immediately with status
- * set to IWN_TX_FAIL_TX_LOCKED. Unfortunately this can easily
- * happen on first authenticate after scanning. To workaround
- * this we ignore a failure of this sort in AUTH state so the
- * 802.11 layer will fall back to using a timeout to wait for
- * the AUTH reply. This allows the firmware time to see
- * traffic so a subsequent retry of AUTH succeeds. It's
- * unclear why the firmware does not maintain state for
- * channels recently visited as this would allow immediate
- * use of the channel after a scan (where we see traffic).
- */
- if (status == IWN_TX_FAIL_TX_LOCKED &&
- ni->ni_vap->iv_state == IEEE80211_S_AUTH)
- ieee80211_process_callback(ni, m, 0);
- else
- ieee80211_process_callback(ni, m,
- (status & IWN_TX_FAIL) != 0);
- }
-
/*
* Update rate control statistics for the node.
*/
@@ -2969,8 +2942,27 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
ieee80211_ratectl_tx_complete(vap, ni,
IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL);
}
- m_freem(m);
- ieee80211_free_node(ni);
+
+ /*
+ * Channels marked for "radar" require traffic to be received
+ * to unlock before we can transmit. Until traffic is seen
+ * any attempt to transmit is returned immediately with status
+ * set to IWN_TX_FAIL_TX_LOCKED. Unfortunately this can easily
+ * happen on first authenticate after scanning. To workaround
+ * this we ignore a failure of this sort in AUTH state so the
+ * 802.11 layer will fall back to using a timeout to wait for
+ * the AUTH reply. This allows the firmware time to see
+ * traffic so a subsequent retry of AUTH succeeds. It's
+ * unclear why the firmware does not maintain state for
+ * channels recently visited as this would allow immediate
+ * use of the channel after a scan (where we see traffic).
+ */
+ if (status == IWN_TX_FAIL_TX_LOCKED &&
+ ni->ni_vap->iv_state == IEEE80211_S_AUTH)
+ ieee80211_tx_complete(ni, m, 0);
+ else
+ ieee80211_tx_complete(ni, m,
+ (status & IWN_TX_FAIL) != 0);
sc->sc_tx_timer = 0;
if (--ring->queued < IWN_TX_RING_LOMARK) {
@@ -3091,11 +3083,7 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes,
KASSERT(ni != NULL, ("no node"));
KASSERT(m != NULL, ("no mbuf"));
- if (m->m_flags & M_TXCB)
- ieee80211_process_callback(ni, m, 1);
-
- m_freem(m);
- ieee80211_free_node(ni);
+ ieee80211_tx_complete(ni, m, 1);
ring->queued--;
ring->read = (ring->read + 1) % IWN_TX_RING_COUNT;
OpenPOWER on IntegriCloud