ath9k: Advertise midband for AR5416 devices
authorSenthil Balasubramanian <senthilkumar@atheros.com>
Fri, 18 Sep 2009 09:37:33 +0000 (15:07 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:40 +0000 (16:39 -0400)
This has to be done if the EEPROM supports FCC Midband
capability.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/eeprom.h
drivers/net/wireless/ath/ath9k/hw.c

index 8463ba09c12c5225dc6cce17480913685bcbae51..33492741735d740ef7feaaa606cbb5ce93b0deb6 100644 (file)
@@ -639,6 +639,7 @@ struct ar9287_eeprom {
 } __packed;
 
 enum reg_ext_bitmap {
+       REG_EXT_FCC_MIDBAND = 0,
        REG_EXT_JAPAN_MIDBAND = 1,
        REG_EXT_FCC_DFS_HT40 = 2,
        REG_EXT_JAPAN_NONDFS_HT40 = 3,
index b53faa09bdb502765b6dcb563d4ab1b00b4ee319..7a4de3d8e6fb778a08b339680092bd8af7ee311d 100644 (file)
@@ -3660,7 +3660,10 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
                        AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN;
        }
 
-       pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND;
+       /* Advertise midband for AR5416 with FCC midband set in eeprom */
+       if (regulatory->current_rd_ext & (1 << REG_EXT_FCC_MIDBAND) &&
+           AR_SREV_5416(ah))
+               pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND;
 
        pCap->num_antcfg_5ghz =
                ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_5GHZ);