From db37fa8ff4a01b1922ba0e20426bafa804f0b806 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Tue, 20 Mar 2007 07:45:12 +0000 Subject: nothing from wdc, wd, or any of the existing ata stuff pls. this gets rid of the wdcreg.h include in atascsi. "feel free to remove" pascoe@ --- sys/dev/ata/atascsi.c | 16 +++++++++------- sys/dev/ata/atascsi.h | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'sys/dev/ata') diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index ee3e8b389aa..611c1c2cf5a 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.20 2007/03/20 07:09:42 pascoe Exp $ */ +/* $OpenBSD: atascsi.c,v 1.21 2007/03/20 07:45:11 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -31,11 +31,13 @@ #include -#include - /* XXX ata_identify should be in atareg.h */ #define ATA_C_IDENTIFY 0xec +#define ATA_C_READDMA 0xc8 +#define ATA_C_WRITEDMA 0xca +#define ATA_C_READDMA_EXT 0x25 +#define ATA_C_WRITEDMA_EXT 0x35 struct ata_identify { u_int16_t config; /* 0 */ @@ -410,8 +412,8 @@ atascsi_disk_cmd(struct scsi_xfer *xs) if (sector_count > 0x100 || lba > 0xfffffff) { /* Use LBA48 */ regs[H2D_COMMAND] = (xa->flags & ATA_F_WRITE) ? - WDCC_WRITEDMA_EXT : WDCC_READDMA_EXT; - regs[DEVICE] = WDSD_LBA; + ATA_C_WRITEDMA_EXT : ATA_C_READDMA_EXT; + regs[DEVICE] = H2D_DEVICE_LBA; regs[LBA_LOW_EXP] = (lba >> 24) & 0xff; regs[LBA_MID_EXP] = (lba >> 32) & 0xff; regs[LBA_HIGH_EXP] = (lba >> 40) & 0xff; @@ -420,8 +422,8 @@ atascsi_disk_cmd(struct scsi_xfer *xs) } else { /* Use LBA */ regs[H2D_COMMAND] = (xa->flags & ATA_F_WRITE) ? - WDCC_WRITEDMA : WDCC_READDMA; - regs[DEVICE] = WDSD_LBA | ((lba >> 24) & 0x0f); + ATA_C_WRITEDMA : ATA_C_READDMA; + regs[DEVICE] = H2D_DEVICE_LBA | ((lba >> 24) & 0x0f); regs[SECTOR_COUNT] = sector_count & 0xff; } diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h index 6e78aceb069..1334d2103f5 100644 --- a/sys/dev/ata/atascsi.h +++ b/sys/dev/ata/atascsi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.h,v 1.11 2007/03/20 07:09:42 pascoe Exp $ */ +/* $OpenBSD: atascsi.h,v 1.12 2007/03/20 07:45:11 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -69,6 +69,7 @@ enum ata_register_map { LBA_HIGH = 6, DEVICE_HEAD = 7, DEVICE = 7, +#define H2D_DEVICE_LBA 0x40 SECTOR_NUM_EXP = 8, LBA_LOW_EXP = 8, CYL_LOW_EXP = 9, -- cgit v1.2.3