Module Name: src
Committed By: jdolecek
Date: Wed Sep 27 19:05:57 UTC 2017
Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c atavar.h
Log Message:
restore the atac_claim_hw and atac_free_hw hooks, they are used on atari
To generate a diff of this commit:
cvs rdiff -u -r1.132.8.37 -r1.132.8.38 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.92.8.27 -r1.92.8.28 src/sys/dev/ata/atavar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.37 src/sys/dev/ata/ata.c:1.132.8.38
--- src/sys/dev/ata/ata.c:1.132.8.37 Mon Sep 25 22:43:46 2017
+++ src/sys/dev/ata/ata.c Wed Sep 27 19:05:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ata.c,v 1.132.8.37 2017/09/25 22:43:46 jdolecek Exp $ */
+/* $NetBSD: ata.c,v 1.132.8.38 2017/09/27 19:05:57 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.37 2017/09/25 22:43:46 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.38 2017/09/27 19:05:57 jdolecek Exp $");
#include "opt_ata.h"
@@ -1355,6 +1355,10 @@ again:
goto out;
}
+ if (atac->atac_claim_hw)
+ if (!atac->atac_claim_hw(chp, 0))
+ goto out;
+
ATADEBUG_PRINT(("atastart: xfer %p channel %d drive %d\n", xfer,
chp->ch_channel, xfer->c_drive), DEBUG_XFERS);
if (drvp->drive_flags & ATA_DRIVE_RESET) {
@@ -1529,6 +1533,9 @@ ata_free_xfer(struct ata_channel *chp, s
}
#endif
+ if (chp->ch_atac->atac_free_hw)
+ chp->ch_atac->atac_free_hw(chp);
+
KASSERT((chq->active_xfers_used & __BIT(xfer->c_slot)) == 0);
KASSERT((chq->queue_xfers_avail & __BIT(xfer->c_slot)) == 0);
chq->queue_xfers_avail |= __BIT(xfer->c_slot);
Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.92.8.27 src/sys/dev/ata/atavar.h:1.92.8.28
--- src/sys/dev/ata/atavar.h:1.92.8.27 Tue Sep 26 20:15:36 2017
+++ src/sys/dev/ata/atavar.h Wed Sep 27 19:05:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: atavar.h,v 1.92.8.27 2017/09/26 20:15:36 jdolecek Exp $ */
+/* $NetBSD: atavar.h,v 1.92.8.28 2017/09/27 19:05:57 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -483,6 +483,13 @@ struct atac_softc {
void (*atac_probe)(struct ata_channel *);
/*
+ * Optional callbacks to lock/unlock hardware.
+ * Called with channel mutex held.
+ */
+ int (*atac_claim_hw)(struct ata_channel *, int);
+ void (*atac_free_hw)(struct ata_channel *);
+
+ /*
* Optional callbacks to set drive mode. Required for anything
* but basic PIO operation.
*/