Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2006 - 2009 Mellanox Technology Inc.  All rights reserved.
0003  *
0004  * This software is available to you under a choice of one of two
0005  * licenses.  You may choose to be licensed under the terms of the GNU
0006  * General Public License (GPL) Version 2, available from the file
0007  * COPYING in the main directory of this source tree, or the
0008  * OpenIB.org BSD license below:
0009  *
0010  *     Redistribution and use in source and binary forms, with or
0011  *     without modification, are permitted provided that the following
0012  *     conditions are met:
0013  *
0014  *      - Redistributions of source code must retain the above
0015  *        copyright notice, this list of conditions and the following
0016  *        disclaimer.
0017  *
0018  *      - Redistributions in binary form must reproduce the above
0019  *        copyright notice, this list of conditions and the following
0020  *        disclaimer in the documentation and/or other materials
0021  *        provided with the distribution.
0022  *
0023  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0024  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0025  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0026  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0027  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0028  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0029  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0030  * SOFTWARE.
0031  *
0032  */
0033 
0034 #ifndef IB_DM_MAD_H
0035 #define IB_DM_MAD_H
0036 
0037 #include <linux/types.h>
0038 
0039 #include <rdma/ib_mad.h>
0040 
0041 enum {
0042     /*
0043      * See also section 13.4.7 Status Field, table 115 MAD Common Status
0044      * Field Bit Values and also section 16.3.1.1 Status Field in the
0045      * InfiniBand Architecture Specification.
0046      */
0047     DM_MAD_STATUS_UNSUP_METHOD = 0x0008,
0048     DM_MAD_STATUS_UNSUP_METHOD_ATTR = 0x000c,
0049     DM_MAD_STATUS_INVALID_FIELD = 0x001c,
0050     DM_MAD_STATUS_NO_IOC = 0x0100,
0051 
0052     /*
0053      * See also the Device Management chapter, section 16.3.3 Attributes,
0054      * table 279 Device Management Attributes in the InfiniBand
0055      * Architecture Specification.
0056      */
0057     DM_ATTR_CLASS_PORT_INFO = 0x01,
0058     DM_ATTR_IOU_INFO = 0x10,
0059     DM_ATTR_IOC_PROFILE = 0x11,
0060     DM_ATTR_SVC_ENTRIES = 0x12
0061 };
0062 
0063 struct ib_dm_hdr {
0064     u8 reserved[28];
0065 };
0066 
0067 /*
0068  * Structure of management datagram sent by the SRP target implementation.
0069  * Contains a management datagram header, reliable multi-packet transaction
0070  * protocol (RMPP) header and ib_dm_hdr. Notes:
0071  * - The SRP target implementation does not use RMPP or ib_dm_hdr when sending
0072  *   management datagrams.
0073  * - The header size must be exactly 64 bytes (IB_MGMT_DEVICE_HDR), since this
0074  *   is the header size that is passed to ib_create_send_mad() in ib_srpt.c.
0075  * - The maximum supported size for a management datagram when not using RMPP
0076  *   is 256 bytes -- 64 bytes header and 192 (IB_MGMT_DEVICE_DATA) bytes data.
0077  */
0078 struct ib_dm_mad {
0079     struct ib_mad_hdr mad_hdr;
0080     struct ib_rmpp_hdr rmpp_hdr;
0081     struct ib_dm_hdr dm_hdr;
0082     u8 data[IB_MGMT_DEVICE_DATA];
0083 };
0084 
0085 /*
0086  * IOUnitInfo as defined in section 16.3.3.3 IOUnitInfo of the InfiniBand
0087  * Architecture Specification.
0088  */
0089 struct ib_dm_iou_info {
0090     __be16 change_id;
0091     u8 max_controllers;
0092     u8 op_rom;
0093     u8 controller_list[128];
0094 };
0095 
0096 /*
0097  * IOControllerprofile as defined in section 16.3.3.4 IOControllerProfile of
0098  * the InfiniBand Architecture Specification.
0099  */
0100 struct ib_dm_ioc_profile {
0101     __be64 guid;
0102     __be32 vendor_id;
0103     __be32 device_id;
0104     __be16 device_version;
0105     __be16 reserved1;
0106     __be32 subsys_vendor_id;
0107     __be32 subsys_device_id;
0108     __be16 io_class;
0109     __be16 io_subclass;
0110     __be16 protocol;
0111     __be16 protocol_version;
0112     __be16 service_conn;
0113     __be16 initiators_supported;
0114     __be16 send_queue_depth;
0115     u8 reserved2;
0116     u8 rdma_read_depth;
0117     __be32 send_size;
0118     __be32 rdma_size;
0119     u8 op_cap_mask;
0120     u8 svc_cap_mask;
0121     u8 num_svc_entries;
0122     u8 reserved3[9];
0123     u8 id_string[64];
0124 };
0125 
0126 struct ib_dm_svc_entry {
0127     u8 name[40];
0128     __be64 id;
0129 };
0130 
0131 /*
0132  * See also section 16.3.3.5 ServiceEntries in the InfiniBand Architecture
0133  * Specification. See also section B.7, table B.8 in the T10 SRP r16a document.
0134  */
0135 struct ib_dm_svc_entries {
0136     struct ib_dm_svc_entry service_entries[4];
0137 };
0138 
0139 #endif