* [PATCH] wireless: Add ifname to STOP_AP event.
@ 2015-06-10 22:17 greearb
2015-06-17 9:14 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: greearb @ 2015-06-10 22:17 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Ben Greear
From: Ben Greear <greearb@candelatech.com>
In case user-space wants to know the name of the
device, this will save a name lookup by index, and
in case where kernel manages to fully delete the
interface before user-space can determine the name,
this will ensure user-space has proper name.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
net/wireless/nl80211.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 736c474..ba73def 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -12992,6 +12992,7 @@ void nl80211_send_ap_stopped(struct wireless_dev *wdev)
goto out;
if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
+ nla_put_string(msg, NL80211_ATTR_IFNAME, wdev->netdev->name) ||
nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) ||
nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)))
goto out;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wireless: Add ifname to STOP_AP event.
2015-06-10 22:17 [PATCH] wireless: Add ifname to STOP_AP event greearb
@ 2015-06-17 9:14 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-06-17 9:14 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
On Wed, 2015-06-10 at 15:17 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> In case user-space wants to know the name of the
> device, this will save a name lookup by index, and
> in case where kernel manages to fully delete the
> interface before user-space can determine the name,
> this will ensure user-space has proper name.
None of this reasoning is specific to the STOP_AP event, and I'd hate us
adding it one by one...
I still think there isn't all that much reason to have it (if userspace
really needs the names so badly it could also subscribe to the rtnetlink
and keep a table of index/names!), but I could get behind a refactoring
of all these places (I count at least 10 events that include the wdev
id) to combine the four lines in the patch below into a single helper.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-17 9:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 22:17 [PATCH] wireless: Add ifname to STOP_AP event greearb
2015-06-17 9:14 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).