4 * @Abstract: Host Interface api
8 * Copyright (c) 2008 Atheros Communications Inc.
18 /* mailbox hw module configuration structure */
19 typedef struct _HIF_CONFIG {
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 */
32 typedef void* hif_handle_t;
34 /* hardware API table structure (API descriptions below) */
36 hif_handle_t (*_init)(HIF_CONFIG *pConfig);
38 void (* _shutdown)(hif_handle_t);
40 void (*_register_callback)(hif_handle_t, HIF_CALLBACK *);
42 int (*_get_total_credit_count)(hif_handle_t);
44 void (*_start)(hif_handle_t);
46 void (*_config_pipe)(hif_handle_t handle, int pipe, int creditCount);
48 int (*_send_buffer)(hif_handle_t handle, int pipe, adf_nbuf_t buf);
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);
56 int (*_get_max_msg_len)(hif_handle_t handle, int pipe);
58 int (*_get_reserved_headroom)(hif_handle_t handle);
60 void (*_isr_handler)(hif_handle_t handle);
62 void (*_get_default_pipe)(hif_handle_t handle, A_UINT8 *pipe_uplink, A_UINT8 *pipe_downlink);
64 /* room to expand this table by another table */
68 extern void generic_hif_module_install(struct hif_api *apis);
70 #endif /* #ifndef _HIF_API_H */