Minor PPP devices improvements
Subsystems (3)
cover Minor PPP devices improvements
Let PPP devices be friendlier to user space by registering their device type and reporting their interface naming scheme.
Guillaume Nault (2):
ppp: define "ppp" device type
ppp: declare ppp devices as enumerated interfaces
drivers/net/ppp/ppp_generic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.6.4
PATCH 1/2 ppp: define "ppp" device type
Let PPP devices be identified as such in /sys/class/net/<iface>/uevent.
--- drivers/net/ppp/ppp_generic.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ppp/ppp_generic.c +6 -0
@@ -1138,9 +1138,15 @@ static const struct net_device_ops ppp_netdev_ops = { .ndo_get_stats64 = ppp_get_stats64, }; +static struct device_type ppp_type = { + .name ="ppp" , +}; +static void ppp_setup (struct net_device *dev) { dev->netdev_ops = &ppp_netdev_ops; +SET_NETDEV_DEVTYPE (dev, &ppp_type); + dev->hard_header_len =PPP_HDRLEN ; dev->mtu =PPP_MRU ; dev->addr_len =0 ;
Signature · 1 line
2.6.4
PATCH 2/2 ppp: declare ppp devices as enumerated interfaces
In reply to Guillaume NaultLet user space be aware of the naming scheme used by ppp interfaces (visible in /sys/class/net/<iface>/name_assign_type).
--- drivers/net/ppp/ppp_generic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ppp/ppp_generic.c +1 -2
@@ -2726,8 +2726,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,int ret = -ENOMEM ;int i; - dev =alloc_netdev (sizeof (struct ppp ),"" ,NET_NAME_UNKNOWN , - ppp_setup); + dev =alloc_netdev (sizeof (struct ppp ),"" ,NET_NAME_ENUM , ppp_setup);if (!dev) goto out1;
Signature · 1 line
2.6.4
David Miller
maintainerFrom: Guillaume Nault <[email protected]>
Date: Fri, 11 Dec 2015 19:54:47 +0100
Quoted 2 lines
Let PPP devices be friendlier to user space by registering their device type and reporting their interface naming scheme.
Series applied, thanks.