Changeset View
Changeset View
Standalone View
Standalone View
stand/libofw/ofw_disk.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
static int ofwd_init(void); | static int ofwd_init(void); | ||||
static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, | static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, | ||||
size_t size, char *buf, size_t *rsize); | size_t size, char *buf, size_t *rsize); | ||||
static int ofwd_open(struct open_file *f, ...); | static int ofwd_open(struct open_file *f, ...); | ||||
static int ofwd_close(struct open_file *f); | static int ofwd_close(struct open_file *f); | ||||
static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); | static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); | ||||
static int ofwd_print(int verbose); | static int ofwd_print(int verbose); | ||||
static char * ofwd_fmtdev(struct devdesc *); | |||||
struct devsw ofwdisk = { | struct devsw ofwdisk = { | ||||
.dv_name = "block", | .dv_name = "block", | ||||
.dv_type = DEVT_DISK, | .dv_type = DEVT_OFDISK, | ||||
.dv_init = ofwd_init, | .dv_init = ofwd_init, | ||||
.dv_strategy = ofwd_strategy, | .dv_strategy = ofwd_strategy, | ||||
.dv_open = ofwd_open, | .dv_open = ofwd_open, | ||||
.dv_close = ofwd_close, | .dv_close = ofwd_close, | ||||
.dv_ioctl = ofwd_ioctl, | .dv_ioctl = ofwd_ioctl, | ||||
.dv_print = ofwd_print, | .dv_print = ofwd_print, | ||||
.dv_cleanup = nullsys, | .dv_cleanup = nullsys, | ||||
.dv_fmtdev = disk_fmtdev, | .dv_fmtdev = ofwd_fmtdev, | ||||
.dv_parsedev = disk_parsedev, | |||||
}; | }; | ||||
/* | /* | ||||
* We're not guaranteed to be able to open a device more than once and there | * We're not guaranteed to be able to open a device more than once and there | ||||
* is no OFW standard method to determine whether a device is already opened. | * is no OFW standard method to determine whether a device is already opened. | ||||
* Opening a device multiple times simultaneously happens to work with most | * Opening a device multiple times simultaneously happens to work with most | ||||
* OFW block device drivers but triggers a trap with at least the driver for | * OFW block device drivers but triggers a trap with at least the driver for | ||||
* the on-board controllers of Sun Fire V100 and Ultra 1. Upper layers and MI | * the on-board controllers of Sun Fire V100 and Ultra 1. Upper layers and MI | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | ofwd_ioctl(struct open_file *f, u_long cmd, void *data) | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ofwd_print(int verbose __unused) | ofwd_print(int verbose __unused) | ||||
{ | { | ||||
return (0); | return (0); | ||||
} | |||||
static char * | |||||
ofwd_fmtdev(struct devdesc *idev) | |||||
{ | |||||
struct ofw_devdesc *dev = (struct ofw_devdesc *)idev; | |||||
return (dev->d_path); | |||||
} | } |