summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2014-02-16 08:35:33 +0000
committerrpaulo <rpaulo@FreeBSD.org>2014-02-16 08:35:33 +0000
commit765f19d46b51a579fcfb71051eb296f0f1aae2c7 (patch)
treed634e14a8209f0d3f794ada6005513a28728bc9b /sys/dev
parentb16d23de194cf6bb2f1039f77f43fcdc99f8d975 (diff)
downloadFreeBSD-src-765f19d46b51a579fcfb71051eb296f0f1aae2c7.zip
FreeBSD-src-765f19d46b51a579fcfb71051eb296f0f1aae2c7.tar.gz
MFC r261863
Add urtwn_start_locked() to avoid unlocking during TX.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index b8c2406..20d223f 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -209,6 +209,8 @@ static int urtwn_tx_start(struct urtwn_softc *,
struct ieee80211_node *, struct mbuf *,
struct urtwn_data *);
static void urtwn_start(struct ifnet *);
+static void urtwn_start_locked(struct ifnet *,
+ struct urtwn_softc *);
static int urtwn_ioctl(struct ifnet *, u_long, caddr_t);
static int urtwn_power_on(struct urtwn_softc *);
static int urtwn_llt_init(struct urtwn_softc *);
@@ -866,13 +868,9 @@ tr_setup:
}
STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next);
STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next);
-
usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen);
usbd_transfer_submit(xfer);
-
- URTWN_UNLOCK(sc);
- urtwn_start(ifp);
- URTWN_LOCK(sc);
+ urtwn_start_locked(ifp, sc);
break;
default:
data = STAILQ_FIRST(&sc->sc_tx_active);
@@ -1715,14 +1713,22 @@ static void
urtwn_start(struct ifnet *ifp)
{
struct urtwn_softc *sc = ifp->if_softc;
- struct ieee80211_node *ni;
- struct mbuf *m;
- struct urtwn_data *bf;
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
-
URTWN_LOCK(sc);
+ urtwn_start_locked(ifp, sc);
+ URTWN_UNLOCK(sc);
+}
+
+static void
+urtwn_start_locked(struct ifnet *ifp, struct urtwn_softc *sc)
+{
+ struct ieee80211_node *ni;
+ struct mbuf *m;
+ struct urtwn_data *bf;
+
+ URTWN_ASSERT_LOCKED(sc);
for (;;) {
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
if (m == NULL)
@@ -1745,7 +1751,6 @@ urtwn_start(struct ifnet *ifp)
sc->sc_txtimer = 5;
callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc);
}
- URTWN_UNLOCK(sc);
}
static int
OpenPOWER on IntegriCloud