Re: [RESEND PATCH 1/3] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-06-13 Thread João Paulo Rechi Vita
On 13 June 2016 at 17:01, Pavel Machek wrote: > On Mon 2016-06-13 15:59:35, João Paulo Rechi Vita wrote: >> On 13 June 2016 at 15:00, Pavel Machek wrote: >> > Hi! >> > >> >> > João, that means you should send a patch to add the ::rfkill suffix. &g

Re: [RESEND PATCH 1/3] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-06-13 Thread João Paulo Rechi Vita
s/class/rfkill > /sys/module/rfkill > If we use "rfkill" as a suffix, how do you expect userspace to be able to differentiate between a LED that indicates airplane-mode (LED ON when all radios are OFF) and a LED that indicates the state of a specific radio like WiFi or Bluetooth (L

Re: [RESEND PATCH 1/3] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-06-13 Thread João Paulo Rechi Vita
his is now contained in the platform-drivers-x86 subsystem. Thanks Johannes for your patience and help designing and reviewing the rfkill changes, even if not all of them made it through in the end. And thanks everyone else involved for the feedback. Best regards, -- João Paulo Rechi Vita http://about

[RESEND PATCH 2/3] rfkill: Userspace control for airplane mode

2016-05-02 Thread João Paulo Rechi Vita
From: João Paulo Rechi Vita Provide an interface for the airplane-mode indicator be controlled from userspace. User has to first acquire the control through RFKILL_OP_AIRPLANE_MODE_INDICATOR_ACQUIRE and keep the fd open for the whole time it wants to be in control of the indicator. Closing the

[RESEND PATCH 3/3] rfkill: Notify userspace of airplane-mode state changes

2016-05-02 Thread João Paulo Rechi Vita
From: João Paulo Rechi Vita Signed-off-by: João Paulo Rechi Vita --- Documentation/rfkill.txt| 3 +++ include/uapi/linux/rfkill.h | 4 ++-- net/rfkill/core.c | 13 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/rfkill.txt b

[RESEND PATCH 1/3] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-05-02 Thread João Paulo Rechi Vita
From: João Paulo Rechi Vita This creates a new LED trigger to be used by platform drivers as a default trigger for airplane-mode indicator LEDs. By default this trigger will fire when RFKILL_OP_CHANGE_ALL is called for all types (RFKILL_TYPE_ALL), setting the LED brightness to LED_FULL when the

[RESEND PATCH 0/3] RFKill airplane-mode indicator

2016-05-02 Thread João Paulo Rechi Vita
k 577/1880 PASS rfkill_wpa2_psk 0.330014 2016-04-29 12:48:59.016711 João Paulo Rechi Vita (3): rfkill: Create "rfkill-airplane-mode" LED trigger rfkill: Userspace control for airplane mode rfkill: Notify userspace of airplane-mode state changes Documentation/rfkill.txt| 15 +++ in

Re: [PATCHv2 08/10] rfkill: Use switch to demux userspace operations

2016-03-08 Thread João Paulo Rechi Vita
Hello Johannes, On 1 March 2016 at 11:15, João Paulo Rechi Vita wrote: > On 1 March 2016 at 08:43, Johannes Berg wrote: >> >> I'm fine with Jouni's change, preserving the original behaviour of >> requiring TYPE_ALL or the correct type, but I'm tempted to simp

Re: [PATCHv2 08/10] rfkill: Use switch to demux userspace operations

2016-03-01 Thread João Paulo Rechi Vita
ANGE) > continue; > > to ignore the type entirely. > > I'm fine with Jouni's change, preserving the original behaviour of > requiring TYPE_ALL or the correct type, but I'm tempted to simply > remove the type check entirely. > > Thought

Re: [PATCHv2 08/10] rfkill: Use switch to demux userspace operations

2016-02-29 Thread João Paulo Rechi Vita
Hello Jouni, On 26 February 2016 at 12:59, Jouni Malinen wrote: > On Mon, Feb 22, 2016 at 11:36:39AM -0500, João Paulo Rechi Vita wrote: >> Using a switch to handle different ev.op values in rfkill_fop_write() >> makes the code easier to extend, as out-of-range values can always b

Re: [PATCHv2 00/10] RFKill airplane-mode indicator

2016-02-22 Thread João Paulo Rechi Vita
On 22 February 2016 at 12:00, Dan Williams wrote: > On Mon, 2016-02-22 at 11:36 -0500, João Paulo Rechi Vita wrote: >> This series implements an airplane-mode indicator LED trigger, which >> can be >> used by platform drivers. The default policy have have airplane-mode &

[PATCHv3] rfkill: Userspace control for airplane mode

