diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-10-27 12:59:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-30 16:49:18 -0400 |
commit | 2da4f01a0938b688f92f9ee380013cfb8653510f (patch) | |
tree | 35f48c5f1802806e785b7e8488011a3077de1baa /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 8c8746f9db8b1f644695050703e2d38cd5964ba7 (diff) |
ath9k_hw: move mac name and rf name helpers to hw code
These are shared between ath9k and the future ath9k_htc driver.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index cab17c6c8a37..bba923135b0e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -4350,3 +4350,65 @@ void ath_gen_timer_isr(struct ath_hw *ah) | |||
4350 | } | 4350 | } |
4351 | } | 4351 | } |
4352 | EXPORT_SYMBOL(ath_gen_timer_isr); | 4352 | EXPORT_SYMBOL(ath_gen_timer_isr); |
4353 | |||
4354 | static struct { | ||
4355 | u32 version; | ||
4356 | const char * name; | ||
4357 | } ath_mac_bb_names[] = { | ||
4358 | /* Devices with external radios */ | ||
4359 | { AR_SREV_VERSION_5416_PCI, "5416" }, | ||
4360 | { AR_SREV_VERSION_5416_PCIE, "5418" }, | ||
4361 | { AR_SREV_VERSION_9100, "9100" }, | ||
4362 | { AR_SREV_VERSION_9160, "9160" }, | ||
4363 | /* Single-chip solutions */ | ||
4364 | { AR_SREV_VERSION_9280, "9280" }, | ||
4365 | { AR_SREV_VERSION_9285, "9285" }, | ||
4366 | { AR_SREV_VERSION_9287, "9287" } | ||
4367 | }; | ||
4368 | |||
4369 | /* For devices with external radios */ | ||
4370 | static struct { | ||
4371 | u16 version; | ||
4372 | const char * name; | ||
4373 | } ath_rf_names[] = { | ||
4374 | { 0, "5133" }, | ||
4375 | { AR_RAD5133_SREV_MAJOR, "5133" }, | ||
4376 | { AR_RAD5122_SREV_MAJOR, "5122" }, | ||
4377 | { AR_RAD2133_SREV_MAJOR, "2133" }, | ||
4378 | { AR_RAD2122_SREV_MAJOR, "2122" } | ||
4379 | }; | ||
4380 | |||
4381 | /* | ||
4382 | * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. | ||
4383 | */ | ||
4384 | const char *ath9k_hw_mac_bb_name(u32 mac_bb_version) | ||
4385 | { | ||
4386 | int i; | ||
4387 | |||
4388 | for (i=0; i<ARRAY_SIZE(ath_mac_bb_names); i++) { | ||
4389 | if (ath_mac_bb_names[i].version == mac_bb_version) { | ||
4390 | return ath_mac_bb_names[i].name; | ||
4391 | } | ||
4392 | } | ||
4393 | |||
4394 | return "????"; | ||
4395 | } | ||
4396 | EXPORT_SYMBOL(ath9k_hw_mac_bb_name); | ||
4397 | |||
4398 | /* | ||
4399 | * Return the RF name. "????" is returned if the RF is unknown. | ||
4400 | * Used for devices with external radios. | ||
4401 | */ | ||
4402 | const char *ath9k_hw_rf_name(u16 rf_version) | ||
4403 | { | ||
4404 | int i; | ||
4405 | |||
4406 | for (i=0; i<ARRAY_SIZE(ath_rf_names); i++) { | ||
4407 | if (ath_rf_names[i].version == rf_version) { | ||
4408 | return ath_rf_names[i].name; | ||
4409 | } | ||
4410 | } | ||
4411 | |||
4412 | return "????"; | ||
4413 | } | ||
4414 | EXPORT_SYMBOL(ath9k_hw_rf_name); | ||