Skip to content

Commit

Permalink
b43: don't unconditionally fall back to CCK if the rate is 6MB OFDM.
Browse files Browse the repository at this point in the history
Check the current PHY operating mode (gmode) to see if we should
fall back from 6MB OFDM to 11MB CCK.  For 5GHz operation this isn't
allowed.

Note, the fallback lookup is only done for RTS rates; normal fallback
rates are done via mac80211 and aren't affected by this change.

Signed-off-by: Adrian Chadd <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Adrian Chadd authored and Kalle Valo committed Jun 4, 2016
1 parent b746740 commit d0b0343
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/net/wireless/broadcom/b43/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate)
return control;
}

static u8 b43_calc_fallback_rate(u8 bitrate)
static u8 b43_calc_fallback_rate(u8 bitrate, int gmode)
{
switch (bitrate) {
case B43_CCK_RATE_1MB:
Expand All @@ -216,8 +216,15 @@ static u8 b43_calc_fallback_rate(u8 bitrate)
return B43_CCK_RATE_2MB;
case B43_CCK_RATE_11MB:
return B43_CCK_RATE_5MB;
/*
* Don't just fallback to CCK; it may be in 5GHz operation
* and falling back to CCK won't work out very well.
*/
case B43_OFDM_RATE_6MB:
return B43_CCK_RATE_5MB;
if (gmode)
return B43_CCK_RATE_5MB;
else
return B43_OFDM_RATE_6MB;
case B43_OFDM_RATE_9MB:
return B43_OFDM_RATE_6MB;
case B43_OFDM_RATE_12MB:
Expand Down Expand Up @@ -438,7 +445,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,

rts_rate = rts_cts_rate ? rts_cts_rate->hw_value : B43_CCK_RATE_1MB;
rts_rate_ofdm = b43_is_ofdm_rate(rts_rate);
rts_rate_fb = b43_calc_fallback_rate(rts_rate);
rts_rate_fb = b43_calc_fallback_rate(rts_rate, phy->gmode);
rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb);

if (rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
Expand Down

0 comments on commit d0b0343

Please sign in to comment.