linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [PATCH] rfkill: clarify usage of rfkill_force_state() and rfkill->get_state()
Date: Thu, 18 Sep 2008 19:40:24 +0200	[thread overview]
Message-ID: <200809181940.24727.IvDoorn@gmail.com> (raw)
In-Reply-To: <20080918164339.GM1583@khazad-dum.debian.net>

On Thursday 18 September 2008, Henrique de Moraes Holschuh wrote:
> On Thu, 18 Sep 2008, Ivo van Doorn wrote:
> > On Thursday 18 September 2008, Henrique de Moraes Holschuh wrote:
> > > rfkill_force_state() is used to update the rfkill core's idea of what is
> > > really happening RIGHT NOW to the transmitter hardware in a PUSH model.
> > > 
> > > rfkill->get_state() does the same, in a PULL model.
> > > 
> > > Neither of them change the real hardware radio state through a call to
> > > rfkill->toggle_radio() or anything of the sort, so they must deal with the
> > > real, current state of the hardware.
> > > 
> > > Change some documentation to make that more clear (I hope).
> > > 
> > > Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> > > Cc: Ivo van Doorn <IvDoorn@gmail.com>
> > 
> > See my other mail I just send out.
> 
> I did, and just replied to it.
> 
> But only now do I think I realised what you meant:  That even if the driver
> tries to keep set txpower off separate from rfkill, if it uses the hardware
> soft-rfkill bit to implement both, it cannot use that to feed information to
> rfkill_force_state() directly.
> 
> Argh.

Indeed, you need to differentiate between RFKILL and RADIO states.

> > But I don't quite agree on this change of rfkill event interpretation.
> 
> Well, there is no intended change in interpretation, but I don't know how to
> word it in a way that means "the real current hardware state as far as
> rfkill is concerned".

Well my interpretation is that rfkill events and thus rfkill_force_state() calls
should be done for RFKILL state changes only. And RADIO state should be
ignored since they don't matter for rfkill.

> Because suppose it is a driver doing txpower off AND software rfkill using
> the *same* hardware bit (a sigle software rfkill bit).
>
> Now it must do something like this in pseudo-code:
> 
> 	1. if (the bit is disabled (i.e. SW rfkill is NOT ACTIVE)) {
> 		rfkill-SW-status = disabled;
> 	   }  else if (the bit is enabled (i.e. SW rfkill is ACTIVE)) {
> 		if (tx power off is NOT ACTIVE)
> 			rfkill-SW-status = enabled;
> 		else
> 			rfkill-SW-status = whatever the user asked
> 	   }
> 
> THEN, it should use rfkill-sw-status, along with the hw rfkill line status,
> to synthesize the state it must pass to rfkill_force_status().
> 
> ICK.  Of course, if the driver has another way to implement txpower off that
> does not clash with sw rfkill, the above is unneeded.
> 
> How would you put that into words for the rfkill documentation?

The driver is required to keep track of the userspace configuration settings,
when rfkill sends BLOCK to driver it should disable the radio, when rfkill
send UNBLOCK to the driver it should restore to the userspace configuration
settings (which can either be an enabled or disabled radio).

Ivo

  parent reply	other threads:[~2008-09-18 17:40 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-18  5:07 [RFC] b43: A patch for control of the radio LED using rfkill Larry Finger
2008-09-18 13:19 ` Ivo van Doorn
2008-09-18 13:47   ` Larry Finger
2008-09-18 13:53     ` Ivo van Doorn
2008-09-18 14:21       ` Henrique de Moraes Holschuh
2008-09-18 14:26         ` Ivo van Doorn
2008-09-18 14:52           ` Henrique de Moraes Holschuh
2008-09-18 15:19             ` [PATCH] rfkill: clarify usage of rfkill_force_state() and rfkill->get_state() Henrique de Moraes Holschuh
2008-09-18 15:24               ` Ivo van Doorn
2008-09-18 16:43                 ` Henrique de Moraes Holschuh
2008-09-18 16:45                   ` Johannes Berg
2008-09-18 17:32                     ` Ivo van Doorn
2008-09-18 17:52                       ` Johannes Berg
2008-09-18 18:12                         ` Ivo van Doorn
2008-09-18 17:40                   ` Ivo van Doorn [this message]
2008-09-18 17:41         ` [RFC] b43: A patch for control of the radio LED using rfkill Michael Buesch
2008-09-18 17:37       ` Michael Buesch
2008-09-18 17:48         ` Ivo van Doorn
2008-09-18 17:56           ` Michael Buesch
2008-09-18 18:10             ` Ivo van Doorn
2008-09-18 18:17               ` Michael Buesch
2008-09-18 18:23                 ` Ivo van Doorn
2008-09-18 18:34                   ` Michael Buesch
2008-09-18 18:36                     ` Johannes Berg
2008-09-18 19:23                     ` Henrique de Moraes Holschuh
2008-09-18 20:09                     ` Ivo van Doorn
2008-09-18 19:08           ` Henrique de Moraes Holschuh
2008-09-18 20:17             ` Ivo van Doorn
2008-09-18 20:28               ` Henrique de Moraes Holschuh
2008-09-18 20:42                 ` Ivo van Doorn
2008-09-18 17:34     ` Michael Buesch
2008-09-18 17:42       ` Ivo van Doorn
2008-09-18 17:49         ` Johannes Berg
2008-09-18 18:02           ` Ivo van Doorn
2008-09-18 19:50             ` Henrique de Moraes Holschuh
2008-09-18 17:53         ` Michael Buesch
2008-09-18 18:06           ` Ivo van Doorn
2008-09-18 14:10   ` Henrique de Moraes Holschuh
2008-09-18 14:24     ` Ivo van Doorn
2008-09-18 14:37       ` Henrique de Moraes Holschuh
2008-09-18 15:16         ` Ivo van Doorn
2008-09-18 16:08           ` Henrique de Moraes Holschuh
2008-09-18 16:51             ` Ivo van Doorn
2008-09-18 18:47               ` Henrique de Moraes Holschuh
2008-09-18 19:14                 ` Johannes Berg
2008-09-18 20:35                 ` Ivo van Doorn
2008-09-18 21:34                   ` Henrique de Moraes Holschuh
2008-09-18 17:44       ` Michael Buesch
2008-09-18 17:52         ` Ivo van Doorn
2008-09-18 17:54           ` Johannes Berg
2008-09-18 18:06             ` Ivo van Doorn
2008-09-18 18:13               ` Johannes Berg
2008-09-18 20:10               ` Henrique de Moraes Holschuh
2008-09-18 20:41                 ` Ivo van Doorn
2008-09-18 21:36                   ` Henrique de Moraes Holschuh
2008-09-19 17:02                     ` Ivo van Doorn
2008-09-20 13:10                       ` Henrique de Moraes Holschuh
2008-09-20 13:20                         ` Ivo van Doorn
2008-09-22  3:01                           ` Henrique de Moraes Holschuh
2008-09-22 21:16                             ` Michael Buesch
2008-09-18 17:31 ` Michael Buesch
2008-09-18 20:13   ` Henrique de Moraes Holschuh

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=200809181940.24727.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=hmh@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).