man Pages(9E): DDI and DKI Driver Entry Points
只搜尋這本書
以 PDF 格式下載這本書

NAME

identify - claim to drive a device

SYNOPSIS

#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

int prefixidentify(dev_info_t * dip);

ARGUMENTS

dip
A pointer to a dev_info structure.

INTERFACE LEVEL

Solaris DDI specific (Solaris DDI). This entry point is Required. You must write it.

DESCRIPTION

identify( ) determines whether this driver drives the device pointed to by dip.

RETURN VALUES

identify( ) should return:
DDI_IDENTIFIED
if it claims to drive this device.
DDI_NOT_IDENTIFIED
if it does not claim to drive this device.

EXAMPLES

#define XX_NAME "xx"
static int xxidentify(dev_info_t * dip)
{
        if (strcmp(ddi_get_name(dip), XX_NAME) == 0) {
                /* namematches device name * /
                return(DDI_IDENTIFIED);
        } else
                return(DDI_NOT_IDENTIFIED);
}

SEE ALSO

attach(9E), ddi_get_name(9F), strcmp(9F)
Writing Device Drivers

WARNINGS

This routine may be called multiple times. It may also be called at any time. The driver should not infer anything from the the sequence or the number of times this entry point has been called.