2 * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
3 * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40 #define NES_MAX_USER_DB_REGIONS 4096
41 #define NES_MAX_USER_WQ_REGIONS 4096
43 #define NES_TERM_SENT 0x01
44 #define NES_TERM_RCVD 0x02
45 #define NES_TERM_DONE 0x04
48 struct ib_ucontext ibucontext;
49 struct nes_device *nesdev;
50 unsigned long mmap_wq_offset;
51 unsigned long mmap_cq_offset; /* to be removed */
52 int index; /* rnic index (minor) */
53 unsigned long allocated_doorbells[BITS_TO_LONGS(NES_MAX_USER_DB_REGIONS)];
54 u16 mmap_db_index[NES_MAX_USER_DB_REGIONS];
56 unsigned long allocated_wqs[BITS_TO_LONGS(NES_MAX_USER_WQ_REGIONS)];
57 struct nes_qp *mmap_nesqp[NES_MAX_USER_WQ_REGIONS];
59 struct list_head cq_reg_mem_list;
60 struct list_head qp_reg_mem_list;
78 struct ib_umem *region;
95 struct nes_hw_pb *pbl_vbase;
98 struct nes_root_vpbl {
100 struct nes_hw_pb *pbl_vbase;
101 struct nes_vpbl *leaf_vpbl;
107 struct nes_root_vpbl root_vpbl;
110 struct ib_fmr_attr attr;
117 struct nes_hw_cq hw_cq;
118 u32 polled_completions;
130 struct disconn_work {
131 struct work_struct work;
132 struct nes_qp *nesqp;
136 struct ietf_mpa_frame;
140 void *allocated_buffer;
141 struct iw_cm_id *cm_id;
142 struct nes_cq *nesscq;
143 struct nes_cq *nesrcq;
144 struct nes_pd *nespd;
145 void *cm_node; /* handle of the node this QP is associated with */
148 dma_addr_t ietf_frame_pbase;
149 struct ib_mr *lsmm_mr;
150 struct nes_hw_qp hwqp;
151 struct work_struct work;
152 enum ib_qp_state ibqp_state;
158 atomic_t close_timer_started;
159 u32 mmap_sq_db_index;
160 u32 mmap_rq_db_index;
163 struct nes_qp_context *nesqp_context;
164 dma_addr_t nesqp_context_pbase;
166 dma_addr_t pbl_pbase;
168 struct timer_list terminate_timer;
169 enum ib_event_type terminate_eventtype;
170 struct sk_buff_head pau_list;
181 u16 private_data_len;
182 u16 term_sq_flush_code;
183 u16 term_rq_flush_code;
192 struct completion sq_drained;
193 struct completion rq_drained;
196 struct ib_mr *nes_reg_phys_mr(struct ib_pd *ib_pd,
197 u64 addr, u64 size, int acc, u64 *iova_start);
199 #endif /* NES_VERBS_H */