#include <linux/slab.h>
#include <linux/cdrom.h>
#include <linux/ide.h>
+#include <linux/hdreg.h>
#include <linux/bitops.h>
#include <linux/mutex.h>
stat = hwif->tp_ops->read_status(hwif);
local_irq_restore(flags);
- progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000;
+ progress_indication = ((stat & ATA_DSC) == 0) ? 0 : 0x10000;
}
if (put_user(progress_indication, arg))
return (-EFAULT);
* Check whether we can support a drive, based on the ATAPI IDENTIFY command
* results.
*/
-static int idefloppy_identify_device(ide_drive_t *drive, struct hd_driveid *id)
+static int idefloppy_identify_device(ide_drive_t *drive, u16 *id)
{
u8 gcw[2];
u8 device_type, protocol, removable, drq_type, packet_size;
- *((u16 *) &gcw) = id->config;
+ *((u16 *)&gcw) = id[ATA_ID_CONFIG];
device_type = gcw[1] & 0x1F;
removable = (gcw[0] & 0x80) >> 7;
#ifdef CONFIG_PPC
/* kludge for Apple PowerBook internal zip */
if (device_type == 5 &&
- !strstr(id->model, "CD-ROM") && strstr(id->model, "ZIP"))
+ !strstr((char *)&id[ATA_ID_PROD], "CD-ROM") &&
+ strstr((char *)&id[ATA_ID_PROD], "ZIP"))
device_type = 0;
#endif
static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
{
+ u16 *id = drive->id;
u8 gcw[2];
- *((u16 *) &gcw) = drive->id->config;
+ *((u16 *)&gcw) = id[ATA_ID_CONFIG];
floppy->pc = floppy->pc_stack;
drive->pc_callback = ide_floppy_callback;
* it. It should be fixed as of version 1.9, but to be on the safe side
* we'll leave the limitation below for the 2.2.x tree.
*/
- if (!strncmp(drive->id->model, "IOMEGA ZIP 100 ATAPI", 20)) {
+ if (!strncmp((char *)&id[ATA_ID_PROD], "IOMEGA ZIP 100 ATAPI", 20)) {
drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE;
/* This value will be visible in the /proc/ide/hdx/settings */
floppy->ticks = IDEFLOPPY_TICKS_DELAY;
* 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 (strncmp(drive->id->model, "IOMEGA Clik!", 11) == 0) {
+ if (strncmp((char *)&id[ATA_ID_PROD], "IOMEGA Clik!", 11) == 0) {
blk_queue_max_sectors(drive->queue, 64);
drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE;
}
if (!strstr("ide-floppy", drive->driver_req))
goto failed;
- if (!drive->present)
- goto failed;
+
if (drive->media != ide_floppy)
goto failed;
+
if (!idefloppy_identify_device(drive, drive->id)) {
printk(KERN_ERR "ide-floppy: %s: not supported by this version"
" of ide-floppy\n", drive->name);