Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libstand/stand.h
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Device switch | * Device switch | ||||
*/ | */ | ||||
struct devsw { | struct devsw { | ||||
const char dv_name[8]; | const char dv_name[8]; | ||||
int dv_type; /* opaque type constant, arch-dependant */ | int dv_type; /* opaque type constant, arch-dependant */ | ||||
int (*dv_init)(void); /* early probe call */ | int (*dv_init)(void); /* early probe call */ | ||||
int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, | int (*dv_strategy)(void *devdata, int rw, daddr_t blk, | ||||
char *buf, size_t *rsize); | size_t offset, size_t size, char *buf, size_t *rsize); | ||||
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); | ||||
void (*dv_print)(int verbose); /* print device information */ | void (*dv_print)(int verbose); /* print device information */ | ||||
void (*dv_cleanup)(void); | void (*dv_cleanup)(void); | ||||
}; | }; | ||||
/* | /* | ||||
* libstand-supplied device switch | * libstand-supplied device switch | ||||
*/ | */ | ||||
extern struct devsw netdev; | extern struct devsw netdev; | ||||
extern int errno; | extern int errno; | ||||
/* | |||||
* Generic device specifier; architecture-dependent | |||||
* versions may be larger, but should be allowed to | |||||
* overlap. | |||||
*/ | |||||
struct devdesc | |||||
{ | |||||
struct devsw *d_dev; | |||||
int d_type; | |||||
#define DEVT_NONE 0 | |||||
#define DEVT_DISK 1 | |||||
#define DEVT_NET 2 | |||||
#define DEVT_CD 3 | |||||
#define DEVT_ZFS 4 | |||||
int d_unit; | |||||
void *d_opendata; | |||||
}; | |||||
struct open_file { | struct open_file { | ||||
int f_flags; /* see F_* below */ | int f_flags; /* see F_* below */ | ||||
struct devsw *f_dev; /* pointer to device operations */ | struct devsw *f_dev; /* pointer to device operations */ | ||||
void *f_devdata; /* device specific data */ | void *f_devdata; /* device specific data */ | ||||
struct fs_ops *f_ops; /* pointer to file system operations */ | struct fs_ops *f_ops; /* pointer to file system operations */ | ||||
void *f_fsdata; /* file system specific data */ | void *f_fsdata; /* file system specific data */ | ||||
off_t f_offset; /* current file offset */ | off_t f_offset; /* current file offset */ | ||||
▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines |