summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-09-19 17:08:02 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-09-19 17:08:02 +0000
commit477e41dc337759ceec5c706e833c41f346988a82 (patch)
treeb57134bd557b4cb4d4a4106c42910e188f05fa1d /sys/dev
parent6197016039dbe4827c368d9580c2ae11ef0e5007 (diff)
detect the newer single chip generations AR2413, AR5413 and AR5224 but
don't attach them, yet.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ar5xxx.c16
-rw-r--r--sys/dev/ic/ar5xxx.h17
-rw-r--r--sys/dev/ic/ath.c48
3 files changed, 62 insertions, 19 deletions
diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c
index 1c997285753..03d1e7bb237 100644
--- a/sys/dev/ic/ar5xxx.c
+++ b/sys/dev/ic/ar5xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.c,v 1.34 2006/09/19 13:14:32 reyk Exp $ */
+/* $OpenBSD: ar5xxx.c,v 1.35 2006/09/19 17:08:01 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -61,6 +61,12 @@ static const struct {
ar5k_ar5212_attach },
{ PCI_VENDOR_ATHEROS, PCI_PRODUCT_ATHEROS_AR5212_IBM,
ar5k_ar5212_attach },
+ { PCI_VENDOR_ATHEROS, PCI_PRODUCT_ATHEROS_AR2413,
+ ar5k_ar5212_attach },
+ { PCI_VENDOR_ATHEROS, PCI_PRODUCT_ATHEROS_AR5413,
+ ar5k_ar5212_attach },
+ { PCI_VENDOR_ATHEROS, PCI_PRODUCT_ATHEROS_AR5424,
+ ar5k_ar5212_attach },
{ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3CRDAG675,
ar5k_ar5212_attach },
{ PCI_VENDOR_3COM2, PCI_PRODUCT_3COM2_3CRPAG175,
@@ -503,6 +509,14 @@ ar5k_printver(enum ar5k_srev_type type, u_int32_t val)
int i;
for (i = 0; i < AR5K_ELEMENTS(names); i++) {
+ if (type == AR5K_VERSION_DEV) {
+ if (names[i].sr_type == type &&
+ names[i].sr_val == val) {
+ name = names[i].sr_name;
+ break;
+ }
+ continue;
+ }
if (names[i].sr_type != type ||
names[i].sr_val == AR5K_SREV_UNKNOWN)
continue;
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index 813c7610bcf..fb0116a2168 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.33 2006/09/19 16:42:29 reyk Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.34 2006/09/19 17:08:01 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -1181,7 +1181,8 @@ struct ath_hal {
enum ar5k_srev_type {
AR5K_VERSION_VER,
AR5K_VERSION_REV,
- AR5K_VERSION_RAD
+ AR5K_VERSION_RAD,
+ AR5K_VERSION_DEV,
};
struct ar5k_srev_name {
@@ -1206,7 +1207,11 @@ struct ar5k_srev_name {
{ "5112a", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A }, \
{ "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, \
{ "2112a", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A }, \
- { "xxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN } \
+ { "xxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, \
+ { "2413", AR5K_VERSION_DEV, AR5K_DEVID_AR2413 }, \
+ { "5413", AR5K_VERSION_DEV, AR5K_DEVID_AR5413 }, \
+ { "5424", AR5K_VERSION_DEV, AR5K_DEVID_AR5424 }, \
+ { "xxxx", AR5K_VERSION_DEV, AR5K_SREV_UNKNOWN } \
}
#define AR5K_SREV_UNKNOWN 0xffff
@@ -1230,6 +1235,10 @@ struct ar5k_srev_name {
#define AR5K_SREV_RAD_2112A 0x45
#define AR5K_SREV_RAD_UNSUPP 0x50
+#define AR5K_DEVID_AR2413 0x001a
+#define AR5K_DEVID_AR5413 0x001b
+#define AR5K_DEVID_AR5424 0x001c
+
/*
* Misc defines
*/
@@ -1928,7 +1937,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 *, u_int16_t, HAL_BOOL, HAL_BOOL);
-const char *ar5k_printver(enum ar5k_srev_type, u_int);
+const char *ar5k_printver(enum ar5k_srev_type, u_int32_t);
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 45baf74d351..0df7c5d0df3 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.54 2006/09/19 16:46:39 reyk Exp $ */
+/* $OpenBSD: ath.c,v 1.55 2006/09/19 17:08:01 reyk Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -235,20 +235,40 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
goto bad;
}
- printf("%s: AR%s %u.%u phy %u.%u", ifp->if_xname,
- ar5k_printver(AR5K_VERSION_VER, ah->ah_mac_srev),
- ah->ah_mac_version, ah->ah_mac_revision,
- ah->ah_phy_revision >> 4, ah->ah_phy_revision & 0xf);
- printf(" rf%s %u.%u",
- ar5k_printver(AR5K_VERSION_RAD, ah->ah_radio_5ghz_revision),
- ah->ah_radio_5ghz_revision >> 4,
- ah->ah_radio_5ghz_revision & 0xf);
- if (ah->ah_radio_2ghz_revision != 0) {
+ switch (devid) {
+ case PCI_PRODUCT_ATHEROS_AR2413:
+ case PCI_PRODUCT_ATHEROS_AR5413:
+ case PCI_PRODUCT_ATHEROS_AR5424:
+ /*
+ * Known single chip solutions
+ */
+ printf("%s: AR%s %u.%u phy %u.%u rf %u.%u", ifp->if_xname,
+ ar5k_printver(AR5K_VERSION_DEV, devid),
+ ah->ah_mac_version, ah->ah_mac_revision,
+ ah->ah_phy_revision >> 4, ah->ah_phy_revision & 0xf,
+ ah->ah_radio_5ghz_revision >> 4,
+ ah->ah_radio_5ghz_revision & 0xf);
+ break;
+ default:
+ /*
+ * Multi chip solutions
+ */
+ printf("%s: AR%s %u.%u phy %u.%u", ifp->if_xname,
+ ar5k_printver(AR5K_VERSION_VER, ah->ah_mac_srev),
+ ah->ah_mac_version, ah->ah_mac_revision,
+ ah->ah_phy_revision >> 4, ah->ah_phy_revision & 0xf);
printf(" rf%s %u.%u",
- ar5k_printver(AR5K_VERSION_RAD,
- ah->ah_radio_2ghz_revision),
- ah->ah_radio_2ghz_revision >> 4,
- ah->ah_radio_2ghz_revision & 0xf);
+ ar5k_printver(AR5K_VERSION_RAD, ah->ah_radio_5ghz_revision),
+ ah->ah_radio_5ghz_revision >> 4,
+ ah->ah_radio_5ghz_revision & 0xf);
+ if (ah->ah_radio_2ghz_revision != 0) {
+ printf(" rf%s %u.%u",
+ ar5k_printver(AR5K_VERSION_RAD,
+ ah->ah_radio_2ghz_revision),
+ ah->ah_radio_2ghz_revision >> 4,
+ ah->ah_radio_2ghz_revision & 0xf);
+ }
+ break;
}
if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_UNSUPP ||