/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* iser.c
* DDI and core routines for Solaris iSER implementation.
*/
/* set B_TRUE for console logging */
/* Driver functions */
/* static int iser_close(dev_t, int, int, cred_t *); */
iser_open, /* open */
iser_close, /* close */
nodev, /* strategy */
nodev, /* print */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
iser_ioctl, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* prop_op */
NULL, /* stream */
D_MP, /* cb_flag */
CB_REV, /* rev */
nodev, /* int (*cb_aread)() */
nodev, /* int (*cb_awrite)() */
};
/* Device operations */
DEVO_REV, /* devo_rev, */
0, /* refcnt */
iser_getinfo, /* getinfo */
nulldev, /* identify */
nulldev, /* probe */
iser_attach, /* attach */
iser_detach, /* detach */
nodev, /* reset */
&iser_cb_ops, /* cb_ops */
NULL, /* bus ops */
NULL, /* power */
ddi_quiesce_not_needed /* quiesce */
};
/* Module Driver Info */
&iser_ops,
};
/* Module Linkage */
};
/*
* _init()
*/
int
_init(void)
{
int status;
if (status != DDI_SUCCESS) {
}
return (status);
}
/*
* _info()
*/
int
{
}
/*
* _fini()
*/
int
_fini(void)
{
int status;
if (status != DDI_SUCCESS) {
return (status);
}
return (DDI_SUCCESS);
}
/*
* iser_attach()
*/
static int
{
int instance;
int status;
switch (cmd) {
case DDI_ATTACH:
/* Initialize the open refcnt and it's lock */
iser_state->is_open_refcnt = 0;
NULL);
if (iser_taskq == NULL) {
"iser", instance);
return (DDI_FAILURE);
}
/* initialize iSER as IB service */
status = iser_ib_init();
if (status != DDI_SUCCESS) {
"iser", instance);
return (DDI_FAILURE);
}
DDI_PSEUDO, 0);
if (status != DDI_SUCCESS) {
(void) iser_ib_fini();
"iser", instance);
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
case DDI_RESUME:
return (DDI_FAILURE);
default:
return (DDI_FAILURE);
}
}
/*
* iser_detach()
*/
static int
{
if (iser_state->is_open_refcnt > 0) {
return (DDI_FAILURE);
}
switch (cmd) {
case DDI_DETACH:
if (iser_ib_fini() != DDI_SUCCESS) {
return (DDI_FAILURE);
}
if (iser_taskq != NULL) {
iser_taskq = NULL;
}
return (DDI_SUCCESS);
case DDI_SUSPEND:
return (DDI_FAILURE);
default:
return (DDI_FAILURE);
}
}
/*
* iser_getinfo()
*/
/* ARGSUSED */
static int
{
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
return (DDI_SUCCESS);
case DDI_INFO_DEVT2INSTANCE:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
}
/*
* iser_open()
*/
/* ARGSUSED */
static int
{
int status;
/* Register the transport with IDM */
status = iser_idm_register();
if (status != DDI_SUCCESS) {
"iser", instance);
return (ENXIO);
}
/* Increment our open refcnt */
return (DDI_SUCCESS);
}
/*
* iser_close()
*/
/* ARGSUSED */
static int
{
return (DDI_SUCCESS);
}
{
return (iser_ib_register_service(idm_svc));
}
{
return (iser_ib_bind_service(idm_svc));
}
void
{
}
void
{
}
/*
* iser_path_exists
* This function takes in a pair of endpoints and determines if an iSER path
* exists between the two. The actual path information (required for creating
* a RC channel) is not returned, instead a boolean value indicating if a path
* exists is returned.
*
* To use an implicit source, a value of NULL is allowed for laddr.
*/
{
int status;
}
/*
* iser_channel_alloc
* This function allocates a reliable communication channel between the
* given endpoints.
*/
{
}
/*
* iser_channel_open
* This function opens the already allocated communication channel between the
* two endpoints.
*/
{
return (iser_ib_open_rc_channel(chan));
}
/*
* iser_channel_close
* This function closes the already opened communication channel between the
* two endpoints.
*/
void
{
}
/*
* iser_channel_free
* This function frees the channel between the given endpoints
*/
void
{
}
/* ARGSUSED */
static int
int *rvalp)
{
return (DDI_SUCCESS);
}