svn commit: r276150 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Tue Dec 23 18:48:46 UTC 2014


Author: adrian
Date: Tue Dec 23 18:48:45 2014
New Revision: 276150
URL: https://svnweb.freebsd.org/changeset/base/276150

Log:
  Bump the valid GPIO range for rfkill up from 8 to 16.
  
  AR5416 and later NICs have more than 8 (Well, more than 6) GPIO pins.
  So to support rfkill on these NICs we need to bump this up or the
  rfkill GPIO pin may get reset to the wrong value.
  
  Noticed by: Anthony Jenkins <scoobi_doo at yahoo.com>

Modified:
  head/sys/dev/ath/if_ath_sysctl.c

Modified: head/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- head/sys/dev/ath/if_ath_sysctl.c	Tue Dec 23 16:33:44 2014	(r276149)
+++ head/sys/dev/ath/if_ath_sysctl.c	Tue Dec 23 18:48:45 2014	(r276150)
@@ -446,7 +446,15 @@ ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS)
 		return error;
 	if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent))
 		return EINVAL;
-	sc->sc_rfsilentpin = rfsilent & 0x1c;
+	/*
+	 * Earlier chips (< AR5212) have up to 8 GPIO
+	 * pins exposed.
+	 *
+	 * AR5416 and later chips have many more GPIO
+	 * pins (up to 16) so the mask is expanded to
+	 * four bits.
+	 */
+	sc->sc_rfsilentpin = rfsilent & 0x3c;
 	sc->sc_rfsilentpol = (rfsilent & 0x2) != 0;
 	return 0;
 }


More information about the svn-src-all mailing list