09219f9c7abaf060116b0daff121b9a103123345
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / k2 / vdesc_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 _VDESC_API_H
14 #define _VDESC_API_H
15
16 #define MAX_HW_DESC_SIZE 20
17
18 typedef struct _VDESC
19 {
20         struct _VDESC   *next_desc;
21         A_UINT8         *buf_addr;
22         A_UINT16        buf_size;
23         A_UINT16        data_offset;
24         A_UINT16        data_size;
25         A_UINT16        control;
26         A_UINT8         hw_desc_buf[MAX_HW_DESC_SIZE]; 
27 } VDESC;
28
29 #define VDESC_HW_TO_VDESC(hwdesc)   ((VDESC *)(((A_UINT32 *)hwdesc - 4)))
30
31 struct vdesc_api {
32         void        (*_init)(int nDesc);
33         VDESC*      (*_alloc_vdesc)();
34         A_UINT8*    (*_get_hw_desc)(VDESC *desc);
35         void        (*_swap_vdesc)(VDESC *dest, VDESC *src);
36
37         /* room to expand this table by another table */
38         void *pReserved;    
39 };
40
41 extern void vdesc_module_install(struct vdesc_api *apis);
42
43 #endif