diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-03 09:35:49 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-03 09:35:49 +0000 |
commit | 808ae6e2aebd3ed14755fe746da77574ac6b439a (patch) | |
tree | 8e05388c847f80e2014c877d32f8aea1a1df9cc1 /sys/dev/ata | |
parent | bfbfee5667fc4d1e7eebf8215ab2bad643d77a1a (diff) |
byteswap the cmdset word properly so we enable the right features on
bigendian archs.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/atascsi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 4bccf8d3596..03f2f8a7b23 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.74 2010/04/03 09:32:14 dlg Exp $ */ +/* $OpenBSD: atascsi.c,v 1.75 2010/04/03 09:35:48 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -172,6 +172,7 @@ atascsi_probe(struct scsi_link *link) struct ata_xfer *xa; int port, type; int rv; + u_int16_t cmdset; /* revisit this when we do port multipliers */ if (link->lun > 0) @@ -222,8 +223,10 @@ atascsi_probe(struct scsi_link *link) if (type != ATA_PORT_T_DISK) return (0); + cmdset = letoh16(ap->ap_identify.cmdset82); + /* Enable write cache if supported */ - if (ap->ap_identify.cmdset82 & ATA_IDENTIFY_WRITECACHE) { + if (ISSET(cmdset, ATA_IDENTIFY_WRITECACHE)) { xa = ata_get_xfer(ap); if (xa == NULL) panic("no free xfers on a new port"); @@ -238,7 +241,7 @@ atascsi_probe(struct scsi_link *link) } /* Enable read lookahead if supported */ - if (ap->ap_identify.cmdset82 & ATA_IDENTIFY_LOOKAHEAD) { + if (ISSET(cmdset, ATA_IDENTIFY_LOOKAHEAD)) { xa = ata_get_xfer(ap); if (xa == NULL) panic("no free xfers on a new port"); |