Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adb1af98 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: pass command instead of request to ide_pio_datablock()



* Add IDE_TFLAG_FS taskfile flag and set it for REQ_TYPE_FS requests.

* Convert ->{in,out}put_data methods to take command instead of request
  as an argument.  Then convert pre_task_out_intr(), task_end_request(),
  task_error(), task_in_unexpected(), ide_pio_sector(), ide_pio_multi()
  and ide_pio_datablock() in similar way.

* Rename task_end_request() to ide_finish_cmd().

There should be no functional changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 22aa4b32
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ static void apply_timings(const u8 chipselect, const u8 pio,
	set_smc_timings(chipselect, cycle, setup, pulse, data_float, use_iordy);
}

static void at91_ide_input_data(ide_drive_t *drive, struct request *rq,
static void at91_ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
				void *buf, unsigned int len)
{
	ide_hwif_t *hwif = drive->hwif;
@@ -160,7 +160,7 @@ static void at91_ide_input_data(ide_drive_t *drive, struct request *rq,
	leave_16bit(chipselect, mode);
}

static void at91_ide_output_data(ide_drive_t *drive, struct request *rq,
static void at91_ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
				 void *buf, unsigned int len)
{
	ide_hwif_t *hwif = drive->hwif;
+2 −2
Original line number Diff line number Diff line
@@ -86,13 +86,13 @@ void auide_outsw(unsigned long port, void *addr, u32 count)
	ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);
}

static void au1xxx_input_data(ide_drive_t *drive, struct request *rq,
static void au1xxx_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
			      void *buf, unsigned int len)
{
	auide_insw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
}

static void au1xxx_output_data(ide_drive_t *drive, struct request *rq,
static void au1xxx_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
			       void *buf, unsigned int len)
{
	auide_outsw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
+4 −4
Original line number Diff line number Diff line
@@ -62,23 +62,23 @@ static void falconide_get_lock(irq_handler_t handler, void *data)
	}
}

static void falconide_input_data(ide_drive_t *drive, struct request *rq,
static void falconide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
				 void *buf, unsigned int len)
{
	unsigned long data_addr = drive->hwif->io_ports.data_addr;

	if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS)
	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS))
		return insw(data_addr, buf, (len + 1) / 2);

	raw_insw_swapw((u16 *)data_addr, buf, (len + 1) / 2);
}

static void falconide_output_data(ide_drive_t *drive, struct request *rq,
static void falconide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
				  void *buf, unsigned int len)
{
	unsigned long data_addr = drive->hwif->io_ports.data_addr;

	if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS)
	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS))
		return outsw(data_addr, buf, (len + 1) / 2);

	raw_outsw_swapw((u16 *)data_addr, buf, (len + 1) / 2);
+2 −0
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
		tf->device = head;
	}

	cmd.tf_flags |= IDE_TFLAG_FS;

	if (rq_data_dir(rq))
		cmd.tf_flags |= IDE_TFLAG_WRITE;

+2 −2
Original line number Diff line number Diff line
@@ -96,9 +96,9 @@ ide_startstop_t ide_dma_intr(ide_drive_t *drive)

	if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
		if (!dma_stat) {
			struct request *rq = hwif->rq;
			struct ide_cmd *cmd = &hwif->cmd;

			task_end_request(drive, rq, stat);
			ide_finish_cmd(drive, cmd, stat);
			return ide_stopped;
		}
		printk(KERN_ERR "%s: %s: bad DMA status (0x%02x)\n",
Loading