diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-08-02 12:55:12 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-08-02 12:55:12 +0000 |
commit | 29064c36d3fd1441d00dee51b3d8a79a1f2b2dba (patch) | |
tree | 6acd899d940715bd18ca8165416714d650862a5e | |
parent | 45ff676fd3c75a31c79628ed33119c90a3384ac0 (diff) |
reduce stack usage
spotted out by jsg@
-rw-r--r-- | sys/dev/ic/ar5210.c | 23 | ||||
-rw-r--r-- | sys/dev/ic/ar5xxx.c | 25 | ||||
-rw-r--r-- | sys/dev/ic/ar5xxx.h | 4 |
3 files changed, 29 insertions, 23 deletions
diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c index b57bfb47587..cc134022e08 100644 --- a/sys/dev/ic/ar5210.c +++ b/sys/dev/ic/ar5210.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5210.c,v 1.26 2005/06/17 12:51:08 reyk Exp $ */ +/* $OpenBSD: ar5210.c,v 1.27 2005/08/02 12:55:11 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -32,6 +32,12 @@ const void ar5k_ar5210_fill(struct ath_hal *); HAL_BOOL ar5k_ar5210_do_calibrate(struct ath_hal *, HAL_CHANNEL *); HAL_BOOL ar5k_ar5210_noise_floor(struct ath_hal *, HAL_CHANNEL *); +/* + * Initial register setting for the AR5210 + */ +static const struct ar5k_ini ar5210_ini[] = + AR5K_AR5210_INI; + AR5K_HAL_FUNCTIONS(extern, ar5k_ar5210,); const void @@ -355,7 +361,6 @@ ar5k_ar5210_reset(hal, op_mode, channel, change_channel, status) HAL_STATUS *status; { int i; - struct ar5k_ini initial[] = AR5K_AR5210_INI; /* Not used, keep for HAL compatibility */ *status = HAL_OK; @@ -374,22 +379,22 @@ ar5k_ar5210_reset(hal, op_mode, channel, change_channel, status) /* * Write initial mode register settings */ - for (i = 0; i < AR5K_ELEMENTS(initial); i++) { + for (i = 0; i < AR5K_ELEMENTS(ar5210_ini); i++) { if (change_channel == AH_TRUE && - initial[i].ini_register >= AR5K_AR5210_PCU_MIN && - initial[i].ini_register <= AR5K_AR5210_PCU_MAX) + ar5210_ini[i].ini_register >= AR5K_AR5210_PCU_MIN && + ar5210_ini[i].ini_register <= AR5K_AR5210_PCU_MAX) continue; - switch (initial[i].ini_mode) { + switch (ar5210_ini[i].ini_mode) { case AR5K_INI_READ: /* Cleared on read */ - AR5K_REG_READ(initial[i].ini_register); + AR5K_REG_READ(ar5210_ini[i].ini_register); break; case AR5K_INI_WRITE: default: - AR5K_REG_WRITE(initial[i].ini_register, - initial[i].ini_value); + AR5K_REG_WRITE(ar5210_ini[i].ini_register, + ar5210_ini[i].ini_value); } } diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c index eb098d676f5..9bc314e7438 100644 --- a/sys/dev/ic/ar5xxx.c +++ b/sys/dev/ic/ar5xxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5xxx.c,v 1.26 2005/06/17 12:51:08 reyk Exp $ */ +/* $OpenBSD: ar5xxx.c,v 1.27 2005/08/02 12:55:11 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -67,6 +67,12 @@ static const struct { ar5k_ar5212_attach } }; +static const HAL_RATE_TABLE ar5k_rt_11a = AR5K_RATES_11A; +static const HAL_RATE_TABLE ar5k_rt_11b = AR5K_RATES_11B; +static const HAL_RATE_TABLE ar5k_rt_11g = AR5K_RATES_11G; +static const HAL_RATE_TABLE ar5k_rt_turbo = AR5K_RATES_TURBO; +static const HAL_RATE_TABLE ar5k_rt_xr = AR5K_RATES_XR; + int ar5k_eeprom_read_ants(struct ath_hal *, u_int32_t *, u_int); int ar5k_eeprom_read_modes(struct ath_hal *, u_int32_t *, u_int); u_int16_t ar5k_eeprom_bin2freq(struct ath_hal *, u_int16_t, u_int); @@ -145,11 +151,6 @@ ath_hal_attach(device, sc, st, sh, status) int *status; { ieee80211_regdomain_t ieee_regdomain; - HAL_RATE_TABLE rt_11a = AR5K_RATES_11A; - HAL_RATE_TABLE rt_11b = AR5K_RATES_11B; - HAL_RATE_TABLE rt_11g = AR5K_RATES_11G; - HAL_RATE_TABLE rt_turbo = AR5K_RATES_TURBO; - HAL_RATE_TABLE rt_xr = AR5K_RATES_XR; u_int16_t regdomain; struct ath_hal *hal = NULL; ar5k_attach_t *attach = NULL; @@ -255,15 +256,15 @@ ath_hal_attach(device, sc, st, sh, status) /* Get rate tables */ if (hal->ah_capabilities.cap_mode & HAL_MODE_11A) - ar5k_rt_copy(&hal->ah_rt_11a, &rt_11a); + ar5k_rt_copy(&hal->ah_rt_11a, &ar5k_rt_11a); if (hal->ah_capabilities.cap_mode & HAL_MODE_11B) - ar5k_rt_copy(&hal->ah_rt_11b, &rt_11b); + ar5k_rt_copy(&hal->ah_rt_11b, &ar5k_rt_11b); if (hal->ah_capabilities.cap_mode & HAL_MODE_11G) - ar5k_rt_copy(&hal->ah_rt_11g, &rt_11g); + ar5k_rt_copy(&hal->ah_rt_11g, &ar5k_rt_11g); if (hal->ah_capabilities.cap_mode & HAL_MODE_TURBO) - ar5k_rt_copy(&hal->ah_rt_turbo, &rt_turbo); + ar5k_rt_copy(&hal->ah_rt_turbo, &ar5k_rt_turbo); if (hal->ah_capabilities.cap_mode & HAL_MODE_XR) - ar5k_rt_copy(&hal->ah_rt_xr, &rt_xr); + ar5k_rt_copy(&hal->ah_rt_xr, &ar5k_rt_xr); /* Initialize the gain optimization values */ if (hal->ah_radio == AR5K_AR5111) { @@ -664,7 +665,7 @@ ar5k_clocktoh(clock, turbo) void ar5k_rt_copy(dst, src) HAL_RATE_TABLE *dst; - HAL_RATE_TABLE *src; + const HAL_RATE_TABLE *src; { bzero(dst, sizeof(HAL_RATE_TABLE)); dst->rateCount = src->rateCount; diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h index 3b58175477b..cf5c663bf9f 100644 --- a/sys/dev/ic/ar5xxx.h +++ b/sys/dev/ic/ar5xxx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5xxx.h,v 1.23 2005/07/30 17:13:17 reyk Exp $ */ +/* $OpenBSD: ar5xxx.h,v 1.24 2005/08/02 12:55:11 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -1825,7 +1825,7 @@ u_int16_t ar5k_get_regdomain(struct ath_hal *); u_int32_t ar5k_bitswap(u_int32_t, u_int); u_int ar5k_clocktoh(u_int, HAL_BOOL); u_int ar5k_htoclock(u_int, HAL_BOOL); -void ar5k_rt_copy(HAL_RATE_TABLE *, HAL_RATE_TABLE *); +void ar5k_rt_copy(HAL_RATE_TABLE *, const HAL_RATE_TABLE *); HAL_BOOL ar5k_register_timeout(struct ath_hal *, u_int32_t, u_int32_t, u_int32_t, HAL_BOOL); |