freebsd compat. layer: now both receiving and sending work with PCNET.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21048 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Hugo Santos
2007-05-07 05:28:38 +00:00
parent e2941f52fd
commit 80df11254f
5 changed files with 16 additions and 3 deletions
@@ -447,17 +447,25 @@ am79900_intr(void *arg)
return;
}
#if 0
isr = (*sc->sc_rdcsr)(sc, LE_CSR0);
#endif
{
cpu_status status;
HAIKU_INTR_REGISTER_ENTER(status);
isr = sc->sc_lastisr;
sc->sc_lastisr = 0;
HAIKU_INTR_REGISTER_LEAVE(status);
}
#if defined(LEDEBUG) && LEDEBUG > 1
if (sc->sc_flags & LE_DEBUG)
if_printf(ifp, "%s: entering with isr=%04x\n", __func__, isr);
#endif
#if 0
if ((isr & LE_C0_INTR) == 0) {
LE_UNLOCK(sc);
return;
}
#endif
/*
* Clear interrupt source flags and turn off interrupts. If we
@@ -50,6 +50,7 @@ int HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev) {
BUS_SPACE_BARRIER_WRITE);
bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP,
value & ~LE_C0_INEA);
lesc->sc_am79900.lsc.sc_lastisr |= value;
}
HAIKU_INTR_REGISTER_LEAVE(status);
@@ -119,6 +119,8 @@ struct lance_softc {
#define LE_CARRIER (1 << 2)
#define LE_DEBUG (1 << 3)
#define LE_PROMISC (1 << 4)
uint16_t sc_lastisr;
};
#define LE_LOCK_INIT(_sc, _name) \
+2
View File
@@ -198,11 +198,13 @@ compat_read(void *cookie, off_t position, void *buf, size_t *numBytes)
len = min_c(max_c((size_t)mb->m_len, 0), *numBytes);
#if 0
mb = m_defrag(mb, 0);
if (mb == NULL) {
*numBytes = 0;
return B_NO_MEMORY;
}
#endif
memcpy(buf, mtod(mb, const void *), len);
*numBytes = len;
+1 -1
View File
@@ -161,7 +161,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
static void
ether_input(struct ifnet *ifp, struct mbuf *m)
{
device_t dev = NULL; /* XXX */
device_t dev = ifp->if_dev;
IF_ENQUEUE(&dev->receive_queue, m);
release_sem_etc(dev->receive_sem, 1, B_DO_NOT_RESCHEDULE);