From e2fcd79a9ecdfbc9e1b4b909838d24c595a27410 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Fri, 12 Mar 2010 10:15:58 +0100 Subject: [PATCH] Reset command ring during device attaching because in HOSTAP mode key setting/deleting happens while device is not running --- rt2870.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rt2870.c b/rt2870.c index 0301590..44c9e1c 100644 --- a/rt2870.c +++ b/rt2870.c @@ -753,6 +753,8 @@ static int rt2870_attach(device_t dev) taskqueue_start_threads(&sc->taskqueue, 1, PI_NET, "%s taskq", device_get_nameunit(sc->dev)); + rt2870_reset_cmd_ring(sc, &sc->cmd_ring); + rt2870_sysctl_attach(sc); if (bootverbose) @@ -1386,8 +1388,6 @@ static void rt2870_init_locked(void *priv) rt2870_reset_rx_ring(sc, &sc->rx_ring); - rt2870_reset_cmd_ring(sc, &sc->cmd_ring); - for(i = 0; i < sc->usb_endpoints - 1; i++) { usbd_xfer_set_priv(sc->usb_xfer[i + 1], &sc->tx_ring[i]); @@ -2694,12 +2694,6 @@ static int rt2870_do_async(struct rt2870_softc *sc, RT2870_SOFTC_LOCK(sc); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - { - RT2870_SOFTC_UNLOCK(sc); - return -1; - } - if (ring->queued >= RT2870_SOFTC_CMD_RING_CMD_COUNT) { RT2870_SOFTC_UNLOCK(sc); -- 2.11.4.GIT