[PATCH] 2.2.18pre17 updates to IDE-floppy driver

From: Paul Bristow (paul@paulbristow.net)
Date: Sun Oct 22 2000 - 14:17:27 EST


Andre, Alan, others,

As agreed with Gadi and Andre I have taken over the ide-floppy driver
maintainence from Gadi Oxman (thanks for all your work so far Gadi!).
Anyone with outstanding patches/suggestions etc could you send them to
me?

Please find attached the patch to update the IDE-Floppy driver to
include IOMEGA Clik! (or PocketZip) support. This patch applies cleanly
to 2.2.17 and 2.2.18pre17. Details on how to use the Clik! drive with
this patch are available at http://paulbristow.net/linux/clik.html

This updated driver has been tested as a module and compiled in, and the
Clik! mods did not break my LS-120 drive.

I also include a patch to the CREDITS and MAINTAINERS file so people
know where to reach me.

Now to get it working in 2.4...

Regards,

-- 

Paul

Email: paul@paulbristow.net (NOTE: change from paul.bristow@technologist.com as mail.com unreliable) Web: http://paulbristow.net ICQ: #11965223

diff -u -b --exclude='*.o' --exclude='.*' --exclude='*.a' --exclude=System.map linux-2.2.17/CREDITS linux-2.2.17-pb/CREDITS --- linux-2.2.17/CREDITS Mon Sep 4 19:39:15 2000 +++ linux-2.2.17-pb/CREDITS Sun Oct 22 15:56:46 2000 @@ -290,6 +290,11 @@ S: Lancaster, LA1 4DN S: UK, England +N: Paul Bristow +E: paul@paulbristow.net +W: http://paulbristow.net/linux +D: ide-floppy maintainer + N: Andries Brouwer E: aeb@cwi.nl D: random Linux hacker Common subdirectories: linux-2.2.17/Documentation and linux-2.2.17-pb/Documentation diff -u -b --exclude='*.o' --exclude='.*' --exclude='*.a' --exclude=System.map linux-2.2.17/MAINTAINERS linux-2.2.17-pb/MAINTAINERS --- linux-2.2.17/MAINTAINERS Mon Sep 4 19:39:16 2000 +++ linux-2.2.17-pb/MAINTAINERS Sun Oct 22 19:55:27 2000 @@ -446,12 +446,19 @@ L: linux-kernel@vger.kernel.org S: Maintained -IDE/ATAPI TAPE/FLOPPY DRIVERS +IDE/ATAPI TAPE DRIVERS P: Gadi Oxman M: Gadi Oxman <gadio@netvision.net.il> L: linux-kernel@vger.kernel.org S: Maintained +IDE/ATAPI FLOPPY DRIVERS +P: Paul Bristow +M: Paul Bristow <paul@paulbristow.net> +W: http://paulbristow.net/linux +L: linux-kernel@vger.kernel.org +S: Maintained + IP FIREWALL P: Paul Russell M: Paul.Russell@rustcorp.com.au Common subdirectories: linux-2.2.17/arch and linux-2.2.17-pb/arch Common subdirectories: linux-2.2.17/drivers and linux-2.2.17-pb/drivers Common subdirectories: linux-2.2.17/fs and linux-2.2.17-pb/fs Common subdirectories: linux-2.2.17/include and linux-2.2.17-pb/include Common subdirectories: linux-2.2.17/init and linux-2.2.17-pb/init Common subdirectories: linux-2.2.17/ipc and linux-2.2.17-pb/ipc Common subdirectories: linux-2.2.17/kernel and linux-2.2.17-pb/kernel Common subdirectories: linux-2.2.17/lib and linux-2.2.17-pb/lib Common subdirectories: linux-2.2.17/mm and linux-2.2.17-pb/mm Common subdirectories: linux-2.2.17/modules and linux-2.2.17-pb/modules Common subdirectories: linux-2.2.17/net and linux-2.2.17-pb/net Common subdirectories: linux-2.2.17/scripts and linux-2.2.17-pb/scripts Binary files linux-2.2.17/vmlinux and linux-2.2.17-pb/vmlinux differ

