Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/libsa.3
Show First 20 Lines • Show All 744 Lines • ▼ Show 20 Lines | struct devsw { | ||||
int (*dv_open)(struct open_file *f, ...); | int (*dv_open)(struct open_file *f, ...); | ||||
int (*dv_close)(struct open_file *f); | int (*dv_close)(struct open_file *f); | ||||
int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); | int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); | ||||
int (*dv_print)(int verbose); | int (*dv_print)(int verbose); | ||||
void (*dv_cleanup)(void); | void (*dv_cleanup)(void); | ||||
char * (*dv_fmtdev)(struct devdesc *); | char * (*dv_fmtdev)(struct devdesc *); | ||||
int (*dv_parsedev)(struct devdesc **dev, const char *devpart, | int (*dv_parsedev)(struct devdesc **dev, const char *devpart, | ||||
const char **path); | const char **path); | ||||
bool (*dv_match)(struct devsw *dv, const char *devspec); | |||||
}; | }; | ||||
.Ed | .Ed | ||||
.Bl -tag -width ".Fn dv_strategy" | .Bl -tag -width ".Fn dv_strategy" | ||||
.It Fn dv_name | .It Fn dv_name | ||||
The device's name. | The device's name. | ||||
.It Fn dv_type | .It Fn dv_type | ||||
Type of device. | Type of device. | ||||
The supported types are: | The supported types are: | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
This routine should set | This routine should set | ||||
.Dv path | .Dv path | ||||
to point to the portion of the string after device specification, or | to point to the portion of the string after device specification, or | ||||
.Dq /xxx | .Dq /xxx | ||||
in the earlier example. | in the earlier example. | ||||
Generally, code needing to parse a path will use | Generally, code needing to parse a path will use | ||||
.Fa devparse | .Fa devparse | ||||
instead of calling this routine directly. | instead of calling this routine directly. | ||||
.It Fn dv_match | |||||
.Dv NULL | |||||
to specify that all device paths starting with | |||||
.Fa dv_name | |||||
match. | |||||
Otherwise, this function returns 0 for a match and a non-zero | |||||
.Dv errno | |||||
to indicate why it didn't match. | |||||
This is helpful when you claim the device path after using it to query | |||||
properties on systems that have uniform naming for different types of | |||||
devices. | |||||
.El | .El | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The | The | ||||
.Nm | .Nm | ||||
library contains contributions from many sources, including: | library contains contributions from many sources, including: | ||||
.Bl -bullet -compact | .Bl -bullet -compact | ||||
.It | .It | ||||
.Nm libsa | .Nm libsa | ||||
Show All 20 Lines |