Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cxgb3_ctl_defs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2008 Chelsio, Inc. All rights reserved.
3  *
4  * 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.
31  */
32 #ifndef _CXGB3_OFFLOAD_CTL_DEFS_H
33 #define _CXGB3_OFFLOAD_CTL_DEFS_H
34 
35 enum {
42  GET_MTUS = 6,
46  GET_PORTS = 10,
47 
50 
52  RDMA_CQ_OP = 14,
58 
61 
63 };
64 
65 /*
66  * Structure used to describe a TID range. Valid TIDs are [base, base+num).
67  */
68 struct tid_range {
69  unsigned int base; /* first TID */
70  unsigned int num; /* number of TIDs in range */
71 };
72 
73 /*
74  * Structure used to request the size and contents of the MTU table.
75  */
76 struct mtutab {
77  unsigned int size; /* # of entries in the MTU table */
78  const unsigned short *mtus; /* the MTU table values */
79 };
80 
81 struct net_device;
82 
83 /*
84  * Structure used to request the adapter net_device owning a given MAC address.
85  */
86 struct iff_mac {
87  struct net_device *dev; /* the net_device */
88  const unsigned char *mac_addr; /* MAC address to lookup */
90 };
91 
92 /* Structure used to request a port's iSCSI IPv4 address */
94  struct net_device *dev; /* the net_device */
95  __be32 ipv4addr; /* the return iSCSI IPv4 address */
96 };
97 
98 struct pci_dev;
99 
100 /*
101  * Structure used to request the TCP DDP parameters.
102  */
103 struct ddp_params {
104  unsigned int llimit; /* TDDP region start address */
105  unsigned int ulimit; /* TDDP region end address */
106  unsigned int tag_mask; /* TDDP tag mask */
107  struct pci_dev *pdev;
108 };
109 
110 struct adap_ports {
111  unsigned int nports; /* number of ports on this adapter */
112  struct net_device *lldevs[2];
113 };
114 
115 /*
116  * Structure used to return information to the iscsi layer.
117  */
119  unsigned int offset;
120  unsigned int llimit;
121  unsigned int ulimit;
122  unsigned int tagmask;
124  unsigned int max_rxsz;
125  unsigned int max_txsz;
126  struct pci_dev *pdev;
127 };
128 
129 /*
130  * Structure used to return information to the RDMA layer.
131  */
132 struct rdma_info {
133  unsigned int tpt_base; /* TPT base address */
134  unsigned int tpt_top; /* TPT last entry address */
135  unsigned int pbl_base; /* PBL base address */
136  unsigned int pbl_top; /* PBL last entry address */
137  unsigned int rqt_base; /* RQT base address */
138  unsigned int rqt_top; /* RQT last entry address */
139  unsigned int udbell_len; /* user doorbell region length */
140  unsigned long udbell_physbase; /* user doorbell physical start addr */
141  void __iomem *kdb_addr; /* kernel doorbell register address */
142  struct pci_dev *pdev; /* associated PCI device */
143 };
144 
145 /*
146  * Structure used to request an operation on an RDMA completion queue.
147  */
148 struct rdma_cq_op {
149  unsigned int id;
150  unsigned int op;
151  unsigned int credits;
152 };
153 
154 /*
155  * Structure used to setup RDMA completion queues.
156  */
158  unsigned int id;
159  unsigned long long base_addr;
160  unsigned int size;
161  unsigned int credits;
162  unsigned int credit_thres;
163  unsigned int ovfl_mode;
164 };
165 
166 /*
167  * Structure used to setup the RDMA control egress context.
168  */
170  unsigned long long base_addr;
171  unsigned int size;
172 };
173 
174 /*
175  * Offload TX/RX page information.
176  */
178  unsigned int page_size; /* Page size, should be a power of 2 */
179  unsigned int num; /* Number of pages */
180 };
181 
182 /*
183  * Structure used to get firmware and protocol engine versions.
184  */
188 };
189 #endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */