ide_pdc4030, ide_rz1000, ide_trm290,
ide_cmd646, ide_cy82c693, ide_4drives,
ide_pmac, ide_etrax100, ide_acorn,
- ide_pc9800, ide_forced
+ ide_forced
} hwif_chipset_t;
/*
#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)
{
- /*
- * fs request
- */
- if (rq->bio)
- return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
-
- /*
- * task request
- */
- return rq->buffer + task_rq_offset(rq);
+ return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
}
static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
{
- if (rq->bio)
- bio_kunmap_irq(buffer, flags);
+ bio_kunmap_irq(buffer, flags);
}
#endif /* !CONFIG_IDE_TASKFILE_IO */
#define DRIVER(drive) ((drive)->driver)
-extern int generic_ide_ioctl(struct block_device *, unsigned, unsigned long);
+extern int generic_ide_ioctl(struct file *, struct block_device *, unsigned, unsigned long);
/*
* ide_hwifs[] is the master data structure used to keep track
extern void taskfile_input_data(ide_drive_t *, void *, u32);
extern void taskfile_output_data(ide_drive_t *, void *, u32);
-#ifdef CONFIG_IDE_TASKFILE_IO
-
#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)
+static inline void __task_sectors(ide_drive_t *drive, char *buf,
+ unsigned nsect, unsigned rw)
{
- unsigned long flags;
- unsigned int bio_rq;
- char *buf;
-
- /*
- * bio_rq flag is needed because we can call
- * rq_unmap_buffer() with rq->cbio == NULL
- */
- bio_rq = rq->cbio ? 1 : 0;
-
- if (bio_rq)
- buf = rq_map_buffer(rq, &flags); /* fs request */
- else
- buf = rq->buffer + blk_rq_offset(rq); /* task request */
-
/*
* 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);
+}
+
+#ifdef CONFIG_IDE_TASKFILE_IO
+static inline void task_bio_sectors(ide_drive_t *drive, struct request *rq,
+ unsigned nsect, unsigned rw)
+{
+ unsigned long flags;
+ char *buf = rq_map_buffer(rq, &flags);
- if (bio_rq)
- rq_unmap_buffer(buf, &flags);
+ process_that_request_first(rq, nsect);
+ __task_sectors(drive, buf, nsect, rw);
+ rq_unmap_buffer(buf, &flags);
}
#endif /* CONFIG_IDE_TASKFILE_IO */