diff options
| author | jakllsch <jakllsch@NetBSD.org> | 2012-07-22 18:12:01 +0000 |
|---|---|---|
| committer | jakllsch <jakllsch@NetBSD.org> | 2012-07-22 18:12:01 +0000 |
| commit | c3e0773bc2d0d0d0b9616493a3d5e1ee6f7e05a4 (patch) | |
| tree | 9d3f57cd1abec411465888441ecb29349a8beb79 /sys/dev | |
| parent | 9238905c9cf1598ae060f08fd8b17bce623f2fa6 (diff) | |
Correctly issue port multiplier register access commands as LBA48 now that the
FIS code doesn't get in the way of doing that.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/satapmp_subr.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/ata/satapmp_subr.c b/sys/dev/ata/satapmp_subr.c index 18d4c910eb0..8f4d4869545 100644 --- a/sys/dev/ata/satapmp_subr.c +++ b/sys/dev/ata/satapmp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: satapmp_subr.c,v 1.3 2012/07/22 18:03:34 jakllsch Exp $ */ +/* $NetBSD: satapmp_subr.c,v 1.4 2012/07/22 18:12:01 jakllsch Exp $ */ /* * Copyright (c) 2012 Manuel Bouyer. All rights reserved. @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: satapmp_subr.c,v 1.3 2012/07/22 18:03:34 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: satapmp_subr.c,v 1.4 2012/07/22 18:12:01 jakllsch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -64,11 +64,11 @@ satapmp_read(struct ata_channel *chp, int port, int reg, uint32_t *value) ata_c.r_command = PMPC_READ_PORT; ata_c.r_features = reg; - ata_c.r_lba = (port & 0xf) << 24; + ata_c.r_device = port; ata_c.timeout = 3000; /* 3s */ ata_c.r_st_bmask = WDCS_DRDY; ata_c.r_st_pmask = 0; - ata_c.flags = AT_READREG | AT_WAIT; + ata_c.flags = AT_LBA48 | AT_READREG | AT_WAIT; if ((*atac->atac_bustype_ata->ata_exec_command)(drvp, &ata_c) != ATACMD_COMPLETE) { @@ -92,7 +92,6 @@ satapmp_read(struct ata_channel *chp, int port, int reg, uint32_t *value) return 0; } -static int satapmp_write(struct ata_channel *chp, int, int, uint32_t) __unused; static int satapmp_write(struct ata_channel *chp, int port, int reg, uint32_t value) { @@ -110,13 +109,13 @@ satapmp_write(struct ata_channel *chp, int port, int reg, uint32_t value) ata_c.r_command = PMPC_WRITE_PORT; ata_c.r_features = reg; - ata_c.r_lba = (port & 0xf) << 24; - ata_c.r_lba |= (value & 0xffffff00) >> 8; + ata_c.r_device = port; + ata_c.r_lba = (value & 0xffffff00) >> 8; ata_c.r_count = value & 0xff; ata_c.timeout = 3000; /* 3s */ ata_c.r_st_bmask = WDCS_DRDY; ata_c.r_st_pmask = 0; - ata_c.flags = AT_WAIT; + ata_c.flags = AT_LBA48 | AT_WAIT; if ((*atac->atac_bustype_ata->ata_exec_command)(drvp, &ata_c) != ATACMD_COMPLETE) { |
