diff options
| author | Bartlomiej Zolnierkiewicz <bzolnier@trik.(none)> | 2004-10-20 22:48:28 +0200 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <bzolnier@trik.(none)> | 2004-10-20 22:48:28 +0200 |
| commit | 680b896870a7c47dc7210424f12367fc5a8663d2 (patch) | |
| tree | e9260bce60abc598e80a8dfb96ffe6843694c74b /include/linux | |
| parent | 2e879618c240b379990b34d2dda709605a5dc6ae (diff) | |
[ide] sg PIO for taskfile requests
Use scatterlists for taskfile based PIO transfers
instead of directly walking rq->[bio,cbio] lists.
If CONFIG_IDE_TASKFILE_IO is defined
this code will be used for fs requests.
ide_pio_sector() is based on ata_pio_sector()
from libata-core.c so kudos to Jeff.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ide.h | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 2fddaa5f5f42..d8b6b870b352 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -927,6 +927,11 @@ typedef struct hwif_s { /* data phase of the active command (currently only valid for PIO/DMA) */ int data_phase; + unsigned int nsect; + unsigned int nleft; + unsigned int cursg; + unsigned int cursg_ofs; + int mmio; /* hosts iomio (0) or custom (2) select */ int rqsize; /* max sectors per request */ int irq; /* our irq number */ @@ -1370,35 +1375,6 @@ 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, char *buf, - unsigned nsect, unsigned rw) -{ - /* - * IRQ can happen instantly after reading/writing - * last sector of the datablock. - */ - 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); - - process_that_request_first(rq, nsect); - __task_sectors(drive, buf, nsect, rw); - rq_unmap_buffer(buf, &flags); -} -#endif /* CONFIG_IDE_TASKFILE_IO */ - extern int drive_is_ready(ide_drive_t *); extern int wait_for_ready(ide_drive_t *, int /* timeout */); @@ -1529,6 +1505,8 @@ typedef struct ide_pci_device_s { extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); +void ide_init_sg_cmd(ide_drive_t *, struct request *); + #define BAD_DMA_DRIVE 0 #define GOOD_DMA_DRIVE 1 |
