Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / build / magpie_1_1 / inc / vbuf_api.h
1 /*
2  * @File: VBUF_api.h
3  * 
4  * @Abstract: Host Interface api
5  * 
6  * @Notes:
7  * 
8  * Copyright (c) 2008 Atheros Communications Inc.
9  * All rights reserved.
10  *
11  */
12
13 #ifndef _VBUF_API_H
14 #define _VBUF_API_H
15
16 #include <vdesc_api.h>
17
18 #define MAX_BUF_CTX_LEN     20
19
20 typedef struct _VBUF
21 {
22     VDESC           *desc_list;
23     struct _VBUF    *next_buf; 
24     A_UINT16        buf_length; 
25     A_UINT8         reserved[2];
26     A_UINT8         ctx[MAX_BUF_CTX_LEN];  
27     //A_UINT8         end_point;    
28     //A_UINT8         reserved[1]; 
29 } VBUF;
30
31 #define VBUF_GET_DATA_ADDR(vbuf)    (vbuf->desc_list->buf_addr + vbuf->desc_list->data_offset)
32
33 /* hardware API table structure (API descriptions below) */
34 struct vbuf_api {
35     void (*_init)(int nBuf);
36     VBUF* (*_alloc_vbuf)(void);
37     VBUF* (*_alloc_vbuf_with_size)(int size, int reserve);
38     void (*_free_vbuf)(VBUF *buf);
39
40         /* room to expand this table by another table */
41     void *pReserved;    
42 };
43
44 extern void vbuf_module_install(struct vbuf_api *apis);
45
46 #endif /* #ifndef _HIF_API_H */