xref: /openbmc/linux/drivers/infiniband/sw/rdmavt/mad.h (revision fe314195)
13dd1faf8SDennis Dalessandro #ifndef DEF_RVTMAD_H
23dd1faf8SDennis Dalessandro #define DEF_RVTMAD_H
33dd1faf8SDennis Dalessandro 
43dd1faf8SDennis Dalessandro /*
5fe314195SDennis Dalessandro  * Copyright(c) 2016 Intel Corporation.
63dd1faf8SDennis Dalessandro  *
73dd1faf8SDennis Dalessandro  * This file is provided under a dual BSD/GPLv2 license.  When using or
83dd1faf8SDennis Dalessandro  * redistributing this file, you may do so under either license.
93dd1faf8SDennis Dalessandro  *
103dd1faf8SDennis Dalessandro  * GPL LICENSE SUMMARY
113dd1faf8SDennis Dalessandro  *
123dd1faf8SDennis Dalessandro  * This program is free software; you can redistribute it and/or modify
133dd1faf8SDennis Dalessandro  * it under the terms of version 2 of the GNU General Public License as
143dd1faf8SDennis Dalessandro  * published by the Free Software Foundation.
153dd1faf8SDennis Dalessandro  *
163dd1faf8SDennis Dalessandro  * This program is distributed in the hope that it will be useful, but
173dd1faf8SDennis Dalessandro  * WITHOUT ANY WARRANTY; without even the implied warranty of
183dd1faf8SDennis Dalessandro  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
193dd1faf8SDennis Dalessandro  * General Public License for more details.
203dd1faf8SDennis Dalessandro  *
213dd1faf8SDennis Dalessandro  * BSD LICENSE
223dd1faf8SDennis Dalessandro  *
233dd1faf8SDennis Dalessandro  * Redistribution and use in source and binary forms, with or without
243dd1faf8SDennis Dalessandro  * modification, are permitted provided that the following conditions
253dd1faf8SDennis Dalessandro  * are met:
263dd1faf8SDennis Dalessandro  *
273dd1faf8SDennis Dalessandro  *  - Redistributions of source code must retain the above copyright
283dd1faf8SDennis Dalessandro  *    notice, this list of conditions and the following disclaimer.
293dd1faf8SDennis Dalessandro  *  - Redistributions in binary form must reproduce the above copyright
303dd1faf8SDennis Dalessandro  *    notice, this list of conditions and the following disclaimer in
313dd1faf8SDennis Dalessandro  *    the documentation and/or other materials provided with the
323dd1faf8SDennis Dalessandro  *    distribution.
333dd1faf8SDennis Dalessandro  *  - Neither the name of Intel Corporation nor the names of its
343dd1faf8SDennis Dalessandro  *    contributors may be used to endorse or promote products derived
353dd1faf8SDennis Dalessandro  *    from this software without specific prior written permission.
363dd1faf8SDennis Dalessandro  *
373dd1faf8SDennis Dalessandro  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
383dd1faf8SDennis Dalessandro  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
393dd1faf8SDennis Dalessandro  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
403dd1faf8SDennis Dalessandro  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
413dd1faf8SDennis Dalessandro  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
423dd1faf8SDennis Dalessandro  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
433dd1faf8SDennis Dalessandro  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
443dd1faf8SDennis Dalessandro  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
453dd1faf8SDennis Dalessandro  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
463dd1faf8SDennis Dalessandro  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
473dd1faf8SDennis Dalessandro  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
483dd1faf8SDennis Dalessandro  *
493dd1faf8SDennis Dalessandro  */
503dd1faf8SDennis Dalessandro 
513dd1faf8SDennis Dalessandro #include <rdma/rdma_vt.h>
523dd1faf8SDennis Dalessandro 
533dd1faf8SDennis Dalessandro int rvt_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
543dd1faf8SDennis Dalessandro 		    const struct ib_wc *in_wc, const struct ib_grh *in_grh,
553dd1faf8SDennis Dalessandro 		    const struct ib_mad_hdr *in, size_t in_mad_size,
563dd1faf8SDennis Dalessandro 		    struct ib_mad_hdr *out, size_t *out_mad_size,
573dd1faf8SDennis Dalessandro 		    u16 *out_mad_pkey_index);
583711baf2SDennis Dalessandro int rvt_create_mad_agents(struct rvt_dev_info *rdi);
593711baf2SDennis Dalessandro void rvt_free_mad_agents(struct rvt_dev_info *rdi);
603dd1faf8SDennis Dalessandro #endif          /* DEF_RVTMAD_H */
61