/* * Copyright (c) 2005 Cisco Systems. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef IB_SRP_H #define IB_SRP_H #include <linux/types.h> #include <linux/list.h> #include <linux/mutex.h> #include <linux/scatterlist.h> #include <scsi/scsi_host.h> #include <scsi/scsi_cmnd.h> #include <rdma/ib_verbs.h> #include <rdma/ib_sa.h> #include <rdma/ib_cm.h> #include <rdma/rdma_cm.h> enum { … }; enum { … }; enum srp_target_state { … }; enum srp_iu_type { … }; /* * RDMA adapter in the initiator system. * * @dev_list: List of RDMA ports associated with this RDMA adapter (srp_host). * @mr_page_mask: HCA memory registration page mask. * @mr_page_size: HCA memory registration page size. * @mr_max_size: Maximum size in bytes of a single FR registration request. */ struct srp_device { … }; /* * One port of an RDMA adapter in the initiator system. * * @target_list: List of connected target ports (struct srp_target_port). * @target_lock: Protects @target_list. */ struct srp_host { … }; struct srp_request { … }; /** * struct srp_rdma_ch * @comp_vector: Completion vector used by this RDMA channel. * @max_it_iu_len: Maximum initiator-to-target information unit length. * @max_ti_iu_len: Maximum target-to-initiator information unit length. */ struct srp_rdma_ch { … }; /** * struct srp_target_port - RDMA port in the SRP target system * @comp_vector: Completion vector used by the first RDMA channel created for * this target port. */ struct srp_target_port { … }; struct srp_iu { … }; /** * struct srp_fr_desc - fast registration work request arguments * @entry: Entry in srp_fr_pool.free_list. * @mr: Memory region. * @frpl: Fast registration page list. */ struct srp_fr_desc { … }; /** * struct srp_fr_pool - pool of fast registration descriptors * * An entry is available for allocation if and only if it occurs in @free_list. * * @size: Number of descriptors in this pool. * @max_page_list_len: Maximum fast registration work request page list length. * @lock: Protects free_list. * @free_list: List of free descriptors. * @desc: Fast registration descriptor pool. */ struct srp_fr_pool { … }; /** * struct srp_map_state - per-request DMA memory mapping state * @desc: Pointer to the element of the SRP buffer descriptor array * that is being filled in. * @pages: Array with DMA addresses of pages being considered for * memory registration. * @base_dma_addr: DMA address of the first page that has not yet been mapped. * @dma_len: Number of bytes that will be registered with the next FR * memory registration call. * @total_len: Total number of bytes in the sg-list being mapped. * @npages: Number of page addresses in the pages[] array. * @nmdesc: Number of FR memory descriptors used for mapping. * @ndesc: Number of SRP buffer descriptors that have been filled in. */ struct srp_map_state { … }; #endif /* IB_SRP_H */