/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Driver to control Alert and Power LEDs for the Seattle platform.
* Alert LED is also known as Service (required).
* Power LED is also known as Activity.
*/
/*
* Some #defs that must be here as they differ for power.c
* and epic.c
*/
/* dev_ops and cb_ops entry point function declarations */
epic_open, /* open */
epic_close, /* close */
nodev, /* strategy */
nodev, /* print */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
epic_ioctl, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
ddi_segmap, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* cb_prop_op */
NULL, /* streamtab - for STREAMS drivers */
};
DEVO_REV, /* driver build version */
0, /* device reference count */
nulldev, /* probe */
nulldev, /* reset */
nulldev, /* power */
ddi_quiesce_not_supported, /* devo_quiesce */
};
/*
* Soft state
*/
struct epic_softc {
};
(inst)))
/* module configuration stuff */
static void *statep;
extern struct mod_ops mod_driverops;
"epic_client driver",
};
&modldrv,
0
};
int
_init(void)
{
int e;
if ((e = ddi_soft_state_init(&statep,
sizeof (struct epic_softc), 0)) != 0) {
return (e);
}
if ((e = mod_install(&modlinkage)) != 0)
return (e);
}
int
_fini(void)
{
int e;
if ((e = mod_remove(&modlinkage)) != 0)
return (e);
return (DDI_SUCCESS);
}
int
{
}
/*ARGSUSED*/
static int
{
int inst;
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
} else
break;
case DDI_INFO_DEVT2INSTANCE:
break;
default:
}
return (retval);
}
static int
{
int inst;
int minor;
int res;
switch (cmd) {
case DDI_ATTACH:
"ddi_create_minor_node() failed for inst %d\n",
inst);
return (DDI_FAILURE);
}
/* Allocate a soft state structure for this instance */
"for inst %d\n", inst);
break;
}
/* Setup soft state */
break;
}
/* Setup device attributes */
&softc->cmd_handle);
if (res != DDI_SUCCESS) {
break;
}
return (DDI_SUCCESS);
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
/* Attach failed */
/* Free soft state, if allocated. remove minor node if added earlier */
if (softc)
return (DDI_FAILURE);
}
static int
{
int inst;
switch (cmd) {
case DDI_DETACH:
return (ENXIO);
/* Free the soft state and remove minor node added earlier */
return (DDI_SUCCESS);
case DDI_SUSPEND:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
}
/*ARGSUSED*/
static int
{
}
/*ARGSUSED*/
static int
{
}
/*ARGSUSED*/
static int
int *rvalp)
{
int inst;
struct epic_softc *softc;
return (ENXIO);
switch (cmd) {
case EPIC_SET_POWER_LED:
break;
case EPIC_RESET_POWER_LED:
break;
case EPIC_SB_BL_POWER_LED:
break;
case EPIC_FAST_BL_POWER_LED:
break;
case EPIC_SET_ALERT_LED:
break;
case EPIC_RESET_ALERT_LED:
break;
case EPIC_GET_FW:
return (EFAULT);
}
break;
default:
return (EINVAL);
}
return (0);
}