1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
24 */
25
26/*
27 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
28 * Use is subject to license terms.
29 */
30
31/*
32 *
33 * MODULE: dapl_ep_post_rdma_write.c
34 *
35 * PURPOSE: Endpoint management
36 * Description: Interfaces in this file are completely described in
37 *		the DAPL 1.1 API, Chapter 6, section 5
38 *
39 * $Id: dapl_ep_post_rdma_write.c,v 1.7 2003/07/30 18:13:37 hobie16 Exp $
40 */
41
42#include "dapl_ep_util.h"
43
44/*
45 * dapl_ep_post_rdma_write
46 *
47 * DAPL Requirements Version xxx, 6.5.13
48 *
49 * Request the xfer of all data specified by the local_iov over the
50 * connection of ep handle Endpint into the remote_iov
51 *
52 * Input:
53 * 	ep_handle
54 * 	num_segments
55 * 	local_iov
56 * 	user_cookie
57 * 	remote_iov
58 * 	compltion_flags
59 *
60 * Output:
61 * 	None.
62 *
63 * Returns:
64 *	DAT_SUCCESS
65 *	DAT_INSUFFICIENT_RESOURCES
66 *	DAT_INVALID_PARAMETER
67 *	DAT_INVALID_STATE
68 *	DAT_LENGTH_ERROR
69 *	DAT_PROTECTION_VIOLATION
70 *	DAT_PRIVILEGES_VIOLATION
71 */
72DAT_RETURN
73dapl_ep_post_rdma_write(
74	IN	DAT_EP_HANDLE		ep_handle,
75	IN	DAT_COUNT		num_segments,
76	IN	DAT_LMR_TRIPLET		*local_iov,
77	IN	DAT_DTO_COOKIE		user_cookie,
78	IN	const DAT_RMR_TRIPLET	*remote_iov,
79	IN	DAT_COMPLETION_FLAGS	completion_flags)
80{
81	DAT_RETURN		dat_status;
82
83	dapl_dbg_log(DAPL_DBG_TYPE_API,
84	    "dapl_ep_post_rdma_write(%p, %d, %p, %p, %p, %x)\n",
85	    ep_handle,
86	    num_segments,
87	    local_iov,
88	    user_cookie.as_64,
89	    remote_iov,
90	    completion_flags);
91
92	dat_status = dapl_ep_post_send_req(ep_handle,
93	    num_segments,
94	    local_iov,
95	    user_cookie,
96	    remote_iov,
97	    completion_flags,
98	    DAPL_DTO_TYPE_RDMA_WRITE,
99	    OP_RDMA_WRITE);
100
101	dapl_dbg_log(DAPL_DBG_TYPE_RTN,
102	    "dapl_ep_post_rdma_write () returns 0x%x", dat_status);
103
104	return (dat_status);
105}
106