diff options
author | Xavier LANGELLIER <xln@renesas41.rmad.renesasmobile.com> | 2012-10-11 11:58:49 +0200 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:42:52 -0700 |
commit | bb277c0193c6f3187497f8a51ac0f73227e7614c (patch) | |
tree | 0202d9989d4bd11e132f9473cd78b6d9c73514ba /net/mhi | |
parent | 8e35c4ed4a1dfc3fb207a478e7e0d5f4d7976e33 (diff) |
net: mhi: mhdp keep alive feature is not required
mhdp keep alive feature is not required anymore. This change is
independant of the RIL one.
Bug 1167018
Change-Id: Ib2aef6ff6883c5666646471c89a82ac5a186a1a2
Signed-off-by: wtsai <wtsai@nvidia.com>
Reviewed-on: http://git-master/r/165068
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'net/mhi')
-rw-r--r-- | net/mhi/l3mhdp.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/net/mhi/l3mhdp.c b/net/mhi/l3mhdp.c index 67b8f31cefb5..ef1635047faa 100644 --- a/net/mhi/l3mhdp.c +++ b/net/mhi/l3mhdp.c @@ -86,6 +86,7 @@ struct mhdp_tunnel { struct net_device *master_dev; struct sk_buff *skb; int pdn_id; + int free_pdn; struct timer_list tx_timer; struct sk_buff *skb_to_free[MAX_MHDPHDR_SIZE]; spinlock_t timer_lock; @@ -194,6 +195,7 @@ mhdp_tunnel_init(struct net_device *dev, tunnel->master_dev = master_dev; tunnel->skb = NULL; tunnel->pdn_id = parms->pdn_id; + tunnel->free_pdn = 0; init_timer(&tunnel->tx_timer); spin_lock_init(&tunnel->timer_lock); @@ -299,10 +301,12 @@ mhdp_netdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return -EFAULT; } - DPRINTK("pdn_id:%d master_device:%s", k_parms.pdn_id, - k_parms.master); + DPRINTK("pdn_id:%d master_device:%s", + k_parms.pdn_id, + k_parms.master); + tunnel = mhdp_locate_tunnel(mhdpn, k_parms.pdn_id); - if (!mhdp_locate_tunnel(mhdpn, k_parms.pdn_id)) { + if (NULL == tunnel) { if (mhdp_add_tunnel(net, &k_parms)) { if (copy_to_user(u_parms, &k_parms, sizeof(struct mhdp_tunnel_parm))) @@ -310,6 +314,15 @@ mhdp_netdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } else { err = -EINVAL; } + } else if (1 == tunnel->free_pdn) { + + tunnel->free_pdn = 0; + + strcpy(&k_parms.name, tunnel->dev->name); + + if (copy_to_user(u_parms, &k_parms, + sizeof(struct mhdp_tunnel_parm))) + err = -EINVAL; } else { err = -EBUSY; } @@ -328,14 +341,8 @@ mhdp_netdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) for (tunnel = mhdpn->tunnels, pre_dev = NULL; tunnel; pre_dev = tunnel, tunnel = tunnel->next) { - if (tunnel->pdn_id == k_parms.pdn_id) { - if (!pre_dev) - mhdpn->tunnels = mhdpn->tunnels->next; - else - pre_dev->next = tunnel->next; - - mhdp_tunnel_destroy(tunnel->dev); - } + if (tunnel->pdn_id == k_parms.pdn_id) + tunnel->free_pdn = 1; } break; @@ -545,6 +552,8 @@ mhdp_netdev_rx(struct sk_buff *skb, struct net_device *dev) } rcu_read_unlock(); + return err; + error: if (mhdp_header_len > skb_headlen(skb)) kfree(mhdpHdr); |