From owner-freebsd-mobile@FreeBSD.ORG Thu Feb 3 20:38:30 2011 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D8F61065694; Thu, 3 Feb 2011 20:38:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7B78FC0C; Thu, 3 Feb 2011 20:38:30 +0000 (UTC) Received: by vws9 with SMTP id 9so958598vws.13 for ; Thu, 03 Feb 2011 12:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LpaXWXQXK8xXNTdYqsmqpa/3WSNQuOnivW37d8W4XrY=; b=MOdmPdSK2QG1LNqUn0EOMq9GRf+aqDzx9lFAK+EyqktOXXW/qGF+eqtitcYhsv+2Sh Vpx2WDKFabzNLAkbAMz5jRk8mi0+ymhBGMNG8a0KMk3DtzBrmel/v6qedANRQrr8qQoT 7o/r8FDBzJDd8DPs+eY2epPIjwPkOVluSFArw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=kLIFr2xn2sYYkZTWeo4jTyXOH06kZW1JbmYOvPGUxFguxRxZHO1QuNP0bReCpqi7Jk /9kJE5fhdKaGsA6Ev5vaXrLw4hndeRt2cMju9FW/49gdPpipjHXBXDYVvySsQEJ2E3wq PGqV/dgwKKQwv7X/Oaj/FLGJA8WfkzoCyywS4= MIME-Version: 1.0 Received: by 10.220.96.202 with SMTP id i10mr2804966vcn.191.1296765509439; Thu, 03 Feb 2011 12:38:29 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.220.198.203 with HTTP; Thu, 3 Feb 2011 12:38:29 -0800 (PST) In-Reply-To: <201102032030.p13KUH9B057585@svn.freebsd.org> References: <201102032030.p13KUH9B057585@svn.freebsd.org> Date: Fri, 4 Feb 2011 04:38:29 +0800 X-Google-Sender-Auth: nYmd4QXZUADAyxF6GzgB3GfyXNI Message-ID: From: Adrian Chadd To: freebsd-mobile@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Net Subject: Re: svn commit: r218240 - head/sys/dev/ath X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 20:38:30 -0000 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 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 > =A0#include > +#include > > =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 */ >