Add function to get bonding nss context.
Add function to get nss interface number for a net
device without needing an nss context.
Change-Id: I8b26ebdb3a8dfd7ee6153547d0b5ecdf9e9235cd
Signed-off-by: Gareth Williams <garethw@codeaurora.org>
diff --git a/nss_lag.c b/nss_lag.c
index 300f4df..50745c8 100644
--- a/nss_lag.c
+++ b/nss_lag.c
@@ -70,7 +70,7 @@
/**
* nss_register_lag_if()
*/
-void nss_register_lag_if(uint32_t if_num,
+void *nss_register_lag_if(uint32_t if_num,
nss_lag_callback_t lag_cb,
nss_lag_event_callback_t lag_ev_cb,
struct net_device *netdev)
@@ -80,6 +80,11 @@
nss_top_main.if_ctx[if_num] = netdev;
nss_top_main.if_rx_callback[if_num] = lag_cb;
nss_top_main.lag_event_callback = lag_ev_cb;
+
+ /*
+ * Return the NSS driver context for LAG (same as for ipv4 functions)
+ */
+ return (void *)&nss_top_main.nss[nss_top_main.ipv4_handler_id];
}
EXPORT_SYMBOL(nss_register_lag_if);