Commit a87cd868 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.8-pre3 IDE 30

- Eliminate ide_task_t and rename struct ide_task_s to struct ata_taskfile.
   This should become the entity which is holding all data for a request in the
   future. If this turns out to be the case, we will just rename it to
   ata_request.

- Reduce the number of arguments for the ata_taskfile() function. This helps to
   wipe quite a lot of code out as well.

This stage is not sensitive, so let's make a patch before we start to integrate
the last work of Jens Axboe.
parent 8e602aee
...@@ -154,7 +154,7 @@ static ide_startstop_t chs_do_request(ide_drive_t *drive, struct request *rq, un ...@@ -154,7 +154,7 @@ static ide_startstop_t chs_do_request(ide_drive_t *drive, struct request *rq, un
{ {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
struct hd_drive_hob_hdr hobfile; struct hd_drive_hob_hdr hobfile;
ide_task_t args; struct ata_taskfile args;
int sectors; int sectors;
unsigned int track = (block / drive->sect); unsigned int track = (block / drive->sect);
...@@ -193,19 +193,14 @@ static ide_startstop_t chs_do_request(ide_drive_t *drive, struct request *rq, un ...@@ -193,19 +193,14 @@ static ide_startstop_t chs_do_request(ide_drive_t *drive, struct request *rq, un
ide_cmd_type_parser(&args); ide_cmd_type_parser(&args);
rq->special = &args; rq->special = &args;
return ata_taskfile(drive, return ata_taskfile(drive, &args, rq);
&args.taskfile,
&args.hobfile,
args.handler,
args.prehandler,
rq);
} }
static ide_startstop_t lba28_do_request(ide_drive_t *drive, struct request *rq, unsigned long block) static ide_startstop_t lba28_do_request(ide_drive_t *drive, struct request *rq, unsigned long block)
{ {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
struct hd_drive_hob_hdr hobfile; struct hd_drive_hob_hdr hobfile;
ide_task_t args; struct ata_taskfile args;
int sectors; int sectors;
sectors = rq->nr_sectors; sectors = rq->nr_sectors;
...@@ -239,12 +234,7 @@ static ide_startstop_t lba28_do_request(ide_drive_t *drive, struct request *rq, ...@@ -239,12 +234,7 @@ static ide_startstop_t lba28_do_request(ide_drive_t *drive, struct request *rq,
ide_cmd_type_parser(&args); ide_cmd_type_parser(&args);
rq->special = &args; rq->special = &args;
return ata_taskfile(drive, return ata_taskfile(drive, &args, rq);
&args.taskfile,
&args.hobfile,
args.handler,
args.prehandler,
rq);
} }
/* /*
...@@ -257,7 +247,7 @@ static ide_startstop_t lba48_do_request(ide_drive_t *drive, struct request *rq, ...@@ -257,7 +247,7 @@ static ide_startstop_t lba48_do_request(ide_drive_t *drive, struct request *rq,
{ {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
struct hd_drive_hob_hdr hobfile; struct hd_drive_hob_hdr hobfile;
ide_task_t args; struct ata_taskfile args;
int sectors; int sectors;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr));
...@@ -302,12 +292,7 @@ static ide_startstop_t lba48_do_request(ide_drive_t *drive, struct request *rq, ...@@ -302,12 +292,7 @@ static ide_startstop_t lba48_do_request(ide_drive_t *drive, struct request *rq,
ide_cmd_type_parser(&args); ide_cmd_type_parser(&args);
rq->special = &args; rq->special = &args;
return ata_taskfile(drive, return ata_taskfile(drive, &args, rq);
&args.taskfile,
&args.hobfile,
args.handler,
args.prehandler,
rq);
} }
/* /*
...@@ -426,7 +411,8 @@ static int idedisk_check_media_change (ide_drive_t *drive) ...@@ -426,7 +411,8 @@ static int idedisk_check_media_change (ide_drive_t *drive)
*/ */
static unsigned long idedisk_read_native_max_address(ide_drive_t *drive) static unsigned long idedisk_read_native_max_address(ide_drive_t *drive)
{ {
ide_task_t args; /* FIXME: This is on stack! */
struct ata_taskfile args;
unsigned long addr = 0; unsigned long addr = 0;
if (!(drive->id->command_set_1 & 0x0400) && if (!(drive->id->command_set_1 & 0x0400) &&
...@@ -434,7 +420,7 @@ static unsigned long idedisk_read_native_max_address(ide_drive_t *drive) ...@@ -434,7 +420,7 @@ static unsigned long idedisk_read_native_max_address(ide_drive_t *drive)
return addr; return addr;
/* Create IDE/ATA command request structure */ /* Create IDE/ATA command request structure */
memset(&args, 0, sizeof(ide_task_t)); memset(&args, 0, sizeof(args));
args.taskfile.device_head = 0x40; args.taskfile.device_head = 0x40;
args.taskfile.command = WIN_READ_NATIVE_MAX; args.taskfile.command = WIN_READ_NATIVE_MAX;
args.handler = task_no_data_intr; args.handler = task_no_data_intr;
...@@ -457,11 +443,11 @@ static unsigned long idedisk_read_native_max_address(ide_drive_t *drive) ...@@ -457,11 +443,11 @@ static unsigned long idedisk_read_native_max_address(ide_drive_t *drive)
static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive) static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive)
{ {
ide_task_t args; struct ata_taskfile args;
unsigned long long addr = 0; unsigned long long addr = 0;
/* Create IDE/ATA command request structure */ /* Create IDE/ATA command request structure */
memset(&args, 0, sizeof(ide_task_t)); memset(&args, 0, sizeof(args));
args.taskfile.device_head = 0x40; args.taskfile.device_head = 0x40;
args.taskfile.command = WIN_READ_NATIVE_MAX_EXT; args.taskfile.command = WIN_READ_NATIVE_MAX_EXT;
...@@ -493,12 +479,12 @@ static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive ...@@ -493,12 +479,12 @@ static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive
*/ */
static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long addr_req) static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long addr_req)
{ {
ide_task_t args; struct ata_taskfile args;
unsigned long addr_set = 0; unsigned long addr_set = 0;
addr_req--; addr_req--;
/* Create IDE/ATA command request structure */ /* Create IDE/ATA command request structure */
memset(&args, 0, sizeof(ide_task_t)); memset(&args, 0, sizeof(args));
args.taskfile.sector_number = (addr_req >> 0); args.taskfile.sector_number = (addr_req >> 0);
args.taskfile.low_cylinder = (addr_req >> 8); args.taskfile.low_cylinder = (addr_req >> 8);
...@@ -522,12 +508,12 @@ static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long a ...@@ -522,12 +508,12 @@ static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long a
static unsigned long long idedisk_set_max_address_ext(ide_drive_t *drive, unsigned long long addr_req) static unsigned long long idedisk_set_max_address_ext(ide_drive_t *drive, unsigned long long addr_req)
{ {
ide_task_t args; struct ata_taskfile args;
unsigned long long addr_set = 0; unsigned long long addr_set = 0;
addr_req--; addr_req--;
/* Create IDE/ATA command request structure */ /* Create IDE/ATA command request structure */
memset(&args, 0, sizeof(ide_task_t)); memset(&args, 0, sizeof(args));
args.taskfile.sector_number = (addr_req >> 0); args.taskfile.sector_number = (addr_req >> 0);
args.taskfile.low_cylinder = (addr_req >>= 8); args.taskfile.low_cylinder = (addr_req >>= 8);
...@@ -667,47 +653,45 @@ static ide_startstop_t idedisk_special (ide_drive_t *drive) ...@@ -667,47 +653,45 @@ static ide_startstop_t idedisk_special (ide_drive_t *drive)
special_t *s = &drive->special; special_t *s = &drive->special;
if (s->b.set_geometry) { if (s->b.set_geometry) {
struct hd_drive_task_hdr taskfile; struct ata_taskfile args;
struct hd_drive_hob_hdr hobfile;
ide_handler_t *handler = NULL;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr));
memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr));
s->b.set_geometry = 0; s->b.set_geometry = 0;
taskfile.sector_number = drive->sect;
taskfile.low_cylinder = drive->cyl; memset(&args, 0, sizeof(args));
taskfile.high_cylinder = drive->cyl>>8; args.taskfile.sector_number = drive->sect;
taskfile.device_head = ((drive->head-1)|drive->select.all)&0xBF; args.taskfile.low_cylinder = drive->cyl;
args.taskfile.high_cylinder = drive->cyl>>8;
args.taskfile.device_head = ((drive->head-1)|drive->select.all)&0xBF;
if (!IS_PDC4030_DRIVE) { if (!IS_PDC4030_DRIVE) {
taskfile.sector_count = drive->sect; args.taskfile.sector_count = drive->sect;
taskfile.command = WIN_SPECIFY; args.taskfile.command = WIN_SPECIFY;
handler = set_geometry_intr;; args.handler = set_geometry_intr;;
} }
ata_taskfile(drive, &taskfile, &hobfile, handler, NULL, NULL); ata_taskfile(drive, &args, NULL);
} else if (s->b.recalibrate) { } else if (s->b.recalibrate) {
s->b.recalibrate = 0; s->b.recalibrate = 0;
if (!IS_PDC4030_DRIVE) { if (!IS_PDC4030_DRIVE) {
struct hd_drive_task_hdr taskfile; struct ata_taskfile args;
struct hd_drive_hob_hdr hobfile;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); memset(&args, 0, sizeof(args));
memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); args.taskfile.sector_count = drive->sect;
taskfile.sector_count = drive->sect; args.taskfile.command = WIN_RESTORE;
taskfile.command = WIN_RESTORE; args.handler = recal_intr;
ata_taskfile(drive, &taskfile, &hobfile, recal_intr, NULL, NULL); ata_taskfile(drive, &args, NULL);
} }
} else if (s->b.set_multmode) { } else if (s->b.set_multmode) {
s->b.set_multmode = 0; s->b.set_multmode = 0;
if (drive->id && drive->mult_req > drive->id->max_multsect) if (drive->id && drive->mult_req > drive->id->max_multsect)
drive->mult_req = drive->id->max_multsect; drive->mult_req = drive->id->max_multsect;
if (!IS_PDC4030_DRIVE) { if (!IS_PDC4030_DRIVE) {
struct hd_drive_task_hdr taskfile; struct ata_taskfile args;
struct hd_drive_hob_hdr hobfile;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); memset(&args, 0, sizeof(args));
memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); args.taskfile.sector_count = drive->mult_req;
taskfile.sector_count = drive->mult_req; args.taskfile.command = WIN_SETMULT;
taskfile.command = WIN_SETMULT; args.handler = set_multmode_intr;
ata_taskfile(drive, &taskfile, &hobfile, set_multmode_intr, NULL, NULL);
ata_taskfile(drive, &args, NULL);
} }
} else if (s->all) { } else if (s->all) {
int special = s->all; int special = s->all;
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/delay.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -238,29 +239,33 @@ static int ide_build_sglist(struct ata_channel *hwif, struct request *rq) ...@@ -238,29 +239,33 @@ static int ide_build_sglist(struct ata_channel *hwif, struct request *rq)
return pci_map_sg(hwif->pci_dev, sg, nents, hwif->sg_dma_direction); return pci_map_sg(hwif->pci_dev, sg, nents, hwif->sg_dma_direction);
} }
static int ide_raw_build_sglist(struct ata_channel *hwif, struct request *rq) /*
* FIXME: taskfiles should be a map of pages, not a long virt address... /jens
* FIXME: I agree with Jens --mdcki!
*/
static int raw_build_sglist(struct ata_channel *ch, struct request *rq)
{ {
struct scatterlist *sg = hwif->sg_table; struct scatterlist *sg = ch->sg_table;
int nents = 0; int nents = 0;
ide_task_t *args = rq->special; struct ata_taskfile *args = rq->special;
#if 1 #if 1
unsigned char *virt_addr = rq->buffer; unsigned char *virt_addr = rq->buffer;
int sector_count = rq->nr_sectors; int sector_count = rq->nr_sectors;
#else #else
nents = blk_rq_map_sg(rq->q, rq, hwif->sg_table); nents = blk_rq_map_sg(rq->q, rq, ch->sg_table);
if (nents > rq->nr_segments) if (nents > rq->nr_segments)
printk("ide-dma: received %d segments, build %d\n", rq->nr_segments, nents); printk("ide-dma: received %d segments, build %d\n", rq->nr_segments, nents);
#endif #endif
if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE)
hwif->sg_dma_direction = PCI_DMA_TODEVICE; ch->sg_dma_direction = PCI_DMA_TODEVICE;
else else
hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; ch->sg_dma_direction = PCI_DMA_FROMDEVICE;
#if 1
if (sector_count > 128) { if (sector_count > 128) {
memset(&sg[nents], 0, sizeof(*sg)); memset(&sg[nents], 0, sizeof(*sg));
sg[nents].page = virt_to_page(virt_addr); sg[nents].page = virt_to_page(virt_addr);
sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK; sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK;
sg[nents].length = 128 * SECTOR_SIZE; sg[nents].length = 128 * SECTOR_SIZE;
...@@ -273,9 +278,8 @@ static int ide_raw_build_sglist(struct ata_channel *hwif, struct request *rq) ...@@ -273,9 +278,8 @@ static int ide_raw_build_sglist(struct ata_channel *hwif, struct request *rq)
sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK; sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK;
sg[nents].length = sector_count * SECTOR_SIZE; sg[nents].length = sector_count * SECTOR_SIZE;
nents++; nents++;
#endif
return pci_map_sg(hwif->pci_dev, sg, nents, hwif->sg_dma_direction); return pci_map_sg(ch->pci_dev, sg, nents, ch->sg_dma_direction);
} }
/* /*
...@@ -297,7 +301,7 @@ int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func) ...@@ -297,7 +301,7 @@ int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func)
struct scatterlist *sg; struct scatterlist *sg;
if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) { if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) {
hwif->sg_nents = i = ide_raw_build_sglist(hwif, HWGROUP(drive)->rq); hwif->sg_nents = i = raw_build_sglist(hwif, HWGROUP(drive)->rq);
} else { } else {
hwif->sg_nents = i = ide_build_sglist(hwif, HWGROUP(drive)->rq); hwif->sg_nents = i = ide_build_sglist(hwif, HWGROUP(drive)->rq);
} }
...@@ -593,7 +597,7 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -593,7 +597,7 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, dma_timer_expiry); /* issue cmd to drive */ ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, dma_timer_expiry); /* issue cmd to drive */
if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) && if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) &&
(drive->addressing == 1)) { (drive->addressing == 1)) {
ide_task_t *args = HWGROUP(drive)->rq->special; struct ata_taskfile *args = HWGROUP(drive)->rq->special;
OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG); OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG);
} else if (drive->addressing) { } else if (drive->addressing) {
OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG); OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG);
......
...@@ -184,7 +184,7 @@ int ide_driveid_update (ide_drive_t *drive) ...@@ -184,7 +184,7 @@ int ide_driveid_update (ide_drive_t *drive)
* in combination with the device (usually a disk) properly detect * in combination with the device (usually a disk) properly detect
* and acknowledge each end of the ribbon. * and acknowledge each end of the ribbon.
*/ */
int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) int ide_ata66_check (ide_drive_t *drive, struct ata_taskfile *args)
{ {
if ((args->taskfile.command == WIN_SETFEATURES) && if ((args->taskfile.command == WIN_SETFEATURES) &&
(args->taskfile.sector_number > XFER_UDMA_2) && (args->taskfile.sector_number > XFER_UDMA_2) &&
...@@ -211,7 +211,7 @@ int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) ...@@ -211,7 +211,7 @@ int ide_ata66_check (ide_drive_t *drive, ide_task_t *args)
* 1 : Safe to update drive->id DMA registers. * 1 : Safe to update drive->id DMA registers.
* 0 : OOPs not allowed. * 0 : OOPs not allowed.
*/ */
int set_transfer (ide_drive_t *drive, ide_task_t *args) int set_transfer (ide_drive_t *drive, struct ata_taskfile *args)
{ {
if ((args->taskfile.command == WIN_SETFEATURES) && if ((args->taskfile.command == WIN_SETFEATURES) &&
(args->taskfile.sector_number >= XFER_SW_DMA_0) && (args->taskfile.sector_number >= XFER_SW_DMA_0) &&
......
...@@ -1055,13 +1055,13 @@ pmac_ide_build_sglist (int ix, struct request *rq) ...@@ -1055,13 +1055,13 @@ pmac_ide_build_sglist (int ix, struct request *rq)
} }
static int static int
pmac_ide_raw_build_sglist (int ix, struct request *rq) pmac_raw_build_sglist (int ix, struct request *rq)
{ {
struct ata_channel *hwif = &ide_hwifs[ix]; struct ata_channel *hwif = &ide_hwifs[ix];
struct pmac_ide_hwif *pmif = &pmac_ide[ix]; struct pmac_ide_hwif *pmif = &pmac_ide[ix];
struct scatterlist *sg = pmif->sg_table; struct scatterlist *sg = pmif->sg_table;
int nents = 0; int nents = 0;
ide_task_t *args = rq->special; struct ata_taskfile *args = rq->special;
unsigned char *virt_addr = rq->buffer; unsigned char *virt_addr = rq->buffer;
int sector_count = rq->nr_sectors; int sector_count = rq->nr_sectors;
...@@ -1111,7 +1111,7 @@ pmac_ide_build_dmatable(ide_drive_t *drive, int ix, int wr) ...@@ -1111,7 +1111,7 @@ pmac_ide_build_dmatable(ide_drive_t *drive, int ix, int wr)
/* Build sglist */ /* Build sglist */
if (rq->flags & REQ_DRIVE_TASKFILE) { if (rq->flags & REQ_DRIVE_TASKFILE) {
pmac_ide[ix].sg_nents = i = pmac_ide_raw_build_sglist(ix, rq); pmac_ide[ix].sg_nents = i = pmac_raw_build_sglist(ix, rq);
} else { } else {
pmac_ide[ix].sg_nents = i = pmac_ide_build_sglist(ix, rq); pmac_ide[ix].sg_nents = i = pmac_ide_build_sglist(ix, rq);
} }
...@@ -1389,7 +1389,7 @@ int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -1389,7 +1389,7 @@ int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) && if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) &&
(drive->addressing == 1)) { (drive->addressing == 1)) {
ide_task_t *args = HWGROUP(drive)->rq->special; struct ata_taskfile *args = HWGROUP(drive)->rq->special;
OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG); OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG);
} else if (drive->addressing) { } else if (drive->addressing) {
OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG); OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG);
......
...@@ -291,7 +291,7 @@ void ata_poll_drive_ready(ide_drive_t *drive) ...@@ -291,7 +291,7 @@ void ata_poll_drive_ready(ide_drive_t *drive)
static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *rq)
{ {
ide_task_t *args = rq->special; struct ata_taskfile *args = rq->special;
ide_startstop_t startstop; ide_startstop_t startstop;
/* /*
...@@ -303,6 +303,7 @@ static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request * ...@@ -303,6 +303,7 @@ static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *
return startstop; return startstop;
ata_poll_drive_ready(drive); ata_poll_drive_ready(drive);
return args->handler(drive); return args->handler(drive);
} }
...@@ -391,18 +392,13 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -391,18 +392,13 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive)
} }
ide_startstop_t ata_taskfile(ide_drive_t *drive, ide_startstop_t ata_taskfile(ide_drive_t *drive,
struct hd_drive_task_hdr *taskfile, struct ata_taskfile *args, struct request *rq)
struct hd_drive_hob_hdr *hobfile,
ide_handler_t *handler,
ide_pre_handler_t *prehandler,
struct request *rq
)
{ {
struct hd_driveid *id = drive->id; struct hd_driveid *id = drive->id;
u8 HIHI = (drive->addressing) ? 0xE0 : 0xEF; u8 HIHI = (drive->addressing) ? 0xE0 : 0xEF;
/* (ks/hs): Moved to start, do not use for multiple out commands */ /* (ks/hs): Moved to start, do not use for multiple out commands */
if (handler != task_mulout_intr) { if (args->handler != task_mulout_intr) {
if (IDE_CONTROL_REG) if (IDE_CONTROL_REG)
OUT_BYTE(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ OUT_BYTE(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */
SELECT_MASK(drive->channel, drive, 0); SELECT_MASK(drive->channel, drive, 0);
...@@ -411,35 +407,38 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive, ...@@ -411,35 +407,38 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive,
if ((id->command_set_2 & 0x0400) && if ((id->command_set_2 & 0x0400) &&
(id->cfs_enable_2 & 0x0400) && (id->cfs_enable_2 & 0x0400) &&
(drive->addressing == 1)) { (drive->addressing == 1)) {
OUT_BYTE(hobfile->feature, IDE_FEATURE_REG); OUT_BYTE(args->hobfile.feature, IDE_FEATURE_REG);
OUT_BYTE(hobfile->sector_count, IDE_NSECTOR_REG); OUT_BYTE(args->hobfile.sector_count, IDE_NSECTOR_REG);
OUT_BYTE(hobfile->sector_number, IDE_SECTOR_REG); OUT_BYTE(args->hobfile.sector_number, IDE_SECTOR_REG);
OUT_BYTE(hobfile->low_cylinder, IDE_LCYL_REG); OUT_BYTE(args->hobfile.low_cylinder, IDE_LCYL_REG);
OUT_BYTE(hobfile->high_cylinder, IDE_HCYL_REG); OUT_BYTE(args->hobfile.high_cylinder, IDE_HCYL_REG);
} }
OUT_BYTE(taskfile->feature, IDE_FEATURE_REG); OUT_BYTE(args->taskfile.feature, IDE_FEATURE_REG);
OUT_BYTE(taskfile->sector_count, IDE_NSECTOR_REG); OUT_BYTE(args->taskfile.sector_count, IDE_NSECTOR_REG);
/* refers to number of sectors to transfer */ /* refers to number of sectors to transfer */
OUT_BYTE(taskfile->sector_number, IDE_SECTOR_REG); OUT_BYTE(args->taskfile.sector_number, IDE_SECTOR_REG);
/* refers to sector offset or start sector */ /* refers to sector offset or start sector */
OUT_BYTE(taskfile->low_cylinder, IDE_LCYL_REG); OUT_BYTE(args->taskfile.low_cylinder, IDE_LCYL_REG);
OUT_BYTE(taskfile->high_cylinder, IDE_HCYL_REG); OUT_BYTE(args->taskfile.high_cylinder, IDE_HCYL_REG);
OUT_BYTE((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG); OUT_BYTE((args->taskfile.device_head & HIHI) | drive->select.all, IDE_SELECT_REG);
if (handler != NULL) { if (args->handler != NULL) {
ide_set_handler(drive, handler, WAIT_CMD, NULL); ide_set_handler(drive, args->handler, WAIT_CMD, NULL);
OUT_BYTE(taskfile->command, IDE_COMMAND_REG); OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG);
/* /*
* Warning check for race between handler and prehandler for * Warning check for race between handler and prehandler for
* writing first block of data. however since we are well * writing first block of data. however since we are well
* inside the boundaries of the seek, we should be okay. * inside the boundaries of the seek, we should be okay.
*/ */
if (prehandler != NULL) if (args->prehandler != NULL)
return prehandler(drive, rq); return args->prehandler(drive, rq);
} else { } else {
/* for dma commands we down set the handler */ /* for dma commands we down set the handler */
if (drive->using_dma && !(drive->channel->dmaproc(((taskfile->command == WIN_WRITEDMA) || (taskfile->command == WIN_WRITEDMA_EXT)) ? ide_dma_write : ide_dma_read, drive))); if (drive->using_dma &&
!(drive->channel->dmaproc(((args->taskfile.command == WIN_WRITEDMA)
|| (args->taskfile.command == WIN_WRITEDMA_EXT))
? ide_dma_write : ide_dma_read, drive)));
} }
return ide_started; return ide_started;
...@@ -496,7 +495,7 @@ ide_startstop_t recal_intr(ide_drive_t *drive) ...@@ -496,7 +495,7 @@ ide_startstop_t recal_intr(ide_drive_t *drive)
*/ */
ide_startstop_t task_no_data_intr (ide_drive_t *drive) ide_startstop_t task_no_data_intr (ide_drive_t *drive)
{ {
ide_task_t *args = HWGROUP(drive)->rq->special; struct ata_taskfile *args = HWGROUP(drive)->rq->special;
byte stat = GET_STAT(); byte stat = GET_STAT();
ide__sti(); /* local CPU only */ ide__sti(); /* local CPU only */
...@@ -554,9 +553,9 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -554,9 +553,9 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive)
return ide_stopped; return ide_stopped;
} }
static ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
{ {
ide_task_t *args = rq->special; struct ata_taskfile *args = rq->special;
ide_startstop_t startstop; ide_startstop_t startstop;
if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) {
...@@ -669,7 +668,7 @@ static ide_startstop_t task_mulin_intr(ide_drive_t *drive) ...@@ -669,7 +668,7 @@ static ide_startstop_t task_mulin_intr(ide_drive_t *drive)
} }
/* Called by ioctl to feature out type of command being called */ /* Called by ioctl to feature out type of command being called */
void ide_cmd_type_parser(ide_task_t *args) void ide_cmd_type_parser(struct ata_taskfile *args)
{ {
struct hd_drive_task_hdr *taskfile = &args->taskfile; struct hd_drive_task_hdr *taskfile = &args->taskfile;
...@@ -877,9 +876,9 @@ int ide_wait_taskfile(ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, st ...@@ -877,9 +876,9 @@ int ide_wait_taskfile(ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, st
{ {
struct request rq; struct request rq;
/* FIXME: This is on stack! */ /* FIXME: This is on stack! */
ide_task_t args; struct ata_taskfile args;
memset(&args, 0, sizeof(ide_task_t)); memset(&args, 0, sizeof(args));
args.taskfile = *taskfile; args.taskfile = *taskfile;
args.hobfile = *hobfile; args.hobfile = *hobfile;
...@@ -897,7 +896,7 @@ int ide_wait_taskfile(ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, st ...@@ -897,7 +896,7 @@ int ide_wait_taskfile(ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, st
return ide_do_drive_cmd(drive, &rq, ide_wait); return ide_do_drive_cmd(drive, &rq, ide_wait);
} }
int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *args, byte *buf) int ide_raw_taskfile(ide_drive_t *drive, struct ata_taskfile *args, byte *buf)
{ {
struct request rq; struct request rq;
init_taskfile_request(&rq); init_taskfile_request(&rq);
...@@ -943,7 +942,8 @@ int ide_cmd_ioctl(ide_drive_t *drive, struct inode *inode, struct file *file, un ...@@ -943,7 +942,8 @@ int ide_cmd_ioctl(ide_drive_t *drive, struct inode *inode, struct file *file, un
u8 *argbuf = args; u8 *argbuf = args;
byte xfer_rate = 0; byte xfer_rate = 0;
int argsize = 4; int argsize = 4;
ide_task_t tfargs; /* FIXME: this should not reside on the stack */
struct ata_taskfile tfargs;
if (NULL == (void *) arg) { if (NULL == (void *) arg) {
struct request rq; struct request rq;
......
...@@ -709,7 +709,7 @@ static inline u32 read_24 (ide_drive_t *drive) ...@@ -709,7 +709,7 @@ static inline u32 read_24 (ide_drive_t *drive)
/* /*
* Clean up after success/failure of an explicit drive cmd * Clean up after success/failure of an explicit drive cmd
*/ */
void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err) void ide_end_drive_cmd(ide_drive_t *drive, byte stat, byte err)
{ {
unsigned long flags; unsigned long flags;
struct request *rq; struct request *rq;
...@@ -738,8 +738,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err) ...@@ -738,8 +738,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err)
args[6] = IN_BYTE(IDE_SELECT_REG); args[6] = IN_BYTE(IDE_SELECT_REG);
} }
} else if (rq->flags & REQ_DRIVE_TASKFILE) { } else if (rq->flags & REQ_DRIVE_TASKFILE) {
ide_task_t *args = (ide_task_t *) rq->special; struct ata_taskfile *args = rq->special;
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
if (args) { if (args) {
args->taskfile.feature = err; args->taskfile.feature = err;
args->taskfile.sector_count = IN_BYTE(IDE_NSECTOR_REG); args->taskfile.sector_count = IN_BYTE(IDE_NSECTOR_REG);
...@@ -1023,9 +1023,9 @@ int ide_wait_stat(ide_startstop_t *startstop, ide_drive_t *drive, byte good, byt ...@@ -1023,9 +1023,9 @@ int ide_wait_stat(ide_startstop_t *startstop, ide_drive_t *drive, byte good, byt
} }
/* /*
* start_request() initiates handling of a new I/O request * This initiates handling of a new I/O request.
*/ */
static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) static ide_startstop_t start_request(ide_drive_t *drive, struct request *rq)
{ {
ide_startstop_t startstop; ide_startstop_t startstop;
unsigned long block; unsigned long block;
...@@ -1083,15 +1083,12 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) ...@@ -1083,15 +1083,12 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
*/ */
if (rq->flags & REQ_DRIVE_TASKFILE) { if (rq->flags & REQ_DRIVE_TASKFILE) {
ide_task_t *args = rq->special; struct ata_taskfile *args = rq->special;
if (!(args)) if (!(args))
goto args_error; goto args_error;
ata_taskfile(drive, ata_taskfile(drive, args, NULL);
&args->taskfile,
&args->hobfile,
args->handler, NULL, NULL);
if (((args->command_type == IDE_DRIVE_TASK_RAW_WRITE) || if (((args->command_type == IDE_DRIVE_TASK_RAW_WRITE) ||
(args->command_type == IDE_DRIVE_TASK_OUT)) && (args->command_type == IDE_DRIVE_TASK_OUT)) &&
...@@ -1185,7 +1182,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) ...@@ -1185,7 +1182,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
return ide_stopped; return ide_stopped;
} }
ide_startstop_t restart_request (ide_drive_t *drive) ide_startstop_t restart_request(ide_drive_t *drive)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
unsigned long flags; unsigned long flags;
...@@ -1417,9 +1414,9 @@ void ide_dma_timeout_retry(ide_drive_t *drive) ...@@ -1417,9 +1414,9 @@ void ide_dma_timeout_retry(ide_drive_t *drive)
} }
/* /*
* ide_timer_expiry() is our timeout function for all drive operations. * This is our timeout function for all drive operations. But note that it can
* But note that it can also be invoked as a result of a "sleep" operation * also be invoked as a result of a "sleep" operation triggered by the
* triggered by the mod_timer() call in ide_do_request. * mod_timer() call in ide_do_request.
*/ */
void ide_timer_expiry(unsigned long data) void ide_timer_expiry(unsigned long data)
{ {
...@@ -1478,7 +1475,7 @@ void ide_timer_expiry(unsigned long data) ...@@ -1478,7 +1475,7 @@ void ide_timer_expiry(unsigned long data)
disable_irq_nosync(hwif->irq); disable_irq_nosync(hwif->irq);
#else #else
disable_irq(hwif->irq); /* disable_irq_nosync ?? */ disable_irq(hwif->irq); /* disable_irq_nosync ?? */
#endif /* DISABLE_IRQ_NOSYNC */ #endif
__cli(); /* local CPU only, as if we were handling an interrupt */ __cli(); /* local CPU only, as if we were handling an interrupt */
if (hwgroup->poll_timeout != 0) { if (hwgroup->poll_timeout != 0) {
startstop = handler(drive); startstop = handler(drive);
...@@ -1608,7 +1605,8 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1608,7 +1605,8 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
drive = hwgroup->drive; drive = hwgroup->drive;
if (!drive) { if (!drive) {
/* /*
* This should NEVER happen, and there isn't much we could do about it here. * This should NEVER happen, and there isn't much we could do
* about it here.
*/ */
goto out_lock; goto out_lock;
} }
...@@ -1734,9 +1732,9 @@ int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t action ...@@ -1734,9 +1732,9 @@ int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t action
if (action == ide_preempt) if (action == ide_preempt)
hwgroup->rq = NULL; hwgroup->rq = NULL;
} else { } else {
if (action == ide_wait || action == ide_end) { if (action == ide_wait || action == ide_end)
queue_head = queue_head->prev; queue_head = queue_head->prev;
} else else
queue_head = queue_head->next; queue_head = queue_head->next;
} }
q->elevator.elevator_add_req_fn(q, rq, queue_head); q->elevator.elevator_add_req_fn(q, rq, queue_head);
...@@ -1848,7 +1846,7 @@ static int ide_open(struct inode * inode, struct file * filp) ...@@ -1848,7 +1846,7 @@ static int ide_open(struct inode * inode, struct file * filp)
/* Request a particular device type module. /* Request a particular device type module.
* *
* FIXME: The function which should rather requests the drivers is * FIXME: The function which should rather requests the drivers in
* ide_driver_module(), since it seems illogical and even a bit * ide_driver_module(), since it seems illogical and even a bit
* dangerous to delay this until open time! * dangerous to delay this until open time!
*/ */
...@@ -2088,7 +2086,7 @@ void ide_unregister(struct ata_channel *channel) ...@@ -2088,7 +2086,7 @@ void ide_unregister(struct ata_channel *channel)
* it. * it.
*/ */
old_hwif = *channel; old_hwif = *channel;
init_hwif_data(channel, channel->index); init_hwif_data(channel, channel->index);
channel->hwgroup = old_hwif.hwgroup; channel->hwgroup = old_hwif.hwgroup;
channel->tuneproc = old_hwif.tuneproc; channel->tuneproc = old_hwif.tuneproc;
......
...@@ -551,7 +551,7 @@ static ide_startstop_t promise_write (ide_drive_t *drive) ...@@ -551,7 +551,7 @@ static ide_startstop_t promise_write (ide_drive_t *drive)
* already set up. It issues a READ or WRITE command to the Promise * already set up. It issues a READ or WRITE command to the Promise
* controller, assuming LBA has been used to set up the block number. * controller, assuming LBA has been used to set up the block number.
*/ */
ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task)
{ {
struct request *rq = HWGROUP(drive)->rq; struct request *rq = HWGROUP(drive)->rq;
struct hd_drive_task_hdr *taskfile = &task->taskfile; struct hd_drive_task_hdr *taskfile = &task->taskfile;
...@@ -644,7 +644,7 @@ ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) ...@@ -644,7 +644,7 @@ ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task)
ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
{ {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
ide_task_t args; struct ata_taskfile args;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr));
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#include <linux/interrupt.h>
#include <asm/hdreg.h> #include <asm/hdreg.h>
#include <asm/bitops.h>
/* /*
* This is the multiple IDE interface driver, as evolved from hd.c. * This is the multiple IDE interface driver, as evolved from hd.c.
...@@ -111,6 +113,7 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -111,6 +113,7 @@ typedef unsigned char byte; /* used everywhere */
#define GET_ERR() IN_BYTE(IDE_ERROR_REG) #define GET_ERR() IN_BYTE(IDE_ERROR_REG)
#define GET_STAT() IN_BYTE(IDE_STATUS_REG) #define GET_STAT() IN_BYTE(IDE_STATUS_REG)
#define GET_ALTSTAT() IN_BYTE(IDE_CONTROL_REG) #define GET_ALTSTAT() IN_BYTE(IDE_CONTROL_REG)
#define GET_FEAT() IN_BYTE(IDE_NSECTOR_REG)
#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
#define BAD_R_STAT (BUSY_STAT | ERR_STAT) #define BAD_R_STAT (BUSY_STAT | ERR_STAT)
#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
...@@ -132,6 +135,7 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -132,6 +135,7 @@ typedef unsigned char byte; /* used everywhere */
*/ */
#define PRD_BYTES 8 #define PRD_BYTES 8
#define PRD_ENTRIES (PAGE_SIZE / (2 * PRD_BYTES)) #define PRD_ENTRIES (PAGE_SIZE / (2 * PRD_BYTES))
#define PRD_SEGMENTS 32
/* /*
* Some more useful definitions * Some more useful definitions
...@@ -275,7 +279,7 @@ typedef struct ide_drive_s { ...@@ -275,7 +279,7 @@ typedef struct ide_drive_s {
char type; /* distingiush different devices: disk, cdrom, tape, floppy, ... */ char type; /* distingiush different devices: disk, cdrom, tape, floppy, ... */
/* NOTE: If we had proper separation between channel and host chip, we /* NOTE: If we had proper separation between channel and host chip, we
* could move this to the chanell and many sync problems would * could move this to the channel and many sync problems would
* magically just go away. * magically just go away.
*/ */
request_queue_t queue; /* per device request queue */ request_queue_t queue; /* per device request queue */
...@@ -500,16 +504,18 @@ extern int ide_register_hw(hw_regs_t *hw, struct ata_channel **hwifp); ...@@ -500,16 +504,18 @@ extern int ide_register_hw(hw_regs_t *hw, struct ata_channel **hwifp);
extern void ide_unregister(struct ata_channel *hwif); extern void ide_unregister(struct ata_channel *hwif);
/* /*
* Status returned from various ide_ functions * Status returned by various functions.
*/ */
typedef enum { typedef enum {
ide_stopped, /* no drive operation was started */ ide_stopped, /* no drive operation was started */
ide_started /* a drive operation was started, and a handler was set */ ide_started, /* a drive operation was started, and a handler was set */
ide_released /* started and released bus */
} ide_startstop_t; } ide_startstop_t;
/* /*
* internal ide interrupt handler type * Interrupt handler types.
*/ */
struct ata_taskfile;
typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *); typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *);
typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
...@@ -519,15 +525,18 @@ typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); ...@@ -519,15 +525,18 @@ typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
*/ */
typedef int (ide_expiry_t)(ide_drive_t *); typedef int (ide_expiry_t)(ide_drive_t *);
#define IDE_BUSY 0 #define IDE_BUSY 0 /* awaiting an interrupt */
#define IDE_SLEEP 1 #define IDE_SLEEP 1
#define IDE_DMA 2 /* DMA in progress */
typedef struct hwgroup_s { typedef struct hwgroup_s {
ide_handler_t *handler;/* irq handler, if active */ ide_handler_t *handler;/* irq handler, if active */
unsigned long flags; /* BUSY, SLEEPING */ unsigned long flags; /* BUSY, SLEEPING */
ide_drive_t *drive; /* current drive */ ide_drive_t *drive; /* current drive */
struct ata_channel *hwif; /* ptr to current hwif in linked-list */ struct ata_channel *hwif; /* ptr to current hwif in linked-list */
struct request *rq; /* current request */ struct request *rq; /* current request */
struct timer_list timer; /* failsafe timer */ struct timer_list timer; /* failsafe timer */
struct request wrq; /* local copy of current write rq */ struct request wrq; /* local copy of current write rq */
unsigned long poll_timeout; /* timeout value during long polls */ unsigned long poll_timeout; /* timeout value during long polls */
...@@ -736,7 +745,7 @@ ide_startstop_t restart_request (ide_drive_t *); ...@@ -736,7 +745,7 @@ ide_startstop_t restart_request (ide_drive_t *);
/* /*
* This function is intended to be used prior to invoking ide_do_drive_cmd(). * This function is intended to be used prior to invoking ide_do_drive_cmd().
*/ */
void ide_init_drive_cmd (struct request *rq); extern void ide_init_drive_cmd (struct request *rq);
/* /*
* "action" parameter type for ide_do_drive_cmd() below. * "action" parameter type for ide_do_drive_cmd() below.
...@@ -760,13 +769,13 @@ extern int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t ...@@ -760,13 +769,13 @@ extern int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t
*/ */
void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err); void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err);
typedef struct ide_task_s { struct ata_taskfile {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
struct hd_drive_hob_hdr hobfile; struct hd_drive_hob_hdr hobfile;
int command_type; int command_type;
ide_pre_handler_t *prehandler; ide_pre_handler_t *prehandler;
ide_handler_t *handler; ide_handler_t *handler;
} ide_task_t; };
void ata_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount); void ata_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
void ata_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount); void ata_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
...@@ -776,11 +785,7 @@ void taskfile_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount) ...@@ -776,11 +785,7 @@ void taskfile_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount)
void taskfile_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount); void taskfile_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
extern ide_startstop_t ata_taskfile(ide_drive_t *drive, extern ide_startstop_t ata_taskfile(ide_drive_t *drive,
struct hd_drive_task_hdr *taskfile, struct ata_taskfile *args, struct request *rq);
struct hd_drive_hob_hdr *hobfile,
ide_handler_t *handler,
ide_pre_handler_t *prehandler,
struct request *rq);
/* /*
* Special Flagged Register Validation Caller * Special Flagged Register Validation Caller
...@@ -793,10 +798,11 @@ extern ide_startstop_t task_no_data_intr(ide_drive_t *drive); ...@@ -793,10 +798,11 @@ extern ide_startstop_t task_no_data_intr(ide_drive_t *drive);
int ide_wait_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, byte *buf); int ide_wait_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, byte *buf);
int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *cmd, byte *buf); int ide_raw_taskfile (ide_drive_t *drive, struct ata_taskfile *cmd, byte *buf);
/* Expects args is a full set of TF registers and parses the command type */ /* This is setting up all fields in args, which depend upon the command type.
extern void ide_cmd_type_parser(ide_task_t *args); */
extern void ide_cmd_type_parser(struct ata_taskfile *args);
int ide_cmd_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); int ide_cmd_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
int ide_task_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); int ide_task_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
...@@ -805,10 +811,10 @@ void ide_delay_50ms (void); ...@@ -805,10 +811,10 @@ void ide_delay_50ms (void);
byte ide_auto_reduce_xfer (ide_drive_t *drive); byte ide_auto_reduce_xfer (ide_drive_t *drive);
int ide_driveid_update (ide_drive_t *drive); int ide_driveid_update (ide_drive_t *drive);
int ide_ata66_check (ide_drive_t *drive, ide_task_t *args); int ide_ata66_check (ide_drive_t *drive, struct ata_taskfile *args);
int ide_config_drive_speed (ide_drive_t *drive, byte speed); int ide_config_drive_speed (ide_drive_t *drive, byte speed);
byte eighty_ninty_three (ide_drive_t *drive); byte eighty_ninty_three (ide_drive_t *drive);
int set_transfer (ide_drive_t *drive, ide_task_t *args); int set_transfer (ide_drive_t *drive, struct ata_taskfile *args);
extern int system_bus_speed; extern int system_bus_speed;
...@@ -896,6 +902,8 @@ extern void ide_setup_dma(struct ata_channel *hwif, ...@@ -896,6 +902,8 @@ extern void ide_setup_dma(struct ata_channel *hwif,
extern spinlock_t ide_lock; extern spinlock_t ide_lock;
#define DRIVE_LOCK(drive) ((drive)->queue.queue_lock)
extern int drive_is_ready(ide_drive_t *drive); extern int drive_is_ready(ide_drive_t *drive);
extern void revalidate_drives(void); extern void revalidate_drives(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment