Re: [PATCH] net-sysfs: Add entry for nl80211 interface type

2013-04-22 Thread Paul Stewart
On Mon, Apr 22, 2013 at 6:29 AM, Johannes Berg
 wrote:
>
> On Wed, 2013-04-17 at 15:14 -0700, Paul Stewart wrote:
> > I believe the documents for "iw" state explicitly that we shouldn't
> > screen-scrape it?
>
> Well, you specifically control your system. I'd also be happy to add
> some (maybe a bit hidden) commands to print out _just_ the (numeric)
> type, to aid scripting?


No need.  I already made the necessary changes in userspace to switch
to nl80211 to retrieve the iftype.  Both Bing and I are done
proselytizing at this point. :-)

>
> All I'm trying to say with that though is that
> you shouldn't rely on specific output formatting, particularly not with
> scan results and "iw list" etc.
>
> johannes
>
>
--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-22 Thread Johannes Berg
On Wed, 2013-04-17 at 15:14 -0700, Paul Stewart wrote:
> I believe the documents for "iw" state explicitly that we shouldn't
> screen-scrape it?

Well, you specifically control your system. I'd also be happy to add
some (maybe a bit hidden) commands to print out _just_ the (numeric)
type, to aid scripting? All I'm trying to say with that though is that
you shouldn't rely on specific output formatting, particularly not with
scan results and "iw list" etc.

johannes


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-22 Thread Johannes Berg
On Wed, 2013-04-17 at 15:14 -0700, Paul Stewart wrote:
 I believe the documents for iw state explicitly that we shouldn't
 screen-scrape it?

Well, you specifically control your system. I'd also be happy to add
some (maybe a bit hidden) commands to print out _just_ the (numeric)
type, to aid scripting? All I'm trying to say with that though is that
you shouldn't rely on specific output formatting, particularly not with
scan results and iw list etc.

johannes


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-22 Thread Paul Stewart
On Mon, Apr 22, 2013 at 6:29 AM, Johannes Berg
johan...@sipsolutions.net wrote:

 On Wed, 2013-04-17 at 15:14 -0700, Paul Stewart wrote:
  I believe the documents for iw state explicitly that we shouldn't
  screen-scrape it?

 Well, you specifically control your system. I'd also be happy to add
 some (maybe a bit hidden) commands to print out _just_ the (numeric)
 type, to aid scripting?


No need.  I already made the necessary changes in userspace to switch
to nl80211 to retrieve the iftype.  Both Bing and I are done
proselytizing at this point. :-)


 All I'm trying to say with that though is that
 you shouldn't rely on specific output formatting, particularly not with
 scan results and iw list etc.

 johannes


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Arend van Spriel

On 04/18/2013 09:10 PM, Marcel Holtmann wrote:

Hi Bing,


Add a "wireless/nl80211_iftype" entry in the net device sysfs
file structure to indicate the mode of the wireless device so
it can be discovered easily from userspace.


I do question a little bit the usefulness for this one.
It would only work on netdev and on wdev devices.


It's true. That's why the new sysfs entry is added in the 'wireless' 
placeholder.

/sys/class/net/ethX/wireless/

For non-wireless dev, this won't apply.


I have to correct myself. I meant it does NOT work for wdev. Please just go 
with nl80211 for this kind of information. It is the right way to handle it. 
Not some sysfs file.



I wanted to correct you on P2P but that would be diverging from the real 
message. Totally agreeing. Why add another user-space API when the 
nl80211 API can provide the information.


Gr. AvS


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Bing,

>>> Add a "wireless/nl80211_iftype" entry in the net device sysfs
>>> file structure to indicate the mode of the wireless device so
>>> it can be discovered easily from userspace.
>> 
>> I do question a little bit the usefulness for this one.
>> It would only work on netdev and on wdev devices.
> 
> It's true. That's why the new sysfs entry is added in the 'wireless' 
> placeholder.
> 
> /sys/class/net/ethX/wireless/
> 
> For non-wireless dev, this won't apply.

I have to correct myself. I meant it does NOT work for wdev. Please just go 
with nl80211 for this kind of information. It is the right way to handle it. 
Not some sysfs file.

Regards

Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Bing Zhao
Hi Marcel,

> Hi Bing,
> 
> > Add a "wireless/nl80211_iftype" entry in the net device sysfs
> > file structure to indicate the mode of the wireless device so
> > it can be discovered easily from userspace.
> 
> I do question a little bit the usefulness for this one.
> It would only work on netdev and on wdev devices.

It's true. That's why the new sysfs entry is added in the 'wireless' 
placeholder.

/sys/class/net/ethX/wireless/

For non-wireless dev, this won't apply.

