Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix the way we compute the mode to use: for mult...



details:   https://anonhg.NetBSD.org/src/rev/21754c4de143
branches:  trunk
changeset: 472719:21754c4de143
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 05 15:24:59 1999 +0000

description:
Fix the way we compute the mode to use: for multiword DMA, the used mode was
2 less than the one we could really use, so for multiword DMA mode 0 or 1,
the driver tried to use DMA mode 255 or 254 (0 - 2 with a u_int8_t).

diffstat:

 sys/dev/pci/pciide.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 45fa14d83410 -r 21754c4de143 sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c      Wed May 05 14:31:16 1999 +0000
+++ b/sys/dev/pci/pciide.c      Wed May 05 15:24:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide.c,v 1.36 1999/05/03 07:44:47 ross Exp $ */
+/*     $NetBSD: pciide.c,v 1.37 1999/05/05 15:24:59 bouyer Exp $       */
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -1682,18 +1682,24 @@
                        if (drvp->PIO_mode <= (drvp->DMA_mode +2))
                                mode = drvp->PIO_mode;
                        else
-                               mode = drvp->DMA_mode;
+                               mode = drvp->DMA_mode + 2;
                }
                idedma_ctl |= IDEDMA_CTL_DRV_DMA(drive);
 
 pio:           /* setup PIO mode */
+               if (mode <= 2) {
+                       drvp->DMA_mode = 0;
+                       drvp->PIO_mode = 0;
+                       mode = 0;
+               } else {
+                       drvp->PIO_mode = mode;
+                       drvp->DMA_mode = mode - 2;
+               }
                datatim_reg |=
                    APO_DATATIM_PULSE(chp->channel, drive,
                        apollo_pio_set[mode]) |
                    APO_DATATIM_RECOV(chp->channel, drive,
                        apollo_pio_rec[mode]);
-               drvp->PIO_mode = mode;
-               drvp->DMA_mode = mode - 2;
        }
        if (idedma_ctl != 0) {
                /* Add software bits in status register */



Home | Main Index | Thread Index | Old Index