From owner-svn-src-head@FreeBSD.ORG Thu Aug 29 13:56:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C8911794; Thu, 29 Aug 2013 13:56:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B42FF292A; Thu, 29 Aug 2013 13:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7TDuifD052217; Thu, 29 Aug 2013 13:56:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7TDuiDP052216; Thu, 29 Aug 2013 13:56:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308291356.r7TDuiDP052216@svn.freebsd.org> From: Adrian Chadd Date: Thu, 29 Aug 2013 13:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255023 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 13:56:45 -0000 Author: adrian Date: Thu Aug 29 13:56:44 2013 New Revision: 255023 URL: http://svnweb.freebsd.org/changeset/base/255023 Log: Migrate iwn(4) to use the new ieee80211_tx_complete() API. Tested: * Intel 5100, STA mode Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Aug 29 13:52:51 2013 (r255022) +++ head/sys/dev/iwn/if_iwn.c Thu Aug 29 13:56:44 2013 (r255023) @@ -2668,11 +2668,7 @@ iwn_rx_compressed_ba(struct iwn_softc *s 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 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 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, 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;