7c35fc601656941142c24570d49e5141d2017020
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / k2 / 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 } VBUF;
28
29 #define VBUF_GET_DATA_ADDR(vbuf)    (vbuf->desc_list->buf_addr + vbuf->desc_list->data_offset)
30
31 /* hardware API table structure (API descriptions below) */
32 struct vbuf_api {
33         void (*_init)(int nBuf);
34         VBUF* (*_alloc_vbuf)(void);
35         VBUF* (*_alloc_vbuf_with_size)(int size, int reserve);
36         void (*_free_vbuf)(VBUF *buf);
37
38         /* room to expand this table by another table */
39         void *pReserved;    
40 };
41
42 extern void vbuf_module_install(struct vbuf_api *apis);
43
44 #endif /* #ifndef _HIF_API_H */