2 #include <adf_os_types.h>
3 #include <adf_os_dma.h>
4 #include <adf_os_timer.h>
5 #include <adf_os_lock.h>
7 #include <adf_os_mem.h>
8 #include <adf_os_module.h>
9 #include <adf_os_pci.h>
10 #include <adf_os_util.h>
11 #include <adf_os_stdtypes.h>
12 #include <adf_os_defer.h>
13 #include <adf_os_atomic.h>
16 #include <adf_net_types.h>
19 #include<ah_internal.h>
23 ath_hal_getuptime(struct ath_hal *ah)
25 return adf_os_getuptime();
29 _ath_hal_attach_tgt(a_uint32_t devid, HAL_SOFTC sc,
30 adf_os_device_t dev,HAL_BUS_HANDLE sh, a_uint32_t flags, void* s)
33 struct ath_hal *ah = ath_hal_attach_tgt(devid,sc,dev,sh, flags, &status);
34 adf_os_print(" ath_hal = %p \n",ah);
35 *(HAL_STATUS *)s = status;
40 ath_hal_detach(struct ath_hal *ah)
45 extern void *global_hdl;
48 * Memory-mapped device register read/write. These are here
49 * as routines when debugging support is enabled and/or when
50 * explicitly configured to use function calls. The latter is
51 * for architectures that might need to do something before
52 * referencing memory (e.g. remap an i/o window).
54 * NB: see the comments in ah_osdep.h about byte-swapping register
55 * reads and writes to understand what's going on below.
58 ath_hal_reg_write_target(struct ath_hal *ah, a_uint32_t reg, a_uint32_t val)
60 adf_os_reg_write32(ah->ah_dev, reg, val);
64 ath_hal_reg_read_target(struct ath_hal *ah, a_uint32_t reg)
68 val = adf_os_reg_read32(ah->ah_dev, reg);
74 * Delay n microseconds.
77 ath_hal_delay(a_int32_t n)
83 * Allocate/free memory.
86 ath_hal_malloc(adf_os_size_t size)
90 p = adf_os_mem_alloc(size);
92 adf_os_mem_zero(p, size);
104 ath_hal_memzero(void *dst, adf_os_size_t n)
106 adf_os_mem_set(dst, 0, n);
110 ath_hal_memcpy(void *dst, void *src, adf_os_size_t n)
112 adf_os_mem_copy(dst, src, n);
117 * Print/log message support.
120 ath_hal_vprintf(struct ath_hal *ah, const char* fmt, va_list ap)
125 DEV_ATH = 9, /* XXX must match driver */
128 adf_os_module_dep(hal, adf_net);
129 adf_os_module_dep(hal, hal);
130 adf_os_virt_module_name(hal);