[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)
This commit is contained in:
Adrian Chadd 2016-05-04 01:29:00 +00:00
parent aa853cb461
commit b0436c3acf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299028

View File

@ -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: