From b0436c3acf170afbf884429a2a528ed97947e216 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Wed, 4 May 2016 01:29:00 +0000 Subject: [PATCH] [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) --- sys/dev/bwn/if_bwn.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index de1bf71f2a56..8766ffa4ac75 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -5958,10 +5958,16 @@ bwn_antenna_sanitize(struct bwn_mac *mac, uint8_t n) 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: