From owner-svn-src-all@FreeBSD.ORG Fri Oct 18 07:48:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 758E11C2; Fri, 18 Oct 2013 07:48:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6383C2788; Fri, 18 Oct 2013 07:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9I7mLac085892; Fri, 18 Oct 2013 07:48:21 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9I7mLII085891; Fri, 18 Oct 2013 07:48:21 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310180748.r9I7mLII085891@svn.freebsd.org> From: Kevin Lo Date: Fri, 18 Oct 2013 07:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256722 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 07:48:21 -0000 Author: kevlo Date: Fri Oct 18 07:48:20 2013 New Revision: 256722 URL: http://svnweb.freebsd.org/changeset/base/256722 Log: Correct tx mixer gain value for RT3070 and RT3071. Correctly value in EEPROM/EFUSE is one or more for RT3070 and two or more for other RT3071 chips. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Oct 18 07:46:28 2013 (r256721) +++ head/sys/dev/usb/wlan/if_run.c Fri Oct 18 07:48:20 2013 (r256722) @@ -4366,7 +4366,7 @@ static int run_rt3070_rf_init(struct run_softc *sc) { uint32_t tmp; - uint8_t rf, target, bbp4; + uint8_t bbp4, mingain, rf, target; int i; run_rt3070_rf_read(sc, 30, &rf); @@ -4473,7 +4473,8 @@ run_rt3070_rf_init(struct run_softc *sc) (sc->mac_ver == 0x3071 && sc->mac_rev >= 0x0211)) && !sc->ext_2ghz_lna) rf |= 0x20; /* fix for long range Rx issue */ - if (sc->txmixgain_2ghz >= 1) + mingain = (sc->mac_ver == 0x3070) ? 1 : 2; + if (sc->txmixgain_2ghz >= mingain) rf = (rf & ~0x7) | sc->txmixgain_2ghz; run_rt3070_rf_write(sc, 17, rf); }