rdsib_arp.c revision 8257fab973a69800a3a3309e8af21fc1876d2df9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/pathname.h>
/*
* rds_get_ibaddr_complete
*/
static int
{
/*
* lock is held by the caller and is released after
* this function returns
*/
return (0);
}
/*
* Process messages based on queue type.
*/
static int
{
}
} else {
}
return (0);
}
/*
* Lower write service procedure.
* Used when lower streams are flow controlled.
*/
static int
{
if (canputnext(q)) {
} else {
qenable(q);
break;
}
}
return (0);
}
/*
*/
static int
{
case M_FLUSH:
/*
* Turn around
*/
return (0);
}
break;
case M_IOCACK:
case M_IOCNAK:
case M_DATA:
/*
* This could be in interrupt context.
* Some of the ibt calls cannot be called in
* interrupt context, so
* put it in the queue and the message will be
* processed by service proccedure
*/
qenable(q);
break;
default:
ASSERT(0);
break;
}
return (0);
}
/*
* Streams write queue module info
*/
static struct module_info rds_winfo = {
99, /* module ID number */
"rds", /* module name */
0, /* min packet size */
49152, /* STREAM queue high water mark -- 49152 */
12 /* STREAM queue low water mark -- 12 */
};
/*
*/
static struct qinit rds_lwinit = {
NULL, /* qi_putp */
rds_lwsrv, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&rds_winfo, /* module info */
NULL, /* module statistics struct */
NULL,
NULL,
STRUIOT_NONE /* stream uio type is standard uiomove() */
};
/*
*/
static struct qinit rds_lrinit = {
rds_lrput, /* qi_putp */
rds_lrsrv, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&rds_winfo, /* module info */
NULL, /* module statistics struct */
NULL,
NULL,
STRUIOT_NONE /* stream uio type is standard uiomove() */
};
int
{
int error;
/* open the driver from inside the kernel */
0, NULL);
if (error) {
path);
return (error);
}
return (0);
}
/*
* Unlink ip, rds, icmp6 drivers
*/
/* ARGSUSED */
int
{
int rc;
}
return (0);
}
int
{
}
return (0);
}
/*
* Link ip, rds drivers below rds
*/
int
{
int rc;
return (rc);
}
return (0);
}
typedef struct rds_get_ibaddr_args_s {
int ret;
void
rds_get_ibaddr_impl(void *arg)
{
int ret;
if (ret != 0) {
return;
}
if (ret == 0) {
}
(void) rds_unlink_drivers(rdss);
}
}
/*
* Return 0 for SUCCESS
* Return NON-ZERO for FAILURE
*/
int
{
int ret;
destip);
sizeof (rds_get_ibaddr_args_t), KM_SLEEP);
/*
* To prevent cv_signal to be called before cv_wait grab the lock
* before taskq_dispatch
*/
(void *)argsp, DDI_NOSLEEP);
if (ret != DDI_SUCCESS) {
return (ret);
}
/* wait here for rds_get_ibaddr_impl to complete */
if (ret == 0) {
/*
* Sometimes arp returns the gids from the cache even when
* the port is down. So, check here if there is actually an
* available path to the destination
*/
if (ret != IBT_SUCCESS) {
RDS_DPRINTF2("rds_get_ibaddr",
"ibt_get_paths failed: %d", ret);
}
}
return (ret);
}