2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * This file is part of the Chelsio T4 support code.
15 * Copyright (C) 2010-2013 Chelsio Communications. All rights reserved.
17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this
20 * release for licensing terms and conditions.
23 #ifndef __CXGBE_OFFLOAD_H
24 #define __CXGBE_OFFLOAD_H
27 * Max # of ATIDs. The absolute HW max is 16K but we keep it lower.
29 #define MAX_ATIDS 8192U
31 #define INIT_ULPTX_WR(w, wrlen, atomic, tid) do { \
32 (w)->wr.wr_hi = htonl(V_FW_WR_OP(FW_ULPTX_WR) | \
33 V_FW_WR_ATOMIC(atomic)); \
34 (w)->wr.wr_mid = htonl(V_FW_WR_LEN16(DIV_ROUND_UP(wrlen, 16)) | \
35 V_FW_WR_FLOWID(tid)); \
36 (w)->wr.wr_lo = cpu_to_be64(0); \
39 #define INIT_TP_WR(w, tid) do { \
40 (w)->wr.wr_hi = htonl(V_FW_WR_OP(FW_TP_WR) | \
41 V_FW_WR_IMMDLEN(sizeof (*w) - sizeof (w->wr))); \
42 (w)->wr.wr_mid = htonl(V_FW_WR_LEN16(DIV_ROUND_UP(sizeof (*w), 16)) | \
43 V_FW_WR_FLOWID(tid)); \
44 (w)->wr.wr_lo = cpu_to_be64(0); \
47 #define INIT_TP_WR_MIT_CPL(w, cpl, tid) do { \
49 OPCODE_TID(w) = htonl(MK_OPCODE_TID(cpl, tid)); \
54 union serv_entry
*next
;
59 union aopen_entry
*next
;
63 * Holds the size, base address, free list start, etc of the TID, server TID,
64 * and active-open TID tables. The tables themselves are allocated dynamically.
70 union serv_entry
*stid_tab
;
72 unsigned int stid_base
;
74 union aopen_entry
*atid_tab
;
77 struct filter_entry
*ftid_tab
;
79 unsigned int ftid_base
;
80 unsigned int ftids_in_use
;
83 union aopen_entry
*afree
;
84 unsigned int atids_in_use
;
87 union serv_entry
*sfree
;
88 unsigned int stids_in_use
;
90 unsigned int tids_in_use
;
98 struct t4_virt_res
{ /* virtualized HW resources */
100 struct t4_range iscsi
;
101 struct t4_range stag
;
115 CXGB4_CONTROL_SET_OFFLOAD_POLICY
,
119 SLIST_ENTRY(uld_info
) link
;
122 int (*attach
)(struct adapter
*, void **);
123 int (*detach
)(void *);
124 int (*rx
)(void *, const void *, mblk_t
*);
125 int (*control
)(void *handle
, enum cxgb4_control control
, ...);
129 struct uld_info
*uld
;
133 struct tom_tunables
{
140 #ifdef TCP_OFFLOAD_ENABLE
146 __u8 ipvers_opentype
;
152 enum { OPEN_TYPE_LISTEN
, OPEN_TYPE_ACTIVE
, OPEN_TYPE_PASSIVE
};
154 struct offload_settings
{
167 extern int t4_register_uld(struct uld_info
*ui
);
168 extern int t4_unregister_uld(struct uld_info
*ui
);
170 #endif /* __CXGBE_OFFLOAD_H */