dlpistub.c revision e11c3f44f531fdff80941ce57c065d2ae861cefc
/*
* 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.
*/
/*
* DLPI stub driver; currently supports VNI and IPMP stub devices.
*/
#include <sys/id_space.h>
#include <sys/sysmacros.h>
#include "dlpistub_impl.h"
static id_space_t *ds_minors;
static dev_info_t *ds_dip;
/*
* DL_INFO_ACK template.
*/
static dl_info_ack_t ds_infoack = {
DL_INFO_ACK, /* dl_primitive */
0, /* dl_max_sdu */
0, /* dl_min_sdu */
0, /* dl_addr_length */
0, /* dl_mac_type */
0, /* dl_reserved */
0, /* dl_current_state */
0, /* dl_sap_length */
DL_CLDLS, /* dl_service_mode */
0, /* dl_qos_length */
0, /* dl_qos_offset */
0, /* dl_qos_range_length */
0, /* dl_qos_range_offset */
DL_STYLE2, /* dl_provider_style */
0, /* dl_addr_offset */
DL_VERSION_2, /* dl_version */
0, /* dl_brdcst_addr_length */
0, /* dl_brdcst_addr_offset */
0 /* dl_growth */
};
static int
{
if (cmd != DDI_ATTACH)
return (DDI_FAILURE);
DDI_PSEUDO, 0) == DDI_FAILURE ||
DDI_PSEUDO, 0) == DDI_FAILURE) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/* ARGSUSED */
static int
{
int error = DDI_FAILURE;
switch (infocmd) {
case DDI_INFO_DEVT2INSTANCE:
*result = (void *)0;
error = DDI_SUCCESS;
break;
case DDI_INFO_DEVT2DEVINFO:
error = DDI_SUCCESS;
}
break;
}
return (error);
}
/* ARGSUSED */
static int
{
int type;
return (EINVAL);
return (0);
case DS_MINOR_VNI:
type = SUNW_DL_VNI;
break;
case DS_MINOR_IPMP:
type = SUNW_DL_IPMP;
break;
default:
return (ENXIO);
}
qprocson(q);
return (0);
}
/* ARGSUSED */
static int
{
qprocsoff(q);
return (0);
}
static int
{
return (0);
}
static int
{
return (0);
}
static int
{
union DL_primitives *dlp;
case M_PROTO:
case M_PCPROTO:
return (0);
}
switch (prim) {
case DL_ATTACH_REQ:
break;
case DL_BIND_REQ:
break;
case DL_INFO_REQ:
*dlip = ds_infoack;
}
break;
case DL_PHYS_ADDR_REQ:
break;
case DL_UNBIND_REQ:
break;
case DL_DETACH_REQ:
break;
case DL_UNITDATA_REQ:
break;
default:
}
break;
case M_IOCTL:
break;
case M_FLUSH:
else
break;
default:
break;
}
return (0);
}
static struct module_info ds_minfo = {
DS_IDNUM, /* mi_idnum */
"dlpistub", /* mi_idname */
0, /* mi_minpsz */
INFPSZ, /* mi_maxpsz */
0, /* mi_hiwat */
0, /* mi_lowat */
};
NULL, /* qi_putp */
NULL, /* qi_srvp */
ds_open, /* qi_qopen */
ds_close, /* qi_qclose */
NULL, /* qi_qadmin */
&ds_minfo, /* qi_minfo */
};
ds_wput, /* qi_putp */
NULL, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&ds_minfo, /* qi_minfo */
};
&ds_rinit, /* st_rdinit */
&ds_winit /* st_wrinit */
};
"DLPI stub driver",
&ds_ops,
};
static struct modlinkage modlinkage = {
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}