#include <sys/stat.h> #include <sys/sunddi.h>int ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type, minor_t minor_num, char *node_type, int flag);
Solaris DDI specific (Solaris DDI).
A pointer to the device's dev_info structure.
The name of this particular minor device.
S_IFCHR or S_IFBLK for character or block minor devices respectively.
The minor number for this particular minor device.
For serial ports
For on board serial ports
For dial out ports
For on board dial out ports
For hard disks
For hard disks with channel or target numbers
For CDROM drives
For CDROM drives with channel or target numbers
For floppy disks
For tape drives
For DLPI style 1 or style 2 network devices
For display devices
For pseudo devices
If the device is a clone device then this flag is set to CLONE_DEV else it is set to 0.
ddi_create_minor_node() provides the necessary information to enable the system to create the /dev and /devices hierarchies. The name is used to create the minor name of the block or character special file under the /devices hierarchy. At-sign (@), slash (/), and space are not allowed. The spec_type specifies whether this is a block or character device. The minor_num is the minor number for the device. The node_type is used to create the names in the /dev hierarchy that refers to the names in the /devices hierarchy. See disks(1M), ports(1M), tapes(1M), devlinks(1M). Finally flag determines if this is a clone device or not, and what device class the node belongs to.
Was able to allocate memory, create the minor data structure, and place it into the linked list of minor devices for this driver.
Minor node creation failed.
The following example creates a data structure describing a minor device called foo which has a minor number of 0. It is of type DDI_NT_BLOCK (a block device) and it is not a clone device.
ddi_create_minor_node(dip, "foo", S_IFBLK, 0, DDI_NT_BLOCK, 0);
If the driver is for a network device (node_type DDI_NT_NET), note that the driver name will undergo the driver name constraints identified in the NOTES section of dlpi(7P). Additionally, the minor name must match the driver name for a DLPI style 2 provider. If the driver is a DLPI style 1 provider, the minor name must also match the driver name with the exception that the ppa is appended to the minor name.
Drivers must remove references to GLOBAL_DEV, NODEBOUND_DEV, NODESPECIFIC_DEV, and ENUMERATED_DEV to compile under Solaris 10 and later versions.