patch-2.1.112 linux/drivers/block/ide-floppy.c
Next file: linux/drivers/block/ide.c
Previous file: linux/arch/i386/mm/ioremap.c
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Sun Jul 26 11:46:46 1998
- Orig file:
v2.1.111/linux/drivers/block/ide-floppy.c
- Orig date:
Thu May 7 22:51:48 1998
diff -u --recursive --new-file v2.1.111/linux/drivers/block/ide-floppy.c linux/drivers/block/ide-floppy.c
@@ -43,6 +43,7 @@
#include <linux/errno.h>
#include <linux/genhd.h>
#include <linux/malloc.h>
+#include <linux/cdrom.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -1141,7 +1142,18 @@
static int idefloppy_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- return -EIO;
+ idefloppy_pc_t pc;
+
+ if (cmd == CDROMEJECT) {
+ if (drive->usage > 1)
+ return -EBUSY;
+ idefloppy_create_prevent_cmd (&pc, 0);
+ (void) idefloppy_queue_pc_tail (drive, &pc);
+ idefloppy_create_start_stop_cmd (&pc, 2);
+ (void) idefloppy_queue_pc_tail (drive, &pc);
+ return 0;
+ }
+ return -EIO;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov