Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Apr 2008 17:19:49 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139525 for review
Message-ID:  <200804071719.m37HJnIe071345@repoman.freebsd.org>

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

Change 139525 by sam@sam_ebb on 2008/04/07 17:19:37

	o add RTM_IEEE80211_RADIO event to notify user space when the
	  rfkill switch state chagnes (not sure if this should be used
	  for other radio state changes that would otherwise appear as
	  link state changes)
	o change RTM_IEEE80211_COUNTRY event to include the bssid of
	  the ap from which the country code was extracted; user apps
	  will likely respond to this event by collecting current scan
	  results so this allows them to find the entry (but this also
	  begs the question of whether this event is even needed as a
	  user app can extract the same info from the scan results now
	  that we return the entire set of ie's in the scan resul data)

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#27 edit
.. //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#24 edit
.. //depot/projects/vap/sys/net80211/ieee80211_proto.h#19 edit
.. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#23 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#27 (text+ko) ====

@@ -627,18 +627,31 @@
 }
 
 void
-ieee80211_notify_country(struct ieee80211vap *vap, const uint8_t cc[2])
+ieee80211_notify_country(struct ieee80211vap *vap,
+	const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t cc[2])
 {
 	struct ifnet *ifp = vap->iv_ifp;
 	struct ieee80211_country_event iev;
 
 	memset(&iev, 0, sizeof(iev));
+	IEEE80211_ADDR_COPY(iev.iev_addr, bssid);
 	iev.iev_cc[0] = cc[0];
 	iev.iev_cc[1] = cc[1];
 	rt_ieee80211msg(ifp, RTM_IEEE80211_COUNTRY, &iev, sizeof(iev));
 }
 
 void
+ieee80211_notify_radio(struct ieee80211com *ic, int state)
+{
+	struct ifnet *ifp = ic->ic_ifp;
+	struct ieee80211_radio_event iev;
+
+	memset(&iev, 0, sizeof(iev));
+	iev.iev_state = state;
+	rt_ieee80211msg(ifp, RTM_IEEE80211_RADIO, &iev, sizeof(iev));
+}
+
+void
 ieee80211_load_module(const char *modname)
 {
 

==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#24 (text+ko) ====

@@ -458,9 +458,14 @@
 };
 
 struct ieee80211_country_event {
+	uint8_t		iev_addr[6];
 	uint8_t		iev_cc[2];	/* ISO country code */
 };
 
+struct ieee80211_radio_event {
+	uint8_t		iev_state;	/* 1 on, 0 off */
+};
+
 #define	RTM_IEEE80211_ASSOC	100	/* station associate (bss mode) */
 #define	RTM_IEEE80211_REASSOC	101	/* station re-associate (bss mode) */
 #define	RTM_IEEE80211_DISASSOC	102	/* station disassociate (bss mode) */
@@ -477,6 +482,7 @@
 #define	RTM_IEEE80211_DEAUTH	113	/* station deauthenticate */
 #define	RTM_IEEE80211_AUTH	114	/* station authenticate (ap mode) */
 #define	RTM_IEEE80211_COUNTRY	115	/* discovered country code (sta mode) */
+#define	RTM_IEEE80211_RADIO	116	/* RF kill switch state change */
 
 /*
  * Structure prepended to raw packets sent through the bpf

==== //depot/projects/vap/sys/net80211/ieee80211_proto.h#19 (text+ko) ====

@@ -354,5 +354,7 @@
 		enum ieee80211_notify_cac_event);
 void	ieee80211_notify_node_deauth(struct ieee80211_node *);
 void	ieee80211_notify_node_auth(struct ieee80211_node *);
-void	ieee80211_notify_country(struct ieee80211vap *, const uint8_t cc[2]);
+void	ieee80211_notify_country(struct ieee80211vap *, const uint8_t [],
+		const uint8_t cc[2]);
+void	ieee80211_notify_radio(struct ieee80211com *, int);
 #endif /* _NET80211_IEEE80211_PROTO_H_ */

==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#23 (text+ko) ====

@@ -322,7 +322,8 @@
 		     !isocmp(cie->cc, ic->ic_regdomain.isocc))) {
 			/* only issue one notify event per scan */
 			if (se->se_countrygen != st->st_scangen) {
-				ieee80211_notify_country(vap, cie->cc);
+				ieee80211_notify_country(vap, ise->se_bssid,
+				    cie->cc);
 				se->se_countrygen = st->st_scangen;
 			}
 		}



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