netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Dan Williams <dcbw@redhat.com>
Cc: Mark Wallis <mwallis@serialmonkey.com>,
	netdev@vger.kernel.org, David Zeuthen <davidz@redhat.com>
Subject: Re: Hardware button support for Wireless cards
Date: Mon, 15 May 2006 17:12:20 +0200	[thread overview]
Message-ID: <200605151712.23639.IvDoorn@gmail.com> (raw)
In-Reply-To: <1147703855.2193.47.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 4546 bytes --]

On Monday 15 May 2006 16:37, Dan Williams wrote:
> On Mon, 2006-05-15 at 22:57 +1000, Mark Wallis wrote:
> > Hi everyone,
> > 
> > Currently, in our rt2x00 (using the devicescape stack) we are firing off an
> > ACPI event so that the hardware button can be handled in userspace. This
> > allows the user to basically do whatever they want when this button is
> > pressed - including bringing down the wireless interface. The problem here
> > is no distro's currently contain scripts to run from this event so for many
> > users it just "doesn't work" without them manually having to write scripts
> > to handle the ACPI even themselves.
> > 
> > Some people are saying that instead of throwing and ACPI event we should be
> > either use hotplug or internally just disable the radio and somehow inform
> > the dscape stack that the radio has been disabled.
> > 
> > What are peoples thoughts here, should we 
> > 
> > A. be handling this within our drivers and doing "what the user expects" and
> > disabling the hardware radio, or 
> 
> > B. should we be firing an ACPI event and getting the distro's to add scripts
> > so when this event is fired they bring down all the wireless interfaces.
> 
> (had this issue in the back of my head for a while already...)
> 
> Isn't the rf-kill switch specific to the manufacturer lots of times?  Is
> the switch connected directly to the card, or is it incumbent on the
> driver to notice the event and disable the card via software?  We need
> to handle this for Bluetooth too, in situations where there's both a
> bluetooth and an 802.11 card in the box.  Does the rf-kill apply to
> both?  Or just to one?

The rt2x00 device itself does nothing when the button is pressed, it only
updates certain fields in a register to indicate the button is pressed.
The driver should read from the EEPROM if a hardware button is available,
after that it should poll the register to see if the button has been pressed,
and it is up to the driver what to do.

> WRT to disabling the radio, I'm not sure it makes a difference either
> way.  Hitting a button generally means "do this _NOW_", so it makes
> sense for the driver to disable the radio and then send out the event.
> Apps need to be able to deal with these resources going out from
> underneath them, and I'm not sure it makes sense to wait around for some
> scripts to run that just might possibly at some future point disable it,
> but you're never sure.

Well I would think it is cleaner to inform userspace that the button is pressed
and let userspace sort out what exactly should happen.
But I doubt it will be a good idea when the driver is sending and event _and_
disabled the radio. It could be that the user wants something to be done
before the radio is being disabled.

> In the end, an ACPI event is probably fine.  I must stress that we NEED
> to have a common event structure for this, such that every driver and
> card presents the same interface.  I don't want to have to write stuff
> for each of 3 or 4 different cards to notice the rf-kill stuff.  Witness
> all the extra binaries that each driver has already for this sort of
> thing.  What interface does the ipw[2|3]xxx driver and hardware present?
> What common bits can be drawn out from both?
> 
> Ideally, here's what would happen:  the driver/card/whatever generates
> an ACPI event, which is noticed by HAL.  HAL sets a property on the
> _exact_ device which the event is for, and propagates the signal out
> over dbus.  Any interested application can listen for, and respond to,
> the rf-kill signal.  (or, the event can be handled by acpid and the
> distro can run scripts for it.  01dsk001.  whatever)

This idea sounds good, but is ACPI the thing to be used.
Escpially since ACPI is a bit architectures dependent.
And the solution should be supported on various architectures.

> But this means a few things.  We need:
> 
> 1) common interface/signal for _all_ cards and drivers
> 2) Enough information to identify which specific pci/pcmcia/etc device
> the event is for (or system-wide?)

system-wide would not be a good idea, we need something to determine which
driver exactly has triggered the event. Some laptops have several hardware buttons
1 for Bluetooth and 1 for Wifi for example.

So we could just pass the name the driver has created for that button to userspace.
At least that is a similar approach to ACPI where the class, bid and name fields
are all names set by the driver.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-05-15 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 12:57 Hardware button support for Wireless cards Mark Wallis
2006-05-15 13:25 ` Jiri Benc
2006-05-15 13:59   ` Ivo van Doorn
2006-05-15 14:06 ` Sergey Vlasov
2006-05-15 14:37 ` Dan Williams
2006-05-15 15:12   ` Ivo van Doorn [this message]
2006-05-15 16:20     ` Jouni Malinen
2006-05-16  3:10       ` Mark Wallis
2006-05-25 15:15         ` [RFC PATCH 0/2] " Ivo van Doorn
2006-05-15 16:19   ` David Zeuthen
2006-05-15 15:27 ` Jason Lunz
2006-05-15 16:01   ` Michael Buesch
2006-05-15 19:12     ` Dan Williams
2006-05-15 19:32       ` Michael Buesch
2006-05-15 19:46       ` Jason Lunz
2006-05-15 21:42         ` Ivo van Doorn
2006-05-15 20:08   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605151712.23639.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=davidz@redhat.com \
    --cc=dcbw@redhat.com \
    --cc=mwallis@serialmonkey.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).