40b8e58384773d82794e71044ebca6831abc7c3d
[linux-libre-firmware.git] / ath9k_htc / target_firmware / magpie_fw_dev / target / inc / adf_net_sw.h
1 /*
2  * Copyright (c) 2013 Qualcomm Atheros, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted (subject to the limitations in the
7  * disclaimer below) provided that the following conditions are met:
8  *
9  *  * Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  *  * Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the
15  *    distribution.
16  *
17  *  * Neither the name of Qualcomm Atheros nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22  * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 /**
36  * @ingroup adf_net_public
37  * @file adf_net_sw.h
38  * This file defines the device and virtual device switch tables.
39  */ 
40
41 #ifndef __ADF_NET_SW_H
42 #define __ADF_NET_SW_H
43
44
45 /**
46  * @brief per device switch structure
47  */
48 typedef struct _adf_dev_sw{
49     /**
50      * @brief Handler for device open - mandatory interface
51      */
52     a_status_t        (*drv_open)      (adf_drv_handle_t hdl); 
53     /**
54      * @brief Handler for device close - mandatory interface
55      */
56     void              (*drv_close)     (adf_drv_handle_t hdl);
57     /**
58      * @brief Handler for transmit - mandatory interface
59      */
60     a_status_t        (*drv_tx)        (adf_drv_handle_t hdl, adf_nbuf_t pkt);
61     /**
62      * @brief Handler for configuration command - mandatory interface
63      */
64     a_status_t        (*drv_cmd)       (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
65                                         adf_net_cmd_data_t *data);
66     /**
67      * @brief Handler for ioctl - mandatory interface
68      */
69     a_status_t        (*drv_ioctl)     (adf_drv_handle_t hdl, int num, 
70                                         void *data);
71     /**
72      * @brief Handler for transmission timeout - mandatory interface
73      */
74     a_status_t        (*drv_tx_timeout)(adf_drv_handle_t hdl);
75     /**
76      * @brief Handler for wireless configuration - optional interface
77      */
78     a_status_t  (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
79                                            adf_net_wcmd_data_t *data);
80     /** 
81      * @brief Handler for polling if polling/deferred processing required - 
82      * optional interface
83      */
84     adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota, 
85                                      int *work_done);
86     /**
87      * @brief Handler for per cpu deffered callback (e.g. for RSS) - optional
88      * interface
89      */
90     adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota, 
91                                          int *work_done, void *arg);
92     /**
93      * @brief Handler for disabling receive interrupts for polling.
94      * adf_drv should do proper locking - these are not called in atomic context
95      */
96     void (*drv_poll_int_disable)(adf_drv_handle_t hdl);
97     /**
98      * @brief Handler for enabling receive interrupts for polling.
99      * adf_drv should do proper locking - these are not called in atomic context
100      */
101     void (*drv_poll_int_enable) (adf_drv_handle_t hdl);
102
103 }adf_dev_sw_t;
104
105 /**
106  * @brief Virtual device switch structure
107  */
108 typedef struct _adf_vdev_sw{
109     /**
110      * @brief Handler for device open
111      */
112     a_status_t  (*drv_open)     (adf_drv_handle_t hdl);
113     /**
114      * @brief Handler for device close
115      */
116     void        (*drv_close)    (adf_drv_handle_t hdl);
117     /**
118      * @brief Handler for transmit
119      */
120     a_status_t  (*drv_tx)   (adf_drv_handle_t hdl, adf_nbuf_t pkt);
121     /**
122      * @brief Handler for configuration command
123      */
124     a_status_t  (*drv_cmd)  (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
125                              adf_net_cmd_data_t *data);
126     /**
127      * @brief Handler for wireless configuration
128      */
129     a_status_t  (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
130                              adf_net_wcmd_data_t *data);
131     /**
132      * @brief Handler for transmission timeout
133      */
134     a_status_t  (*drv_tx_timeout)   (adf_drv_handle_t hdl);
135     /**
136      * @brief Handler for ioctl
137      */
138     a_status_t  (*drv_ioctl)        (adf_drv_handle_t hdl, int num, void *data);
139 }adf_vdev_sw_t;
140
141 #endif
142