Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/rtwn/pci/rtwn_pci_rx.c
Show All 29 Lines | |||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/taskqueue.h> | #include <sys/taskqueue.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/epoch.h> | |||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/ethernet.h> | #include <net/ethernet.h> | ||||
#include <net/if_media.h> | #include <net/if_media.h> | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
rtwn_pci_rx_done(struct rtwn_softc *sc) | rtwn_pci_rx_done(struct rtwn_softc *sc) | ||||
{ | { | ||||
struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); | struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); | ||||
struct rtwn_rx_ring *ring = &pc->rx_ring; | struct rtwn_rx_ring *ring = &pc->rx_ring; | ||||
struct rtwn_rx_stat_pci *rx_desc; | struct rtwn_rx_stat_pci *rx_desc; | ||||
struct rtwn_rx_data *rx_data; | struct rtwn_rx_data *rx_data; | ||||
struct epoch_tracker et; | |||||
int len; | int len; | ||||
NET_EPOCH_ENTER(et); | |||||
bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); | bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); | ||||
for (;;) { | for (;;) { | ||||
rx_desc = &ring->desc[ring->cur]; | rx_desc = &ring->desc[ring->cur]; | ||||
rx_data = &ring->rx_data[ring->cur]; | rx_data = &ring->rx_data[ring->cur]; | ||||
if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) | if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) | ||||
break; | break; | ||||
Show All 25 Lines | for (;;) { | ||||
/* NB: device can reuse current descriptor. */ | /* NB: device can reuse current descriptor. */ | ||||
bus_dmamap_sync(ring->desc_dmat, ring->desc_map, | bus_dmamap_sync(ring->desc_dmat, ring->desc_map, | ||||
BUS_DMASYNC_POSTREAD); | BUS_DMASYNC_POSTREAD); | ||||
if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) | if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) | ||||
ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; | ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; | ||||
} | } | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
void | void | ||||
rtwn_pci_intr(void *arg) | rtwn_pci_intr(void *arg) | ||||
{ | { | ||||
struct rtwn_softc *sc = arg; | struct rtwn_softc *sc = arg; | ||||
struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); | struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); | ||||
int i, status, tx_rings; | int i, status, tx_rings; | ||||
Show All 24 Lines |