RE: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-21 Thread Peer, Ilan
Hi Luis,

Can you please have a look at version 5 of the patch? I think that I addressed 
some concerns there.
Regardless, I'll send another version that clarifies the optimization in the 
commit message.

Thanks again,

Ilan.

> -Original Message-
> From: Luis R. Rodriguez [mailto:mcg...@suse.com]
> Sent: Friday, February 20, 2015 02:54
> To: Peer, Ilan
> Cc: linux-wirel...@vger.kernel.org; ArikX Nemtsov; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor
> regulatory setting
> 
> Wider community:
> 
> anyone aware of any *need* in the kernel to know whether one is indoor or
> not on a device running Linux other than wifi? Clearly it should be something
> that might be of interest to at least other RF devices, so that is at least 
> one
> possibilty to consider already, but what else?
> 
> On Sun, Feb 15, 2015 at 12:26:04PM +, Peer, Ilan wrote:
> > Hi Luis,
> >
> > > >
> > > > This differs from the country setting that would potentially
> > > > require user space interaction and might invoke more complex
> > > > flows. The flow in this case is immediate, and does not require
> > > > the somewhat complex handling of country settings (it even
> > > > complicates the flow unnecessarily, with the
> REG_REQ_USER_HINT_HANDLED etc.).
> > >
> > > There's two things you should address then:
> > >
> > >   0) Try to mitigate the issue with the old userspace API if possible.
> > >  This will enable old userspace to continue to work with the
> > >  old API but also mitigate the issue you have described for which
> > >  you are providing a new optimized solution for but that requires
> > >  a new API.
> > >
> >
> > Not sure I have a good solution for this. The problem here is that
> > with the current API, the indoor setting will stick as long as a
> > station interface is connected, although the indoor setting might no
> > longer be true. For example when a station interface is connected to
> > P2P GO (or a soft AP) and both devices are moving out of the indoor
> > environment. The motivation for this patch was to move the full control of
> this setting to user space.
> >
> > Any suggestion are welcomed.
> 
> Why not just clear it upon disconnect for the old case? It seems that would be
> better if that is better regulatory wise.
> 

Yep. This is what I did in version 5. Did you get a chance to look at it?

> >
> > >   1) With the new API have userspace be able to send to the kernel that
> > >  userspace will do socket monitoring and because of this and the
> > >  reasons you mentioned it will have more control over the environment
> > >  boolean.
> > >
> >
> > Ok. Will add such an API.
> 
> Great.
> 
> > > > > > 2. Track the socket on which the indoor hint is issued, and reset
> > > > > >indoor setting if the socket was released. The motivation here 
> > > > > > is to
> > > > > >force a user space process that sets the indoor setting to
> constantly
> > > > > >monitor this setting, and be responsible to correctly toggling 
> > > > > > it,
> > > > > >so indoor operation will not be enabled uncontrolled.
> > > > >
> > > > > That seems to imply a new requirement for something that used to
> > > > > work, what having an option to set this requirement?
> > > >
> > > > (Sadly) I would not consider the previous implementation as
> > > > working as it would leave the regulatory core in a state that it
> > > > considers to be indoor although it is no longer true.
> > >
> > > Let's review the current implementation for indoor thing.
> > >
> > > We assume we're not indoor unless userspace sends a
> > > regulatory_hint_indoor_user(), this is with the user reg hint type
> > > set to NL80211_USER_REG_HINT_INDOOR.
> > > For country IEs we never trust the country IE data since it may
> > > contain bogus data, but we also end up ignoring the environment aspect
> too.
> > >
> > > If we disconnect we should be reseting the indoor setting to false.
> > > I just checked and restore_regulatory_settings() does set
> > > reg_is_indoor = false so if we are keeping the indoor setting I am
> > > missing something here, and it does indeed rather an issue that
> > > should be fixed. Where is the indoor setting being up

Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-20 Thread Luis R. Rodriguez
On Fri, Feb 20, 2015 at 7:02 AM, Jonathan Bither  wrote:
> On 02/19/2015 08:03 PM, valdis.kletni...@vt.edu wrote:
>>
>> On Fri, 20 Feb 2015 01:53:44 +0100, "Luis R. Rodriguez" said:
>>>
>>> Wider community:
>>>
>>> anyone aware of any *need* in the kernel to know whether one is indoor or
>>> not on a device running Linux other than wifi? Clearly it should be
>>> something
>>> that might be of interest to at least other RF devices, so that is at
>>> least
>>> one possibilty to consider already, but what else?
>>
>>
>> I can think of a lot of reasons for the kernel to make indoor/outdoor
>> status available to userspace, but am coming up empty why the kernel
>> itself
>> should care
>>
> That made me try to think of the possible uses for such a variable but I
> imagine that they can all be handled by userspace as well.
> Powering down GPS chips for energy consumption.
> Applying filters to cameras for fluorescent lights.

These days such devices are bundled with all these devices typically
aiming towards single-chip, ie one devices with multiple functions and
sharing as much as possible, as such it should be possible
architecturally to share this. So far then it seems this can just live
under its hood under cfg80211 then.

 Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-20 Thread Jonathan Bither



On 02/19/2015 08:03 PM, valdis.kletni...@vt.edu wrote:

On Fri, 20 Feb 2015 01:53:44 +0100, "Luis R. Rodriguez" said:

Wider community:

anyone aware of any *need* in the kernel to know whether one is indoor or
not on a device running Linux other than wifi? Clearly it should be something
that might be of interest to at least other RF devices, so that is at least
one possibilty to consider already, but what else?


I can think of a lot of reasons for the kernel to make indoor/outdoor
status available to userspace, but am coming up empty why the kernel itself
should care

That made me try to think of the possible uses for such a variable but I 
imagine that they can all be handled by userspace as well.

