Skip to content

Commit

Permalink
Merge branch 'ppp-type-and-name'
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Dec 14, 2015
2 parents e286213 + 69d9728 commit 7772f77
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/ppp/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2720,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;

Expand Down

0 comments on commit 7772f77

Please sign in to comment.