diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 1998-09-09 21:35:47 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 1998-09-09 21:35:47 +0000 |
commit | 17ab7108e05317df36573c44dfd45b69231bd624 (patch) | |
tree | bc52438560d97a68d5373daba31a0e95da18e119 /sys | |
parent | 8951634811c2043ce651a8aaf40751fbf62de6fd (diff) |
Now working on alpha too... -moj
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_xl.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/dev/pci/if_xl.c b/sys/dev/pci/if_xl.c index 73fea4ee386..70b5a8ee9d3 100644 --- a/sys/dev/pci/if_xl.c +++ b/sys/dev/pci/if_xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xl.c,v 1.6 1998/09/08 03:02:57 jason Exp $ */ +/* $OpenBSD: if_xl.c,v 1.7 1998/09/09 21:35:46 maja Exp $ */ /* * Copyright (c) 1997, 1998 @@ -147,6 +147,12 @@ #include <pci/pcivar.h> #endif +#ifdef __OpenBSD__ +#ifdef __alpha__ +#undef vtophys +#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va)) +#endif +#endif /* * The following #define causes the code to use PIO to access the @@ -1769,6 +1775,9 @@ static int xl_newbuf(sc, c) struct xl_chain_onefrag *c; { struct mbuf *m_new = NULL; +#if defined(__alpha__) && defined(__OpenBSD__) + int pad; +#endif MGETHDR(m_new, M_DONTWAIT, MT_DATA); if (m_new == NULL) { @@ -1777,6 +1786,12 @@ static int xl_newbuf(sc, c) return(ENOBUFS); } +#if defined(__alpha__) && defined(__OpenBSD__) + pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header); + m_new->m_data += pad; + m_new->m_len -= pad; +#endif + MCLGET(m_new, M_DONTWAIT); if (!(m_new->m_flags & M_EXT)) { printf("xl%d: no memory for rx list -- packet dropped!\n", @@ -1785,6 +1800,12 @@ static int xl_newbuf(sc, c) return(ENOBUFS); } +#if defined(__alpha__) && defined(__OpenBSD__) + pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header); + m_new->m_data += pad; + m_new->m_len -= pad; +#endif + c->xl_mbuf = m_new; c->xl_ptr->xl_status = 0; c->xl_ptr->xl_frag.xl_addr = vtophys(mtod(m_new, caddr_t)); @@ -2977,7 +2998,11 @@ xl_attach(parent, self, aux) } sc->xl_ldata = (struct xl_list_data *)sc->xl_ldata_ptr; +#ifdef __alpha__ + round = (u_int64_t)sc->xl_ldata_ptr & 0xf; +#else round = (u_int32_t)sc->xl_ldata_ptr & 0xf; +#endif roundptr = sc->xl_ldata_ptr; for (i = 0; i < 8; i++) { if (round % 8) { |