summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>2003-06-07 03:38:01 -0700
committerAnton Blanchard <anton@samba.org>2003-06-07 03:38:01 -0700
commit4949833a590e03775c29e83154ffb8a615b5c66a (patch)
tree2b13fc3bdb835a1bc3031cb7c1521b3c0fccfa8c /include
parent319a0865008dd05578457c43b69f65acc86cbc25 (diff)
[PATCH] switch ide to taskfile IO
- rewrite taskfile PIO handlers (they now comply with ide state machine and use bio walking) - switch ide-disk.c to use *only* taskfile IO - swicth pdc4030.c to use *only* taskfile IO (untested) - remove old cruft (>600 lines)
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/ide.h47
2 files changed, 33 insertions, 15 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index fd211093a374..ad140bb8e8d5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -457,6 +457,7 @@ extern void blk_queue_invalidate_tags(request_queue_t *);
extern void blk_congestion_wait(int rw, long timeout);
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
+extern void blk_rq_prep_restart(struct request *);
#define MAX_PHYS_SEGMENTS 128
#define MAX_HW_SEGMENTS 128
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c6a8f20203ec..0d6d1a27405d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -817,33 +817,25 @@ typedef struct ide_dma_ops_s {
*
* temporarily mapping a (possible) highmem bio for PIO transfer
*/
-#define ide_rq_offset(rq) \
- (((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9)
-/*
- * taskfiles really should use hard_cur_sectors as well!
- */
-#define task_rq_offset(rq) \
- (((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE)
-
-static inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
+static inline void *task_map_rq(struct request *rq, unsigned long *flags)
{
/*
* fs request
*/
- if (rq->bio)
- return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
+ if (rq->cbio)
+ return rq_map_buffer(rq, flags);
/*
* task request
*/
- return rq->buffer + task_rq_offset(rq);
+ return rq->buffer + blk_rq_offset(rq);
}
-static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
+static inline void task_unmap_rq(struct request *rq, char *buffer, unsigned long *flags)
{
- if (rq->bio)
- bio_kunmap_irq(buffer, flags);
+ if (rq->cbio)
+ rq_unmap_buffer(buffer, flags);
}
#define IDE_CHIPSET_PCI_MASK \
@@ -1418,6 +1410,31 @@ extern void atapi_output_bytes(ide_drive_t *, void *, u32);
extern void taskfile_input_data(ide_drive_t *, void *, u32);
extern void taskfile_output_data(ide_drive_t *, void *, u32);
+#define IDE_PIO_IN 0
+#define IDE_PIO_OUT 1
+
+static inline void task_sectors(ide_drive_t *drive, struct request *rq,
+ unsigned nsect, int rw)
+{
+ unsigned long flags;
+ char *buf;
+
+ buf = task_map_rq(rq, &flags);
+
+ /*
+ * IRQ can happen instantly after reading/writing
+ * last sector of the datablock.
+ */
+ process_that_request_first(rq, nsect);
+
+ if (rw == IDE_PIO_OUT)
+ taskfile_output_data(drive, buf, nsect * SECTOR_WORDS);
+ else
+ taskfile_input_data(drive, buf, nsect * SECTOR_WORDS);
+
+ task_unmap_rq(rq, buf, &flags);
+}
+
extern int drive_is_ready(ide_drive_t *);
extern int wait_for_ready(ide_drive_t *, int /* timeout */);