diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-09-13 13:35:07 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-09-13 13:35:07 +0000 |
commit | 6b664f0e218709861d1549f94cfdc851f0707ee1 (patch) | |
tree | 8cb7360f69ed7804e892ef82c1ef1c833a955886 /sys/dev | |
parent | 40176daf3d3092c8563fb1878c0707ac08a702ae (diff) |
fallback to 11b support if the EEPROM is not reporting any available mode.
there is probably a new EEPROM format here, but i don't know how to parse
the AR5424 version yet, so just set some defaults for these chipsets for now.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/ar5211.c | 22 | ||||
-rw-r--r-- | sys/dev/ic/ar5212.c | 29 |
2 files changed, 40 insertions, 11 deletions
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c index def07374ad0..bd5a74dfa75 100644 --- a/sys/dev/ic/ar5211.c +++ b/sys/dev/ic/ar5211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5211.c,v 1.39 2008/08/29 10:05:00 reyk Exp $ */ +/* $OpenBSD: ar5211.c,v 1.40 2008/09/13 13:35:06 reyk Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org> @@ -2402,10 +2402,22 @@ HAL_BOOL ar5k_ar5211_get_capabilities(struct ath_hal *hal) { u_int16_t ee_header; + u_int a, b, g; /* Capabilities stored in the EEPROM */ ee_header = hal->ah_capabilities.cap_eeprom.ee_header; + a = AR5K_EEPROM_HDR_11A(ee_header); + b = AR5K_EEPROM_HDR_11B(ee_header); + g = AR5K_EEPROM_HDR_11G(ee_header); + + /* + * If the EEPROM is not reporting any mode, we try 11b. + * This might fix a few broken devices with invalid EEPROM. + */ + if (a == b == g == 0) + b = 1; + /* * XXX The AR5211 tranceiver supports frequencies from 4920 to 6100GHz * XXX and from 2312 to 2732GHz. There are problems with the current @@ -2420,7 +2432,7 @@ ar5k_ar5211_get_capabilities(struct ath_hal *hal) * Set radio capabilities */ - if (AR5K_EEPROM_HDR_11A(ee_header)) { + if (a) { hal->ah_capabilities.cap_range.range_5ghz_min = 5005; /* 4920 */ hal->ah_capabilities.cap_range.range_5ghz_max = 6100; @@ -2429,14 +2441,14 @@ ar5k_ar5211_get_capabilities(struct ath_hal *hal) } /* This chip will support 802.11b if the 2GHz radio is connected */ - if (AR5K_EEPROM_HDR_11B(ee_header) || AR5K_EEPROM_HDR_11G(ee_header)) { + if (b || g) { hal->ah_capabilities.cap_range.range_2ghz_min = 2412; /* 2312 */ hal->ah_capabilities.cap_range.range_2ghz_max = 2732; - if (AR5K_EEPROM_HDR_11B(ee_header)) + if (b) hal->ah_capabilities.cap_mode |= HAL_MODE_11B; #if 0 - if (AR5K_EEPROM_HDR_11G(ee_header)) + if (g) hal->ah_capabilities.cap_mode |= HAL_MODE_11G; #endif } diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c index 1affee9d453..e658b944729 100644 --- a/sys/dev/ic/ar5212.c +++ b/sys/dev/ic/ar5212.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5212.c,v 1.47 2008/08/29 10:05:00 reyk Exp $ */ +/* $OpenBSD: ar5212.c,v 1.48 2008/09/13 13:35:06 reyk Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org> @@ -229,7 +229,12 @@ ar5k_ar5212_attach(u_int16_t device, void *sc, bus_space_tag_t st, /* Identify the chipset (this has to be done in an early step) */ hal->ah_version = AR5K_AR5212; - if (srev == AR5K_SREV_VER_AR2425) { + if (device == AR5K_VERSION_DEV) { + hal->ah_radio = AR5K_AR5413; + hal->ah_phy_spending = AR5K_AR5212_PHY_SPENDING_AR5424; + hal->ah_radio_5ghz_revision = hal->ah_radio_2ghz_revision = + AR5K_SREV_VER_AR5413; + } else if (srev == AR5K_SREV_VER_AR2425) { hal->ah_radio = AR5K_AR2425; hal->ah_phy_spending = AR5K_AR5212_PHY_SPENDING_AR5112; } else if (hal->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112) { @@ -2809,10 +2814,22 @@ HAL_BOOL ar5k_ar5212_get_capabilities(struct ath_hal *hal) { u_int16_t ee_header; + u_int a, b, g; /* Capabilities stored in the EEPROM */ ee_header = hal->ah_capabilities.cap_eeprom.ee_header; + a = AR5K_EEPROM_HDR_11A(ee_header); + b = AR5K_EEPROM_HDR_11B(ee_header); + g = AR5K_EEPROM_HDR_11G(ee_header); + + /* + * If the EEPROM is not reporting any mode, we try 11b. + * This might fix a few broken devices with invalid EEPROM. + */ + if (a == b == g == 0) + b = 1; + /* * XXX The AR5212 tranceiver supports frequencies from 4920 to 6100GHz * XXX and from 2312 to 2732GHz. There are problems with the current @@ -2827,7 +2844,7 @@ ar5k_ar5212_get_capabilities(struct ath_hal *hal) * Set radio capabilities */ - if (AR5K_EEPROM_HDR_11A(ee_header)) { + if (a) { hal->ah_capabilities.cap_range.range_5ghz_min = 5005; /* 4920 */ hal->ah_capabilities.cap_range.range_5ghz_max = 6100; @@ -2837,14 +2854,14 @@ ar5k_ar5212_get_capabilities(struct ath_hal *hal) } /* This chip will support 802.11b if the 2GHz radio is connected */ - if (AR5K_EEPROM_HDR_11B(ee_header) || AR5K_EEPROM_HDR_11G(ee_header)) { + if (b || g) { hal->ah_capabilities.cap_range.range_2ghz_min = 2412; /* 2312 */ hal->ah_capabilities.cap_range.range_2ghz_max = 2732; - if (AR5K_EEPROM_HDR_11B(ee_header)) + if (b) hal->ah_capabilities.cap_mode |= HAL_MODE_11B; #if 0 - if (AR5K_EEPROM_HDR_11G(ee_header)) + if (g) hal->ah_capabilities.cap_mode |= HAL_MODE_11G; #endif } |