summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorXavier LANGELLIER <xln@renesas41.rmad.renesasmobile.com>2012-10-11 14:48:10 +0200
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-11-23 02:28:12 -0800
commit5b3f08b1656ec945bad23a2beb04d13e26abc06b (patch)
tree17c262e565898b22519ee284bc9209f02fb06f08 /net
parent9d0cbb8b01e5f48adb0393ad5ebae3531a345388 (diff)
net: mhi: mhdp support for bonding
mhdp support for bonding. Set to off by default. Add option CONFIG_MHDP_BONDING_SUPPORT to activate the feature. Bug 1167018 Change-Id: I9dc77cc78495a1b142db9325a2d0726329bfe626 Signed-off-by: wtsai <wtsai@nvidia.com> Reviewed-on: http://git-master/r/165079 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'net')
-rw-r--r--net/mhi/Kconfig4
-rw-r--r--net/mhi/l3mhdp.c41
2 files changed, 41 insertions, 4 deletions
diff --git a/net/mhi/Kconfig b/net/mhi/Kconfig
index 64965a7d2c6d..7f4e05c086e4 100644
--- a/net/mhi/Kconfig
+++ b/net/mhi/Kconfig
@@ -84,6 +84,8 @@ config MHI_DUMP_FRAMES
If unsure, say N.
-
+config MHDP_BONDING_SUPPORT
+ bool "use mhdp as a bonding slave"
+ default n
endif
diff --git a/net/mhi/l3mhdp.c b/net/mhi/l3mhdp.c
index ef1635047faa..a728eeab5ef5 100644
--- a/net/mhi/l3mhdp.c
+++ b/net/mhi/l3mhdp.c
@@ -38,6 +38,14 @@
#include <linux/etherdevice.h>
#include <linux/pkt_sched.h>
+#ifdef CONFIG_MHDP_BONDING_SUPPORT
+#define MHDP_BONDING_SUPPORT
+#endif
+
+#ifdef MHDP_BONDING_SUPPORT
+#include <linux/etherdevice.h>
+#endif /* MHDP_BONDING_SUPPORT */
+
#include <net/netns/generic.h>
#include <net/mhi/mhdp.h>
@@ -264,9 +272,6 @@ mhdp_add_tunnel(struct net *net, struct mhdp_tunnel_parm *parms)
mhdp_tunnel_init(mhdp_dev, parms, master_dev);
- mhdp_dev->flags |= IFF_SLAVE;
- master_dev->flags |= IFF_MASTER;
-
dev_put(master_dev);
return mhdp_dev;
@@ -733,6 +738,25 @@ mhdp_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
return NOTIFY_DONE;
}
+#ifdef MHDP_BONDING_SUPPORT
+static void
+cdma_netdev_uninit(struct net_device *dev)
+{
+ dev_put(dev);
+}
+
+static void mhdp_ethtool_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *drvinfo)
+{
+ strncpy(drvinfo->driver, dev->name, 32);
+}
+
+static const struct ethtool_ops mhdp_ethtool_ops = {
+ .get_drvinfo = mhdp_ethtool_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+};
+#endif /* MHDP_BONDING_SUPPORT */
+
static const struct net_device_ops mhdp_netdev_ops = {
.ndo_uninit = mhdp_netdev_uninit,
.ndo_start_xmit = mhdp_netdev_xmit,
@@ -743,8 +767,18 @@ static const struct net_device_ops mhdp_netdev_ops = {
static void mhdp_netdev_setup(struct net_device *dev)
{
dev->netdev_ops = &mhdp_netdev_ops;
+#ifdef MHDP_BONDING_SUPPORT
+ dev->ethtool_ops = &mhdp_ethtool_ops;
+#endif /* MHDP_BONDING_SUPPORT */
+
dev->destructor = free_netdev;
+#ifdef truc /* MHDP_BONDING_SUPPORT */
+ ether_setup(dev);
+ dev->flags |= IFF_NOARP;
+ dev->iflink = 0;
+ dev->features |= (NETIF_F_NETNS_LOCAL | NETIF_F_FRAGLIST);
+#else
dev->type = ARPHRD_TUNNEL;
dev->hard_header_len = L2MUX_HDR_SIZE + sizeof(struct mhdp_hdr);
dev->mtu = ETH_DATA_LEN;
@@ -752,6 +786,7 @@ static void mhdp_netdev_setup(struct net_device *dev)
dev->iflink = 0;
dev->addr_len = 4;
dev->features |= (NETIF_F_NETNS_LOCAL | NETIF_F_FRAGLIST);
+#endif /* MHDP_BONDING_SUPPORT */
}
static int __net_init mhdp_init_net(struct net *net)