Exemple #1
0
/*---------------------------------------------------------------------------*
 *	i4bopen - device driver open routine
 *---------------------------------------------------------------------------*/
PDEVSTATIC int
i4bopen(struct dev_open_args *ap)
{
    cdev_t dev = ap->a_head.a_dev;

    if (minor(dev))
        return(ENXIO);
    if (openflag)
        return(EBUSY);
    crit_enter();
    openflag = 1;
    i4b_l4_daemon_attached();
    crit_exit();

    return(0);
}
Exemple #2
0
/*---------------------------------------------------------------------------*
 *	i4bopen - device driver open routine
 *---------------------------------------------------------------------------*/
PDEVSTATIC int
i4bopen(dev_t dev, int flag, int fmt, struct proc *p)
{
	int x;
	
	if(minor(dev))
		return(ENXIO);

	if(openflag)
		return(EBUSY);
	
	x = splimp();
	openflag = 1;
	i4b_l4_daemon_attached();
	splx(x);
	
	return(0);
}
Exemple #3
0
/*---------------------------------------------------------------------------*
 *	i4bopen - device driver open routine
 *---------------------------------------------------------------------------*/
PDEVSTATIC int
isdnopen(dev_t dev, int flag, int fmt, struct lwp *l)
{
	int x;

	if(minor(dev))
		return(ENXIO);

	if(openflag)
		return(EBUSY);

	x = splnet();
	openflag = 1;
	i4b_l4_daemon_attached();
	splx(x);

	return(0);
}