summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rlreg.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-06-19 20:17:38 +0000
committerwpaul <wpaul@FreeBSD.org>1999-06-19 20:17:38 +0000
commitbf694850c4689290cec3f73afa21c3d54a733785 (patch)
treeb5b94aab1c3a43010b6e31b634fbeef81ab6fae0 /sys/pci/if_rlreg.h
parentff773191969ea0eb35218ab5f90ca57d05cff015 (diff)
downloadFreeBSD-src-bf694850c4689290cec3f73afa21c3d54a733785.zip
FreeBSD-src-bf694850c4689290cec3f73afa21c3d54a733785.tar.gz
Fix up the RealTek 8139 driver to work on FreeBSD/alpha. This involves a
few changes: - there was a bug in rl_list_tx_init(): it was calculating the registers to initialize incorrectly. Not a problem on the x86 where unaligned access are allowed, but a problem on the alpha. - set rl_btag accordingly depending on the machine type - rl_rxeof() needs to be sure to longword-align the packet data. This is a little tricky since we copy the data out of the receive buffer using m_devget(), however there's no way to tell m_devget() to fill in the mbufs starting at a particular offset. To get around this, we tell m_devget to copy bytes+2 bytes starting at offset offset-2. This results in the proper alignment, and we can trim off the two leading bytes afterwards with m_adj(). We also allocate some extra space before the start of the receive buffer so that we don't get into trouble in the case where offset == 0. - redefine vtophys() in if_rlreg.h for the alpha. Making this chipset work on the alpha is sort of the inverse of putting a jet engine on a rowboat (putting a propeller on a 747?) but when you can get these things for $5 a pop, it's hard to stop people from buying them.
Diffstat (limited to 'sys/pci/if_rlreg.h')
-rw-r--r--sys/pci/if_rlreg.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
index ab0f302..53891cf 100644
--- a/sys/pci/if_rlreg.h
+++ b/sys/pci/if_rlreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_rlreg.h,v 1.18 1999/05/30 18:48:01 wpaul Exp $
+ * $Id: if_rlreg.h,v 1.19 1999/06/19 20:01:32 wpaul Exp wpaul $
*/
/*
@@ -307,9 +307,12 @@
#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ)
#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA)
+#define RL_ETHER_ALIGN 2
+
struct rl_chain_data {
u_int16_t cur_rx;
caddr_t rl_rx_buf;
+ caddr_t rl_rx_buf_ptr;
struct mbuf *rl_tx_chain[RL_TX_LIST_CNT];
u_int8_t last_tx;
@@ -608,3 +611,8 @@ struct rl_softc {
#define PHY_BMSR_LINKSTAT 0x0004
#define PHY_BMSR_JABBER 0x0002
#define PHY_BMSR_EXTENDED 0x0001
+#ifdef __alpha__
+#undef vtophys
+#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)va)
+#endif
+
OpenPOWER on IntegriCloud