blob: 55099eb3c70ec8c5b6e216cdea84567d392eb87c [file] [log] [blame]
Divy Le Ray4d22de32007-01-18 22:04:14 -05001/*
Divy Le Raya02d44a2008-10-13 18:47:30 -07002 * Copyright (c) 2003-2008 Chelsio, Inc. All rights reserved.
Divy Le Ray4d22de32007-01-18 22:04:14 -05003 *
Divy Le Ray1d68e932007-01-30 19:44:35 -08004 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
Divy Le Ray4d22de32007-01-18 22:04:14 -050031 */
Divy Le Ray4d22de32007-01-18 22:04:14 -050032#ifndef _CXGB3_OFFLOAD_CTL_DEFS_H
33#define _CXGB3_OFFLOAD_CTL_DEFS_H
34
35enum {
Divy Le Raye22bb452007-08-21 20:49:21 -070036 GET_MAX_OUTSTANDING_WR = 0,
37 GET_TX_MAX_CHUNK = 1,
38 GET_TID_RANGE = 2,
39 GET_STID_RANGE = 3,
40 GET_RTBL_RANGE = 4,
41 GET_L2T_CAPACITY = 5,
42 GET_MTUS = 6,
43 GET_WR_LEN = 7,
44 GET_IFF_FROM_MAC = 8,
45 GET_DDP_PARAMS = 9,
46 GET_PORTS = 10,
Divy Le Ray4d22de32007-01-18 22:04:14 -050047
Divy Le Raye22bb452007-08-21 20:49:21 -070048 ULP_ISCSI_GET_PARAMS = 11,
49 ULP_ISCSI_SET_PARAMS = 12,
Divy Le Ray4d22de32007-01-18 22:04:14 -050050
Divy Le Raye22bb452007-08-21 20:49:21 -070051 RDMA_GET_PARAMS = 13,
52 RDMA_CQ_OP = 14,
53 RDMA_CQ_SETUP = 15,
54 RDMA_CQ_DISABLE = 16,
55 RDMA_CTRL_QP_SETUP = 17,
56 RDMA_GET_MEM = 18,
Steve Wise14cc1802008-07-14 23:48:48 -070057 RDMA_GET_MIB = 19,
Divy Le Raye22bb452007-08-21 20:49:21 -070058
59 GET_RX_PAGE_INFO = 50,
Karen Xiea109a5b2008-12-18 22:56:20 -080060 GET_ISCSI_IPV4ADDR = 51,
Divy Le Ray4d22de32007-01-18 22:04:14 -050061};
62
63/*
64 * Structure used to describe a TID range. Valid TIDs are [base, base+num).
65 */
66struct tid_range {
67 unsigned int base; /* first TID */
68 unsigned int num; /* number of TIDs in range */
69};
70
71/*
72 * Structure used to request the size and contents of the MTU table.
73 */
74struct mtutab {
75 unsigned int size; /* # of entries in the MTU table */
76 const unsigned short *mtus; /* the MTU table values */
77};
78
79struct net_device;
80
81/*
82 * Structure used to request the adapter net_device owning a given MAC address.
83 */
84struct iff_mac {
85 struct net_device *dev; /* the net_device */
86 const unsigned char *mac_addr; /* MAC address to lookup */
87 u16 vlan_tag;
88};
89
Karen Xiea109a5b2008-12-18 22:56:20 -080090/* Structure used to request a port's iSCSI IPv4 address */
91struct iscsi_ipv4addr {
92 struct net_device *dev; /* the net_device */
93 __be32 ipv4addr; /* the return iSCSI IPv4 address */
94};
95
Divy Le Ray4d22de32007-01-18 22:04:14 -050096struct pci_dev;
97
98/*
99 * Structure used to request the TCP DDP parameters.
100 */
101struct ddp_params {
102 unsigned int llimit; /* TDDP region start address */
103 unsigned int ulimit; /* TDDP region end address */
104 unsigned int tag_mask; /* TDDP tag mask */
105 struct pci_dev *pdev;
106};
107
108struct adap_ports {
109 unsigned int nports; /* number of ports on this adapter */
110 struct net_device *lldevs[2];
111};
112
113/*
114 * Structure used to return information to the iscsi layer.
115 */
116struct ulp_iscsi_info {
117 unsigned int offset;
118 unsigned int llimit;
119 unsigned int ulimit;
120 unsigned int tagmask;
Karen Xie9439f742008-07-08 09:32:34 -0700121 u8 pgsz_factor[4];
Divy Le Ray4d22de32007-01-18 22:04:14 -0500122 unsigned int max_rxsz;
123 unsigned int max_txsz;
124 struct pci_dev *pdev;
125};
126
127/*
128 * Structure used to return information to the RDMA layer.
129 */
130struct rdma_info {
131 unsigned int tpt_base; /* TPT base address */
132 unsigned int tpt_top; /* TPT last entry address */
133 unsigned int pbl_base; /* PBL base address */
134 unsigned int pbl_top; /* PBL last entry address */
135 unsigned int rqt_base; /* RQT base address */
136 unsigned int rqt_top; /* RQT last entry address */
137 unsigned int udbell_len; /* user doorbell region length */
138 unsigned long udbell_physbase; /* user doorbell physical start addr */
139 void __iomem *kdb_addr; /* kernel doorbell register address */
140 struct pci_dev *pdev; /* associated PCI device */
141};
142
143/*
144 * Structure used to request an operation on an RDMA completion queue.
145 */
146struct rdma_cq_op {
147 unsigned int id;
148 unsigned int op;
149 unsigned int credits;
150};
151
152/*
153 * Structure used to setup RDMA completion queues.
154 */
155struct rdma_cq_setup {
156 unsigned int id;
157 unsigned long long base_addr;
158 unsigned int size;
159 unsigned int credits;
160 unsigned int credit_thres;
161 unsigned int ovfl_mode;
162};
163
164/*
165 * Structure used to setup the RDMA control egress context.
166 */
167struct rdma_ctrlqp_setup {
168 unsigned long long base_addr;
169 unsigned int size;
170};
Divy Le Raye22bb452007-08-21 20:49:21 -0700171
172/*
173 * Offload TX/RX page information.
174 */
175struct ofld_page_info {
176 unsigned int page_size; /* Page size, should be a power of 2 */
177 unsigned int num; /* Number of pages */
178};
Divy Le Ray4d22de32007-01-18 22:04:14 -0500179#endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */