NAME | SYNOPSIS | PARAMETERS | DESCRIPTION | RETURN VALUES | CONTEXT | ATTRIBUTES | SEE ALSO
The device id address.
The first of two device id addresses to be compared calling ddi_devid_compare().
The second of two device id addresses to be compared calling ddi_devid_compare().
A dev_info pointer, which identifies the device.
The following device id types may be accepted by the ddi_devid_init() function:
World Wide Name associated with SCSI-3 devices.
Vendor IDand serial number associated with a SCSI device. Note: This may only be used if known to be unique; otherwise a fabricated device id must be used.
Device ID of another device. This is for layered device driver usage.
Fabricated device ID.
The length in bytes of device ID.
The return address of the device ID created by ddi_devid_init().
The following routines are used to provide unique identifiers, device IDs, for devices. Specifically, kernel modules use these interfaces to identify and locate devices, independent of the device's physical connection or its logical device name or number.
ddi_devid_compare() compares two device IDs byte-by-byte and determines both equality and sort order.
ddi_devid_sizeof() returns the number of bytes allocated for the passed in device ID (devid).
ddi_devid_init() allocates memory and initializes the opaque device ID structure. This function does not store the devid. If the device id is not derived from the device's firmware, it is the driver's responsibility to store the devid on some reliable store. When a devid_type of either DEVID_SCSI3_WWN, DEVID_SCSI_SERIAL, or DEVID_ENCAP is accepted, an array of bytes (id) must be passed in (nbytes).
When the devid_type DEVID_FAB is used, the array of bytes (id) must be NULL and the length (nbytes) must be zero. The fabricated device ids, DEVID_FAB will be initialized with the machine's host id and a timestamp.
Drivers must free the memory allocated by this function, using the ddi_devid_free() function.
ddi_devid_free() frees the memory allocated by the ddi_devid_init() function.
ddi_devid_register() registers the device ID address (devid) with the DDI framework, associating it with the dev_info passed in (dip). The drivers must register device IDs at attach time. See attach(9E).
ddi_devid_unregister() removes the device ID address from the dev_info passed in (dip). Drivers must use this function to unregister the device ID when devices are being detached. This function does not free the space allocated for the device ID. The driver must free the space allocated for the device ID, using the ddi_devid_free() function. See detach(9E).
ddi_devid_valid() validates the device ID (devid) passed in. The driver must use this function to validate any fabricated device ID that has been stored on a device.
ddi_devid_init() returns the following values:
Success.
Out of memory. An invalid devid_type was passed in.
ddi_devid_valid() returns the following values:
Valid device ID.
Invalid device ID.
ddi_devid_register() returns the following values:
Success.
Failure. The device ID is already registered or the device ID is invalid.
ddi_devid_valid() returns the following values:
Valid device ID.
Invalid device ID.
ddi_devid_compare() returns the following values:
The device ID pointed to by devid1 is less than the device ID pointed to by devid2.
The device ID pointed to by devid1 is equal to the device ID pointed to by devid2.
The device ID pointed to by devid1 is greater than the device ID pointed to by devid2.
ddi_devid_sizeof() returns the size of the devid in numbers of bytes.
These functions can be called from a user context only.
See attributes(5) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
MT-Level | Safe |
devid_compare(3DEVID), devid_deviceid_to_nmlist(3DEVID), devid_free(3DEVID), devid_free_nmlist(3DEVID), devid_get(3DEVID), devid_get_minor_name(3DEVID), devid_sizeof(3DEVID), libdevid(3LIB), attributes(5), attach(9E), detach(9E)
NAME | SYNOPSIS | PARAMETERS | DESCRIPTION | RETURN VALUES | CONTEXT | ATTRIBUTES | SEE ALSO