lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080918164339.GM1583@khazad-dum.debian.net>
Date:	Thu, 18 Sep 2008 13:43:39 -0300
From:	Henrique de Moraes Holschuh <hmh@....eng.br>
To:	Ivo van Doorn <ivdoorn@...il.com>
Cc:	John Linville <linville@...driver.com>,
	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
	Larry Finger <Larry.Finger@...inger.net>
Subject: Re: [PATCH] rfkill: clarify usage of rfkill_force_state() and
	rfkill->get_state()

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@....eng.br>
> > Cc: Ivo van Doorn <IvDoorn@...il.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.

> 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".

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?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