2016-02-22 Thread João Paulo Rechi Vita
. To change state of the indicator, the RFKILL_OP_AIRPLANE_MODE_INDICATOR_CHANGE operation is used, passing the value on "struct rfkill_event.soft". If the caller has not acquired the airplane-mode control beforehand, the operation fails. Signed-off-by: João Paulo Rechi Vita --- Doc

[PATCHv2 05/10] rfkill: Factor rfkill_global_states[].cur assignments

2016-02-22 Thread João Paulo Rechi Vita
Factor all assignments to rfkill_global_states[].cur into a single function rfkill_update_global_state(). Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/net/rfkill/core.c b

[PATCHv2 04/10] rfkill: Move "state" sysfs file back to stable

2016-02-22 Thread João Paulo Rechi Vita
There is still quite a bit of code using this interface, so we can't just remove it. Hopefully it will be possible in the future, but since its scheduled removal date is past 2 years already, we are better having the documentation reflecting the current state of things. Signed-off-by: João

[PATCHv2 06/10] rfkill: Add documentation about LED triggers

2016-02-22 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- Documentation/rfkill.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 2ee6ef9..1f0c270 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt @@ -83,6 +83,8 @@ rfkill drivers

[PATCHv2 02/10] rfkill: Remove extra blank line

2016-02-22 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index ffbc375..56d79cb 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -455,7 +455,6 @@ bool rfkill_get_global_sw_state(const enum

[PATCHv2 08/10] rfkill: Use switch to demux userspace operations

2016-02-22 Thread João Paulo Rechi Vita
Using a switch to handle different ev.op values in rfkill_fop_write() makes the code easier to extend, as out-of-range values can always be handled by the default case. Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 32 ++-- 1 file changed, 18

[PATCHv2 03/10] rfkill: Point to the correct deprecated doc location

2016-02-22 Thread João Paulo Rechi Vita
The "claim" sysfs interface has been removed, so its documentation now lives in the "removed" folder. Signed-off-by: João Paulo Rechi Vita --- Documentation/ABI/stable/sysfs-class-rfkill | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentat

[PATCHv2 09/10] rfkill: Userspace control for airplane mode

2016-02-22 Thread João Paulo Rechi Vita
RFKILL_OP_AIRPLANE_MODE_RELEASE restores the default policy. To change state of the indicator, the RFKILL_OP_AIRPLANE_MODE_CHANGE operation is used, passing the value on "struct rfkill_event.soft". If the caller has not acquired the airplane-mode control beforehand, the operation fails. Signed-off-by: João Paulo

[PATCHv2 07/10] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-02-22 Thread João Paulo Rechi Vita
, and to LED_OFF when the changing the state to unblocked. In the future there will be a mechanism for userspace to override the default policy, so it can implement its own. This trigger will be used by the asus-wireless x86 platform driver. Signed-off-by: João Paulo Rechi Vita --- Documentation

[PATCHv2 10/10] rfkill: Notify userspace of airplane-mode state changes

2016-02-22 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- Documentation/rfkill.txt| 3 +++ include/uapi/linux/rfkill.h | 4 ++-- net/rfkill/core.c | 13 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 9dbe3fc

[PATCHv2 01/10] rfkill: Improve documentation language

2016-02-22 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index a805831..ffbc375 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -282,8 +282,8 @@ static void rfkill_set_block

[PATCHv2 00/10] RFKill airplane-mode indicator

2016-02-22 Thread João Paulo Rechi Vita
. Additionally, I have a couple of patches to have this feature supported by the userspace tool 'rfkill' [1]. Should I use a different subject prefix to help separate those from kernel patches in linux-wireless? [1] https://wireless.wiki.kernel.org/en/users/documentation/rfkill João Paulo

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-22 Thread João Paulo Rechi Vita
On 18 February 2016 at 15:12, Johannes Berg wrote: > Hi, > > Sorry for the delay reviewing this. > No problems! > > On Mon, 2016-02-08 at 10:41 -0500, João Paulo Rechi Vita wrote: >> Provide an interface for the airplane-mode indicator be controlled >> from &

Re: [PATCH 7/9] rfkill: Create "rfkill-airplane_mode" LED trigger

2016-02-22 Thread João Paulo Rechi Vita
On 18 February 2016 at 15:08, Johannes Berg wrote: > On Mon, 2016-02-08 at 10:41 -0500, João Paulo Rechi Vita wrote: >> This creates a new LED trigger to be used by platform drivers as a >> default trigger for airplane-mode indicator LEDs. >> >> By default

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-16 Thread João Paulo Rechi Vita
s not extend the RFKill event struct. One alternative would be to move the control point to a separate device, like /dev/rfkill-airplane-mode, but I'm not sure this is a very elegant approach. Anyway, I'm open to work on changes to the API, but it would be great if you could at least

[PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-09 Thread João Paulo Rechi Vita
RFKILL_OP_AIRPLANE_MODE_RELEASE restores the default policy. To change state of the indicator, the RFKILL_OP_AIRPLANE_MODE_CHANGE operation is used, passing the value on "struct rfkill_event.soft". If the caller has not acquired the airplane-mode control beforehand, the operation fails. Signed-off-by: João Paulo

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-09 Thread João Paulo Rechi Vita
separate function? > Yes, makes sense. This also made me notice I was assigning a negative value to a size_t variable (count). >> + } >> + >> list_del(&data->list); >> + > > (extra line) > After factoring out the _RELEASE code it looks be

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-08 Thread João Paulo Rechi Vita
On 8 February 2016 at 11:11, Dan Williams wrote: > On Mon, 2016-02-08 at 10:41 -0500, João Paulo Rechi Vita wrote: >> Provide an interface for the airplane-mode indicator be controlled >> from >> userspace. User has to first acquire the control through >> RFKILL_OP_AIR

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-08 Thread João Paulo Rechi Vita
ge from Johannes http://www.spinics.net/lists/linux-wireless/msg146069.html and let me know if that covers your concern. Thanks! -- João Paulo Rechi Vita http://about.me/jprvita -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/9] rfkill: Remove extra blank line

2016-02-08 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index ffbc375..56d79cb 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -455,7 +455,6 @@ bool rfkill_get_global_sw_state(const enum

[PATCH 4/9] rfkill: Move "state" sysfs file back to stable

2016-02-08 Thread João Paulo Rechi Vita
There is still quite a bit of code using this interface, so we can't just remove it. Hopefully it will be possible in the future, but since its scheduled removal date is past 2 years already, we are better having the documentation reflecting the current state of things. Signed-off-by: João

[PATCH 3/9] rfkill: Point to the correct deprecated doc location

2016-02-08 Thread João Paulo Rechi Vita
The "claim" sysfs interface has been removed, so its documentation now lives in the "removed" folder. Signed-off-by: João Paulo Rechi Vita --- Documentation/ABI/stable/sysfs-class-rfkill | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentat

[PATCH 1/9] rfkill: Improve documentation language

2016-02-08 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index a805831..ffbc375 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -282,8 +282,8 @@ static void rfkill_set_block

[PATCH 5/9] rfkill: Factor rfkill_global_states[].cur assignments

2016-02-08 Thread João Paulo Rechi Vita
Factor all assignments to rfkill_global_states[].cur into a single function rfkill_update_global_state(). Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/net/rfkill/core.c b

[PATCH 6/9] rfkill: Add documentation about LED triggers

2016-02-08 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- Documentation/rfkill.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 2ee6ef9..1f0c270 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt @@ -83,6 +83,8 @@ rfkill drivers

[PATCH 7/9] rfkill: Create "rfkill-airplane_mode" LED trigger

2016-02-08 Thread João Paulo Rechi Vita
, and to LED_OFF when the changing the state to unblocked. In the future there will be a mechanism for userspace to override the default policy, so it can implement its own. This trigger will be used by the asus-wireless x86 platform driver. Signed-off-by: João Paulo Rechi Vita --- Documentation

[PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-08 Thread João Paulo Rechi Vita
RFKILL_OP_AIRPLANE_MODE_RELEASE restores the default policy. To change state of the indicator, the RFKILL_OP_AIRPLANE_MODE_CHANGE operation is used, passing the value on "struct rfkill_event.soft". If the caller has not acquired the airplane-mode control beforehand, the operation fails. Signed-off-by: João Paulo

[PATCH 9/9] rfkill: Notify userspace of airplane-mode state changes

2016-02-08 Thread João Paulo Rechi Vita
Signed-off-by: João Paulo Rechi Vita --- Documentation/rfkill.txt | 3 +++ net/rfkill/core.c| 13 + 2 files changed, 16 insertions(+) diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index aa6e014..5248812 100644 --- a/Documentation/rfkill.txt +++ b

[PATCH 0/9] RFKill airplane-mode indicator

2016-02-08 Thread João Paulo Rechi Vita
_AIRPLANE_MODE_ACQUIRE, _AIRPLANE_MODE_RELEASE, and _AIRPLANE_MODE_CHANGE. When the airplane-mode indicator state changes, userspace gets notifications through the RFKill control misc device (/dev/rfkill). The series also contains a few general fixes and improvements to the subsystem. João Paulo Rechi Vita (9