+/*
+ * Copyright (C) 2010 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#include <linux/module.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+
+MODULE_LICENSE("GPL");
+
+static int ndeth_open(struct net_device *dev)
+{
+ printk(KERN_DEBUG "ndeth open\n");
+ return 0;
+}
+
+static int ndeth_stop(struct net_device *dev)
+{
+ printk(KERN_DEBUG "ndeth stop\n");
+ return 0;
+}
+
+static int ndeth_tx(struct sk_buff *skb, struct net_device *dev)
+{
+ dev_kfree_skb(skb);
+ return NETDEV_TX_OK;
+}
+
+static const struct net_device_ops ndeth_ops = {
+ .ndo_open = ndeth_open,
+ .ndo_stop = ndeth_stop,
+ .ndo_start_xmit = ndeth_tx,
+};
+
+struct net_device *ndeth;
+
+static __init int ndeth_init(void)
+{
+ int r = -ENOMEM;
+ ndeth = alloc_etherdev(0);
+ if (!ndeth)
+ goto out;
+ ndeth->netdev_ops = &ndeth_ops;
+ r = register_netdev(ndeth);
+ if (r)
+ goto reg_out;
+ return 0;
+reg_out:
+ free_netdev(ndeth);
+out:
+ return r;
+}
+
+static __exit void ndeth_exit(void)
+{
+ unregister_netdev(ndeth);
+ free_netdev(ndeth);
+}
+
+module_init(ndeth_init);
+module_exit(ndeth_exit);