Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / buf_pool / buf_pool_api.h
1 /*
2  * @File: buf_pool_api.h
3  * 
4  * @Abstract: BUF Pool api
5  * 
6  * @Notes:
7  * 
8  * Copyright (c) 2008 Atheros Communications Inc.
9  * All rights reserved.
10  *
11  */
12
13 #ifndef _BUF_POOL_API_H
14 #define _BUF_POOL_API_H
15
16 #include <adf_nbuf.h>
17
18 /* endpoint defines */
19 typedef enum
20 {
21     POOL_ID_HTC_CONTROL         = 0, 
22     POOL_ID_WMI_SVC_CMD_REPLY   = 1,  
23     POOL_ID_WMI_SVC_EVENT       = 2,
24     POOL_ID_WLAN_RX_BUF         = 3,
25     POOL_ID_MAX                 = 10 
26 } BUF_POOL_ID;
27
28 typedef void* pool_handle_t;
29
30 /* hardware API table structure (API descriptions below) */
31 struct buf_pool_api {
32     pool_handle_t (*_init)(adf_os_handle_t handle);
33             
34     void (*_shutdown)(pool_handle_t handle);
35     
36     void (*_create_pool)(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize);
37     
38     adf_nbuf_t  (*_alloc_buf)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve);
39     
40     adf_nbuf_t  (*_alloc_buf_align)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align);
41     
42     void (*_free_buf)(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf);
43     
44         /* room to expand this table by another table */
45     void *pReserved;    
46 };
47
48 extern void buf_pool_module_install(struct buf_pool_api *apis);
49
50 #endif /* #ifndef _BUF_POOL_API_H */