/*
* 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
*/
/*
*/
#include <sys/priv_names.h>
/*
* tree. A regular installation will end up adding a file to sock2path.d
* announcing support for sdp using AF_INET/SOCK_STREAM/PROTO_SDP parameters in
* socket call. On a non IB hardware, following are the constraints within
* which the sdp project operates. The sdpib driver which is the real driver
* (in terms of moving data) should not be loaded since it has dependency on
* ibcm and ibtl modules which will be loaded in the memory. This will consume
* precious memory and needs to be avoided. As a result the sdpib driver
* should fail its init() call to disallow loading on other modules. Due to
* in the regular sdpib driver. During the boottime, this will cause a warning
* message when soconfig processes the entry for sdp in sock2path file . In
* order to avoid this a pseudo driver is introduced which creates an entry
* sdp subsystem, the call will end up in this driver, which then forwards
* this call to the real sdp driver. On a non-ib hardware system the call
* will fail
*/
#define SDP_DEVMINOR 0
static int
{
int ret;
if (cmd != DDI_ATTACH)
return (DDI_FAILURE);
sdp_dev_info = devi;
SDP_DEVMINOR, DDI_PSEUDO, 0);
if (ret != DDI_SUCCESS) {
return (ret);
}
return (DDI_SUCCESS);
}
static int
{
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/* open routine. */
/*ARGSUSED*/
static int
{
qprocson(q);
qenable(q);
return (0);
}
/* open routine. */
/*ARGSUSED*/
static int
{
qprocsoff(q);
return (0);
}
static int
{
int ret = 0;
if (sdp_transport_handle != 0) {
/*
* Someone beat us to it.
*/
goto done;
}
if (ibt_hw_is_present() == 0) {
goto done;
}
goto done;
}
if (ret != 0) {
goto done;
}
done:
return (ret);
}
static void
{
int ret;
/* LINTED */
case SIOCSENABLESDP:
/*
* Check for root privs.
* if not net config privs - return state of system SDP
*/
}
/*
* The sdpib driver is loaded if root enables sdp the
* first time (sdp_transport_handle is NULL). It is
* unloaded during the following first disable. At all
* other times for root as well as non-root users, the
*/
if ((send_enable == 1) &&
(sdp_transport_handle == NULL) &&
/* Initialize sdpib transport driver */
ret = sdp_open_sdpib_driver();
if (ret != 0) {
/* Transport failed to load */
enable = 0;
goto done;
}
(void) ldi_ioctl(sdp_transport_handle,
} else if (sdp_transport_handle != NULL) {
(void) ldi_ioctl(sdp_transport_handle,
(void) ldi_close(sdp_transport_handle,
}
} else {
enable = 0;
}
done:
/* ACK the ioctl */
break;
default:
}
}
/*
*/
static void
{
case M_IOCTL:
sdp_gen_ioctl(q, mp);
break;
case M_FLUSH:
else
break;
default:
return;
}
}
};
};
};
};
/*
* Module linkage information for the kernel.
*/
};
&modldrv,
};
int
_init(void)
{
int ret;
if (ret != 0)
goto done;
if (ret != 0)
done:
return (ret);
}
int
_fini(void)
{
int ret;
if (ret != 0) {
return (ret);
}
return (0);
}
int
{
}