Commit e23da570 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

ata: Fix bus master direction flag


! ata: Bit 3 in the Bus Master IDE Command Register is set if the DMA
  transfer is a bus master write, i.e. read from disk and write to
  memory. Current code got that wrong and sets it for writes to the
  disk.
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent 15bc4278
No related merge requests found
Showing with 5 additions and 4 deletions
+5 -4
......@@ -116,7 +116,7 @@
// Bits im Busmaster Command Register
#define BMR_CMD_START (1 << 0)
#define BMR_CMD_WRITE (1 << 3)
#define BMR_CMD_READ (1 << 3)
// Bits im Busmaster Status Register
#define BMR_STATUS_ERROR (1 << 1)
......
......@@ -461,10 +461,11 @@ static int ata_protocol_dma(struct ata_request* request)
// aus, dass es notwendig ist.
cdi_inb(ctrl->port_bmr_base + BMR_COMMAND);
cdi_inb(ctrl->port_bmr_base + BMR_STATUS);
// Busmastering starten
if (request->flags.direction != READ) {
cdi_outb(ctrl->port_bmr_base + BMR_COMMAND, BMR_CMD_START |
BMR_CMD_WRITE);
if (request->flags.direction == READ) {
cdi_outb(ctrl->port_bmr_base + BMR_COMMAND,
BMR_CMD_START | BMR_CMD_READ);
} else {
cdi_outb(ctrl->port_bmr_base + BMR_COMMAND, BMR_CMD_START);
}
......
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