9 #include <linux/errno.h>
10 #include <linux/types.h>
11 #include <linux/socket.h>
13 #include <linux/kernel.h>
14 #include <linux/module.h>
17 #include <linux/string.h>
19 #include <linux/net.h>
20 #include <linux/slab.h>
23 #include <linux/netdevice.h>
26 #include <asm/uaccess.h>
27 #include <linux/fcntl.h>
37 static struct listen_struct {
38 struct listen_struct *
next;
41 } *listen_list =
NULL;
51 ap->
next = protocol_list;
63 protocol = protocol_list;
67 if (protocol->
pid == pid) {
68 protocol_list = protocol->
next;
73 if (protocol->
next->pid == pid) {
74 protocol->
next = protocol->
next->next;
78 protocol = protocol->
next;
88 spin_lock_bh(&linkfail_lock);
89 hlist_add_head(&lf->
lf_node, &ax25_linkfail_list);
90 spin_unlock_bh(&linkfail_lock);
97 spin_lock_bh(&linkfail_lock);
99 spin_unlock_bh(&linkfail_lock);
106 struct listen_struct *listen;
114 listen->callsign = *callsign;
117 spin_lock_bh(&listen_lock);
118 listen->next = listen_list;
119 listen_list = listen;
120 spin_unlock_bh(&listen_lock);
129 struct listen_struct *
s, *listen;
131 spin_lock_bh(&listen_lock);
132 listen = listen_list;
133 if (listen ==
NULL) {
134 spin_unlock_bh(&listen_lock);
138 if (
ax25cmp(&listen->callsign, callsign) == 0 && listen->dev == dev) {
139 listen_list = listen->next;
140 spin_unlock_bh(&listen_lock);
145 while (listen !=
NULL && listen->next !=
NULL) {
146 if (
ax25cmp(&listen->next->callsign, callsign) == 0 && listen->next->dev == dev) {
148 listen->next = listen->next->next;
149 spin_unlock_bh(&listen_lock);
154 listen = listen->next;
156 spin_unlock_bh(&listen_lock);
167 for (protocol = protocol_list; protocol !=
NULL; protocol = protocol->
next)
168 if (protocol->
pid ==
pid) {
179 struct listen_struct *listen;
181 spin_lock_bh(&listen_lock);
182 for (listen = listen_list; listen !=
NULL; listen = listen->next)
183 if (
ax25cmp(&listen->callsign, callsign) == 0 &&
184 (listen->dev == dev || listen->dev ==
NULL)) {
185 spin_unlock_bh(&listen_lock);
188 spin_unlock_bh(&listen_lock);
198 spin_lock_bh(&linkfail_lock);
200 lf->
func(ax25, reason);
201 spin_unlock_bh(&linkfail_lock);
210 for (protocol = protocol_list; protocol !=
NULL; protocol = protocol->
next)
211 if (protocol->
pid == pid) {