1 /**************************************************************************
3 Copyright (c) 2007, Chelsio Inc.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Neither the name of the Chelsio Corporation nor the names of its
13 contributors may be used to endorse or promote products derived from
14 this software without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 POSSIBILITY OF SUCH DAMAGE.
28 $FreeBSD: src/sys/dev/cxgb/cxgb_ioctl.h,v 1.5 2007/08/17 05:57:03 kmacy Exp $
30 ***************************************************************************/
35 * Ioctl commands specific to this driver.
84 enum { CNTXT_TYPE_EGRESS
, CNTXT_TYPE_FL
, CNTXT_TYPE_RSP
, CNTXT_TYPE_CQ
};
103 struct ch_qset_params
{
115 struct ch_pktsched_params
{
129 int32_t kbps
; /* rate in Kbps */
130 int32_t class_ipg
; /* tenths of nanoseconds */
131 uint32_t flow_ipg
; /* usec */
134 struct ch_filter_tuple
{
140 uint16_t vlan_prio
:3;
146 struct ch_filter_tuple val
;
147 struct ch_filter_tuple mask
;
148 uint16_t mac_addr_idx
;
152 uint8_t want_filter_id
:1; /* report filter TID instead of RSS hash */
153 uint8_t pass
:1; /* whether to pass or drop packets */
154 uint8_t rss
:1; /* use RSS or specified qset */
159 # define TCB_SIZE 128
162 /* TCB size in 32-bit words */
163 #define TCB_WORDS (TCB_SIZE / 4)
165 enum { MEM_CM
, MEM_PMRX
, MEM_PMTX
}; /* ch_mem_range.mem_id values */
170 uint16_t mtus
[NMTUS
];
193 uint32_t tcb_data
[TCB_WORDS
];
196 struct ch_tcam_word
{
218 uint8_t invert_match
:1,
225 #define REGDUMP_SIZE (4 * 1024)
229 uint32_t len
; /* bytes */
240 #define CHELSIO_SETREG _IOW('f', CH_SETREG, struct ch_reg)
241 #define CHELSIO_GETREG _IOWR('f', CH_GETREG, struct ch_reg)
242 #define CHELSIO_READ_TCAM_WORD _IOR('f', CH_READ_TCAM_WORD, struct ch_tcam)
243 #define CHELSIO_GET_MEM _IOWR('f', CH_GET_MEM, struct ch_mem_range)
244 #define CHELSIO_GET_SGE_CONTEXT _IOWR('f', CH_GET_SGE_CONTEXT, struct ch_cntxt)
245 #define CHELSIO_GET_SGE_DESC _IOWR('f', CH_GET_SGE_DESC, struct ch_desc)
246 #define CHELSIO_GET_QSET_PARAMS _IOWR('f', CH_GET_QSET_PARAMS, struct ch_qset_params)
247 #define CHELSIO_SET_QSET_PARAMS _IOW('f', CH_SET_QSET_PARAMS, struct ch_qset_params)
248 #define CHELSIO_GET_QSET_NUM _IOWR('f', CH_GET_QSET_NUM, struct ch_reg)
249 #define CHELSIO_SET_QSET_NUM _IOW('f', CH_SET_QSET_NUM, struct ch_reg)
250 #define CHELSIO_GETMTUTAB _IOR('f', CH_GET_QSET_NUM, struct ch_mtus)
251 #define CHELSIO_SETMTUTAB _IOW('f', CH_SET_QSET_NUM, struct ch_mtus)
254 #define CHELSIO_SET_TRACE_FILTER _IOW('f', CH_SET_TRACE_FILTER, struct ch_trace)
255 #define CHELSIO_SET_PKTSCHED _IOW('f', CH_SET_PKTSCHED, struct ch_pktsched_params)
256 #define CHELSIO_IFCONF_GETREGS _IOWR('f', CH_IFCONF_GETREGS, struct ifconf_regs)
257 #define SIOCGMIIREG _IOWR('f', CH_GETMIIREGS, struct mii_data)
258 #define SIOCSMIIREG _IOWR('f', CH_SETMIIREGS, struct mii_data)
259 #define CHELSIO_SET_HW_SCHED _IOWR('f', CH_SET_HW_SCHED, struct ch_hw_sched)
260 #define CHELSIO_SET_FILTER _IOW('f', CH_SET_FILTER, struct ch_filter)
261 #define CHELSIO_DEL_FILTER _IOW('f', CH_DEL_FILTER, struct ch_filter)
262 #define CHELSIO_DEVUP _IO('f', CH_DEVUP)