diff options
author | Andrew Hendry <andrew.hendry@gmail.com> | 2010-04-22 19:12:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-22 19:12:36 -0400 |
commit | 5ebfbc06aae941484326c9e7e9c4d85330f63591 (patch) | |
tree | 35719a9023c47bdaaf25771c03836a15150dc741 /net/x25 | |
parent | f68c224fedff2157f3fad7f7da674cbc96567c84 (diff) |
X25: Add if_x25.h and x25 to device identifiers
V2 Feedback from John Hughes.
- Add header for userspace implementations such as xot/xoe to use
- Use explicit values for interface stability
- No changes to driver patches
V1
- Use identifiers instead of magic numbers for X25 layer 3 to device interface.
- Also fixed checkpatch notes on updated code.
[ Add new user header to include/linux/Kbuild -DaveM ]
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/x25_dev.c | 36 |
1 files changed, 20 insertions, 16 deletions
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 | ||
28 | static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb) | 29 | static 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); |
133 | drop: | 137 | drop: |
@@ -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) |