X25: Use identifiers for lapbether device to x25 interface
Change magic numbers to identifiers for X25 interface. Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7eeeacf0b5
commit
4d99503e0b
@ -139,7 +139,7 @@ static int lapbeth_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 = 0x00;
|
*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);
|
||||||
@ -161,14 +161,14 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,
|
|||||||
goto drop;
|
goto drop;
|
||||||
|
|
||||||
switch (skb->data[0]) {
|
switch (skb->data[0]) {
|
||||||
case 0x00:
|
case X25_IFACE_DATA:
|
||||||
break;
|
break;
|
||||||
case 0x01:
|
case X25_IFACE_CONNECT:
|
||||||
if ((err = lapb_connect_request(dev)) != LAPB_OK)
|
if ((err = lapb_connect_request(dev)) != LAPB_OK)
|
||||||
printk(KERN_ERR "lapbeth: lapb_connect_request "
|
printk(KERN_ERR "lapbeth: lapb_connect_request "
|
||||||
"error: %d\n", err);
|
"error: %d\n", err);
|
||||||
goto drop;
|
goto drop;
|
||||||
case 0x02:
|
case X25_IFACE_DISCONNECT:
|
||||||
if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
|
if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
|
||||||
printk(KERN_ERR "lapbeth: lapb_disconnect_request "
|
printk(KERN_ERR "lapbeth: lapb_disconnect_request "
|
||||||
"err: %d\n", err);
|
"err: %d\n", err);
|
||||||
@ -225,7 +225,7 @@ static void lapbeth_connected(struct net_device *dev, int reason)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr = skb_put(skb, 1);
|
ptr = skb_put(skb, 1);
|
||||||
*ptr = 0x01;
|
*ptr = X25_IFACE_CONNECT;
|
||||||
|
|
||||||
skb->protocol = x25_type_trans(skb, dev);
|
skb->protocol = x25_type_trans(skb, dev);
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
@ -242,7 +242,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr = skb_put(skb, 1);
|
ptr = skb_put(skb, 1);
|
||||||
*ptr = 0x02;
|
*ptr = X25_IFACE_DISCONNECT;
|
||||||
|
|
||||||
skb->protocol = x25_type_trans(skb, dev);
|
skb->protocol = x25_type_trans(skb, dev);
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
|
Loading…
Reference in New Issue
Block a user