From 4582c6dc1f10642ebecbe9fdebc241a265ad4516 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Mon, 24 May 2010 04:12:05 -0400 Subject: [PATCH] Schedule delayed work when setting interface up. --- ndeth.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ndeth.c b/ndeth.c index ec6be59..c9402c4 100644 --- a/ndeth.c +++ b/ndeth.c @@ -20,18 +20,28 @@ #include #include #include +#include MODULE_LICENSE("GPL"); +static void work_ndeth(struct work_struct *work) +{ + printk(KERN_DEBUG "doing ndeth work\n"); +} + +static DECLARE_DELAYED_WORK(ndeth_work, work_ndeth); + static int ndeth_open(struct net_device *dev) { printk(KERN_DEBUG "ndeth open\n"); + schedule_delayed_work(&ndeth_work, 4 * HZ); return 0; } static int ndeth_stop(struct net_device *dev) { printk(KERN_DEBUG "ndeth stop\n"); + cancel_delayed_work_sync(&ndeth_work); return 0; } -- 2.20.1