aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c8
-rw-r--r--net/x25/x25_dev.c36
2 files changed, 24 insertions, 20 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 36e84e13c6aa..296e65e01064 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -719,7 +719,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
719 DECLARE_WAITQUEUE(wait, current); 719 DECLARE_WAITQUEUE(wait, current);
720 int rc; 720 int rc;
721 721
722 add_wait_queue_exclusive(sk->sk_sleep, &wait); 722 add_wait_queue_exclusive(sk_sleep(sk), &wait);
723 for (;;) { 723 for (;;) {
724 __set_current_state(TASK_INTERRUPTIBLE); 724 __set_current_state(TASK_INTERRUPTIBLE);
725 rc = -ERESTARTSYS; 725 rc = -ERESTARTSYS;
@@ -739,7 +739,7 @@ static int x25_wait_for_connection_establishment(struct sock *sk)
739 break; 739 break;
740 } 740 }
741 __set_current_state(TASK_RUNNING); 741 __set_current_state(TASK_RUNNING);
742 remove_wait_queue(sk->sk_sleep, &wait); 742 remove_wait_queue(sk_sleep(sk), &wait);
743 return rc; 743 return rc;
744} 744}
745 745
@@ -839,7 +839,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
839 DECLARE_WAITQUEUE(wait, current); 839 DECLARE_WAITQUEUE(wait, current);
840 int rc = 0; 840 int rc = 0;
841 841
842 add_wait_queue_exclusive(sk->sk_sleep, &wait); 842 add_wait_queue_exclusive(sk_sleep(sk), &wait);
843 for (;;) { 843 for (;;) {
844 __set_current_state(TASK_INTERRUPTIBLE); 844 __set_current_state(TASK_INTERRUPTIBLE);
845 if (sk->sk_shutdown & RCV_SHUTDOWN) 845 if (sk->sk_shutdown & RCV_SHUTDOWN)
@@ -859,7 +859,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
859 break; 859 break;
860 } 860 }
861 __set_current_state(TASK_RUNNING); 861 __set_current_state(TASK_RUNNING);
862 remove_wait_queue(sk->sk_sleep, &wait); 862 remove_wait_queue(sk_sleep(sk), &wait);
863 return rc; 863 return rc;
864} 864}
865 865
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index b9ef682230a0..9005f6daeab5 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -24,6 +24,7 @@
24#include <net/sock.h> 24#include <net/sock.h>
25#include <linux/if_arp.h> 25#include <linux/if_arp.h>
26#include <net/x25.h> 26#include <net/x25.h>
27#include <net/x25device.h>
27 28
28static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb) 29static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
29{ 30{
@@ -115,19 +116,22 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
115 } 116 }
116 117
117 switch (skb->data[0]) { 118 switch (skb->data[0]) {
118 case 0x00: 119
119 skb_pull(skb, 1); 120 case X25_IFACE_DATA:
120 if (x25_receive_data(skb, nb)) { 121 skb_pull(skb, 1);
121 x25_neigh_put(nb); 122 if (x25_receive_data(skb, nb)) {
122 goto out; 123 x25_neigh_put(nb);
123 } 124 goto out;
124 break; 125 }
125 case 0x01: 126 break;
126 x25_link_established(nb); 127
127 break; 128 case X25_IFACE_CONNECT:
128 case 0x02: 129 x25_link_established(nb);
129 x25_link_terminated(nb); 130 break;
130 break; 131
132 case X25_IFACE_DISCONNECT:
133 x25_link_terminated(nb);
134 break;
131 } 135 }
132 x25_neigh_put(nb); 136 x25_neigh_put(nb);
133drop: 137drop:
@@ -148,7 +152,7 @@ void x25_establish_link(struct x25_neigh *nb)
148 return; 152 return;
149 } 153 }
150 ptr = skb_put(skb, 1); 154 ptr = skb_put(skb, 1);
151 *ptr = 0x01; 155 *ptr = X25_IFACE_CONNECT;
152 break; 156 break;
153 157
154#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE) 158#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
@@ -184,7 +188,7 @@ void x25_terminate_link(struct x25_neigh *nb)
184 } 188 }
185 189
186 ptr = skb_put(skb, 1); 190 ptr = skb_put(skb, 1);
187 *ptr = 0x02; 191 *ptr = X25_IFACE_DISCONNECT;
188 192
189 skb->protocol = htons(ETH_P_X25); 193 skb->protocol = htons(ETH_P_X25);
190 skb->dev = nb->dev; 194 skb->dev = nb->dev;
@@ -200,7 +204,7 @@ void x25_send_frame(struct sk_buff *skb, struct x25_neigh *nb)
200 switch (nb->dev->type) { 204 switch (nb->dev->type) {
201 case ARPHRD_X25: 205 case ARPHRD_X25:
202 dptr = skb_push(skb, 1); 206 dptr = skb_push(skb, 1);
203 *dptr = 0x00; 207 *dptr = X25_IFACE_DATA;
204 break; 208 break;
205 209
206#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE) 210#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)