diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-02-15 14:10:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-02-15 14:10:59 +0000 |
commit | fc6d20d53c04161f723bf26a7978b4cf2346bf63 (patch) | |
tree | 04d8ab47cdc8a59a5ee4989b6b5807f73a14607e | |
parent | d3f1990b7db2c64b361bbac1c6fd58dc9810e814 (diff) |
Don't print the version twice, but do print a newline before attaching the
PHY.
Put the DMA address of the mbuf into the rx descriptors (instead of the
length). Use the correct value when setting the tx ring tail pointer.
This make sending and receiving packets work as long as the interface
is in promiscuous mode.
ok patrick@
-rw-r--r-- | sys/dev/fdt/if_dwqe_fdt.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/dwqe.c | 12 |
2 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/fdt/if_dwqe_fdt.c b/sys/dev/fdt/if_dwqe_fdt.c index a7d6186f6ed..10e5a69d0e5 100644 --- a/sys/dev/fdt/if_dwqe_fdt.c +++ b/sys/dev/fdt/if_dwqe_fdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dwqe_fdt.c,v 1.1 2023/02/13 19:18:53 patrick Exp $ */ +/* $OpenBSD: if_dwqe_fdt.c,v 1.2 2023/02/15 14:10:58 kettenis Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2017, 2022 Patrick Wildt <patrick@blueri.se> @@ -85,7 +85,6 @@ dwqe_fdt_attach(struct device *parent, struct device *self, void *aux) struct fdt_attach_args *faa = aux; uint32_t phy, phy_supply; uint32_t axi_config; - uint32_t version; int i, node; sc->sc_node = faa->fa_node; @@ -134,9 +133,6 @@ dwqe_fdt_attach(struct device *parent, struct device *self, void *aux) } delay(5000); - version = dwqe_read(sc, GMAC_VERSION); - printf(": rev 0x%02x", version & GMAC_VERSION_SNPS_MASK); - /* Power up PHY. */ phy_supply = OF_getpropint(faa->fa_node, "phy-supply", 0); if (phy_supply) diff --git a/sys/dev/ic/dwqe.c b/sys/dev/ic/dwqe.c index 401cd05b8f0..a7275ccba58 100644 --- a/sys/dev/ic/dwqe.c +++ b/sys/dev/ic/dwqe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwqe.c,v 1.1 2023/02/13 19:18:53 patrick Exp $ */ +/* $OpenBSD: dwqe.c,v 1.2 2023/02/15 14:10:58 kettenis Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2017, 2022 Patrick Wildt <patrick@blueri.se> @@ -109,7 +109,7 @@ dwqe_attach(struct dwqe_softc *sc) int i; version = dwqe_read(sc, GMAC_VERSION); - printf(": rev 0x%02x, address %s", version & GMAC_VERSION_SNPS_MASK, + printf(": rev 0x%02x, address %s\n", version & GMAC_VERSION_SNPS_MASK, ether_sprintf(sc->sc_lladdr)); for (i = 0; i < 4; i++) @@ -1011,7 +1011,7 @@ dwqe_encap(struct dwqe_softc *sc, struct mbuf *m, int *idx, int *used) *idx * sizeof(*txd), sizeof(*txd), BUS_DMASYNC_PREWRITE); dwqe_write(sc, GMAC_CHAN_TX_END_ADDR(0), DWQE_DMA_DVA(sc->sc_txring) + - sc->sc_tx_cons * sizeof(*txd)); + frag * sizeof(*txd)); KASSERT(sc->sc_txbuf[cur].tb_m == NULL); sc->sc_txbuf[*idx].tb_map = sc->sc_txbuf[cur].tb_map; @@ -1130,11 +1130,11 @@ dwqe_fill_rx_ring(struct dwqe_softc *sc) break; /* TODO: check for 32-bit vs 64-bit support */ - KASSERT((rxb->tb_map->dm_segs[0].ds_len >> 32) == 0); + KASSERT((rxb->tb_map->dm_segs[0].ds_addr >> 32) == 0); rxd = &sc->sc_rxdesc[sc->sc_rx_prod]; - rxd->sd_tdes0 = (uint32_t)rxb->tb_map->dm_segs[0].ds_len; - rxd->sd_tdes1 = (uint32_t)(rxb->tb_map->dm_segs[0].ds_len >> 32); + rxd->sd_tdes0 = (uint32_t)rxb->tb_map->dm_segs[0].ds_addr; + rxd->sd_tdes1 = (uint32_t)(rxb->tb_map->dm_segs[0].ds_addr >> 32); rxd->sd_tdes2 = 0; rxd->sd_tdes3 = RDES3_OWN | RDES3_IC | RDES3_BUF1V; |