commit f3703cf522ed186e3ef5b1891d954c173d306a9d Author: Jiri Slaby Date: Sun Jun 17 11:48:00 2007 +0200 remove bus typedefs diff --git a/ath/if_ath.c b/ath/if_ath.c index eefbbed..0a76149 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -362,7 +362,7 @@ ath_attach(u_int16_t devid, struct net_device *dev) /* * Attach the hal */ - ah = _ath_hal_attach(devid, sc, 0, sc->sc_iobase, &status); + ah = _ath_hal_attach(devid, sc, sc->sc_iobase, &status); if (ah == NULL) { printk(KERN_ERR "%s: unable to attach hardware: '%s' (HAL status %u)\n", __func__, hal_status_desc[status], status); diff --git a/openhal/ah_osdep.c b/openhal/ah_osdep.c index 1b83167..d2a14be 100644 --- a/openhal/ah_osdep.c +++ b/openhal/ah_osdep.c @@ -15,13 +15,11 @@ static char dev_info[] = "ath_hal"; -struct ath_hal *_ath_hal_attach(u_int16_t devid, AR5K_SOFTC sc, - AR5K_BUS_TAG t, AR5K_BUS_HANDLE h, void *s) +struct ath_hal *_ath_hal_attach(u16 devid, void *sc, void __iomem *h, + AR5K_STATUS *s) { - AR5K_STATUS status; - struct ath_hal *ah = ath5k_hw_init(devid, sc, t, h, &status); + struct ath_hal *ah = ath5k_hw_init(devid, sc, h, s); - *(AR5K_STATUS *)s = status; if (ah && !try_module_get(THIS_MODULE)) { printk(KERN_WARNING "try_module_get failed\n"); kfree(ah); diff --git a/openhal/ah_osdep.h b/openhal/ah_osdep.h index 973bcb8..3b0661e 100644 --- a/openhal/ah_osdep.h +++ b/openhal/ah_osdep.h @@ -9,42 +9,9 @@ * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id$ */ -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -/*For radar functions*/ -//#include - -#include -#include -#include -#include - - -typedef void* AR5K_SOFTC; -typedef int AR5K_BUS_TAG; -typedef __iomem void* AR5K_BUS_HANDLE; -typedef u_int32_t AR5K_BUS_ADDR; -#define bus_space_tag_t AR5K_BUS_TAG -#define bus_space_handle_t AR5K_BUS_HANDLE #define AR5K_PRINTF(fmt, ...) printk("%s: " fmt, __func__, ##__VA_ARGS__) #define AR5K_PRINT(fmt) printk("%s: " fmt, __func__) diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 153a1fe..8f78f70 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -957,9 +957,6 @@ typedef enum ieee80211_countrycode AR5K_CTRY_CODE; #define AR5K_ELEMENTS(_array) (sizeof(_array) / sizeof(_array[0])) -typedef struct ath_hal * (ath5k_attach_t) - (u_int16_t, AR5K_SOFTC, AR5K_BUS_TAG, AR5K_BUS_HANDLE, AR5K_STATUS *); - typedef AR5K_BOOL (ath5k_rfgain_t) (struct ath_hal *, AR5K_CHANNEL *, u_int); @@ -1064,7 +1061,7 @@ typedef AR5K_BOOL (ath5k_rfgain_t) _t void (_a _n##_init_beacon)(struct ath_hal *, u_int32_t nexttbtt, u_int32_t intval); \ _t void (_a _n##_set_beacon_timers)(struct ath_hal *, const AR5K_BEACON_STATE *); \ _t void (_a _n##_reset_beacon)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_wait_for_beacon)(struct ath_hal *, AR5K_BUS_ADDR); \ + _t AR5K_BOOL (_a _n##_wait_for_beacon)(struct ath_hal *, unsigned long); \ /* Interrupt functions */ \ _t AR5K_BOOL (_a _n##_is_intr_pending)(struct ath_hal *); \ _t AR5K_BOOL (_a _n##_get_isr)(struct ath_hal *, u_int32_t *); \ @@ -1102,9 +1099,8 @@ struct ath_hal { u_int16_t ah_device; u_int16_t ah_sub_vendor; - AR5K_SOFTC ah_sc; - bus_space_tag_t ah_st; - bus_space_handle_t ah_sh; + void *ah_sc; + void __iomem *ah_sh; AR5K_CTRY_CODE ah_country_code; AR5K_INT ah_imr; @@ -1194,9 +1190,9 @@ struct ath_hal { * Prototypes */ -const char* ath_hal_probe(u_int16_t, u_int16_t); -struct ath_hal* ath5k_hw_init(u_int16_t device, AR5K_SOFTC sc, AR5K_BUS_TAG, - AR5K_BUS_HANDLE, AR5K_STATUS *); +const char *ath_hal_probe(u16, u16); +struct ath_hal *ath5k_hw_init(u16, void *, void __iomem *, + AR5K_STATUS *); u_int16_t ath_hal_computetxtime(struct ath_hal *, const AR5K_RATE_TABLE *, u_int32_t, u_int16_t, AR5K_BOOL); u_int ath_hal_mhz2ieee(u_int, u_int); @@ -1248,8 +1244,8 @@ AR5K_BOOL ath5k_hw_rfgain(struct ath_hal *, u_int, u_int); void ath5k_txpower_table(struct ath_hal *, AR5K_CHANNEL *, int16_t); /*added*/ -extern u_int ath_hal_getwirelessmodes(struct ath_hal*, AR5K_CTRY_CODE); +extern u_int ath_hal_getwirelessmodes(struct ath_hal *, AR5K_CTRY_CODE); void ath_hal_detach(struct ath_hal *ah); -struct ath_hal * _ath_hal_attach(u_int16_t devid, AR5K_SOFTC sc, AR5K_BUS_TAG t, - AR5K_BUS_HANDLE h, void* s); +struct ath_hal *_ath_hal_attach(u16 devid, void *sc, void __iomem *h, + AR5K_STATUS *s); #endif /* _AR5K_H */ diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index ee9ba92..fb59cd3 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -22,6 +22,8 @@ * (Please have a look at ar5xxx.h for further information) */ +#include + #include "ah_devid.h" #include "ath5k.h" #include "ath5kreg.h" @@ -354,8 +356,7 @@ ath5k_hw_register_timeout(struct ath_hal *hal, u_int32_t reg, u_int32_t flag, * Check if the device is supported and initialize the needed structs */ struct ath_hal * -ath5k_hw_init(u_int16_t device, AR5K_SOFTC sc, AR5K_BUS_TAG st, - AR5K_BUS_HANDLE sh, AR5K_STATUS *status) +ath5k_hw_init(u16 device, void *sc, void __iomem *sh, AR5K_STATUS *status) { struct ath_hal *hal = NULL; u_int8_t mac[ETH_ALEN]; @@ -392,7 +393,6 @@ ath5k_hw_init(u_int16_t device, AR5K_SOFTC sc, AR5K_BUS_TAG st, memset(hal, 0, sizeof(struct ath_hal)); hal->ah_sc = sc; - hal->ah_st = st; hal->ah_sh = sh; hal->ah_device = device; hal->ah_sub_vendor = 0; /* XXX unknown?! */ @@ -3206,7 +3206,7 @@ ath5k_hw_reset_beacon(struct ath_hal *hal) * TODO: This function's name is misleading, rename */ AR5K_BOOL -ath5k_hw_wait_for_beacon(struct ath_hal *hal, AR5K_BUS_ADDR phys_addr) +ath5k_hw_wait_for_beacon(struct ath_hal *hal, unsigned long phys_addr) { AR5K_BOOL ret; int i; @@ -3228,7 +3228,7 @@ ath5k_hw_wait_for_beacon(struct ath_hal *hal, AR5K_BUS_ADDR phys_addr) /* * Re-schedule the beacon queue */ - AR5K_REG_WRITE(AR5K_NOQCU_TXDP1, (u_int32_t)phys_addr); + AR5K_REG_WRITE(AR5K_NOQCU_TXDP1, phys_addr); AR5K_REG_WRITE(AR5K_BCR, AR5K_BCR_TQ1V | AR5K_BCR_BDMAE); return (FALSE);