From owner-svn-src-head@freebsd.org Wed May 4 01:29:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418C0B2ABCC; Wed, 4 May 2016 01:29:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107371036; Wed, 4 May 2016 01:29:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u441T0Q8065920; Wed, 4 May 2016 01:29:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u441T0vn065919; Wed, 4 May 2016 01:29:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040129.u441T0vn065919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 01:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299028 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 01:29:01 -0000 Author: adrian Date: Wed May 4 01:29:00 2016 New Revision: 299028 URL: https://svnweb.freebsd.org/changeset/base/299028 Log: [bwn] ensure the fallback rate stays in the same PHY mode. Falling back from 6MB OFDM to 5MB CCK (a) may not work well in the 11bg PHYs, (b) won't work at all if you're 11g only, and (c) plainly won't work for the 11a PHY. So, don't do that! Tested: * BCM4312 802.11b/g Wireless, STA mode WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed May 4 01:28:10 2016 (r299027) +++ head/sys/dev/bwn/if_bwn.c Wed May 4 01:29:00 2016 (r299028) @@ -5958,10 +5958,16 @@ bwn_antenna_sanitize(struct bwn_mac *mac return (n); } +/* + * Return a fallback rate for the given rate. + * + * Note: Don't fall back from OFDM to CCK. + */ static uint8_t bwn_get_fbrate(uint8_t bitrate) { switch (bitrate) { + /* CCK */ case BWN_CCK_RATE_1MB: return (BWN_CCK_RATE_1MB); case BWN_CCK_RATE_2MB: @@ -5970,8 +5976,10 @@ bwn_get_fbrate(uint8_t bitrate) return (BWN_CCK_RATE_2MB); case BWN_CCK_RATE_11MB: return (BWN_CCK_RATE_5MB); + + /* OFDM */ case BWN_OFDM_RATE_6MB: - return (BWN_CCK_RATE_5MB); + return (BWN_OFDM_RATE_6MB); case BWN_OFDM_RATE_9MB: return (BWN_OFDM_RATE_6MB); case BWN_OFDM_RATE_12MB: