Author: sbruno
Date: Mon Jul 25 23:44:44 2016
New Revision: 303326
URL: https://svnweb.freebsd.org/changeset/base/303326

Log:
  iwm(4): switch to ieee80211_runtask()
  
  Submitted by: Andiry Voskoboinyk (s3er...@gmail.com)
  MFC after:    2 weeks
  Differential Revision:        https://reviews.freebsd.org/D5054

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c   Mon Jul 25 23:38:14 2016        (r303325)
+++ head/sys/dev/iwm/if_iwm.c   Mon Jul 25 23:44:44 2016        (r303326)
@@ -4092,6 +4092,7 @@ do {                                                      
                \
 static void
 iwm_notif_intr(struct iwm_softc *sc)
 {
+       struct ieee80211com *ic = &sc->sc_ic;
        uint16_t hw;
 
        bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map,
@@ -4145,7 +4146,6 @@ iwm_notif_intr(struct iwm_softc *sc)
                        int missed;
 
                        /* XXX look at mac_id to determine interface ID */
-                       struct ieee80211com *ic = &sc->sc_ic;
                        struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
 
                        SYNC_RESP_STRUCT(resp, pkt);
@@ -4253,7 +4253,7 @@ iwm_notif_intr(struct iwm_softc *sc)
                case IWM_SCAN_COMPLETE_NOTIFICATION: {
                        struct iwm_scan_complete_notif *notif;
                        SYNC_RESP_STRUCT(notif, pkt);
-                       taskqueue_enqueue(sc->sc_tq, &sc->sc_es_task);
+                       ieee80211_runtask(ic, &sc->sc_es_task);
                        break; }
 
                case IWM_REPLY_ERROR: {
@@ -4627,14 +4627,6 @@ iwm_attach(device_t dev)
        callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0);
        callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0);
        TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc);
-       sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK,
-            taskqueue_thread_enqueue, &sc->sc_tq);
-        error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwm_taskq");
-        if (error != 0) {
-                device_printf(dev, "can't start threads, error %d\n",
-                   error);
-               goto fail;
-        }
 
        /* PCI attach */
        error = iwm_pci_attach(dev);
@@ -5015,10 +5007,8 @@ iwm_detach_local(struct iwm_softc *sc, i
        device_t dev = sc->sc_dev;
        int i;
 
-       if (sc->sc_tq) {
-               taskqueue_drain_all(sc->sc_tq);
-               taskqueue_free(sc->sc_tq);
-       }
+       ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task);
+
        callout_drain(&sc->sc_led_blink_to);
        callout_drain(&sc->sc_watchdog_to);
        iwm_stop_device(sc);

Modified: head/sys/dev/iwm/if_iwmvar.h
==============================================================================
--- head/sys/dev/iwm/if_iwmvar.h        Mon Jul 25 23:38:14 2016        
(r303325)
+++ head/sys/dev/iwm/if_iwmvar.h        Mon Jul 25 23:44:44 2016        
(r303326)
@@ -495,7 +495,6 @@ struct iwm_softc {
        uint8_t                 sc_cmd_resp[IWM_CMD_RESP_MAX];
        int                     sc_wantresp;
 
-       struct taskqueue        *sc_tq;
        struct task             sc_es_task;
 
        struct iwm_rx_phy_info  sc_last_phy_info;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to