Index: src/sys/dev/ata/satafis_subr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/satafis_subr.c,v
retrieving revision 1.7
diff -u -r1.7 satafis_subr.c
--- src/sys/dev/ata/satafis_subr.c	22 Jul 2012 17:57:57 -0000	1.7
+++ src/sys/dev/ata/satafis_subr.c	20 Jul 2019 10:12:28 -0000
@@ -140,12 +140,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;
 }
