commit 864ee6a9607787147044a9067c631ca8c235508c Author: Jiri Slaby Date: Sun Jun 17 11:58:43 2007 +0200 fix sparse warnings diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 8f78f70..7b62b51 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -211,12 +211,12 @@ struct ath5k_srev_name { #define HAS_SHPREAMBLE(_ix) (rt->rates[_ix].modulation == MODULATION_CCK_SP) #define SHPREAMBLE_FLAG(_ix) HAS_SHPREAMBLE(_ix)?AR5K_SET_SHORT_PREAMBLE:0 -typedef enum { +/*typedef enum { AR5K_M_STA = IEEE80211_IF_TYPE_STA, AR5K_M_IBSS = IEEE80211_IF_TYPE_IBSS, AR5K_M_HOSTAP = IEEE80211_IF_TYPE_AP, AR5K_M_MONITOR = IEEE80211_IF_TYPE_MNTR, -} AR5K_OPMODE; +} AR5K_OPMODE;*/ /****************\ @@ -957,6 +957,8 @@ typedef enum ieee80211_countrycode AR5K_CTRY_CODE; #define AR5K_ELEMENTS(_array) (sizeof(_array) / sizeof(_array[0])) +struct ath_hal; + typedef AR5K_BOOL (ath5k_rfgain_t) (struct ath_hal *, AR5K_CHANNEL *, u_int); @@ -968,7 +970,7 @@ typedef AR5K_BOOL (ath5k_rfgain_t) _t const AR5K_RATE_TABLE *(_a _n##_get_rate_table)(struct ath_hal *, u_int mode); \ _t void (_a _n##_detach)(struct ath_hal *); \ /* Reset functions */ \ - _t AR5K_BOOL (_a _n##_reset)(struct ath_hal *, AR5K_OPMODE, AR5K_CHANNEL *, \ + _t AR5K_BOOL (_a _n##_reset)(struct ath_hal *, enum ieee80211_if_types, AR5K_CHANNEL *, \ AR5K_BOOL change_channel, AR5K_STATUS *status); \ _t void (_a _n##_set_opmode)(struct ath_hal *); \ _t AR5K_BOOL (_a _n##_phy_calibrate)(struct ath_hal*, AR5K_CHANNEL *); \ @@ -1105,7 +1107,7 @@ struct ath_hal { AR5K_INT ah_imr; - AR5K_OPMODE ah_op_mode; + enum ieee80211_if_types ah_op_mode; AR5K_POWER_MODE ah_power_mode; AR5K_CHANNEL ah_current_channel; AR5K_BOOL ah_turbo; diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index fb59cd3..17814ca 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -405,7 +405,7 @@ ath5k_hw_init(u16 device, void *sc, void __iomem *sh, AR5K_STATUS *status) hal->ah_country_code = AR5K_TUNE_CTRY; ath5k_get_regdomain(hal); - hal->ah_op_mode = AR5K_M_STA; + hal->ah_op_mode = IEEE80211_IF_TYPE_STA; hal->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT; hal->ah_turbo = FALSE; hal->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; @@ -794,8 +794,8 @@ ath5k_hw_detach(struct ath_hal *hal) * Main reset function */ AR5K_BOOL -ath5k_hw_reset(struct ath_hal *hal, AR5K_OPMODE op_mode, AR5K_CHANNEL *channel, - AR5K_BOOL change_channel, AR5K_STATUS *status) +ath5k_hw_reset(struct ath_hal *hal, enum ieee80211_if_types op_mode, + AR5K_CHANNEL *channel, AR5K_BOOL change_channel, AR5K_STATUS *status) { struct ath5k_eeprom_info *ee = &hal->ah_capabilities.cap_eeprom; u_int8_t mac[ETH_ALEN]; @@ -2669,7 +2669,7 @@ ath5k_hw_set_opmode(struct ath_hal *hal) AR5K_TRACE; switch (hal->ah_op_mode) { - case AR5K_M_IBSS: + case IEEE80211_IF_TYPE_IBSS: pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA | (hal->ah_version == AR5K_AR5210 ?AR5K_STA_ID1_NO_PSPOLL :0); @@ -2677,7 +2677,7 @@ ath5k_hw_set_opmode(struct ath_hal *hal) beacon_reg |= AR5K_BCR_ADHOC; break; - case AR5K_M_HOSTAP: + case IEEE80211_IF_TYPE_AP: pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA | (hal->ah_version == AR5K_AR5210 ?AR5K_STA_ID1_NO_PSPOLL :0); @@ -2685,10 +2685,10 @@ ath5k_hw_set_opmode(struct ath_hal *hal) beacon_reg |= AR5K_BCR_AP; break; - case AR5K_M_STA: + case IEEE80211_IF_TYPE_STA: pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | (hal->ah_version == AR5K_AR5210 ?AR5K_STA_ID1_PWR_SV :0); - case AR5K_M_MONITOR: + case IEEE80211_IF_TYPE_MNTR: pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | (hal->ah_version == AR5K_AR5210 ?AR5K_STA_ID1_NO_PSPOLL :0); break; @@ -3020,7 +3020,7 @@ ath5k_hw_init_beacon(struct ath_hal *hal, u_int32_t next_beacon, * Set the additional timers by mode */ switch (hal->ah_op_mode) { - case AR5K_M_STA: + case IEEE80211_IF_TYPE_STA: if (hal->ah_version == AR5K_AR5210) { timer1 = 0xffffffff; timer2 = 0xffffffff; @@ -3912,7 +3912,7 @@ ath5k_hw_get_slot_time(struct ath_hal *hal) /* * Initialize the 2-word tx descriptor on 5210/5211 */ -AR5K_BOOL +static AR5K_BOOL ath5k_hw_setup_2word_tx_desc(struct ath_hal *hal, struct ath_desc *desc, u_int packet_length, u_int header_length, AR5K_PKT_TYPE type, u_int tx_power, u_int tx_rate0, u_int tx_tries0, u_int key_index, u_int antenna_mode, @@ -4129,7 +4129,7 @@ ath5k_hw_setup_xr_tx_desc(struct ath_hal *hal, struct ath_desc *desc, /* * Fill the 2-word tx descriptor on 5210/5211 */ -AR5K_BOOL +static AR5K_BOOL ath5k_hw_fill_2word_tx_desc(struct ath_hal *hal, struct ath_desc *desc, u_int segment_length, AR5K_BOOL first_segment, AR5K_BOOL last_segment, const struct ath_desc *last_desc) { @@ -4190,7 +4190,7 @@ ath5k_hw_fill_4word_tx_desc(struct ath_hal *hal, struct ath_desc *desc, /* * Proccess the tx status descriptor on 5210/5211 */ -AR5K_STATUS +static AR5K_STATUS ath5k_hw_proc_2word_tx_status(struct ath_hal *hal, struct ath_desc *desc) { struct ath5k_hw_tx_status *tx_status; @@ -4378,7 +4378,7 @@ ath5k_hw_setup_rx_desc(struct ath_hal *hal, struct ath_desc *desc, /* * Proccess the rx status descriptor on 5210/5211 */ -AR5K_STATUS +static AR5K_STATUS ath5k_hw_proc_old_rx_status(struct ath_hal *hal, struct ath_desc *desc, u_int32_t phys_addr, struct ath_desc *next) {