summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-05-08 18:13:18 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-05-08 18:13:18 +0000
commite081968f6d318012296686c5482bcd7ab46f339f (patch)
tree1cc64810343db2025cb4dd4dc0b80bdfef7a5f15 /sys
parent31015541cfa56873993d82665354acd7bc69c69e (diff)
change the dmesg output: print known chipset names, don't print the
supported 802.11a/b/g modes (this could be discovered with ifconfig -m athX). inspired by Johan M:son Lindman and others asking about the several different ARxxxx chipset combos.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ar5xxx.c24
-rw-r--r--sys/dev/ic/ar5xxx.h35
-rw-r--r--sys/dev/ic/ath.c34
3 files changed, 70 insertions, 23 deletions
diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c
index 6f4adbb28d0..495a53f9407 100644
--- a/sys/dev/ic/ar5xxx.c
+++ b/sys/dev/ic/ar5xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.c,v 1.21 2005/04/18 18:42:55 reyk Exp $ */
+/* $OpenBSD: ar5xxx.c,v 1.22 2005/05/08 18:13:17 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -530,6 +530,28 @@ ath_hal_init_channels(hal, channels, max_channels, channels_size, country, mode,
* Common internal functions
*/
+const char *
+ar5k_printver(type, val)
+ enum ar5k_srev_type type;
+ u_int32_t val;
+{
+ struct ar5k_srev_name names[] = AR5K_SREV_NAME;
+ const char *name = "xxxx";
+ int i;
+
+ for (i = 0; i < AR5K_ELEMENTS(names); i++) {
+ if (names[i].sr_type != type ||
+ names[i].sr_val == AR5K_SREV_UNKNOWN)
+ continue;
+ if (val < names[i + 1].sr_val) {
+ name = names[i].sr_name;
+ break;
+ }
+ }
+
+ return (name);
+}
+
void
ar5k_radar_alert(hal)
struct ath_hal *hal;
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index 52232c8c625..81d8cb043d6 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.19 2005/04/18 18:42:55 reyk Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.20 2005/05/08 18:13:17 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -1174,6 +1174,36 @@ struct ath_hal {
/*
* Common silicon revision/version values
*/
+enum ar5k_srev_type {
+ AR5K_VERSION_VER,
+ AR5K_VERSION_REV,
+ AR5K_VERSION_RAD
+};
+
+struct ar5k_srev_name {
+ const char *sr_name;
+ enum ar5k_srev_type sr_type;
+ u_int sr_val;
+};
+
+#define AR5K_SREV_NAME { \
+ { "5210", AR5K_VERSION_VER, AR5K_SREV_VER_AR5210 }, \
+ { "5311", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311 }, \
+ { "5311a", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311A },\
+ { "5311b", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311B },\
+ { "5211", AR5K_VERSION_VER, AR5K_SREV_VER_AR5211 }, \
+ { "5212", AR5K_VERSION_VER, AR5K_SREV_VER_AR5212 }, \
+ { "xxxx", AR5K_VERSION_VER, AR5K_SREV_UNKNOWN }, \
+ { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 }, \
+ { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 }, \
+ { "2111", AR5K_VERSION_RAD, AR5K_SREV_RAD_2111 }, \
+ { "5112", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112 }, \
+ { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, \
+ { "xxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN } \
+}
+
+#define AR5K_SREV_UNKNOWN 0xffff
+
#define AR5K_SREV_REV_FPGA 1
#define AR5K_SREV_REV_PROTO 2
#define AR5K_SREV_REV_PROTOA 3
@@ -1189,11 +1219,13 @@ struct ath_hal {
#define AR5K_SREV_VER_AR5211 4
#define AR5K_SREV_VER_AR5212 5
+#define AR5K_SREV_RAD_5110 0x00
#define AR5K_SREV_RAD_5111 0x10
#define AR5K_SREV_RAD_5111A 0x15
#define AR5K_SREV_RAD_2111 0x20
#define AR5K_SREV_RAD_5112 0x30
#define AR5K_SREV_RAD_5112A 0x35
+#define AR5K_SREV_RAD_2112 0x40
#define AR5K_SREV_RAD_2112A 0x45
/*
@@ -1783,6 +1815,7 @@ u_int ath_hal_ieee2mhz(u_int, u_int);
HAL_BOOL ath_hal_init_channels(struct ath_hal *, HAL_CHANNEL *,
u_int, u_int *, HAL_CTRY_CODE, u_int16_t, HAL_BOOL, HAL_BOOL);
+const char *ar5k_printver(enum ar5k_srev_type, u_int);
void ar5k_radar_alert(struct ath_hal *);
ieee80211_regdomain_t ar5k_regdomain_to_ieee(u_int16_t);
u_int16_t ar5k_regdomain_from_ieee(ieee80211_regdomain_t);
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 78ee86c1885..8486eb064c4 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.23 2005/04/18 18:42:55 reyk Exp $ */
+/* $OpenBSD: ath.c,v 1.24 2005/05/08 18:13:17 reyk Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -218,7 +218,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
struct ath_hal *ah;
HAL_STATUS status;
HAL_TXQ_INFO qinfo;
- int error = 0, i = 0;
+ int error = 0;
DPRINTF(ATH_DEBUG_ANY, ("%s: devid 0x%x\n", __func__, devid));
@@ -237,29 +237,21 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
error = ENXIO;
goto bad;
}
- if_printf(ifp, "mac %d.%d phy %d.%d",
- ah->ah_macVersion, ah->ah_macRev,
- ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
- printf(" radio %d.%d", ah->ah_analog5GhzRev >> 4,
+
+ if_printf(ifp, "AR%s %u.%u phy %u.%u",
+ ar5k_printver(AR5K_VERSION_VER, ah->ah_macVersion),
+ ah->ah_macVersion, ah->ah_macRev,
+ ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
+ printf(" rf%s %u.%u",
+ ar5k_printver(AR5K_VERSION_RAD, ah->ah_analog5GhzRev),
+ ah->ah_analog5GhzRev >> 4,
ah->ah_analog5GhzRev & 0xf);
if (ah->ah_analog2GhzRev != 0) {
- printf(" %d.%d", ah->ah_analog2GhzRev >> 4,
+ printf(" rf%s %u.%u",
+ ar5k_printver(AR5K_VERSION_RAD, ah->ah_analog2GhzRev),
+ ah->ah_analog2GhzRev >> 4,
ah->ah_analog2GhzRev & 0xf);
}
-#define ah_mode(_m) { \
- if (i++) { \
- printf("/%s", #_m); \
- } else { \
- printf(", 802.11%s", #_m); \
- } \
-} \
- if (ah->ah_modes & HAL_MODE_11A)
- ah_mode(a);
- if (ah->ah_modes & HAL_MODE_11B)
- ah_mode(b);
- if (ah->ah_modes & HAL_MODE_11G)
- ah_mode(g);
-#undef ah_mode
sc->sc_ah = ah;
sc->sc_invalid = 0; /* ready to go, enable interrupt handling */