From owner-svn-src-user@FreeBSD.ORG Sun Aug 14 12:21:08 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 B083F106566B; Sun, 14 Aug 2011 12:21:08 +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 9FFD58FC19; Sun, 14 Aug 2011 12:21:08 +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 p7ECL8aq063887; Sun, 14 Aug 2011 12:21:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7ECL85S063882; Sun, 14 Aug 2011 12:21:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108141221.p7ECL85S063882@svn.freebsd.org> From: Adrian Chadd Date: Sun, 14 Aug 2011 12:21:08 +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: r224862 - 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: Sun, 14 Aug 2011 12:21:08 -0000 Author: adrian Date: Sun Aug 14 12:21:08 2011 New Revision: 224862 URL: http://svn.freebsd.org/changeset/base/224862 Log: Begin fleshing out the BAR handling. net80211 implements BAR frame queuing and completion handofing. The first place a BAR should be TXed is when the software retry limit has been exceeded for a TID currently doing aggregation. The process should be (just so I don't forget): * pause the TID; * send the BAR; * unpause the TID in ath_bar_response() If multiple BAR's are sent, paused will be incremented and decremented appropriately until all BAR frames have been transmitted (succesfully or otherwise.) However, using it with the current code is likely not going to work because the ath TX code isn't re-entrant w/ the way locking currently is implement. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sun Aug 14 11:47:42 2011 (r224861) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sun Aug 14 12:21:08 2011 (r224862) @@ -733,10 +733,12 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_addba_request = ic->ic_addba_request; sc->sc_addba_response = ic->ic_addba_response; sc->sc_addba_stop = ic->ic_addba_stop; + sc->sc_bar_response = ic->ic_bar_response; ic->ic_addba_request = ath_addba_request; ic->ic_addba_response = ath_addba_response; ic->ic_addba_stop = ath_addba_stop; + ic->ic_bar_response = ath_bar_response; ieee80211_radiotap_attach(ic, &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), 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 Sun Aug 14 11:47:42 2011 (r224861) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sun Aug 14 12:21:08 2011 (r224862) @@ -2104,6 +2104,12 @@ ath_tx_aggr_retry_unaggr(struct ath_soft ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + /* Pause the TID */ + + /* Send BAR frame */ + device_printf(sc->sc_dev, "%s: TID %d: send BAR\n", + __func__, tid); + /* Free buffer, bf is free after this call */ ath_tx_default_comp(sc, bf, 0); return; @@ -2487,3 +2493,14 @@ ath_addba_stop(struct ieee80211_node *ni ath_tx_cleanup(sc, an, tid); ATH_TXQ_UNLOCK(txq); } + +void +ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int status) +{ + struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + + device_printf(sc->sc_dev, "%s: called\n", __func__); + + sc->sc_bar_response(ni, tap, status); +} Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Sun Aug 14 11:47:42 2011 (r224861) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Sun Aug 14 12:21:08 2011 (r224862) @@ -62,5 +62,7 @@ extern int ath_addba_response(struct iee int code, int batimeout); extern void ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap); +extern void ath_bar_response(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap, int status); #endif Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sun Aug 14 11:47:42 2011 (r224861) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sun Aug 14 12:21:08 2011 (r224862) @@ -470,6 +470,9 @@ struct ath_softc { struct ieee80211_tx_ampdu *, int, int, int); void (*sc_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *); + void (*sc_bar_response)(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap, + int status); }; #define ATH_LOCK_INIT(_sc) \