Module Name: src Committed By: thorpej Date: Sun Mar 1 03:00:31 UTC 2020
Modified Files: src/sys/dev/pci: if_alc.c Log Message: - Use the 64-bit PCI DMA tag if available. - Add a comment explaining that if we were to use more than one Rx ring / Rx Return ring, all of the Rx-related control data would need to be in the same 4G segment. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/if_alc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.50 src/sys/dev/pci/if_alc.c:1.51 --- src/sys/dev/pci/if_alc.c:1.50 Sun Mar 1 02:28:14 2020 +++ src/sys/dev/pci/if_alc.c Sun Mar 1 03:00:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.50 2020/03/01 02:28:14 thorpej Exp $ */ +/* $NetBSD: if_alc.c,v 1.51 2020/03/01 03:00:31 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon <yong...@freebsd.org> @@ -1277,10 +1277,14 @@ alc_attach(device_t parent, device_t sel aprint_normal(": %s\n", sc->alc_ident->name); sc->sc_dev = self; - sc->sc_dmat = pa->pa_dmat; sc->sc_pct = pa->pa_pc; sc->sc_pcitag = pa->pa_tag; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; + /* * Allocate IO memory */ @@ -1610,6 +1614,13 @@ alc_dma_alloc(struct alc_softc *sc) sc->alc_cdata.alc_tx_ring_map->dm_segs[0].ds_addr; /* + * NOTE: If we used more than one Rx / Rx Return ring, + * we would need to ensure ALL of the Rx-related stuff + * ended up in the same 4G segment, since the hardware + * requires this. + */ + + /* * Create DMA stuffs for RX ring */ error = bus_dmamap_create(sc->sc_dmat, ALC_RX_RING_SZ, 1,