From owner-svn-src-head@freebsd.org Thu Feb 2 05:27:49 2017 Return-Path: Delivered-To: svn-src-head@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 F2907CCDAE2; Thu, 2 Feb 2017 05:27:49 +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 C245117A1; Thu, 2 Feb 2017 05:27:49 +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 v125Rmhp095018; Thu, 2 Feb 2017 05:27:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v125RmBL095017; Thu, 2 Feb 2017 05:27:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702020527.v125RmBL095017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 2 Feb 2017 05:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313087 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 05:27:50 -0000 Author: adrian Date: Thu Feb 2 05:27:48 2017 New Revision: 313087 URL: https://svnweb.freebsd.org/changeset/base/313087 Log: [ath] ensure the NIC is woken up before changing the spectral scan parameters. Modified: head/sys/dev/ath/if_ath_spectral.c Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Thu Feb 2 05:27:27 2017 (r313086) +++ head/sys/dev/ath/if_ath_spectral.c Thu Feb 2 05:27:48 2017 (r313087) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -191,6 +192,10 @@ ath_ioctl_spectral(struct ath_softc *sc, if (! ath_hal_spectral_supported(sc->sc_ah)) return (EINVAL); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if (ad->ad_id & ATH_DIAG_IN) { /* * Copy in data. @@ -285,6 +290,10 @@ bad: free(indata, M_TEMP); if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) free(outdata, M_TEMP); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + return (error); }