Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2005 20:48:24 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 68762 for review
Message-ID:  <200501112048.j0BKmOdW008130@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=68762

Change 68762 by sam@sam_ebb on 2005/01/11 20:48:00

	handle scan interruption; explicitly cancel a scan when
	transitioning from RUN->INIT as can (easily) happen when
	an interface is marked up then altered again (e.g by setting
	the channel or altering the operating mode)

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_node.c#38 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_node.h#19 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#21 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#38 (text+ko) ====

@@ -570,6 +570,19 @@
 }
 
 /*
+ * Mark an ongoing scan stopped.
+ */
+void
+ieee80211_cancel_scan(struct ieee80211com *ic)
+{
+
+	IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "end %s scan\n",
+		(ic->ic_flags & IEEE80211_F_ASCAN) ?  "active" : "passive");
+
+	ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN);
+}
+
+/*
  * Complete a scan of potential channels.
  */
 void
@@ -578,10 +591,8 @@
 	struct ieee80211_node *ni, *nextbs, *selbs;
 	struct ieee80211_node_table *nt;
 
-	IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "end %s scan\n",
-		(ic->ic_flags & IEEE80211_F_ASCAN) ?  "active" : "passive");
+	ieee80211_cancel_scan(ic);
 
-	ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN);
 	nt = &ic->ic_scan;
 	ni = TAILQ_FIRST(&nt->nt_node);
 
@@ -736,6 +747,7 @@
 		ic->ic_flags&IEEE80211_F_SHSLOT ? "short" : "long",
 		ic->ic_flags&IEEE80211_F_USEPROT ? ", protection" : ""
 	);
+	/* XXX check ni is in sta table and not scan table */
 	return ieee80211_sta_join(ic, ni);
 }
 

==== //depot/projects/wifi/sys/net80211/ieee80211_node.h#19 (text+ko) ====

@@ -194,6 +194,7 @@
 extern	void ieee80211_create_ibss(struct ieee80211com*,
 		struct ieee80211_channel *);
 extern	void ieee80211_reset_bss(struct ieee80211com *);
+extern	void ieee80211_cancel_scan(struct ieee80211com *);
 extern	void ieee80211_end_scan(struct ieee80211com *);
 extern	int ieee80211_ibss_merge(struct ieee80211com *,
 		struct ieee80211_node *);

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#21 (text+ko) ====

@@ -900,8 +900,10 @@
 				break;
 			}
 			goto reset;
+		case IEEE80211_S_SCAN:
+			ieee80211_cancel_scan(ic);
+			goto reset;
 		case IEEE80211_S_AUTH:
-		case IEEE80211_S_SCAN:
 		reset:
 			ic->ic_mgt_timer = 0;
 			IF_DRAIN(&ic->ic_mgtq);



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