Path: blob/master/drivers/infiniband/hw/nes/nes_verbs.h
15112 views
/*1* Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.2* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.3*4* This software is available to you under a choice of one of two5* licenses. You may choose to be licensed under the terms of the GNU6* General Public License (GPL) Version 2, available from the file7* COPYING in the main directory of this source tree, or the8* OpenIB.org BSD license below:9*10* Redistribution and use in source and binary forms, with or11* without modification, are permitted provided that the following12* conditions are met:13*14* - Redistributions of source code must retain the above15* copyright notice, this list of conditions and the following16* disclaimer.17*18* - Redistributions in binary form must reproduce the above19* copyright notice, this list of conditions and the following20* disclaimer in the documentation and/or other materials21* 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 OF25* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND26* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS27* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN28* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN29* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE30* SOFTWARE.31*32*/3334#ifndef NES_VERBS_H35#define NES_VERBS_H3637struct nes_device;3839#define NES_MAX_USER_DB_REGIONS 409640#define NES_MAX_USER_WQ_REGIONS 40964142#define NES_TERM_SENT 0x0143#define NES_TERM_RCVD 0x0244#define NES_TERM_DONE 0x044546struct nes_ucontext {47struct ib_ucontext ibucontext;48struct nes_device *nesdev;49unsigned long mmap_wq_offset;50unsigned long mmap_cq_offset; /* to be removed */51int index; /* rnic index (minor) */52unsigned long allocated_doorbells[BITS_TO_LONGS(NES_MAX_USER_DB_REGIONS)];53u16 mmap_db_index[NES_MAX_USER_DB_REGIONS];54u16 first_free_db;55unsigned long allocated_wqs[BITS_TO_LONGS(NES_MAX_USER_WQ_REGIONS)];56struct nes_qp *mmap_nesqp[NES_MAX_USER_WQ_REGIONS];57u16 first_free_wq;58struct list_head cq_reg_mem_list;59struct list_head qp_reg_mem_list;60u32 mcrqf;61atomic_t usecnt;62};6364struct nes_pd {65struct ib_pd ibpd;66u16 pd_id;67atomic_t sqp_count;68u16 mmap_db_index;69};7071struct nes_mr {72union {73struct ib_mr ibmr;74struct ib_mw ibmw;75struct ib_fmr ibfmr;76};77struct ib_umem *region;78u16 pbls_used;79u8 mode;80u8 pbl_4k;81};8283struct nes_hw_pb {84__le32 pa_low;85__le32 pa_high;86};8788struct nes_vpbl {89dma_addr_t pbl_pbase;90struct nes_hw_pb *pbl_vbase;91};9293struct nes_root_vpbl {94dma_addr_t pbl_pbase;95struct nes_hw_pb *pbl_vbase;96struct nes_vpbl *leaf_vpbl;97};9899struct nes_fmr {100struct nes_mr nesmr;101u32 leaf_pbl_cnt;102struct nes_root_vpbl root_vpbl;103struct ib_qp *ib_qp;104int access_rights;105struct ib_fmr_attr attr;106};107108struct nes_av;109110struct nes_cq {111struct ib_cq ibcq;112struct nes_hw_cq hw_cq;113u32 polled_completions;114u32 cq_mem_size;115spinlock_t lock;116u8 virtual_cq;117u8 pad[3];118u32 mcrqf;119};120121struct nes_wq {122spinlock_t lock;123};124125struct disconn_work {126struct work_struct work;127struct nes_qp *nesqp;128};129130struct iw_cm_id;131struct ietf_mpa_frame;132133struct nes_qp {134struct ib_qp ibqp;135void *allocated_buffer;136struct iw_cm_id *cm_id;137struct nes_cq *nesscq;138struct nes_cq *nesrcq;139struct nes_pd *nespd;140void *cm_node; /* handle of the node this QP is associated with */141struct ietf_mpa_frame *ietf_frame;142dma_addr_t ietf_frame_pbase;143struct ib_mr *lsmm_mr;144struct nes_hw_qp hwqp;145struct work_struct work;146enum ib_qp_state ibqp_state;147u32 iwarp_state;148u32 hte_index;149u32 last_aeq;150u32 qp_mem_size;151atomic_t refcount;152atomic_t close_timer_started;153u32 mmap_sq_db_index;154u32 mmap_rq_db_index;155spinlock_t lock;156struct nes_qp_context *nesqp_context;157dma_addr_t nesqp_context_pbase;158void *pbl_vbase;159dma_addr_t pbl_pbase;160struct page *page;161struct timer_list terminate_timer;162enum ib_event_type terminate_eventtype;163u16 active_conn:1;164u16 skip_lsmm:1;165u16 user_mode:1;166u16 hte_added:1;167u16 flush_issued:1;168u16 destroyed:1;169u16 sig_all:1;170u16 rsvd:9;171u16 private_data_len;172u16 term_sq_flush_code;173u16 term_rq_flush_code;174u8 hw_iwarp_state;175u8 hw_tcp_state;176u8 term_flags;177u8 sq_kmapped;178};179#endif /* NES_VERBS_H */180181182