[PATCH] ppc64 iSeries: make virtual DVD-RAMs writable again
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 27 May 2005 19:52:58 +0000 (12:52 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 28 May 2005 18:14:00 +0000 (11:14 -0700)
It appears that another test has been added in the Uniform CDROM layer that
must be passed before a DVD-RAM is considered writeable.  This patch
implements an emulation of the needed packet command for the viocd driver.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/cdrom/viocd.c

index fcca26c89bbccfa5803680bc0b5b5d417ced3b44..38dd9ffbe8bcc147cc2174e3965870ab5a9aba73 100644 (file)
@@ -488,6 +488,20 @@ static int viocd_packet(struct cdrom_device_info *cdi,
                                         & (CDC_DVD_RAM | CDC_RAM)) != 0;
                }
                break;
+       case GPCMD_GET_CONFIGURATION:
+               if (cgc->cmd[3] == CDF_RWRT) {
+                       struct rwrt_feature_desc *rfd = (struct rwrt_feature_desc *)(cgc->buffer + sizeof(struct feature_header));
+
+                       if ((buflen >=
+                            (sizeof(struct feature_header) + sizeof(*rfd))) &&
+                           (cdi->ops->capability & ~cdi->mask
+                            & (CDC_DVD_RAM | CDC_RAM))) {
+                               rfd->feature_code = cpu_to_be16(CDF_RWRT);
+                               rfd->curr = 1;
+                               ret = 0;
+                       }
+               }
+               break;
        default:
                if (cgc->sense) {
                        /* indicate Unknown code */