summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ar5211.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-09-19 16:42:30 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-09-19 16:42:30 +0000
commita1890d4665a235fe827940778520aa0488e73f74 (patch)
tree482f740d34c3f00fed6d42966b6cbc7706b77cd9 /sys/dev/ic/ar5211.c
parentb2a0ed24fa12fa0e63291568624582cdebd1e571 (diff)
better mode setup in the ar5211 and ar5212 reset functions
Diffstat (limited to 'sys/dev/ic/ar5211.c')
-rw-r--r--sys/dev/ic/ar5211.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c
index b7d377807a2..bbbb593270f 100644
--- a/sys/dev/ic/ar5211.c
+++ b/sys/dev/ic/ar5211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5211.c,v 1.27 2006/09/19 13:37:11 reyk Exp $ */
+/* $OpenBSD: ar5211.c,v 1.28 2006/09/19 16:42:29 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -423,23 +423,29 @@ ar5k_ar5211_reset(struct ath_hal *hal, HAL_OPMODE op_mode, HAL_CHANNEL *channel,
*/
hal->ah_op_mode = op_mode;
- if (channel->c_channel_flags & IEEE80211_CHAN_A) {
+ switch (channel->c_channel_flags & CHANNEL_MODES) {
+ case CHANNEL_A:
mode = AR5K_INI_VAL_11A;
freq = AR5K_INI_RFGAIN_5GHZ;
ee_mode = AR5K_EEPROM_MODE_11A;
- } else if (channel->c_channel_flags & IEEE80211_CHAN_T) {
+ break;
+ case CHANNEL_T:
mode = AR5K_INI_VAL_11A_TURBO;
freq = AR5K_INI_RFGAIN_5GHZ;
ee_mode = AR5K_EEPROM_MODE_11A;
- } else if (channel->c_channel_flags & IEEE80211_CHAN_B) {
+ break;
+ case CHANNEL_B:
mode = AR5K_INI_VAL_11B;
freq = AR5K_INI_RFGAIN_2GHZ;
ee_mode = AR5K_EEPROM_MODE_11B;
- } else if (channel->c_channel_flags & IEEE80211_CHAN_G) {
+ break;
+ case CHANNEL_G:
+ case CHANNEL_PUREG:
mode = AR5K_INI_VAL_11G;
freq = AR5K_INI_RFGAIN_2GHZ;
ee_mode = AR5K_EEPROM_MODE_11G;
- } else {
+ break;
+ default:
AR5K_PRINTF("invalid channel: %d\n", channel->c_channel);
return (AH_FALSE);
}