From owner-freebsd-mobile@FreeBSD.ORG Mon Mar 12 16:27:12 2012 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CD1106564A; Mon, 12 Mar 2012 16:27:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id B68F98FC08; Mon, 12 Mar 2012 16:27:11 +0000 (UTC) Received: by yhgm50 with SMTP id m50so3259566yhg.13 for ; Mon, 12 Mar 2012 09:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LClQQ4BwtXWsaGEmzGr7+BSGgwtvJ5Ozgj3GeMmnCZo=; b=SVQjJjDEov8fmQoKngNTvNMXObmI6IauBrznrEKbpr9rq1RRj7hg9hBZqZpb6NR2ay n6QMvdHHfaL+duIzVKBn9eYxrkOYx/NO+VIONttKWcV4c71A6W7s6PzrxlGtQ9jZWdLU ZYeqUIdAsD8RP0Fc6tSEAK3I8y6lgu4GOLRFQbbSvOrJiKj6ixG9Nu/xdobi2e8/mMCn bmx6l8n6cLfHIDpVQtGVkqy6oWOVMgvHO7SglXi/QDVSidpxbdDGR3rovZMa98peyxMU Z7xaZiWNaR3C0mcYHcrmciElA3bVbSxrmAQZB425xmgbYPAz+7Td9jVMObUS2i6Ql8XL bKmg== MIME-Version: 1.0 Received: by 10.68.240.135 with SMTP id wa7mr1934194pbc.7.1331569630885; Mon, 12 Mar 2012 09:27:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.143.33.5 with HTTP; Mon, 12 Mar 2012 09:27:10 -0700 (PDT) In-Reply-To: <20120312151358.GA26109@bali> References: <20120312151358.GA26109@bali> Date: Mon, 12 Mar 2012 09:27:10 -0700 X-Google-Sender-Auth: gqK2FK2i0VBOcl_CmwysF5JlzuI Message-ID: From: Adrian Chadd To: Andre Albsmeier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-wireless@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: [Patch] Reflect state of rfkill switch in a sysctl for ath based card X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 16:27:12 -0000 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 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"