1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control

sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.

PR:		ports/162190
MFC after:	1 week
This commit is contained in:
Alexander Motin 2012-01-03 17:04:09 +00:00
parent f5b50e25ec
commit 2cb9ba56ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229395

View File

@ -2685,6 +2685,16 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td)
error = cdsetspeed(periph, CDR_MAX_SPEED, *(u_int32_t *)addr);
cam_periph_unlock(periph);
break;
case CDRIOCGETBLOCKSIZE:
*(int *)addr = softc->params.blksize;
break;
case CDRIOCSETBLOCKSIZE:
if (*(int *)addr <= 0) {
error = EINVAL;
break;
}
softc->disk->d_sectorsize = softc->params.blksize = *(int *)addr;
break;
case DVDIOCSENDKEY:
case DVDIOCREPORTKEY: {
struct dvd_authinfo *authinfo;