Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2017 05:27:48 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313087 - head/sys/dev/ath
Message-ID:  <201702020527.v125RmBL095017@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <dev/ath/if_athvar.h>
 #include <dev/ath/if_ath_spectral.h>
+#include <dev/ath/if_ath_misc.h>
 
 #include <dev/ath/ath_hal/ah_desc.h>
 
@@ -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);
 }
 



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