Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ddi_create_minor_node(9F) — SunOS 5.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

add_drv(1M)

devlinks(1M)

disks(1M)

drvconfig(1M)

ports(1M)

tapes(1M)

attach(9E)

ddi_remove_minor_node(9F)

ddi_create_minor_node(9F)

NAME

ddi_create_minor_node − create a minor node for this device

SYNOPSIS

#include <sys/stat.h>
#include <sys/sunddi.h>

int ddi_create_minor_node(dev_info_t ∗dip, char ∗name, int spec_type,

int minor_num, char ∗node_type, int is_clone);

ARGUMENTS

dip A pointer to the device’s dev_info structure. 

name The name of this particular minor device. 

spec_type S_IFCHR or S_IFBLK for character or block minor devices respectively. 

minor_num The minor number for this particular minor device. 

node_type Any string that uniquely identifies the type of node.  See the following predefined node types are provided with this release See the <sys/sunddi.h> header for the predefined node types and their actual string values. 

is_clone If the device is a clone device then this flag is set to CLONE_DEV. 

INTERFACE LEVEL

Solaris architecture specific (SunDDI). 

DESCRIPTION

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 is_clone determines if this is a clone device or not. 

RETURN VALUES

ddi_create_minor_node() returns:

DDI_SUCCESS
if it was able to allocate memory, create the minor data structure, and place it into the linked list of minor devices for this driver.

DDI_FAILURE
if minor node creation failed.

EXAMPLES

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);

SEE ALSO

add_drv(1M), devlinks(1M), disks(1M), drvconfig(1M), ports(1M), tapes(1M), attach(9E), ddi_remove_minor_node(9F)
SunOS 5.1 Writing Device Drivers

SunOS 5.1  —  Last change: 31 May 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026