Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Mar 2018 23:47:04 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330750 - in head/sys/dev/rtwn: rtl8188e rtl8192c
Message-ID:  <201803102347.w2ANl45n048290@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Sat Mar 10 23:47:03 2018
New Revision: 330750
URL: https://svnweb.freebsd.org/changeset/base/330750

Log:
  rtwn(4): reset Tx power values before calling get_txpower()
  for RTL8192C / RTL8188E (like it is done for other chipsets).

Modified:
  head/sys/dev/rtwn/rtl8188e/r88e_chan.c
  head/sys/dev/rtwn/rtl8192c/r92c_chan.c

Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c
==============================================================================
--- head/sys/dev/rtwn/rtl8188e/r88e_chan.c	Sat Mar 10 23:16:24 2018	(r330749)
+++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c	Sat Mar 10 23:47:03 2018	(r330750)
@@ -104,8 +104,6 @@ r88e_get_txpower(struct rtwn_softc *sc, int chain,
 	max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1);
 	KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n"));
 
-	memset(power, 0, max_mcs * sizeof(power[0]));
-
 	/* Compute per-CCK rate Tx power. */
 	cckpow = rt->cck_tx_pwr[group];
 	for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) {

Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c
==============================================================================
--- head/sys/dev/rtwn/rtl8192c/r92c_chan.c	Sat Mar 10 23:16:24 2018	(r330749)
+++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c	Sat Mar 10 23:47:03 2018	(r330750)
@@ -102,7 +102,6 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain,
 	max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1);
 	KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n"));
 
-	memset(power, 0, max_mcs * sizeof(power[0]));
 	if (rs->regulatory == 0) {
 		for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++)
 			power[ridx] = base[chain].pwr[0][ridx];
@@ -225,6 +224,7 @@ r92c_set_txpower(struct rtwn_softc *sc, struct ieee802
 	int i;
 
 	for (i = 0; i < sc->ntxchains; i++) {
+		memset(power, 0, sizeof(power));
 		/* Compute per-rate Tx power values. */
 		rtwn_r92c_get_txpower(sc, i, c, power);
 #ifdef RTWN_DEBUG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803102347.w2ANl45n048290>