Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2011 04:38:29 +0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        freebsd-mobile@freebsd.org
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: svn commit: r218240 - head/sys/dev/ath
Message-ID:  <AANLkTinBn2R4DSh28VzDOdeSv=fsw4X5-odwB3A7D_08@mail.gmail.com>
In-Reply-To: <201102032030.p13KUH9B057585@svn.freebsd.org>
References:  <201102032030.p13KUH9B057585@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi all,

This commit may have broken TX on if_ath.

I'd appreciate it if people tested things out and got back to me.

In particular, I'd like to make sure that the legacy rates TX with the
short and long preamble correctly.

Thanks,


Adrian

On 4 February 2011 04:30, Adrian Chadd <adrian@freebsd.org> wrote:
> Author: adrian
> Date: Thu Feb =A03 20:30:17 2011
> New Revision: 218240
> URL: http://svn.freebsd.org/changeset/base/218240
>
> Log:
> =A0Modify the TX path to set and use the 11n rate scenario bits.
>
> =A0This isn't strictly required to TX (at least non-agg and non-HT40,
> =A0non-short-GI) frames; but as it needs to be done anyway, just get
> =A0it done.
>
> =A0Linux ath9k uses the rate scenario style path for -all- packets,
> =A0legacy or otherwise. This code does much the same.
>
> =A0Beacon TX still uses the legacy, non-rate-scenario TX descriptor
> =A0setup. Ath9k also does this.
>
> =A0This 11n rate scenario path is only called for chips in the AR5416
> =A0HAL; legacy chips use the previous interface for TX'ing.
>
> Modified:
> =A0head/sys/dev/ath/if_ath_tx.c
>
> Modified: head/sys/dev/ath/if_ath_tx.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/ath/if_ath_tx.c =A0 =A0 =A0 =A0Thu Feb =A03 20:27:20 201=
1 =A0 =A0 =A0 =A0(r218239)
> +++ head/sys/dev/ath/if_ath_tx.c =A0 =A0 =A0 =A0Thu Feb =A03 20:30:17 201=
1 =A0 =A0 =A0 =A0(r218240)
> @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$");
>
> =A0#include <dev/ath/if_ath_misc.h>
> =A0#include <dev/ath/if_ath_tx.h>
> +#include <dev/ath/if_ath_tx_ht.h>
>
> =A0/*
> =A0* Whether to use the 11n rate scenario functions or not
> @@ -482,6 +483,10 @@ ath_tx_start(struct ath_softc *sc, struc
> =A0 =A0 =A0 =A0HAL_BOOL shortPreamble;
> =A0 =A0 =A0 =A0struct ath_node *an;
> =A0 =A0 =A0 =A0u_int pri;
> + =A0 =A0 =A0 uint8_t try[4], rate[4];
> +
> + =A0 =A0 =A0 bzero(try, sizeof(try));
> + =A0 =A0 =A0 bzero(rate, sizeof(rate));
>
> =A0 =A0 =A0 =A0wh =3D mtod(m0, struct ieee80211_frame *);
> =A0 =A0 =A0 =A0iswep =3D wh->i_fc[1] & IEEE80211_FC1_WEP;
> @@ -768,10 +773,17 @@ ath_tx_start(struct ath_softc *sc, struc
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0txq->axq_intrcnt =3D 0;
> =A0 =A0 =A0 =A0}
>
> + =A0 =A0 =A0 if (ath_tx_is_11n(sc)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[0] =3D rix;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[0] =3D try0;
> + =A0 =A0 =A0 }
> +
> =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 * Formulate first tx descriptor with tx controls.
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0/* XXX check return value? */
> + =A0 =A0 =A0 /* XXX is this ok to call for 11n descriptors? */
> + =A0 =A0 =A0 /* XXX or should it go through the first, next, last 11n ca=
lls? */
> =A0 =A0 =A0 =A0ath_hal_setuptxdesc(ah, ds
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0, pktlen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*=
 packet length */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0, hdrlen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*=
 header length */
> @@ -792,8 +804,16 @@ ath_tx_start(struct ath_softc *sc, struc
> =A0 =A0 =A0 =A0 * when the hardware supports multi-rate retry and
> =A0 =A0 =A0 =A0 * we don't use it.
> =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 if (ismrr)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ath_rate_setupxtxdesc(sc, an, ds, shortPrea=
mble, rix);
> + =A0 =A0 =A0 =A0if (ismrr) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ath_tx_is_11n(sc))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ath_rate_getxtxrates(sc,=
 an, rix, rate, try);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ath_rate_setupxtxdesc(sc=
, an, ds, shortPreamble, rix);
> + =A0 =A0 =A0 =A0}
> +
> + =A0 =A0 =A0 =A0if (ath_tx_is_11n(sc)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ath_buf_set_rate(sc, ni, bf, pktlen, fla=
gs, ctsrate, rate, try);
> + =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0ath_tx_handoff(sc, txq, bf);
> =A0 =A0 =A0 =A0return 0;
> @@ -817,6 +837,10 @@ ath_tx_raw_start(struct ath_softc *sc, s
> =A0 =A0 =A0 =A0const HAL_RATE_TABLE *rt;
> =A0 =A0 =A0 =A0struct ath_desc *ds;
> =A0 =A0 =A0 =A0u_int pri;
> + =A0 =A0 =A0 uint8_t try[4], rate[4];
> +
> + =A0 =A0 =A0 bzero(try, sizeof(try));
> + =A0 =A0 =A0 bzero(rate, sizeof(rate));
>
> =A0 =A0 =A0 =A0wh =3D mtod(m0, struct ieee80211_frame *);
> =A0 =A0 =A0 =A0ismcast =3D IEEE80211_IS_MULTICAST(wh->i_addr1);
> @@ -925,30 +949,56 @@ ath_tx_raw_start(struct ath_softc *sc, s
> =A0 =A0 =A0 =A0);
> =A0 =A0 =A0 =A0bf->bf_txflags =3D flags;
>
> - =A0 =A0 =A0 if (ismrr) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath_tx_findrix(sc, params->ibp_rate=
1);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate1 =3D rt->info[rix].rateCode;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_flags & IEEE80211_BPF_SHORT=
PRE)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate1 |=3D rt->info[rix].sh=
ortPreamble;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_try2) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath_tx_findrix(sc, =
params->ibp_rate2);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate2 =3D rt->info[rix].rat=
eCode;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_flags & IEE=
E80211_BPF_SHORTPRE)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate2 |=3D =
rt->info[rix].shortPreamble;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate2 =3D 0;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_try3) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath_tx_findrix(sc, =
params->ibp_rate3);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate3 =3D rt->info[rix].rat=
eCode;
> + =A0 =A0 =A0 if (ath_tx_is_11n(sc)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[0] =3D ath_tx_findrix(sc, params->ibp_=
rate0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[0] =3D params->ibp_try0;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ismrr) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Remember, rate[] is actu=
ally an array of rix's -adrian */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[0] =3D ath_tx_findrix(=
sc, params->ibp_rate0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[1] =3D ath_tx_findrix(=
sc, params->ibp_rate1);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[2] =3D ath_tx_findrix(=
sc, params->ibp_rate2);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate[3] =3D ath_tx_findrix(=
sc, params->ibp_rate3);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[0] =3D params->ibp_try0=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[1] =3D params->ibp_try1=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[2] =3D params->ibp_try2=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 try[3] =3D params->ibp_try3=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 } else {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ismrr) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath_tx_findrix(sc, =
params->ibp_rate1);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate1 =3D rt->info[rix].rat=
eCode;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (params->ibp_flags & IE=
EE80211_BPF_SHORTPRE)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate3 |=3D =
rt->info[rix].shortPreamble;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate3 =3D 0;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ath_hal_setupxtxdesc(ah, ds
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate1, params->ibp_try1 =
=A0 =A0 =A0 /* series 1 */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate2, params->ibp_try2 =
=A0 =A0 =A0 /* series 2 */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate3, params->ibp_try3 =
=A0 =A0 =A0 /* series 3 */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 );
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate1 |=3D =
rt->info[rix].shortPreamble;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_try2) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath=
_tx_findrix(sc, params->ibp_rate2);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate2 =3D r=
t->info[rix].rateCode;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params-=
>ibp_flags & IEEE80211_BPF_SHORTPRE)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 rate2 |=3D rt->info[rix].shortPreamble;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate2 =3D 0=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params->ibp_try3) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rix =3D ath=
_tx_findrix(sc, params->ibp_rate3);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate3 =3D r=
t->info[rix].rateCode;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (params-=
>ibp_flags & IEEE80211_BPF_SHORTPRE)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 rate3 |=3D rt->info[rix].shortPreamble;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rate3 =3D 0=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ath_hal_setupxtxdesc(ah, ds
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate1, pa=
rams->ibp_try1 =A0 =A0 =A0 /* series 1 */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate2, pa=
rams->ibp_try2 =A0 =A0 =A0 /* series 2 */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , rate3, pa=
rams->ibp_try3 =A0 =A0 =A0 /* series 3 */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 );
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 if (ath_tx_is_11n(sc)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* notice that rix doesn't include any of=
 the "magic" flags txrate
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* does for communicating "other stuff" t=
o the HAL.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ath_buf_set_rate(sc, ni, bf, pktlen, flags,=
 ctsrate, rate, try);
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0/* NB: no buffered multicast in power save support */
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinBn2R4DSh28VzDOdeSv=fsw4X5-odwB3A7D_08>