Commit 7772f773 authored by David S. Miller's avatar David S. Miller

Merge branch 'ppp-type-and-name'

Guillaume Nault says:

====================
Minor PPP devices improvements

Let PPP devices be friendlier to user space by registering their device
type and reporting their interface naming scheme.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e2862134 69d9728d
...@@ -1138,9 +1138,15 @@ static const struct net_device_ops ppp_netdev_ops = { ...@@ -1138,9 +1138,15 @@ static const struct net_device_ops ppp_netdev_ops = {
.ndo_get_stats64 = ppp_get_stats64, .ndo_get_stats64 = ppp_get_stats64,
}; };
static struct device_type ppp_type = {
.name = "ppp",
};
static void ppp_setup(struct net_device *dev) static void ppp_setup(struct net_device *dev)
{ {
dev->netdev_ops = &ppp_netdev_ops; dev->netdev_ops = &ppp_netdev_ops;
SET_NETDEV_DEVTYPE(dev, &ppp_type);
dev->hard_header_len = PPP_HDRLEN; dev->hard_header_len = PPP_HDRLEN;
dev->mtu = PPP_MRU; dev->mtu = PPP_MRU;
dev->addr_len = 0; dev->addr_len = 0;
...@@ -2720,8 +2726,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, ...@@ -2720,8 +2726,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
int ret = -ENOMEM; int ret = -ENOMEM;
int i; int i;
dev = alloc_netdev(sizeof(struct ppp), "", NET_NAME_UNKNOWN, dev = alloc_netdev(sizeof(struct ppp), "", NET_NAME_ENUM, ppp_setup);
ppp_setup);
if (!dev) if (!dev)
goto out1; goto out1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment