Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev/ata Pull up following revision(s) (requested by g...



details:   https://anonhg.NetBSD.org/src/rev/4c46a869d497
branches:  netbsd-9
changeset: 962943:4c46a869d497
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 05 09:02:48 2019 +0000

description:
Pull up following revision(s) (requested by gson in ticket #179):

        sys/dev/ata/satafis_subr.c: revision 1.9

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 10fcf1d9f63f -r 4c46a869d497 sys/dev/ata/satafis_subr.c
--- a/sys/dev/ata/satafis_subr.c        Thu Sep 05 09:00:22 2019 +0000
+++ b/sys/dev/ata/satafis_subr.c        Thu Sep 05 09:02:48 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.8.10.1 2019/09/05 09:02:48 martin 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.8.10.1 2019/09/05 09:02:48 martin 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