diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-10-27 12:59:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-30 16:49:18 -0400 |
commit | f934c4d9de85571ff792360aa72dd26e00e1afc7 (patch) | |
tree | 38b212bcd0ca4f2511cc7c9513df3096049185c7 | |
parent | 2da4f01a0938b688f92f9ee380013cfb8653510f (diff) |
ath9k_hw: distinguish single-chip solutions on initial probe print
Devices with external radios have revisions which we can count on.
On single chip solutions these EEPROM values for these radio revision
also exist but are not meaningful as the radios are embedded onto the
same chip. Each single-chip device evolves together as one device.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ahb.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 11 |
4 files changed, 36 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c index 41422c449696..329e6bc137ab 100644 --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c | |||
@@ -69,6 +69,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
69 | int irq; | 69 | int irq; |
70 | int ret = 0; | 70 | int ret = 0; |
71 | struct ath_hw *ah; | 71 | struct ath_hw *ah; |
72 | char hw_name[64]; | ||
72 | 73 | ||
73 | if (!pdev->dev.platform_data) { | 74 | if (!pdev->dev.platform_data) { |
74 | dev_err(&pdev->dev, "no platform data specified\n"); | 75 | dev_err(&pdev->dev, "no platform data specified\n"); |
@@ -133,15 +134,11 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
133 | } | 134 | } |
134 | 135 | ||
135 | ah = sc->sc_ah; | 136 | ah = sc->sc_ah; |
137 | ath9k_hw_name(ah, hw_name, sizeof(hw_name)); | ||
136 | printk(KERN_INFO | 138 | printk(KERN_INFO |
137 | "%s: Atheros AR%s MAC/BB Rev:%x, " | 139 | "%s: %s mem=0x%lx, irq=%d\n", |
138 | "AR%s RF Rev:%x, mem=0x%lx, irq=%d\n", | ||
139 | wiphy_name(hw->wiphy), | 140 | wiphy_name(hw->wiphy), |
140 | ath9k_hw_mac_bb_name(ah->hw_version.macVersion), | 141 | hw_name, |
141 | ah->hw_version.macRev, | ||
142 | ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & | ||
143 | AR_RADIO_SREV_MAJOR)), | ||
144 | ah->hw_version.phyRev, | ||
145 | (unsigned long)mem, irq); | 142 | (unsigned long)mem, irq); |
146 | 143 | ||
147 | return 0; | 144 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index bba923135b0e..5d7a5b177a39 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -4381,7 +4381,7 @@ static struct { | |||
4381 | /* | 4381 | /* |
4382 | * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. | 4382 | * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. |
4383 | */ | 4383 | */ |
4384 | const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) | 4384 | static const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) |
4385 | { | 4385 | { |
4386 | int i; | 4386 | int i; |
4387 | 4387 | ||
@@ -4393,13 +4393,12 @@ const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) | |||
4393 | 4393 | ||
4394 | return "????"; | 4394 | return "????"; |
4395 | } | 4395 | } |
4396 | EXPORT_SYMBOL(ath9k_hw_mac_bb_name); | ||
4397 | 4396 | ||
4398 | /* | 4397 | /* |
4399 | * Return the RF name. "????" is returned if the RF is unknown. | 4398 | * Return the RF name. "????" is returned if the RF is unknown. |
4400 | * Used for devices with external radios. | 4399 | * Used for devices with external radios. |
4401 | */ | 4400 | */ |
4402 | const char *ath9k_hw_rf_name(u16 rf_version) | 4401 | static const char *ath9k_hw_rf_name(u16 rf_version) |
4403 | { | 4402 | { |
4404 | int i; | 4403 | int i; |
4405 | 4404 | ||
@@ -4411,4 +4410,28 @@ const char *ath9k_hw_rf_name(u16 rf_version) | |||
4411 | 4410 | ||
4412 | return "????"; | 4411 | return "????"; |
4413 | } | 4412 | } |
4414 | EXPORT_SYMBOL(ath9k_hw_rf_name); | 4413 | |
4414 | void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len) | ||
4415 | { | ||
4416 | int used; | ||
4417 | |||
4418 | /* chipsets >= AR9280 are single-chip */ | ||
4419 | if (AR_SREV_9280_10_OR_LATER(ah)) { | ||
4420 | used = snprintf(hw_name, len, | ||
4421 | "Atheros AR%s Rev:%x", | ||
4422 | ath9k_hw_mac_bb_name(ah->hw_version.macVersion), | ||
4423 | ah->hw_version.macRev); | ||
4424 | } | ||
4425 | else { | ||
4426 | used = snprintf(hw_name, len, | ||
4427 | "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x", | ||
4428 | ath9k_hw_mac_bb_name(ah->hw_version.macVersion), | ||
4429 | ah->hw_version.macRev, | ||
4430 | ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & | ||
4431 | AR_RADIO_SREV_MAJOR)), | ||
4432 | ah->hw_version.phyRev); | ||
4433 | } | ||
4434 | |||
4435 | hw_name[used] = '\0'; | ||
4436 | } | ||
4437 | EXPORT_SYMBOL(ath9k_hw_name); | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 979a594f93d1..33a5aec1856d 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -704,8 +704,7 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer); | |||
704 | void ath_gen_timer_isr(struct ath_hw *hw); | 704 | void ath_gen_timer_isr(struct ath_hw *hw); |
705 | u32 ath9k_hw_gettsf32(struct ath_hw *ah); | 705 | u32 ath9k_hw_gettsf32(struct ath_hw *ah); |
706 | 706 | ||
707 | const char *ath9k_hw_mac_bb_name(u32 mac_bb_version); | 707 | void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len); |
708 | const char *ath9k_hw_rf_name(u16 rf_version); | ||
709 | 708 | ||
710 | #define ATH_PCIE_CAP_LINK_CTRL 0x70 | 709 | #define ATH_PCIE_CAP_LINK_CTRL 0x70 |
711 | #define ATH_PCIE_CAP_LINK_L0S 1 | 710 | #define ATH_PCIE_CAP_LINK_L0S 1 |
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 76f3890d0a9c..5321f735e5a0 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -114,6 +114,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
114 | u32 val; | 114 | u32 val; |
115 | int ret = 0; | 115 | int ret = 0; |
116 | struct ath_hw *ah; | 116 | struct ath_hw *ah; |
117 | char hw_name[64]; | ||
117 | 118 | ||
118 | if (pci_enable_device(pdev)) | 119 | if (pci_enable_device(pdev)) |
119 | return -EIO; | 120 | return -EIO; |
@@ -218,15 +219,11 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
218 | sc->irq = pdev->irq; | 219 | sc->irq = pdev->irq; |
219 | 220 | ||
220 | ah = sc->sc_ah; | 221 | ah = sc->sc_ah; |
222 | ath9k_hw_name(ah, hw_name, sizeof(hw_name)); | ||
221 | printk(KERN_INFO | 223 | printk(KERN_INFO |
222 | "%s: Atheros AR%s MAC/BB Rev:%x " | 224 | "%s: %s mem=0x%lx, irq=%d\n", |
223 | "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n", | ||
224 | wiphy_name(hw->wiphy), | 225 | wiphy_name(hw->wiphy), |
225 | ath9k_hw_mac_bb_name(ah->hw_version.macVersion), | 226 | hw_name, |
226 | ah->hw_version.macRev, | ||
227 | ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & | ||
228 | AR_RADIO_SREV_MAJOR)), | ||
229 | ah->hw_version.phyRev, | ||
230 | (unsigned long)mem, pdev->irq); | 227 | (unsigned long)mem, pdev->irq); |
231 | 228 | ||
232 | return 0; | 229 | return 0; |