From owner-freebsd-questions@FreeBSD.ORG Sat Feb 4 17:32:26 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A910106566B for ; Sat, 4 Feb 2012 17:32:26 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DDE708FC0A for ; Sat, 4 Feb 2012 17:32:25 +0000 (UTC) Received: by iaeo4 with SMTP id o4so9725539iae.13 for ; Sat, 04 Feb 2012 09:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7Hxv+4td5I8fin5TJtxhC5DMAJBTTmhdAYTzcoPTizQ=; b=JBe60VIUmNg/9M9G67czGTeTpnB7ijTfrOWSgmjfU2B4w5f6k/jz2rKuC0TzuR3C5R KFlawO8yIjEMKE/DgkrdIs6n4s6p2qTmyZl0Wv/K4uaosOpNFuBu7+mLx1Ppsy//81B5 SCJ12BMcoOE5cTYsB0f5NZiWH9uUgIXeVi/D0= MIME-Version: 1.0 Received: by 10.50.154.200 with SMTP id vq8mr13895523igb.14.1328376745230; Sat, 04 Feb 2012 09:32:25 -0800 (PST) Received: by 10.231.17.193 with HTTP; Sat, 4 Feb 2012 09:32:25 -0800 (PST) In-Reply-To: References: <4F2AA33E.6010207@onetel.com> <4F2D1BE0.7050901@onetel.com> Date: Sat, 4 Feb 2012 09:32:25 -0800 Message-ID: From: Waitman Gobble To: Chris Whitehouse Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: User Questions Subject: Re: ath and how to control wireless light X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 17:32:26 -0000 On Sat, Feb 4, 2012 at 9:02 AM, Waitman Gobble wrote: > > > On Sat, Feb 4, 2012 at 8:49 AM, Waitman Gobble wrote: > >> >> >> On Sat, Feb 4, 2012 at 3:52 AM, Chris Whitehouse wrote: >> >>> On 04/02/2012 08:37, Waitman Gobble wrote: >>> >>>> On Thu, Feb 2, 2012 at 6:52 AM, Chris Whitehouse >>>> wrote: >>>> >>>> Hello >>>>> >>>>> I have FreeBSD 9R amd64 installed on a HP G60 laptop. This machine has >>>>> a >>>>> combined wireless switch and led. The switch turns the wifi on and off >>>>> but >>>>> the light stays red. >>>>> >>>>> The light is supposed to show red for wireless off and blue for >>>>> wireless >>>>> on. I found some sysctls that control it: >>>>> dev.ath.0.softled: 0 >>>>> dev.ath.0.ledpin: 3 >>>>> dev.ath.0.ledon: 1 >>>>> dev.ath.0.ledidle: 2700 >>>>> >>>>> softled, ledpin and ledon are all set to 0 on boot. >>>>> I set ledpin to 3, then to change the colour of the light I turn on >>>>> softled 0->1, toggle ledon and turn off softled again. >>>>> >>>>> Can I make that sequence occur, or do something else, to make the led >>>>> change when the button is pressed _and_ keep in sync with whether the >>>>> wireless is on or off? >>>>> >>>>> With softled=1 the light is blue with a short red flash or red with a >>>>> short blue flash depending on the value of ledon. Also when softled=1 >>>>> the >>>>> light flashes in it's "opposite" colour when there is network traffic. >>>>> So >>>>> it would probably be ok just to leave softled=1 and toggle ledon. >>>>> >>>>> The wireless device is >>>>> dev.ath.0.%desc: Atheros 5424/2424. >>>>> >>>>> I think there is a slight glitch with the on/off button, that under >>>>> some >>>>> circumstances it doesn't turn the wifi on again, which would be much >>>>> easier >>>>> to test if the light worked. >>>>> >>>>> Also what is ledidle and what do different settings do? >>>>> >>>>> Thanks >>>>> >>>>> Chris >>>>> ______________________________****_________________ >>>>> freebsd-questions@freebsd.org mailing list >>>>> http://lists.freebsd.org/****mailman/listinfo/freebsd-****questions >>>>> >>>>> > >>>>> To unsubscribe, send any mail to "freebsd-questions-** >>>>> unsubscribe@freebsd.org >>>>> >" >>>>> >>>>> >>>> Hi Chris, >>>> >>>> I have an Acer Aspire D150 and the LED hasn't been lit with FreeBSD, >>>> 9-rc3, >>>> 9-release or 10-current (with BroadCom and 2 Atheros cards). it did >>>> work >>>> with Fedora GNU/Linux 11. I did try setting in loader.conf as >>>> recommended >>>> to me to no avail. On one hand it was easy to get the attitude "who >>>> cares >>>> about the LED anyway" but on the other I'm thinking it's a simple little >>>> thing that's important,I guess like maybe buying a new car and it's >>>> missing >>>> a knob on the stereo. (?) :) I suppose it probably should work. >>>> >>>> Waitman Gobble >>>> San Jose California USA >>>> >>>> I have another HP laptop with a Broadcomm card which has a >>> button_with_light and it just works. None of the sysctl oids above occur >>> though. Maybe I'll swap wireless cards between the two and see what happens. >>> >>> What is the output of sysctl -a |grep led ? >>> You'll get lots of "enabled's" but there might be something that relates >>> to led's. >>> >>> I had to change ledpin from default of 0 to 3 before any of the other >>> ones had any effect. >>> >>> Thanks for the reply anyway. >>> >>> Chris >>> >> >> Oh thats a good idea :) Thanks >> >> here's what someone recommended : >> >> dev.ath.0.ledpin=3 >> dev.ath.0.softled=1 >> >> but here are some extras i found from sysctl -a that i will check out: >> >> dev.ath.0.ledon: 0 >> dev.ath.0.ledidle: 2700 >> dev.ath.0.hardled: 0 >> dev.ath.0.led_net_pin: -1 >> dev.ath.0.led_pwr_pin: -1 >> >> Waitman Gobble >> San Jose California USA >> >> > in if_athvar.h > sc_softled : 1,/* enable LED gpio status */ > sc_hardled : 1,/* enable MAC LED status */ > > if_ath_sysctl.c: ath_sysctl_hardled, "I", "enable/disable hardware LED > support"); > if_ath_sysctl.c: /* XXX Laziness - configure pins, then flip hardled > off/on */ > if_athvar.h: sc_hardled : 1,/* enable MAC LED status > > this one maybe? > > p00ntang# grep led_pwr_pin * > if_ath.c: sc->sc_led_pwr_pin = -1; > if_ath_led.c: if (sc->sc_led_pwr_pin > 0) > if_ath_led.c: ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_pwr_pin, > if_ath_sysctl.c: "led_pwr_pin", CTLFLAG_RW, &sc->sc_led_pwr_pin, 0, > if_athvar.h: int sc_led_pwr_pin; /* MAC power LED GPIO pin */ > > > > It looks like all the LED code is in if_ath_led.c :) /* Software LED blinking - GPIO controlled LED */ if (sc->sc_softled) { ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin, HAL_GPIO_MUX_OUTPUT); ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); } /* Hardware LED blinking - MAC controlled LED */ if (sc->sc_hardled) { /* * Only enable each LED if required. * * Some NICs only have one LED connected; others may * have GPIO1/GPIO2 connected to other hardware. */ if (sc->sc_led_pwr_pin > 0) ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_pwr_pin, HAL_GPIO_MUX_MAC_POWER_LED); if (sc->sc_led_net_pin > 0) ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_net_pin, HAL_GPIO_MUX_MAC_NETWORK_LED); } but on my netbook w/ mini-PCIe NIC I'm guessing it's only software LED.. Waitman Gobble San Jose California USA