Skip to contentSkip to conversation

rfkill: core: add custom rfkill switch

PATCH Pavan Savoy 2 participants 3 messages Mar 26, 2010 – Jun 9, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 22 lines · Dmitry Torokhov

From: Dmitry Torokhov <[email protected]>
Subject: Re: [PATCH] rfkill: core: add custom rfkill switch
To: "Johannes Berg" <[email protected]>
Cc: "Pavan Savoy" <[email protected]>
Date: Friday, 26 March, 2010, 12:28 PM

Quoted 1 line · Johannes Berg

On Thu, 2010-03-25 at 23:23 -0700, Dmitry Torokhov

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines

I do have an actual driver it's just that

all 3 cores are controlled

Quoted 1 line
Quoted 1 line
Quoted 1 line

by 1 chip_enable and individual cores are

powered up down by s/w

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

commands.

Hmm, so the main portion of the driver needs to

count the number of

Quoted 1 line
Quoted 1 line

active users across rfkill interfaces

before powering down the chip. I

Quoted 1 line
Quoted 1 line

do not quite understand what the issue is

Quoted 11 lines

here...

Quoted 2 lines

He also wants to (ab)use rfkill to signal to userspace

what the value of

Quoted 2 lines

that counter is ...

Well, this one is easy - just say 'No' ;)

Signature · 1 line
Dmitry

Well, Almost, I don't want to signal the user-space about the counter. Have a look @ http://lkml.org/lkml/2010/3/24/303

See the kernel space (bluetooth driver) would register itself, to my line discipline driver, when someone does a 'hciconfig hci0 up' which is essentially BT-On.

So, now from my ldisc driver (which intends to mux BT/FM and GPS over UART), I need to signal a user-space daemon to open the TTY device, set the baud rate and install the ldisc - So I can make use of it.

To notify that user-space daemon, I had planned to use /dev/rfkill.
However, now with BT application also toggling the rfkill switch by writing to sysfs entry - is causing a bit of confusion to my user-space daemon.

Although I now use hard/soft members of struct rfkill_event now to differentiate the 2 events (1 auto generated, another from BT app) - This patch would make it a bit more proper.

The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

#2 lore raw
Quoted 11 lines · Pavan Savoy

Well, Almost, I don't want to signal the user-space about the counter. Have a look @ http://lkml.org/lkml/2010/3/24/303

See the kernel space (bluetooth driver) would register itself, to my line discipline driver, when someone does a 'hciconfig hci0 up' which is essentially BT-On.

So, now from my ldisc driver (which intends to mux BT/FM and GPS over UART), I need to signal a user-space daemon to open the TTY device, set the baud rate and install the ldisc - So I can make use of it.

To notify that user-space daemon, I had planned to use /dev/rfkill.
However, now with BT application also toggling the rfkill switch by writing to sysfs entry - is causing a bit of confusion to my user-space daemon.

Although I now use hard/soft members of struct rfkill_event now to differentiate the 2 events (1 auto generated, another from BT app) - This patch would make it a bit more proper.

No. The proper way would be to either have your driver manage the UART instead of userspace, or have your driver have its own userspace interface. rfkill has nothing to do with it.

johannes

#3 lore raw

rfkill switch state during suspend?

In reply to a message not in the archive

Hi,

I remember in 2.6.29, the rfkill switch state during suspend was set to SOFT_BLOCKED by calling the toggle_radio of rfkill drivers.

What happens now ? 2.6.32+ ... ?

This previously posed a problems to drivers which mapped their chip enable GPIOs to the rfkill entries, because on suspend, the gpio was pulled low because of the SOFT_BLOCKED state.

A couple of lines regarding same in Documentation/rfkill.txt would be ideal too.

Thanks in advance.
Pavan Savoy.

Quoted 34 lines · Dmitry Torokhov

From: Dmitry Torokhov <[email protected]>
Subject: Re: [PATCH] rfkill: core: add custom rfkill switch
To: "Johannes Berg" <[email protected]>
Cc: "Pavan Savoy" <[email protected]>
Date: Friday, 26 March, 2010, 12:28 PM

Quoted 1 line · Johannes Berg

On Thu, 2010-03-25 at 23:23 -0700, Dmitry Torokhov

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines

I do have an actual driver it's just that

all 3 cores are controlled

Quoted 1 line
Quoted 1 line
Quoted 1 line

by 1 chip_enable and individual cores are

powered up down by s/w

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

commands.

Hmm, so the main portion of the driver needs to

count the number of

Quoted 1 line
Quoted 1 line

active users across rfkill interfaces

before powering down the chip. I

Quoted 1 line
Quoted 1 line

do not quite understand what the issue is

here...

Quoted 2 lines

He also wants to (ab)use rfkill to signal to userspace

what the value of

Quoted 2 lines

that counter is ...

Well, this one is easy - just say 'No' ;)

Signature · 1 line
Dmitry