9 #include <linux/errno.h>
10 #include <linux/types.h>
11 #include <linux/socket.h>
13 #include <linux/kernel.h>
16 #include <linux/string.h>
18 #include <linux/net.h>
19 #include <linux/slab.h>
22 #include <linux/netdevice.h>
25 #include <linux/fcntl.h>
28 #include <linux/netfilter.h>
31 static void rose_ftimer_expiry(
unsigned long);
32 static void rose_t0timer_expiry(
unsigned long);
34 static void rose_transmit_restart_confirmation(
struct rose_neigh *neigh);
35 static void rose_transmit_restart_request(
struct rose_neigh *neigh);
42 neigh->
ftimer.function = &rose_ftimer_expiry;
49 static void rose_start_t0timer(
struct rose_neigh *neigh)
54 neigh->
t0timer.function = &rose_t0timer_expiry;
73 return timer_pending(&neigh->
ftimer);
76 static int rose_t0timer_running(
struct rose_neigh *neigh)
78 return timer_pending(&neigh->
t0timer);
81 static void rose_ftimer_expiry(
unsigned long param)
85 static void rose_t0timer_expiry(
unsigned long param)
89 rose_transmit_restart_request(neigh);
93 rose_start_t0timer(neigh);
124 static int rose_link_up(
struct rose_neigh *neigh)
154 rose_transmit_restart_confirmation(neigh);
173 if (!rose_send_frame(skbn, neigh))
181 static void rose_transmit_restart_request(
struct rose_neigh *neigh)
194 dptr =
skb_put(skb, ROSE_MIN_LEN + 3);
203 if (!rose_send_frame(skb, neigh))
210 static void rose_transmit_restart_confirmation(
struct rose_neigh *neigh)
223 dptr =
skb_put(skb, ROSE_MIN_LEN + 1);
230 if (!rose_send_frame(skb, neigh))
251 dptr =
skb_put(skb, ROSE_MIN_LEN + 3);
254 *dptr++ = ((lci >> 8) & 0x0F) |
ROSE_GFI;
255 *dptr++ = ((lci >> 0) & 0xFF);
258 *dptr++ = diagnostic;
260 if (!rose_send_frame(skb, neigh))
273 if (!rose_link_up(neigh))
280 if (!rose_send_frame(skb, neigh))
285 if (!rose_t0timer_running(neigh)) {
286 rose_transmit_restart_request(neigh);
288 rose_start_t0timer(neigh);