diff options
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/cycx_x25.c | 13 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_ppp.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_x25.c | 12 | ||||
-rw-r--r-- | drivers/net/wan/lapbether.c | 12 | ||||
-rw-r--r-- | drivers/net/wan/x25_asy.c | 12 |
5 files changed, 32 insertions, 23 deletions
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index cd8cb95c5bd7..cf9e15fd8d91 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c | |||
@@ -634,11 +634,12 @@ static netdev_tx_t cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | |||
634 | } | 634 | } |
635 | } else { /* chan->protocol == ETH_P_X25 */ | 635 | } else { /* chan->protocol == ETH_P_X25 */ |
636 | switch (skb->data[0]) { | 636 | switch (skb->data[0]) { |
637 | case 0: break; | 637 | case X25_IFACE_DATA: |
638 | case 1: /* Connect request */ | 638 | break; |
639 | case X25_IFACE_CONNECT: | ||
639 | cycx_x25_chan_connect(dev); | 640 | cycx_x25_chan_connect(dev); |
640 | goto free_packet; | 641 | goto free_packet; |
641 | case 2: /* Disconnect request */ | 642 | case X25_IFACE_DISCONNECT: |
642 | cycx_x25_chan_disconnect(dev); | 643 | cycx_x25_chan_disconnect(dev); |
643 | goto free_packet; | 644 | goto free_packet; |
644 | default: | 645 | default: |
@@ -1406,7 +1407,8 @@ static void cycx_x25_set_chan_state(struct net_device *dev, u8 state) | |||
1406 | reset_timer(dev); | 1407 | reset_timer(dev); |
1407 | 1408 | ||
1408 | if (chan->protocol == ETH_P_X25) | 1409 | if (chan->protocol == ETH_P_X25) |
1409 | cycx_x25_chan_send_event(dev, 1); | 1410 | cycx_x25_chan_send_event(dev, |
1411 | X25_IFACE_CONNECT); | ||
1410 | 1412 | ||
1411 | break; | 1413 | break; |
1412 | case WAN_CONNECTING: | 1414 | case WAN_CONNECTING: |
@@ -1424,7 +1426,8 @@ static void cycx_x25_set_chan_state(struct net_device *dev, u8 state) | |||
1424 | } | 1426 | } |
1425 | 1427 | ||
1426 | if (chan->protocol == ETH_P_X25) | 1428 | if (chan->protocol == ETH_P_X25) |
1427 | cycx_x25_chan_send_event(dev, 2); | 1429 | cycx_x25_chan_send_event(dev, |
1430 | X25_IFACE_DISCONNECT); | ||
1428 | 1431 | ||
1429 | netif_wake_queue(dev); | 1432 | netif_wake_queue(dev); |
1430 | break; | 1433 | break; |
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c index b9b9d6b01c0b..941f053e650e 100644 --- a/drivers/net/wan/hdlc_ppp.c +++ b/drivers/net/wan/hdlc_ppp.c | |||
@@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *dev) | |||
628 | ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL); | 628 | ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL); |
629 | } | 629 | } |
630 | 630 | ||
631 | static void ppp_close(struct net_device *dev) | ||
632 | { | ||
633 | ppp_tx_flush(); | ||
634 | } | ||
635 | |||
631 | static struct hdlc_proto proto = { | 636 | static struct hdlc_proto proto = { |
632 | .start = ppp_start, | 637 | .start = ppp_start, |
633 | .stop = ppp_stop, | 638 | .stop = ppp_stop, |
639 | .close = ppp_close, | ||
634 | .type_trans = ppp_type_trans, | 640 | .type_trans = ppp_type_trans, |
635 | .ioctl = ppp_ioctl, | 641 | .ioctl = ppp_ioctl, |
636 | .netif_rx = ppp_rx, | 642 | .netif_rx = ppp_rx, |
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c index c7adbb79f7cc..70527e5a54a2 100644 --- a/drivers/net/wan/hdlc_x25.c +++ b/drivers/net/wan/hdlc_x25.c | |||
@@ -49,14 +49,14 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code) | |||
49 | 49 | ||
50 | static void x25_connected(struct net_device *dev, int reason) | 50 | static void x25_connected(struct net_device *dev, int reason) |
51 | { | 51 | { |
52 | x25_connect_disconnect(dev, reason, 1); | 52 | x25_connect_disconnect(dev, reason, X25_IFACE_CONNECT); |
53 | } | 53 | } |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | static void x25_disconnected(struct net_device *dev, int reason) | 57 | static void x25_disconnected(struct net_device *dev, int reason) |
58 | { | 58 | { |
59 | x25_connect_disconnect(dev, reason, 2); | 59 | x25_connect_disconnect(dev, reason, X25_IFACE_DISCONNECT); |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
@@ -71,7 +71,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) | |||
71 | return NET_RX_DROP; | 71 | return NET_RX_DROP; |
72 | 72 | ||
73 | ptr = skb->data; | 73 | ptr = skb->data; |
74 | *ptr = 0; | 74 | *ptr = X25_IFACE_DATA; |
75 | 75 | ||
76 | skb->protocol = x25_type_trans(skb, dev); | 76 | skb->protocol = x25_type_trans(skb, dev); |
77 | return netif_rx(skb); | 77 | return netif_rx(skb); |
@@ -94,13 +94,13 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev) | |||
94 | 94 | ||
95 | /* X.25 to LAPB */ | 95 | /* X.25 to LAPB */ |
96 | switch (skb->data[0]) { | 96 | switch (skb->data[0]) { |
97 | case 0: /* Data to be transmitted */ | 97 | case X25_IFACE_DATA: /* Data to be transmitted */ |
98 | skb_pull(skb, 1); | 98 | skb_pull(skb, 1); |
99 | if ((result = lapb_data_request(dev, skb)) != LAPB_OK) | 99 | if ((result = lapb_data_request(dev, skb)) != LAPB_OK) |
100 | dev_kfree_skb(skb); | 100 | dev_kfree_skb(skb); |
101 | return NETDEV_TX_OK; | 101 | return NETDEV_TX_OK; |
102 | 102 | ||
103 | case 1: | 103 | case X25_IFACE_CONNECT: |
104 | if ((result = lapb_connect_request(dev))!= LAPB_OK) { | 104 | if ((result = lapb_connect_request(dev))!= LAPB_OK) { |
105 | if (result == LAPB_CONNECTED) | 105 | if (result == LAPB_CONNECTED) |
106 | /* Send connect confirm. msg to level 3 */ | 106 | /* Send connect confirm. msg to level 3 */ |
@@ -112,7 +112,7 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev) | |||
112 | } | 112 | } |
113 | break; | 113 | break; |
114 | 114 | ||
115 | case 2: | 115 | case X25_IFACE_DISCONNECT: |
116 | if ((result = lapb_disconnect_request(dev)) != LAPB_OK) { | 116 | if ((result = lapb_disconnect_request(dev)) != LAPB_OK) { |
117 | if (result == LAPB_NOTCONNECTED) | 117 | if (result == LAPB_NOTCONNECTED) |
118 | /* Send disconnect confirm. msg to level 3 */ | 118 | /* Send disconnect confirm. msg to level 3 */ |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 98e2f99903d7..4d4dc38c7290 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -139,7 +139,7 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) | |||
139 | return NET_RX_DROP; | 139 | return NET_RX_DROP; |
140 | 140 | ||
141 | ptr = skb->data; | 141 | ptr = skb->data; |
142 | *ptr = 0x00; | 142 | *ptr = X25_IFACE_DATA; |
143 | 143 | ||
144 | skb->protocol = x25_type_trans(skb, dev); | 144 | skb->protocol = x25_type_trans(skb, dev); |
145 | return netif_rx(skb); | 145 | return netif_rx(skb); |
@@ -161,14 +161,14 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb, | |||
161 | goto drop; | 161 | goto drop; |
162 | 162 | ||
163 | switch (skb->data[0]) { | 163 | switch (skb->data[0]) { |
164 | case 0x00: | 164 | case X25_IFACE_DATA: |
165 | break; | 165 | break; |
166 | case 0x01: | 166 | case X25_IFACE_CONNECT: |
167 | if ((err = lapb_connect_request(dev)) != LAPB_OK) | 167 | if ((err = lapb_connect_request(dev)) != LAPB_OK) |
168 | printk(KERN_ERR "lapbeth: lapb_connect_request " | 168 | printk(KERN_ERR "lapbeth: lapb_connect_request " |
169 | "error: %d\n", err); | 169 | "error: %d\n", err); |
170 | goto drop; | 170 | goto drop; |
171 | case 0x02: | 171 | case X25_IFACE_DISCONNECT: |
172 | if ((err = lapb_disconnect_request(dev)) != LAPB_OK) | 172 | if ((err = lapb_disconnect_request(dev)) != LAPB_OK) |
173 | printk(KERN_ERR "lapbeth: lapb_disconnect_request " | 173 | printk(KERN_ERR "lapbeth: lapb_disconnect_request " |
174 | "err: %d\n", err); | 174 | "err: %d\n", err); |
@@ -225,7 +225,7 @@ static void lapbeth_connected(struct net_device *dev, int reason) | |||
225 | } | 225 | } |
226 | 226 | ||
227 | ptr = skb_put(skb, 1); | 227 | ptr = skb_put(skb, 1); |
228 | *ptr = 0x01; | 228 | *ptr = X25_IFACE_CONNECT; |
229 | 229 | ||
230 | skb->protocol = x25_type_trans(skb, dev); | 230 | skb->protocol = x25_type_trans(skb, dev); |
231 | netif_rx(skb); | 231 | netif_rx(skb); |
@@ -242,7 +242,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason) | |||
242 | } | 242 | } |
243 | 243 | ||
244 | ptr = skb_put(skb, 1); | 244 | ptr = skb_put(skb, 1); |
245 | *ptr = 0x02; | 245 | *ptr = X25_IFACE_DISCONNECT; |
246 | 246 | ||
247 | skb->protocol = x25_type_trans(skb, dev); | 247 | skb->protocol = x25_type_trans(skb, dev); |
248 | netif_rx(skb); | 248 | netif_rx(skb); |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 80d5c5834a0b..166e77dfffda 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -29,12 +29,12 @@ | |||
29 | #include <linux/etherdevice.h> | 29 | #include <linux/etherdevice.h> |
30 | #include <linux/skbuff.h> | 30 | #include <linux/skbuff.h> |
31 | #include <linux/if_arp.h> | 31 | #include <linux/if_arp.h> |
32 | #include <linux/x25.h> | ||
33 | #include <linux/lapb.h> | 32 | #include <linux/lapb.h> |
34 | #include <linux/init.h> | 33 | #include <linux/init.h> |
35 | #include <linux/rtnetlink.h> | 34 | #include <linux/rtnetlink.h> |
36 | #include <linux/compat.h> | 35 | #include <linux/compat.h> |
37 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <net/x25device.h> | ||
38 | #include "x25_asy.h" | 38 | #include "x25_asy.h" |
39 | 39 | ||
40 | #include <net/x25device.h> | 40 | #include <net/x25device.h> |
@@ -315,15 +315,15 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | switch (skb->data[0]) { | 317 | switch (skb->data[0]) { |
318 | case 0x00: | 318 | case X25_IFACE_DATA: |
319 | break; | 319 | break; |
320 | case 0x01: /* Connection request .. do nothing */ | 320 | case X25_IFACE_CONNECT: /* Connection request .. do nothing */ |
321 | err = lapb_connect_request(dev); | 321 | err = lapb_connect_request(dev); |
322 | if (err != LAPB_OK) | 322 | if (err != LAPB_OK) |
323 | printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); | 323 | printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); |
324 | kfree_skb(skb); | 324 | kfree_skb(skb); |
325 | return NETDEV_TX_OK; | 325 | return NETDEV_TX_OK; |
326 | case 0x02: /* Disconnect request .. do nothing - hang up ?? */ | 326 | case X25_IFACE_DISCONNECT: /* do nothing - hang up ?? */ |
327 | err = lapb_disconnect_request(dev); | 327 | err = lapb_disconnect_request(dev); |
328 | if (err != LAPB_OK) | 328 | if (err != LAPB_OK) |
329 | printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); | 329 | printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); |
@@ -411,7 +411,7 @@ static void x25_asy_connected(struct net_device *dev, int reason) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | ptr = skb_put(skb, 1); | 413 | ptr = skb_put(skb, 1); |
414 | *ptr = 0x01; | 414 | *ptr = X25_IFACE_CONNECT; |
415 | 415 | ||
416 | skb->protocol = x25_type_trans(skb, sl->dev); | 416 | skb->protocol = x25_type_trans(skb, sl->dev); |
417 | netif_rx(skb); | 417 | netif_rx(skb); |
@@ -430,7 +430,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason) | |||
430 | } | 430 | } |
431 | 431 | ||
432 | ptr = skb_put(skb, 1); | 432 | ptr = skb_put(skb, 1); |
433 | *ptr = 0x02; | 433 | *ptr = X25_IFACE_DISCONNECT; |
434 | 434 | ||
435 | skb->protocol = x25_type_trans(skb, sl->dev); | 435 | skb->protocol = x25_type_trans(skb, sl->dev); |
436 | netif_rx(skb); | 436 | netif_rx(skb); |