Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/wlan/if_ural.c
Show First 20 Lines • Show All 845 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static void | static void | ||||
ural_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) | ural_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) | ||||
{ | { | ||||
struct ural_softc *sc = usbd_xfer_softc(xfer); | struct ural_softc *sc = usbd_xfer_softc(xfer); | ||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211_node *ni; | struct ieee80211_node *ni; | ||||
struct epoch_tracker et; | |||||
struct mbuf *m = NULL; | struct mbuf *m = NULL; | ||||
struct usb_page_cache *pc; | struct usb_page_cache *pc; | ||||
uint32_t flags; | uint32_t flags; | ||||
int8_t rssi = 0, nf = 0; | int8_t rssi = 0, nf = 0; | ||||
int len; | int len; | ||||
usbd_xfer_status(xfer, &len, NULL, NULL, NULL); | usbd_xfer_status(xfer, &len, NULL, NULL, NULL); | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | tr_setup: | ||||
* At the end of a USB callback it is always safe to unlock | * At the end of a USB callback it is always safe to unlock | ||||
* the private mutex of a device! That is why we do the | * the private mutex of a device! That is why we do the | ||||
* "ieee80211_input" here, and not some lines up! | * "ieee80211_input" here, and not some lines up! | ||||
*/ | */ | ||||
RAL_UNLOCK(sc); | RAL_UNLOCK(sc); | ||||
if (m) { | if (m) { | ||||
ni = ieee80211_find_rxnode(ic, | ni = ieee80211_find_rxnode(ic, | ||||
mtod(m, struct ieee80211_frame_min *)); | mtod(m, struct ieee80211_frame_min *)); | ||||
NET_EPOCH_ENTER(et); | |||||
if (ni != NULL) { | if (ni != NULL) { | ||||
(void) ieee80211_input(ni, m, rssi, nf); | (void) ieee80211_input(ni, m, rssi, nf); | ||||
ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
} else | } else | ||||
(void) ieee80211_input_all(ic, m, rssi, nf); | (void) ieee80211_input_all(ic, m, rssi, nf); | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
RAL_LOCK(sc); | RAL_LOCK(sc); | ||||
ural_start(sc); | ural_start(sc); | ||||
return; | return; | ||||
default: /* Error */ | default: /* Error */ | ||||
if (error != USB_ERR_CANCELLED) { | if (error != USB_ERR_CANCELLED) { | ||||
/* try to clear stall first */ | /* try to clear stall first */ | ||||
▲ Show 20 Lines • Show All 1,276 Lines • Show Last 20 Lines |