diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2011-08-15 12:45:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 14:41:42 -0400 |
commit | 7ccc83b0fc69d5b18602aa250c10be0d3ae920c6 (patch) | |
tree | 3c6a3875b294d62df281f77edc0d392cee00a227 /drivers/net/wireless/ath/carl9170 | |
parent | bfe2ed8f4df2e7b6991c4039bb624dee5f8b6583 (diff) |
carl9170: fix timekeeping for HW_COUNTER firmwares
AR9170_PWR_REG_PLL_ADDAC is used to set the main clock
divisor which affects the AHB/CPU speed. Because this
would interfere with the firmware internal timekeeping,
the function has to be moved into the firmware.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/carl9170')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/carl9170.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/fw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/phy.c | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index c5427a72a1e2..f7dbdaa74c63 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h | |||
@@ -282,6 +282,7 @@ struct ar9170 { | |||
282 | bool rx_stream; | 282 | bool rx_stream; |
283 | bool tx_stream; | 283 | bool tx_stream; |
284 | bool rx_filter; | 284 | bool rx_filter; |
285 | bool hw_counters; | ||
285 | unsigned int mem_blocks; | 286 | unsigned int mem_blocks; |
286 | unsigned int mem_block_size; | 287 | unsigned int mem_block_size; |
287 | unsigned int rx_size; | 288 | unsigned int rx_size; |
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index 39ddea5794f7..f4cae1cccbff 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c | |||
@@ -266,6 +266,9 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
266 | FIF_PROMISC_IN_BSS; | 266 | FIF_PROMISC_IN_BSS; |
267 | } | 267 | } |
268 | 268 | ||
269 | if (SUPP(CARL9170FW_HW_COUNTERS)) | ||
270 | ar->fw.hw_counters = true; | ||
271 | |||
269 | if (SUPP(CARL9170FW_WOL)) | 272 | if (SUPP(CARL9170FW_WOL)) |
270 | device_set_wakeup_enable(&ar->udev->dev, true); | 273 | device_set_wakeup_enable(&ar->udev->dev, true); |
271 | 274 | ||
diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c index aa147a9120b6..8635c5c8463c 100644 --- a/drivers/net/wireless/ath/carl9170/phy.c +++ b/drivers/net/wireless/ath/carl9170/phy.c | |||
@@ -578,11 +578,10 @@ static int carl9170_init_phy(struct ar9170 *ar, enum ieee80211_band band) | |||
578 | if (err) | 578 | if (err) |
579 | return err; | 579 | return err; |
580 | 580 | ||
581 | /* XXX: remove magic! */ | 581 | if (!ar->fw.hw_counters) { |
582 | if (is_2ghz) | 582 | err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, |
583 | err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, 0x5163); | 583 | is_2ghz ? 0x5163 : 0x5143); |
584 | else | 584 | } |
585 | err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, 0x5143); | ||
586 | 585 | ||
587 | return err; | 586 | return err; |
588 | } | 587 | } |