diff options
author | Rajan Gupta <rajan.gupta@freescale.com> | 2012-03-26 05:04:42 (GMT) |
---|---|---|
committer | Emil Medve <Emilian.Medve@Freescale.com> | 2013-03-21 18:42:13 (GMT) |
commit | 2a692dd851055f767c99e050873f71b073980076 (patch) | |
tree | 2f50255a16e4d48d7747e9659dd3cd12dd0a2077 /drivers/net/ppp | |
parent | e9fb175c41dbf2cd7850d83d24c7d3467d8b2636 (diff) | |
download | linux-fsl-qoriq-2a692dd851055f767c99e050873f71b073980076.tar.xz |
ppp: Get parent device
Get parent device and session id for a given PPP device. Required by ASF for
processing Rx/Tx packets on the PPP devices
Signed-off-by: Rajan Gupta <rajan.gupta@freescale.com>
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r-- | drivers/net/ppp/ppp_generic.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 508570e..f70907f 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -53,6 +53,9 @@ #include <linux/nsproxy.h> #include <net/net_namespace.h> #include <net/netns/generic.h> +#ifdef CONFIG_AS_FASTPATH +#include <linux/if_pppox.h> +#endif #define PPP_VERSION "2.4.2" @@ -1624,6 +1627,31 @@ ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) ppp_recv_unlock(ppp); } +#ifdef CONFIG_AS_FASTPATH +struct net_device * +ppp_get_parent_dev(struct net_device *dev, __be16 *sessid) +{ + struct ppp *ppp = netdev_priv(dev); + struct channel *pch; + struct list_head *list; + struct sock *sk; + struct pppox_sock *po; + + list = &ppp->channels; + if (list_empty(list)) + return NULL; + + list = list->next; + pch = list_entry(list, struct channel, clist); + sk = pch->chan->private; + po = pppox_sk(sk); + + *sessid = po->num; + return po->pppoe_dev; +} +EXPORT_SYMBOL(ppp_get_parent_dev); +#endif + void ppp_input(struct ppp_channel *chan, struct sk_buff *skb) { |