Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2009 16:26:18 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200037 - head/sys/dev/if_ndis
Message-ID:  <200912021626.nB2GQIKZ030295@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Dec  2 16:26:18 2009
New Revision: 200037
URL: http://svn.freebsd.org/changeset/base/200037

Log:
  ndis_scan_results() can sleep if the scan results are not ready when
  ndis_scan() is called.  However, ndis_scan() is invoked from softclock()
  and cannot sleep.  Move ndis_scan_results() to the ndis' driver's scan_end
  hook instead.
  
  Submitted by:	Paul B Mahol  onemda of gmail
  MFC after:	1 week

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Wed Dec  2 16:08:33 2009	(r200036)
+++ head/sys/dev/if_ndis/if_ndis.c	Wed Dec  2 16:26:18 2009	(r200037)
@@ -3222,14 +3222,8 @@ ndis_newstate(struct ieee80211vap *vap, 
 static void
 ndis_scan(void *arg)
 {
-	struct ndis_softc *sc = arg;
-	struct ieee80211com *ic;
-	struct ieee80211vap *vap;
-
-	ic = sc->ifp->if_l2com;
-	vap = TAILQ_FIRST(&ic->ic_vaps);
+	struct ieee80211vap *vap = arg;
 
-	ndis_scan_results(sc);
 	ieee80211_scan_done(vap);
 }
 
@@ -3377,7 +3371,7 @@ ndis_scan_start(struct ieee80211com *ic)
 		return;
 	}
 	/* Set a timer to collect the results */
-	callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, sc);
+	callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, vap);
 }
 
 static void
@@ -3401,5 +3395,7 @@ ndis_scan_mindwell(struct ieee80211_scan
 static void
 ndis_scan_end(struct ieee80211com *ic)
 {
-	/* ignore */
+	struct ndis_softc *sc = ic->ic_ifp->if_softc;
+
+	ndis_scan_results(sc);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912021626.nB2GQIKZ030295>