Commit 90b3e030 authored by andrew hendry's avatar andrew hendry Committed by David S. Miller

X25: Use identifiers for hdlc x25 device to x25 interface

Change magic numbers to identifiers for X25 interface.
Signed-off-by: default avatarAndrew Hendry <andrew.hendry@gmail.com>
Acked-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d747314
...@@ -49,14 +49,14 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code) ...@@ -49,14 +49,14 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
static void x25_connected(struct net_device *dev, int reason) static void x25_connected(struct net_device *dev, int reason)
{ {
x25_connect_disconnect(dev, reason, 1); x25_connect_disconnect(dev, reason, X25_IFACE_CONNECT);
} }
static void x25_disconnected(struct net_device *dev, int reason) static void x25_disconnected(struct net_device *dev, int reason)
{ {
x25_connect_disconnect(dev, reason, 2); x25_connect_disconnect(dev, reason, X25_IFACE_DISCONNECT);
} }
...@@ -71,7 +71,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) ...@@ -71,7 +71,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
return NET_RX_DROP; return NET_RX_DROP;
ptr = skb->data; ptr = skb->data;
*ptr = 0; *ptr = X25_IFACE_DATA;
skb->protocol = x25_type_trans(skb, dev); skb->protocol = x25_type_trans(skb, dev);
return netif_rx(skb); return netif_rx(skb);
...@@ -94,13 +94,13 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -94,13 +94,13 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
/* X.25 to LAPB */ /* X.25 to LAPB */
switch (skb->data[0]) { switch (skb->data[0]) {
case 0: /* Data to be transmitted */ case X25_IFACE_DATA: /* Data to be transmitted */
skb_pull(skb, 1); skb_pull(skb, 1);
if ((result = lapb_data_request(dev, skb)) != LAPB_OK) if ((result = lapb_data_request(dev, skb)) != LAPB_OK)
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
case 1: case X25_IFACE_CONNECT:
if ((result = lapb_connect_request(dev))!= LAPB_OK) { if ((result = lapb_connect_request(dev))!= LAPB_OK) {
if (result == LAPB_CONNECTED) if (result == LAPB_CONNECTED)
/* Send connect confirm. msg to level 3 */ /* 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,7 +112,7 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
} }
break; break;
case 2: case X25_IFACE_DISCONNECT:
if ((result = lapb_disconnect_request(dev)) != LAPB_OK) { if ((result = lapb_disconnect_request(dev)) != LAPB_OK) {
if (result == LAPB_NOTCONNECTED) if (result == LAPB_NOTCONNECTED)
/* Send disconnect confirm. msg to level 3 */ /* Send disconnect confirm. msg to level 3 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment