/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* passed in cmd and a pointer to the appropriate structure (i.e.
* hci1394_ioctl_wrreg_t) is passed in arg.
*/
/* HCI1394_IOCTL_READ_SELFID for 32-bit apps in 64-bit kernel */
typedef struct hci1394_ioctl_readselfid32_s {
int mode);
int mode);
int mode);
int mode);
int mode);
int mode);
int mode);
int mode);
int mode);
int mode);
#ifdef _MULTI_DATAMODEL
#endif
/* ARGSUSED */
int
int *rvalp)
{
int instance;
int status;
if (instance == -1) {
"");
return (EBADF);
}
if (soft_state == NULL) {
"");
return (EBADF);
}
status = 0;
switch (cmd) {
case HCI1394_IOCTL_WRITE_REG:
break;
case HCI1394_IOCTL_READ_REG:
break;
case HCI1394_IOCTL_READ_VREG:
break;
case HCI1394_IOCTL_WRITE_VREG:
break;
case HCI1394_IOCTL_RESET_BUS:
break;
case HCI1394_IOCTL_SELFID_CNT:
mode);
break;
case HCI1394_IOCTL_BUSGEN_CNT:
mode);
break;
mode);
break;
case HCI1394_IOCTL_READ_PHY:
break;
case HCI1394_IOCTL_WRITE_PHY:
break;
case HCI1394_IOCTL_HBA_INFO:
break;
default:
/*
* if we don't know what the ioctl is, forward it on to the
* services layer. The services layer will handle the devctl
* ioctl's along with any services layer private ioctls that
* it has defined.
*/
break;
}
return (status);
}
static int
{
int status;
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
return (0);
}
static int
{
int status;
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
return (0);
}
static int
{
int status;
"");
mode);
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
if (status != DDI_SUCCESS) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
return (0);
}
static int
{
int status;
"");
mode);
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
if (status != DDI_SUCCESS) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
return (0);
}
static int
{
int status;
HCI1394_TNF_HAL_STACK, "");
sizeof (hci1394_ioctl_selfid_cnt_t), mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
HCI1394_TNF_HAL_STACK, "");
return (0);
}
static int
{
int status;
HCI1394_TNF_HAL_STACK, "");
sizeof (hci1394_ioctl_busgen_cnt_t), mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
HCI1394_TNF_HAL_STACK, "");
return (0);
}
static int
{
int status;
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
if (status != DDI_SUCCESS) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
return (0);
}
static int
{
int status;
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
if (status != DDI_SUCCESS) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
if (status != 0) {
"");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
return (0);
}
static int
{
int status;
HCI1394_TNF_HAL_STACK, "");
mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
HCI1394_TNF_HAL_STACK, "");
return (0);
}
static int
{
int status;
#ifdef _MULTI_DATAMODEL
#endif
HCI1394_TNF_HAL_STACK, "");
#ifdef _MULTI_DATAMODEL
/* 32-bit app in 64-bit kernel */
case DDI_MODEL_ILP32:
/* copy in the 32-bit version of the args */
sizeof (hci1394_ioctl_readselfid32_t), mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
/*
* Use a special function to process the 32-bit user address
* pointer embedded in the structure we pass in arg.
*/
&read_selfid32, mode);
return (status);
default:
break;
}
#endif
/*
* if we got here, we either are a 64-bit app in a 64-bit kernel or a
* 32-bit app in a 32-bit kernel
*/
/* copy in the args. We don't need to do any special conversions */
sizeof (hci1394_ioctl_read_selfid_t), mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
/*
* make sure we are not trying to copy more data than the selfid buffer
* can hold. count is in quadlets and max_selfid_size is in bytes.
*/
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
/*
* copy the selfid buffer one word at a time into the user buffer. The
* combination between having to do ddi_get32's (for endian reasons)
* and a ddi_copyout() make it easier to do it one word at a time.
*/
/* read word from selfid buffer */
/* copy the selfid word into the user buffer */
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
}
HCI1394_TNF_HAL_STACK, "");
return (0);
}
#ifdef _MULTI_DATAMODEL
static int
{
int status;
HCI1394_TNF_HAL_STACK, "");
/*
* make sure we are not trying to copy more data than the selfid buffer
* can hold. count is in quadlets and max_selfid_size is in bytes.
*/
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EINVAL);
}
/*
* copy the selfid buffer one word at a time into the user buffer. The
* combination between having to do ddi_get32's (for endian reasons) and
* a ddi_copyout() make it easier to do it one word at a time.
*/
/* read word from selfid buffer */
/* copy the selfid word into the user buffer */
4, mode);
if (status != 0) {
HCI1394_TNF_HAL_ERROR, "");
HCI1394_TNF_HAL_STACK, "");
return (EFAULT);
}
}
HCI1394_TNF_HAL_STACK, "");
return (0);
}
#endif