11 #include <linux/errno.h>
12 #include <linux/types.h>
13 #include <linux/socket.h>
15 #include <linux/kernel.h>
16 #include <linux/module.h>
18 #include <linux/string.h>
21 #include <linux/net.h>
22 #include <linux/slab.h>
25 #include <linux/netdevice.h>
27 #include <linux/netfilter.h>
29 #include <asm/uaccess.h>
30 #include <linux/fcntl.h>
46 if ((ax25_dev = ax25_dev_ax25dev(dev)) ==
NULL)
60 if ((ax25_dev = ax25_dev_ax25dev(dev)) ==
NULL)
85 #ifdef CONFIG_AX25_DAMA_SLAVE
86 case AX25_PROTO_DAMA_SLAVE:
87 if (ax25_dev->dama.slave)
124 int frontlen,
len, fragno, ka9qfrag,
first = 1;
132 if ((skb->
len - 1) > paclen) {
141 fragno = skb->
len / paclen;
142 if (skb->
len % paclen == 0) fragno--;
144 frontlen = skb_headroom(skb);
146 while (skb->
len > 0) {
147 spin_lock_bh(&ax25_frag_lock);
148 if ((skbn = alloc_skb(paclen + 2 + frontlen,
GFP_ATOMIC)) ==
NULL) {
149 spin_unlock_bh(&ax25_frag_lock);
155 skb_set_owner_w(skbn, skb->
sk);
157 spin_unlock_bh(&ax25_frag_lock);
159 len = (paclen > skb->
len) ? skb->
len : paclen;
162 skb_reserve(skbn, frontlen + 2);
163 skb_set_network_header(skbn,
164 skb_network_offset(skb));
165 skb_copy_from_linear_data(skb,
skb_put(skbn, len), len);
176 skb_reserve(skbn, frontlen + 1);
177 skb_set_network_header(skbn,
178 skb_network_offset(skb));
179 skb_copy_from_linear_data(skb,
skb_put(skbn, len), len);
199 #ifdef CONFIG_AX25_DAMA_SLAVE
204 case AX25_PROTO_DAMA_SLAVE:
217 unsigned char *
frame;
222 skb_reset_network_header(skb);
228 *frame |= (poll_bit) ?
AX25_PF : 0;
229 *frame |= (ax25->
vr << 5);
230 *frame |= (ax25->
vs << 1);
235 frame[0] |= (ax25->
vs << 1);
236 frame[1] = (poll_bit) ?
AX25_EPF : 0;
237 frame[1] |= (ax25->
vr << 1);
289 skb_set_owner_w(skbn, skb->
sk);
292 last = (next == end);
305 #ifdef CONFIG_AX25_DAMA_SLAVE
306 case AX25_PROTO_DAMA_SLAVE:
307 ax25_send_iframe(ax25, skbn, AX25_POLLOFF);
343 if (skb_headroom(skb) < headroom) {
351 skb_set_owner_w(skbn, skb->
sk);
382 if (ax25->
vs == nr) {
389 if (ax25->
va != nr) {