mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
Make ASIX driver work on FreeBSD/alpha, add to GENERIC.
This commit is contained in:
parent
e31c685452
commit
4473c5ec86
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45484
@ -11,7 +11,7 @@
|
||||
# device lines is present in the ./LINT configuration file. If you are
|
||||
# in doubt as to the purpose or necessity of a line, check first in LINT.
|
||||
#
|
||||
# $Id: GENERIC,v 1.17 1999/03/31 04:04:14 wpaul Exp $
|
||||
# $Id: GENERIC,v 1.18 1999/04/01 02:09:37 wpaul Exp $
|
||||
|
||||
machine "alpha"
|
||||
cpu "EV4"
|
||||
@ -97,6 +97,7 @@ device sio1 at isa0 port "IO_COM2" irq 3 flags 0x50
|
||||
# this list of network interfaces until the probes have been fixed.
|
||||
# Right now it appears that the ie0 must be probed before ep0. See
|
||||
# revision 1.20 of this file.
|
||||
device ax0
|
||||
device de0
|
||||
device fxp0
|
||||
device le0
|
||||
|
@ -11,7 +11,7 @@
|
||||
# device lines is present in the ./LINT configuration file. If you are
|
||||
# in doubt as to the purpose or necessity of a line, check first in LINT.
|
||||
#
|
||||
# $Id: GENERIC,v 1.17 1999/03/31 04:04:14 wpaul Exp $
|
||||
# $Id: GENERIC,v 1.18 1999/04/01 02:09:37 wpaul Exp $
|
||||
|
||||
machine "alpha"
|
||||
cpu "EV4"
|
||||
@ -97,6 +97,7 @@ device sio1 at isa0 port "IO_COM2" irq 3 flags 0x50
|
||||
# this list of network interfaces until the probes have been fixed.
|
||||
# Right now it appears that the ie0 must be probed before ep0. See
|
||||
# revision 1.20 of this file.
|
||||
device ax0
|
||||
device de0
|
||||
device fxp0
|
||||
device le0
|
||||
|
@ -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_ax.c,v 1.9 1999/02/23 01:44:20 wpaul Exp $
|
||||
* $Id: if_ax.c,v 1.10 1999/04/08 03:57:57 wpaul Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -87,7 +87,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id: if_ax.c,v 1.9 1999/02/23 01:44:20 wpaul Exp $";
|
||||
"$Id: if_ax.c,v 1.10 1999/04/08 03:57:57 wpaul Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1150,7 +1150,12 @@ ax_attach(config_id, unit)
|
||||
printf ("ax%d: couldn't map ports\n", unit);
|
||||
goto fail;
|
||||
}
|
||||
#ifdef __i386__
|
||||
sc->ax_btag = I386_BUS_SPACE_IO;
|
||||
#endif
|
||||
#ifdef __alpha__
|
||||
sc->ax_btag = ALPHA_BUS_SPACE_IO;
|
||||
#endif
|
||||
#else
|
||||
if (!(command & PCIM_CMD_MEMEN)) {
|
||||
printf("ax%d: failed to enable memory mapping!\n", unit);
|
||||
@ -1161,7 +1166,12 @@ ax_attach(config_id, unit)
|
||||
printf ("ax%d: couldn't map memory\n", unit);
|
||||
goto fail;
|
||||
}
|
||||
#ifdef __i386__
|
||||
sc->ax_btag = I386_BUS_SPACE_MEM;
|
||||
#endif
|
||||
#ifdef __alpha__
|
||||
sc->ax_btag = ALPHA_BUS_SPACE_MEM;
|
||||
#endif
|
||||
sc->ax_bhandle = vbase;
|
||||
#endif
|
||||
|
||||
@ -1429,6 +1439,9 @@ static void ax_rxeof(sc)
|
||||
|
||||
while(!((rxstat = sc->ax_cdata.ax_rx_head->ax_ptr->ax_status) &
|
||||
AX_RXSTAT_OWN)) {
|
||||
#ifdef __alpha__
|
||||
struct mbuf *m0 = NULL;
|
||||
#endif
|
||||
cur_rx = sc->ax_cdata.ax_rx_head;
|
||||
sc->ax_cdata.ax_rx_head = cur_rx->ax_nextdesc;
|
||||
|
||||
@ -1453,6 +1466,51 @@ static void ax_rxeof(sc)
|
||||
|
||||
total_len -= ETHER_CRC_LEN;
|
||||
|
||||
#ifdef __alpha__
|
||||
/*
|
||||
* Try to conjure up a new mbuf cluster. If that
|
||||
* fails, it means we have an out of memory condition and
|
||||
* should leave the buffer in place and continue. This will
|
||||
* result in a lost packet, but there's little else we
|
||||
* can do in this situation.
|
||||
*/
|
||||
if (ax_newbuf(sc, cur_rx) == ENOBUFS) {
|
||||
ifp->if_ierrors++;
|
||||
cur_rx->ax_ptr->ax_status = AX_RXSTAT;
|
||||
cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sadly, the ASIX chip doesn't decode the last few
|
||||
* bits of the RX DMA buffer address, so we have to
|
||||
* cheat in order to obtain proper payload alignment
|
||||
* on the alpha.
|
||||
*/
|
||||
MGETHDR(m0, M_DONTWAIT, MT_DATA);
|
||||
if (m0 == NULL) {
|
||||
ifp->if_ierrors++;
|
||||
cur_rx->ax_ptr->ax_status = AX_RXSTAT;
|
||||
cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
m0->m_data += 2;
|
||||
if (total_len <= (MHLEN - 2)) {
|
||||
bcopy(mtod(m, caddr_t), mtod(m0, caddr_t), total_len); m_freem(m);
|
||||
m = m0;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
} else {
|
||||
bcopy(mtod(m, caddr_t), mtod(m0, caddr_t), (MHLEN - 2));
|
||||
m->m_len = total_len - (MHLEN - 2);
|
||||
m->m_data += (MHLEN - 2);
|
||||
m0->m_next = m;
|
||||
m0->m_len = (MHLEN - 2);
|
||||
m = m0;
|
||||
m->m_pkthdr.len = total_len;
|
||||
}
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
#else
|
||||
if (total_len < MINCLSIZE) {
|
||||
m = m_devget(mtod(cur_rx->ax_mbuf, char *),
|
||||
total_len, 0, ifp, NULL);
|
||||
@ -1480,6 +1538,7 @@ static void ax_rxeof(sc)
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
}
|
||||
#endif
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
@ -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_axreg.h,v 1.3 1999/02/23 01:52:42 wpaul Exp $
|
||||
* $Id: if_axreg.h,v 1.6 1999/04/08 03:57:57 wpaul Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -564,3 +564,9 @@ struct ax_softc {
|
||||
#define PHY_BMSR_LINKSTAT 0x0004
|
||||
#define PHY_BMSR_JABBER 0x0002
|
||||
#define PHY_BMSR_EXTENDED 0x0001
|
||||
|
||||
#ifdef __alpha__
|
||||
#undef vtophys
|
||||
#define vtophys(va) (pmap_kextract(((vm_offset_t) (va))) \
|
||||
+ 1*1024*1024*1024)
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user