Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata Set the ATAPI "BYTE COUNT LIMIT" field in the SA...



details:   https://anonhg.NetBSD.org/src/rev/f9d69ae3a80b
branches:  trunk
changeset: 458898:f9d69ae3a80b
user:      gson <gson%NetBSD.org@localhost>
date:      Thu Aug 15 09:00:23 2019 +0000

description:
Set the ATAPI "BYTE COUNT LIMIT" field in the SATA case like we
already do in the ATA case, to make NetBSD work with the virtual
SATA CD-ROM of "qemu-system-i386 -machine q35".  Fixes PR kern/54389.
OK mlelstv.

diffstat:

 sys/dev/ata/satafis_subr.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 7a0ab880d590 -r f9d69ae3a80b sys/dev/ata/satafis_subr.c
--- a/sys/dev/ata/satafis_subr.c        Thu Aug 15 08:55:06 2019 +0000
+++ b/sys/dev/ata/satafis_subr.c        Thu Aug 15 09:00:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: satafis_subr.c,v 1.9 2019/08/15 09:00:23 gson Exp $ */
 
 /*-
  * Copyright (c) 2009 Jonathan A. Kollasch.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.9 2019/08/15 09:00:23 gson Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -149,12 +149,16 @@
 void
 satafis_rhd_construct_atapi(struct ata_xfer *xfer, uint8_t *fis)
 {
+       int bcount16;
 
        memset(fis, 0, RHD_FISLEN);
 
        fis[fis_type] = RHD_FISTYPE;
        fis[rhd_c] = RHD_C;
        fis[rhd_command] = ATAPI_PKT_CMD;
+       bcount16 = xfer->c_bcount <= 0xffff ? xfer->c_bcount : 0xffff;
+       fis[rhd_lba1] = (bcount16 >> 0) & 0xff;
+       fis[rhd_lba2] = (bcount16 >> 8) & 0xff;
        fis[rhd_features0] = (xfer->c_flags & C_DMA) ?
            ATAPI_PKT_CMD_FTRE_DMA : 0;
 }



Home | Main Index | Thread Index | Old Index