From: Philip Langdale <philipl@overt.org>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: LKML <linux-kernel@vger.kernel.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
toshiba_acpi@memebeam.org, Ivo van Doorn <ivdoorn@gmail.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/1] toshiba_acpi: Add support for bluetooth toggling through rfkill (v2)
Date: Wed, 06 Aug 2008 21:40:47 -0700 [thread overview]
Message-ID: <489A7CCF.1090407@overt.org> (raw)
In-Reply-To: <20080805212416.GB21738@khazad-dum.debian.net>
Henrique de Moraes Holschuh wrote:
>
> Well, the textbook way to connect that to rfkill is something like this,
> please check if it makes sense:
>
> Export (1) as a input device (you have events to hook to when it changes
> state) or polled input device (you don't have said events). Do NOT register
> (1) with a struct rfkill at all. It is purely an input device.
>
> DO NOT expose (2) as an input device at all. Instead, register it to a
> rfkill struct, of type bluetooth.
>
> On the event handler for (1), you issue the EV_SW SW_RFKILL_ALL input event.
> Since you *do* know events from (1) are likely to also have messed with the
> state of (2), you also check (2)'s state at this time and update it through
> rfkill_force_state().
>
> Due to the interaction of 1 and 2, you need to implement and deal with
> RFKILL_STATE_HARD_BLOCKED. Since you do know the firmware will be
> hard-blocking (2) when (1) is active, you return RFKILL_STATE_HARD_BLOCKED
> for (2)'s state every time (1) is active. Otherwise, you return
> RFKILL_STATE_SOFT_BLOCKED when (2) is blocked, and RFKILL_STATE_UNBLOCKED
> otherwise.
>
> This will cause the state of (2) to go to either RFKILL_STATE_HARD_BLOCKED
> or RFKILL_STATE_SOFT_BLOCKED when (1) changes state.
>
> [Note: the above does assume (1) blocks (2) in some way you cannot override,
> and that trying to unblock (2) while (1) is blocking it is futile].
>
> rfkill-input (now) or userspace (someday) will take care of kicking the
> radio to RFKILL_STATE_UNBLOCKED when (1) issues an event that signals that
> radios don't have to remain blocked. Maybe this is why you see the WLAN
> going on when you deactivate the radio kill switch?
>
> And rfkill-input will soon be enhanced to let the user configure it to do
> something different if he wants. Your driver doesn't (and shouldn't)
> hardcode policy about it.
Hmm. So, I've updated the diff to do this, but rfkill-input is not kicking
the bluetooth device back on after I release the kill switch. it just returns
to SOFT_UNBLOCKED and stays there.
--phil
next prev parent reply other threads:[~2008-08-07 5:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 19:12 [PATCH 1/1] toshiba_acpi: Add support for bluetooth toggling through rfkill (v2) Philip Langdale
2008-08-03 4:26 ` Henrique de Moraes Holschuh
2008-08-04 1:10 ` Philip Langdale
2008-08-05 21:24 ` Henrique de Moraes Holschuh
2008-08-06 3:33 ` Philip Langdale
2008-08-06 12:26 ` Henrique de Moraes Holschuh
2008-08-07 4:40 ` Philip Langdale [this message]
2008-08-07 13:45 ` Henrique de Moraes Holschuh
2008-08-11 16:41 ` Philip Langdale
2008-08-13 9:29 ` Henrique de Moraes Holschuh
2008-08-14 6:58 ` Philip Langdale
2008-08-16 19:22 ` Philip Langdale
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=489A7CCF.1090407@overt.org \
--to=philipl@overt.org \
--cc=hmh@hmh.eng.br \
--cc=ivdoorn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=toshiba_acpi@memebeam.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).