Powering down GPS chips for energy consumption.
Applying filters to cameras for fluorescent lights.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-19 Thread Luis R. Rodriguez
On Thu, Feb 19, 2015 at 5:03 PM,   wrote:
> On Fri, 20 Feb 2015 01:53:44 +0100, "Luis R. Rodriguez" said:
>> Wider community:
>>
>> anyone aware of any *need* in the kernel to know whether one is indoor or
>> not on a device running Linux other than wifi? Clearly it should be something
>> that might be of interest to at least other RF devices, so that is at least
>> one possibilty to consider already, but what else?
>
> I can think of a lot of reasons for the kernel to make indoor/outdoor
> status available to userspace, but am coming up empty why the kernel itself
> should care

Some devices enable regulatory control through the kernel, in such
cases the wireless-regdb is used and there is an INDOOR flag that
enables / disables specific functionality.

 Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-19 Thread Valdis . Kletnieks
On Fri, 20 Feb 2015 01:53:44 +0100, "Luis R. Rodriguez" said:
> Wider community:
>
> anyone aware of any *need* in the kernel to know whether one is indoor or
> not on a device running Linux other than wifi? Clearly it should be something
> that might be of interest to at least other RF devices, so that is at least
> one possibilty to consider already, but what else?

I can think of a lot of reasons for the kernel to make indoor/outdoor
status available to userspace, but am coming up empty why the kernel itself
should care


pgpcNlUSzNEt1.pgp
Description: PGP signature


Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-19 Thread Luis R. Rodriguez
Wider community:

anyone aware of any *need* in the kernel to know whether one is indoor or
not on a device running Linux other than wifi? Clearly it should be something
that might be of interest to at least other RF devices, so that is at least
one possibilty to consider already, but what else?

On Sun, Feb 15, 2015 at 12:26:04PM +, Peer, Ilan wrote:
> Hi Luis,
> 
> > >
> > > This differs from the country setting that would potentially require
> > > user space interaction and might invoke more complex flows. The flow
> > > in this case is immediate, and does not require the somewhat complex
> > > handling of country settings (it even complicates the flow
> > > unnecessarily, with the REG_REQ_USER_HINT_HANDLED etc.).
> > 
> > There's two things you should address then:
> > 
> >   0) Try to mitigate the issue with the old userspace API if possible.
> >  This will enable old userspace to continue to work with the
> >  old API but also mitigate the issue you have described for which
> >  you are providing a new optimized solution for but that requires
> >  a new API.
> > 
> 
> Not sure I have a good solution for this. The problem here is that with the
> current API, the indoor setting will stick as long as a station interface is
> connected, although the indoor setting might no longer be true. For example
> when a station interface is connected to P2P GO (or a soft AP) and both
> devices are moving out of the indoor environment. The motivation for this
> patch was to move the full control of this setting to user space.
>
> Any suggestion are welcomed.

Why not just clear it upon disconnect for the old case? It seems that would
be better if that is better regulatory wise.

> 
> >   1) With the new API have userspace be able to send to the kernel that
> >  userspace will do socket monitoring and because of this and the
> >  reasons you mentioned it will have more control over the environment
> >  boolean.
> > 
> 
> Ok. Will add such an API.

Great.

> > > > > 2. Track the socket on which the indoor hint is issued, and reset
> > > > >indoor setting if the socket was released. The motivation here is 
> > > > > to
> > > > >force a user space process that sets the indoor setting to 
> > > > > constantly
> > > > >monitor this setting, and be responsible to correctly toggling it,
> > > > >so indoor operation will not be enabled uncontrolled.
> > > >
> > > > That seems to imply a new requirement for something that used to
> > > > work, what having an option to set this requirement?
> > >
> > > (Sadly) I would not consider the previous implementation as working as
> > > it would leave the regulatory core in a state that it considers to be
> > > indoor although it is no longer true.
> > 
> > Let's review the current implementation for indoor thing.
> > 
> > We assume we're not indoor unless userspace sends a
> > regulatory_hint_indoor_user(), this is with the user reg hint type set to
> > NL80211_USER_REG_HINT_INDOOR.
> > For country IEs we never trust the country IE data since it may contain 
> > bogus
> > data, but we also end up ignoring the environment aspect too.
> > 
> > If we disconnect we should be reseting the indoor setting to false.
> > I just checked and restore_regulatory_settings() does set reg_is_indoor =
> > false so if we are keeping the indoor setting I am missing something here, 
> > and
> > it does indeed rather an issue that should be fixed. Where is the indoor
> > setting being upkept?
> > 
> 
> This is generally true, but is not fully compatible with moving APs/P2P GOs,
> where you can be indoor, connect to an AP/P2P GO, and then move out of the
> indoor environment, while connected. Point is the being connected does not
> guarantee that the indoor setting is kept. 

Ah so then the above description does satisfy the concern you stated.
What you are describing *now* is a dynamic environment new requirement.

That's a very different picture than what you originally stated and
your commit message does not clarify what worked and what really are
the issue well. As it stands your changes will be an ammendment to
help with dynamic environment setting, and it will also enable environment
options to remain post disconnect.

> > > > > 3. Do not reset the indoor setting when restoring the regulatory
> > > > >settings as it has nothing to do with CRDA or interface
> > > > >disconnection.
> > > >
> > > > I disagree, if we disconnect we want the more restrictive setting
> > > > and if we put the indoor setting out of general regulatory requests
> > > > then we do want to reset this no?
> > > >
> > >
> > > I do not think so. This setting is in the responsibility of the user
> > > space daemon, so it should be the one controlling it.
> > 
> > Right now the API requires sending the userspace regulatory hint and the
> > kenrel should indeed reset to non-indoor upon disconnect, the later is an
> > issue which should be fixed and what you introduce seems rather