diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-12-06 07:27:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-07 16:34:54 -0500 |
commit | 47c80de62e9d6d262a829502d689a8b56add8d3d (patch) | |
tree | c30b7df85d2e36fb54ee6a98a12d144cfea8dc6f /drivers/net/wireless/ath | |
parent | 8060e169e02fe855f5533b5ef6af1f23ae2db0c4 (diff) |
ath9k_hw: Find the maximum number of chains that hw supports
Have it in ah->caps. This will be used during various
calibrations.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 49da1849c7fe..a2f85b75b7f8 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1764,7 +1764,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
1764 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; | 1764 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; |
1765 | 1765 | ||
1766 | u16 capField = 0, eeval; | 1766 | u16 capField = 0, eeval; |
1767 | u8 ant_div_ctl1; | 1767 | u8 ant_div_ctl1, tx_chainmask, rx_chainmask; |
1768 | 1768 | ||
1769 | eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0); | 1769 | eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0); |
1770 | regulatory->current_rd = eeval; | 1770 | regulatory->current_rd = eeval; |
@@ -1976,6 +1976,18 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
1976 | pCap->pcie_lcr_offset = 0x80; | 1976 | pCap->pcie_lcr_offset = 0x80; |
1977 | } | 1977 | } |
1978 | 1978 | ||
1979 | tx_chainmask = pCap->tx_chainmask; | ||
1980 | rx_chainmask = pCap->rx_chainmask; | ||
1981 | while (tx_chainmask || rx_chainmask) { | ||
1982 | if (tx_chainmask & BIT(0)) | ||
1983 | pCap->max_txchains++; | ||
1984 | if (rx_chainmask & BIT(0)) | ||
1985 | pCap->max_rxchains++; | ||
1986 | |||
1987 | tx_chainmask >>= 1; | ||
1988 | rx_chainmask >>= 1; | ||
1989 | } | ||
1990 | |||
1979 | return 0; | 1991 | return 0; |
1980 | } | 1992 | } |
1981 | 1993 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 76ae3296e3fc..fcfd63efe55a 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -199,6 +199,8 @@ struct ath9k_hw_capabilities { | |||
199 | u16 rts_aggr_limit; | 199 | u16 rts_aggr_limit; |
200 | u8 tx_chainmask; | 200 | u8 tx_chainmask; |
201 | u8 rx_chainmask; | 201 | u8 rx_chainmask; |
202 | u8 max_txchains; | ||
203 | u8 max_rxchains; | ||
202 | u16 tx_triglevel_max; | 204 | u16 tx_triglevel_max; |
203 | u16 reg_cap; | 205 | u16 reg_cap; |
204 | u8 num_gpio_pins; | 206 | u8 num_gpio_pins; |