From owner-svn-src-all@freebsd.org Sat Feb 11 05:33:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A907CDA9FE; Sat, 11 Feb 2017 05:33:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5788310B0; Sat, 11 Feb 2017 05:33:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1B5XncF075493; Sat, 11 Feb 2017 05:33:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1B5XnxI075492; Sat, 11 Feb 2017 05:33:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702110533.v1B5XnxI075492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 11 Feb 2017 05:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313578 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2017 05:33:50 -0000 Author: adrian Date: Sat Feb 11 05:33:49 2017 New Revision: 313578 URL: https://svnweb.freebsd.org/changeset/base/313578 Log: [net80211] add a sysctl that forces a vap restart. Well, vap restart really does "all restart" for now, which will be a good way of debugging firmware restart issues. Modified: head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sat Feb 11 05:19:45 2017 (r313577) +++ head/sys/net80211/ieee80211_freebsd.c Sat Feb 11 05:33:49 2017 (r313578) @@ -180,6 +180,26 @@ ieee80211_sysctl_radar(SYSCTL_HANDLER_AR return 0; } +/* + * For now, just restart everything. + * + * Later on, it'd be nice to have a separate VAP restart to + * full-device restart. + */ +static int +ieee80211_sysctl_vap_restart(SYSCTL_HANDLER_ARGS) +{ + struct ieee80211vap *vap = arg1; + int t = 0, error; + + error = sysctl_handle_int(oidp, &t, 0, req); + if (error || !req->newptr) + return error; + + ieee80211_restart_all(vap->iv_ic); + return 0; +} + void ieee80211_sysctl_attach(struct ieee80211com *ic) { @@ -259,6 +279,12 @@ ieee80211_sysctl_vattach(struct ieee8021 &vap->iv_ampdu_mintraffic[WME_AC_VI], 0, "VI traffic tx aggr threshold (pps)"); } + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "force_restart", CTLTYPE_INT | CTLFLAG_RW, vap, 0, + ieee80211_sysctl_vap_restart, "I", + "force a VAP restart"); + 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,