diff options
-rw-r--r-- | sys/dev/ic/ar5210.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/ar5210reg.h | 14 | ||||
-rw-r--r-- | sys/dev/ic/ar5211.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/ar5211reg.h | 9 | ||||
-rw-r--r-- | sys/dev/ic/ar5212.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/ar5212reg.h | 9 |
6 files changed, 27 insertions, 28 deletions
diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c index da31228ae23..da33748870b 100644 --- a/sys/dev/ic/ar5210.c +++ b/sys/dev/ic/ar5210.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5210.c,v 1.20 2005/04/18 18:42:55 reyk Exp $ */ +/* $OpenBSD: ar5210.c,v 1.21 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -179,6 +179,7 @@ ar5k_ar5210_attach(device, sc, st, sh, status) int i; struct ath_hal *hal = (struct ath_hal*) sc; u_int8_t mac[IEEE80211_ADDR_LEN]; + u_int32_t srev; ar5k_ar5210_fill(hal); @@ -187,9 +188,9 @@ ar5k_ar5210_attach(device, sc, st, sh, status) return (NULL); /* Get MAC, PHY and RADIO revisions */ + srev = AR5K_REG_READ(AR5K_AR5210_SREV); hal->ah_mac_version = 1; - hal->ah_mac_revision = (AR5K_REG_READ(AR5K_AR5210_SREV) & - AR5K_AR5210_SREV_ID_M); + hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_AR5210_SREV_REV); hal->ah_phy_revision = AR5K_REG_READ(AR5K_AR5210_PHY_CHIP_ID) & 0x00ffffffff; diff --git a/sys/dev/ic/ar5210reg.h b/sys/dev/ic/ar5210reg.h index 4adf1011745..fbc6b913c94 100644 --- a/sys/dev/ic/ar5210reg.h +++ b/sys/dev/ic/ar5210reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5210reg.h,v 1.8 2005/03/20 04:21:55 reyk Exp $ */ +/* $OpenBSD: ar5210reg.h,v 1.9 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -311,14 +311,10 @@ typedef enum { * Silicon revision register */ #define AR5K_AR5210_SREV 0x4020 -#define AR5K_AR5210_SREV_ID_M 0x000000ff -#define AR5K_AR5210_SREV_FPGA 1 -#define AR5K_AR5210_SREV_PHYPLUS 2 -#define AR5K_AR5210_SREV_PHYPLUS_MS 3 -#define AR5K_AR5210_SREV_CRETE 4 -#define AR5K_AR5210_SREV_CRETE_MS 5 -#define AR5K_AR5210_SREV_CRETE_MS23 7 -#define AR5K_AR5210_SREV_CRETE_23 8 +#define AR5K_AR5210_SREV_REV 0x0000000f +#define AR5K_AR5210_SREV_REV_S 0 +#define AR5K_AR5210_SREV_VER 0x000000ff +#define AR5K_AR5210_SREV_VER_S 4 /* * EEPROM access registers diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c index 8796279a0a4..52d7ca81307 100644 --- a/sys/dev/ic/ar5211.c +++ b/sys/dev/ic/ar5211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5211.c,v 1.12 2005/04/20 01:46:02 reyk Exp $ */ +/* $OpenBSD: ar5211.c,v 1.13 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -197,9 +197,9 @@ ar5k_ar5211_attach(device, sc, st, sh, status) return (NULL); /* Get MAC, PHY and RADIO revisions */ - srev = AR5K_REG_READ(AR5K_AR5211_SREV) & AR5K_AR5211_SREV_M; - hal->ah_mac_version = srev & AR5K_AR5211_SREV_VERSION; - hal->ah_mac_revision = srev & AR5K_AR5211_SREV_REVISION; + srev = AR5K_REG_READ(AR5K_AR5211_SREV); + hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_AR5211_SREV_VER); + hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_AR5211_SREV_REV); hal->ah_phy_revision = AR5K_REG_READ(AR5K_AR5211_PHY_CHIP_ID) & 0x00ffffffff; diff --git a/sys/dev/ic/ar5211reg.h b/sys/dev/ic/ar5211reg.h index 05135bd5ea1..01eb75339d4 100644 --- a/sys/dev/ic/ar5211reg.h +++ b/sys/dev/ic/ar5211reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5211reg.h,v 1.4 2005/03/20 04:21:55 reyk Exp $ */ +/* $OpenBSD: ar5211reg.h,v 1.5 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -631,9 +631,10 @@ typedef enum { * Silicon revision register */ #define AR5K_AR5211_SREV 0x4020 -#define AR5K_AR5211_SREV_M 0x000000ff -#define AR5K_AR5211_SREV_REVISION 0x0000000f -#define AR5K_AR5211_SREV_VERSION 0x000000f0 +#define AR5K_AR5211_SREV_REV 0x0000000f +#define AR5K_AR5211_SREV_REV_S 0 +#define AR5K_AR5211_SREV_VER 0x000000ff +#define AR5K_AR5211_SREV_VER_S 4 /* * EEPROM access registers diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c index 38467004aa0..b2da7f077a0 100644 --- a/sys/dev/ic/ar5212.c +++ b/sys/dev/ic/ar5212.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5212.c,v 1.15 2005/04/18 18:42:55 reyk Exp $ */ +/* $OpenBSD: ar5212.c,v 1.16 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -194,9 +194,9 @@ ar5k_ar5212_attach(device, sc, st, sh, status) return (NULL); /* Get MAC, PHY and RADIO revisions */ - srev = AR5K_REG_READ(AR5K_AR5212_SREV) & AR5K_AR5212_SREV_M; - hal->ah_mac_version = srev & AR5K_AR5212_SREV_VERSION; - hal->ah_mac_revision = srev & AR5K_AR5212_SREV_REVISION; + srev = AR5K_REG_READ(AR5K_AR5212_SREV); + hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_AR5212_SREV_VER); + hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_AR5212_SREV_REV); hal->ah_phy_revision = AR5K_REG_READ(AR5K_AR5212_PHY_CHIP_ID) & 0x00ffffffff; diff --git a/sys/dev/ic/ar5212reg.h b/sys/dev/ic/ar5212reg.h index 7f11d5de49d..5893f248984 100644 --- a/sys/dev/ic/ar5212reg.h +++ b/sys/dev/ic/ar5212reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5212reg.h,v 1.4 2005/03/20 04:21:55 reyk Exp $ */ +/* $OpenBSD: ar5212reg.h,v 1.5 2005/05/08 14:46:50 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -645,9 +645,10 @@ typedef enum { * Silicon revision register */ #define AR5K_AR5212_SREV 0x4020 -#define AR5K_AR5212_SREV_M 0x000000ff -#define AR5K_AR5212_SREV_REVISION 0x0000000f -#define AR5K_AR5212_SREV_VERSION 0x000000f0 +#define AR5K_AR5212_SREV_REV 0x0000000f +#define AR5K_AR5212_SREV_REV_S 0 +#define AR5K_AR5212_SREV_VER 0x000000ff +#define AR5K_AR5212_SREV_VER_S 4 /* * EEPROM access registers |