Widen EPOCH(9) usage in USB WLAN drivers.

This patch should unbreak the USB WLAN drivers after r357004.

Pointy hat:	glebius@
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2020-01-30 09:41:48 +00:00
parent 3cfabd81a1
commit 21c4082de9
7 changed files with 21 additions and 0 deletions

View File

@ -1168,6 +1168,7 @@ rum_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_frame_min *wh;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct mbuf *m = NULL;
struct usb_page_cache *pc;
uint32_t flags;
@ -1286,6 +1287,7 @@ tr_setup:
else
ni = NULL;
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi,
RT2573_NOISE_FLOOR);
@ -1293,6 +1295,7 @@ tr_setup:
} else
(void) ieee80211_input_all(ic, m, rssi,
RT2573_NOISE_FLOOR);
NET_EPOCH_EXIT(et);
}
RUM_LOCK(sc);
rum_start(sc);

View File

@ -2811,6 +2811,7 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uint32_t dmalen)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct rt2870_rxd *rxd;
struct rt2860_rxwi *rxwi;
uint32_t flags;
@ -2929,12 +2930,14 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uint32_t dmalen)
}
}
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void)ieee80211_input(ni, m, rssi, nf);
ieee80211_free_node(ni);
} else {
(void)ieee80211_input_all(ic, m, rssi, nf);
}
NET_EPOCH_EXIT(et);
return;

View File

@ -2705,6 +2705,7 @@ uath_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct mbuf *m = NULL;
struct uath_data *data;
struct uath_rx_desc *desc = NULL;
@ -2751,6 +2752,7 @@ setup:
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
nf = -95; /* XXX */
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m,
(int)be32toh(desc->rssi), nf);
@ -2759,6 +2761,7 @@ setup:
} else
(void) ieee80211_input_all(ic, m,
(int)be32toh(desc->rssi), nf);
NET_EPOCH_EXIT(et);
m = NULL;
desc = NULL;
}

View File

@ -2211,6 +2211,7 @@ upgt_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct mbuf *m = NULL;
struct upgt_data *data;
int8_t nf;
@ -2248,12 +2249,14 @@ setup:
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
nf = -95; /* XXX */
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, nf);
/* node is no longer needed */
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
m = NULL;
}
UPGT_LOCK(sc);

View File

@ -851,6 +851,7 @@ ural_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
struct ural_softc *sc = usbd_xfer_softc(xfer);
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct mbuf *m = NULL;
struct usb_page_cache *pc;
uint32_t flags;
@ -931,11 +932,13 @@ tr_setup:
if (m) {
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, nf);
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
}
RAL_LOCK(sc);
ural_start(sc);

View File

@ -4042,6 +4042,7 @@ urtw_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error)
struct urtw_softc *sc = usbd_xfer_softc(xfer);
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct mbuf *m = NULL;
struct urtw_data *data;
int8_t nf = -95;
@ -4085,12 +4086,14 @@ setup:
} else
ni = NULL;
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, nf);
/* node is no longer needed */
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
m = NULL;
}
URTW_LOCK(sc);

View File

@ -2223,6 +2223,7 @@ zyd_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
struct zyd_softc *sc = usbd_xfer_softc(xfer);
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_node *ni;
struct epoch_tracker et;
struct zyd_rx_desc desc;
struct mbuf *m;
struct usb_page_cache *pc;
@ -2278,6 +2279,7 @@ tr_setup:
* "ieee80211_input" here, and not some lines up!
*/
ZYD_UNLOCK(sc);
NET_EPOCH_ENTER(et);
for (i = 0; i < sc->sc_rx_count; i++) {
rssi = sc->sc_rx_data[i].rssi;
m = sc->sc_rx_data[i].m;
@ -2293,6 +2295,7 @@ tr_setup:
} else
(void)ieee80211_input_all(ic, m, rssi, nf);
}
NET_EPOCH_EXIT(et);
ZYD_LOCK(sc);
zyd_start(sc);
break;