cfg_attr_t - General: Contains information for managing
the loading and unloading of kernel modules
typedef struct cfg_attr {
char name[CFG_ATTR_NAME_SZ];
uchar type;
uchar operation;
uint status;
long index;
union {
struct {
caddr_t val;
ulong min_size;
ulong max_size;
void (*disposal)();
ulong val_size;
} bin;
struct {
caddr_t val;
ulong min_len;
ulong max_len;
void (*disposal)();
} str;
struct {
ulong val;
ulong min_val;
ulong max_val;
} num;
} attr; } cfg_attr_t;
Specifies the ASCII name of the attribute. The name must
be between 2 and CFG_ATTR_NAME_SZ characters in length,
including the terminating null character. Do not begin the
ASCII name of the attribute with the Method_ or Device_
characters. The cfgmgr framework reserves certain names
that begin with the Method_ and Device_ characters. Specifies
the data type associated with the name attribute.
See the DESCRIPTION section for the constants you can pass
to the type member. Specifies the operations that the
cfgmgr framework can perform on the attribute. See the
DESCRIPTION section for the constants you can pass to the
operation member. Stores the return code from operations
(configure, unconfigure, query) that the cfgmgr framework
performs. See the DESCRIPTION section for the operation
codes that the cfgmgr framework can return to the status
member. Stores a value that scopes the target for indexed
attributes. Specifies a union of the possible attribute
types used for storing values, kernel locations, validation
criteria, and disposal routines. The cfgmgr framework
uses the appropriate union element according to the
attribute type. For example, attributes of type
CFG_ATTR_ULONGTYPE use the union element num.
The cfg_attr_t data structure contains information for
managing the configuring and unconfiguring of kernel modules.
The cfgmgr framework passes a pointer to this data
structure to the kernel module's configure routine. The
kernel module can parse this structure pointer to check
the validity of the values associated with the module's
associated sysconfigtab file fragment and the /etc/sysconfigtab
database.
You must set the type member to one of the following constants:
Data type is a null-terminated array of characters.
Data type is a 32-bit signed integer. Data type is
a 32-bit unsigned integer. Data type is a 64-bit signed
integer. Data type is a 64-bit unsigned integer. Data
type is an array of bytes. Data type is an 8-bit unsigned
character. Data type is a 16-bit unsigned short integer.
You can set the operation member to one of the following
constants: The cfgmgr framework configures the attribute.
This means the cfgmgr framework obtains a data value for
the attribute from the /etc/sysconfigtab database. The
configure operation occurs when the cfgmgr framework calls
the configure routine at its CFG_OP_CONFIGURE entry point.
(That is, the optype argument of the configure routine
evaluates to the CFG_OP_CONFIGURE constant.) The cfgmgr
framework queries (reads) the attribute. This means the
kernel module cooperates with the cfgmgr framework to provide
the value associated with the attribute as a result
of user-initiated query requests. These requests are typically
the result of the sysconfig -q command. The query
operation occurs when the cfgmgr framework calls the configure
routine at its CFG_OP_QUERY entry point. (That is,
the optype argument of the configure routine evaluates to
the CFG_OP_QUERY constant.) The cfgmgr framework reconfigures
the attribute. This means the cfgmgr framework
reconfigures the data value for the attribute. This functionality
allows a user to modify the attribute. A reconfigure
request is typically the result of the sysconfig -r
command. The reconfigure operation occurs when the cfgmgr
framework calls the configure routine at its CFG_OP_RECONFIGURE
entry point. (That is, the optype argument of the
configure routine evaluates to the CFG_OP_RECONFIGURE constant.)
The cfgmgr framework can return one of the following operation
codes: Successful operation. The attribute you
specified in the name member does not exist. The
attribute you specified in the name member does not support
the operation. The subsystem failed. The value or
size of the attribute you specified in the name member is
too small. The value or size of the attribute you specified
in the name member is too large. The data type that
you specified for the attribute you specified in the name
member is invalid or is a mismatch. The index associated
with the attribute that you specified in the name member
is invalid. The cfgmgr framework could not allocate memory
for the specified attribute. The attribute that you
specified in the name member cannot be converted to a number.
SEE ALSO
Data Structures: cfg_subsys_attr_t(9s)
cfg_attr_t(9s)
[ Back ] |