stand/ofw: ofw_disk isn't really a disk
The rest of the code in the tree assumes that a DEVT_DISK uses a disk_devdesc to represent the device. However ofw_disk diesn't, so we can't use disk_fmtdev, nor disk_parsedev. ofw needs to have a dv_match-like routine to use devpasrse, though, since we have two drivers (net and block) that claim the same sort of devices (eg /path/to/ofw-dev) based on the device-type property. In the interim, we can't use devmatch and ofw_disk's and the default net driver's parsing is offloaded ofw_parsedev. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37347
This commit is contained in:
parent
bb9f61da17
commit
daaf594e84
@ -28,6 +28,8 @@
|
|||||||
#include "openfirm.h"
|
#include "openfirm.h"
|
||||||
#include <readin.h>
|
#include <readin.h>
|
||||||
|
|
||||||
|
#define DEVT_OFDISK 1001
|
||||||
|
|
||||||
struct ofw_devdesc {
|
struct ofw_devdesc {
|
||||||
struct devdesc dd;
|
struct devdesc dd;
|
||||||
union {
|
union {
|
||||||
|
@ -49,10 +49,12 @@ 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,
|
||||||
@ -60,8 +62,7 @@ struct devsw ofwdisk = {
|
|||||||
.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,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -185,3 +186,10 @@ 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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user