From owner-freebsd-wireless@FreeBSD.ORG Tue Mar 13 11:19:45 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2362106564A; Tue, 13 Mar 2012 11:19:44 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.freebsd.org (Postfix) with ESMTP id 707BE8FC15; Tue, 13 Mar 2012 11:19:44 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id q2DBBQWH002268; Tue, 13 Mar 2012 12:11:27 +0100 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id q2DBBQLp031040; Tue, 13 Mar 2012 12:11:26 +0100 Received: (from localhost) by curry.mchp.siemens.de (8.14.5/8.14.5) id q2DBBQuH082981; Date: Tue, 13 Mar 2012 12:11:26 +0100 From: Andre Albsmeier To: Adrian Chadd Message-ID: <20120313111126.GA29538@bali> References: <20120312151358.GA26109@bali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-wireless@freebsd.org" , "Albsmeier, Andre" , "freebsd-mobile@freebsd.org" Subject: Re: [Patch] Reflect state of rfkill switch in a sysctl for ath based card X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 11:19:45 -0000 On Mon, 12-Mar-2012 at 17:27:10 +0100, Adrian Chadd wrote: > Hi! > > Would you please create a PR and let me know what the PR number is? Well, there is a high probability that it might not work on non-5212 cards end even here it might fail (I can just test it with this Wistron CM9 card). Maybe someone with more knowledge about ath(4) (Sam?) might have quick look at it before... -Andre > > I'll test it out on my local ath(4) NICs and commit it to -HEAD if > there aren't any issues with it. > > Thanks! > > > Adrian > > > On 12 March 2012 08:13, Andre Albsmeier wrote: > > Hello all, > > > > my laptop (FSC S7020) got this rfkill switch for the normally > > used Intel 2200 WLAN card. The state of this switch can be > > seen through the dev.iwi.0.radio sysctl. > > > > With my new Atheros based card (Wistron CM9) this never worked > > although the state of the switch was properly honoured by the > > card. > > > > In case anyone is interested: The following patch brings this > > functionality to the ath driver of 7.4-STABLE and works at least > > on the above mentioned hardware. Comments and suggestions (apart > > from style fixes;-)) are welcome... > > > >        -Andre > > > > --- sys/dev/ath/if_ath.c.ORI    2010-11-17 18:30:14.000000000 +0100 > > +++ sys/dev/ath/if_ath.c        2012-03-02 13:47:26.000000000 +0100 > > @@ -6074,6 +6074,15 @@ > >        return !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0; > >  } > > > > +static int ath_sysctl_radio( SYSCTL_HANDLER_ARGS ) > > +{ > > +  struct ath_softc* sc = arg1; > > +  int val; > > + > > +  val = ath_hal_gpioget( sc->sc_ah, sc->sc_rfsilentpin ) ^ sc->sc_rfsilentpol; > > +  return sysctl_handle_int( oidp, &val, 0, req ); > > +} > > + > >  static void > >  ath_sysctlattach(struct ath_softc *sc) > >  { > > @@ -6162,6 +6171,7 @@ > >                SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, > >                        "rfkill", CTLTYPE_INT | CTLFLAG_RW, sc, 0, > >                        ath_sysctl_rfkill, "I", "enable/disable RF kill switch"); > > +  SYSCTL_ADD_PROC( ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "radio", CTLTYPE_INT | CTLFLAG_RD, sc, 0, ath_sysctl_radio, "I", "radio transmitter switch state (0=off, 1=on)"); > >        } > >        sc->sc_monpass = HAL_RXERR_DECRYPT | HAL_RXERR_MIC; > >        SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, > > _______________________________________________ > > freebsd-mobile@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-mobile > > To unsubscribe, send any mail to "freebsd-mobile-unsubscribe@freebsd.org" -- FreeBSD: We eat penguins for breakfast