#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/workqueue.h>
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;
}