PERFORCE change 121293 for review

Andrew Thompson thompsa at FreeBSD.org
Sat Jun 9 20:12:23 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=121293

Change 121293 by thompsa at thompsa_heff on 2007/06/09 20:11:40

	Move the scan abort code into its own taskqueue, it needs to be able to
	reset scan even if iwi_ops is blocked on a state.

Affected files ...

.. //depot/projects/wifi/sys/dev/iwi/if_iwi.c#47 edit
.. //depot/projects/wifi/sys/dev/iwi/if_iwivar.h#21 edit

Differences ...

==== //depot/projects/wifi/sys/dev/iwi/if_iwi.c#47 (text+ko) ====

@@ -165,6 +165,7 @@
 static int	iwi_scanchan(struct iwi_softc *, unsigned long, int);
 static void	iwi_scan_start(struct ieee80211com *);
 static void	iwi_scan_end(struct ieee80211com *);
+static void	iwi_scanabort(void *, int);
 static void	iwi_set_channel(struct ieee80211com *);
 static void	iwi_scan_curchan(struct ieee80211com *, unsigned long maxdwell);
 #if 0
@@ -280,6 +281,7 @@
 	TASK_INIT(&sc->sc_radiofftask, 0, iwi_radio_off, sc);
 	TASK_INIT(&sc->sc_restarttask, 0, iwi_restart, sc);
 	TASK_INIT(&sc->sc_opstask, 0, iwi_ops, sc);
+	TASK_INIT(&sc->sc_scanaborttask, 0, iwi_scanabort, sc);
 	callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0);
 
 	if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
@@ -2818,6 +2820,20 @@
 	return (iwi_cmd(sc, IWI_CMD_SCAN_EXT, &scan, sizeof scan));
 }
 
+static void
+iwi_scanabort(void *arg, int npending)
+{
+	struct iwi_softc *sc = arg;
+	IWI_LOCK_DECL;
+
+	IWI_LOCK(sc);
+	sc->flags &= ~IWI_FLAG_CHANNEL_SCAN;
+	/* NB: make sure we're still scanning */
+	if (sc->fw_state == IWI_FW_SCANNING)
+		iwi_cmd(sc, IWI_CMD_ABORT_SCAN, NULL, 0);
+	IWI_UNLOCK(sc);
+}
+
 static int
 iwi_set_sensitivity(struct iwi_softc *sc, int8_t rssi_dbm)
 {
@@ -3573,12 +3589,6 @@
 	case IWI_SCAN_START:
 		sc->flags |= IWI_FLAG_CHANNEL_SCAN;
 		break;
-	case IWI_SCAN_END:
-		sc->flags &= ~IWI_FLAG_CHANNEL_SCAN;
-		/* NB: make sure we're still scanning */
-		if (sc->fw_state == IWI_FW_SCANNING)
-			iwi_cmd(sc, IWI_CMD_ABORT_SCAN, NULL, 0);
-		break;
 	case IWI_SCAN_CURCHAN:
 	case IWI_SCAN_ALLCHAN:
 		if (!(sc->flags & IWI_FLAG_CHANNEL_SCAN)) {
@@ -3667,7 +3677,7 @@
 	struct ifnet *ifp = ic->ic_ifp;
 	struct iwi_softc *sc = ifp->if_softc;
 
-	iwi_queue_cmd(sc, IWI_SCAN_END);
+	taskqueue_enqueue(sc->sc_tq, &sc->sc_scanaborttask);
 }
 
 static void

==== //depot/projects/wifi/sys/dev/iwi/if_iwivar.h#21 (text+ko) ====

@@ -189,6 +189,7 @@
 
 	struct task		sc_radiontask;	/* radio on processing */
 	struct task		sc_radiofftask;	/* radio off processing */
+	struct task		sc_scanaborttask;	/* cancel active scan */
 	struct task		sc_restarttask;	/* restart adapter processing */
 	struct task		sc_opstask;	/* scan / auth processing */
 


More information about the p4-projects mailing list