diff mbox

rfkill: Copy "all" global state to other types

Message ID 1440507403-9695-1-git-send-email-jprvita@endlessm.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

João Paulo Rechi Vita Aug. 25, 2015, 12:56 p.m. UTC
When switching the state of all RFKill switches of type all we need to
replicate the RFKILL_TYPE_ALL global state to all the other types global
state, so it is used to initialize persistent RFKill switches on
register.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
 net/rfkill/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Marcel Holtmann Aug. 25, 2015, 4:13 p.m. UTC | #1
Hi Joao Paulo,

> When switching the state of all RFKill switches of type all we need to
> replicate the RFKILL_TYPE_ALL global state to all the other types global
> state, so it is used to initialize persistent RFKill switches on
> register.
> 
> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
> ---
> net/rfkill/core.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
João Paulo Rechi Vita Sept. 1, 2015, 8:25 p.m. UTC | #2
Hello Johannes,

On 25 August 2015 at 12:13, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Joao Paulo,
>
>> When switching the state of all RFKill switches of type all we need to
>> replicate the RFKILL_TYPE_ALL global state to all the other types global
>> state, so it is used to initialize persistent RFKill switches on
>> register.
>>
>> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
>> ---
>> net/rfkill/core.c | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
>

Any feedback or any plans to pick this for mac80211-next (which I
understand is where it should go to be sent upstream)?

Thanks,

--
João Paulo Rechi Vita
http://about.me/jprvita
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marcel Holtmann Sept. 2, 2015, 5:42 p.m. UTC | #3
Hi Joao,

>>> When switching the state of all RFKill switches of type all we need to
>>> replicate the RFKILL_TYPE_ALL global state to all the other types global
>>> state, so it is used to initialize persistent RFKill switches on
>>> register.
>>> 
>>> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
>>> ---
>>> net/rfkill/core.c | 9 ++++++++-
>>> 1 file changed, 8 insertions(+), 1 deletion(-)
>> 
>> Acked-by: Marcel Holtmann <marcel@holtmann.org>
>> 
> 
> Any feedback or any plans to pick this for mac80211-next (which I
> understand is where it should go to be sent upstream)?

I can take this through bluetooth-next tree if there are no objections.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Sept. 2, 2015, 6:28 p.m. UTC | #4
On Wed, 2015-09-02 at 10:42 -0700, Marcel Holtmann wrote:
> 
> > Any feedback or any plans to pick this for mac80211-next (which I
> > understand is where it should go to be sent upstream)?
> 
> I can take this through bluetooth-next tree if there are no 
> objections.
> 

I'm going to to take it, but we're in the middle of release/merge
-window time, so there was no point in doing that just yet.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
João Paulo Rechi Vita Sept. 2, 2015, 6:35 p.m. UTC | #5
On 2 September 2015 at 14:28, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Wed, 2015-09-02 at 10:42 -0700, Marcel Holtmann wrote:
>>
>> > Any feedback or any plans to pick this for mac80211-next (which I
>> > understand is where it should go to be sent upstream)?
>>
>> I can take this through bluetooth-next tree if there are no
>> objections.
>>
>
> I'm going to to take it, but we're in the middle of release/merge
> -window time, so there was no point in doing that just yet.
>

All right, thanks for the feedback!

--
João Paulo Rechi Vita
http://about.me/jprvita
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Sept. 4, 2015, 12:28 p.m. UTC | #6
On Tue, 2015-08-25 at 08:56 -0400, João Paulo Rechi Vita wrote:
> When switching the state of all RFKill switches of type all we need 
> to
> replicate the RFKILL_TYPE_ALL global state to all the other types 
> global
> state, so it is used to initialize persistent RFKill switches on
> register.
> 
Applied.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index f12149a..2c1284a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -341,7 +341,14 @@  static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
 {
 	struct rfkill *rfkill;
 
-	rfkill_global_states[type].cur = blocked;
+	if (type == RFKILL_TYPE_ALL) {
+		int i;
+		for (i = 0; i < NUM_RFKILL_TYPES; i++)
+			rfkill_global_states[i].cur = blocked;
+	} else {
+		rfkill_global_states[type].cur = blocked;
+	}
+
 	list_for_each_entry(rfkill, &rfkill_list, node) {
 		if (rfkill->type != type && type != RFKILL_TYPE_ALL)
 			continue;