lkml.org 
[lkml]   [2001]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.4.1-ac16: add CDROM_LOCKDOOR ioctl to IDE floppies
Patch below. It Work For Me(tm) with an IDE ZIP drive.

--- drivers/ide/ide-floppy.c.old Mon Feb 19 13:39:55 2001
+++ drivers/ide/ide-floppy.c Mon Feb 19 13:48:53 2001
@@ -1517,15 +1517,21 @@
unsigned int cmd, unsigned long arg)
{
idefloppy_pc_t pc;
+ int prevent = (arg) ? 1 : 0;

switch (cmd) {
case CDROMEJECT:
+ prevent = 0;
+ /* fall through */
+ case CDROM_LOCKDOOR:
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);
+ idefloppy_create_prevent_cmd (&pc, prevent);
(void) idefloppy_queue_pc_tail (drive, &pc);
+ if (cmd == CDROMEJECT) {
+ idefloppy_create_start_stop_cmd (&pc, 2);
+ (void) idefloppy_queue_pc_tail (drive, &pc);
+ }
return 0;
case IDEFLOPPY_IOCTL_FORMAT_SUPPORTED:
return (0);

--
Francis Galiegue, fg@mandrakesoft.com - Normand et fier de l'être
"Programming is a race between programmers, who try and make more and more
idiot-proof software, and universe, which produces more and more remarkable
idiots. Until now, universe leads the race" -- R. Cook

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:15    [W:0.038 / U:1.848 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site