| 1 |
/* |
| 2 |
* Copyright (c) 2013. Intel Corporation. All rights reserved. |
| 3 |
* Copyright (c) 2006-2012. QLogic Corporation. All rights reserved. |
| 4 |
* Copyright (c) 2003-2006, PathScale, Inc. All rights reserved. |
| 5 |
* |
| 6 |
* This software is available to you under a choice of one of two |
| 7 |
* licenses. You may choose to be licensed under the terms of the GNU |
| 8 |
* General Public License (GPL) Version 2, available from the file |
| 9 |
* COPYING in the main directory of this source tree, or the |
| 10 |
* OpenIB.org BSD license below: |
| 11 |
* |
| 12 |
* Redistribution and use in source and binary forms, with or |
| 13 |
* without modification, are permitted provided that the following |
| 14 |
* conditions are met: |
| 15 |
* |
| 16 |
* - Redistributions of source code must retain the above |
| 17 |
* copyright notice, this list of conditions and the following |
| 18 |
* disclaimer. |
| 19 |
* |
| 20 |
* - Redistributions in binary form must reproduce the above |
| 21 |
* copyright notice, this list of conditions and the following |
| 22 |
* disclaimer in the documentation and/or other materials |
| 23 |
* provided with the distribution. |
| 24 |
* |
| 25 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 26 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 27 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 28 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 29 |
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 30 |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 31 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 32 |
* SOFTWARE. |
| 33 |
*/ |
| 34 |
|
| 35 |
#ifndef _IPS_PROTO_AM_H |
| 36 |
#define _IPS_PROTO_AM_H |
| 37 |
|
| 38 |
#include "psm_user.h" |
| 39 |
#include "ips_scb.h" |
| 40 |
|
| 41 |
#define PSM_AM_HDR_QWORDS 2 /* Needs to be at least 2 */ |
| 42 |
|
| 43 |
struct ips_proto_am { |
| 44 |
struct ips_proto *proto; /* back pointer */ |
| 45 |
struct ips_scbctrl *scbc_request; |
| 46 |
struct ips_scbctrl scbc_reply; |
| 47 |
|
| 48 |
uint64_t amreply_nobufs; |
| 49 |
}; |
| 50 |
|
| 51 |
psm_error_t |
| 52 |
ips_am_short_reply(psm_am_token_t tok, |
| 53 |
psm_handler_t handler, psm_amarg_t *args, int nargs, |
| 54 |
void *src, size_t len, int flags, |
| 55 |
psm_am_completion_fn_t completion_fn, |
| 56 |
void *completion_ctxt); |
| 57 |
|
| 58 |
psm_error_t |
| 59 |
ips_am_short_request(psm_epaddr_t epaddr, |
| 60 |
psm_handler_t handler, psm_amarg_t *args, int nargs, |
| 61 |
void *src, size_t len, int flags, |
| 62 |
psm_am_completion_fn_t completion_fn, |
| 63 |
void *completion_ctxt); |
| 64 |
|
| 65 |
psm_error_t ips_proto_am_init(struct ips_proto *proto, int num_of_send_bufs, |
| 66 |
int num_of_send_desc, uint32_t imm_size, |
| 67 |
struct ips_proto_am *proto_am); |
| 68 |
|
| 69 |
psm_error_t ips_proto_am_fini(struct ips_proto_am *proto_am); |
| 70 |
|
| 71 |
#endif /* _IPS_PROTO_AM_H */ |