STREAMS-UX Programmer's Guide (February 2007)

STREAMS Administrative Driver
Overview
Appendix D
252
SAP_CLEAR Clears the previous settings. Specifies only the sap_major and sap_minor
fields when using this command. If a previous entry specified SAP_ALL, set
the sap_minor field to 0 (zero). If a previous entry was specified as
SAP_RANGE, set the sap_minor field to the lowest minor device number in
the range.
sap_major: Major device number.
sap_minor: Minor device number.
sap_lastminor: Range of minor devices.
sap_npush: Number of modules to push. This number must be no more than MAXAPUSH, a constant
defined in <sys/sad.h>. Additionally, this number must not exceed the STREAMS kernel
tunable NSTRPUSH.
sap_list: Specifies, in order, the array of modules to push.
SAD_GAP
Allows the sad driver to be used to obtain autopush configuration information for a device by setting the
sap_major and sap_minor fields of the strapush structure (see the SAD_SAP command) to the major and
minor device numbers of the device being queried. This strapush structure must be pointed to by the
arg
parameter. Upon successful completion, the strapush structure contains all of the information used to
configure the device. Values of 0 (zero) will appear in any unused entry in the module list.
SAD_VML
This command enables the user to check a list of modules (e.g., to see if a specific module is installed). The
arg
parameter points to a str_list structure, defined in <sys/stropts.h> and shown here:
struct str_list {
int sl_nmods;
struct str_mlist *sl_modlist;
};
sl_nmods: Number of entries allocated in an array.
sl_modlist: Pointer to the array of module names.
The str_mlist structure, also defined in <sys/stropts.h>, contains the following:
struct str_mlist {
char l_name[FMNAMESZ+1];
};
l_name: Array of module names. If the l_name array is valid, the SAD_VML command returns a value
of 0 (zero). If the array contains an invalid module name, the command returns a value of 1.
Upon failure, the command returns a value of -1.
NOTE As a STREAMS driver, sad also supports the normal STREAMS I_STR IOCTL command. In
this form, the developer needs to set the ic_cmd field in the strioctl structure to either
SAD_SAP, SAD_GAP, or SAD_VML. The ic_dp field of the strioctl structure should point to this
strapush structure.