Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci if MMIO is allowed and available, prefer it over...



details:   https://anonhg.NetBSD.org/src/rev/d64e6e9c6b51
branches:  trunk
changeset: 326799:d64e6e9c6b51
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Feb 18 12:32:12 2014 +0000

description:
if MMIO is allowed and available, prefer it over PIO
now my ADPT,2930CU works again

diffstat:

 sys/dev/pci/ahc_pci.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (49 lines):

diff -r 8ee34c931f47 -r d64e6e9c6b51 sys/dev/pci/ahc_pci.c
--- a/sys/dev/pci/ahc_pci.c     Tue Feb 18 12:27:15 2014 +0000
+++ b/sys/dev/pci/ahc_pci.c     Tue Feb 18 12:32:12 2014 +0000
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: ahc_pci.c,v 1.68 2009/11/26 15:17:08 njoly Exp $
+ * $Id: ahc_pci.c,v 1.69 2014/02/18 12:32:12 macallan Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.68 2009/11/26 15:17:08 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.69 2014/02/18 12:32:12 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -833,20 +833,22 @@
        ioh_valid = (pci_mapreg_map(pa, AHC_PCI_IOADDR,
                                    PCI_MAPREG_TYPE_IO, 0, &iot,
                                    &ioh, NULL, NULL) == 0);
+
 #if 0
        printf("%s: bus info: memt 0x%lx, memh 0x%lx, iot 0x%lx, ioh 0x%lx\n",
            ahc_name(ahc), (u_long)memt, (u_long)memh, (u_long)iot,
            (u_long)ioh);
 #endif
 
+#ifdef AHC_ALLOW_MEMIO
+       if (memh_valid) {
+               st = memt;
+               sh = memh;
+       } else
+#endif
        if (ioh_valid) {
                st = iot;
                sh = ioh;
-#ifdef AHC_ALLOW_MEMIO
-       } else if (memh_valid) {
-               st = memt;
-               sh = memh;
-#endif
        } else {
                printf(": unable to map registers\n");
                return;



Home | Main Index | Thread Index | Old Index