1di_walk_minor(3DEVINFOD)evice Information Library Functiondsi_walk_minor(3DEVINFO)
2
3
4

NAME

6       di_walk_minor - traverse libdevinfo minor nodes
7

SYNOPSIS

9       cc [ flag... ] file... -ldevinfo [ library... ]
10       #include <libdevinfo.h>
11
12       int di_walk_minor(di_node_t root, const char *minor_nodetype,
13            uint_t flag, void *arg, int (*minor_callback)(di_node_t node,
14            di_minor_t minor, void *arg));
15
16

PARAMETERS

18       arg               Pointer to caller- specific user data.
19
20
21       flag              Specify 0. Reserved for future use.
22
23
24       minor             The minor node visited.
25
26
27       minor_nodetype    A  character  string  specifying the minor data type,
28                         which may be one of the types defined by the  Solaris
29                         DDI   framework,   for  example,  DDI_NT_BLOCK.  NULL
30                         matches   all   minor_node    types.   See   ddi_cre‐
31                         ate_minor_node(9F).
32
33
34       node              The  device  node  with  which  to  the minor node is
35                         associated.
36
37
38       root              Root of subtree to visit.
39
40

DESCRIPTION

42       The di_walk_minor() function visits all minor nodes attached to  device
43       nodes  in  a  subtree rooted at root. For each  minor node that matches
44       minor_nodetype,  the  caller-supplied  function   minor_callback()   is
45       invoked.  The walk terminates immediately when minor_callback() returns
46       DI_WALK_TERMINATE.
47

RETURN VALUES

49       Upon successful completion, di_walk_minor() returns 0. Otherwise, -1 is
50       returned and errno is set to indicate the error.
51
52
53       The minor_callback() function returns one of the following:
54
55       DI_WALK_CONTINUE     Continue to visit subsequent minor data nodes.
56
57
58       DI_WALK_TERMINATE    Terminate the walk immediately.
59
60

ERRORS

62       The di_walk_minor() function will fail if:
63
64       EINVAL    Invalid argument.
65
66

ATTRIBUTES

68       See attributes(5) for descriptions of the following attributes:
69
70
71
72
73       ┌─────────────────────────────┬─────────────────────────────┐
74       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
75       ├─────────────────────────────┼─────────────────────────────┤
76       │Interface Stability          │Committed                    │
77       ├─────────────────────────────┼─────────────────────────────┤
78       │MT-Level                     │Safe                         │
79       └─────────────────────────────┴─────────────────────────────┘
80

SEE ALSO

82       dladm(1M),   di_minor_nodetype(3DEVINFO),   dlpi_walk(3DLPI),   libdev‐
83       info(3LIB), attributes(5), filesystem(5), ddi_create_minor_node(9F)
84
85
86       Writing Device Drivers
87

NOTES

89       The di_walk_minor() function is no longer an accurate method for  walk‐
90       ing  network datalink interfaces on the system. Applications should use
91       dlpi_walk(3DLPI) instead. It has been common for  applications  to  use
92       di_walk_minor()  to walk networking devices by passing in a minor_node‐
93       type of DDI_NT_NET, in most cases to discover the set of  DLPI  devices
94       on  the  system.  Solaris now makes a layering distinction between net‐
95       working devices (the objects displayed in the  DEVICE  field  by  dladm
96       show-phys)  and  network  datalink interfaces (the objects displayed by
97       dladm show-link). Datalink interfaces are represented  as  the  set  of
98       DLPI  device nodes that applications can open by using dlpi_open(3DLPI)
99       or by opening DLPI nodes out of the /dev/net filesystem  (see  filesys‐
100       tem(5)).  The  dlpi_walk(3DLPI) function is the proper function to walk
101       these nodes.
102
103
104
105SunOS 5.11                        14 Jan 2009          di_walk_minor(3DEVINFO)
Impressum