Bug 43918 - Use iwgetid to detect wireless cards
Summary: Use iwgetid to detect wireless cards
Alias: None
Product: pm-utils
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
Depends on:
Reported: 2011-12-17 19:49 UTC by Olli Nevalainen
Modified: 2018-06-29 19:57 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Use iwgetid to detect wireless cards (996 bytes, patch)
2011-12-17 19:49 UTC, Olli Nevalainen
Details | Splinter Review

Description Olli Nevalainen 2011-12-17 19:49:19 UTC
Created attachment 54531 [details] [review]
Use iwgetid to detect wireless cards

pm/power.d/wireless currently tries to detect wireless interfaces by checking the existence of /sys/class/net/$1/wireless directory. This directory has been made optional and deprecated around 2009 (See WIRELESS_EXT_SYSFS kernel configuration option).

As pm/power.d/wireless is using iwconfig in wireless-tools to set the power saving options we would probably be better off using wireless-tools to detect whether the interface is a wireless interface or not. Man page for iwgetid command documents "iwgetid --protocol" being a reliable way to check whether the interface supports Wireless Extension or not.

The attached patch has been tested using iwlagn driver on Linux 3.1.0 with WIRELESS_EXT_SYSFS disabled.
Comment 1 Samuli Suominen 2014-06-04 19:39:46 UTC
'wireless-tools' is deprecated in favour of 'iw', so wouldn't this just create extra dependency on a obsolete tool?
Comment 2 Olli Nevalainen 2014-06-15 22:52:36 UTC
(In reply to comment #1)
> 'wireless-tools' is deprecated in favour of 'iw', so wouldn't this just
> create extra dependency on a obsolete tool?

I seem to have said that as wireless-tools was already used for setting power saving options, it would also make sense to use wireless-tools for detecting which interfaces were supported. I think that would have made sense even when wireless-tools itself was deprecated, unless there was an active effort to convert pm-utils to use 'iw'.

Having said that, I'm happy for this issue to be closed as it doesn't seem to be a problem for anyone else, and I'm not currently using pm-utils either.
Comment 3 Adam Jackson 2018-06-29 19:57:25 UTC
pm-utils hasn't been touched in eight years, none of this is likely to get addressed. Closing bugs and disabling the bz product.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.