Mark files without an existing BSD licence as having a QCA ClearBSD
[open-ath9k-htc-firmware.git] / target_firmware / wlan / ah.h
1 /*
2  * Copyright (c) 2013 Qualcomm Atheros, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted (subject to the limitations in the
7  * disclaimer below) provided that the following conditions are met:
8  *
9  *  * Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  *  * Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the
15  *    distribution.
16  *
17  *  * Neither the name of Qualcomm Atheros nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22  * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35
36 #ifndef _ATH_AH_H_
37 #define _ATH_AH_H_
38
39 #include <ah_osdep.h>
40 #include <ah_desc.h>
41
42 #ifndef __ahdecl
43 #define __ahdecl
44 #endif
45
46 #define AR5416_DEVID_PCIE   0x0024  /* AR5416 PCI-E (XB) (Owl) */
47
48 typedef enum {
49         HAL_OK           = 0,    /* No error */
50         HAL_ENXIO        = 1,    /* No hardware present */
51         HAL_ENOMEM       = 2,    /* Memory allocation failed */
52         HAL_EIO          = 3,    /* Hardware didn't respond as expected */
53         HAL_EEMAGIC      = 4,    /* EEPROM magic number invalid */
54         HAL_EEVERSION    = 5,    /* EEPROM version invalid */
55         HAL_EELOCKED     = 6,    /* EEPROM unreadable */
56         HAL_EEBADSUM     = 7,    /* EEPROM checksum invalid */
57         HAL_EEREAD       = 8,    /* EEPROM read problem */
58         HAL_EEBADMAC     = 9,    /* EEPROM mac address invalid */
59         HAL_EESIZE       = 10,   /* EEPROM size not supported */
60         HAL_EEWRITE      = 11,   /* Attempt to change write-locked EEPROM */
61         HAL_EINVAL       = 12,   /* Invalid parameter to function */
62         HAL_ENOTSUPP     = 13,   /* Hardware revision not supported */
63         HAL_ESELFTEST    = 14,   /* Hardware self-test failed */
64         HAL_EINPROGRESS  = 15,   /* Operation incomplete */
65         HAL_FULL_RESET   = 16,   /* Full reset done */
66 } HAL_STATUS;
67
68 typedef enum {
69         AH_FALSE = 0,
70         AH_TRUE  = 1,
71 } HAL_BOOL;
72
73 typedef enum {
74         HAL_CAP_VEOL        = 0,
75         HAL_CAP_BSSIDMASK   = 1,
76         HAL_CAP_TSF_ADJUST  = 2,
77         HAL_CAP_RX_STBC     = 3,
78         HAL_CAP_TX_STBC     = 4,
79         HAL_CAP_HT          = 5,
80         HAL_CAP_RTS_AGGR_LIMIT = 6,
81 } HAL_CAPABILITY_TYPE;
82
83 typedef enum {
84         HAL_M_STA       = 1,
85         HAL_M_IBSS      = 0,
86         HAL_M_HOSTAP    = 6,
87         HAL_M_MONITOR   = 8,
88 } HAL_OPMODE;
89
90 typedef enum {
91         HAL_TX_QUEUE_INACTIVE   = 0,
92         HAL_TX_QUEUE_DATA   = 1,
93         HAL_TX_QUEUE_BEACON = 2,
94         HAL_TX_QUEUE_CAB    = 3,
95         HAL_TX_QUEUE_PSPOLL = 4,
96         HAL_TX_QUEUE_UAPSD  = 5,
97 } HAL_TX_QUEUE;
98
99 typedef enum {
100         HAL_WME_AC_BK   = 0,
101         HAL_WME_AC_BE   = 1,
102         HAL_WME_AC_VI   = 2,
103         HAL_WME_AC_VO   = 3,
104         HAL_WME_UPSD    = 4,
105         HAL_XR_DATA     = 5,
106 } HAL_TX_QUEUE_SUBTYPE;
107
108 #define HAL_NUM_TX_QUEUES  10
109
110 typedef enum {
111         HAL_PKT_TYPE_NORMAL = 0,
112         HAL_PKT_TYPE_ATIM   = 1,
113         HAL_PKT_TYPE_PSPOLL = 2,
114         HAL_PKT_TYPE_BEACON = 3,
115         HAL_PKT_TYPE_PROBE_RESP = 4,
116         HAL_PKT_TYPE_CHIRP  = 5,
117         HAL_PKT_TYPE_GRP_POLL = 6,
118 } HAL_PKT_TYPE;
119
120 typedef enum {
121         HAL_RX_CLEAR_CTL_LOW    = 0x1,    /* force control channel to appear busy */
122         HAL_RX_CLEAR_EXT_LOW    = 0x2,    /* force extension channel to appear busy */
123 } HAL_HT_RXCLEAR;
124
125 typedef enum {
126         HAL_RX_FILTER_UCAST     = 0x00000001,   /* Allow unicast frames */
127         HAL_RX_FILTER_MCAST     = 0x00000002,   /* Allow multicast frames */
128         HAL_RX_FILTER_BCAST     = 0x00000004,   /* Allow broadcast frames */
129         HAL_RX_FILTER_CONTROL   = 0x00000008,   /* Allow control frames */
130         HAL_RX_FILTER_BEACON    = 0x00000010,   /* Allow beacon frames */
131         HAL_RX_FILTER_PROM      = 0x00000020,   /* Promiscuous mode */
132         HAL_RX_FILTER_XRPOLL    = 0x00000040,   /* Allow XR poll frmae */
133         HAL_RX_FILTER_PROBEREQ  = 0x00000080,   /* Allow probe request frames */
134         HAL_RX_FILTER_PHYERR    = 0x00000100,   /* Allow phy errors */
135 #ifdef MAGPIE_MERLIN
136         HAL_RX_FILTER_PHYRADAR  =  0x00002000, /* Allow phy radar errors*/
137         HAL_RX_FILTER_PSPOLL    = 0x00004000,   /* Allow PSPOLL frames */
138         /*
139         ** PHY "Pseudo bits" should be in the upper 16 bits since the lower
140         ** 16 bits actually correspond to register 0x803c bits
141         */
142 #else
143         HAL_RX_FILTER_PHYRADAR  = 0x00000200,   /* Allow phy radar errors*/
144 #endif
145 } HAL_RX_FILTER;
146
147 #define CHANNEL_QUARTER 0x8000  /* Quarter rate channel */
148 #define CHANNEL_HALF    0x4000  /* Half rate channel */
149
150 typedef enum {
151         HAL_INT_RX      = 0x00000001,   /* Non-common mapping */
152         HAL_INT_RXDESC  = 0x00000002,
153         HAL_INT_RXNOFRM = 0x00000008,
154         HAL_INT_RXEOL   = 0x00000010,
155         HAL_INT_RXORN   = 0x00000020,
156         HAL_INT_TX      = 0x00000040,   /* Non-common mapping */
157         HAL_INT_TXDESC  = 0x00000080,
158         HAL_INT_TXURN   = 0x00000800,
159         HAL_INT_MIB     = 0x00001000,
160         HAL_INT_RXPHY   = 0x00004000,
161         HAL_INT_RXKCM   = 0x00008000,
162         HAL_INT_SWBA    = 0x00010000,
163         HAL_INT_BMISS   = 0x00040000,
164         HAL_INT_BNR     = 0x00100000,   /* Non-common mapping */
165         HAL_INT_GPIO    = 0x01000000,
166         HAL_INT_CST     = 0x02000000,   /* Non-common mapping */
167         HAL_INT_GTT     = 0x20000000,   /* Non-common mapping */
168         HAL_INT_FATAL   = 0x40000000,   /* Non-common mapping */
169         HAL_INT_GLOBAL  = 0x80000000,   /* Set/clear IER */
170         HAL_INT_GENTIMER =0x08000000,   /* Non-common mapping */
171
172         /* Interrupt bits that map directly to ISR/IMR bits */
173         HAL_INT_COMMON  = HAL_INT_RXNOFRM
174         | HAL_INT_RXDESC
175         | HAL_INT_RXEOL
176         | HAL_INT_RXORN
177         | HAL_INT_TXURN
178         | HAL_INT_TXDESC
179         | HAL_INT_MIB
180         | HAL_INT_RXPHY
181         | HAL_INT_RXKCM
182         | HAL_INT_SWBA
183         | HAL_INT_BMISS
184         | HAL_INT_GPIO,
185         HAL_INT_NOCARD  = 0xffffffff    /* To signal the card was removed */
186 } HAL_INT;
187
188 #ifdef MAGPIE_MERLIN
189
190 #define HAL_RATESERIES_RTS_CTS    0x0001  /* use rts/cts w/this series */
191 #define HAL_RATESERIES_2040       0x0002  /* use ext channel for series */
192 #define HAL_RATESERIES_HALFGI     0x0004  /* use half-gi for series */
193 #define HAL_RATESERIES_STBC       0x0008  /* use STBC for series */
194
195 /* 11n */
196 typedef enum {
197         HAL_HT_MACMODE_20   = 0,        /* 20 MHz operation */
198         HAL_HT_MACMODE_2040 = 1,        /* 20/40 MHz operation */
199 } HAL_HT_MACMODE;
200
201 typedef enum {
202         HAL_HT_PHYMODE_20   = 0,        /* 20 MHz operation */
203         HAL_HT_PHYMODE_2040 = 1,        /* 20/40 MHz operation */
204 } HAL_HT_PHYMODE;
205
206 typedef enum {
207         HAL_HT_EXTPROTSPACING_20 = 0,       /* 20 MHz spacing */
208         HAL_HT_EXTPROTSPACING_25 = 1,       /* 25 MHz spacing */
209 } HAL_HT_EXTPROTSPACING;
210
211 typedef struct {
212         HAL_HT_MACMODE          ht_macmode;     /* MAC - 20/40 mode */
213         HAL_HT_PHYMODE          ht_phymode;     /* PHY - 20/40 mode */
214         a_int8_t                ht_extoff;      /* ext channel offset */
215         HAL_HT_EXTPROTSPACING   ht_extprotspacing;  /* ext channel protection spacing */
216 } HAL_HT_CWM;
217
218 typedef struct {
219         a_uint8_t ht_txchainmask; /* tx chain mask    */
220         a_uint8_t ht_rxchainmask; /* rx chain mask    */
221 } HAL_HT_MISC;
222
223 typedef struct {
224         HAL_HT_CWM  cwm;
225         HAL_HT_MISC misc;
226 } HAL_HT;
227
228 /* channelFlags */
229 #define CHANNEL_CW_INT  0x0002  /* CW interference detected on channel */
230 #define CHANNEL_TURBO   0x0010  /* Turbo Channel */
231 #define CHANNEL_CCK     0x0020  /* CCK channel */
232 #define CHANNEL_OFDM    0x0040  /* OFDM channel */
233 #define CHANNEL_2GHZ    0x0080  /* 2 GHz spectrum channel. */
234 #define CHANNEL_5GHZ    0x0100  /* 5 GHz spectrum channel */
235 #define CHANNEL_PASSIVE 0x0200  /* Only passive scan allowed in the channel */
236 #define CHANNEL_DYN     0x0400  /* dynamic CCK-OFDM channel */
237 #define CHANNEL_XR      0x0800  /* XR channel */
238 #define CHANNEL_STURBO  0x2000  /* Static turbo, no 11a-only usage */
239 #define CHANNEL_HALF    0x4000  /* Half rate channel */
240 #define CHANNEL_QUARTER 0x8000  /* Quarter rate channel */
241 #define CHANNEL_HT20    0x10000 /* HT20 channel */
242 #define CHANNEL_HT40    0x20000 /* HT40 channel */
243 #define CHANNEL_HT40U   0x40000 /* control channel can be upper channel */
244 #define CHANNEL_HT40L   0x80000 /* control channel can be lower channel */
245
246 /* privFlags */
247 #define CHANNEL_INTERFERENCE    0x01
248 #define CHANNEL_DFS             0x02 /* DFS required on channel */
249 #define CHANNEL_4MS_LIMIT       0x04 /* 4msec packet limit on this channel */
250 #define CHANNEL_DFS_CLEAR       0x08 /* if channel has been checked for DFS */
251
252 #define CHANNEL_A       (CHANNEL_5GHZ|CHANNEL_OFDM)
253 #define CHANNEL_B       (CHANNEL_2GHZ|CHANNEL_CCK)
254 #define CHANNEL_PUREG   (CHANNEL_2GHZ|CHANNEL_OFDM)
255 #define CHANNEL_G       (CHANNEL_2GHZ|CHANNEL_OFDM)
256 #define CHANNEL_T       (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
257 #define CHANNEL_ST      (CHANNEL_T|CHANNEL_STURBO)
258 #define CHANNEL_108G    (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
259 #define CHANNEL_108A    CHANNEL_T
260 #define CHANNEL_X       (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR)
261
262 #define CHANNEL_G_HT20  (CHANNEL_2GHZ|CHANNEL_HT20)
263 #define CHANNEL_A_HT20  (CHANNEL_5GHZ|CHANNEL_HT20)
264 #define CHANNEL_G_HT40  (CHANNEL_2GHZ|CHANNEL_HT20|CHANNEL_HT40)
265 #define CHANNEL_A_HT40  (CHANNEL_5GHZ|CHANNEL_HT20|CHANNEL_HT40)
266 #define CHANNEL_ALL                             \
267         (CHANNEL_OFDM |                         \
268          CHANNEL_CCK |                          \
269          CHANNEL_2GHZ |                         \
270          CHANNEL_5GHZ |                         \
271          CHANNEL_TURBO |                        \
272          CHANNEL_HT20 |                         \
273          CHANNEL_HT40)
274 #define CHANNEL_ALL_NOTURBO     (CHANNEL_ALL &~ CHANNEL_TURBO)
275
276 typedef struct {
277         a_int32_t    rateCount;
278         a_uint8_t    rateCodeToIndex[32];
279         struct {
280                 a_uint8_t    valid;
281                 a_uint8_t    phy;
282                 a_int16_t    txPower;
283                 a_int16_t    txPower2Chains;
284                 a_int16_t    txPower3Chains;
285                 a_uint32_t   rateKbps;
286                 a_uint8_t    rateCode;
287                 a_uint8_t    shortPreamble;
288                 a_uint8_t    dot11Rate;
289                 a_uint8_t    controlRate;
290                 a_uint16_t   lpAckDuration;
291                 a_uint16_t   spAckDuration;
292         } info[32];
293 } HAL_RATE_TABLE;
294
295 typedef struct {
296         a_uint32_t   Tries;
297         a_uint32_t   Rate;
298         a_uint32_t   PktDuration;
299         a_uint32_t   ChSel;
300         a_uint32_t   RateFlags;
301         a_uint32_t   RateIndex;
302         a_uint32_t   TxPowerCap;     /* in 1/2 dBm units */
303 } HAL_11N_RATE_SERIES;
304
305 #else
306
307 typedef struct {
308         a_int32_t    rateCount;
309         a_uint8_t    rateCodeToIndex[32];
310         struct {
311                 a_uint8_t    valid;
312                 a_uint8_t    phy;
313                 a_uint32_t   rateKbps;
314                 a_uint8_t    rateCode;
315                 a_uint8_t    shortPreamble;
316                 a_uint8_t    dot11Rate;
317                 a_uint8_t    controlRate;
318                 a_uint16_t   lpAckDuration;
319                 a_uint16_t   spAckDuration;
320         } info[32];
321 } HAL_RATE_TABLE;
322
323 #define HAL_RATESERIES_RTS_CTS    0x0001  /* use rts/cts w/this series */
324 #define HAL_RATESERIES_2040       0x0002  /* use ext channel for series */
325 #define HAL_RATESERIES_HALFGI     0x0004  /* use half-gi for series */
326 #define HAL_RATESERIES_STBC       0x0008  /* use STBC for series */
327
328 typedef struct {
329         a_uint32_t   Tries;
330         a_uint32_t   Rate;
331         a_uint32_t   PktDuration;
332         a_uint32_t   ChSel;
333         a_uint32_t   RateFlags;
334 } HAL_11N_RATE_SERIES;
335
336 #endif
337
338 enum {
339         HAL_MODE_11A    = 0x001,        /* 11a channels */
340         HAL_MODE_TURBO  = 0x002,        /* 11a turbo-only channels */
341         HAL_MODE_11B    = 0x004,        /* 11b channels */
342         HAL_MODE_PUREG  = 0x008,        /* 11g channels (OFDM only) */
343         HAL_MODE_11G    = 0x008,        /* XXX historical */
344         HAL_MODE_108G   = 0x020,        /* 11a+Turbo channels */
345         HAL_MODE_108A   = 0x040,        /* 11g+Turbo channels */
346         HAL_MODE_XR     = 0x100,        /* XR channels */
347         HAL_MODE_11A_HALF_RATE = 0x200,     /* 11A half rate channels */
348         HAL_MODE_11A_QUARTER_RATE = 0x400,  /* 11A quarter rate channels */
349         HAL_MODE_11NG   = 0x4000,           /* 11ng channels */
350         HAL_MODE_11NA   = 0x8000,           /* 11na channels */
351         HAL_MODE_ALL    = 0xffff
352 };
353
354 typedef enum {
355         HAL_KEY_TYPE_CLEAR,
356         HAL_KEY_TYPE_WEP,
357         HAL_KEY_TYPE_AES,
358         HAL_KEY_TYPE_TKIP,
359         HAL_KEY_TYPE_WAPI,
360 } HAL_KEY_TYPE;
361
362 struct ath_desc;
363 struct ath_rx_status;
364
365 struct ath_hal
366 {
367         a_uint32_t ah_magic;
368         HAL_SOFTC ah_sc;
369         HAL_BUS_HANDLE ah_sh;
370         adf_os_device_t ah_dev;
371            
372         a_uint32_t ah_macVersion;
373         a_uint16_t ah_macRev;
374         a_uint16_t ah_phyRev;
375         const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *,
376                                                          a_uint32_t mode);
377         void      __ahdecl(*ah_detach)(struct ath_hal*);
378         HAL_BOOL  __ahdecl(*ah_updateTxTrigLevel)(struct ath_hal*,
379                                                   HAL_BOOL incTrigLevel);
380            
381         /* Misc Functions */
382         HAL_STATUS __ahdecl(*ah_getCapability)(struct ath_hal *,
383                                                HAL_CAPABILITY_TYPE, a_uint32_t capability,
384                                                a_uint32_t *result);
385         void      __ahdecl(*ah_setDefAntenna)(struct ath_hal*, a_uint32_t);     
386            
387         HAL_BOOL  __ahdecl(*ah_updateCTSForBursting)(struct ath_hal *,
388                                                      struct ath_desc *, struct ath_desc *,
389                                                      struct ath_desc *, struct ath_desc *,
390                                                      a_uint32_t, a_uint32_t);
391         void      __ahdecl(*ah_setRxFilter)(struct ath_hal*, a_uint32_t);
392            
393                       
394         /* Target Transmit Functions */
395            
396         a_uint32_t __ahdecl(*ah_getTxDP)(struct ath_hal*, a_uint32_t);
397         HAL_BOOL  __ahdecl(*ah_setTxDP)(struct ath_hal*, a_uint32_t, a_uint32_t txdp);
398         a_uint32_t __ahdecl(*ah_numTxPending)(struct ath_hal *, a_uint32_t q);           
399         HAL_BOOL  __ahdecl(*ah_startTxDma)(struct ath_hal*, a_uint32_t);
400         HAL_BOOL  __ahdecl(*ah_stopTxDma)(struct ath_hal*, a_uint32_t);
401            
402         HAL_BOOL  __ahdecl(*ah_abortTxDma)(struct ath_hal *);
403            
404         void      __ahdecl(*ah_set11nTxDesc)(struct ath_hal *ah,
405                                              struct ath_desc *ds,
406                                              a_uint32_t pktLen, HAL_PKT_TYPE type,
407                                              a_uint32_t txPower, a_uint32_t keyIx,
408                                              HAL_KEY_TYPE keyType,
409                                              a_uint32_t flags);
410         void      __ahdecl(*ah_set11nRateScenario)(struct ath_hal *ah,
411                                                    struct ath_desc *ds,
412                                                    a_uint32_t durUpdateEn,
413                                                    a_uint32_t rtsctsRate,
414                                                    a_uint32_t rtsctsDuration,
415                                                    HAL_11N_RATE_SERIES series[],
416                                                    a_uint32_t nseries, a_uint32_t flags);
417         void      __ahdecl(*ah_set11nAggrFirst)(struct ath_hal *ah,
418                                                 struct ath_desc *ds, a_uint32_t aggrLen,
419                                                 a_uint32_t numDelims);
420         void      __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *ah,
421                                                  struct ath_desc *ds, a_uint32_t numDelims);
422         void      __ahdecl(*ah_set11nAggrLast)(struct ath_hal *ah,
423                                                struct ath_desc *ds);
424         void      __ahdecl(*ah_clr11nAggr)(struct ath_hal *ah,
425                                            struct ath_desc *ds);
426         void      __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *ah,
427                                                     struct ath_desc *ds,
428                                                     a_uint32_t burstDuration);
429         void      __ahdecl(*ah_set11nVirtualMoreFrag)(struct ath_hal *ah,
430                                                       struct ath_desc *ds, a_uint32_t vmf);
431            
432         HAL_BOOL  __ahdecl(*ah_setupTxDesc)(struct ath_hal *, struct ath_desc *,
433                                             a_uint32_t pktLen, a_uint32_t hdrLen,
434                                             HAL_PKT_TYPE type, a_uint32_t txPower,
435                                             a_uint32_t txRate0, a_uint32_t txTries0,
436                                             a_uint32_t keyIx, a_uint32_t antMode, a_uint32_t flags,
437                                             a_uint32_t rtsctsRate, a_uint32_t rtsctsDuration,
438                                             a_uint32_t compicvLen, a_uint32_t compivLen,
439                                             a_uint32_t comp);
440         HAL_BOOL  __ahdecl(*ah_fillTxDesc)(struct ath_hal *, struct ath_desc *,
441                                            a_uint32_t segLen, HAL_BOOL firstSeg,
442                                            HAL_BOOL lastSeg, const struct ath_desc *);
443         HAL_BOOL  __ahdecl (*ah_fillKeyTxDesc) (struct ath_hal *, struct ath_desc *, HAL_KEY_TYPE);
444         HAL_STATUS __ahdecl(*ah_procTxDesc)(struct ath_hal *, struct ath_desc*);
445         void            __ahdecl(*ah_getTxIntrQueue)(struct ath_hal *, a_uint32_t *);
446         void       __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*);    
447         HAL_BOOL  __ahdecl(*ah_setBssIdMask)(struct ath_hal *, const a_uint8_t*);
448         void      __ahdecl(*ah_setPCUConfig)(struct ath_hal *);
449         void      __ahdecl(*ah_setMulticastFilter)(struct ath_hal*,
450                                                    a_uint32_t filter0, a_uint32_t filter1);
451            
452         a_uint32_t __ahdecl(*ah_getTsf32)(struct ath_hal*);
453         u_int64_t __ahdecl(*ah_getTsf64)(struct ath_hal*);
454         void      __ahdecl(*ah_resetTsf)(struct ath_hal*);
455            
456         /* Target receive Functions */
457         a_uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*);
458         void       __ahdecl(*ah_setRxDP)(struct ath_hal*, a_uint32_t rxdp);
459         HAL_BOOL  __ahdecl(*ah_setupRxDesc)(struct ath_hal *, struct ath_desc *,
460                                             a_uint32_t size, a_uint32_t flags);
461         HAL_STATUS __ahdecl(*ah_procRxDesc)(struct ath_hal *, struct ath_desc *,
462                                             a_uint32_t phyAddr, struct ath_desc *next, u_int64_t tsf);
463         HAL_STATUS __ahdecl(*ah_procRxDescFast)(struct ath_hal *ah, 
464                                                 struct ath_desc *ds, a_uint32_t pa, 
465                                                 struct ath_desc *nds, 
466                                                 struct ath_rx_status *rx_stats);
467         HAL_BOOL  __ahdecl(*ah_stopDmaReceive)(struct ath_hal*);
468         void      __ahdecl(*ah_startPcuReceive)(struct ath_hal*);
469         void      __ahdecl(*ah_stopPcuReceive)(struct ath_hal*);
470         void      __ahdecl(*ah_enableReceive)(struct ath_hal*);
471            
472         /* Interrupt functions */
473         HAL_BOOL  __ahdecl(*ah_isInterruptPending)(struct ath_hal*);
474         HAL_BOOL  __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*);
475         HAL_INT   __ahdecl(*ah_getInterrupts)(struct ath_hal*);
476         HAL_INT   __ahdecl(*ah_setInterrupts)(struct ath_hal*, HAL_INT);
477 };
478
479
480 extern struct ath_hal * __ahdecl ath_hal_attach_tgt(a_uint32_t devid, HAL_SOFTC,
481                                                     adf_os_device_t dev, HAL_BUS_HANDLE sh,
482                                                     a_uint32_t flags, HAL_STATUS* status);
483
484 extern const HAL_RATE_TABLE * __ahdecl ath_hal_getratetable(struct ath_hal *,
485                                                             a_uint32_t mode);
486
487 extern a_uint16_t __ahdecl ath_hal_computetxtime(struct ath_hal *,
488                                                  const HAL_RATE_TABLE *rates,
489                                                  a_uint32_t frameLen,
490                                                  a_uint16_t rateix,
491                                                  HAL_BOOL shortPreamble);
492 #endif /* _ATH_AH_H_ */