Commit f934c4d9 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

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: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2da4f01a
...@@ -69,6 +69,7 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -69,6 +69,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
int irq; int irq;
int ret = 0; int ret = 0;
struct ath_hw *ah; struct ath_hw *ah;
char hw_name[64];
if (!pdev->dev.platform_data) { if (!pdev->dev.platform_data) {
dev_err(&pdev->dev, "no platform data specified\n"); dev_err(&pdev->dev, "no platform data specified\n");
...@@ -133,15 +134,11 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -133,15 +134,11 @@ static int ath_ahb_probe(struct platform_device *pdev)
} }
ah = sc->sc_ah; ah = sc->sc_ah;
ath9k_hw_name(ah, hw_name, sizeof(hw_name));
printk(KERN_INFO printk(KERN_INFO
"%s: Atheros AR%s MAC/BB Rev:%x, " "%s: %s mem=0x%lx, irq=%d\n",
"AR%s RF Rev:%x, mem=0x%lx, irq=%d\n",
wiphy_name(hw->wiphy), wiphy_name(hw->wiphy),
ath9k_hw_mac_bb_name(ah->hw_version.macVersion), hw_name,
ah->hw_version.macRev,
ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
AR_RADIO_SREV_MAJOR)),
ah->hw_version.phyRev,
(unsigned long)mem, irq); (unsigned long)mem, irq);
return 0; return 0;
......
...@@ -4381,7 +4381,7 @@ static struct { ...@@ -4381,7 +4381,7 @@ static struct {
/* /*
* Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
*/ */
const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) static const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
{ {
int i; int i;
...@@ -4393,13 +4393,12 @@ const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) ...@@ -4393,13 +4393,12 @@ const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
return "????"; return "????";
} }
EXPORT_SYMBOL(ath9k_hw_mac_bb_name);
/* /*
* Return the RF name. "????" is returned if the RF is unknown. * Return the RF name. "????" is returned if the RF is unknown.
* Used for devices with external radios. * Used for devices with external radios.
*/ */
const char *ath9k_hw_rf_name(u16 rf_version) static const char *ath9k_hw_rf_name(u16 rf_version)
{ {
int i; int i;
...@@ -4411,4 +4410,28 @@ const char *ath9k_hw_rf_name(u16 rf_version) ...@@ -4411,4 +4410,28 @@ const char *ath9k_hw_rf_name(u16 rf_version)
return "????"; return "????";
} }
EXPORT_SYMBOL(ath9k_hw_rf_name);
void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
{
int used;
/* chipsets >= AR9280 are single-chip */
if (AR_SREV_9280_10_OR_LATER(ah)) {
used = snprintf(hw_name, len,
"Atheros AR%s Rev:%x",
ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
ah->hw_version.macRev);
}
else {
used = snprintf(hw_name, len,
"Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
ah->hw_version.macRev,
ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
AR_RADIO_SREV_MAJOR)),
ah->hw_version.phyRev);
}
hw_name[used] = '\0';
}
EXPORT_SYMBOL(ath9k_hw_name);
...@@ -704,8 +704,7 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer); ...@@ -704,8 +704,7 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
void ath_gen_timer_isr(struct ath_hw *hw); void ath_gen_timer_isr(struct ath_hw *hw);
u32 ath9k_hw_gettsf32(struct ath_hw *ah); u32 ath9k_hw_gettsf32(struct ath_hw *ah);
const char *ath9k_hw_mac_bb_name(u32 mac_bb_version); void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
const char *ath9k_hw_rf_name(u16 rf_version);
#define ATH_PCIE_CAP_LINK_CTRL 0x70 #define ATH_PCIE_CAP_LINK_CTRL 0x70
#define ATH_PCIE_CAP_LINK_L0S 1 #define ATH_PCIE_CAP_LINK_L0S 1
......
...@@ -114,6 +114,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -114,6 +114,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
u32 val; u32 val;
int ret = 0; int ret = 0;
struct ath_hw *ah; struct ath_hw *ah;
char hw_name[64];
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
return -EIO; return -EIO;
...@@ -218,15 +219,11 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -218,15 +219,11 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
sc->irq = pdev->irq; sc->irq = pdev->irq;
ah = sc->sc_ah; ah = sc->sc_ah;
ath9k_hw_name(ah, hw_name, sizeof(hw_name));
printk(KERN_INFO printk(KERN_INFO
"%s: Atheros AR%s MAC/BB Rev:%x " "%s: %s mem=0x%lx, irq=%d\n",
"AR%s RF Rev:%x: mem=0x%lx, irq=%d\n",
wiphy_name(hw->wiphy), wiphy_name(hw->wiphy),
ath9k_hw_mac_bb_name(ah->hw_version.macVersion), hw_name,
ah->hw_version.macRev,
ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
AR_RADIO_SREV_MAJOR)),
ah->hw_version.phyRev,
(unsigned long)mem, pdev->irq); (unsigned long)mem, pdev->irq);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment