33dde31b03f3faa1fd2d7dbe1cedfdf969111b3a
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / build / magpie_1_1 / inc / hif_api.h
1 /*
2  * @File: HIF_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 _HIF_API_H
14 #define _HIF_API_H
15
16 #include <adf_nbuf.h>
17
18 /* mailbox hw module configuration structure */
19 typedef struct _HIF_CONFIG {
20     int dummy;
21 } HIF_CONFIG;
22
23 typedef struct _HIF_CALLBACK {
24     /* callback when a buffer has be sent to the host*/
25     void (*send_buf_done)(adf_nbuf_t buf, void *context);
26     /* callback when a receive message is received */
27     void (*recv_buf)(adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *context);
28     /* context used for all callbacks */
29     void *context;
30 } HIF_CALLBACK;
31
32 typedef void* hif_handle_t;
33
34 /* hardware API table structure (API descriptions below) */
35 struct hif_api {
36     hif_handle_t (*_init)(HIF_CONFIG *pConfig);
37             
38     void (* _shutdown)(hif_handle_t);
39     
40     void (*_register_callback)(hif_handle_t, HIF_CALLBACK *);
41     
42     int  (*_get_total_credit_count)(hif_handle_t);
43     
44     void (*_start)(hif_handle_t);
45
46     void (*_config_pipe)(hif_handle_t handle, int pipe, int creditCount);
47     
48     int  (*_send_buffer)(hif_handle_t handle, int pipe, adf_nbuf_t buf);
49
50     void (*_return_recv_buf)(hif_handle_t handle, int pipe, adf_nbuf_t buf);                                 
51     //void (*_set_recv_bufsz)(int pipe, int bufsz);
52     //void (*_pause_recv)(int pipe);
53     //void (*_resume_recv)(int pipe);
54     int  (*_is_pipe_supported)(hif_handle_t handle, int pipe);
55     
56     int  (*_get_max_msg_len)(hif_handle_t handle, int pipe);
57     
58     int  (*_get_reserved_headroom)(hif_handle_t handle);
59     
60     void (*_isr_handler)(hif_handle_t handle);
61     
62     void (*_get_default_pipe)(hif_handle_t handle, A_UINT8 *pipe_uplink, A_UINT8 *pipe_downlink);
63     
64         /* room to expand this table by another table */
65     void *pReserved;
66 };
67
68 extern void generic_hif_module_install(struct hif_api *apis);
69
70 #endif /* #ifndef _HIF_API_H */