Source-Changes-HG archive

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

[src/jdolecek-ncq]: src/sys/dev/ata restore the atac_claim_hw and atac_free_h...



details:   https://anonhg.NetBSD.org/src/rev/6dae64f642f8
branches:  jdolecek-ncq
changeset: 823039:6dae64f642f8
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Sep 27 19:05:57 2017 +0000

description:
restore the atac_claim_hw and atac_free_hw hooks, they are used on atari

diffstat:

 sys/dev/ata/ata.c    |  11 +++++++++--
 sys/dev/ata/atavar.h |   9 ++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r 981136052345 -r 6dae64f642f8 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Wed Sep 27 19:04:05 2017 +0000
+++ b/sys/dev/ata/ata.c Wed Sep 27 19:05:57 2017 +0000
@@ -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 @@
                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 @@
        }
 #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);
diff -r 981136052345 -r 6dae64f642f8 sys/dev/ata/atavar.h
--- a/sys/dev/ata/atavar.h      Wed Sep 27 19:04:05 2017 +0000
+++ b/sys/dev/ata/atavar.h      Wed Sep 27 19:05:57 2017 +0000
@@ -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 @@
        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.
         */



Home | Main Index | Thread Index | Old Index