2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
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:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
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
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.
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.
36 * @ingroup adf_net_public
38 * This file defines the device and virtual device switch tables.
41 #ifndef __ADF_NET_SW_H
42 #define __ADF_NET_SW_H
46 * @brief per device switch structure
48 typedef struct _adf_dev_sw{
50 * @brief Handler for device open - mandatory interface
52 a_status_t (*drv_open) (adf_drv_handle_t hdl);
54 * @brief Handler for device close - mandatory interface
56 void (*drv_close) (adf_drv_handle_t hdl);
58 * @brief Handler for transmit - mandatory interface
60 a_status_t (*drv_tx) (adf_drv_handle_t hdl, adf_nbuf_t pkt);
62 * @brief Handler for configuration command - mandatory interface
64 a_status_t (*drv_cmd) (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
65 adf_net_cmd_data_t *data);
67 * @brief Handler for ioctl - mandatory interface
69 a_status_t (*drv_ioctl) (adf_drv_handle_t hdl, int num,
72 * @brief Handler for transmission timeout - mandatory interface
74 a_status_t (*drv_tx_timeout)(adf_drv_handle_t hdl);
76 * @brief Handler for wireless configuration - optional interface
78 a_status_t (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
79 adf_net_wcmd_data_t *data);
81 * @brief Handler for polling if polling/deferred processing required -
84 adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota,
87 * @brief Handler for per cpu deffered callback (e.g. for RSS) - optional
90 adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota,
91 int *work_done, void *arg);
93 * @brief Handler for disabling receive interrupts for polling.
94 * adf_drv should do proper locking - these are not called in atomic context
96 void (*drv_poll_int_disable)(adf_drv_handle_t hdl);
98 * @brief Handler for enabling receive interrupts for polling.
99 * adf_drv should do proper locking - these are not called in atomic context
101 void (*drv_poll_int_enable) (adf_drv_handle_t hdl);
106 * @brief Virtual device switch structure
108 typedef struct _adf_vdev_sw{
110 * @brief Handler for device open
112 a_status_t (*drv_open) (adf_drv_handle_t hdl);
114 * @brief Handler for device close
116 void (*drv_close) (adf_drv_handle_t hdl);
118 * @brief Handler for transmit
120 a_status_t (*drv_tx) (adf_drv_handle_t hdl, adf_nbuf_t pkt);
122 * @brief Handler for configuration command
124 a_status_t (*drv_cmd) (adf_drv_handle_t hdl, adf_net_cmd_t cmd,
125 adf_net_cmd_data_t *data);
127 * @brief Handler for wireless configuration
129 a_status_t (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
130 adf_net_wcmd_data_t *data);
132 * @brief Handler for transmission timeout
134 a_status_t (*drv_tx_timeout) (adf_drv_handle_t hdl);
136 * @brief Handler for ioctl
138 a_status_t (*drv_ioctl) (adf_drv_handle_t hdl, int num, void *data);