diff options
author | pdeuskar <pdeuskar@FreeBSD.org> | 2003-05-03 07:35:47 +0000 |
---|---|---|
committer | pdeuskar <pdeuskar@FreeBSD.org> | 2003-05-03 07:35:47 +0000 |
commit | 53c33bd230087a300fe957b1f37af59d3aa11b94 (patch) | |
tree | 522ee0666cca49262b5933ebcfebc222da70cf2a /sys/dev/em/if_em.c | |
parent | 3644496d4a96572e57603747cc4d0f92a8d3556a (diff) | |
download | FreeBSD-src-53c33bd230087a300fe957b1f37af59d3aa11b94.zip FreeBSD-src-53c33bd230087a300fe957b1f37af59d3aa11b94.tar.gz |
- Fix breakage on PAE enabled kernel
- Don't use vtophys when you can get physical address using bus_dma API
Submitted by: jake (Jake Burkholder)
Diffstat (limited to 'sys/dev/em/if_em.c')
-rw-r--r-- | sys/dev/em/if_em.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 22e3d2e..70f67129 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -1895,11 +1895,12 @@ em_initialize_transmit_unit(struct adapter * adapter) { u_int32_t reg_tctl; u_int32_t reg_tipg = 0; + u_int64_t bus_addr; /* Setup the Base and Length of the Tx Descriptor Ring */ - E1000_WRITE_REG(&adapter->hw, TDBAL, - vtophys((vm_offset_t) adapter->tx_desc_base)); - E1000_WRITE_REG(&adapter->hw, TDBAH, 0); + bus_addr = adapter->txdma.dma_paddr; + E1000_WRITE_REG(&adapter->hw, TDBAL, (u_int32_t)bus_addr); + E1000_WRITE_REG(&adapter->hw, TDBAH, (u_int32_t)(bus_addr >> 32)); E1000_WRITE_REG(&adapter->hw, TDLEN, adapter->num_tx_desc * sizeof(struct em_tx_desc)); @@ -2170,7 +2171,7 @@ em_get_buf(int i, struct adapter *adapter, register struct mbuf *mp = nmp; struct em_buffer *rx_buffer; struct ifnet *ifp; - u_int32_t paddr; + bus_addr_t paddr; int error; ifp = &adapter->interface_data.ac_if; @@ -2317,6 +2318,7 @@ em_initialize_receive_unit(struct adapter * adapter) u_int32_t reg_rctl; u_int32_t reg_rxcsum; struct ifnet *ifp; + u_int64_t bus_addr; ifp = &adapter->interface_data.ac_if; @@ -2338,9 +2340,9 @@ em_initialize_receive_unit(struct adapter * adapter) } /* Setup the Base and Length of the Rx Descriptor Ring */ - E1000_WRITE_REG(&adapter->hw, RDBAL, - vtophys((vm_offset_t) adapter->rx_desc_base)); - E1000_WRITE_REG(&adapter->hw, RDBAH, 0); + bus_addr = adapter->rxdma.dma_paddr; + E1000_WRITE_REG(&adapter->hw, RDBAL, (u_int32_t)bus_addr); + E1000_WRITE_REG(&adapter->hw, RDBAH, (u_int32_t)(bus_addr >> 32)); E1000_WRITE_REG(&adapter->hw, RDLEN, adapter->num_rx_desc * sizeof(struct em_rx_desc)); |