diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-10-12 02:54:00 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-10-12 02:54:00 +0000 |
commit | 789061fea8337e6ec410976b19a6ff216317d1da (patch) | |
tree | b51bd39ada9c95249c63cd405d27a05ca82304b1 /sys | |
parent | 5abebc56ff0de552da169a8f66410d251f13d408 (diff) |
only one vtophys left (tx data)... both the rx and tx descriptors are
fully handled by bus_dma now.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_vr.c | 17 | ||||
-rw-r--r-- | sys/dev/pci/if_vrreg.h | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 994c05ff292..5a2464db150 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.37 2003/10/12 02:35:53 jason Exp $ */ +/* $OpenBSD: if_vr.c,v 1.38 2003/10/12 02:53:59 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -891,6 +891,9 @@ vr_list_tx_init(sc) ld = sc->vr_ldata; for (i = 0; i < VR_TX_LIST_CNT; i++) { cd->vr_tx_chain[i].vr_ptr = &ld->vr_tx_list[i]; + cd->vr_tx_chain[i].vr_paddr = + sc->sc_listmap->dm_segs[0].ds_addr + + offsetof(struct vr_list_data, vr_tx_list[i]); if (i == (VR_TX_LIST_CNT - 1)) cd->vr_tx_chain[i].vr_nextdesc = &cd->vr_tx_chain[0]; @@ -926,7 +929,9 @@ vr_list_rx_init(sc) for (i = 0; i < VR_RX_LIST_CNT; i++) { d = (struct vr_desc *)&ld->vr_rx_list[i]; cd->vr_rx_chain[i].vr_ptr = d; - + cd->vr_rx_chain[i].vr_paddr = + sc->sc_listmap->dm_segs[0].ds_addr + + offsetof(struct vr_list_data, vr_rx_list[i]); cd->vr_rx_chain[i].vr_buf = (u_int8_t *)malloc(MCLBYTES, M_DEVBUF, M_NOWAIT); if (cd->vr_rx_chain[i].vr_buf == NULL) @@ -1095,7 +1100,7 @@ vr_rxeoc(sc) vr_rxeof(sc); - CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr)); + CSR_WRITE_4(sc, VR_RXADDR, sc->vr_cdata.vr_rx_head->vr_paddr); VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON); VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO); @@ -1147,7 +1152,7 @@ vr_txeof(sc) break; } VR_TXOWN(cur_tx) = VR_TXSTAT_OWN; - CSR_WRITE_4(sc, VR_TXADDR, vtophys(cur_tx->vr_ptr)); + CSR_WRITE_4(sc, VR_TXADDR, cur_tx->vr_paddr); break; } @@ -1370,7 +1375,7 @@ vr_encap(sc, c, m_head) c->vr_mbuf = m_head; c->vr_ptr->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT; - c->vr_ptr->vr_next = vtophys(c->vr_nextdesc->vr_ptr); + c->vr_ptr->vr_next = htole32(c->vr_nextdesc->vr_paddr); return(0); } @@ -1536,7 +1541,7 @@ vr_init(xsc) /* * Load the address of the RX list. */ - CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr)); + CSR_WRITE_4(sc, VR_RXADDR, sc->vr_cdata.vr_rx_head->vr_paddr); /* Enable receiver and transmitter. */ CSR_WRITE_2(sc, VR_COMMAND, VR_CMD_TX_NOPOLL|VR_CMD_START| diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h index 3b8be817caf..32681dc204d 100644 --- a/sys/dev/pci/if_vrreg.h +++ b/sys/dev/pci/if_vrreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vrreg.h,v 1.10 2003/10/12 02:35:53 jason Exp $ */ +/* $OpenBSD: if_vrreg.h,v 1.11 2003/10/12 02:53:59 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -407,6 +407,7 @@ struct vr_chain { struct vr_desc *vr_ptr; struct mbuf *vr_mbuf; struct vr_chain *vr_nextdesc; + bus_addr_t vr_paddr; bus_dmamap_t vr_map; }; @@ -414,6 +415,7 @@ struct vr_chain_onefrag { struct vr_desc *vr_ptr; struct vr_chain_onefrag *vr_nextdesc; u_int8_t *vr_buf; + bus_addr_t vr_paddr; bus_dmamap_t vr_map; }; |