hwgraph.inv(D3X)hwgraph.inv(D3X)NAME
hwgraph.inv: device_inventory_add, device_inventory_get_next,
device_controller_num_get, device_controller_num_set - device inventory
information
SYNOPSIS
#include <sys/types.h>
#include <sys/hwgraph.h>
#include <sys/ddi.h>
#include <sys/invent.h>
void
device_inventory_add(dev_t device,
int class,
int type,
major_t ctlr,
minor_t unit,
int state);
inventory_t *
device_inventory_get_next(dev_t device, invplace_t * place);
void
device_controller_num_set(dev_t device, int ctlr);
int
device_controller_num_get(dev_t device);
Arguments
class Inventory class to assign, from sys/invent.h.
ctlr Controller sequence number to assign.
device Vertex handle of a device vertex.
place Address of a variable to hold the current position in a scan
of inventory records.
state Arbitrary device state to assign.
type Inventory device type to assign, from sys/invent.h.
unit Device unit number to assign.
DESCRIPTION
These functions manage the hardware inventory information. In previous
releases of IRIX, the hardware inventory as reported by hinv(1) and
getinvent(3) was maintained as a table in kernel memory. Now the same
information is distributed throughout the hwgraph. After creating a
device vertex as described in hwgraph.dev(D3X), the driver can attach
inventory information to the new vertex using device_inventory_add().
Page 1
hwgraph.inv(D3X)hwgraph.inv(D3X)
Normally only a single inventory record is attached to a vertex, but
multiple records are supported. To read the first or all inventory
records call device_inventory_get_next(). Initially the variable
addressed by place should contain NULL to indicate "first." The first
inventory record is returned (if any exist), and the position is noted.
Subsequent calls return further records if they exist.
To read out the controller number from the first or only inventory
record, call device_controller_num_get(). This is the means of
discovering the controller number assigned by the ioconfig(1) program.
DIAGNOSTICSdevice_inventory_get_next() returns NULL when no (further) inventory
record exists.
SEE ALSOhinv(1), ioconfig(1), getinvent(3), hwgraph.dev(D3X), hwgraph.intro(D4X).
Page 2