diff options
author | sam <sam@FreeBSD.org> | 2008-08-02 18:00:33 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-08-02 18:00:33 +0000 |
commit | a3bf7f34053fc16514aaad6498093a3c9c586d04 (patch) | |
tree | 85d90632b7ec0f253805885b5b2c05acf02071ae | |
parent | 3ca07b6391dea7038b619982ca8151eb506f843a (diff) | |
download | FreeBSD-src-a3bf7f34053fc16514aaad6498093a3c9c586d04.zip FreeBSD-src-a3bf7f34053fc16514aaad6498093a3c9c586d04.tar.gz |
add a sysctl to deliver a radar event for testing
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index c0c1474..ad29931 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -201,6 +201,21 @@ ieee80211_sysctl_parent(SYSCTL_HANDLER_ARGS) return SYSCTL_OUT(req, name, strlen(name)); } +static int +ieee80211_sysctl_radar(SYSCTL_HANDLER_ARGS) +{ + struct ieee80211com *ic = arg1; + int t = 0, error; + + error = sysctl_handle_int(oidp, &t, 0, req); + if (error || !req->newptr) + return error; + IEEE80211_LOCK(ic); + ieee80211_dfs_notify_radar(ic, ic->ic_curchan); + IEEE80211_UNLOCK(ic); + return 0; +} + void ieee80211_sysctl_attach(struct ieee80211com *ic) { @@ -280,6 +295,11 @@ ieee80211_sysctl_vattach(struct ieee80211vap *vap) &vap->iv_ampdu_mintraffic[WME_AC_VI], 0, "VI traffic tx aggr threshold (pps)"); } + if (vap->iv_caps & IEEE80211_C_DFS) { + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "radar", CTLTYPE_INT | CTLFLAG_RW, vap->iv_ic, 0, + ieee80211_sysctl_radar, "I", "simulare radar event"); + } vap->iv_sysctl = ctx; vap->iv_oid = oid; } |