summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ar5212.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic/ar5212.c')
-rw-r--r--sys/dev/ic/ar5212.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c
index 8ccb60e252a..965aab792d0 100644
--- a/sys/dev/ic/ar5212.c
+++ b/sys/dev/ic/ar5212.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5212.c,v 1.31 2006/09/19 13:25:54 reyk Exp $ */
+/* $OpenBSD: ar5212.c,v 1.32 2006/09/19 16:42:29 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -452,31 +452,39 @@ ar5k_ar5212_reset(struct ath_hal *hal, HAL_OPMODE op_mode, HAL_CHANNEL *channel,
return (AH_FALSE);
}
- 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) {
- 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 if (channel->c_channel_flags & CHANNEL_TG) {
+ break;
+ case CHANNEL_T:
+ mode = AR5K_INI_VAL_11A_TURBO;
+ freq = AR5K_INI_RFGAIN_5GHZ;
+ ee_mode = AR5K_EEPROM_MODE_11A;
+ break;
+ case CHANNEL_TG:
mode = AR5K_INI_VAL_11G_TURBO;
freq = AR5K_INI_RFGAIN_2GHZ;
ee_mode = AR5K_EEPROM_MODE_11G;
- } else if (channel->c_channel_flags & CHANNEL_XR) {
+ break;
+ case CHANNEL_XR:
mode = AR5K_INI_VAL_XR;
freq = AR5K_INI_RFGAIN_5GHZ;
ee_mode = AR5K_EEPROM_MODE_11A;
- } else {
+ break;
+ default:
AR5K_PRINTF("invalid channel: %d\n", channel->c_channel);
return (AH_FALSE);
}