return ret;
 }
 
+#ifdef CONFIG_COMPAT
+static int pkt_compat_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
+{
+       switch (cmd) {
+       /* compatible */
+       case CDROMEJECT:
+       case CDROMMULTISESSION:
+       case CDROMREADTOCENTRY:
+       case SCSI_IOCTL_SEND_COMMAND:
+               return pkt_ioctl(bdev, mode, cmd, (unsigned long)compat_ptr(arg));
+
+
+       /* FIXME: no handler so far */
+       case CDROM_LAST_WRITTEN:
+       /* handled in compat_blkdev_driver_ioctl */
+       case CDROM_SEND_PACKET:
+       default:
+               return -ENOIOCTLCMD;
+       }
+}
+#endif
+
 static unsigned int pkt_check_events(struct gendisk *disk,
                                     unsigned int clearing)
 {
        .open =                 pkt_open,
        .release =              pkt_close,
        .ioctl =                pkt_ioctl,
+#ifdef CONFIG_COMPAT
+       .ioctl =                pkt_compat_ioctl,
+#endif
        .check_events =         pkt_check_events,
 };