Thanks,
Bing

> Using nl80211 to discover this information seems a lot better approach.
> 
> Regards
> 
> Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Paul,

> The original reason to request this change was simple: to figure out
> what type of interface we are looking at, since now some wireless
> drivers can simultaneously create managed, p2p and ap interfaces.
> Knowing that, from a simple front-end (let's even say a shell script)
> we can decide what arguments to use with wpa_supplicant (or indeed if
> we want to start it on this interface).  wpa_supplicant, of course,
> knows how to manipulate the device further using nl80211.  I thought
> it was a bit onerous to force userspace all the way through nl80211
> just to get this trivial piece of information, but apparently this
> doesn't seem to be the common point of view.

quite frankly this is a design issue with wpa_supplicant since it refuses to 
manage the wireless devices and interfaces. If you would have a real daemon 
that manages the wireless device via nl80211, then you would never ever have 
this problem. All the information are available via nl80211.

However my point is that you can not just base this around netdev exposed 
interfaces. The netdev interface might not even be present. Especially when 
talking about P2P you might not have a netdev in the first place. You only have 
a wdev.

Regards

Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Paul Stewart
The original reason to request this change was simple: to figure out
what type of interface we are looking at, since now some wireless
drivers can simultaneously create managed, p2p and ap interfaces.
Knowing that, from a simple front-end (let's even say a shell script)
we can decide what arguments to use with wpa_supplicant (or indeed if
we want to start it on this interface).  wpa_supplicant, of course,
knows how to manipulate the device further using nl80211.  I thought
it was a bit onerous to force userspace all the way through nl80211
just to get this trivial piece of information, but apparently this
doesn't seem to be the common point of view.

--
Paul

On Wed, Apr 17, 2013 at 11:43 PM, Marcel Holtmann  wrote:
> Hi Nicolas,
>
 Add a "wireless/nl80211_iftype" entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.
>>>
>>> What's wrong with "iw dev", i.e. netlink/nl80211?
>>
>> "Do NOT screenscrape this tool, we don't consider its output stable."
>>
>> So if you are in a shell script, you're basically screwed.
>
> if you are in a shell script, you are screwed no matter what. So what is your 
> point?
>
> Regards
>
> Marcel
>
>
--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Nicolas,

>>> Add a "wireless/nl80211_iftype" entry in the net device sysfs
>>> file structure to indicate the mode of the wireless device so
>>> it can be discovered easily from userspace.
>> 
>> What's wrong with "iw dev", i.e. netlink/nl80211?
> 
> "Do NOT screenscrape this tool, we don't consider its output stable."
> 
> So if you are in a shell script, you're basically screwed.

if you are in a shell script, you are screwed no matter what. So what is your 
point?

Regards

Marcel


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Nicolas Cavallari
On 18/04/2013 00:09, Johannes Berg wrote:
> On Wed, 2013-04-17 at 15:06 -0700, Bing Zhao wrote:
>> Add a "wireless/nl80211_iftype" entry in the net device sysfs
>> file structure to indicate the mode of the wireless device so
>> it can be discovered easily from userspace.
> 
> What's wrong with "iw dev", i.e. netlink/nl80211?

"Do NOT screenscrape this tool, we don't consider its output stable."

So if you are in a shell script, you're basically screwed.
--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Nicolas Cavallari
On 18/04/2013 00:09, Johannes Berg wrote:
 On Wed, 2013-04-17 at 15:06 -0700, Bing Zhao wrote:
 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.
 
 What's wrong with iw dev, i.e. netlink/nl80211?

Do NOT screenscrape this tool, we don't consider its output stable.

So if you are in a shell script, you're basically screwed.
--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Nicolas,

 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.
 
 What's wrong with iw dev, i.e. netlink/nl80211?
 
 Do NOT screenscrape this tool, we don't consider its output stable.
 
 So if you are in a shell script, you're basically screwed.

if you are in a shell script, you are screwed no matter what. So what is your 
point?

Regards

Marcel


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Paul Stewart
The original reason to request this change was simple: to figure out
what type of interface we are looking at, since now some wireless
drivers can simultaneously create managed, p2p and ap interfaces.
Knowing that, from a simple front-end (let's even say a shell script)
we can decide what arguments to use with wpa_supplicant (or indeed if
we want to start it on this interface).  wpa_supplicant, of course,
knows how to manipulate the device further using nl80211.  I thought
it was a bit onerous to force userspace all the way through nl80211
just to get this trivial piece of information, but apparently this
doesn't seem to be the common point of view.

--
Paul

On Wed, Apr 17, 2013 at 11:43 PM, Marcel Holtmann mar...@holtmann.org wrote:
 Hi Nicolas,

 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.

 What's wrong with iw dev, i.e. netlink/nl80211?

 Do NOT screenscrape this tool, we don't consider its output stable.

 So if you are in a shell script, you're basically screwed.

 if you are in a shell script, you are screwed no matter what. So what is your 
 point?

 Regards

 Marcel


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Paul,

 The original reason to request this change was simple: to figure out
 what type of interface we are looking at, since now some wireless
 drivers can simultaneously create managed, p2p and ap interfaces.
 Knowing that, from a simple front-end (let's even say a shell script)
 we can decide what arguments to use with wpa_supplicant (or indeed if
 we want to start it on this interface).  wpa_supplicant, of course,
 knows how to manipulate the device further using nl80211.  I thought
 it was a bit onerous to force userspace all the way through nl80211
 just to get this trivial piece of information, but apparently this
 doesn't seem to be the common point of view.

quite frankly this is a design issue with wpa_supplicant since it refuses to 
manage the wireless devices and interfaces. If you would have a real daemon 
that manages the wireless device via nl80211, then you would never ever have 
this problem. All the information are available via nl80211.

However my point is that you can not just base this around netdev exposed 
interfaces. The netdev interface might not even be present. Especially when 
talking about P2P you might not have a netdev in the first place. You only have 
a wdev.

Regards

Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Bing Zhao
Hi Marcel,

 Hi Bing,
 
  Add a wireless/nl80211_iftype entry in the net device sysfs
  file structure to indicate the mode of the wireless device so
  it can be discovered easily from userspace.
 
 I do question a little bit the usefulness for this one.
 It would only work on netdev and on wdev devices.

It's true. That's why the new sysfs entry is added in the 'wireless' 
placeholder.

/sys/class/net/ethX/wireless/

For non-wireless dev, this won't apply.

Thanks,
Bing

 Using nl80211 to discover this information seems a lot better approach.
 
 Regards
 
 Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Marcel Holtmann
Hi Bing,

 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.
 
 I do question a little bit the usefulness for this one.
 It would only work on netdev and on wdev devices.
 
 It's true. That's why the new sysfs entry is added in the 'wireless' 
 placeholder.
 
 /sys/class/net/ethX/wireless/
 
 For non-wireless dev, this won't apply.

I have to correct myself. I meant it does NOT work for wdev. Please just go 
with nl80211 for this kind of information. It is the right way to handle it. 
Not some sysfs file.

Regards

Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-18 Thread Arend van Spriel

On 04/18/2013 09:10 PM, Marcel Holtmann wrote:

Hi Bing,


Add a wireless/nl80211_iftype entry in the net device sysfs
file structure to indicate the mode of the wireless device so
it can be discovered easily from userspace.


I do question a little bit the usefulness for this one.
It would only work on netdev and on wdev devices.


It's true. That's why the new sysfs entry is added in the 'wireless' 
placeholder.

/sys/class/net/ethX/wireless/

For non-wireless dev, this won't apply.


I have to correct myself. I meant it does NOT work for wdev. Please just go 
with nl80211 for this kind of information. It is the right way to handle it. 
Not some sysfs file.



I wanted to correct you on P2P but that would be diverging from the real 
message. Totally agreeing. Why add another user-space API when the 
nl80211 API can provide the information.


Gr. AvS


--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-17 Thread Marcel Holtmann
Hi Bing,

> Add a "wireless/nl80211_iftype" entry in the net device sysfs
> file structure to indicate the mode of the wireless device so
> it can be discovered easily from userspace.

I do question a little bit the usefulness for this one. It would only work on 
netdev and on wdev devices. Using nl80211 to discover this information seems a 
lot better approach.

Regards

Marcel

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-17 Thread Johannes Berg
On Wed, 2013-04-17 at 15:06 -0700, Bing Zhao wrote:
> Add a "wireless/nl80211_iftype" entry in the net device sysfs
> file structure to indicate the mode of the wireless device so
> it can be discovered easily from userspace.

What's wrong with "iw dev", i.e. netlink/nl80211?

johannes

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-17 Thread Johannes Berg
On Wed, 2013-04-17 at 15:06 -0700, Bing Zhao wrote:
 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.

What's wrong with iw dev, i.e. netlink/nl80211?

johannes

--
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] net-sysfs: Add entry for nl80211 interface type

2013-04-17 Thread Marcel Holtmann
Hi Bing,

 Add a wireless/nl80211_iftype entry in the net device sysfs
 file structure to indicate the mode of the wireless device so
 it can be discovered easily from userspace.

I do question a little bit the usefulness for this one. It would only work on 
netdev and on wdev devices. Using nl80211 to discover this information seems a 
lot better approach.

Regards

Marcel

--
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/