svn commit: r191504 - user/thompsa/vaptq/sys/net80211

Andrew Thompson thompsa at FreeBSD.org
Sat Apr 25 23:40:21 UTC 2009


Author: thompsa
Date: Sat Apr 25 23:40:20 2009
New Revision: 191504
URL: http://svn.freebsd.org/changeset/base/191504

Log:
  The vap pointer is cleared in ieee80211_scan_vdetach() so keep a pointer to the
  ic too.

Modified:
  user/thompsa/vaptq/sys/net80211/ieee80211_scan.c
  user/thompsa/vaptq/sys/net80211/ieee80211_scan.h

Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c	Sat Apr 25 23:09:39 2009	(r191503)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c	Sat Apr 25 23:40:20 2009	(r191504)
@@ -115,6 +115,7 @@ ieee80211_scan_attach(struct ieee80211co
 	cv_init(&ss->ss_scan_cv, "scan");
 	TASK_INIT(&ss->ss_scan_task, 0, scan_task, ss);
 	ic->ic_scan = &ss->base;
+	ss->base.ss_ic = ic;
 
 	ic->ic_scan_curchan = scan_curchan;
 	ic->ic_scan_mindwell = scan_mindwell;
@@ -327,7 +328,7 @@ channel_type(const struct ieee80211_chan
 void
 ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss)
 {
-	struct ieee80211com *ic = ss->ss_vap->iv_ic;
+	struct ieee80211com *ic = ss->ss_ic;
 	const char *sep;
 	int i;
 
@@ -815,6 +816,8 @@ scan_signal(void *arg)
 {
 	struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg;
 
+	IEEE80211_LOCK_ASSERT(ss->ss_ic);
+
 	cv_signal(&SCAN_PRIVATE(ss)->ss_scan_cv);
 }
 
@@ -825,8 +828,7 @@ scan_signal(void *arg)
 static void
 scan_mindwell(struct ieee80211_scan_state *ss)
 {
-	struct ieee80211vap *vap = ss->ss_vap;
-	struct ieee80211com *ic = vap->iv_ic;
+	struct ieee80211com *ic = ss->ss_ic;
 
 	IEEE80211_LOCK(ic);
 	scan_signal(ss);
@@ -839,13 +841,13 @@ scan_task(void *arg, int pending)
 #define	ISCAN_REP	(ISCAN_MINDWELL | ISCAN_DISCARD)
 	struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg;
 	struct ieee80211vap *vap = ss->ss_vap;
-	struct ieee80211com *ic = vap->iv_ic;
+	struct ieee80211com *ic = ss->ss_ic;
 	struct ieee80211_channel *chan;
 	unsigned long maxdwell, scanend;
 	int scandone = 0;
 
 	IEEE80211_LOCK(ic);
-	if ((ic->ic_flags & IEEE80211_F_SCAN) == 0 ||
+	if (vap == NULL || (ic->ic_flags & IEEE80211_F_SCAN) == 0 ||
 	    (SCAN_PRIVATE(ss)->ss_iflags & ISCAN_ABORT)) {
 		/* Cancelled before we started */
 		goto done;

Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.h
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_scan.h	Sat Apr 25 23:09:39 2009	(r191503)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.h	Sat Apr 25 23:40:20 2009	(r191504)
@@ -90,6 +90,7 @@ struct ieee80211_scan_ssid {
  */
 struct ieee80211_scan_state {
 	struct ieee80211vap *ss_vap;
+	struct ieee80211com *ss_ic;
 	const struct ieee80211_scanner *ss_ops;	/* policy hookup, see below */
 	void		*ss_priv;		/* scanner private state */
 	uint16_t	ss_flags;


More information about the svn-src-user mailing list