summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2004-11-11 20:11:29 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2004-11-11 20:11:29 +0000
commitfab0389990707a83804011d9e2ecddef87871c7c (patch)
tree258b0a08093ea49482c6cf7d94791f056a533bfa /sys
parent0d0281b1dd4c1b5ce715463f827ae004c3399e66 (diff)
some fixes for beeing compatible with gcc3 as noticed by some people.
thanks to Joerg Sonnenberger and Nathan Binkert.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ar5210.c37
-rw-r--r--sys/dev/ic/ar5xxx.c18
-rw-r--r--sys/dev/ic/ar5xxx.h196
-rw-r--r--sys/dev/ic/ath.c4
4 files changed, 129 insertions, 126 deletions
diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c
index 48e552a4c82..c834b06f3bd 100644
--- a/sys/dev/ic/ar5210.c
+++ b/sys/dev/ic/ar5210.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5210.c,v 1.5 2004/11/08 16:48:25 reyk Exp $ */
+/* $OpenBSD: ar5210.c,v 1.6 2004/11/11 20:11:28 reyk Exp $ */
/*
* Copyright (c) 2004 Reyk Floeter <reyk@vantronix.net>.
@@ -270,7 +270,7 @@ ar5k_ar5210_nic_wakeup(hal, turbo, initial)
/* ...reset hardware */
if (ar5k_ar5210_nic_reset(hal,
AR5K_AR5210_RC_PCI) == AH_FALSE) {
- AR5K_PRINTF("failed to reset the PCI chipset\n");
+ AR5K_PRINT("failed to reset the PCI chipset\n");
return (AH_FALSE);
}
@@ -280,7 +280,7 @@ ar5k_ar5210_nic_wakeup(hal, turbo, initial)
/* ...wakeup the device */
if (ar5k_ar5210_setPowerMode(hal,
HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
- AR5K_PRINTF("failed to resume the AR5210 chipset\n");
+ AR5K_PRINT("failed to resume the AR5210 chipset\n");
return (AH_FALSE);
}
@@ -290,7 +290,7 @@ ar5k_ar5210_nic_wakeup(hal, turbo, initial)
/* ...reset chipset */
if (ar5k_ar5210_nic_reset(hal, AR5K_AR5210_RC_CHIP) == AH_FALSE) {
- AR5K_PRINTF("failed to reset the AR5210 chipset\n");
+ AR5K_PRINT("failed to reset the AR5210 chipset\n");
return (AH_FALSE);
}
@@ -299,7 +299,7 @@ ar5k_ar5210_nic_wakeup(hal, turbo, initial)
/* ...reset chipset and PCI device */
if (ar5k_ar5210_nic_reset(hal,
AR5K_AR5210_RC_CHIP | AR5K_AR5210_RC_PCI) == AH_FALSE) {
- AR5K_PRINTF("failed to reset the AR5210 + PCI chipset\n");
+ AR5K_PRINT("failed to reset the AR5210 + PCI chipset\n");
return (AH_FALSE);
}
@@ -308,13 +308,13 @@ ar5k_ar5210_nic_wakeup(hal, turbo, initial)
/* ...wakeup (again) */
if (ar5k_ar5210_setPowerMode(hal,
HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
- AR5K_PRINTF("failed to resume the AR5210 (again)\n");
+ AR5K_PRINT("failed to resume the AR5210 (again)\n");
return (AH_FALSE);
}
/* ...final warm reset */
if (ar5k_ar5210_nic_reset(hal, 0) == AH_FALSE) {
- AR5K_PRINTF("failed to warm reset the AR5210\n");
+ AR5K_PRINT("failed to warm reset the AR5210\n");
return (AH_FALSE);
}
@@ -333,8 +333,8 @@ ar5k_ar5210_chan2athchan(channel)
* newer chipsets like the AR5212A who have a completely
* different RF/PHY part.
*/
- athchan = (ar5k_bitswap((ieee80211_mhz2ieee(channel->channel,
- channel->channelFlags) - 24)
+ athchan = (ar5k_bitswap((ieee80211_mhz2ieee(channel->c_channel,
+ channel->c_channel_flags) - 24)
/ 2, 5) << 1) | (1 << 6) | 0x1;
return (athchan);
@@ -355,10 +355,10 @@ ar5k_ar5210_set_channel(hal, channel)
* Check bounds supported by the PHY
* (don't care about regulation restrictions at this point)
*/
- if (channel->channel < hal->ah_capabilities.cap_range.range_5ghz_min ||
- channel->channel > hal->ah_capabilities.cap_range.range_5ghz_max) {
- AR5K_PRINTF("channel out of supported range (%u MHz)\n",
- channel->channel);
+ if (channel->c_channel < hal->ah_capabilities.cap_range.range_5ghz_min ||
+ channel->c_channel > hal->ah_capabilities.cap_range.range_5ghz_max) {
+ AR5K_PRINTF("channel out of supported range (%uMHz)\n",
+ channel->c_channel);
return (AH_FALSE);
}
@@ -376,9 +376,9 @@ ar5k_ar5210_set_channel(hal, channel)
AR5K_REG_WRITE(AR5K_AR5210_PHY_ACTIVE, AR5K_AR5210_PHY_ENABLE);
AR5K_DELAY(1000);
- hal->ah_current_channel.channel = channel->channel;
- hal->ah_current_channel.channelFlags = channel->channelFlags;
- hal->ah_turbo = channel->channelFlags == CHANNEL_T ? AH_TRUE : AH_FALSE;
+ hal->ah_current_channel.channel = channel->c_channel;
+ hal->ah_current_channel.channelFlags = channel->c_channel_flags;
+ hal->ah_turbo = channel->c_channel_flags == CHANNEL_T ? AH_TRUE : AH_FALSE;
return (AH_TRUE);
}
@@ -424,7 +424,7 @@ ar5k_ar5210_reset(hal, op_mode, channel, change_channel, status)
struct ar5k_ini initial[] = AR5K_AR5210_INI;
if (ar5k_ar5210_nic_wakeup(hal,
- channel->channelFlags & IEEE80211_CHAN_T ?
+ channel->c_channel_flags & IEEE80211_CHAN_T ?
AH_TRUE : AH_FALSE, AH_FALSE) == AH_FALSE)
return (AH_FALSE);
@@ -572,7 +572,8 @@ ar5k_ar5210_perCalibration(hal, channel)
if (ar5k_register_timeout(hal, AR5K_AR5210_PHY_AGCCTL,
AR5K_AR5210_PHY_AGC_CAL, 0, AH_FALSE) == AH_FALSE) {
- AR5K_PRINTF("calibration timeout\n");
+ AR5K_PRINTF("calibration timeout (%uMHz)\n",
+ channel->c_channel);
return (AH_FALSE);
}
diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c
index 70878465164..ec0b6777fa9 100644
--- a/sys/dev/ic/ar5xxx.c
+++ b/sys/dev/ic/ar5xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.c,v 1.4 2004/11/06 03:05:20 reyk Exp $ */
+/* $OpenBSD: ar5xxx.c,v 1.5 2004/11/11 20:11:28 reyk Exp $ */
/*
* Copyright (c) 2004 Reyk Floeter <reyk@vantronix.net>.
@@ -125,7 +125,7 @@ ath_hal_attach(device, sc, st, sh, status)
HAL_RATE_TABLE rt_11g = AR5K_RATES_11G;
HAL_RATE_TABLE rt_turbo = AR5K_RATES_TURBO;
struct ath_hal *hal = NULL;
- ar5k_attach_t *attach;
+ ar5k_attach_t *attach = NULL;
u_int8_t mac[IEEE80211_ADDR_LEN];
int i;
@@ -142,14 +142,14 @@ ath_hal_attach(device, sc, st, sh, status)
if (attach == NULL) {
*status = ENXIO;
- AR5K_PRINTF("device not supported\n");
+ AR5K_PRINTF("device not supported: 0x%04x\n", device);
return (NULL);
}
if ((hal = malloc(sizeof(struct ath_hal),
M_DEVBUF, M_NOWAIT)) == NULL) {
*status = ENOMEM;
- AR5K_PRINTF("out of memory\n");
+ AR5K_PRINT("out of memory\n");
return (NULL);
}
@@ -185,12 +185,14 @@ ath_hal_attach(device, sc, st, sh, status)
*/
if (hal->ah_get_capabilities(hal) != AH_TRUE) {
- AR5K_PRINTF("unable to get device capabilities\n");
+ AR5K_PRINTF("unable to get device capabilities: 0x%04x\n",
+ device);
goto failed;
}
if ((*status = ar5k_eeprom_read_mac(hal, mac)) != HAL_OK) {
- AR5K_PRINTF("unable to read address from EEPROM\n");
+ AR5K_PRINTF("unable to read address from EEPROM: 0x%04x\n",
+ device);
goto failed;
}
@@ -222,7 +224,7 @@ ath_hal_computetxtime(hal, rates, frame_length, rate_index, short_preamble)
u_int16_t rate_index;
HAL_BOOL short_preamble;
{
- HAL_RATE *rate;
+ const HAL_RATE *rate;
u_int32_t value;
AR5K_ASSERT_ENTRY(rate_index, rates->rateCount);
@@ -230,7 +232,7 @@ ath_hal_computetxtime(hal, rates, frame_length, rate_index, short_preamble)
/*
* Get rate by index
*/
- rate = (HAL_RATE*)&rates->info[rate_index];
+ rate = &rates->info[rate_index];
/*
* Calculate the transmission time by operation (PHY) mode
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index 39b51a6fbc8..b3fbae8251f 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.4 2004/11/08 16:48:25 reyk Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.5 2004/11/11 20:11:28 reyk Exp $ */
/*
* Copyright (c) 2004 Reyk Floeter <reyk@vantronix.net>.
@@ -368,7 +368,7 @@ typedef struct {
u_int16_t channelFlags;
#define c_channel channel
-#define c_channel_flags cnannelFlags
+#define c_channel_flags channelFlags
} HAL_CHANNEL;
@@ -576,150 +576,150 @@ struct ath_desc {
#define AR5K_HAL_FUNCTION(_hal, _n, _f) (_hal)->ah_##_f = ar5k_##_n##_##_f
#define AR5K_HAL_FUNCTIONS(_t, _n, _a) \
- _t const HAL_RATE_TABLE *(_a ##_n##_getRateTable)(struct ath_hal *, \
+ _t const HAL_RATE_TABLE *(_a _n##_getRateTable)(struct ath_hal *, \
u_int mode); \
- _t void (_a ##_n##_detach)(struct ath_hal *); \
+ _t void (_a _n##_detach)(struct ath_hal *); \
/* Reset functions */ \
- _t HAL_BOOL (_a ##_n##_reset)(struct ath_hal *, HAL_OPMODE, \
+ _t HAL_BOOL (_a _n##_reset)(struct ath_hal *, HAL_OPMODE, \
HAL_CHANNEL *, HAL_BOOL change_channel, HAL_STATUS *status); \
- _t void (_a ##_n##_setPCUConfig)(struct ath_hal *); \
- _t HAL_BOOL (_a ##_n##_perCalibration)(struct ath_hal*, \
+ _t void (_a _n##_setPCUConfig)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_perCalibration)(struct ath_hal*, \
HAL_CHANNEL *); \
/* Transmit functions */ \
- _t HAL_BOOL (_a ##_n##_updateTxTrigLevel)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_updateTxTrigLevel)(struct ath_hal*, \
HAL_BOOL level); \
- _t int (_a ##_n##_setupTxQueue)(struct ath_hal *, HAL_TX_QUEUE, \
+ _t int (_a _n##_setupTxQueue)(struct ath_hal *, HAL_TX_QUEUE, \
const HAL_TXQ_INFO *); \
- _t HAL_BOOL (_a ##_n##_setTxQueueProps)(struct ath_hal *, int queue, \
+ _t HAL_BOOL (_a _n##_setTxQueueProps)(struct ath_hal *, int queue, \
const HAL_TXQ_INFO *); \
- _t HAL_BOOL (_a ##_n##_releaseTxQueue)(struct ath_hal *, u_int queue); \
- _t HAL_BOOL (_a ##_n##_resetTxQueue)(struct ath_hal *, u_int queue); \
- _t u_int32_t (_a ##_n##_getTxDP)(struct ath_hal *, u_int queue); \
- _t HAL_BOOL (_a ##_n##_setTxDP)(struct ath_hal *, u_int, \
+ _t HAL_BOOL (_a _n##_releaseTxQueue)(struct ath_hal *, u_int queue); \
+ _t HAL_BOOL (_a _n##_resetTxQueue)(struct ath_hal *, u_int queue); \
+ _t u_int32_t (_a _n##_getTxDP)(struct ath_hal *, u_int queue); \
+ _t HAL_BOOL (_a _n##_setTxDP)(struct ath_hal *, u_int, \
u_int32_t phys_addr); \
- _t HAL_BOOL (_a ##_n##_startTxDma)(struct ath_hal *, u_int queue); \
- _t HAL_BOOL (_a ##_n##_stopTxDma)(struct ath_hal *, u_int queue); \
- _t HAL_BOOL (_a ##_n##_setupTxDesc)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_startTxDma)(struct ath_hal *, u_int queue); \
+ _t HAL_BOOL (_a _n##_stopTxDma)(struct ath_hal *, u_int queue); \
+ _t HAL_BOOL (_a _n##_setupTxDesc)(struct ath_hal *, \
struct ath_desc *, \
u_int packet_length, u_int header_length, HAL_PKT_TYPE type, \
u_int txPower, u_int tx_rate0, u_int tx_tries0, u_int key_index, \
u_int antenna_mode, u_int flags, u_int rtscts_rate, \
u_int rtscts_duration); \
- _t HAL_BOOL (_a ##_n##_setupXTxDesc)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_setupXTxDesc)(struct ath_hal *, \
struct ath_desc *, \
u_int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2, \
u_int tx_rate3, u_int tx_tries3); \
- _t HAL_BOOL (_a ##_n##_fillTxDesc)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_fillTxDesc)(struct ath_hal *, \
struct ath_desc *, \
u_int segLen, HAL_BOOL firstSeg, HAL_BOOL lastSeg); \
- _t HAL_STATUS (_a ##_n##_procTxDesc)(struct ath_hal *, \
+ _t HAL_STATUS (_a _n##_procTxDesc)(struct ath_hal *, \
struct ath_desc *); \
- _t HAL_BOOL (_a ##_n##_hasVEOL)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_hasVEOL)(struct ath_hal *); \
/* Receive Functions */ \
- _t u_int32_t (_a ##_n##_getRxDP)(struct ath_hal*); \
- _t void (_a ##_n##_setRxDP)(struct ath_hal*, u_int32_t rxdp); \
- _t void (_a ##_n##_enableReceive)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_stopDmaReceive)(struct ath_hal*); \
- _t void (_a ##_n##_startPcuReceive)(struct ath_hal*); \
- _t void (_a ##_n##_stopPcuReceive)(struct ath_hal*); \
- _t void (_a ##_n##_setMulticastFilter)(struct ath_hal*, \
+ _t u_int32_t (_a _n##_getRxDP)(struct ath_hal*); \
+ _t void (_a _n##_setRxDP)(struct ath_hal*, u_int32_t rxdp); \
+ _t void (_a _n##_enableReceive)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_stopDmaReceive)(struct ath_hal*); \
+ _t void (_a _n##_startPcuReceive)(struct ath_hal*); \
+ _t void (_a _n##_stopPcuReceive)(struct ath_hal*); \
+ _t void (_a _n##_setMulticastFilter)(struct ath_hal*, \
u_int32_t filter0, u_int32_t filter1); \
- _t HAL_BOOL (_a ##_n##_setMulticastFilterIndex)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_setMulticastFilterIndex)(struct ath_hal*, \
u_int32_t index); \
- _t HAL_BOOL (_a ##_n##_clrMulticastFilterIndex)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_clrMulticastFilterIndex)(struct ath_hal*, \
u_int32_t index); \
- _t u_int32_t (_a ##_n##_getRxFilter)(struct ath_hal*); \
- _t void (_a ##_n##_setRxFilter)(struct ath_hal*, u_int32_t); \
- _t HAL_BOOL (_a ##_n##_setupRxDesc)(struct ath_hal *, \
+ _t u_int32_t (_a _n##_getRxFilter)(struct ath_hal*); \
+ _t void (_a _n##_setRxFilter)(struct ath_hal*, u_int32_t); \
+ _t HAL_BOOL (_a _n##_setupRxDesc)(struct ath_hal *, \
struct ath_desc *, u_int32_t size, u_int flags); \
- _t HAL_STATUS (_a ##_n##_procRxDesc)(struct ath_hal *, \
+ _t HAL_STATUS (_a _n##_procRxDesc)(struct ath_hal *, \
struct ath_desc *, u_int32_t phyAddr, struct ath_desc *next); \
- _t void (_a ##_n##_rxMonitor)(struct ath_hal *); \
+ _t void (_a _n##_rxMonitor)(struct ath_hal *); \
/* Misc Functions */ \
- _t void (_a ##_n##_dumpState)(struct ath_hal *); \
- _t HAL_BOOL (_a ##_n##_getDiagState)(struct ath_hal *, int, void **, \
+ _t void (_a _n##_dumpState)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_getDiagState)(struct ath_hal *, int, void **, \
u_int *); \
- _t void (_a ##_n##_getMacAddress)(struct ath_hal *, u_int8_t *); \
- _t HAL_BOOL (_a ##_n##_setMacAddress)(struct ath_hal *, const u_int8_t*); \
- _t HAL_BOOL (_a ##_n##_setRegulatoryDomain)(struct ath_hal*, \
+ _t void (_a _n##_getMacAddress)(struct ath_hal *, u_int8_t *); \
+ _t HAL_BOOL (_a _n##_setMacAddress)(struct ath_hal *, const u_int8_t*); \
+ _t HAL_BOOL (_a _n##_setRegulatoryDomain)(struct ath_hal*, \
u_int16_t, HAL_STATUS *); \
- _t void (_a ##_n##_setLedState)(struct ath_hal*, HAL_LED_STATE); \
- _t void (_a ##_n##_writeAssocid)(struct ath_hal*, \
+ _t void (_a _n##_setLedState)(struct ath_hal*, HAL_LED_STATE); \
+ _t void (_a _n##_writeAssocid)(struct ath_hal*, \
const u_int8_t *bssid, u_int16_t assocId, u_int16_t timOffset); \
- _t HAL_BOOL (_a ##_n##_gpioCfgOutput)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_gpioCfgOutput)(struct ath_hal *, \
u_int32_t gpio); \
- _t HAL_BOOL (_a ##_n##_gpioCfgInput)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_gpioCfgInput)(struct ath_hal *, \
u_int32_t gpio); \
- _t u_int32_t (_a ##_n##_gpioGet)(struct ath_hal *, u_int32_t gpio); \
- _t HAL_BOOL (_a ##_n##_gpioSet)(struct ath_hal *, u_int32_t gpio, \
+ _t u_int32_t (_a _n##_gpioGet)(struct ath_hal *, u_int32_t gpio); \
+ _t HAL_BOOL (_a _n##_gpioSet)(struct ath_hal *, u_int32_t gpio, \
u_int32_t val); \
- _t void (_a ##_n##_gpioSetIntr)(struct ath_hal*, u_int, u_int32_t); \
- _t u_int32_t (_a ##_n##_getTsf32)(struct ath_hal*); \
- _t u_int64_t (_a ##_n##_getTsf64)(struct ath_hal*); \
- _t void (_a ##_n##_resetTsf)(struct ath_hal*); \
- _t u_int16_t (_a ##_n##_getRegDomain)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_detectCardPresent)(struct ath_hal*); \
- _t void (_a ##_n##_updateMibCounters)(struct ath_hal*, \
+ _t void (_a _n##_gpioSetIntr)(struct ath_hal*, u_int, u_int32_t); \
+ _t u_int32_t (_a _n##_getTsf32)(struct ath_hal*); \
+ _t u_int64_t (_a _n##_getTsf64)(struct ath_hal*); \
+ _t void (_a _n##_resetTsf)(struct ath_hal*); \
+ _t u_int16_t (_a _n##_getRegDomain)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_detectCardPresent)(struct ath_hal*); \
+ _t void (_a _n##_updateMibCounters)(struct ath_hal*, \
HAL_MIB_STATS*); \
- _t HAL_BOOL (_a ##_n##_isHwCipherSupported)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_isHwCipherSupported)(struct ath_hal*, \
HAL_CIPHER); \
- _t HAL_RFGAIN (_a ##_n##_getRfGain)(struct ath_hal*); \
+ _t HAL_RFGAIN (_a _n##_getRfGain)(struct ath_hal*); \
/* \
- u_int32_t (_a ##_n##_getCurRssi)(struct ath_hal*); \
- u_int32_t (_a ##_n##_getDefAntenna)(struct ath_hal*); \
- void (_a ##_n##_setDefAntenna)(struct ath_hal*, u_int32_t ant); \
+ u_int32_t (_a _n##_getCurRssi)(struct ath_hal*); \
+ u_int32_t (_a _n##_getDefAntenna)(struct ath_hal*); \
+ void (_a _n##_setDefAntenna)(struct ath_hal*, u_int32_t ant); \
*/ \
- _t HAL_BOOL (_a ##_n##_setSlotTime)(struct ath_hal*, u_int); \
- _t u_int (_a ##_n##_getSlotTime)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_setAckTimeout)(struct ath_hal *, u_int); \
- _t u_int (_a ##_n##_getAckTimeout)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_setCTSTimeout)(struct ath_hal*, u_int); \
- _t u_int (_a ##_n##_getCTSTimeout)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_setSlotTime)(struct ath_hal*, u_int); \
+ _t u_int (_a _n##_getSlotTime)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_setAckTimeout)(struct ath_hal *, u_int); \
+ _t u_int (_a _n##_getAckTimeout)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_setCTSTimeout)(struct ath_hal*, u_int); \
+ _t u_int (_a _n##_getCTSTimeout)(struct ath_hal*); \
/* Key Cache Functions */ \
- _t u_int32_t (_a ##_n##_getKeyCacheSize)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_resetKeyCacheEntry)(struct ath_hal*, \
+ _t u_int32_t (_a _n##_getKeyCacheSize)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_resetKeyCacheEntry)(struct ath_hal*, \
u_int16_t); \
- _t HAL_BOOL (_a ##_n##_isKeyCacheEntryValid)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_isKeyCacheEntryValid)(struct ath_hal *, \
u_int16_t); \
- _t HAL_BOOL (_a ##_n##_setKeyCacheEntry)(struct ath_hal*, u_int16_t, \
+ _t HAL_BOOL (_a _n##_setKeyCacheEntry)(struct ath_hal*, u_int16_t, \
const HAL_KEYVAL *, const u_int8_t *, int); \
- _t HAL_BOOL (_a ##_n##_setKeyCacheEntryMac)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_setKeyCacheEntryMac)(struct ath_hal*, \
u_int16_t, const u_int8_t *); \
/* Power Management Functions */ \
- _t HAL_BOOL (_a ##_n##_setPowerMode)(struct ath_hal*, \
+ _t HAL_BOOL (_a _n##_setPowerMode)(struct ath_hal*, \
HAL_POWER_MODE mode, \
int setChip, u_int16_t sleepDuration); \
- _t HAL_POWER_MODE (_a ##_n##_getPowerMode)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_queryPSPollSupport)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_initPSPoll)(struct ath_hal*); \
- _t HAL_BOOL (_a ##_n##_enablePSPoll)(struct ath_hal *, u_int8_t *, \
+ _t HAL_POWER_MODE (_a _n##_getPowerMode)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_queryPSPollSupport)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_initPSPoll)(struct ath_hal*); \
+ _t HAL_BOOL (_a _n##_enablePSPoll)(struct ath_hal *, u_int8_t *, \
u_int16_t); \
- _t HAL_BOOL (_a ##_n##_disablePSPoll)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_disablePSPoll)(struct ath_hal *); \
/* Beacon Management Functions */ \
- _t void (_a ##_n##_beaconInit)(struct ath_hal *, u_int32_t nexttbtt, \
+ _t void (_a _n##_beaconInit)(struct ath_hal *, u_int32_t nexttbtt, \
u_int32_t intval); \
- _t void (_a ##_n##_setStationBeaconTimers)(struct ath_hal *, \
+ _t void (_a _n##_setStationBeaconTimers)(struct ath_hal *, \
const HAL_BEACON_STATE *, u_int32_t tsf, u_int32_t dtimCount, \
u_int32_t cfpCcount); \
- _t void (_a ##_n##_resetStationBeaconTimers)(struct ath_hal *); \
- _t HAL_BOOL (_a ##_n##_waitForBeaconDone)(struct ath_hal *, \
+ _t void (_a _n##_resetStationBeaconTimers)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_waitForBeaconDone)(struct ath_hal *, \
bus_addr_t); \
/* Interrupt functions */ \
- _t HAL_BOOL (_a ##_n##_isInterruptPending)(struct ath_hal *); \
- _t HAL_BOOL (_a ##_n##_getPendingInterrupts)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_isInterruptPending)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_getPendingInterrupts)(struct ath_hal *, \
u_int32_t *); \
- _t u_int32_t (_a ##_n##_getInterrupts)(struct ath_hal *); \
- _t HAL_INT (_a ##_n##_setInterrupts)(struct ath_hal *, HAL_INT); \
+ _t u_int32_t (_a _n##_getInterrupts)(struct ath_hal *); \
+ _t HAL_INT (_a _n##_setInterrupts)(struct ath_hal *, HAL_INT); \
/* Chipset functions (ar5k-specific, non-HAL) */ \
- _t HAL_BOOL (_a ##_n##_get_capabilities)(struct ath_hal *); \
- _t void (_a ##_n##_radar_alert)(struct ath_hal *, HAL_BOOL enable); \
- _t HAL_BOOL (_a ##_n##_regulation_domain)(struct ath_hal *, \
+ _t HAL_BOOL (_a _n##_get_capabilities)(struct ath_hal *); \
+ _t void (_a _n##_radar_alert)(struct ath_hal *, HAL_BOOL enable); \
+ _t HAL_BOOL (_a _n##_regulation_domain)(struct ath_hal *, \
HAL_BOOL read, ieee80211_regdomain_t *); \
- _t int (_a ##_n##_eeprom_init)(struct ath_hal *); \
- _t HAL_BOOL (_a ##_n##_eeprom_is_busy)(struct ath_hal *); \
- _t int (_a ##_n##_eeprom_read)(struct ath_hal *, u_int32_t offset, \
+ _t int (_a _n##_eeprom_init)(struct ath_hal *); \
+ _t HAL_BOOL (_a _n##_eeprom_is_busy)(struct ath_hal *); \
+ _t int (_a _n##_eeprom_read)(struct ath_hal *, u_int32_t offset, \
u_int16_t *data); \
- _t int (_a ##_n##_eeprom_write)(struct ath_hal *, u_int32_t offset, \
+ _t int (_a _n##_eeprom_write)(struct ath_hal *, u_int32_t offset, \
u_int16_t data);
#define AR5K_MAX_GPIO 10
@@ -795,11 +795,11 @@ struct ath_hal {
#define HAL_ABI_VERSION 0x04090901 /* YYMMDDnn */
-#define AR5K_PRINTF(_x, ...) printf(__func__ ": " _x)
-#define AR5K_TRACE printf("%s:%d\n", __func__, __LINE__)
-#define AR5K_DELAY(_n) delay(_n)
-
-#define AR5K_ELEMENTS(_array) (sizeof(_array) / sizeof(_array[0]))
+#define AR5K_PRINTF(fmt, ...) printf("%s: " fmt, __func__, ##__VA_ARGS__)
+#define AR5K_PRINT(fmt) printf("%s: " fmt, __func__)
+#define AR5K_TRACE printf("%s:%d\n", __func__, __LINE__)
+#define AR5K_DELAY(_n) delay(_n)
+#define AR5K_ELEMENTS(_array) (sizeof(_array) / sizeof(_array[0]))
typedef struct ath_hal*(ar5k_attach_t)
(u_int16_t, void *, bus_space_tag_t, bus_space_handle_t, HAL_STATUS *);
@@ -914,10 +914,10 @@ struct ar5k_ini {
*/
#define AR5K_LE_READ_2(_p) \
- (((u_int8_t *)(_p))[0] | (((u_int8_t *)(_p))[1] << 8))
+ (((const u_int8_t *)(_p))[0] | (((const u_int8_t *)(_p))[1] << 8))
#define AR5K_LE_READ_4(_p) \
- (((u_int8_t *)(_p))[0] | (((u_int8_t *)(_p))[1] << 8) | \
- (((u_int8_t *)(_p))[2] << 16) | (((u_int8_t *)(_p))[3] << 24))
+ (((const u_int8_t *)(_p))[0] | (((const u_int8_t *)(_p))[1] << 8) | \
+ (((const u_int8_t *)(_p))[2] << 16) | (((const u_int8_t *)(_p))[3] << 24))
#define AR5K_LE_WRITE_2(_p, _val) \
((((u_int8_t *)(_p))[0] = ((u_int32_t)(_val) & 0xff)), \
(((u_int8_t *)(_p))[1] = (((u_int32_t)(_val) >> 8) & 0xff)))
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 0485b49c0d5..3bb589f673f 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.2 2004/11/02 14:05:49 reyk Exp $ */
+/* $OpenBSD: ath.c,v 1.3 2004/11/11 20:11:28 reyk Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -179,7 +179,7 @@ static int ath_calinterval = 30; /* calibrate every 30 secs */
static int ath_outdoor = AH_TRUE; /* outdoor operation */
static int ath_xchanmode = AH_TRUE; /* enable extended channels */
static int ath_countrycode = CTRY_DEFAULT; /* country code */
-static int ath_regdomain = 0; /* regulatory domain */
+static int ath_regdomain = DMN_DEFAULT; /* regulatory domain */
#ifdef AR_DEBUG
enum {