diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index a8a8b8737294..e404b12d7d83 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1032,6 +1033,14 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) error = EINVAL; break; + case DIOCGMEDIASIZE: + *(off_t *)addr = cdp->disk_size * cdp->block_size; + break; + + case DIOCGSECTORSIZE: + *(u_int *)addr = cdp->block_size; + break; + default: error = ENOTTY; } diff --git a/sys/dev/ata/atapi-cd.h b/sys/dev/ata/atapi-cd.h index 6184bee90c60..190b651bdcd6 100644 --- a/sys/dev/ata/atapi-cd.h +++ b/sys/dev/ata/atapi-cd.h @@ -318,8 +318,8 @@ struct acd_softc { struct acd_softc **driver; /* softc's of changer slots */ int slot; /* this instance slot number */ time_t timestamp; /* this instance timestamp */ - int disk_size; /* size of current media */ - int block_size; /* blocksize currently used */ + u_int disk_size; /* size of current media */ + u_int block_size; /* blocksize currently used */ struct devstat *stats; /* devstat entry */ dev_t dev; /* device place holders */ #ifndef BURN_BRIDGES