The arguments are as follows:void filldsreq(struct dsreq *dsp, uchar_t *data,long datalen, long flags)
dsp | The address of a dsreq prepared by dsopen(). |
data | The address of a buffer area. |
datalen | The length of the buffer area. |
flags | Flag values for ds_flags (see "Values for ds_flags"). |
The bits in flags are added to ds_flags with an OR; they do not replace the contents of the field.
Note: Besides the specified values, the function also sets 10000 in ds_timeout and clears ds_link, ds_synch, and ds_ret to zero.
void fillg0cmd(struct dsreq *dsp, uchar_t *cmdbuf, b0, ..., b5) void fillg1cmd(struct dsreq *dsp, uchar_t *cmdbuf, b0, ..., b9)The arguments are as follows:
dsp | The address of any dsreq. |
cmdbuf | The address of a buffer to receive the command string. |
b0, b1,... | Expressions for the successive bytes of a SCSI command. |
In typical use, the arguments are as follows:
dsp | The address of a dsreq initialized by dsopen(). |
cmdbuf | The command buffer allocated by dsopen(), whose address is stored in the ds_cmdbuf field of the dsreq. |
b0 | A SCSI command verb expressed as one of the constants declared in dslib.h, for example G0_INQU. |
A typical call resembles the following:
The macros B1(), B2(), and B4() defined in sys/dsreq.h are useful for expressing halfword and word values as byte sequences.fillg0cmd(dsp, (uchar_t *)CMDBUF(dsp), G0_INQU, 1, inq_page, 0, B1(datalen),0);
The ds_vtostr() function searches any of the five vtab tables for the string matching an integer key. The ds_ctostr() function searches a ctab (currently, only sensekeytab is a ctab) for the string matching a key. The function prototypes are
char * ds_vtostr(unsigned long v, struct vtab *table); char * ds_ctostr(unsigned long v, struct ctab *table);Each function searches the specified table for a row containing the numeric value v, and returns address of the corresponding string. If there is no such row, the functions return the address of a zero-length string.