Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci For the PIIX, make sure the PIO_mode and DMA_mod...



details:   https://anonhg.NetBSD.org/src/rev/c1aec566ec86
branches:  trunk
changeset: 473263:c1aec566ec86
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu May 27 09:45:50 1999 +0000

description:
For the PIIX, make sure the PIO_mode and DMA_mode get reset to the values used
by the controller for all drives.

diffstat:

 sys/dev/pci/pciide.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (65 lines):

diff -r 4f7b56c82751 -r c1aec566ec86 sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c      Thu May 27 09:08:25 1999 +0000
+++ b/sys/dev/pci/pciide.c      Thu May 27 09:45:50 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide.c,v 1.37 1999/05/05 15:24:59 bouyer Exp $       */
+/*     $NetBSD: pciide.c,v 1.38 1999/05/27 09:45:50 bouyer Exp $       */
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -1283,6 +1283,7 @@
                mode[0] = mode[1] =
                    min(drvp[0].DMA_mode, drvp[1].DMA_mode);
                    drvp[0].DMA_mode = mode[0];
+                   drvp[1].DMA_mode = mode[1];
                goto ok;
        }
        /*
@@ -1294,7 +1295,7 @@
                mode[1] = drvp[1].PIO_mode;
                if (piix_isp_pio[mode[1]] != piix_isp_dma[mode[0]] ||
                    piix_rtc_pio[mode[1]] != piix_rtc_dma[mode[0]])
-                       mode[1] = 0;
+                       mode[1] = drvp[1].PIO_mode = 0;
                goto ok;
        }
        if (drvp[1].drive_flags & DRIVE_DMA) {
@@ -1302,7 +1303,7 @@
                mode[0] = drvp[0].PIO_mode;
                if (piix_isp_pio[mode[0]] != piix_isp_dma[mode[1]] ||
                    piix_rtc_pio[mode[0]] != piix_rtc_dma[mode[1]])
-                       mode[0] = 0;
+                       mode[0] = drvp[0].PIO_mode = 0;
                goto ok;
        }
        /*
@@ -1310,24 +1311,24 @@
         * one of them is PIO mode < 2
         */
        if (drvp[0].PIO_mode < 2) {
-               mode[0] = 0;
+               mode[0] = drvp[0].PIO_mode = 0;
                mode[1] = drvp[1].PIO_mode;
        } else if (drvp[1].PIO_mode < 2) {
-               mode[1] = 0;
+               mode[1] = drvp[1].PIO_mode = 0;
                mode[0] = drvp[0].PIO_mode;
        } else {
                mode[0] = mode[1] =
                    min(drvp[1].PIO_mode, drvp[0].PIO_mode);
+               drvp[0].PIO_mode = mode[0];
+               drvp[1].PIO_mode = mode[1];
        }
 ok:    /* The modes are setup */
        for (drive = 0; drive < 2; drive++) {
                if (drvp[drive].drive_flags & DRIVE_DMA) {
-                       drvp[drive].DMA_mode = mode[drive];
                        idetim |= piix_setup_idetim_timings(
                            mode[drive], 1, chp->channel);
                        goto end;
-               } else
-                       drvp[drive].PIO_mode = mode[drive];
+               }
        }
        /* If we are there, none of the drives are DMA */
        if (mode[0] >= 2)



Home | Main Index | Thread Index | Old Index