summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-06-10 03:34:59 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-15 11:47:11 -0700
commit93e2c32b5cb2ad92ceb1d7a4684f20a0d25bf530 (patch)
treec15af2642af01702097ade735506d15d7a910c54 /net/core/dev.c
parent91d2c34a4eed32876ca333b0ca44f3bc56645805 (diff)
downloadblackbird-op-linux-93e2c32b5cb2ad92ceb1d7a4684f20a0d25bf530.tar.gz
blackbird-op-linux-93e2c32b5cb2ad92ceb1d7a4684f20a0d25bf530.zip
net: add rx_handler data pointer
Add possibility to register rx_handler data pointer along with a rx_handler. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a1abc10db08a..abdb19e547a7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2703,6 +2703,7 @@ void netif_nit_deliver(struct sk_buff *skb)
* netdev_rx_handler_register - register receive handler
* @dev: device to register a handler for
* @rx_handler: receive handler to register
+ * @rx_handler_data: data pointer that is used by rx handler
*
* Register a receive hander for a device. This handler will then be
* called from __netif_receive_skb. A negative errno code is returned
@@ -2711,13 +2712,15 @@ void netif_nit_deliver(struct sk_buff *skb)
* The caller must hold the rtnl_mutex.
*/
int netdev_rx_handler_register(struct net_device *dev,
- rx_handler_func_t *rx_handler)
+ rx_handler_func_t *rx_handler,
+ void *rx_handler_data)
{
ASSERT_RTNL();
if (dev->rx_handler)
return -EBUSY;
+ rcu_assign_pointer(dev->rx_handler_data, rx_handler_data);
rcu_assign_pointer(dev->rx_handler, rx_handler);
return 0;
@@ -2737,6 +2740,7 @@ void netdev_rx_handler_unregister(struct net_device *dev)
ASSERT_RTNL();
rcu_assign_pointer(dev->rx_handler, NULL);
+ rcu_assign_pointer(dev->rx_handler_data, NULL);
}
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
OpenPOWER on IntegriCloud