Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / adf_net_sw.h
1 /**
2  * @ingroup adf_net_public
3  * @file adf_net_sw.h
4  * This file defines the device and virtual device switch tables.
5  */ 
6
7 #ifndef __ADF_NET_SW_H
8 #define __ADF_NET_SW_H
9
10
11 /**
12  * @brief per device switch structure
13  */
14 typedef struct _adf_dev_sw{
15     /**
16      * @brief Handler for device open - mandatory interface
17      */
18     a_status_t        (*drv_open)      (adf_drv_handle_t hdl); 
19     /**
20      * @brief Handler for device close - mandatory interface
21      */
22     void              (*drv_close)     (adf_drv_handle_t hdl);
23     /**
24      * @brief Handler for transmit - mandatory interface
25      */
26     a_status_t        (*drv_tx)        (adf_drv_handle_t hdl, adf_nbuf_t pkt);
27     /**
28      * @brief Handler for configuration command - mandatory interface
29      */
30     a_status_t        (*drv_cmd)       (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
31                                         adf_net_cmd_data_t *data);
32     /**
33      * @brief Handler for ioctl - mandatory interface
34      */
35     a_status_t        (*drv_ioctl)     (adf_drv_handle_t hdl, int num, 
36                                         void *data);
37     /**
38      * @brief Handler for transmission timeout - mandatory interface
39      */
40     a_status_t        (*drv_tx_timeout)(adf_drv_handle_t hdl);
41     /**
42      * @brief Handler for wireless configuration - optional interface
43      */
44     a_status_t  (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
45                                            adf_net_wcmd_data_t *data);
46     /** 
47      * @brief Handler for polling if polling/deferred processing required - 
48      * optional interface
49      */
50     adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota, 
51                                      int *work_done);
52     /**
53      * @brief Handler for per cpu deffered callback (e.g. for RSS) - optional
54      * interface
55      */
56     adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota, 
57                                          int *work_done, void *arg);
58     /**
59      * @brief Handler for disabling receive interrupts for polling.
60      * adf_drv should do proper locking - these are not called in atomic context
61      */
62     void (*drv_poll_int_disable)(adf_drv_handle_t hdl);
63     /**
64      * @brief Handler for enabling receive interrupts for polling.
65      * adf_drv should do proper locking - these are not called in atomic context
66      */
67     void (*drv_poll_int_enable) (adf_drv_handle_t hdl);
68
69 }adf_dev_sw_t;
70
71 /**
72  * @brief Virtual device switch structure
73  */
74 typedef struct _adf_vdev_sw{
75     /**
76      * @brief Handler for device open
77      */
78     a_status_t  (*drv_open)     (adf_drv_handle_t hdl);
79     /**
80      * @brief Handler for device close
81      */
82     void        (*drv_close)    (adf_drv_handle_t hdl);
83     /**
84      * @brief Handler for transmit
85      */
86     a_status_t  (*drv_tx)   (adf_drv_handle_t hdl, adf_nbuf_t pkt);
87     /**
88      * @brief Handler for configuration command
89      */
90     a_status_t  (*drv_cmd)  (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
91                              adf_net_cmd_data_t *data);
92     /**
93      * @brief Handler for wireless configuration
94      */
95     a_status_t  (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
96                              adf_net_wcmd_data_t *data);
97     /**
98      * @brief Handler for transmission timeout
99      */
100     a_status_t  (*drv_tx_timeout)   (adf_drv_handle_t hdl);
101     /**
102      * @brief Handler for ioctl
103      */
104     a_status_t  (*drv_ioctl)        (adf_drv_handle_t hdl, int num, void *data);
105 }adf_vdev_sw_t;
106
107 #endif
108