Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci use 64-bit DMA where possible.



details:   https://anonhg.NetBSD.org/src/rev/a3897e324db5
branches:  trunk
changeset: 781696:a3897e324db5
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Sep 23 01:12:01 2012 +0000

description:
use 64-bit DMA where possible.

diffstat:

 sys/dev/pci/if_nfe.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 20cef20ea01e -r a3897e324db5 sys/dev/pci/if_nfe.c
--- a/sys/dev/pci/if_nfe.c      Sun Sep 23 01:11:14 2012 +0000
+++ b/sys/dev/pci/if_nfe.c      Sun Sep 23 01:12:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_nfe.c,v 1.56 2012/07/22 14:33:03 matt Exp $ */
+/*     $NetBSD: if_nfe.c,v 1.57 2012/09/23 01:12:01 chs Exp $  */
 /*     $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $        */
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.56 2012/07/22 14:33:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.57 2012/09/23 01:12:01 chs Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -255,8 +255,6 @@
        }
        aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
-       sc->sc_dmat = pa->pa_dmat;
-
        csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
        csr |= PCI_COMMAND_MASTER_ENABLE;
        pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
@@ -324,6 +322,11 @@
                break;
        }
 
+       if (pci_dma64_available(pa) && (sc->sc_flags & NFE_40BIT_ADDR) != 0)
+               sc->sc_dmat = pa->pa_dmat64;
+       else
+               sc->sc_dmat = pa->pa_dmat;
+
        nfe_poweron(self);
 
 #ifndef NFE_NO_JUMBO



Home | Main Index | Thread Index | Old Index