Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2012 09:27:10 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Andre Albsmeier <Andre.Albsmeier@siemens.com>
Cc:        freebsd-wireless@freebsd.org, freebsd-mobile@freebsd.org
Subject:   Re: [Patch] Reflect state of rfkill switch in a sysctl for ath based card
Message-ID:  <CAJ-Vmo=sDU43wiwga=Vgo25VURP%2BK4iKVMLCpYfw0n8RJZA59w@mail.gmail.com>
In-Reply-To: <20120312151358.GA26109@bali>
References:  <20120312151358.GA26109@bali>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi!

Would you please create a PR and let me know what the PR number is?

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 <Andre.Albsmeier@siemens.com> 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...
>
> =A0 =A0 =A0 =A0-Andre
>
> --- sys/dev/ath/if_ath.c.ORI =A0 =A02010-11-17 18:30:14.000000000 +0100
> +++ sys/dev/ath/if_ath.c =A0 =A0 =A0 =A02012-03-02 13:47:26.000000000 +01=
00
> @@ -6074,6 +6074,15 @@
> =A0 =A0 =A0 =A0return !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0;
> =A0}
>
> +static int ath_sysctl_radio( SYSCTL_HANDLER_ARGS )
> +{
> + =A0struct ath_softc* sc =3D arg1;
> + =A0int val;
> +
> + =A0val =3D ath_hal_gpioget( sc->sc_ah, sc->sc_rfsilentpin ) ^ sc->sc_rf=
silentpol;
> + =A0return sysctl_handle_int( oidp, &val, 0, req );
> +}
> +
> =A0static void
> =A0ath_sysctlattach(struct ath_softc *sc)
> =A0{
> @@ -6162,6 +6171,7 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree)=
, OID_AUTO,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"rfkill", CTLTYPE_INT | CT=
LFLAG_RW, sc, 0,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ath_sysctl_rfkill, "I", "e=
nable/disable RF kill switch");
> + =A0SYSCTL_ADD_PROC( ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "radio", CTLT=
YPE_INT | CTLFLAG_RD, sc, 0, ath_sysctl_radio, "I", "radio transmitter swit=
ch state (0=3Doff, 1=3Don)");
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0sc->sc_monpass =3D HAL_RXERR_DECRYPT | HAL_RXERR_MIC;
> =A0 =A0 =A0 =A0SYSCTL_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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=sDU43wiwga=Vgo25VURP%2BK4iKVMLCpYfw0n8RJZA59w>