/*
*/
/*
* This file contains code imported from the OFED rds source file message.c
* Oracle elects to have and use the contents of message.c under and governed
* by the OpenIB.org BSD license (see below for full license text). However,
* the following notice accompanied the original version of this file:
*/
/*
* Copyright (c) 2006 Oracle. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#ifndef __lock_lint
[RDSV3_EXTHDR_NONE] = 0,
[RDSV3_EXTHDR_VERSION] = sizeof (struct rdsv3_ext_header_version),
[RDSV3_EXTHDR_RDMA] = sizeof (struct rdsv3_ext_header_rdma),
[RDSV3_EXTHDR_RDMA_DEST] = sizeof (struct rdsv3_ext_header_rdma_dest),
};
#else
0,
sizeof (struct rdsv3_ext_header_version),
sizeof (struct rdsv3_ext_header_rdma),
sizeof (struct rdsv3_ext_header_rdma_dest),
};
#endif
void
{
}
/*
* This relies on dma_map_sg() not touching sg[].page during merging.
*/
static void
{
unsigned long i;
return;
/* XXX will have to put_page for page refs */
}
if (mr->r_refcount == 0) {
RDSV3_DPRINTF4("rdsv3_message_purge ASSERT 0",
return;
}
RDSV3_DPRINTF4("rdsv3_message_purge ASSERT deadbeef",
return;
}
}
}
}
void
{
RDSV3_DPRINTF5("rdsv3_message_put",
}
}
void
{
}
void
{
}
int
{
unsigned char *dst;
/* For now, refuse to add more than one extension header */
return (0);
if (type >= __RDSV3_EXTHDR_MAX ||
return (0);
if (ext_len >= RDSV3_HEADER_EXT_SPACE)
return (0);
return (1);
}
/*
* If a message has extension headers, retrieve them here.
* Call like this:
*
* unsigned int pos = 0;
*
* while (1) {
* buflen = sizeof(buffer);
* type = rdsv3_message_next_extension(hdr, &pos, buffer, &buflen);
* if (type == RDSV3_EXTHDR_NONE)
* break;
* ...
* }
*/
int
{
if (offset >= RDSV3_HEADER_EXT_SPACE)
goto none;
/*
* Get the extension type and length. For now, the
* length is implied by the extension type.
*/
goto none;
goto none;
return (ext_type);
none:
*buflen = 0;
return (RDSV3_EXTHDR_NONE);
}
int
unsigned int version)
{
}
int
unsigned int *version)
{
/*
* We assume the version extension is the only one present
*/
return (0);
return (1);
}
int
{
}
struct rdsv3_message *
{
if (!rm)
goto out;
out:
return (rm);
}
struct rdsv3_message *
{
unsigned int i;
#ifndef __lock_lint
#else
#endif
#ifndef __lock_lint
#else
#endif
page_addrs[i],
PAGE_SIZE, 0);
}
return (rm);
}
struct rdsv3_message *
{
int ret;
#ifndef __lock_lint
#else
#endif
goto out;
}
/*
* now allocate and copy in the data payload.
*/
while (total_len) {
if (ret)
goto out;
}
uiop);
if (ret) {
RDSV3_DPRINTF2("rdsv3_message_copy_from_user",
"uiomove failed");
goto out;
}
sg++;
}
ret = 0;
out:
if (ret) {
if (rm)
}
return (rm);
}
int
{
unsigned long to_copy;
unsigned long vec_off;
int copied;
int ret;
RDSV3_DPRINTF4("rdsv3_message_inc_copy_to_user",
vec_off = 0;
copied = 0;
RDSV3_DPRINTF5("rdsv3_message_inc_copy_to_user",
"copying %lu bytes to user iov %p from sg [%p, %u] + %lu\n",
if (ret)
break;
vec_off = 0;
sg++;
}
}
return (copied);
}
/*
* If the message is still on the send queue, wait until the transport
* is done with it. This is particularly important for RDMA operations.
*/
/* ARGSUSED */
void
{
}
void
{
}