<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/rfkill/rfkill.c, branch v2.6.27.47</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>rfkill: update LEDs for all state changes</title>
<updated>2008-10-18T17:49:12+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-10-11T16:55:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95a3690291668508570c593ccc8b69af1f0e3f3f'/>
<id>95a3690291668508570c593ccc8b69af1f0e3f3f</id>
<content type='text'>
commit 417bd25ac4c6f76c8aafe8a584f3620f4a936b72 upstream

The LED state was not being updated by rfkill_force_state(), which
will cause regressions in wireless drivers that had old-style rfkill
support and are updated to use rfkill_force_state().

The LED state was not being updated when a change was detected through
the rfkill-&gt;get_state() hook, either.

Move the LED trigger update calls into notify_rfkill_state_change(),
where it should have been in the first place.  This takes care of both
issues above.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 417bd25ac4c6f76c8aafe8a584f3620f4a936b72 upstream

The LED state was not being updated by rfkill_force_state(), which
will cause regressions in wireless drivers that had old-style rfkill
support and are updated to use rfkill_force_state().

The LED state was not being updated when a change was detected through
the rfkill-&gt;get_state() hook, either.

Move the LED trigger update calls into notify_rfkill_state_change(),
where it should have been in the first place.  This takes care of both
issues above.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>net: rfkill: add missing line break</title>
<updated>2008-08-27T00:06:31+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@nokia.com</email>
</author>
<published>2008-08-18T19:56:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=988b02f1bf5b608ef91a9d98c7170d037d0f12e3'/>
<id>988b02f1bf5b608ef91a9d98c7170d037d0f12e3</id>
<content type='text'>
Trivial patch adding a missing line break on
rfkill_claim_show().

Signed-off-by: Felipe Balbi &lt;felipe.balbi@nokia.com&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.co&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trivial patch adding a missing line break on
rfkill_claim_show().

Signed-off-by: Felipe Balbi &lt;felipe.balbi@nokia.com&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.co&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: protect suspended rfkill controllers</title>
<updated>2008-08-18T15:05:12+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-08-02T17:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e10e0dfe3ba358cfb442cc3bf0d3f2068785bf5c'/>
<id>e10e0dfe3ba358cfb442cc3bf0d3f2068785bf5c</id>
<content type='text'>
Guard rfkill controllers attached to a rfkill class against state changes
after class suspend has been issued.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guard rfkill controllers attached to a rfkill class against state changes
after class suspend has been issued.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RFKILL: set the status of the leds on activation.</title>
<updated>2008-08-01T19:31:33+00:00</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dbaryshkov@gmail.com</email>
</author>
<published>2008-07-22T10:21:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=96185664f10e79d038c084305d3cacff9b52204f'/>
<id>96185664f10e79d038c084305d3cacff9b52204f</id>
<content type='text'>
Provide default activate function to set the state of the led
when the led becomes bound to the trigger

Signed-off-by: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Acked-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide default activate function to set the state of the led
when the led becomes bound to the trigger

Signed-off-by: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Acked-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RFKILL: allow one to specify led trigger name</title>
<updated>2008-08-01T19:31:33+00:00</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dbaryshkov@gmail.com</email>
</author>
<published>2008-07-22T10:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c4f4578fc85d42d149f86b47f76c28626a20d92'/>
<id>7c4f4578fc85d42d149f86b47f76c28626a20d92</id>
<content type='text'>
Allow the rfkill driver to specify led trigger name.
By default it still defaults to the name of rfkill switch.

Signed-off-by: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Acked-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow the rfkill driver to specify led trigger name.
By default it still defaults to the name of rfkill switch.

Signed-off-by: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Acked-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: yet more minor kernel-doc fixes</title>
<updated>2008-07-29T20:55:03+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-07-22T00:18:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=435307a365ceedc4f4e1813e405f583f434d98e4'/>
<id>435307a365ceedc4f4e1813e405f583f434d98e4</id>
<content type='text'>
For some stupid reason, I sent and old version of the patch minor kernel
doc-fix patch, and it got merged before I noticed the problem. This is an
incremental fix on top.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some stupid reason, I sent and old version of the patch minor kernel
doc-fix patch, and it got merged before I noticed the problem. This is an
incremental fix on top.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: mutex fixes</title>
<updated>2008-07-29T20:36:35+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-07-22T00:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=064af1117b4aa64a0e52f6b741df7356ef055142'/>
<id>064af1117b4aa64a0e52f6b741df7356ef055142</id>
<content type='text'>
There are two mutexes in rfkill:

rfkill-&gt;mutex, which protects some of the fields of a rfkill struct, and is
also used for callback serialization.

rfkill_mutex, which protects the global state, the list of registered
rfkill structs and rfkill-&gt;claim.

Make sure to use the correct mutex, and to not miss locking rfkill-&gt;mutex
even when we already took rfkill_mutex.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two mutexes in rfkill:

