patch-2.1.20 linux/net/netrom/nr_dev.c
Next file: linux/net/netrom/nr_in.c
Previous file: linux/net/netrom/af_netrom.c
Back to the patch index
Back to the overall index
- Lines: 120
- Date:
Thu Jan 2 15:13:29 1997
- Orig file:
v2.1.19/linux/net/netrom/nr_dev.c
- Orig date:
Mon Dec 30 15:39:17 1996
diff -u --recursive --new-file v2.1.19/linux/net/netrom/nr_dev.c linux/net/netrom/nr_dev.c
@@ -1,10 +1,10 @@
/*
- * NET/ROM release 004
+ * NET/ROM release 006
*
* This is ALPHA test software. This code may break your machine, randomly fail to work with new
* releases, misbehave and/or generally screw up. It might even work.
*
- * This code REQUIRES 1.3.0 or higher/ NET3.029
+ * This code REQUIRES 2.1.15 or higher/ NET3.038
*
* This module:
* This module is free software; you can redistribute it and/or
@@ -18,11 +18,11 @@
* NET/ROM 003 Jonathan(G4KLX) Put nr_rebuild_header into line with
* ax25_rebuild_header
* NET/ROM 004 Jonathan(G4KLX) Callsign registration with AX.25.
+ * NET/ROM 006 Hans(PE1AYX) Fixed interface to IP layer.
*/
#include <linux/config.h>
#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
-#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -70,9 +70,11 @@
skb->protocol = htons(ETH_P_IP);
/* Spoof incoming device */
- skb->dev = dev;
+ skb->dev = dev;
+ skb->h.raw = skb->data;
+ skb->nh.raw = skb->data;
+ skb->pkt_type = PACKET_HOST;
- skb->h.raw = skb->data;
ip_rcv(skb, skb->dev, NULL);
return 1;
@@ -169,8 +171,6 @@
dev->tbusy = 0;
dev->start = 1;
- MOD_INC_USE_COUNT;
-
ax25_listen_register((ax25_address *)dev->dev_addr, NULL);
return 0;
@@ -183,8 +183,6 @@
ax25_listen_release((ax25_address *)dev->dev_addr, NULL);
- MOD_DEC_USE_COUNT;
-
return 0;
}
@@ -267,61 +265,5 @@
return 0;
};
-
-#ifdef MODULE
-extern struct proto_ops nr_proto_ops;
-extern struct notifier_block nr_dev_notifier;
-
-static struct device dev_nr[] = {
- {"nr0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, nr_init},
- {"nr1", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, nr_init},
- {"nr2", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, nr_init},
- {"nr3", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, nr_init}
-};
-
-EXPORT_NO_SYMBOLS;
-
-int init_module(void)
-{
- int i;
-
- for (i = 0; i < 4; i++)
- register_netdev(&dev_nr[i]);
-
- nr_proto_init(NULL);
-
- return 0;
-}
-
-void cleanup_module(void)
-{
- int i;
-
-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_NR);
- proc_net_unregister(PROC_NET_NR_NEIGH);
- proc_net_unregister(PROC_NET_NR_NODES);
-#endif
- nr_rt_free();
-
- ax25_protocol_release(AX25_P_NETROM);
- ax25_linkfail_release(nr_link_failed);
-
- unregister_netdevice_notifier(&nr_dev_notifier);
-
- nr_unregister_sysctl();
-
- sock_unregister(nr_proto_ops.family);
-
- for (i = 0; i < 4; i++) {
- if (dev_nr[i].priv != NULL) {
- kfree(dev_nr[i].priv);
- dev_nr[i].priv = NULL;
- unregister_netdev(&dev_nr[i]);
- }
- }
-}
-
-#endif
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov