Commit 4150bbf3 authored by andrew hendry's avatar andrew hendry Committed by David S. Miller

X25: Use identifiers for isdn device to x25 interface

Change magic numbers to identifiers for X25 interface.
also minor check patch formatting.
Signed-off-by: default avatarAndrew Hendry <andrew.hendry@gmail.com>
Acked-by: default avatarKarsten Keil <isdn@linux-pingi.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5ebfbc06
...@@ -194,7 +194,7 @@ static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb ...@@ -194,7 +194,7 @@ static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb
if ( ( (ix25_pdata_t*) (cprot->proto_data) ) if ( ( (ix25_pdata_t*) (cprot->proto_data) )
-> state == WAN_CONNECTED ){ -> state == WAN_CONNECTED ){
if( skb_push(skb, 1)){ if( skb_push(skb, 1)){
skb -> data[0]=0x00; skb->data[0] = X25_IFACE_DATA;
skb->protocol = x25_type_trans(skb, cprot->net_dev); skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb); netif_rx(skb);
return 0; return 0;
...@@ -224,7 +224,7 @@ static int isdn_x25iface_connect_ind(struct concap_proto *cprot) ...@@ -224,7 +224,7 @@ static int isdn_x25iface_connect_ind(struct concap_proto *cprot)
skb = dev_alloc_skb(1); skb = dev_alloc_skb(1);
if( skb ){ if( skb ){
*( skb_put(skb, 1) ) = 0x01; *(skb_put(skb, 1)) = X25_IFACE_CONNECT;
skb->protocol = x25_type_trans(skb, cprot->net_dev); skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb); netif_rx(skb);
return 0; return 0;
...@@ -253,7 +253,7 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *cprot) ...@@ -253,7 +253,7 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
*state_p = WAN_DISCONNECTED; *state_p = WAN_DISCONNECTED;
skb = dev_alloc_skb(1); skb = dev_alloc_skb(1);
if( skb ){ if( skb ){
*( skb_put(skb, 1) ) = 0x02; *(skb_put(skb, 1)) = X25_IFACE_DISCONNECT;
skb->protocol = x25_type_trans(skb, cprot->net_dev); skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb); netif_rx(skb);
return 0; return 0;
...@@ -272,9 +272,10 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) ...@@ -272,9 +272,10 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
unsigned char firstbyte = skb->data[0]; unsigned char firstbyte = skb->data[0];
enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state; enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state;
int ret = 0; int ret = 0;
IX25DEBUG( "isdn_x25iface_xmit: %s first=%x state=%d \n", MY_DEVNAME(cprot -> net_dev), firstbyte, *state ); IX25DEBUG("isdn_x25iface_xmit: %s first=%x state=%d\n",
MY_DEVNAME(cprot->net_dev), firstbyte, *state);
switch ( firstbyte ){ switch ( firstbyte ){
case 0x00: /* dl_data request */ case X25_IFACE_DATA:
if( *state == WAN_CONNECTED ){ if( *state == WAN_CONNECTED ){
skb_pull(skb, 1); skb_pull(skb, 1);
cprot -> net_dev -> trans_start = jiffies; cprot -> net_dev -> trans_start = jiffies;
...@@ -285,7 +286,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) ...@@ -285,7 +286,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
} }
illegal_state_warn( *state, firstbyte ); illegal_state_warn( *state, firstbyte );
break; break;
case 0x01: /* dl_connect request */ case X25_IFACE_CONNECT:
if( *state == WAN_DISCONNECTED ){ if( *state == WAN_DISCONNECTED ){
*state = WAN_CONNECTING; *state = WAN_CONNECTING;
ret = cprot -> dops -> connect_req(cprot); ret = cprot -> dops -> connect_req(cprot);
...@@ -298,7 +299,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) ...@@ -298,7 +299,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
illegal_state_warn( *state, firstbyte ); illegal_state_warn( *state, firstbyte );
} }
break; break;
case 0x02: /* dl_disconnect request */ case X25_IFACE_DISCONNECT:
switch ( *state ){ switch ( *state ){
case WAN_DISCONNECTED: case WAN_DISCONNECTED:
/* Should not happen. However, give upper layer a /* Should not happen. However, give upper layer a
...@@ -318,7 +319,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) ...@@ -318,7 +319,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
illegal_state_warn( *state, firstbyte ); illegal_state_warn( *state, firstbyte );
} }
break; break;
case 0x03: /* changing lapb parameters requested */ case X25_IFACE_PARAMS:
printk(KERN_WARNING "isdn_x25iface_xmit: setting of lapb" printk(KERN_WARNING "isdn_x25iface_xmit: setting of lapb"
" options not yet supported\n"); " options not yet supported\n");
break; break;
......
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