--- wikisrc/users/mlelstv/disk-driver-template.mdwn 2016/11/28 06:34:28 1.11 +++ wikisrc/users/mlelstv/disk-driver-template.mdwn 2016/12/08 11:39:34 1.12 @@ -54,13 +54,14 @@ static const struct dkdriver xxxdkdriver .d_open = xxxopen, .d_close = xxxclose, .d_strategy = xxxstrategy, - .d_iosize = xxx_iosize, .d_minphys = xxxminphys, .d_diskstart = xxx_diskstart, - .d_dumpblocks = xxx_dumpblocks, - .d_lastclose = xxx_lastclose, .d_discard = xxx_discard, - .d_firstopen = xxx_firstopen + .d_dumpblocks = xxx_dumpblocks, /* optional */ + .d_iosize = xxx_iosize, /* optional */ + .d_lastclose = xxx_lastclose, /* optional */ + .d_firstopen = xxx_firstopen, /* optional */ + .d_label = xxx_label, /* optional */ }; static int xxx_match(device_t, cfdata_t, void *); @@ -463,6 +464,7 @@ static int xxx_dumpblocks(device_t dv, void *va, daddr_t blkno, int nblk) { // issue polling I/O to dump a page + // return error } static void @@ -475,7 +477,16 @@ static int xxx_discard(device_t dv, off_t pos, off_t len) { // issue request to discard bytes + // return error } + +static void +xxx_label(device_t dv, struct disklabel *lp) +{ + // lp is initialized for generic disk + // augment with driver specific information +} + ----