1 /**************************************************************************
2 SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 Copyright (c) 2007-2008, Chelsio Inc.
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
13 2. Neither the name of the Chelsio Corporation nor the names of its
14 contributors may be used to endorse or promote products derived from
15 this software without specific prior written permission.
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 POSSIBILITY OF SUCH DAMAGE.
31 ***************************************************************************/
36 * Ioctl commands specific to this driver.
68 /* statistics categories */
86 enum { CNTXT_TYPE_EGRESS, CNTXT_TYPE_FL, CNTXT_TYPE_RSP, CNTXT_TYPE_CQ };
103 enum { MEM_CM, MEM_PMRX, MEM_PMTX }; /* ch_mem_range.mem_id values */
105 struct ch_qset_params {
118 struct ch_pktsched_params {
130 int32_t kbps; /* rate in Kbps */
131 int32_t class_ipg; /* tenths of nanoseconds */
132 int32_t flow_ipg; /* usec */
137 uint16_t mtus[NMTUS];
148 struct ch_tcam_word {
163 uint32_t vlan_mask:12;
165 uint32_t intf_mask:4;
168 uint8_t invert_match:1;
175 #define REGDUMP_SIZE (4 * 1024)
177 struct ch_ifconf_regs {
179 uint32_t len; /* bytes */
197 #define LA_BUFSIZE (2 * 1024)
205 struct t3_ioq_entry {
212 #define IOQS_BUFSIZE (1024)
214 uint32_t ioq_rx_enable;
215 uint32_t ioq_tx_enable;
216 uint32_t ioq_rx_status;
217 uint32_t ioq_tx_status;
219 struct t3_ioq_entry *data;
222 struct ch_filter_tuple {
228 uint16_t vlan_prio:3;
233 struct ch_filter_tuple val;
234 struct ch_filter_tuple mask;
235 uint16_t mac_addr_idx;
239 uint8_t want_filter_id:1;
245 #define CHELSIO_SETREG _IOW('f', CH_SETREG, struct ch_reg)
246 #define CHELSIO_GETREG _IOWR('f', CH_GETREG, struct ch_reg)
247 #define CHELSIO_GETMTUTAB _IOR('f', CH_GETMTUTAB, struct ch_mtus)
248 #define CHELSIO_SETMTUTAB _IOW('f', CH_SETMTUTAB, struct ch_mtus)
249 #define CHELSIO_SET_PM _IOW('f', CH_SET_PM, struct ch_pm)
250 #define CHELSIO_GET_PM _IOR('f', CH_GET_PM, struct ch_pm)
251 #define CHELSIO_READ_TCAM_WORD _IOWR('f', CH_READ_TCAM_WORD, struct ch_tcam_word)
252 #define CHELSIO_GET_MEM _IOWR('f', CH_GET_MEM, struct ch_mem_range)
253 #define CHELSIO_GET_SGE_CONTEXT _IOWR('f', CH_GET_SGE_CONTEXT, struct ch_cntxt)
254 #define CHELSIO_GET_SGE_DESC _IOWR('f', CH_GET_SGE_DESC, struct ch_desc)
255 #define CHELSIO_LOAD_FW _IOWR('f', CH_LOAD_FW, struct ch_mem_range)
256 #define CHELSIO_SET_TRACE_FILTER _IOW('f', CH_SET_TRACE_FILTER, struct ch_trace)
257 #define CHELSIO_GET_QSET_PARAMS _IOWR('f', CH_GET_QSET_PARAMS, struct ch_qset_params)
258 #define CHELSIO_GET_QSET_NUM _IOR('f', CH_GET_QSET_NUM, struct ch_reg)
259 #define CHELSIO_SET_PKTSCHED _IOW('f', CH_SET_PKTSCHED, struct ch_pktsched_params)
260 #define CHELSIO_SET_HW_SCHED _IOW('f', CH_SET_HW_SCHED, struct ch_hw_sched)
261 #define CHELSIO_LOAD_BOOT _IOW('f', CH_LOAD_BOOT, struct ch_mem_range)
262 #define CHELSIO_CLEAR_STATS _IO('f', CH_CLEAR_STATS)
263 #define CHELSIO_IFCONF_GETREGS _IOWR('f', CH_IFCONF_GETREGS, struct ch_ifconf_regs)
264 #define CHELSIO_GET_MIIREG _IOWR('f', CH_GET_MIIREG, struct ch_mii_data)
265 #define CHELSIO_SET_MIIREG _IOW('f', CH_SET_MIIREG, struct ch_mii_data)
266 #define CHELSIO_GET_EEPROM _IOWR('f', CH_GET_EEPROM, struct ch_eeprom)
267 #define CHELSIO_GET_UP_LA _IOWR('f', CH_GET_UP_LA, struct ch_up_la)
268 #define CHELSIO_GET_UP_IOQS _IOWR('f', CH_GET_UP_IOQS, struct ch_up_ioqs)
269 #define CHELSIO_SET_FILTER _IOW('f', CH_SET_FILTER, struct ch_filter)
270 #define CHELSIO_DEL_FILTER _IOW('f', CH_DEL_FILTER, struct ch_filter)
271 #define CHELSIO_GET_FILTER _IOWR('f', CH_GET_FILTER, struct ch_filter)