rfkill-&gt;mutex, which protects some of the fields of a rfkill struct, and is
also used for callback serialization.

rfkill_mutex, which protects the global state, the list of registered
rfkill structs and rfkill-&gt;claim.

Make sure to use the correct mutex, and to not miss locking rfkill-&gt;mutex
even when we already took rfkill_mutex.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: fix led-trigger unregister order in error unwind</title>
<updated>2008-07-29T20:36:32+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-07-22T00:18:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37f55e9d78d1b63047b1b7ae175cdce650547ba8'/>
<id>37f55e9d78d1b63047b1b7ae175cdce650547ba8</id>
<content type='text'>
rfkill needs to unregister the led trigger AFTER a call to
rfkill_remove_switch(), otherwise it will not update the LED state,
possibly leaving it ON when it should be OFF.

To make led-trigger unregistering safer, guard against unregistering a
trigger twice, and also against issuing trigger events to a led trigger
that was unregistered.  This makes the error unwind paths more resilient.

Refer to "rfkill: Register LED triggers before registering switch".

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Cc: Michael Buesch &lt;mb@bu3sch.de&gt;
Cc: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rfkill needs to unregister the led trigger AFTER a call to
rfkill_remove_switch(), otherwise it will not update the LED state,
possibly leaving it ON when it should be OFF.

To make led-trigger unregistering safer, guard against unregistering a
trigger twice, and also against issuing trigger events to a led trigger
that was unregistered.  This makes the error unwind paths more resilient.

Refer to "rfkill: Register LED triggers before registering switch".

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Cc: Michael Buesch &lt;mb@bu3sch.de&gt;
Cc: Dmitry Baryshkov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: document rfkill_force_state as required (v2)</title>
<updated>2008-07-29T20:36:32+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-07-22T00:18:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2fd9b2212e25e6411b6f309707f4e2683d164250'/>
<id>2fd9b2212e25e6411b6f309707f4e2683d164250</id>
<content type='text'>
While the rfkill class does work with just get_state(), it doesn't work
well on devices that are subject to external events that cause rfkill state
changes.

Document that rfkill_force_state() is required in those cases.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the rfkill class does work with just get_state(), it doesn't work
well on devices that are subject to external events that cause rfkill state
changes.

Document that rfkill_force_state() is required in those cases.

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rfkill: ignore errors from rfkill_toggle_radio in rfkill_add_switch</title>
<updated>2008-07-08T18:16:03+00:00</updated>
<author>
<name>Henrique de Moraes Holschuh</name>
<email>hmh@hmh.eng.br</email>
</author>
<published>2008-07-03T16:14:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fd4484af7c02b31bcb6090eeb0d85cf947719f2d'/>
<id>fd4484af7c02b31bcb6090eeb0d85cf947719f2d</id>
<content type='text'>
rfkill_add_switch() calls rfkill_toggle_radio() to set the state of a
recently registered rfkill class to the current global state [for that
rfkill-&gt;type].

The rfkill_toggle_radio() call is going to error out if the hardware is
RFKILL_STATE_HARD_BLOCKED, and the global state is RFKILL_STATE_UNBLOCKED.

That is a quite normal situation which I missed to account for.  As things
stand, the error return from rfkill_toggle_radio ends up causing
rfkill_register to bail out with an error (de-registering the new switch in
the process), which is Not Nice.

Change rfkill_add_switch() to not return errors because of a failed call to
rfkill_toggle_radio().  We can go back to returning errors again (if that's
indeed the right thing to do) if we define the exact error codes the
rfkill-&gt;toggle_radio callbacks are to return in each situation, so that we
can ignore the right ones only.

Bug reported by "kionez &lt;kionez@anche.no&gt;".

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Cc: kionez &lt;kionez@anche.no&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rfkill_add_switch() calls rfkill_toggle_radio() to set the state of a
recently registered rfkill class to the current global state [for that
rfkill-&gt;type].

The rfkill_toggle_radio() call is going to error out if the hardware is
RFKILL_STATE_HARD_BLOCKED, and the global state is RFKILL_STATE_UNBLOCKED.

That is a quite normal situation which I missed to account for.  As things
stand, the error return from rfkill_toggle_radio ends up causing
rfkill_register to bail out with an error (de-registering the new switch in
the process), which is Not Nice.

Change rfkill_add_switch() to not return errors because of a failed call to
rfkill_toggle_radio().  We can go back to returning errors again (if that's
indeed the right thing to do) if we define the exact error codes the
rfkill-&gt;toggle_radio callbacks are to return in each situation, so that we
can ignore the right ones only.

Bug reported by "kionez &lt;kionez@anche.no&gt;".

Signed-off-by: Henrique de Moraes Holschuh &lt;hmh@hmh.eng.br&gt;
Cc: kionez &lt;kionez@anche.no&gt;
Acked-by: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
