mac80211: Supporting of IFLA_INFO_KIND rtnl attribute
Subsystems (3)
PATCH 1/1 mac80211: Supporting of IFLA_INFO_KIND rtnl attribute
It allows to identify the wireless kind of device for the user application, e.g.:
# ip -d link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0
2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wireless
4: wlp0s26u1u2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wireless
--- net/mac80211/iface.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/mac80211/iface.c +7 -0
@@ -18,6 +18,7 @@#include <linux/rtnetlink.h> #include <net/mac80211.h> #include <net/ieee80211_radiotap.h> +#include <net/rtnetlink.h> #include "ieee80211_i.h" #include "sta_info.h" #include "debugfs_netdev.h"
@@ -1624,6 +1625,10 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,mutex_unlock (&local->iflist_mtx); } +static struct rtnl_link_ops wireless_link_ops__read_mostly = { + .kind ="wireless" , +}; +int ieee80211_if_add (struct ieee80211_local *local,const char *name,struct wireless_dev **new_wdev,enum nl80211_iftype type,struct vif_params *params)
@@ -1684,6 +1689,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,memcpy (sdata->vif.addr, ndev->dev_addr,ETH_ALEN );memcpy (sdata->name, ndev->name,IFNAMSIZ ); + ndev->rtnl_link_ops = &wireless_link_ops; + sdata->dev = ndev; }
Signature · 6 lines
2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1417910690-2021-1-git-send-email-vadim4j-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Hi Vadim,
Quoted 34 lines
It allows to identify the wireless kind of device for the user application, e.g.:
# ip -d link1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 02: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc
pfifo_faststate DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wireless
4: wlp0s26u1u2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wirelessSigned-off-by Vadim Kochan <[email protected]>---
net/mac80211/iface.c| 7 +++++++1 file changed, 7 insertions(+)net/mac80211/iface.c +1
-0@@ -18,6 +18,7 @@#include <linux/rtnetlink.h> #include <net/mac80211.h> #include <net/ieee80211_radiotap.h> +#include <net/rtnetlink.h> #include "ieee80211_i.h" #include "sta_info.h" #include "debugfs_netdev.h"
net/mac80211/iface.c static void ieee80211_assign_perm_addr(struct ieee80211_local *local, · line 1631
Quoted 7 lines
net/mac80211/iface.c +4
-0@@ -1624,6 +1625,10 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,mutex_unlock (&local->iflist_mtx); } +static struct rtnl_link_ops wireless_link_ops__read_mostly = { + .kind ="wireless" , +}; +
I would prefer if we use "wlan" here. Same as what we use for DEVTYPE and RFKILL switches. Being consistent across the kernel helps a lot. Since other subsystems including Bluetooth might want to identify their netdev as well and "wireless" would be just too generic.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 46 lines · Marcel Holtmann
Hi Vadim,
Quoted 34 lines
It allows to identify the wireless kind of device for the user application, e.g.:
# ip -d link1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 02: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc
pfifo_faststate DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wireless
4: wlp0s26u1u2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
wirelessSigned-off-by Vadim Kochan <[email protected]>---
net/mac80211/iface.c| 7 +++++++1 file changed, 7 insertions(+)net/mac80211/iface.c +1
-0@@ -18,6 +18,7 @@#include <linux/rtnetlink.h> #include <net/mac80211.h> #include <net/ieee80211_radiotap.h> +#include <net/rtnetlink.h> #include "ieee80211_i.h" #include "sta_info.h" #include "debugfs_netdev.h" net/mac80211/iface.c static void ieee80211_assign_perm_addr(struct ieee80211_local *local, · line 1631
Quoted 7 lines
net/mac80211/iface.c +4
-0@@ -1624,6 +1625,10 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,mutex_unlock (&local->iflist_mtx); } +static struct rtnl_link_ops wireless_link_ops__read_mostly = { + .kind ="wireless" , +}; +I would prefer if we use "wlan" here. Same as what we use for DEVTYPE and RFKILL switches. Being consistent across the kernel helps a lot. Since other subsystems including Bluetooth might want to identify their netdev as well and "wireless" would be just too generic.
Quoted 4 lines
Regards
Marcel
Hi Marcel,
It make sense.
Thanks,