Author: mav
Date: Tue Jan  3 17:04:09 2012
New Revision: 229395
URL: http://svn.freebsd.org/changeset/base/229395

Log:
  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

Modified:
  head/sys/cam/scsi/scsi_cd.c

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c Tue Jan  3 16:54:47 2012        (r229394)
+++ head/sys/cam/scsi/scsi_cd.c Tue Jan  3 17:04:09 2012        (r229395)
@@ -2685,6 +2685,16 @@ cdioctl(struct disk *dp, u_long cmd, voi
                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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to