summaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
commitb2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch)
tree954a648692e7da983db1d2470953705f6a729264 /drivers/ide
parentc9c06167e7933d93a6e396174c68abf242294abb (diff)
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Config.in2
-rw-r--r--drivers/ide/Makefile42
-rw-r--r--drivers/ide/ide-cd.c127
-rw-r--r--drivers/ide/ide-cd.h6
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-tape.c4
6 files changed, 95 insertions, 88 deletions
diff --git a/drivers/ide/Config.in b/drivers/ide/Config.in
index 4db04ef96..a157767f3 100644
--- a/drivers/ide/Config.in
+++ b/drivers/ide/Config.in
@@ -68,7 +68,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
dep_bool ' PROMISE PDC20246/PDC20262/PDC20267 support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX
- dep_bool ' ServerWorks OSB4 chipset support' CONFIG_BLK_DEV_OSB4 $CONFIG_BLK_DEV_OSB4
+ dep_bool ' ServerWorks OSB4 chipset support' CONFIG_BLK_DEV_OSB4 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
index f85ab2aa4..c2d8a5644 100644
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -8,16 +8,23 @@
# In the future, some of these should be built conditionally.
#
-SUB_DIRS :=
-MOD_SUB_DIRS := $(SUB_DIRS)
-ALL_SUB_DIRS := $(SUB_DIRS)
-
O_TARGET := idedriver.o
+export-objs := ide.o ide-features.o
+list-multi := ide-mod.o ide-probe-mod.o
+
obj-y :=
obj-m :=
ide-obj-y :=
+obj-$(CONFIG_BLK_DEV_HD) += hd.o
+obj-$(CONFIG_BLK_DEV_IDE) += ide-mod.o ide-probe-mod.o
+obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
+obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o
+obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o
+obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o
+obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o
+
ide-obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o
ide-obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o
ide-obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o
@@ -31,7 +38,6 @@ ide-obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o
ide-obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o
ide-obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o
ide-obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o
-obj-$(CONFIG_BLK_DEV_HD) += hd.o
ide-obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
@@ -59,35 +65,9 @@ ide-obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
ide-obj-$(CONFIG_PROC_FS) += ide-proc.o
-export-objs := ide.o ide-features.o
-list-multi := ide-mod.o ide-probe-mod.o
ide-mod-objs := $(export-objs) $(ide-obj-y)
ide-probe-mod-objs := ide-probe.o ide-geometry.o
-obj-$(CONFIG_BLK_DEV_IDE) += ide-mod.o ide-probe-mod.o
-obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
-obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o
-obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o
-obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o
-obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o
-
-# Extract lists of the multi-part drivers.
-# The 'int-*' lists are the intermediate files used to build the multi's.
-multi-y := $(filter $(list-multi), $(obj-y))
-multi-m := $(filter $(list-multi), $(obj-m))
-int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs)))
-int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs)))
-
-# Take multi-part drivers out of obj-y and put components in.
-obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y)
-
-# Translate to Rules.make lists.
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m)))
-MIX_OBJS := $(sort $(filter $(export-objs), $(int-m)))
-
include $(TOPDIR)/Rules.make
ide-mod.o: $(ide-mod-objs)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index f00c68ed4..1ec89b3e0 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -285,9 +285,13 @@
* 4.58 May 1, 2000 - Clean up ACER50 stuff.
* - Fix small problem with ide_cdrom_capacity
*
+ * 4.59 Aug 11, 2000 - Fix changer problem in cdrom_read_toc, we weren't
+ * correctly sensing a disc change.
+ * - Rearranged some code
+ *
*************************************************************************/
-#define IDECD_VERSION "4.58"
+#define IDECD_VERSION "4.59"
#include <linux/config.h>
#include <linux/module.h>
@@ -324,41 +328,50 @@ static void cdrom_saw_media_change (ide_drive_t *drive)
info->nsectors_buffered = 0;
}
+static int cdrom_log_sense(ide_drive_t *drive, struct packet_command *pc,
+ struct request_sense *sense)
+{
+ int log = 0;
+
+ if (sense == NULL || pc == NULL || pc->quiet)
+ return 0;
+
+ switch (sense->sense_key) {
+ case NO_SENSE: case RECOVERED_ERROR:
+ break;
+ case NOT_READY:
+ /*
+ * don't care about tray state messages for
+ * e.g. capacity commands or in-progress or
+ * becoming ready
+ */
+ if (sense->asc == 0x3a || sense->asc == 0x04)
+ break;
+ log = 1;
+ break;
+ case UNIT_ATTENTION:
+ /*
+ * Make good and sure we've seen this potential media
+ * change. Some drives (i.e. Creative) fail to present
+ * the correct sense key in the error register.
+ */
+ cdrom_saw_media_change(drive);
+ break;
+ default:
+ log = 1;
+ break;
+ }
+ return log;
+}
static
void cdrom_analyze_sense_data(ide_drive_t *drive,
struct packet_command *failed_command,
struct request_sense *sense)
{
- if (sense->sense_key == NOT_READY ||
- sense->sense_key == UNIT_ATTENTION) {
- /* Make good and sure we've seen this potential media change.
- Some drives (i.e. Creative) fail to present the correct
- sense key in the error register. */
- cdrom_saw_media_change (drive);
-
-
- /* Don't print not ready or unit attention errors for
- READ_SUBCHANNEL. Workman (and probably other programs)
- uses this command to poll the drive, and we don't want
- to fill the syslog with useless errors. */
- if (failed_command &&
- (failed_command->c[0] == GPCMD_READ_SUBCHANNEL ||
- failed_command->c[0] == GPCMD_TEST_UNIT_READY))
- return;
- }
- if (sense->error_code == 0x70 && sense->sense_key == 0x02
- && ((sense->asc == 0x3a && sense->ascq == 0x00) ||
- (sense->asc == 0x04 && sense->ascq == 0x01)))
- {
- /*
- * Suppress the following errors:
- * "Medium not present", "in progress of becoming ready",
- * and "writing" to keep the noise level down to a dull roar.
- */
+ if (!cdrom_log_sense(drive, failed_command, sense))
return;
- }
/*
* If a read toc is executed for a CD-R or CD-RW medium where
@@ -590,7 +603,7 @@ static int cdrom_decode_status (ide_startstop_t *startstop, ide_drive_t *drive,
cdrom_saw_media_change (drive);
/*printk("%s: media changed\n",drive->name);*/
return 0;
- } else {
+ } else if (!pc->quiet) {
/* Otherwise, print an error. */
ide_dump_status(drive, "packet command error", stat);
}
@@ -726,26 +739,27 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,
or there's data ready. */
static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive,
unsigned char *cmd_buf, int cmd_len,
- ide_handler_t *handler)
+ ide_handler_t *handler,
+ unsigned int timeout)
{
+ ide_startstop_t startstop;
+
if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
/* Here we should have been called after receiving an interrupt
from the device. DRQ should how be set. */
int stat_dum;
- ide_startstop_t startstop;
/* Check for errors. */
if (cdrom_decode_status (&startstop, drive, DRQ_STAT, &stat_dum))
return startstop;
} else {
- ide_startstop_t startstop;
/* Otherwise, we must wait for DRQ to get set. */
if (ide_wait_stat (&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY))
return startstop;
}
/* Arm the interrupt handler. */
- ide_set_handler (drive, handler, WAIT_CMD, cdrom_timer_expiry);
+ ide_set_handler (drive, handler, timeout, cdrom_timer_expiry);
/* Send the command to the device. */
atapi_output_bytes (drive, cmd_buf, cmd_len);
@@ -1090,7 +1104,7 @@ static ide_startstop_t cdrom_start_read_continuation (ide_drive_t *drive)
/* Send the command to the drive and return. */
return cdrom_transfer_packet_command(drive, pc.c, sizeof(pc.c),
- &cdrom_read_intr);
+ &cdrom_read_intr, WAIT_CMD);
}
@@ -1111,7 +1125,13 @@ static ide_startstop_t cdrom_seek_intr (ide_drive_t *drive)
if (retry && jiffies - info->start_seek > IDECD_SEEK_TIMER) {
if (--retry == 0) {
+ /*
+ * this condition is far too common, to bother
+ * users about it
+ */
+#if 0
printk("%s: disabled DSC seek overlap\n", drive->name);
+#endif
drive->dsc_overlap = 0;
}
}
@@ -1133,7 +1153,7 @@ static ide_startstop_t cdrom_start_seek_continuation (ide_drive_t *drive)
memset (&pc.c, 0, sizeof (pc.c));
pc.c[0] = GPCMD_SEEK;
put_unaligned(cpu_to_be32(frame), (unsigned int *) &pc.c[2]);
- return cdrom_transfer_packet_command (drive, pc.c, sizeof (pc.c), &cdrom_seek_intr);
+ return cdrom_transfer_packet_command(drive, pc.c, sizeof(pc.c), &cdrom_seek_intr, WAIT_CMD);
}
static ide_startstop_t cdrom_start_seek (ide_drive_t *drive, unsigned int block)
@@ -1308,9 +1328,12 @@ static ide_startstop_t cdrom_do_pc_continuation (ide_drive_t *drive)
struct request *rq = HWGROUP(drive)->rq;
struct packet_command *pc = (struct packet_command *)rq->buffer;
+ if (!pc->timeout)
+ pc->timeout = WAIT_CMD;
+
/* Send the command to the drive and return. */
- return cdrom_transfer_packet_command (drive, pc->c,
- sizeof (pc->c), &cdrom_pc_intr);
+ return cdrom_transfer_packet_command(drive, pc->c, sizeof(pc->c),
+ &cdrom_pc_intr, pc->timeout);
}
@@ -1335,8 +1358,12 @@ static ide_startstop_t cdrom_do_packet_command (ide_drive_t *drive)
static
void cdrom_sleep (int time)
{
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(time);
+ int sleep = time;
+
+ do {
+ set_current_state(TASK_INTERRUPTIBLE);
+ sleep = schedule_timeout(sleep);
+ } while (sleep);
}
static
@@ -1372,7 +1399,7 @@ int cdrom_queue_packet_command(ide_drive_t *drive, struct packet_command *pc)
/* The drive is in the process of loading
a disk. Retry, but wait a little to give
the drive time to complete the load. */
- cdrom_sleep (HZ);
+ cdrom_sleep(2 * HZ);
} else {
/* Otherwise, don't retry. */
retries = 0;
@@ -1886,6 +1913,9 @@ static int ide_cdrom_packet(struct cdrom_device_info *cdi,
struct packet_command pc;
ide_drive_t *drive = (ide_drive_t*) cdi->handle;
+ if (cgc->timeout <= 0)
+ cgc->timeout = WAIT_CMD;
+
/* here we queue the commands from the uniform CD-ROM
layer. the packet must be complete, as we do not
touch it at all. */
@@ -1893,14 +1923,10 @@ static int ide_cdrom_packet(struct cdrom_device_info *cdi,
memcpy(pc.c, cgc->cmd, CDROM_PACKET_SIZE);
pc.buffer = cgc->buffer;
pc.buflen = cgc->buflen;
- cgc->stat = cdrom_queue_packet_command(drive, &pc);
-
- /*
- * FIXME: copy sense, don't just assign pointer!!
- */
- cgc->sense = pc.sense;
-
- return cgc->stat;
+ pc.quiet = cgc->quiet;
+ pc.timeout = cgc->timeout;
+ pc.sense = cgc->sense;
+ return cgc->stat = cdrom_queue_packet_command(drive, &pc);
}
static
@@ -1956,6 +1982,7 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi,
{
ide_drive_t *drive = (ide_drive_t*) cdi->handle;
struct cdrom_info *info = drive->driver_data;
+ int stat;
switch (cmd) {
/*
@@ -1963,7 +1990,7 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi,
* atapi doesn't support it
*/
case CDROMPLAYTRKIND: {
- int stat, lba_start, lba_end;
+ unsigned long lba_start, lba_end;
struct cdrom_ti *ti = (struct cdrom_ti *)arg;
struct atapi_toc_entry *first_toc, *last_toc;
@@ -1987,7 +2014,6 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi,
}
case CDROMREADTOCHDR: {
- int stat;
struct cdrom_tochdr *tochdr = (struct cdrom_tochdr *) arg;
struct atapi_toc *toc;
@@ -2003,7 +2029,6 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi,
}
case CDROMREADTOCENTRY: {
- int stat;
struct cdrom_tocentry *tocentry = (struct cdrom_tocentry*) arg;
struct atapi_toc_entry *toce;
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h
index 1d901d3c7..ee0a44a79 100644
--- a/drivers/ide/ide-cd.h
+++ b/drivers/ide/ide-cd.h
@@ -106,6 +106,7 @@ struct packet_command {
int buflen;
int stat;
int quiet;
+ int timeout;
struct request_sense *sense;
unsigned char c[12];
};
@@ -628,7 +629,9 @@ const struct {
"Logical unit not ready - in progress [sic] of becoming ready" },
{ 0x020402, "Logical unit not ready - initializing command required" },
{ 0x020403, "Logical unit not ready - manual intervention required" },
- { 0x020404, "In process of becoming ready - writing" },
+ { 0x020404, "Logical unit not ready - format in progress" },
+ { 0x020407, "Logical unit not ready - operation in progress" },
+ { 0x020408, "Logical unit not ready - long write in progress" },
{ 0x020600, "No reference position found (media may be upside down)" },
{ 0x023000, "Incompatible medium installed" },
{ 0x023a00, "Medium not present" },
@@ -678,7 +681,6 @@ const struct {
{ 0x04b600, "Media load mechanism failed" },
{ 0x051a00, "Parameter list length error" },
{ 0x052000, "Invalid command operation code" },
- { 0x052c00, "Command sequence error" },
{ 0x052100, "Logical block address out of range" },
{ 0x052102, "Invalid address for write" },
{ 0x052400, "Invalid field in command packet" },
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 1130bd3d5..b6258aad8 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -104,7 +104,7 @@ typedef struct idefloppy_packet_command_s {
byte *current_position; /* Pointer into the above buffer */
void (*callback) (ide_drive_t *); /* Called when this packet command is completed */
byte pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */
- unsigned int flags; /* Status/Action bit flags */
+ unsigned long flags; /* Status/Action bit flags: long for set_bit */
} idefloppy_pc_t;
/*
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 079353425..0e7a23994 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -686,7 +686,7 @@ typedef struct idetape_packet_command_s {
byte *current_position; /* Pointer into the above buffer */
ide_startstop_t (*callback) (ide_drive_t *); /* Called when this packet command is completed */
byte pc_buffer[IDETAPE_PC_BUFFER_SIZE]; /* Temporary buffer */
- unsigned int flags; /* Status/Action bit flags */
+ unsigned long flags; /* Status/Action bit flags: long for set_bit */
} idetape_pc_t;
/*
@@ -908,7 +908,7 @@ typedef struct {
int pages_per_stage;
int excess_bh_size; /* Wasted space in each stage */
- unsigned int flags; /* Status/Action flags */
+ unsigned long flags; /* Status/Action flags: long for set_bit */
spinlock_t spinlock; /* protects the ide-tape queue */
/*