/*1* Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.2* Copyright (c) 2004 Infinicon Corporation. All rights reserved.3* Copyright (c) 2004 Intel Corporation. All rights reserved.4* Copyright (c) 2004 Topspin Corporation. All rights reserved.5* Copyright (c) 2004-2006 Voltaire Corporation. All rights reserved.6*7* This software is available to you under a choice of one of two8* licenses. You may choose to be licensed under the terms of the GNU9* General Public License (GPL) Version 2, available from the file10* COPYING in the main directory of this source tree, or the11* OpenIB.org BSD license below:12*13* Redistribution and use in source and binary forms, with or14* without modification, are permitted provided that the following15* conditions are met:16*17* - Redistributions of source code must retain the above18* copyright notice, this list of conditions and the following19* disclaimer.20*21* - Redistributions in binary form must reproduce the above22* copyright notice, this list of conditions and the following23* disclaimer in the documentation and/or other materials24* provided with the distribution.25*26* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,27* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF28* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND29* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS30* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN31* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN32* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE33* SOFTWARE.34*/3536#if !defined(IB_MAD_H)37#define IB_MAD_H3839#include <linux/list.h>4041#include <rdma/ib_verbs.h>4243/* Management base version */44#define IB_MGMT_BASE_VERSION 14546/* Management classes */47#define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x0148#define IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE 0x8149#define IB_MGMT_CLASS_SUBN_ADM 0x0350#define IB_MGMT_CLASS_PERF_MGMT 0x0451#define IB_MGMT_CLASS_BM 0x0552#define IB_MGMT_CLASS_DEVICE_MGMT 0x0653#define IB_MGMT_CLASS_CM 0x0754#define IB_MGMT_CLASS_SNMP 0x0855#define IB_MGMT_CLASS_DEVICE_ADM 0x1056#define IB_MGMT_CLASS_BOOT_MGMT 0x1157#define IB_MGMT_CLASS_BIS 0x1258#define IB_MGMT_CLASS_CONG_MGMT 0x2159#define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x3060#define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F6162#define IB_OPENIB_OUI (0x001405)6364/* Management methods */65#define IB_MGMT_METHOD_GET 0x0166#define IB_MGMT_METHOD_SET 0x0267#define IB_MGMT_METHOD_GET_RESP 0x8168#define IB_MGMT_METHOD_SEND 0x0369#define IB_MGMT_METHOD_TRAP 0x0570#define IB_MGMT_METHOD_REPORT 0x0671#define IB_MGMT_METHOD_REPORT_RESP 0x8672#define IB_MGMT_METHOD_TRAP_REPRESS 0x077374#define IB_MGMT_METHOD_RESP 0x8075#define IB_BM_ATTR_MOD_RESP cpu_to_be32(1)7677#define IB_MGMT_MAX_METHODS 1287879/* RMPP information */80#define IB_MGMT_RMPP_VERSION 18182#define IB_MGMT_RMPP_TYPE_DATA 183#define IB_MGMT_RMPP_TYPE_ACK 284#define IB_MGMT_RMPP_TYPE_STOP 385#define IB_MGMT_RMPP_TYPE_ABORT 48687#define IB_MGMT_RMPP_FLAG_ACTIVE 188#define IB_MGMT_RMPP_FLAG_FIRST (1<<1)89#define IB_MGMT_RMPP_FLAG_LAST (1<<2)9091#define IB_MGMT_RMPP_NO_RESPTIME 0x1F9293#define IB_MGMT_RMPP_STATUS_SUCCESS 094#define IB_MGMT_RMPP_STATUS_RESX 195#define IB_MGMT_RMPP_STATUS_ABORT_MIN 11896#define IB_MGMT_RMPP_STATUS_T2L 11897#define IB_MGMT_RMPP_STATUS_BAD_LEN 11998#define IB_MGMT_RMPP_STATUS_BAD_SEG 12099#define IB_MGMT_RMPP_STATUS_BADT 121100#define IB_MGMT_RMPP_STATUS_W2S 122101#define IB_MGMT_RMPP_STATUS_S2B 123102#define IB_MGMT_RMPP_STATUS_BAD_STATUS 124103#define IB_MGMT_RMPP_STATUS_UNV 125104#define IB_MGMT_RMPP_STATUS_TMR 126105#define IB_MGMT_RMPP_STATUS_UNSPEC 127106#define IB_MGMT_RMPP_STATUS_ABORT_MAX 127107108#define IB_QP0 0109#define IB_QP1 cpu_to_be32(1)110#define IB_QP1_QKEY 0x80010000111#define IB_QP_SET_QKEY 0x80000000112113#define IB_DEFAULT_PKEY_PARTIAL 0x7FFF114#define IB_DEFAULT_PKEY_FULL 0xFFFF115116enum {117IB_MGMT_MAD_HDR = 24,118IB_MGMT_MAD_DATA = 232,119IB_MGMT_RMPP_HDR = 36,120IB_MGMT_RMPP_DATA = 220,121IB_MGMT_VENDOR_HDR = 40,122IB_MGMT_VENDOR_DATA = 216,123IB_MGMT_SA_HDR = 56,124IB_MGMT_SA_DATA = 200,125IB_MGMT_DEVICE_HDR = 64,126IB_MGMT_DEVICE_DATA = 192,127};128129struct ib_mad_hdr {130u8 base_version;131u8 mgmt_class;132u8 class_version;133u8 method;134__be16 status;135__be16 class_specific;136__be64 tid;137__be16 attr_id;138__be16 resv;139__be32 attr_mod;140};141142struct ib_rmpp_hdr {143u8 rmpp_version;144u8 rmpp_type;145u8 rmpp_rtime_flags;146u8 rmpp_status;147__be32 seg_num;148__be32 paylen_newwin;149};150151typedef u64 __bitwise ib_sa_comp_mask;152153#define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n))154155/*156* ib_sa_hdr and ib_sa_mad structures must be packed because they have157* 64-bit fields that are only 32-bit aligned. 64-bit architectures will158* lay them out wrong otherwise. (And unfortunately they are sent on159* the wire so we can't change the layout)160*/161struct ib_sa_hdr {162__be64 sm_key;163__be16 attr_offset;164__be16 reserved;165ib_sa_comp_mask comp_mask;166} __attribute__ ((packed));167168struct ib_mad {169struct ib_mad_hdr mad_hdr;170u8 data[IB_MGMT_MAD_DATA];171};172173struct ib_rmpp_mad {174struct ib_mad_hdr mad_hdr;175struct ib_rmpp_hdr rmpp_hdr;176u8 data[IB_MGMT_RMPP_DATA];177};178179struct ib_sa_mad {180struct ib_mad_hdr mad_hdr;181struct ib_rmpp_hdr rmpp_hdr;182struct ib_sa_hdr sa_hdr;183u8 data[IB_MGMT_SA_DATA];184} __attribute__ ((packed));185186struct ib_vendor_mad {187struct ib_mad_hdr mad_hdr;188struct ib_rmpp_hdr rmpp_hdr;189u8 reserved;190u8 oui[3];191u8 data[IB_MGMT_VENDOR_DATA];192};193194struct ib_class_port_info {195u8 base_version;196u8 class_version;197__be16 capability_mask;198u8 reserved[3];199u8 resp_time_value;200u8 redirect_gid[16];201__be32 redirect_tcslfl;202__be16 redirect_lid;203__be16 redirect_pkey;204__be32 redirect_qp;205__be32 redirect_qkey;206u8 trap_gid[16];207__be32 trap_tcslfl;208__be16 trap_lid;209__be16 trap_pkey;210__be32 trap_hlqp;211__be32 trap_qkey;212};213214/**215* ib_mad_send_buf - MAD data buffer and work request for sends.216* @next: A pointer used to chain together MADs for posting.217* @mad: References an allocated MAD data buffer for MADs that do not have218* RMPP active. For MADs using RMPP, references the common and management219* class specific headers.220* @mad_agent: MAD agent that allocated the buffer.221* @ah: The address handle to use when sending the MAD.222* @context: User-controlled context fields.223* @hdr_len: Indicates the size of the data header of the MAD. This length224* includes the common MAD, RMPP, and class specific headers.225* @data_len: Indicates the total size of user-transferred data.226* @seg_count: The number of RMPP segments allocated for this send.227* @seg_size: Size of each RMPP segment.228* @timeout_ms: Time to wait for a response.229* @retries: Number of times to retry a request for a response. For MADs230* using RMPP, this applies per window. On completion, returns the number231* of retries needed to complete the transfer.232*233* Users are responsible for initializing the MAD buffer itself, with the234* exception of any RMPP header. Additional segment buffer space allocated235* beyond data_len is padding.236*/237struct ib_mad_send_buf {238struct ib_mad_send_buf *next;239void *mad;240struct ib_mad_agent *mad_agent;241struct ib_ah *ah;242void *context[2];243int hdr_len;244int data_len;245int seg_count;246int seg_size;247int timeout_ms;248int retries;249};250251/**252* ib_response_mad - Returns if the specified MAD has been generated in253* response to a sent request or trap.254*/255int ib_response_mad(struct ib_mad *mad);256257/**258* ib_get_rmpp_resptime - Returns the RMPP response time.259* @rmpp_hdr: An RMPP header.260*/261static inline u8 ib_get_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr)262{263return rmpp_hdr->rmpp_rtime_flags >> 3;264}265266/**267* ib_get_rmpp_flags - Returns the RMPP flags.268* @rmpp_hdr: An RMPP header.269*/270static inline u8 ib_get_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr)271{272return rmpp_hdr->rmpp_rtime_flags & 0x7;273}274275/**276* ib_set_rmpp_resptime - Sets the response time in an RMPP header.277* @rmpp_hdr: An RMPP header.278* @rtime: The response time to set.279*/280static inline void ib_set_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr, u8 rtime)281{282rmpp_hdr->rmpp_rtime_flags = ib_get_rmpp_flags(rmpp_hdr) | (rtime << 3);283}284285/**286* ib_set_rmpp_flags - Sets the flags in an RMPP header.287* @rmpp_hdr: An RMPP header.288* @flags: The flags to set.289*/290static inline void ib_set_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr, u8 flags)291{292rmpp_hdr->rmpp_rtime_flags = (rmpp_hdr->rmpp_rtime_flags & 0xF8) |293(flags & 0x7);294}295296struct ib_mad_agent;297struct ib_mad_send_wc;298struct ib_mad_recv_wc;299300/**301* ib_mad_send_handler - callback handler for a sent MAD.302* @mad_agent: MAD agent that sent the MAD.303* @mad_send_wc: Send work completion information on the sent MAD.304*/305typedef void (*ib_mad_send_handler)(struct ib_mad_agent *mad_agent,306struct ib_mad_send_wc *mad_send_wc);307308/**309* ib_mad_snoop_handler - Callback handler for snooping sent MADs.310* @mad_agent: MAD agent that snooped the MAD.311* @send_wr: Work request information on the sent MAD.312* @mad_send_wc: Work completion information on the sent MAD. Valid313* only for snooping that occurs on a send completion.314*315* Clients snooping MADs should not modify data referenced by the @send_wr316* or @mad_send_wc.317*/318typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent,319struct ib_mad_send_buf *send_buf,320struct ib_mad_send_wc *mad_send_wc);321322/**323* ib_mad_recv_handler - callback handler for a received MAD.324* @mad_agent: MAD agent requesting the received MAD.325* @mad_recv_wc: Received work completion information on the received MAD.326*327* MADs received in response to a send request operation will be handed to328* the user before the send operation completes. All data buffers given329* to registered agents through this routine are owned by the receiving330* client, except for snooping agents. Clients snooping MADs should not331* modify the data referenced by @mad_recv_wc.332*/333typedef void (*ib_mad_recv_handler)(struct ib_mad_agent *mad_agent,334struct ib_mad_recv_wc *mad_recv_wc);335336/**337* ib_mad_agent - Used to track MAD registration with the access layer.338* @device: Reference to device registration is on.339* @qp: Reference to QP used for sending and receiving MADs.340* @mr: Memory region for system memory usable for DMA.341* @recv_handler: Callback handler for a received MAD.342* @send_handler: Callback handler for a sent MAD.343* @snoop_handler: Callback handler for snooped sent MADs.344* @context: User-specified context associated with this registration.345* @hi_tid: Access layer assigned transaction ID for this client.346* Unsolicited MADs sent by this client will have the upper 32-bits347* of their TID set to this value.348* @port_num: Port number on which QP is registered349* @rmpp_version: If set, indicates the RMPP version used by this agent.350*/351struct ib_mad_agent {352struct ib_device *device;353struct ib_qp *qp;354struct ib_mr *mr;355ib_mad_recv_handler recv_handler;356ib_mad_send_handler send_handler;357ib_mad_snoop_handler snoop_handler;358void *context;359u32 hi_tid;360u8 port_num;361u8 rmpp_version;362};363364/**365* ib_mad_send_wc - MAD send completion information.366* @send_buf: Send MAD data buffer associated with the send MAD request.367* @status: Completion status.368* @vendor_err: Optional vendor error information returned with a failed369* request.370*/371struct ib_mad_send_wc {372struct ib_mad_send_buf *send_buf;373enum ib_wc_status status;374u32 vendor_err;375};376377/**378* ib_mad_recv_buf - received MAD buffer information.379* @list: Reference to next data buffer for a received RMPP MAD.380* @grh: References a data buffer containing the global route header.381* The data refereced by this buffer is only valid if the GRH is382* valid.383* @mad: References the start of the received MAD.384*/385struct ib_mad_recv_buf {386struct list_head list;387struct ib_grh *grh;388struct ib_mad *mad;389};390391/**392* ib_mad_recv_wc - received MAD information.393* @wc: Completion information for the received data.394* @recv_buf: Specifies the location of the received data buffer(s).395* @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers.396* @mad_len: The length of the received MAD, without duplicated headers.397*398* For received response, the wr_id contains a pointer to the ib_mad_send_buf399* for the corresponding send request.400*/401struct ib_mad_recv_wc {402struct ib_wc *wc;403struct ib_mad_recv_buf recv_buf;404struct list_head rmpp_list;405int mad_len;406};407408/**409* ib_mad_reg_req - MAD registration request410* @mgmt_class: Indicates which management class of MADs should be receive411* by the caller. This field is only required if the user wishes to412* receive unsolicited MADs, otherwise it should be 0.413* @mgmt_class_version: Indicates which version of MADs for the given414* management class to receive.415* @oui: Indicates IEEE OUI when mgmt_class is a vendor class416* in the range from 0x30 to 0x4f. Otherwise not used.417* @method_mask: The caller will receive unsolicited MADs for any method418* where @method_mask = 1.419*/420struct ib_mad_reg_req {421u8 mgmt_class;422u8 mgmt_class_version;423u8 oui[3];424DECLARE_BITMAP(method_mask, IB_MGMT_MAX_METHODS);425};426427/**428* ib_register_mad_agent - Register to send/receive MADs.429* @device: The device to register with.430* @port_num: The port on the specified device to use.431* @qp_type: Specifies which QP to access. Must be either432* IB_QPT_SMI or IB_QPT_GSI.433* @mad_reg_req: Specifies which unsolicited MADs should be received434* by the caller. This parameter may be NULL if the caller only435* wishes to receive solicited responses.436* @rmpp_version: If set, indicates that the client will send437* and receive MADs that contain the RMPP header for the given version.438* If set to 0, indicates that RMPP is not used by this client.439* @send_handler: The completion callback routine invoked after a send440* request has completed.441* @recv_handler: The completion callback routine invoked for a received442* MAD.443* @context: User specified context associated with the registration.444*/445struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,446u8 port_num,447enum ib_qp_type qp_type,448struct ib_mad_reg_req *mad_reg_req,449u8 rmpp_version,450ib_mad_send_handler send_handler,451ib_mad_recv_handler recv_handler,452void *context);453454enum ib_mad_snoop_flags {455/*IB_MAD_SNOOP_POSTED_SENDS = 1,*/456/*IB_MAD_SNOOP_RMPP_SENDS = (1<<1),*/457IB_MAD_SNOOP_SEND_COMPLETIONS = (1<<2),458/*IB_MAD_SNOOP_RMPP_SEND_COMPLETIONS = (1<<3),*/459IB_MAD_SNOOP_RECVS = (1<<4)460/*IB_MAD_SNOOP_RMPP_RECVS = (1<<5),*/461/*IB_MAD_SNOOP_REDIRECTED_QPS = (1<<6)*/462};463464/**465* ib_register_mad_snoop - Register to snoop sent and received MADs.466* @device: The device to register with.467* @port_num: The port on the specified device to use.468* @qp_type: Specifies which QP traffic to snoop. Must be either469* IB_QPT_SMI or IB_QPT_GSI.470* @mad_snoop_flags: Specifies information where snooping occurs.471* @send_handler: The callback routine invoked for a snooped send.472* @recv_handler: The callback routine invoked for a snooped receive.473* @context: User specified context associated with the registration.474*/475struct ib_mad_agent *ib_register_mad_snoop(struct ib_device *device,476u8 port_num,477enum ib_qp_type qp_type,478int mad_snoop_flags,479ib_mad_snoop_handler snoop_handler,480ib_mad_recv_handler recv_handler,481void *context);482483/**484* ib_unregister_mad_agent - Unregisters a client from using MAD services.485* @mad_agent: Corresponding MAD registration request to deregister.486*487* After invoking this routine, MAD services are no longer usable by the488* client on the associated QP.489*/490int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent);491492/**493* ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated494* with the registered client.495* @send_buf: Specifies the information needed to send the MAD(s).496* @bad_send_buf: Specifies the MAD on which an error was encountered. This497* parameter is optional if only a single MAD is posted.498*499* Sent MADs are not guaranteed to complete in the order that they were posted.500*501* If the MAD requires RMPP, the data buffer should contain a single copy502* of the common MAD, RMPP, and class specific headers, followed by the class503* defined data. If the class defined data would not divide evenly into504* RMPP segments, then space must be allocated at the end of the referenced505* buffer for any required padding. To indicate the amount of class defined506* data being transferred, the paylen_newwin field in the RMPP header should507* be set to the size of the class specific header plus the amount of class508* defined data being transferred. The paylen_newwin field should be509* specified in network-byte order.510*/511int ib_post_send_mad(struct ib_mad_send_buf *send_buf,512struct ib_mad_send_buf **bad_send_buf);513514515/**516* ib_free_recv_mad - Returns data buffers used to receive a MAD.517* @mad_recv_wc: Work completion information for a received MAD.518*519* Clients receiving MADs through their ib_mad_recv_handler must call this520* routine to return the work completion buffers to the access layer.521*/522void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc);523524/**525* ib_cancel_mad - Cancels an outstanding send MAD operation.526* @mad_agent: Specifies the registration associated with sent MAD.527* @send_buf: Indicates the MAD to cancel.528*529* MADs will be returned to the user through the corresponding530* ib_mad_send_handler.531*/532void ib_cancel_mad(struct ib_mad_agent *mad_agent,533struct ib_mad_send_buf *send_buf);534535/**536* ib_modify_mad - Modifies an outstanding send MAD operation.537* @mad_agent: Specifies the registration associated with sent MAD.538* @send_buf: Indicates the MAD to modify.539* @timeout_ms: New timeout value for sent MAD.540*541* This call will reset the timeout value for a sent MAD to the specified542* value.543*/544int ib_modify_mad(struct ib_mad_agent *mad_agent,545struct ib_mad_send_buf *send_buf, u32 timeout_ms);546547/**548* ib_redirect_mad_qp - Registers a QP for MAD services.549* @qp: Reference to a QP that requires MAD services.550* @rmpp_version: If set, indicates that the client will send551* and receive MADs that contain the RMPP header for the given version.552* If set to 0, indicates that RMPP is not used by this client.553* @send_handler: The completion callback routine invoked after a send554* request has completed.555* @recv_handler: The completion callback routine invoked for a received556* MAD.557* @context: User specified context associated with the registration.558*559* Use of this call allows clients to use MAD services, such as RMPP,560* on user-owned QPs. After calling this routine, users may send561* MADs on the specified QP by calling ib_mad_post_send.562*/563struct ib_mad_agent *ib_redirect_mad_qp(struct ib_qp *qp,564u8 rmpp_version,565ib_mad_send_handler send_handler,566ib_mad_recv_handler recv_handler,567void *context);568569/**570* ib_process_mad_wc - Processes a work completion associated with a571* MAD sent or received on a redirected QP.572* @mad_agent: Specifies the registered MAD service using the redirected QP.573* @wc: References a work completion associated with a sent or received574* MAD segment.575*576* This routine is used to complete or continue processing on a MAD request.577* If the work completion is associated with a send operation, calling578* this routine is required to continue an RMPP transfer or to wait for a579* corresponding response, if it is a request. If the work completion is580* associated with a receive operation, calling this routine is required to581* process an inbound or outbound RMPP transfer, or to match a response MAD582* with its corresponding request.583*/584int ib_process_mad_wc(struct ib_mad_agent *mad_agent,585struct ib_wc *wc);586587/**588* ib_create_send_mad - Allocate and initialize a data buffer and work request589* for sending a MAD.590* @mad_agent: Specifies the registered MAD service to associate with the MAD.591* @remote_qpn: Specifies the QPN of the receiving node.592* @pkey_index: Specifies which PKey the MAD will be sent using. This field593* is valid only if the remote_qpn is QP 1.594* @rmpp_active: Indicates if the send will enable RMPP.595* @hdr_len: Indicates the size of the data header of the MAD. This length596* should include the common MAD header, RMPP header, plus any class597* specific header.598* @data_len: Indicates the size of any user-transferred data. The call will599* automatically adjust the allocated buffer size to account for any600* additional padding that may be necessary.601* @gfp_mask: GFP mask used for the memory allocation.602*603* This routine allocates a MAD for sending. The returned MAD send buffer604* will reference a data buffer usable for sending a MAD, along605* with an initialized work request structure. Users may modify the returned606* MAD data buffer before posting the send.607*608* The returned MAD header, class specific headers, and any padding will be609* cleared. Users are responsible for initializing the common MAD header,610* any class specific header, and MAD data area.611* If @rmpp_active is set, the RMPP header will be initialized for sending.612*/613struct ib_mad_send_buf *ib_create_send_mad(struct ib_mad_agent *mad_agent,614u32 remote_qpn, u16 pkey_index,615int rmpp_active,616int hdr_len, int data_len,617gfp_t gfp_mask);618619/**620* ib_is_mad_class_rmpp - returns whether given management class621* supports RMPP.622* @mgmt_class: management class623*624* This routine returns whether the management class supports RMPP.625*/626int ib_is_mad_class_rmpp(u8 mgmt_class);627628/**629* ib_get_mad_data_offset - returns the data offset for a given630* management class.631* @mgmt_class: management class632*633* This routine returns the data offset in the MAD for the management634* class requested.635*/636int ib_get_mad_data_offset(u8 mgmt_class);637638/**639* ib_get_rmpp_segment - returns the data buffer for a given RMPP segment.640* @send_buf: Previously allocated send data buffer.641* @seg_num: number of segment to return642*643* This routine returns a pointer to the data buffer of an RMPP MAD.644* Users must provide synchronization to @send_buf around this call.645*/646void *ib_get_rmpp_segment(struct ib_mad_send_buf *send_buf, int seg_num);647648/**649* ib_free_send_mad - Returns data buffers used to send a MAD.650* @send_buf: Previously allocated send data buffer.651*/652void ib_free_send_mad(struct ib_mad_send_buf *send_buf);653654#endif /* IB_MAD_H */655656657