From owner-svn-src-user@FreeBSD.ORG Wed Jun 15 15:07:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D41106564A; Wed, 15 Jun 2011 15:07:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6F08FC12; Wed, 15 Jun 2011 15:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FF714U086938; Wed, 15 Jun 2011 15:07:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FF71if086936; Wed, 15 Jun 2011 15:07:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106151507.p5FF71if086936@svn.freebsd.org> From: Adrian Chadd Date: Wed, 15 Jun 2011 15:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223112 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 15:07:01 -0000 Author: adrian Date: Wed Jun 15 15:07:01 2011 New Revision: 223112 URL: http://svn.freebsd.org/changeset/base/223112 Log: Don't assign sequence numbers if AMPDU-TX is in negotiation phase. net80211 only stops assigning its own sequence numbers once AMPDU-TX has finished being negotiated. It otherwise tags packets with sequence numbers. My previous patch was skipping every other sequence number during the ADDBA exchange and causing the receiver to get throughly confused for a bit. With this patch the receiver now doesn't receive such badly sequenced packets. There are still issues though with the addba BA win start versus what's already been software queued. Packets in the software queue have sequence numbers from -before- the BA window advertised in the ADDBA but are being held and arrive after the ADDBA exchange has occured. Crazy, but true. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 15 14:48:42 2011 (r223111) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 15 15:07:01 2011 (r223112) @@ -926,7 +926,8 @@ ath_tx_start(struct ath_softc *sc, struc struct ath_txq *txq; int ismcast; const struct ieee80211_frame *wh; - int is_ampdu = 0; + int is_ampdu, is_ampdu_tx, is_ampdu_pending; + ieee80211_seq seqno; /* Determine the target hardware queue! */ pri = M_WME_GETAC(m0); /* honor classification */ @@ -936,9 +937,9 @@ ath_tx_start(struct ath_softc *sc, struc ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); /* A-MPDU TX */ - if ((ath_tx_ampdu_running(sc, ATH_NODE(ni), tid)) || - (ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid))) - is_ampdu = 1; + is_ampdu_tx = ath_tx_ampdu_running(sc, ATH_NODE(ni), tid); + is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); + is_ampdu = is_ampdu_tx | is_ampdu_pending; DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ac=%d, is_ampdu=%d\n", __func__, tid, pri, is_ampdu); @@ -952,8 +953,9 @@ ath_tx_start(struct ath_softc *sc, struc /* Do the generic frame setup */ /* A-MPDU TX? Manually set sequence number */ - if (is_ampdu) - (void) ath_tx_tid_seqno_assign(sc, ni, bf, m0); + /* Don't do it whilst pending; the net80211 layer still assigns them */ + if (is_ampdu_tx) + seqno = ath_tx_tid_seqno_assign(sc, ni, bf, m0); /* This also sets up the DMA map */ r = ath_tx_normal_setup(sc, ni, bf, m0);