--- linux-2.2.17/drivers/block/ide-floppy.c Mon Sep 4 19:39:16 2000 +++ linux-2.2.17-pb/drivers/block/ide-floppy.c Sun Oct 22 20:30:10 2000 @@ -2,6 +2,7 @@ * linux/drivers/block/ide-floppy.c Version 0.9 Jul 4, 1999 * * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il> + * Copyright (C) 2000 Paul Bristow <paul@paulbristow.net> */ /* @@ -29,9 +30,14 @@ * Ver 0.9 Jul 4 99 Fix a bug which might have caused the number of * bytes requested on each interrupt to be zero. * Thanks to <shanos@es.co.nz> for pointing this out. + * Ver 0.91 Dec 11 99 Added IOMEGA Clik! drive support by + * <paul@paulbristow.net> + * Ver 0.92 Oct 22 00 Paul Bristow became official maintainer for this i + * driver. Included Powerbook internal zip kludge. + * */ -#define IDEFLOPPY_VERSION "0.9" +#define IDEFLOPPY_VERSION "0.92" #include <linux/config.h> #include <linux/module.h> @@ -60,6 +66,7 @@ */ #include "ide.h" + /* * The following are used to debug the driver. */ @@ -1205,6 +1212,15 @@ idefloppy_flexible_disk_page_t *page; int capacity, lba_capacity; + /* Inserted by Paul Bristow + * The IOMEGA Clik! drive does not support this command + * so I removed it and fake the important parameters. + * This does not appear to have any major side effects, + * so I hope everything is OK. + */ + if (!strstr(drive->id->model,"Clik")) { + + idefloppy_create_mode_sense_cmd (&pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE, MODE_SENSE_CURRENT); if (idefloppy_queue_pc_tail (drive,&pc)) { printk (KERN_ERR "ide-floppy: Can't get flexible disk page parameters\n"); @@ -1235,6 +1251,16 @@ capacity = IDEFLOPPY_MIN(capacity, lba_capacity); floppy->blocks = floppy->block_size ? capacity / floppy->block_size : 0; } + } + else { + /* It is an IOMEGA Clik! Drive, which does not support the above command */ +#if IDEFLOPPY_DEBUG_LOG + printk (KERN_INFO "Forcing Clik! Parameters\n"); +#endif /* IDEFLOPPY_DEBUG_LOG */ + floppy->blocks=78882; + floppy->block_size=512; + floppy->bs_factor=1; + } return 0; } @@ -1290,6 +1316,7 @@ return rc; } + /* * Our special ide-floppy ioctl's. * @@ -1303,8 +1330,11 @@ if (cmd == CDROMEJECT) { if (drive->usage > 1) return -EBUSY; + /* The IOMEGA CLik! Drive doesn't support this command */ + if (!strstr(drive->id->model,"Clik")) { 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; @@ -1326,14 +1356,31 @@ MOD_INC_USE_COUNT; if (drive->usage == 1) { +#if IDEFLOPPY_DEBUG_LOG + /* Send are you ready command */ + /* Will fail if no disk... */ + printk (KERN_INFO "Testing if unit is ready...\n"); +#endif /* IDEFLOPPY_DEBUG_LOG */ idefloppy_create_test_unit_ready_cmd(&pc); if (idefloppy_queue_pc_tail(drive, &pc)) { + printk (KERN_INFO "Not ready, issuing start command\n"); + /* This will also fail for a Clik! drive if no disk... */ idefloppy_create_start_stop_cmd (&pc, 1); (void) idefloppy_queue_pc_tail (drive, &pc); + } else + { +#if IDEFLOPPY_DEBUG_LOG + /* Send are you ready command */ + /* Will fail if no disk... */ + printk (KERN_INFO "Yes unit is ready\n"); +#endif /* IDEFLOPPY_DEBUG_LOG */ } if (idefloppy_get_capacity (drive)) { drive->usage--; MOD_DEC_USE_COUNT; +#if IDEFLOPPY_DEBUG_LOG + printk (KERN_INFO "I/O Error Getting Capacity\n"); +#endif /* IDEFLOPPY_DEBUG_LOG */ return -EIO; } if (floppy->wp && (filp->f_mode & 2)) { @@ -1342,8 +1389,11 @@ return -EROFS; } set_bit (IDEFLOPPY_MEDIA_CHANGED, &floppy->flags); + /* IOMEGA Clik! drives do not support lock/unlock commands */ + if (!strstr(drive->id->model,"Clik")) { idefloppy_create_prevent_cmd (&pc, 1); (void) idefloppy_queue_pc_tail (drive, &pc); + } check_disk_change(inode->i_rdev); } return 0; @@ -1359,9 +1409,12 @@ if (!drive->usage) { invalidate_buffers (inode->i_rdev); + /* IOMEGA Clik! drives do not support lock/unlock commands */ + if (!strstr(drive->id->model,"Clik")) { idefloppy_create_prevent_cmd (&pc, 0); (void) idefloppy_queue_pc_tail (drive, &pc); } + } MOD_DEC_USE_COUNT; } @@ -1549,6 +1602,16 @@ for (i = 0; i < 1 << PARTN_BITS; i++) max_sectors[major][minor + i] = 64; } + /* + * Guess what? The IOMEGA Clik! drive also needs the + * above fix. It makes nasty clicking noises without + * it, so please don't remove this. + */ + if (strcmp(drive->id->model, "IOMEGA Clik! 40 CZ ATAPI") == 0) + { + for (i = 0; i < 1 << PARTN_BITS; i++) + max_sectors[major][minor + i] = 64; + } (void) idefloppy_get_capacity (drive); idefloppy_add_settings(drive);

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



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:19 EST