From owner-p4-projects@FreeBSD.ORG Mon Apr 7 17:19:50 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 28DD31065672; Mon, 7 Apr 2008 17:19:50 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6190106566C for ; Mon, 7 Apr 2008 17:19:49 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id ABC228FC1C for ; Mon, 7 Apr 2008 17:19:49 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m37HJnJt071347 for ; Mon, 7 Apr 2008 17:19:49 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m37HJnIe071345 for perforce@freebsd.org; Mon, 7 Apr 2008 17:19:49 GMT (envelope-from sam@freebsd.org) Date: Mon, 7 Apr 2008 17:19:49 GMT Message-Id: <200804071719.m37HJnIe071345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 139525 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2008 17:19:50 -0000 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; } }