Fix bug in LLC state tables, remove old LLC stack, etc

Additional changes:
. remove last typedefs (for structs) in new LLC stack
. use C99 labeled elements in sysctl_net_802.c and sysctl_net.c
parent d52a86be
#include <linux/skbuff.h>
#define LLC_MODULE
typedef struct llc_struct llc;
typedef struct llc_struct *llcptr;
/*
* LLC private data area structure.
*/
struct llc_struct
{
char eye[4]; /* To recognize llc area in dump */
int retry_count; /* LLC link state variables */
unsigned char name[9]; /* name of this llc instance */
unsigned char s_flag;
unsigned char p_flag;
unsigned char f_flag;
unsigned char data_flag;
unsigned char cause_flag;
unsigned char vs; /* Send state variable */
unsigned char vr; /* Receive state variable */
unsigned char remote_busy;
unsigned char state; /* Current state of type2 llc procedure */
int n1; /* Maximum number of bytes in I pdu 7.8.2 */
int n2; /* Naximum number of retransmissions 7.8.2 */
unsigned char k; /* Transmit window size 7.8.4, tw in IBM doc*/
unsigned char rw; /* Receive window size */
struct
{
/*
* FRMR_RSP info field structure: 5.4.2.3.5 p55
*/
unsigned char cntl1;
unsigned char cntl2;
unsigned char vs;
unsigned char vr_cr;
unsigned char xxyz;
} frmr_info_fld;
/*
* Timers in 7.8.1 page 78
*/
#define P_TIMER 0
#define REJ_TIMER 1
#define ACK_TIMER 2
#define BUSY_TIMER 3
unsigned long timer_expire_time[4];
unsigned char timer_state[4]; /* The state of each timer */
#define TIMER_IDLE 0
#define TIMER_RUNNING 1
#define TIMER_EXPIRED 2
unsigned long timer_interval[4];
struct timer_list tl[4];
/*
* Client entry point, called by the LLC.
*/
void (*llc_event)(struct llc_struct *);
/*
* Mux and Demux variables
*/
char * client_data; /* Pointer to clients context */
unsigned char local_sap;
unsigned char remote_sap ;
char remote_mac[MAX_ADDR_LEN]; /* MAC address of remote session partner */
struct net_device *dev; /* Device we are attached to */
unsigned char llc_mode; /* See doc 7.1 on p70 */
#define MODE_ADM 1
#define MODE_ABM 2
int llc_callbacks; /* Pending callbacks */
#define LLC_CONN_INDICATION 1 /* We have to ensure the names don't */
#define LLC_CONN_CONFIRM 2 /* mix up with the 802 state table */
#define LLC_DATA_INDIC 4
#define LLC_DISC_INDICATION 8
#define LLC_RESET_INDIC_LOC 16
#define LLC_RESET_INDIC_REM 32
#define LLC_RST_CONFIRM 64
#define LLC_FRMR_RECV 128
#define LLC_FRMR_SENT 256
#define LLC_REMOTE_BUSY 512
#define LLC_REMOTE_NOTBUSY 1024
#define LLC_TEST_INDICATION 2048
#define LLC_XID_INDICATION 4096
#define LLC_UI_DATA 8192
struct sk_buff *inc_skb; /* Saved data buffer for indications */
struct sk_buff_head rtq; /* Retransmit queue */
struct sk_buff_head atq; /* Await transit queue */
unsigned char xid_count;
struct llc_struct *nextllc; /* ptr to next llc struct in proto chain */
};
#define ADD_TO_RTQ(skb) skb_queue_tail(&lp->rtq,skb)
#define ADD_TO_ATQ(skb) skb_queue_tail(&lp->atq,skb)
void llc_cancel_timers(llcptr lp);
int llc_decode_frametype(frameptr fr);
llcptr llc_find(void);
int llc_free_acknowledged_skbs(llcptr lp, unsigned char ack);
void llc_handle_xid_indication( char *chsp, short int ll, char *xid_data);
void llc_interpret_pseudo_code(llcptr lp, int pc_label, struct sk_buff *skb, char type);
void llc_add_to_queue(struct sk_buff *skb, struct sk_buff **f, struct sk_buff **b);
void llc_process_otype2_frame(llcptr lp, struct sk_buff *skb, char type);
struct sk_buff *llc_pull_from_atq(llcptr lp);
int llc_resend_ipdu(llcptr lp, unsigned char ack_nr, unsigned char type, char p);
void llc_sendpdu(llcptr lp, char type, char pf, int data_len, char *pdu_data);
void llc_sendipdu(llcptr lp, char type, char pf, struct sk_buff *skb);
void llc_start_timer(llcptr lp, int t);
void llc_stop_timer(llcptr lp, int t);
void llc_timer_expired(llcptr lp, int t);
int llc_validate_seq_nos(llcptr lp, frameptr fr);
int llc_data_request(llcptr lp, struct sk_buff *skb);
void llc_unit_data_request(llcptr lp, int ll, char * data);
void llc_disconnect_request(llcptr lp);
void llc_connect_request(llcptr lp);
void llc_xid_request(llcptr lp, char opt, int data_len, char *pdu_data);
void llc_test_request(llcptr lp, int data_len, char *pdu_data);
int register_cl2llc_client(llcptr llc, const char *device, void (*ops)(llcptr), u8 *rmac, u8 ssap, u8 dsap);
void unregister_cl2llc_client(llcptr lp);
int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb );
......@@ -191,34 +191,34 @@
(info->ind_bits = ( (info->ind_bits & 0xEF) | (((u8) ind) & 0x10)))
/* Sequence-numbered PDU format (4 bytes in length) */
typedef struct llc_pdu_sn {
struct llc_pdu_sn {
u8 dsap;
u8 ssap;
u8 ctrl_1;
u8 ctrl_2;
} llc_pdu_sn_t;
};
/* Un-numbered PDU format (3 bytes in length) */
typedef struct llc_pdu_un {
struct llc_pdu_un {
u8 dsap;
u8 ssap;
u8 ctrl_1;
} llc_pdu_un_t;
};
/* LLC Type 1 XID command/response information fields format */
typedef struct llc_xid_info {
struct llc_xid_info {
u8 fmt_id; /* always 0x18 for LLC */
u8 type; /* different if NULL/non-NULL LSAP */
u8 rw; /* sender receive window */
} llc_xid_info_t;
};
/* LLC Type 2 FRMR response information field format */
typedef struct llc_frmr_info {
struct llc_frmr_info {
u16 rej_pdu_ctrl; /* bits 1-8 if U-PDU */
u8 curr_ssv; /* current send state variable val */
u8 curr_rsv; /* current receive state variable */
u8 ind_bits; /* indicator bits set with macro */
} llc_frmr_info_t;
};
extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type);
extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value);
......@@ -246,7 +246,8 @@ extern int llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
u8 rx_window);
extern int llc_pdu_init_as_test_rsp(struct sk_buff *skb,
struct sk_buff *ev_skb);
extern int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, llc_pdu_sn_t *prev_pdu,
extern int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb,
struct llc_pdu_sn *prev_pdu,
u8 f_bit, u8 vs, u8 vr, u8 vzyxw);
extern int llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr);
extern int llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr);
......
......@@ -2,15 +2,14 @@
# Makefile for the Linux 802.x protocol layers.
#
export-objs := llc_macinit.o p8022.o psnap.o
export-objs := p8022.o psnap.o tr.o
obj-y := p8023.o
# Check the p8022 selections against net/core/Makefile.
obj-$(CONFIG_SYSCTL) += sysctl_net_802.o
obj-$(CONFIG_LLC) += p8022.o psnap.o llc_sendpdu.o llc_utility.o \
cl2llc.o llc_macinit.o
obj-$(CONFIG_TR) += p8022.o psnap.o tr.o
obj-$(CONFIG_LLC) += p8022.o psnap.o
obj-$(CONFIG_TR) += p8022.o psnap.o tr.o sysctl_net_802.o
obj-$(CONFIG_NET_FC) += fc.o
obj-$(CONFIG_FDDI) += fddi.o
obj-$(CONFIG_HIPPI) += hippi.o
......@@ -18,25 +17,3 @@ obj-$(CONFIG_IPX) += p8022.o psnap.o
obj-$(CONFIG_ATALK) += p8022.o psnap.o
include $(TOPDIR)/Rules.make
# Dependencies on generated files need to be listed explicitly
$(obj)/cl2llc.o: $(obj)/transit/pdutr.h $(obj)/transit/timertr.h \
$(obj)/pseudo/pseudocode.h
# Generated files
$(obj)/transit/pdutr.h: $(src)/transit/pdutr.pre $(src)/transit/compile.awk
awk -f $(src)/transit/compile.awk $< >$@
$(obj)/transit/timertr.h: $(src)/transit/timertr.pre $(src)/transit/compile.awk
awk -f $(src)/transit/compile.awk $< >$@
$(obj)/pseudo/pseudocode.h: $(src)/pseudo/pseudocode \
$(src)/pseudo/opcd2num.sed \
$(src)/pseudo/compile.awk
sed -f $(src)/pseudo/opcd2num.sed $< | \
awk -f $(src)/pseudo/compile.awk >$@
$(obj)/cl2llc.c: $(src)/cl2llc.pre $(src)/pseudo/opcd2num.sed
sed -f $(src)/pseudo/opcd2num.sed $< >$@
Remaining Problems:
1. Serialization of access to variables in the llc structure
by mac_data_indicate(), timer expired functions, and data_request() .
There is not serialization of any kind right now.
While testing, I have not seen any problems that stem from this lack of
serialization, but it wories me...
2. The code is currently able to handle one connection only,
there is more work in register_cl2llc_client() to make a chain
of llc structures and in mac_data_indicate() to find back
the llc structure addressed by an incoming frame.
According to IEEE, connections are identified by (remote mac + local mac
+ dsap + ssap). dsap and ssap do not seem important: existing applications
always use the same dsap/ssap. Its probably sufficient to index on
the remote mac only.
3. There is no test to see if the transmit window is full in data_request()
as described in the doc p73, "7.5.1 Sending I PDUs" 3th alinea.
The pdus presented to data_request() could probably go on the
awaiting-transmit-queue (atq). The real difficulty is coding a test
to see if the transmit window is used up and to send the queue
when space in the window becomes available.
As I have no network layer that can generate a continous flow of pdus it is
difficult to simulate a remote busy condition and hence to test the code
to handle it.
4. A simple flow control algorithm, steering the size of the transmit
window would be nice to have.
/*
* NET An implementation of the IEEE 802.2 LLC protocol for the
* LINUX operating system. LLC is implemented as a set of
* state machines and callbacks for higher networking layers.
*
* Class 2 llc algorithm.
* Pseudocode interpreter, transition table lookup,
* data_request & indicate primitives...
*
* Code for initialization, termination, registration and
* MAC layer glue.
*
* Copyright Tim Alpaerts,
* <Tim_Alpaerts@toyota-motor-europe.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Changes
* Alan Cox : Chainsawed into Linux format
* Modified to use llc_ names
* Changed callbacks
*
* This file must be processed by sed before it can be compiled.
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/p8022.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <asm/byteorder.h>
#include "pseudo/pseudocode.h"
#include "transit/pdutr.h"
#include "transit/timertr.h"
#include <net/llc_frame.h>
#include <net/llc.h>
/*
* Data_request() is called by the client to present a data unit
* to the llc for transmission.
* In the future this function should also check if the transmit window
* allows the sending of another pdu, and if not put the skb on the atq
* for deferred sending.
*/
int llc_data_request(llcptr lp, struct sk_buff *skb)
{
if (skb_headroom(skb) < (lp->dev->hard_header_len +4)){
printk("cl2llc: data_request() not enough headroom in skb\n");
return -1;
};
skb_push(skb, 4);
if ((lp->state != NORMAL) && (lp->state != BUSY) && (lp->state != REJECT))
{
printk("cl2llc: data_request() while no llc connection\n");
return -1;
}
if (lp->remote_busy)
{ /* if the remote llc is BUSY, */
ADD_TO_ATQ(skb); /* save skb in the await transmit queue */
return 0;
}
else
{
/*
* Else proceed with xmit
*/
switch(lp->state)
{
case NORMAL:
if(lp->p_flag)
llc_interpret_pseudo_code(lp, NORMAL2, skb, NO_FRAME);
else
llc_interpret_pseudo_code(lp, NORMAL1, skb, NO_FRAME);
break;
case BUSY:
if (lp->p_flag)
llc_interpret_pseudo_code(lp, BUSY2, skb, NO_FRAME);
else
llc_interpret_pseudo_code(lp, BUSY1, skb, NO_FRAME);
break;
case REJECT:
if (lp->p_flag)
llc_interpret_pseudo_code(lp, REJECT2, skb, NO_FRAME);
else
llc_interpret_pseudo_code(lp, REJECT1, skb, NO_FRAME);
break;
default:;
}
if(lp->llc_callbacks)
{
lp->llc_event(lp);
lp->llc_callbacks=0;
}
return 0;
}
}
/*
* Disconnect_request() requests that the llc to terminate a connection
*/
void disconnect_request(llcptr lp)
{
if ((lp->state == NORMAL) ||
(lp->state == BUSY) ||
(lp->state == REJECT) ||
(lp->state == AWAIT) ||
(lp->state == AWAIT_BUSY) ||
(lp->state == AWAIT_REJECT))
{
lp->state = D_CONN;
llc_interpret_pseudo_code(lp, SH1, NULL, NO_FRAME);
if(lp->llc_callbacks)
{
lp->llc_event(lp);
lp->llc_callbacks=0;
}
/*
* lp may be invalid after the callback
*/
}
}
/*
* Connect_request() requests that the llc to start a connection
*/
void connect_request(llcptr lp)
{
if (lp->state == ADM)
{
lp->state = SETUP;
llc_interpret_pseudo_code(lp, ADM1, NULL, NO_FRAME);
if(lp->llc_callbacks)
{
lp->llc_event(lp);
lp->llc_callbacks=0;
}
/*
* lp may be invalid after the callback
*/
}
}
/*
* Interpret_pseudo_code() executes the actions in the connection component
* state transition table. Table 4 in document on p88.
*
* If this function is called to handle an incoming pdu, skb will point
* to the buffer with the pdu and type will contain the decoded pdu type.
*
* If called by data_request skb points to an skb that was skb_alloc-ed by
* the llc client to hold the information unit to be transmitted, there is
* no valid type in this case.
*
* If called because a timer expired no skb is passed, and there is no
* type.
*/
void llc_interpret_pseudo_code(llcptr lp, int pc_label, struct sk_buff *skb,
char type)
{
short int pc; /* program counter in pseudo code array */
char p_flag_received;
frameptr fr;
int resend_count; /* number of pdus resend by llc_resend_ipdu() */
int ack_count; /* number of pdus acknowledged */
struct sk_buff *skb2;
if (skb != NULL)
{
fr = (frameptr) skb->data;
}
else
fr = NULL;
pc = pseudo_code_idx[pc_label];
while(pseudo_code[pc])
{
switch(pseudo_code[pc])
{
case IF_F=1_CLEAR_REMOTE_BUSY:
if ((type != I_CMD) || (fr->i_hdr.i_pflag == 0))
break;
case CLEAR_REMOTE_BUSY:
lp->remote_busy = 0;
llc_stop_timer(lp, BUSY_TIMER);
if ((lp->state == NORMAL) ||
(lp->state == REJECT) ||
(lp->state == BUSY))
{
skb2 = llc_pull_from_atq(lp);
if (skb2 != NULL)
llc_start_timer(lp, ACK_TIMER);
while (skb2 != NULL)
{
llc_sendipdu( lp, I_CMD, 0, skb2);
skb2 = llc_pull_from_atq(lp);
}
}
break;
case CONNECT_INDICATION:
lp->state = NORMAL; /* needed to eliminate connect_response() */
lp->llc_mode = MODE_ABM;
lp->llc_callbacks|=LLC_CONN_INDICATION;
break;
case CONNECT_CONFIRM:
lp->llc_mode = MODE_ABM;
lp->llc_callbacks|=LLC_CONN_CONFIRM;
break;
case DATA_INDICATION:
skb_pull(skb, 4);
lp->inc_skb=skb;
lp->llc_callbacks|=LLC_DATA_INDIC;
break;
case DISCONNECT_INDICATION:
lp->llc_mode = MODE_ADM;
lp->llc_callbacks|=LLC_DISC_INDICATION;
break;
case RESET_INDICATION(LOCAL):
lp->llc_callbacks|=LLC_RESET_INDIC_LOC;
break;
case RESET_INDICATION(REMOTE):
lp->llc_callbacks|=LLC_RESET_INDIC_REM;
break;
case RESET_CONFIRM:
lp->llc_callbacks|=LLC_RST_CONFIRM;
break;
case REPORT_STATUS(FRMR_RECEIVED):
lp->llc_callbacks|=LLC_FRMR_RECV;
break;
case REPORT_STATUS(FRMR_SENT):
lp->llc_callbacks|=LLC_FRMR_SENT;
break;
case REPORT_STATUS(REMOTE_BUSY):
lp->llc_callbacks|=LLC_REMOTE_BUSY;
break;
case REPORT_STATUS(REMOTE_NOT_BUSY):
lp->llc_callbacks|=LLC_REMOTE_NOTBUSY;
break;
case SEND_DISC_CMD(P=X):
llc_sendpdu(lp, DISC_CMD, lp->f_flag, 0, NULL);
break;
case SEND_DM_RSP(F=X):
llc_sendpdu(lp, DM_RSP, 0, 0, NULL);
break;
case SEND_FRMR_RSP(F=X):
lp->frmr_info_fld.cntl1 = fr->pdu_cntl.byte1;
lp->frmr_info_fld.cntl2 = fr->pdu_cntl.byte2;
lp->frmr_info_fld.vs = lp->vs;
lp->frmr_info_fld.vr_cr = lp->vr;
llc_sendpdu(lp, FRMR_RSP, 0, 5, (char *) &lp->frmr_info_fld);
break;
case RE-SEND_FRMR_RSP(F=0):
llc_sendpdu(lp, FRMR_RSP, 0, 5, (char *) &lp->frmr_info_fld);
break;
case RE-SEND_FRMR_RSP(F=P):
llc_sendpdu(lp, FRMR_RSP, lp->p_flag,
5, (char *) &lp->frmr_info_fld);
break;
case SEND_I_CMD(P=1):
llc_sendipdu(lp, I_CMD, 1, skb);
break;
case RE-SEND_I_CMD(P=1):
resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 1);
break;
case RE-SEND_I_CMD(P=1)_OR_SEND_RR:
resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 1);
if (resend_count == 0)
{
llc_sendpdu(lp, RR_CMD, 1, 0, NULL);
}
break;
case SEND_I_XXX(X=0):
llc_sendipdu(lp, I_CMD, 0, skb);
break;
case RE-SEND_I_XXX(X=0):
resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 0);
break;
case RE-SEND_I_XXX(X=0)_OR_SEND_RR:
resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 0);
if (resend_count == 0)
{
llc_sendpdu(lp, RR_CMD, 0, 0, NULL);
}
break;
case RE-SEND_I_RSP(F=1):
resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_RSP, 1);
break;
case SEND_REJ_CMD(P=1):
llc_sendpdu(lp, REJ_CMD, 1, 0, NULL);
break;
case SEND_REJ_RSP(F=1):
llc_sendpdu(lp, REJ_RSP, 1, 0, NULL);
break;
case SEND_REJ_XXX(X=0):
if (IS_RSP(fr))
llc_sendpdu(lp, REJ_CMD, 0, 0, NULL);
else
llc_sendpdu(lp, REJ_RSP, 0, 0, NULL);
break;
case SEND_RNR_CMD(F=1):
llc_sendpdu(lp, RNR_CMD, 1, 0, NULL);
break;
case SEND_RNR_RSP(F=1):
llc_sendpdu(lp, RNR_RSP, 1, 0, NULL);
break;
case SEND_RNR_XXX(X=0):
if (IS_RSP(fr))
llc_sendpdu(lp, RNR_CMD, 0, 0, NULL);
else
llc_sendpdu(lp, RNR_RSP, 0, 0, NULL);
break;
case SET_REMOTE_BUSY:
if (lp->remote_busy == 0)
{
lp->remote_busy = 1;
llc_start_timer(lp, BUSY_TIMER);
lp->llc_callbacks|=LLC_REMOTE_BUSY;
}
else if (lp->timer_state[BUSY_TIMER] == TIMER_IDLE)
{
llc_start_timer(lp, BUSY_TIMER);
}
break;
case OPTIONAL_SEND_RNR_XXX(X=0):
if (IS_RSP(fr))
llc_sendpdu(lp, RNR_CMD, 0, 0, NULL);
else
llc_sendpdu(lp, RNR_RSP, 0, 0, NULL);
break;
case SEND_RR_CMD(P=1):
llc_sendpdu(lp, RR_CMD, 1, 0, NULL);
break;
case SEND_ACKNOWLEDGE_CMD(P=1):
llc_sendpdu(lp, RR_CMD, 1, 0, NULL);
break;
case SEND_RR_RSP(F=1):
llc_sendpdu(lp, RR_RSP, 1, 0, NULL);
break;
case SEND_ACKNOWLEDGE_RSP(F=1):
llc_sendpdu(lp, RR_RSP, 1, 0, NULL);
break;
case SEND_RR_XXX(X=0):
llc_sendpdu(lp, RR_RSP, 0, 0, NULL);
break;
case SEND_ACKNOWLEDGE_XXX(X=0):
if (IS_RSP(fr))
llc_sendpdu(lp, RR_CMD, 0, 0, NULL);
else
llc_sendpdu(lp, RR_RSP, 0, 0, NULL);
break;
case SEND_SABME_CMD(P=X):
llc_sendpdu(lp, SABME_CMD, 0, 0, NULL);
lp->f_flag = 0;
break;
case SEND_UA_RSP(F=X):
llc_sendpdu(lp, UA_RSP, lp->f_flag, 0, NULL);
break;
case S_FLAG:=0:
lp->s_flag = 0;
break;
case S_FLAG:=1:
lp->s_flag = 1;
break;
case START_P_TIMER:
if(lp->timer_state[P_TIMER] == TIMER_RUNNING)
llc_stop_timer(lp, P_TIMER);
llc_start_timer(lp, P_TIMER);
if (lp->p_flag == 0)
{
lp->retry_count = 0;
lp->p_flag = 1;
}
break;
case START_ACK_TIMER_IF_NOT_RUNNING:
if (lp->timer_state[ACK_TIMER] == TIMER_IDLE)
llc_start_timer(lp, ACK_TIMER);
break;
case START_ACK_TIMER:
llc_start_timer(lp, ACK_TIMER);
break;
case START_REJ_TIMER:
llc_start_timer(lp, REJ_TIMER);
break;
case STOP_ACK_TIMER:
llc_stop_timer(lp, ACK_TIMER);
break;
case STOP_P_TIMER:
llc_stop_timer(lp, ACK_TIMER);
lp->p_flag = 0;
break;
case IF_DATA_FLAG=2_STOP_REJ_TIMER:
if (lp->data_flag == 2)
llc_stop_timer(lp, REJ_TIMER);
break;
case STOP_REJ_TIMER:
llc_stop_timer(lp, REJ_TIMER);
break;
case STOP_ALL_TIMERS:
llc_stop_timer(lp, ACK_TIMER);
llc_stop_timer(lp, P_TIMER);
llc_stop_timer(lp, REJ_TIMER);
llc_stop_timer(lp, BUSY_TIMER);
break;
case STOP_OTHER_TIMERS:
llc_stop_timer(lp, P_TIMER);
llc_stop_timer(lp, REJ_TIMER);
llc_stop_timer(lp, BUSY_TIMER);
break;
case UPDATE_N(R)_RECEIVED:
ack_count = llc_free_acknowledged_skbs(lp,
(unsigned char) fr->s_hdr.nr);
if (ack_count > 0)
{
lp->retry_count = 0;
llc_stop_timer(lp, ACK_TIMER);
if (skb_peek(&lp->rtq) != NULL)
{
/*
* Re-transmit queue not empty
*/
llc_start_timer(lp, ACK_TIMER);
}
}
break;
case UPDATE_P_FLAG:
if (IS_UFRAME(fr))
p_flag_received = fr->u_hdr.u_pflag;
else
p_flag_received = fr->i_hdr.i_pflag;
if ((fr->pdu_hdr.ssap & 0x01) && (p_flag_received))
{
lp->p_flag = 0;
llc_stop_timer(lp, P_TIMER);
}
break;
case DATA_FLAG:=2:
lp->data_flag = 2;
break;
case DATA_FLAG:=0:
lp->data_flag = 0;
break;
case DATA_FLAG:=1:
lp->data_flag = 1;
break;
case IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1:
if (lp->data_flag == 0)
lp->data_flag = 1;
break;
case P_FLAG:=0:
lp->p_flag = 0;
break;
case P_FLAG:=P:
lp->p_flag = lp->f_flag;
break;
case REMOTE_BUSY:=0:
lp->remote_busy = 0;
break;
case RETRY_COUNT:=0:
lp->retry_count = 0;
break;
case RETRY_COUNT:=RETRY_COUNT+1:
lp->retry_count++;
break;
case V(R):=0:
lp->vr = 0;
break;
case V(R):=V(R)+1:
lp->vr++;
break;
case V(S):=0:
lp->vs = 0;
break;
case V(S):=N(R):
lp->vs = fr->i_hdr.nr;
break;
case F_FLAG:=P:
if (IS_UFRAME(fr))
lp->f_flag = fr->u_hdr.u_pflag;
else
lp->f_flag = fr->i_hdr.i_pflag;
break;
default:;
}
pc++;
}
}
/*
* Process_otype2_frame will handle incoming frames
* for 802.2 Type 2 Procedure.
*/
void llc_process_otype2_frame(llcptr lp, struct sk_buff *skb, char type)
{
int idx; /* index in transition table */
int pc_label; /* action to perform, from tr tbl */
int validation; /* result of validate_seq_nos */
int p_flag_received; /* p_flag in received frame */
frameptr fr;
fr = (frameptr) skb->data;
if (IS_UFRAME(fr))
p_flag_received = fr->u_hdr.u_pflag;
else
p_flag_received = fr->i_hdr.i_pflag;
switch(lp->state)
{
/* Compute index in transition table: */
case ADM:
idx = type;
idx = (idx << 1) + p_flag_received;
break;
case CONN:
case RESET_WAIT:
case RESET_CHECK:
case ERROR:
idx = type;
break;
case SETUP:
case RESET:
case D_CONN:
idx = type;
idx = (idx << 1) + lp->p_flag;
break;
case NORMAL:
case BUSY:
case REJECT:
case AWAIT:
case AWAIT_BUSY:
case AWAIT_REJECT:
validation = llc_validate_seq_nos(lp, fr);
if (validation > 3)
type = BAD_FRAME;
idx = type;
idx = (idx << 1);
if (validation & 1)
idx = idx +1;
idx = (idx << 1) + p_flag_received;
idx = (idx << 1) + lp->p_flag;
default:
printk("llc_proc: bad state\n");
return;
}
idx = (idx << 1) + pdutr_offset[lp->state];
lp->state = pdutr_entry[idx +1];
pc_label = pdutr_entry[idx];
if (pc_label != NOP)
{
llc_interpret_pseudo_code(lp, pc_label, skb, type);
if(lp->llc_callbacks)
{
lp->llc_event(lp);
lp->llc_callbacks=0;
}
/*
* lp may no longer be valid after this point. Be
* careful what is added!
*/
}
}
void llc_timer_expired(llcptr lp, int t)
{
int idx; /* index in transition table */
int pc_label; /* action to perform, from tr tbl */
lp->timer_state[t] = TIMER_EXPIRED;
idx = lp->state; /* Compute index in transition table: */
idx = (idx << 2) + t;
idx = idx << 1;
if (lp->retry_count >= lp->n2)
idx = idx + 1;
idx = (idx << 1) + lp->s_flag;
idx = (idx << 1) + lp->p_flag;
idx = idx << 1; /* 2 bytes per entry: action & newstate */
pc_label = timertr_entry[idx];
if (pc_label != NOP)
{
llc_interpret_pseudo_code(lp, pc_label, NULL, NO_FRAME);
lp->state = timertr_entry[idx +1];
}
lp->timer_state[t] = TIMER_IDLE;
if(lp->llc_callbacks)
{
lp->llc_event(lp);
lp->llc_callbacks=0;
}
/*
* And lp may have vanished in the event callback
*/
}
/*
* NET An implementation of the IEEE 802.2 LLC protocol for the
* LINUX operating system. LLC is implemented as a set of
* state machines and callbacks for higher networking layers.
*
* Code for initialization, termination, registration and
* MAC layer glue.
*
* Written by Tim Alpaerts, Tim_Alpaerts@toyota-motor-europe.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Changes
* Alan Cox : Chainsawed to Linux format
* Added llc_ to names
* Started restructuring handlers
*
* Horst von Brand : Add #include <linux/string.h>
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/init.h>
#include <net/p8022.h>
#include <asm/byteorder.h>
#include <net/llc_frame.h>
#include <net/llc.h>
/*
* All incoming frames pass thru mac_data_indicate().
* On entry the llc structure related to the frame is passed as parameter.
* The received sk_buffs with pdus other than I_CMD and I_RSP
* are freed by mac_data_indicate() after processing,
* the I pdu buffers are freed by the cl2llc client when it no longer needs
* the skb.
*/
int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb)
{
int ll; /* logical length == 802.3 length field */
unsigned char p_flag;
unsigned char type;
frameptr fr;
int free=1;
lp->inc_skb=NULL;
/*
* Truncate buffer to true 802.3 length
* [FIXME: move to 802.2 demux]
*/
ll = *(skb->data -2) * 256 + *(skb->data -1);
skb_trim( skb, ll );
fr = (frameptr) skb->data;
type = llc_decode_frametype( fr );
if (type <= FRMR_RSP)
{
/*
* PDU is of the type 2 set
*/
if ((lp->llc_mode == MODE_ABM)||(type == SABME_CMD))
llc_process_otype2_frame(lp, skb, type);
}
else
{
/*
* PDU belongs to type 1 set
*/
p_flag = fr->u_hdr.u_pflag;
switch(type)
{
case TEST_CMD:
llc_sendpdu(lp, TEST_RSP, 0,ll -3,
fr->u_hdr.u_info);
break;
case TEST_RSP:
lp->llc_callbacks|=LLC_TEST_INDICATION;
lp->inc_skb=skb;
free=0;
break;
case XID_CMD:
/*
* Basic format XID is handled by LLC itself
* Doc 5.4.1.1.2 p 48/49
*/
if ((ll == 6)&&(fr->u_hdr.u_info[0] == 0x81))
{
lp->k = fr->u_hdr.u_info[2];
llc_sendpdu(lp, XID_RSP,
fr->u_hdr.u_pflag, ll -3,
fr->u_hdr.u_info);
}
break;
case XID_RSP:
if( ll == 6 && fr->u_hdr.u_info[0] == 0x81 )
{
lp->k = fr->u_hdr.u_info[2];
}
lp->llc_callbacks|=LLC_XID_INDICATION;
lp->inc_skb=skb;
free=0;
break;
case UI_CMD:
lp->llc_callbacks|=LLC_UI_DATA;
skb_pull(skb,3);
lp->inc_skb=skb;
free=0;
break;
default:;
/*
* All other type 1 pdus ignored for now
*/
}
}
if (free&&(!(IS_IFRAME(fr))))
{
/*
* No auto free for I pdus
*/
skb->sk = NULL;
kfree_skb(skb);
}
if(lp->llc_callbacks)
{
if ( lp->llc_event != NULL ) lp->llc_event(lp);
lp->llc_callbacks=0;
}
return 0;
}
/*
* Create an LLC client. As it is the job of the caller to clean up
* LLC's on device down, the device list must be locked before this call.
*/
int register_cl2llc_client(llcptr lp, const char *device, void (*event)(llcptr), u8 *rmac, u8 ssap, u8 dsap)
{
char eye_init[] = "LLC\0";
memset(lp, 0, sizeof(*lp));
lp->dev = __dev_get_by_name(device);
if(lp->dev == NULL)
return -ENODEV;
memcpy(lp->eye, eye_init, sizeof(lp->eye));
lp->rw = 1;
lp->k = 127;
lp->n1 = 1490;
lp->n2 = 10;
lp->timer_interval[P_TIMER] = HZ; /* 1 sec */
lp->timer_interval[REJ_TIMER] = HZ/8;
lp->timer_interval[ACK_TIMER] = HZ/8;
lp->timer_interval[BUSY_TIMER] = HZ*2;
lp->local_sap = ssap;
lp->llc_event = event;
memcpy(lp->remote_mac, rmac, sizeof(lp->remote_mac));
lp->state = 0;
lp->llc_mode = MODE_ADM;
lp->remote_sap = dsap;
skb_queue_head_init(&lp->atq);
skb_queue_head_init(&lp->rtq);
MOD_INC_USE_COUNT;
return 0;
}
void unregister_cl2llc_client(llcptr lp)
{
llc_cancel_timers(lp);
MOD_DEC_USE_COUNT;
kfree(lp);
}
EXPORT_SYMBOL(register_cl2llc_client);
EXPORT_SYMBOL(unregister_cl2llc_client);
EXPORT_SYMBOL(llc_data_request);
EXPORT_SYMBOL(llc_unit_data_request);
EXPORT_SYMBOL(llc_test_request);
EXPORT_SYMBOL(llc_xid_request);
EXPORT_SYMBOL(llc_mac_data_indicate);
EXPORT_SYMBOL(llc_cancel_timers);
#define ALL_TYPES_8022 0
static int __init llc_init(void)
{
printk(KERN_NOTICE "IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts\n");
return 0;
}
module_init(llc_init);
/*
* NET An implementation of the IEEE 802.2 LLC protocol for the
* LINUX operating system. LLC is implemented as a set of
* state machines and callbacks for higher networking layers.
*
* llc_sendpdu(), llc_sendipdu(), resend() + queue handling code
*
* Written by Tim Alpaerts, Tim_Alpaerts@toyota-motor-europe.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Changes
* Alan Cox : Chainsawed into Linux format, style
* Added llc_ to function names
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/p8022.h>
#include <linux/stat.h>
#include <asm/byteorder.h>
#include <net/llc_frame.h>
#include <net/llc.h>
static unsigned char cntl_byte_encode[] =
{
0x00, /* I_CMD */
0x01, /* RR_CMD */
0x05, /* RNR_CMD */
0x09, /* REJ_CMD */
0x43, /* DISC_CMD */
0x7F, /* SABME_CMD */
0x00, /* I_RSP */
0x01, /* RR_RSP */
0x05, /* RNR_RSP */
0x09, /* REJ_RSP */
0x63, /* UA_RSP */
0x0F, /* DM_RSP */
0x87, /* FRMR_RSP */
0xFF, /* BAD_FRAME */
0x03, /* UI_CMD */
0xBF, /* XID_CMD */
0xE3, /* TEST_CMD */
0xBF, /* XID_RSP */
0xE3 /* TEST_RSP */
};
static unsigned char fr_length_encode[] =
{
0x04, /* I_CMD */
0x04, /* RR_CMD */
0x04, /* RNR_CMD */
0x04, /* REJ_CMD */
0x03, /* DISC_CMD */
0x03, /* SABME_CMD */
0x04, /* I_RSP */
0x04, /* RR_RSP */
0x04, /* RNR_RSP */
0x04, /* REJ_RSP */
0x03, /* UA_RSP */
0x03, /* DM_RSP */
0x03, /* FRMR_RSP */
0x00, /* BAD_FRAME */
0x03, /* UI_CMD */
0x03, /* XID_CMD */
0x03, /* TEST_CMD */
0x03, /* XID_RSP */
0x03 /* TEST_RSP */
};
static unsigned char cr_bit_encode[] = {
0x00, /* I_CMD */
0x00, /* RR_CMD */
0x00, /* RNR_CMD */
0x00, /* REJ_CMD */
0x00, /* DISC_CMD */
0x00, /* SABME_CMD */
0x01, /* I_RSP */
0x01, /* RR_RSP */
0x01, /* RNR_RSP */
0x01, /* REJ_RSP */
0x01, /* UA_RSP */
0x01, /* DM_RSP */
0x01, /* FRMR_RSP */
0x00, /* BAD_FRAME */
0x00, /* UI_CMD */
0x00, /* XID_CMD */
0x00, /* TEST_CMD */
0x01, /* XID_RSP */
0x01 /* TEST_RSP */
};
/*
* Sendpdu() constructs an output frame in a new skb and
* gives it to the MAC layer for transmission.
* This function is not used to send I pdus.
* No queues are updated here, nothing is saved for retransmission.
*
* Parameter pf controls both the poll/final bit and dsap
* fields in the output pdu.
* The dsap trick was needed to implement XID_CMD send with
* zero dsap field as described in doc 6.6 item 1 of enum.
*/
void llc_sendpdu(llcptr lp, char type, char pf, int data_len, char *pdu_data)
{
frameptr fr; /* ptr to output pdu buffer */
unsigned short int fl; /* frame length == 802.3 "length" value */
struct sk_buff *skb;
fl = data_len + fr_length_encode[(int)type];
skb = alloc_skb(16 + fl, GFP_ATOMIC);
if (skb != NULL)
{
skb->dev = lp->dev;
skb_reserve(skb, 16);
fr = (frameptr) skb_put(skb, fl);
memset(fr, 0, fl);
/*
* Construct 802.2 header
*/
if (pf & 0x02)
fr->pdu_hdr.dsap = 0;
else
fr->pdu_hdr.dsap = lp->remote_sap;
fr->pdu_hdr.ssap = lp->local_sap + cr_bit_encode[(int)type];
fr->pdu_cntl.byte1 = cntl_byte_encode[(int)type];
/*
* Fill in pflag and seq nbrs:
*/
if (IS_SFRAME(fr))
{
/* case S-frames */
if (pf & 0x01)
fr->i_hdr.i_pflag = 1;
fr->i_hdr.nr = lp->vr;
}
else
{
/* case U frames */
if (pf & 0x01)
fr->u_hdr.u_pflag = 1;
}
if (data_len > 0)
{ /* append data if any */
if (IS_UFRAME(fr))
{
memcpy(fr->u_hdr.u_info, pdu_data, data_len);
}
else
{
memcpy(fr->i_hdr.is_info, pdu_data, data_len);
}
}
lp->dev->hard_header(skb, lp->dev, ETH_P_802_3,
lp->remote_mac, NULL, fl);
skb->dev=lp->dev;
dev_queue_xmit(skb);
}
else
printk(KERN_DEBUG "cl2llc: skb_alloc() in llc_sendpdu() failed\n");
}
void llc_xid_request(llcptr lp, char opt, int ll, char * data)
{
llc_sendpdu(lp, XID_CMD, opt, ll, data);
}
void llc_test_request(llcptr lp, int ll, char * data)
{
llc_sendpdu(lp, TEST_CMD, 0, ll, data);
}
void llc_unit_data_request(llcptr lp, int ll, char * data)
{
llc_sendpdu(lp, UI_CMD, 0, ll, data);
}
/*
* llc_sendipdu() Completes an I pdu in an existing skb and gives it
* to the MAC layer for transmission.
* Parameter "type" must be either I_CMD or I_RSP.
* The skb is not freed after xmit, it is kept in case a retransmission
* is requested. If needed it can be picked up again from the rtq.
*/
void llc_sendipdu(llcptr lp, char type, char pf, struct sk_buff *skb)
{
frameptr fr; /* ptr to output pdu buffer */
struct sk_buff *tmp;
fr = (frameptr) skb->data;
fr->pdu_hdr.dsap = lp->remote_sap;
fr->pdu_hdr.ssap = lp->local_sap + cr_bit_encode[(int)type];
fr->pdu_cntl.byte1 = cntl_byte_encode[(int)type];
if (pf)
fr->i_hdr.i_pflag = 1; /* p/f and seq numbers */
fr->i_hdr.nr = lp->vr;
fr->i_hdr.ns = lp->vs;
lp->vs++;
if (lp->vs > 127)
lp->vs = 0;
lp->dev->hard_header(skb, lp->dev, ETH_P_802_3,
lp->remote_mac, NULL, skb->len);
ADD_TO_RTQ(skb); /* add skb to the retransmit queue */
tmp=skb_clone(skb, GFP_ATOMIC);
if(tmp!=NULL)
{
tmp->dev=lp->dev;
dev_queue_xmit(tmp);
}
}
/*
* Resend_ipdu() will resend the pdus in the retransmit queue (rtq)
* the return value is the number of pdus resend.
* ack_nr is N(R) of 1st pdu to resent.
* Type is I_CMD or I_RSP for 1st pdu resent.
* p is p/f flag 0 or 1 for 1st pdu resent.
* All subsequent pdus will be sent as I_CMDs with p/f set to 0
*/
int llc_resend_ipdu(llcptr lp, unsigned char ack_nr, unsigned char type, char p)
{
struct sk_buff *skb,*tmp;
int resend_count;
frameptr fr;
unsigned long flags;
resend_count = 0;
save_flags(flags);
cli();
skb = skb_peek(&lp->rtq);
while(skb && skb != (struct sk_buff *)&lp->rtq)
{
fr = (frameptr) (skb->data + lp->dev->hard_header_len);
if (resend_count == 0)
{
/*
* Resending 1st pdu:
*/
if (p)
fr->i_hdr.i_pflag = 1;
else
fr->i_hdr.i_pflag = 0;
if (type == I_CMD)
fr->pdu_hdr.ssap = fr->pdu_hdr.ssap & 0xfe;
else
fr->pdu_hdr.ssap = fr->pdu_hdr.ssap | 0x01;
}
else
{
/*
* Resending pdu 2...n
*/
fr->pdu_hdr.ssap = fr->pdu_hdr.ssap & 0xfe;
fr->i_hdr.i_pflag = 0;
}
fr->i_hdr.nr = lp->vr;
fr->i_hdr.ns = lp->vs;
lp->vs++;
if (lp->vs > 127)
lp->vs = 0;
tmp=skb_clone(skb, GFP_ATOMIC);
if(tmp!=NULL)
{
tmp->dev = lp->dev;
dev_queue_xmit(skb);
}
resend_count++;
skb = skb->next;
}
restore_flags(flags);
return resend_count;
}
/* ************** internal queue management code ****************** */
/*
* Remove one skb from the front of the awaiting transmit queue
* (this is the skb longest on the queue) and return a pointer to
* that skb.
*/
struct sk_buff *llc_pull_from_atq(llcptr lp)
{
return skb_dequeue(&lp->atq);
}
/*
* Free_acknowledged_skbs(), remove from retransmit queue (rtq)
* and free all skbs with an N(S) chronologicaly before 'pdu_ack'.
* The return value is the number of pdus acknowledged.
*/
int llc_free_acknowledged_skbs(llcptr lp, unsigned char pdu_ack)
{
struct sk_buff *pp;
frameptr fr;
int ack_count;
unsigned char ack; /* N(S) of most recently ack'ed pdu */
unsigned char ns_save;
unsigned long flags;
if (pdu_ack > 0)
ack = pdu_ack -1;
else
ack = 127;
ack_count = 0;
save_flags(flags);
cli();
pp = skb_dequeue(&lp->rtq);
while (pp != NULL)
{
/*
* Locate skb with N(S) == ack
*/
/*
* BUG: FIXME - use skb->h.*
*/
fr = (frameptr) (pp->data + lp->dev->hard_header_len);
ns_save = fr->i_hdr.ns;
kfree_skb(pp);
ack_count++;
if (ns_save == ack)
break;
pp = skb_dequeue(&lp->rtq);
}
restore_flags(flags);
return ack_count;
}
/*
* NET An implementation of the IEEE 802.2 LLC protocol for the
* LINUX operating system. LLC is implemented as a set of
* state machines and callbacks for higher networking layers.
*
* Small utilities, Linux timer handling.
*
* Written by Tim Alpaerts, Tim_Alpaerts@toyota-motor-europe.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Changes
* Alan Cox : Chainsawed into Linux form.
* Added llc_ function name prefixes.
* Fixed bug in stop/start timer.
* Added llc_cancel_timers for closing
* down an llc
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <net/llc_frame.h>
#include <net/llc.h>
int llc_decode_frametype(frameptr fr)
{
if (IS_UFRAME(fr))
{ /* unnumbered cmd/rsp */
switch(fr->u_mm.mm & 0x3B)
{
case 0x1B:
return(SABME_CMD);
break;
case 0x10:
return(DISC_CMD);
break;
case 0x18:
return(UA_RSP);
break;
case 0x03:
return(DM_RSP);
break;
case 0x21:
return(FRMR_RSP);
break;
case 0x00:
return(UI_CMD);
break;
case 0x2B:
if (IS_RSP(fr))
return(XID_RSP);
else
return(XID_CMD);
break;
case 0x38:
if (IS_RSP(fr))
return(TEST_RSP);
else
return(TEST_CMD);
break;
default:
return(BAD_FRAME);
}
}
else if (IS_SFRAME(fr))
{ /* supervisory cmd/rsp */
switch(fr->s_hdr.ss)
{
case 0x00:
if (IS_RSP(fr))
return(RR_RSP);
else
return(RR_CMD);
break;
case 0x02:
if (IS_RSP(fr))
return(REJ_RSP);
else
return(REJ_CMD);
break;
case 0x01:
if (IS_RSP(fr))
return(RNR_RSP);
else
return(RNR_CMD);
break;
default:
return(BAD_FRAME);
}
}
else
{ /* information xfer */
if (IS_RSP(fr))
return(I_RSP);
else
return(I_CMD);
}
}
/*
* Validate_seq_nos will check N(S) and N(R) to see if they are
* invalid or unexpected.
* "unexpected" is explained on p44 Send State Variable.
* The return value is:
* 4 * invalid N(R) +
* 2 * invalid N(S) +
* 1 * unexpected N(S)
*/
int llc_validate_seq_nos(llcptr lp, frameptr fr)
{
int res;
/*
* A U-frame is always good
*/
if (IS_UFRAME(fr))
return(0);
/*
* For S- and I-frames check N(R):
*/
if (fr->i_hdr.nr == lp->vs)
{ /* if N(R) = V(S) */
res = 0; /* N(R) is good */
}
else
{ /* lp->k = transmit window size */
if (lp->vs >= lp->k)
{ /* if window not wrapped around 127 */
if ((fr->i_hdr.nr < lp->vs) &&
(fr->i_hdr.nr > (lp->vs - lp->k)))
res = 0;
else
res = 4; /* N(R) invalid */
}
else
{ /* window wraps around 127 */
if ((fr->i_hdr.nr < lp->vs) ||
(fr->i_hdr.nr > (128 + lp->vs - lp->k)))
res = 0;
else
res = 4; /* N(R) invalid */
}
}
/*
* For an I-frame, must check N(S) also:
*/
if (IS_IFRAME(fr))
{
if (fr->i_hdr.ns == lp->vr)
return res; /* N(S) good */
if (lp->vr >= lp->rw)
{
/* if receive window not wrapped */
if ((fr->i_hdr.ns < lp->vr) &&
(fr->i_hdr.ns > (lp->vr - lp->k)))
res = res +1; /* N(S) unexpected */
else
res = res +2; /* N(S) invalid */
}
else
{
/* Window wraps around 127 */
if ((fr->i_hdr.ns < lp->vr) ||
(fr->i_hdr.ns > (128 + lp->vr - lp->k)))
res = res +1; /* N(S) unexpected */
else
res = res +2; /* N(S) invalid */
}
}
return(res);
}
/* **************** timer management routines ********************* */
static void llc_p_timer_expired(unsigned long ulp)
{
llc_timer_expired((llcptr) ulp, P_TIMER);
}
static void llc_rej_timer_expired(unsigned long ulp)
{
llc_timer_expired((llcptr) ulp, REJ_TIMER);
}
static void llc_ack_timer_expired(unsigned long ulp)
{
llc_timer_expired((llcptr) ulp, ACK_TIMER);
}
static void llc_busy_timer_expired(unsigned long ulp)
{
llc_timer_expired((llcptr) ulp, BUSY_TIMER);
}
/* exp_fcn is an array holding the 4 entry points of the
timer expiry routines above.
It is required to keep start_timer() generic.
Thank you cdecl.
*/
static void (* exp_fcn[])(unsigned long) =
{
llc_p_timer_expired,
llc_rej_timer_expired,
llc_ack_timer_expired,
llc_busy_timer_expired
};
void llc_start_timer(llcptr lp, int t)
{
if (lp->timer_state[t] == TIMER_IDLE)
{
lp->tl[t].expires = jiffies + lp->timer_interval[t];
lp->tl[t].data = (unsigned long) lp;
lp->tl[t].function = exp_fcn[t];
add_timer(&lp->tl[t]);
lp->timer_state[t] = TIMER_RUNNING;
}
}
void llc_stop_timer(llcptr lp, int t)
{
if (lp->timer_state[t] == TIMER_RUNNING)
{
del_timer(&lp->tl[t]);
lp->timer_state[t] = TIMER_IDLE;
}
}
void llc_cancel_timers(llcptr lp)
{
llc_stop_timer(lp, P_TIMER);
llc_stop_timer(lp, REJ_TIMER);
llc_stop_timer(lp, ACK_TIMER);
llc_stop_timer(lp, BUSY_TIMER);
}
# usage: awk -f actionnm.awk pseudocode.h
#
BEGIN { "date" | getline
today = $0
printf("\n/* this file generated on %s */\n", today )
printf("\nstatic char *action_names[] = { \n " )
opl = 0
}
/^#define/ {
if ( opl > 3 ) {
printf("\n ")
opl = 0
}
opl = opl +1
t = sprintf("\"%s\"", $2 )
printf("%-15s ,", t )
# printf("%-10s", $2 )
}
END {
if ( opl > 3 ) {
printf("\n ")
}
printf("\t 0\n};\n\n")
}
# usage: cat pseudocode | sed -f act2num | awk -f compile.awk
#
#
BEGIN { "date" | getline
today = $0
printf("\n/* this file generated on %s */\n", today )
printf("\nstatic char pseudo_code [ ] = { \n" )
opl = 0 # op codes on the current line
opc = 0 # opcode counter
fpi = 0 # fill pointer for idx array
}
/^;/ { } # line starting with semicolon is comment
/^[A-Z]/ { # start of a new action
emit( 0 )
idx[ ++fpi ] = opc
name[ fpi ] = $1
emit( $2 )
}
/^[\t ]/ {
emit( $1 )
}
END {
if ( opl > 8 ) {
printf("\n")
}
printf("\t 0\n};\n\n")
printf("static short int pseudo_code_idx [ ] ={\n")
opl = 0
emit( 0 )
for( ii = 1; ii <= fpi; ii++ )
emit( idx[ ii ] )
if ( opl > 8 ) {
printf("\n")
}
printf("\t 0\n};\n\n")
printf("#define %-10s \t %3d \n", "NOP", 0 )
for( ii = 1; ii <= fpi; ii++ )
printf("#define %-10s \t %3d \n", name[ ii ], ii )
printf("\n")
}
function emit( opcode ){ # Niclaus Wirth
if ( opl > 8 ) {
printf("\n")
opl = 0
}
opl = opl +1
printf("\t%4d,", opcode )
opc++
}
s/NOP/0/
s/DUMMY_6/6/
s/DUMMY_8/8/
s/IF_F=1_CLEAR_REMOTE_BUSY/9/
s/CLEAR_REMOTE_BUSY/1/
s/CONNECT_CONFIRM/3/
s/DISCONNECT_INDICATION/5/
s/CONNECT_INDICATION/2/
s/IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1/55/
s/DATA_FLAG:=0/53/
s/DATA_FLAG:=1/54/
s/DATA_FLAG:=2/52/
s/DATA_INDICATION/4/
s/F_FLAG:=P/65/
s/IF_DATA_FLAG=2_STOP_REJ_TIMER/10/
s/OPTIONAL_SEND_RNR_XXX(X=0)/30/
s/P_FLAG:=0/56/
s/P_FLAG:=P/57/
s/RE-SEND_FRMR_RSP(F=0)/14/
s/RE-SEND_FRMR_RSP(F=P)/15/
s/RE-SEND_I_CMD(P=1)_OR_SEND_RR/18/
s/RE-SEND_I_CMD(P=1)/17/
s/RE-SEND_I_RSP(F=1)/22/
s/RE-SEND_I_XXX(X=0)_OR_SEND_RR/21/
s/RE-SEND_I_XXX(X=0)/20/
s/REMOTE_BUSY:=0/58/
s/REPORT_STATUS(FRMR_RECEIVED)/66/
s/REPORT_STATUS(FRMR_SENT)/67/
s/REPORT_STATUS(REMOTE_BUSY)/68/
s/REPORT_STATUS(REMOTE_NOT_BUSY)/69/
s/RESET_CONFIRM/7/
s/RESET_INDICATION(LOCAL)/70/
s/RESET_INDICATION(REMOTE)/71/
s/RETRY_COUNT:=RETRY_COUNT+1/60/
s/RETRY_COUNT:=0/59/
s/SEND_ACKNOWLEDGE_CMD(P=1)/32/
s/SEND_ACKNOWLEDGE_RSP(F=1)/34/
s/SEND_ACKNOWLEDGE_XXX(X=0)/36/
s/SEND_DISC_CMD(P=X)/11/
s/SEND_DM_RSP(F=X)/12/
s/SEND_FRMR_RSP(F=X)/13/
s/SEND_I_CMD(P=1)/16/
s/SEND_I_XXX(X=0)/19/
s/SEND_REJ_CMD(P=1)/23/
s/SEND_REJ_RSP(F=1)/24/
s/SEND_REJ_XXX(X=0)/25/
s/SEND_RNR_CMD(F=1)/26/
s/SEND_RNR_RSP(F=1)/27/
s/SEND_RNR_XXX(X=0)/28/
s/SEND_RR_CMD(P=1)/31/
s/SEND_RR_RSP(F=1)/33/
s/SEND_RR_XXX(X=0)/35/
s/SEND_SABME_CMD(P=X)/37/
s/SEND_UA_RSP(F=X)/38/
s/SET_REMOTE_BUSY/29/
s/START_ACK_TIMER_IF_NOT_RUNNING/44/
s/START_ACK_TIMER/42/
s/START_P_TIMER/41/
s/START_REJ_TIMER/43/
s/STOP_ACK_TIMER/45/
s/STOP_ALL_TIMERS/48/
s/STOP_OTHER_TIMERS/49/
s/STOP_P_TIMER/46/
s/STOP_REJ_TIMER/47/
s/S_FLAG:=0/39/
s/S_FLAG:=1/40/
s/UPDATE_N(R)_RECEIVED/50/
s/UPDATE_P_FLAG/51/
s/V(R):=0/61/
s/V(R):=V(R)+1/62/
s/V(S):=0/63/
s/V(S):=N(R)/64/
0 NOP
1 CLEAR_REMOTE_BUSY
2 CONNECT_INDICATION
3 CONNECT_CONFIRM
4 DATA_INDICATION
5 DISCONNECT_INDICATION
6 DUMMY_6
7 RESET_CONFIRM
8 DUMMY_8
9 IF_F=1_CLEAR_REMOTE_BUSY
10 IF_DATA_FLAG=2_STOP_REJ_TIMER
11 SEND_DISC_CMD(P=X)
12 SEND_DM_RSP(F=X)
13 SEND_FRMR_RSP(F=X)
14 RE-SEND_FRMR_RSP(F=0)
15 RE-SEND_FRMR_RSP(F=P)
16 SEND_I_CMD(P=1)
17 RE-SEND_I_CMD(P=1)
18 RE-SEND_I_CMD(P=1)_OR_SEND_RR
19 SEND_I_XXX(X=0)
20 RE-SEND_I_XXX(X=0)
21 RE-SEND_I_XXX(X=0)_OR_SEND_RR
22 RE-SEND_I_RSP(F=1)
23 SEND_REJ_CMD(P=1)
24 SEND_REJ_RSP(F=1)
25 SEND_REJ_XXX(X=0)
26 SEND_RNR_CMD(F=1)
27 SEND_RNR_RSP(F=1)
28 SEND_RNR_XXX(X=0)
29 SET_REMOTE_BUSY
30 OPTIONAL_SEND_RNR_XXX(X=0)
31 SEND_RR_CMD(P=1)
32 SEND_ACKNOWLEDGE_CMD(P=1)
33 SEND_RR_RSP(F=1)
34 SEND_ACKNOWLEDGE_RSP(F=1)
35 SEND_RR_XXX(X=0)
36 SEND_ACKNOWLEDGE_XXX(X=0)
37 SEND_SABME_CMD(P=X)
38 SEND_UA_RSP(F=X)
39 S_FLAG:=0
40 S_FLAG:=1
41 START_P_TIMER
42 START_ACK_TIMER
43 START_REJ_TIMER
44 START_ACK_TIMER_IF_NOT_RUNNING
45 STOP_ACK_TIMER
46 STOP_P_TIMER
47 STOP_REJ_TIMER
48 STOP_ALL_TIMERS
49 STOP_OTHER_TIMERS
50 UPDATE_N(R)_RECEIVED
51 UPDATE_P_FLAG
52 DATA_FLAG:=2
53 DATA_FLAG:=0
54 DATA_FLAG:=1
55 IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
56 P_FLAG:=0
57 P_FLAG:=P
58 REMOTE_BUSY:=0
59 RETRY_COUNT:=0
60 RETRY_COUNT:=RETRY_COUNT+1
61 V(R):=0
62 V(R):=V(R)+1
63 V(S):=0
64 V(S):=N(R)
65 F_FLAG:=P
66 REPORT_STATUS(FRMR_RECEIVED)
67 REPORT_STATUS(FRMR_SENT)
68 REPORT_STATUS(REMOTE_BUSY)
69 REPORT_STATUS(REMOTE_NOT_BUSY)
70 RESET_INDICATION(LOCAL)
71 RESET_INDICATION(REMOTE)
static char *opcode_names[] = {
"NOP", "CLEAR_REMOTE_BUSY", "CONNECT_INDICATION", "CONNECT_CONFIRM", "DATA_INDICATION",
"DISCONNECT_INDICATION", "DUMMY_6", "RESET_CONFIRM", "DUMMY_8",
"IF_F=1_CLEAR_REMOTE_BUSY", "IF_DATA_FLAG=2_STOP_REJ_TIMER", "SEND_DISC_CMD(P=X)",
"SEND_DM_RSP(F=X)", "SEND_FRMR_RSP(F=X)", "RE-SEND_FRMR_RSP(F=0)",
"RE-SEND_FRMR_RSP(F=P)", "SEND_I_CMD(P=1)", "RE-SEND_I_CMD(P=1)",
"RE-SEND_I_CMD(P=1)_OR_SEND_RR", "SEND_I_XXX(X=0)", "RE-SEND_I_XXX(X=0)",
"RE-SEND_I_XXX(X=0)_OR_SEND_RR", "RE-SEND_I_RSP(F=1)", "SEND_REJ_CMD(P=1)",
"SEND_REJ_RSP(F=1)", "SEND_REJ_XXX(X=0)", "SEND_RNR_CMD(F=1)", "SEND_RNR_RSP(F=1)",
"SEND_RNR_XXX(X=0)", "SET_REMOTE_BUSY", "OPTIONAL_SEND_RNR_XXX(X=0)",
"SEND_RR_CMD(P=1)", "SEND_ACKNOWLEDGE_CMD(P=1)", "SEND_RR_RSP(F=1)",
"SEND_ACKNOWLEDGE_RSP(F=1)", "SEND_RR_XXX(X=0)", "SEND_ACKNOWLEDGE_XXX(X=0)",
"SEND_SABME_CMD(P=X)", "SEND_UA_RSP(F=X)", "S_FLAG:=0", "S_FLAG:=1", "START_P_TIMER",
"START_ACK_TIMER", "START_REJ_TIMER", "START_ACK_TIMER_IF_NOT_RUNNING",
"STOP_ACK_TIMER", "STOP_P_TIMER", "STOP_REJ_TIMER", "STOP_ALL_TIMERS",
"STOP_OTHER_TIMERS", "UPDATE_N(R)_RECEIVED", "UPDATE_P_FLAG", "DATA_FLAG:=2",
"DATA_FLAG:=0", "DATA_FLAG:=1", "IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1", "P_FLAG:=0",
"P_FLAG:=P", "REMOTE_BUSY:=0", "RETRY_COUNT:=0", "RETRY_COUNT:=RETRY_COUNT+1",
"V(R):=0", "V(R):=V(R)+1", "V(S):=0", "V(S):=N(R)", "F_FLAG:=P",
"REPORT_STATUS(FRMR_RECEIVED)", "REPORT_STATUS(FRMR_SENT)",
"REPORT_STATUS(REMOTE_BUSY)", "REPORT_STATUS(REMOTE_NOT_BUSY)",
"RESET_INDICATION(LOCAL)", "RESET_INDICATION(REMOTE)"
};
;============================================================================
;
; translate this with
; cat pseudocode | sed -f act2num | awk -f compile.awk >pseudocode.h
;
; actionname pseudocode
;
;============================================================================
ADM1 SEND_SABME_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=0
S_FLAG:=0
;
; instructions in ADM2 have been changed:
; 1. P_FLAG:=P is probably wrong in doc...
; I think it should be F_FLAG:=P the way it is in CONN3
; 2. CONNECT_RESPONSE has been wired in here,
; CONN1 is no longer referenced
;
ADM2 F_FLAG:=P
SEND_UA_RSP(F=X)
V(S):=0
V(R):=0
RETRY_COUNT:=0
P_FLAG:=0
REMOTE_BUSY:=0
CONNECT_INDICATION
ADM3 SEND_DM_RSP(F=X)
ADM4 SEND_DM_RSP(F=X)
ADM5 NOP
;============================================================================
;CONN1 SEND_UA_RSP(F=X)
; V(S):=0
; V(R):=0
; RETRY_COUNT:=0
; P_FLAG:=0
; REMOTE_BUSY:=0
CONN2 SEND_DM_RSP(F=X)
CONN3 F_FLAG:=P
CONN4 DISCONNECT_INDICATION
CONN5 NOP
;============================================================================
RESWAIT1 SEND_SABME_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=0
RESWAIT2 SEND_UA_RSP(F=X)
V(S):=0
V(R):=0
RETRY_COUNT:=0
P_FLAG:=0
REMOTE_BUSY:=0
RESET_CONFIRM
RESWAIT3 SEND_DISC_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=0
RESWAIT4 SEND_DM_RSP(F=X)
RESWAIT5 DISCONNECT_INDICATION
RESWAIT6 S_FLAG:=1
F_FLAG:=P
RESWAIT7 SEND_DM_RSP(F=X)
DISCONNECT_INDICATION
RESWAIT8 NOP
;============================================================================
RESCHK1 SEND_UA_RSP(F=X)
V(S):=0
V(R):=0
RETRY_COUNT:=0
P_FLAG:=0
REMOTE_BUSY:=0
RESCHK2 SEND_DM_RSP(F=X)
RESCHK3 DISCONNECT_INDICATION
RESCHK4 F_FLAG:=P
RESCHK5 SEND_DM_RSP(F=X)
DISCONNECT_INDICATION
RESCHK6 NOP
;============================================================================
SETUP1 SEND_UA_RSP(F=X)
V(S):=0
V(R):=0
RETRY_COUNT:=0
S_FLAG:=1
SETUP2 STOP_ACK_TIMER
V(S):=0
V(R):=0
RETRY_COUNT:=0
UPDATE_P_FLAG
CONNECT_CONFIRM
REMOTE_BUSY:=0
SETUP3 P_FLAG:=0
CONNECT_CONFIRM
REMOTE_BUSY:=0
SETUP4 SEND_DM_RSP(F=X)
DISCONNECT_INDICATION
STOP_ACK_TIMER
SETUP5 DISCONNECT_INDICATION
STOP_ACK_TIMER
SETUP6 NOP
SETUP7 SEND_SABME_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=RETRY_COUNT+1
SETUP8 DISCONNECT_INDICATION
;============================================================================
RESET1 SEND_UA_RSP(F=X)
V(S):=0
V(R):=0
RETRY_COUNT:=0
S_FLAG:=1
RESET2 STOP_ACK_TIMER
V(S):=0
V(R):=0
RETRY_COUNT:=0
UPDATE_P_FLAG
RESET_CONFIRM
REMOTE_BUSY:=0
RESET3 P_FLAG:=0
RESET_CONFIRM
REMOTE_BUSY:=0
RESET4 SEND_DM_RSP(F=X)
DISCONNECT_INDICATION
STOP_ACK_TIMER
RESET5 DISCONNECT_INDICATION
STOP_ACK_TIMER
RESET6 NOP
RESET7 SEND_SABME_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=RETRY_COUNT+1
RESET8 DISCONNECT_INDICATION
;============================================================================
D_CONN1 SEND_DM_RSP(F=X)
STOP_ACK_TIMER
D_CONN2 STOP_ACK_TIMER
D_CONN3 SEND_UA_RSP(F=X)
D_CONN4 STOP_ACK_TIMER
D_CONN5 NOP
D_CONN6 SEND_DISC_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
RETRY_COUNT:=RETRY_COUNT+1
D_CONN7 NOP
;============================================================================
ERR1 RESET_INDICATION(REMOTE)
STOP_ACK_TIMER
F_FLAG:=P
ERR2 SEND_UA_RSP(F=X)
DISCONNECT_INDICATION
STOP_ACK_TIMER
ERR3 DISCONNECT_INDICATION
STOP_ACK_TIMER
ERR4 RESET_INDICATION(LOCAL)
STOP_ACK_TIMER
REPORT_STATUS(FRMR_RECEIVED)
S_FLAG:=0
ERR5 RE-SEND_FRMR_RSP(F=P)
START_ACK_TIMER
ERR6 NOP
ERR7 RE-SEND_FRMR_RSP(F=0)
START_ACK_TIMER
RETRY_COUNT:=RETRY_COUNT+1
ERR8 S_FLAG:=0
RESET_INDICATION(LOCAL)
;============================================================================
; the shared actions are common to states NORMAL, BUSY, REJECT,
; AWAIT, AWAIT_BUSY and AWAIT_REJECT.
;============================================================================
SH1 SEND_DISC_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
SH2 SEND_SABME_CMD(P=X)
P_FLAG:=P
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
S_FLAG:=0
SH3 RESET_INDICATION(REMOTE)
F_FLAG:=P
STOP_ALL_TIMERS
SH4 SEND_UA_RSP(F=X)
DISCONNECT_INDICATION
STOP_ALL_TIMERS
SH5 STOP_ALL_TIMERS
RESET_INDICATION(LOCAL)
REPORT_STATUS(FRMR_RECEIVED)
S_FLAG:=0
SH6 DISCONNECT_INDICATION
STOP_ALL_TIMERS
SH7 SEND_FRMR_RSP(F=X)
REPORT_STATUS(FRMR_SENT)
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
SH8 SEND_FRMR_RSP(F=0)
REPORT_STATUS(FRMR_SENT)
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
SH9 SEND_FRMR_RSP(F=0)
REPORT_STATUS(FRMR_SENT)
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
SH10 SEND_FRMR_RSP(F=X)
REPORT_STATUS(FRMR_SENT)
START_ACK_TIMER
STOP_OTHER_TIMERS
RETRY_COUNT:=0
SH11 STOP_ALL_TIMERS
RESET_INDICATION(LOCAL)
S_FLAG:=0
;============================================================================
NORMAL1 SEND_I_CMD(P=1)
START_P_TIMER
START_ACK_TIMER_IF_NOT_RUNNING
; SEND_I_XXX(X=0)
; START_ACK_TIMER_IF_NOT_RUNNING
NORMAL2 SEND_I_XXX(X=0)
START_ACK_TIMER_IF_NOT_RUNNING
NORMAL3 SEND_RNR_CMD(F=1)
START_P_TIMER
DATA_FLAG:=0
; SEND_RNR_XXX(X=0)
; DATA_FLAG:=0
NORMAL4 SEND_RNR_XXX(X=0)
DATA_FLAG:=0
NORMAL5 SEND_REJ_XXX(X=0)
UPDATE_N(R)_RECEIVED
UPDATE_P_FLAG
START_REJ_TIMER
IF_F=1_CLEAR_REMOTE_BUSY
; SEND_REJ_CMD(P=1)
; UPDATE_N(R)_RECEIVED
; START_P_TIMER
; START_REJ_TIMER
; IF_F=1_CLEAR_REMOTE_BUSY
NORMAL6 SEND_REJ_XXX(X=0)
UPDATE_N(R)_RECEIVED
START_REJ_TIMER
NORMAL7 SEND_REJ_RSP(F=1)
UPDATE_N(R)_RECEIVED
START_REJ_TIMER
;
; the order of opcodes in NORMAL8 is changed.
; the transition table will execute NORMAL8A for incoming pdus
; with p/f 1, pdus with pf 0 are treated in NORMAL8B.
;
NORMAL8A V(R):=V(R)+1
SEND_ACKNOWLEDGE_CMD(P=1)
START_P_TIMER
UPDATE_N(R)_RECEIVED
IF_F=1_CLEAR_REMOTE_BUSY
DATA_INDICATION
;
NORMAL8B V(R):=V(R)+1
UPDATE_P_FLAG
SEND_ACKNOWLEDGE_XXX(X=0)
UPDATE_N(R)_RECEIVED
IF_F=1_CLEAR_REMOTE_BUSY
DATA_INDICATION
;
; the order of opcodes in NORMAL9 is changed
NORMAL9 V(R):=V(R)+1
SEND_ACKNOWLEDGE_XXX(X=0)
UPDATE_N(R)_RECEIVED
DATA_INDICATION
;
; the order of opcodes in NORMAL10 is changed
NORMAL10 V(R):=V(R)+1
SEND_ACKNOWLEDGE_RSP(F=1)
UPDATE_N(R)_RECEIVED
DATA_INDICATION
NORMAL11 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
NORMAL12 SEND_ACKNOWLEDGE_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
NORMAL13 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
NORMAL14 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
NORMAL15 V(S):=N(R)
UPDATE_N(R)_RECEIVED
UPDATE_P_FLAG
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; V(S):=N(R)
; UPDATE_N(R)_RECEIVED
; START_P_TIMER
; RE-SEND_I_CMD(P=1)
; CLEAR_REMOTE_BUSY
NORMAL16 V(S):=N(R)
UPDATE_N(R)_RECEIVED
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
NORMAL17 V(S):=N(R)
UPDATE_N(R)_RECEIVED
RE-SEND_I_RSP(F=1)
CLEAR_REMOTE_BUSY
NORMAL18 SEND_RR_CMD(P=1)
START_P_TIMER
NORMAL19 P_FLAG:=0
; SEND_RR_CMD(P=1)
; START_P_TIMER
; RETRY_COUNT:=RETRY_COUNT+1
NORMAL20 SEND_RR_CMD(P=1)
START_P_TIMER
RETRY_COUNT:=RETRY_COUNT+1
;============================================================================
BUSY1 SEND_I_CMD(P=1)
START_P_TIMER
START_ACK_TIMER_IF_NOT_RUNNING
; SEND_I_XXX(X=0)
; START_ACK_TIMER_IF_NOT_RUNNING
BUSY2 SEND_I_XXX(X=0)
START_ACK_TIMER_IF_NOT_RUNNING
BUSY3 SEND_REJ_CMD(P=1)
START_REJ_TIMER
START_P_TIMER
; SEND_REJ_XXX(X=0)
; START_REJ_TIMER
BUSY4 SEND_REJ_XXX(X=0)
START_REJ_TIMER
BUSY5 SEND_RR_CMD(P=1)
START_P_TIMER
SEND_RR_XXX(X=0)
BUSY6 SEND_RR_XXX(X=0)
BUSY7 SEND_RR_CMD(P=1)
START_P_TIMER
SEND_RR_XXX(X=0)
BUSY8 SEND_RR_XXX(X=0)
BUSY9 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
IF_F=1_CLEAR_REMOTE_BUSY
; SEND_RNR_CMD(P=1)
; START_P_TIMER
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
; IF_F=1_CLEAR_REMOTE_BUSY
BUSY10 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
BUSY11 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
BUSY12 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG=2_STOP_REJ_TIMER
DATA_FLAG:=1
; V(R):=V(R)+1
; DATA_INDICATION
; SEND_RNR_RSP(F=1)
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG=2_STOP_REJ_TIMER
; DATA_FLAG:=0
BUSY13 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG=2_STOP_REJ_TIMER
DATA_FLAG:=1
IF_F=1_CLEAR_REMOTE_BUSY
; SEND_RNR_CMD(F=1)
; START_P_TIMER
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG=2_STOP_REJ_TIMER
; DATA_FLAG:=1
; IF_F=1_CLEAR_REMOTE_BUSY
; V(R):=V(R)+1
; DATA_INDICATION
; SEND_RNR_CMD(F=1)
; START_P_TIMER
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG=2_STOP_REJ_TIMER
; DATA_FLAG:=0
; IF_F=1_CLEAR_REMOTE_BUSY
; V(R):=V(R)+1
; DATA_INDICATION
; UPDATE_P_FLAG
; OPTIONAL_SEND_RNR_XXX(X=0)
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG=2_STOP_REJ_TIMER
; DATA_FLAG:=0
; IF_F=1_CLEAR_REMOTE_BUSY
BUSY14 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
IF_DATA_FLAG=2_STOP_REJ_TIMER
DATA_FLAG:=1
; V(R):=V(R)+1
; DATA_INDICATION
; OPTIONAL_SEND_RNR_XXX(X=0)
; UPDATE_N(R)_RECEIVED
; IF_DATA_FLAG=2_STOP_REJ_TIMER
; DATA_FLAG:=0
BUSY15 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
BUSY16 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
BUSY17 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
BUSY18 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
BUSY19 V(S):=N(R)
UPDATE_N(R)_RECEIVED
UPDATE_P_FLAG
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; V(S):=N(R)
; UPDATE_N(R)_RECEIVED
; RE-SEND_I_CMD(P=1)
; CLEAR_REMOTE_BUSY
BUSY20 V(S):=N(R)
UPDATE_N(R)_RECEIVED
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
BUSY21 V(S):=N(R)
UPDATE_N(R)_RECEIVED
SEND_RNR_RSP(F=1)
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
BUSY22 SEND_RNR_CMD(F=1)
START_P_TIMER
BUSY23 P_FLAG:=0
; SEND_RNR_CMD(F=1)
; START_P_TIMER
; RETRY_COUNT:=RETRY_COUNT+1
BUSY24 SEND_RNR_CMD(F=1)
START_P_TIMER
RETRY_COUNT:=RETRY_COUNT+1
BUSY25 DATA_FLAG:=1
; SEND_RNR_CMD(F=1)
; START_P_TIMER
; RETRY_COUNT:=RETRY_COUNT+1
; DATA_FLAG:=1
BUSY26 DATA_FLAG:=1
;============================================================================
REJECT1 SEND_I_CMD(P=1)
START_P_TIMER
START_ACK_TIMER_IF_NOT_RUNNING
; SEND_I_XXX(X=0)
; START_ACK_TIMER_IF_NOT_RUNNING
REJECT2 SEND_I_XXX(X=0)
START_ACK_TIMER_IF_NOT_RUNNING
REJECT3 SEND_RNR_CMD(F=1)
START_P_TIMER
DATA_FLAG:=2
; SEND_RNR_XXX(X=0)
; DATA_FLAG:=2
REJECT4 SEND_RNR_XXX(X=0)
DATA_FLAG:=2
REJECT5 UPDATE_N(R)_RECEIVED
UPDATE_P_FLAG
IF_F=1_CLEAR_REMOTE_BUSY
REJECT6 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
;
; order of opcodes in REJECT7 is changed
REJECT7 V(R):=V(R)+1
SEND_ACKNOWLEDGE_CMD(P=1)
START_P_TIMER
UPDATE_N(R)_RECEIVED
IF_F=1_CLEAR_REMOTE_BUSY
STOP_REJ_TIMER
DATA_INDICATION
; V(R):=V(R)+1
; DATA_INDICATION
; UPDATE_P_FLAG
; SEND_ACKNOWLEDGE_XXX(X=0)
; UPDATE_N(R)_RECEIVED
; IF_F=1_CLEAR_REMOTE_BUSY
; STOP_REJ_TIMER
;
; order of opcodes in REJECT8 is changed
REJECT8 V(R):=V(R)+1
SEND_ACKNOWLEDGE_XXX(X=0)
UPDATE_N(R)_RECEIVED
STOP_REJ_TIMER
DATA_INDICATION
;
; order of opcodes in REJECT9 is changed
REJECT9 V(R):=V(R)+1
SEND_ACKNOWLEDGE_RSP(F=1)
UPDATE_N(R)_RECEIVED
STOP_REJ_TIMER
DATA_INDICATION
REJECT10 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
REJECT11 SEND_ACKNOWLEDGE_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
REJECT12 UPDATE_P_FLAG
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
REJECT13 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
REJECT14 V(S):=N(R)
UPDATE_N(R)_RECEIVED
UPDATE_P_FLAG
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; V(S):=N(R)
; UPDATE_N(R)_RECEIVED
; RE-SEND_I_CMD(P=1)
; START_P_TIMER
; CLEAR_REMOTE_BUSY
REJECT15 V(S):=N(R)
UPDATE_N(R)_RECEIVED
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
REJECT16 V(S):=N(R)
UPDATE_N(R)_RECEIVED
RE-SEND_I_RSP(F=1)
CLEAR_REMOTE_BUSY
REJECT17 SEND_RR_CMD(P=1)
START_P_TIMER
REJECT18 SEND_REJ_CMD(P=1)
START_P_TIMER
START_REJ_TIMER
RETRY_COUNT:=RETRY_COUNT+1
REJECT19 P_FLAG:=0
; SEND_RR_CMD(P=1)
; START_P_TIMER
; START_REJ_TIMER
; RETRY_COUNT:=RETRY_COUNT+1
REJECT20 SEND_RR_CMD(P=1)
START_P_TIMER
START_REJ_TIMER
RETRY_COUNT:=RETRY_COUNT+1
;============================================================================
AWAIT1 SEND_RNR_XXX(X=0)
DATA_FLAG:=0
AWAIT2 SEND_REJ_XXX(X=0)
UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
RE-SEND_I_XXX(X=0)
START_REJ_TIMER
CLEAR_REMOTE_BUSY
; SEND_REJ_CMD(P=1)
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_XXX(X=0)
; START_P_TIMER
; START_REJ_TIMER
; CLEAR_REMOTE_BUSY
AWAIT3 SEND_REJ_XXX(X=0)
UPDATE_N(R)_RECEIVED
START_REJ_TIMER
AWAIT4 SEND_REJ_RSP(F=1)
UPDATE_N(R)_RECEIVED
START_REJ_TIMER
;
; order of opcode in AWAIT5 changed
AWAIT5 V(R):=V(R)+1
UPDATE_N(R)_RECEIVED
V(S):=N(R)
RE-SEND_I_CMD(P=1)_OR_SEND_RR
START_P_TIMER
CLEAR_REMOTE_BUSY
DATA_INDICATION
; V(R):=V(R)+1
; DATA_INDICATION
; STOP_P_TIMER
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_XXX(X=0)_OR_SEND_RR
; CLEAR_REMOTE_BUSY
;
; order of opcode in AWAIT6 changed
AWAIT6 V(R):=V(R)+1
SEND_RR_XXX(X=0)
UPDATE_N(R)_RECEIVED
DATA_INDICATION
;
; order of opcode in AWAIT7 changed
AWAIT7 V(R):=V(R)+1
SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
DATA_INDICATION
AWAIT8 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_CMD(P=1)
; START_P_TIMER
; CLEAR_REMOTE_BUSY
AWAIT9 UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT10 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT11 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
SET_REMOTE_BUSY
AWAIT12 UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT13 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT14 SEND_RR_CMD(P=1)
START_P_TIMER
RETRY_COUNT:=RETRY_COUNT+1
;============================================================================
AWAIT_BUSY1 SEND_REJ_XXX(X=0)
START_REJ_TIMER
AWAIT_BUSY2 SEND_RR_XXX(X=0)
AWAIT_BUSY3 SEND_RR_XXX(X=0)
AWAIT_BUSY4 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
DATA_FLAG:=1
CLEAR_REMOTE_BUSY
RE-SEND_I_XXX(X=0)
; SEND_RNR_CMD(F=1)
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; START_P_TIMER
; DATA_FLAG:=1
; CLEAR_REMOTE_BUSY
; RE-SEND_I_XXX(X=0)
AWAIT_BUSY5 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
DATA_FLAG:=1
AWAIT_BUSY6 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
DATA_FLAG:=1
AWAIT_BUSY7 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
V(S):=N(R)
DATA_FLAG:=1
STOP_P_TIMER
CLEAR_REMOTE_BUSY
RE-SEND_I_XXX(X=0)
; SEND_RNR_CMD(F=1)
; V(R):=V(R)+1
; DATA_INDICATION
; START_P_TIMER
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; DATA_FLAG:=0
; CLEAR_REMOTE_BUSY
; RE-SEND_I_XXX(X=0)
; OPTIONAL_SEND_RNR_XXX(X=0)
; V(R):=V(R)+1
; DATA_INDICATION
; STOP_P_TIMER
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; DATA_FLAG:=0
; CLEAR_REMOTE_BUSY
; RE-SEND_I_XXX(X=0)
AWAIT_BUSY8 OPTIONAL_SEND_RNR_XXX(X=0)
UPDATE_N(R)_RECEIVED
DATA_FLAG:=1
; OPTIONAL_SEND_RNR_XXX(X=0)
; V(R):=V(R)+1
; DATA_INDICATION
; UPDATE_N(R)_RECEIVED
; DATA_FLAG:=0
AWAIT_BUSY9 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
DATA_FLAG:=1
; SEND_RNR_RSP(F=1)
; V(R):=V(R)+1
; DATA_INDICATION
; UPDATE_N(R)_RECEIVED
; DATA_FLAG:=0
AWAIT_BUSY10 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_CMD(P=1)
; START_P_TIMER
; CLEAR_REMOTE_BUSY
AWAIT_BUSY11 UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT_BUSY12 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT_BUSY13 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
SET_REMOTE_BUSY
AWAIT_BUSY14 UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT_BUSY15 SEND_RNR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT_BUSY16 SEND_RNR_CMD(F=1)
START_P_TIMER
RETRY_COUNT:=RETRY_COUNT+1
;============================================================================
AWAIT_REJECT1 SEND_RNR_XXX(X=0)
DATA_FLAG:=2
AWAIT_REJECT2 UPDATE_N(R)_RECEIVED
AWAIT_REJECT3 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
;
; order of opcodes in AWAIT_REJECT4 changed
AWAIT_REJECT4 V(R):=V(R)+1
UPDATE_N(R)_RECEIVED
V(S):=N(R)
RE-SEND_I_CMD(P=1)_OR_SEND_RR
START_P_TIMER
STOP_REJ_TIMER
CLEAR_REMOTE_BUSY
DATA_INDICATION
; V(R):=V(R)+1
; DATA_INDICATION
; STOP_P_TIMER
; STOP_REJ_TIMER
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_CMD(P=1)_OR_SEND_RR
; CLEAR_REMOTE_BUSY
;
; order of opcodes in AWAIT_REJECT5 changed
AWAIT_REJECT5 V(R):=V(R)+1
SEND_RR_XXX(X=0)
STOP_REJ_TIMER
UPDATE_N(R)_RECEIVED
DATA_INDICATION
;
; order of opcodes in AWAIT_REJECT6 changed
AWAIT_REJECT6 V(R):=V(R)+1
SEND_RR_RSP(F=1)
STOP_REJ_TIMER
UPDATE_N(R)_RECEIVED
DATA_INDICATION
AWAIT_REJECT7 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
RE-SEND_I_XXX(X=0)
CLEAR_REMOTE_BUSY
; UPDATE_N(R)_RECEIVED
; V(S):=N(R)
; RE-SEND_I_CMD(P=1)
; START_P_TIMER
; CLEAR_REMOTE_BUSY
AWAIT_REJECT8 UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT_REJECT9 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
CLEAR_REMOTE_BUSY
AWAIT_REJECT10 UPDATE_N(R)_RECEIVED
V(S):=N(R)
STOP_P_TIMER
SET_REMOTE_BUSY
AWAIT_REJECT11 UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT_REJECT12 SEND_RR_RSP(F=1)
UPDATE_N(R)_RECEIVED
SET_REMOTE_BUSY
AWAIT_REJECT13 SEND_REJ_CMD(P=1)
START_P_TIMER
RETRY_COUNT:=RETRY_COUNT+1
;============================================================================
......@@ -14,15 +14,16 @@
#include <linux/sysctl.h>
#include <linux/config.h>
ctl_table e802_table[] = {
{0}
};
#ifdef CONFIG_TR
extern int sysctl_tr_rif_timeout;
ctl_table tr_table[] = {
{NET_TR_RIF_TIMEOUT, "rif_timeout", &sysctl_tr_rif_timeout, sizeof(int),
0644, NULL, &proc_dointvec},
{0}
struct ctl_table tr_table[] = {
{
.ctl_name = NET_TR_RIF_TIMEOUT,
.procname = "rif_timeout",
.data = &sysctl_tr_rif_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{ 0 },
};
#endif
# to run: awk -f transit.awk transit.p0
#
BEGIN { "date" | getline
enable_index = 1
today = $0
printf("\n/* this file was generated on %s */\n", today )
not_firstone = 0 # flag to avoid empty entry in 1st table
fpe = 0 # entry tbl array fill pointer
fpeo = 0 # entry tbl offset list fill pointer
fpdef = 0 # define list fill pointer
}
### /^;/ { } # line starting with a semicolon is comment
/^[A-Z]/ { # table name
if ( $1 == "TABLE" ) {
tbl = $2 # get table name
newtbl( tbl )
}
else if ( $1 == "COMPILE" ) {
array_name = $2
if ( $3 == "NOINDEX" ) { enable_index = 0 }
}
else { # table entry
ec = ec +1
n = split( $0, fld, " " )
action = fld[ n-1 ]
newstate = fld[ n ]
store( action, newstate )
ecct = ecct +1
}
}
END { store( action, newstate )
if ( enable_index ) {
printf( "\n/* index name #defines: */\n\n",
ec, ecct )
for( ii = 1; ii <= fpeo; ii++ ){
printf( "#define %-12s %3d\n", define[ ii ], ii -1 )
}
}
printf( "\n\n/* size of transition table is %d bytes */\n",
fpe )
if ( enable_index ) {
printf( "\nstatic short int %s_offset [ ] ={", array_name )
for( ii = 1; ii <= fpeo; ii++ ){
if ( (ii % 10) == 1 ) printf("\n ")
printf( " %4d", entry_offset[ ii ] )
if ( ii < fpeo ) printf( "," )
}
printf(" };\n")
}
printf( "\nstatic char %s_entry [ ] = {", array_name )
for( ii = 1; ii <= fpe; ii++ ){
if ( (ii % 6) == 1 ) printf("\n ")
printf( " %-14s", entry[ ii ] )
if ( ii < fpe ) printf( "," )
}
printf(" };\n")
}
function store( act, ns ){
# printf( "%s %s\n", act, ns )
entry[ ++fpe ] = act
entry[ ++fpe ] = ns
}
function newtbl( tbl ){
if ( not_firstone ) {
store( action, newstate )
}
not_firstone = 1
entry_offset[ ++fpeo ] = fpe # entry tbl offset list
define[ ++fpdef ] = tbl # state name to define
}
COMPILE pdutr INDEX
;
; Transition tables for incoming pdu events.
; translate this thing into C with
; awk -f ./compile.awk pdu.trans > pdutr.h
;
TABLE ADM
;Transition table for the ADM state:
;
;frame type p bit action newstate
;received in frame
;
I_CMD 0 ADM5 ADM
I_CMD 1 ADM4 ADM
RR_CMD 0 ADM5 ADM
RR_CMD 1 ADM4 ADM
RNR_CMD 0 ADM5 ADM
RNR_CMD 1 ADM4 ADM
REJ_CMD 0 ADM5 ADM
REJ_CMD 1 ADM4 ADM
DISC_CMD 0 ADM3 ADM
DISC_CMD 1 ADM3 ADM
SABME_CMD 0 ADM2 CONN
SABME_CMD 1 ADM2 CONN
I_RSP 0 ADM5 ADM
I_RSP 1 ADM5 ADM
RR_RSP 0 ADM5 ADM
RR_RSP 1 ADM5 ADM
RNR_RSP 0 ADM5 ADM
RNR_RSP 1 ADM5 ADM
REJ_RSP 0 ADM5 ADM
REJ_RSP 1 ADM5 ADM
UA_RSP 0 ADM5 ADM
UA_RSP 1 ADM5 ADM
DM_RSP 0 ADM5 ADM
DM_RSP 1 ADM5 ADM
FRMR_RSP 0 ADM5 ADM
FRMR_RSP 1 ADM5 ADM
;
TABLE CONN
;
;Transition table for the CONN state:
;
;frame type action newstate
;received
;
I_CMD CONN5 CONN
RR_CMD CONN5 CONN
RNR_CMD CONN5 CONN
REJ_CMD CONN5 CONN
DISC_CMD CONN5 CONN
SABME_CMD CONN3 CONN
I_RSP CONN5 CONN
RR_RSP CONN5 CONN
RNR_RSP CONN5 CONN
REJ_RSP CONN5 CONN
UA_RSP CONN5 CONN
DM_RSP CONN4 ADM
FRMR_RSP CONN5 CONN
;
TABLE RESET_WAIT
;Transition table for the RESET_WAIT
;
;frame type action newstate
;received
;
I_CMD RESWAIT8 RESET_WAIT
RR_CMD RESWAIT8 RESET_WAIT
RNR_CMD RESWAIT8 RESET_WAIT
REJ_CMD RESWAIT8 RESET_WAIT
DISC_CMD RESWAIT7 RESET_WAIT
SABME_CMD RESWAIT6 RESET_WAIT
I_RSP RESWAIT8 RESET_WAIT
RR_RSP RESWAIT8 RESET_WAIT
RNR_RSP RESWAIT8 RESET_WAIT
REJ_RSP RESWAIT8 RESET_WAIT
UA_RSP RESWAIT8 RESET_WAIT
DM_RSP RESWAIT5 ADM
FRMR_RSP RESWAIT8 RESET_WAIT
;
;
TABLE RESET_CHECK
;Transition table for the RESET_CHECK state
;
;frame type action newstate
;received
;
I_CMD RESCHK6 RESET_CHECK
RR_CMD RESCHK6 RESET_CHECK
RNR_CMD RESCHK6 RESET_CHECK
REJ_CMD RESCHK6 RESET_CHECK
DISC_CMD RESCHK5 ADM
SABME_CMD RESCHK4 RESET_CHECK
I_RSP RESCHK6 RESET_CHECK
RR_RSP RESCHK6 RESET_CHECK
RNR_RSP RESCHK6 RESET_CHECK
REJ_RSP RESCHK6 RESET_CHECK
UA_RSP RESCHK6 RESET_CHECK
DM_RSP RESCHK3 ADM
FRMR_RSP RESCHK6 RESET_CHECK
;
;
TABLE SETUP
;Transition table for the SETUP state
;
;frame type p flag action newstate
;received = f
;
I_CMD 0 SETUP6 SETUP
I_CMD 1 SETUP6 SETUP
RR_CMD 0 SETUP6 SETUP
RR_CMD 1 SETUP6 SETUP
RNR_CMD 0 SETUP6 SETUP
RNR_CMD 1 SETUP6 SETUP
REJ_CMD 0 SETUP6 SETUP
REJ_CMD 1 SETUP6 SETUP
DISC_CMD 0 SETUP4 ADM
DISC_CMD 1 SETUP4 ADM
SABME_CMD 0 SETUP1 SETUP
SABME_CMD 1 SETUP1 SETUP
I_RSP 0 SETUP6 SETUP
I_RSP 1 SETUP6 SETUP
RR_RSP 0 SETUP6 SETUP
RR_RSP 1 SETUP6 SETUP
RNR_RSP 0 SETUP6 SETUP
RNR_RSP 1 SETUP6 SETUP
REJ_RSP 0 SETUP6 SETUP
REJ_RSP 1 SETUP6 SETUP
UA_RSP 0 SETUP6 SETUP
UA_RSP 1 SETUP2 NORMAL
DM_RSP 0 SETUP5 ADM
DM_RSP 1 SETUP5 ADM
FRMR_RSP 0 SETUP6 SETUP
FRMR_RSP 1 SETUP6 SETUP
;
;
TABLE RESET
;Transition table for the RESET state:
;
;frame type p flag action newstate
;received = f
;
I_CMD 0 RESET6 RESET
I_CMD 1 RESET6 RESET
RR_CMD 0 RESET6 RESET
RR_CMD 1 RESET6 RESET
RNR_CMD 0 RESET6 RESET
RNR_CMD 1 RESET6 RESET
REJ_CMD 0 RESET6 RESET
REJ_CMD 1 RESET6 RESET
DISC_CMD 0 RESET4 ADM
DISC_CMD 1 RESET4 ADM
SABME_CMD 0 RESET1 RESET
SABME_CMD 1 RESET1 RESET
I_RSP 0 RESET6 RESET
I_RSP 1 RESET6 RESET
RR_RSP 0 RESET6 RESET
RR_RSP 1 RESET6 RESET
RNR_RSP 0 RESET6 RESET
RNR_RSP 1 RESET6 RESET
REJ_RSP 0 RESET6 RESET
REJ_RSP 1 RESET6 RESET
UA_RSP 0 RESET6 RESET
UA_RSP 1 RESET2 NORMAL
DM_RSP 0 RESET5 ADM
DM_RSP 1 RESET5 ADM
FRMR_RSP 0 RESET6 RESET
FRMR_RSP 1 RESET6 RESET
;
;
TABLE D_CONN
;Transition table for the D_CONN state:
;
;frame type p bit action newstate
;received in frame
I_CMD 0 D_CONN5 D_CONN
I_CMD 1 D_CONN5 D_CONN
RR_CMD 0 D_CONN5 D_CONN
RR_CMD 1 D_CONN5 D_CONN
RNR_CMD 0 D_CONN5 D_CONN
RNR_CMD 1 D_CONN5 D_CONN
REJ_CMD 0 D_CONN5 D_CONN
REJ_CMD 1 D_CONN5 D_CONN
DISC_CMD 0 D_CONN3 D_CONN
DISC_CMD 1 D_CONN3 D_CONN
SABME_CMD 0 D_CONN1 ADM
SABME_CMD 1 D_CONN1 ADM
I_RSP 0 D_CONN5 D_CONN
I_RSP 1 D_CONN5 D_CONN
RR_RSP 0 D_CONN5 D_CONN
RR_RSP 1 D_CONN5 D_CONN
RNR_RSP 0 D_CONN5 D_CONN
RNR_RSP 1 D_CONN5 D_CONN
REJ_RSP 0 D_CONN5 D_CONN
REJ_RSP 1 D_CONN5 D_CONN
UA_RSP 0 D_CONN5 D_CONN
UA_RSP 1 D_CONN4 ADM
DM_RSP 0 D_CONN4 ADM
DM_RSP 1 D_CONN5 ADM
FRMR_RSP 0 D_CONN5 D_CONN
FRMR_RSP 1 D_CONN5 D_CONN
;
;
TABLE ERROR
;Transition table for the ERROR state:
;
;frame type action newstate
;received
;
I_CMD ERR5 ERROR
RR_CMD ERR5 ERROR
RNR_CMD ERR5 ERROR
REJ_CMD ERR5 ERROR
DISC_CMD ERR2 ADM
SABME_CMD ERR1 RESET_CHECK
I_RSP ERR6 ERROR
RR_RSP ERR6 ERROR
RNR_RSP ERR6 ERROR
REJ_RSP ERR6 ERROR
UA_RSP ERR6 ERROR
DM_RSP ERR3 ADM
FRMR_RSP ERR4 RESET_WAIT
;
TABLE NORMAL
;Transition table for the NORMAL state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 NORMAL8B NORMAL
I_CMD 0 0 1 NORMAL9 NORMAL
I_CMD 0 1 0 NORMAL10 NORMAL
I_CMD 0 1 1 NORMAL10 NORMAL
I_CMD 1 0 0 NORMAL5 REJECT
I_CMD 1 0 1 NORMAL6 REJECT
I_CMD 1 1 0 NORMAL7 REJECT
I_CMD 1 1 1 NORMAL7 REJECT
RR_CMD 0 0 0 NORMAL11 NORMAL
RR_CMD 0 0 1 NORMAL11 NORMAL
RR_CMD 0 1 0 NORMAL12 NORMAL
RR_CMD 0 1 1 NORMAL12 NORMAL
RR_CMD 1 0 0 NORMAL11 NORMAL
RR_CMD 1 0 1 NORMAL11 NORMAL
RR_CMD 1 1 0 NORMAL12 NORMAL
RR_CMD 1 1 1 NORMAL12 NORMAL
RNR_CMD 0 0 0 NORMAL13 NORMAL
RNR_CMD 0 0 1 NORMAL13 NORMAL
RNR_CMD 0 1 0 NORMAL14 NORMAL
RNR_CMD 0 1 1 NORMAL14 NORMAL
RNR_CMD 1 0 0 NORMAL13 NORMAL
RNR_CMD 1 0 1 NORMAL13 NORMAL
RNR_CMD 1 1 0 NORMAL14 NORMAL
RNR_CMD 1 1 1 NORMAL14 NORMAL
REJ_CMD 0 0 0 NORMAL15 NORMAL
REJ_CMD 0 0 1 NORMAL16 NORMAL
REJ_CMD 0 1 0 NORMAL17 NORMAL
REJ_CMD 0 1 1 NORMAL17 NORMAL
REJ_CMD 1 0 0 NORMAL15 NORMAL
REJ_CMD 1 0 1 NORMAL16 NORMAL
REJ_CMD 1 1 0 NORMAL17 NORMAL
REJ_CMD 1 1 1 NORMAL17 NORMAL
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 NORMAL8B NORMAL
I_RSP 0 0 1 NORMAL9 NORMAL
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 NORMAL8A NORMAL
I_RSP 1 0 0 NORMAL5 REJECT
I_RSP 1 0 1 NORMAL6 REJECT
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 NORMAL5 REJECT
RR_RSP 0 0 0 NORMAL11 NORMAL
RR_RSP 0 0 1 NORMAL11 NORMAL
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 NORMAL11 NORMAL
RR_RSP 1 0 0 NORMAL11 NORMAL
RR_RSP 1 0 1 NORMAL11 NORMAL
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 NORMAL11 NORMAL
RNR_RSP 0 0 0 NORMAL13 NORMAL
RNR_RSP 0 0 1 NORMAL13 NORMAL
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 NORMAL13 NORMAL
RNR_RSP 1 0 0 NORMAL13 NORMAL
RNR_RSP 1 0 1 NORMAL13 NORMAL
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 NORMAL13 NORMAL
REJ_RSP 0 0 0 NORMAL15 NORMAL
REJ_RSP 0 0 1 NORMAL16 NORMAL
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 NORMAL15 NORMAL
REJ_RSP 1 0 0 NORMAL15 NORMAL
REJ_RSP 1 0 1 NORMAL16 NORMAL
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 NORMAL15 NORMAL
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 1 modified by tredit4 I_CMD 1 0 0 NORMAL5 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP 1 0 0 NORMAL5 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP 1 1 1 NORMAL5 REJECT
;112 entries in table, 1 modified by tredit4 I_CMD 1 0 1 NORMAL6 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP 1 0 1 NORMAL6 REJECT
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x NORMAL7 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP x 1 1 NORMAL8A NORMAL
;112 entries in table, 1 modified by tredit4 I_RSP x 0 0 NORMAL8B NORMAL
;112 entries in table, 1 modified by tredit4 I_CMD x 0 0 NORMAL8B NORMAL
;112 entries in table, 1 modified by tredit4 I_RSP x 0 1 NORMAL9 NORMAL
;112 entries in table, 1 modified by tredit4 I_CMD x 0 1 NORMAL9 NORMAL
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x NORMAL10 NORMAL
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x NORMAL11 NORMAL
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x NORMAL11 NORMAL
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 1 NORMAL11 NORMAL
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x NORMAL12 NORMAL
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x NORMAL13 NORMAL
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x NORMAL13 NORMAL
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 1 NORMAL13 NORMAL
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x NORMAL14 NORMAL
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 0 NORMAL15 NORMAL
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 1 NORMAL15 NORMAL
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 0 NORMAL15 NORMAL
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 1 NORMAL16 NORMAL
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 1 NORMAL16 NORMAL
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x NORMAL17 NORMAL
;
TABLE BUSY
;Transition table for the BUSY state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 BUSY13 BUSY
I_CMD 0 0 1 BUSY14 BUSY
I_CMD 0 1 0 BUSY12 BUSY
I_CMD 0 1 1 BUSY12 BUSY
I_CMD 1 0 0 BUSY9 BUSY
I_CMD 1 0 1 BUSY10 BUSY
I_CMD 1 1 0 BUSY11 BUSY
I_CMD 1 1 1 BUSY11 BUSY
RR_CMD 0 0 0 BUSY15 BUSY
RR_CMD 0 0 1 BUSY15 BUSY
RR_CMD 0 1 0 BUSY16 BUSY
RR_CMD 0 1 1 BUSY16 BUSY
RR_CMD 1 0 0 BUSY15 BUSY
RR_CMD 1 0 1 BUSY15 BUSY
RR_CMD 1 1 0 BUSY16 BUSY
RR_CMD 1 1 1 BUSY16 BUSY
RNR_CMD 0 0 0 BUSY17 BUSY
RNR_CMD 0 0 1 BUSY17 BUSY
RNR_CMD 0 1 0 BUSY18 BUSY
RNR_CMD 0 1 1 BUSY18 BUSY
RNR_CMD 1 0 0 BUSY17 BUSY
RNR_CMD 1 0 1 BUSY17 BUSY
RNR_CMD 1 1 0 BUSY18 BUSY
RNR_CMD 1 1 1 BUSY18 BUSY
REJ_CMD 0 0 0 BUSY19 BUSY
REJ_CMD 0 0 1 BUSY20 BUSY
REJ_CMD 0 1 0 BUSY21 BUSY
REJ_CMD 0 1 1 BUSY21 BUSY
REJ_CMD 1 0 0 BUSY19 BUSY
REJ_CMD 1 0 1 BUSY20 BUSY
REJ_CMD 1 1 0 BUSY21 BUSY
REJ_CMD 1 1 1 BUSY21 BUSY
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 BUSY13 BUSY
I_RSP 0 0 1 BUSY14 BUSY
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 BUSY13 BUSY
I_RSP 1 0 0 BUSY9 BUSY
I_RSP 1 0 1 BUSY10 BUSY
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 BUSY9 BUSY
RR_RSP 0 0 0 BUSY15 BUSY
RR_RSP 0 0 1 BUSY15 BUSY
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 BUSY15 BUSY
RR_RSP 1 0 0 BUSY15 BUSY
RR_RSP 1 0 1 BUSY15 BUSY
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 BUSY15 BUSY
RNR_RSP 0 0 0 BUSY17 BUSY
RNR_RSP 0 0 1 BUSY17 BUSY
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 BUSY17 BUSY
RNR_RSP 1 0 0 BUSY17 BUSY
RNR_RSP 1 0 1 BUSY17 BUSY
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 BUSY17 BUSY
REJ_RSP 0 0 0 BUSY19 BUSY
REJ_RSP 0 0 1 BUSY20 BUSY
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 BUSY19 BUSY
REJ_RSP 1 0 0 BUSY19 BUSY
REJ_RSP 1 0 1 BUSY20 BUSY
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 BUSY19 BUSY
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 1 modified by tredit4 I_RSP 1 0 0 BUSY9 BUSY
;112 entries in table, 1 modified by tredit4 I_RSP 1 1 1 BUSY9 BUSY
;112 entries in table, 1 modified by tredit4 I_CMD 1 0 0 BUSY9 BUSY
;112 entries in table, 1 modified by tredit4 I_RSP 1 0 1 BUSY10 BUSY
;112 entries in table, 1 modified by tredit4 I_CMD 1 0 1 BUSY10 BUSY
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x BUSY11 BUSY
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x BUSY12 BUSY
;112 entries in table, 1 modified by tredit4 I_RSP x 0 0 BUSY13 BUSY
;112 entries in table, 1 modified by tredit4 I_RSP x 1 1 BUSY13 BUSY
;112 entries in table, 1 modified by tredit4 I_CMD x 0 0 BUSY13 BUSY
;112 entries in table, 1 modified by tredit4 I_RSP x 0 1 BUSY14 BUSY
;112 entries in table, 1 modified by tredit4 I_CMD x 0 1 BUSY14 BUSY
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x BUSY15 BUSY
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x BUSY15 BUSY
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 1 BUSY15 BUSY
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x BUSY16 BUSY
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x BUSY17 BUSY
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x BUSY17 BUSY
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 1 BUSY17 BUSY
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x BUSY18 BUSY
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 0 BUSY19 BUSY
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 0 BUSY19 BUSY
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 1 BUSY19 BUSY
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 1 BUSY20 BUSY
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 1 BUSY20 BUSY
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x BUSY21 BUSY
;
TABLE REJECT
;Transition table for the REJECT state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 REJECT7 REJECT
I_CMD 0 0 1 REJECT8 REJECT
I_CMD 0 1 0 REJECT9 REJECT
I_CMD 0 1 1 REJECT9 REJECT
I_CMD 1 0 0 REJECT5 REJECT
I_CMD 1 0 1 REJECT5 REJECT
I_CMD 1 1 0 REJECT6 REJECT
I_CMD 1 1 1 REJECT6 REJECT
RR_CMD 0 0 0 REJECT10 REJECT
RR_CMD 0 0 1 REJECT10 REJECT
RR_CMD 0 1 0 REJECT11 REJECT
RR_CMD 0 1 1 REJECT11 REJECT
RR_CMD 1 0 0 REJECT10 REJECT
RR_CMD 1 0 1 REJECT10 REJECT
RR_CMD 1 1 0 REJECT11 REJECT
RR_CMD 1 1 1 REJECT11 REJECT
RNR_CMD 0 0 0 REJECT12 REJECT
RNR_CMD 0 0 1 REJECT12 REJECT
RNR_CMD 0 1 0 REJECT13 REJECT
RNR_CMD 0 1 1 REJECT13 REJECT
RNR_CMD 1 0 0 REJECT12 REJECT
RNR_CMD 1 0 1 REJECT12 REJECT
RNR_CMD 1 1 0 REJECT13 REJECT
RNR_CMD 1 1 1 REJECT13 REJECT
REJ_CMD 0 0 0 REJECT14 REJECT
REJ_CMD 0 0 1 REJECT15 REJECT
REJ_CMD 0 1 0 REJECT16 REJECT
REJ_CMD 0 1 1 REJECT16 REJECT
REJ_CMD 1 0 0 REJECT14 REJECT
REJ_CMD 1 0 1 REJECT15 REJECT
REJ_CMD 1 1 0 REJECT16 REJECT
REJ_CMD 1 1 1 REJECT16 REJECT
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 REJECT7 REJECT
I_RSP 0 0 1 REJECT8 REJECT
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 REJECT7 REJECT
I_RSP 1 0 0 REJECT5 REJECT
I_RSP 1 0 1 REJECT5 REJECT
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 REJECT5 REJECT
RR_RSP 0 0 0 REJECT10 REJECT
RR_RSP 0 0 1 REJECT10 REJECT
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 REJECT10 REJECT
RR_RSP 1 0 0 REJECT10 REJECT
RR_RSP 1 0 1 REJECT10 REJECT
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 REJECT10 REJECT
RNR_RSP 0 0 0 REJECT12 REJECT
RNR_RSP 0 0 1 REJECT12 REJECT
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 REJECT12 REJECT
RNR_RSP 1 0 0 REJECT12 REJECT
RNR_RSP 1 0 1 REJECT12 REJECT
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 REJECT12 REJECT
REJ_RSP 0 0 0 REJECT14 REJECT
REJ_RSP 0 0 1 REJECT15 REJECT
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 REJECT14 REJECT
REJ_RSP 1 0 0 REJECT14 REJECT
REJ_RSP 1 0 1 REJECT15 REJECT
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 REJECT14 REJECT
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 2 modified by tredit4 I_CMD 1 0 x REJECT5 REJECT
;112 entries in table, 2 modified by tredit4 I_RSP 1 0 x REJECT5 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP 1 1 1 REJECT5 REJECT
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x REJECT6 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP x 1 1 REJECT7 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP x 0 0 REJECT7 REJECT
;112 entries in table, 1 modified by tredit4 I_CMD x 0 0 REJECT7 REJECT
;112 entries in table, 1 modified by tredit4 I_RSP x 0 1 REJECT8 REJECT
;112 entries in table, 1 modified by tredit4 I_CMD x 0 1 REJECT8 REJECT
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x REJECT9 REJECT
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x REJECT10 REJECT
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x REJECT10 REJECT
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 1 REJECT10 REJECT
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x REJECT11 REJECT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x REJECT12 REJECT
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x REJECT12 REJECT
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 1 REJECT12 REJECT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x REJECT13 REJECT
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 0 REJECT14 REJECT
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 0 REJECT14 REJECT
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 1 REJECT14 REJECT
;112 entries in table, 2 modified by tredit4 REJ_CMD x 0 1 REJECT15 REJECT
;112 entries in table, 2 modified by tredit4 REJ_RSP x 0 1 REJECT15 REJECT
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x REJECT16 REJECT
;
TABLE AWAIT
;Transition table for the AWAIT state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 AWAIT6 AWAIT
I_CMD 0 0 1 AWAIT6 AWAIT
I_CMD 0 1 0 AWAIT7 AWAIT
I_CMD 0 1 1 AWAIT7 AWAIT
I_CMD 1 0 0 AWAIT3 AWAIT_REJECT
I_CMD 1 0 1 AWAIT3 AWAIT_REJECT
I_CMD 1 1 0 AWAIT4 AWAIT_REJECT
I_CMD 1 1 1 AWAIT4 AWAIT_REJECT
RR_CMD 0 0 0 AWAIT9 AWAIT
RR_CMD 0 0 1 AWAIT9 AWAIT
RR_CMD 0 1 0 AWAIT10 AWAIT
RR_CMD 0 1 1 AWAIT10 AWAIT
RR_CMD 1 0 0 AWAIT9 AWAIT
RR_CMD 1 0 1 AWAIT9 AWAIT
RR_CMD 1 1 0 AWAIT10 AWAIT
RR_CMD 1 1 1 AWAIT10 AWAIT
RNR_CMD 0 0 0 AWAIT12 AWAIT
RNR_CMD 0 0 1 AWAIT12 AWAIT
RNR_CMD 0 1 0 AWAIT13 AWAIT
RNR_CMD 0 1 1 AWAIT13 AWAIT
RNR_CMD 1 0 0 AWAIT12 AWAIT
RNR_CMD 1 0 1 AWAIT12 AWAIT
RNR_CMD 1 1 0 AWAIT13 AWAIT
RNR_CMD 1 1 1 AWAIT13 AWAIT
REJ_CMD 0 0 0 AWAIT9 AWAIT
REJ_CMD 0 0 1 AWAIT9 AWAIT
REJ_CMD 0 1 0 AWAIT10 AWAIT
REJ_CMD 0 1 1 AWAIT10 AWAIT
REJ_CMD 1 0 0 AWAIT9 AWAIT
REJ_CMD 1 0 1 AWAIT9 AWAIT
REJ_CMD 1 1 0 AWAIT10 AWAIT
REJ_CMD 1 1 1 AWAIT10 AWAIT
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 AWAIT6 AWAIT
I_RSP 0 0 1 AWAIT6 AWAIT
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 AWAIT5 NORMAL
I_RSP 1 0 0 AWAIT3 AWAIT_REJECT
I_RSP 1 0 1 AWAIT3 AWAIT_REJECT
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 AWAIT2 REJECT
RR_RSP 0 0 0 AWAIT9 AWAIT
RR_RSP 0 0 1 AWAIT9 AWAIT
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 AWAIT8 AWAIT
RR_RSP 1 0 0 AWAIT9 AWAIT
RR_RSP 1 0 1 AWAIT9 AWAIT
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 AWAIT8 AWAIT
RNR_RSP 0 0 0 AWAIT12 AWAIT
RNR_RSP 0 0 1 AWAIT12 AWAIT
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 AWAIT11 AWAIT
RNR_RSP 1 0 0 AWAIT12 AWAIT
RNR_RSP 1 0 1 AWAIT12 AWAIT
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 AWAIT11 AWAIT
REJ_RSP 0 0 0 AWAIT9 AWAIT
REJ_RSP 0 0 1 AWAIT9 AWAIT
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 AWAIT8 AWAIT
REJ_RSP 1 0 0 AWAIT9 AWAIT
REJ_RSP 1 0 1 AWAIT9 AWAIT
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 AWAIT8 AWAIT
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 1 modified by tredit4 I_RSP 1 1 x AWAIT2 REJECT
;112 entries in table, 2 modified by tredit4 I_CMD 1 0 x AWAIT3 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 I_RSP 1 0 x AWAIT3 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x AWAIT4 AWAIT_REJECT
;112 entries in table, 1 modified by tredit4 I_RSP x 1 x AWAIT5 NORMAL
;112 entries in table, 2 modified by tredit4 I_RSP x 0 x AWAIT6 AWAIT
;112 entries in table, 2 modified by tredit4 I_CMD x 0 x AWAIT6 AWAIT
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x AWAIT7 AWAIT
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 x AWAIT8 AWAIT
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 x AWAIT8 AWAIT
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x AWAIT9 AWAIT
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x AWAIT9 AWAIT
;112 entries in table, 4 modified by tredit4 REJ_CMD x 0 x AWAIT9 AWAIT
;112 entries in table, 4 modified by tredit4 REJ_RSP x 0 x AWAIT9 AWAIT
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x AWAIT10 AWAIT
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x AWAIT10 AWAIT
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 x AWAIT11 AWAIT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x AWAIT12 AWAIT
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x AWAIT12 AWAIT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x AWAIT13 AWAIT
;
TABLE AWAIT_BUSY
;Transition table for the AWAIT_BUSY state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 AWAIT_BUSY8 AWAIT_BUSY
I_CMD 0 0 1 AWAIT_BUSY8 AWAIT_BUSY
I_CMD 0 1 0 AWAIT_BUSY9 AWAIT_BUSY
I_CMD 0 1 1 AWAIT_BUSY9 AWAIT_BUSY
I_CMD 1 0 0 AWAIT_BUSY5 AWAIT_BUSY
I_CMD 1 0 1 AWAIT_BUSY5 AWAIT_BUSY
I_CMD 1 1 0 AWAIT_BUSY6 AWAIT_BUSY
I_CMD 1 1 1 AWAIT_BUSY6 AWAIT_BUSY
RR_CMD 0 0 0 AWAIT_BUSY11 AWAIT_BUSY
RR_CMD 0 0 1 AWAIT_BUSY11 AWAIT_BUSY
RR_CMD 0 1 0 AWAIT_BUSY12 AWAIT_BUSY
RR_CMD 0 1 1 AWAIT_BUSY12 AWAIT_BUSY
RR_CMD 1 0 0 AWAIT_BUSY11 AWAIT_BUSY
RR_CMD 1 0 1 AWAIT_BUSY11 AWAIT_BUSY
RR_CMD 1 1 0 AWAIT_BUSY12 AWAIT_BUSY
RR_CMD 1 1 1 AWAIT_BUSY12 AWAIT_BUSY
RNR_CMD 0 0 0 AWAIT_BUSY14 AWAIT_BUSY
RNR_CMD 0 0 1 AWAIT_BUSY14 AWAIT_BUSY
RNR_CMD 0 1 0 AWAIT_BUSY15 AWAIT_BUSY
RNR_CMD 0 1 1 AWAIT_BUSY15 AWAIT_BUSY
RNR_CMD 1 0 0 AWAIT_BUSY14 AWAIT_BUSY
RNR_CMD 1 0 1 AWAIT_BUSY14 AWAIT_BUSY
RNR_CMD 1 1 0 AWAIT_BUSY15 AWAIT_BUSY
RNR_CMD 1 1 1 AWAIT_BUSY15 AWAIT_BUSY
REJ_CMD 0 0 0 AWAIT_BUSY11 AWAIT_BUSY
REJ_CMD 0 0 1 AWAIT_BUSY11 AWAIT_BUSY
REJ_CMD 0 1 0 AWAIT_BUSY12 AWAIT_BUSY
REJ_CMD 0 1 1 AWAIT_BUSY12 AWAIT_BUSY
REJ_CMD 1 0 0 AWAIT_BUSY11 AWAIT_BUSY
REJ_CMD 1 0 1 AWAIT_BUSY11 AWAIT_BUSY
REJ_CMD 1 1 0 AWAIT_BUSY12 AWAIT_BUSY
REJ_CMD 1 1 1 AWAIT_BUSY12 AWAIT_BUSY
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 AWAIT_BUSY8 AWAIT_BUSY
I_RSP 0 0 1 AWAIT_BUSY8 AWAIT_BUSY
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 AWAIT_BUSY7 BUSY
I_RSP 1 0 0 AWAIT_BUSY5 AWAIT_BUSY
I_RSP 1 0 1 AWAIT_BUSY5 AWAIT_BUSY
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 AWAIT_BUSY4 BUSY
RR_RSP 0 0 0 AWAIT_BUSY11 AWAIT_BUSY
RR_RSP 0 0 1 AWAIT_BUSY11 AWAIT_BUSY
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 AWAIT_BUSY10 BUSY
RR_RSP 1 0 0 AWAIT_BUSY11 AWAIT_BUSY
RR_RSP 1 0 1 AWAIT_BUSY11 AWAIT_BUSY
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 AWAIT_BUSY10 BUSY
RNR_RSP 0 0 0 AWAIT_BUSY14 AWAIT_BUSY
RNR_RSP 0 0 1 AWAIT_BUSY14 AWAIT_BUSY
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 AWAIT_BUSY13 BUSY
RNR_RSP 1 0 0 AWAIT_BUSY14 AWAIT_BUSY
RNR_RSP 1 0 1 AWAIT_BUSY14 AWAIT_BUSY
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 AWAIT_BUSY13 BUSY
REJ_RSP 0 0 0 AWAIT_BUSY11 AWAIT_BUSY
REJ_RSP 0 0 1 AWAIT_BUSY11 AWAIT_BUSY
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 AWAIT_BUSY10 BUSY
REJ_RSP 1 0 0 AWAIT_BUSY11 AWAIT_BUSY
REJ_RSP 1 0 1 AWAIT_BUSY11 AWAIT_BUSY
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 AWAIT_BUSY10 BUSY
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 1 modified by tredit4 I_RSP 1 1 x AWAIT_BUSY4 BUSY
;112 entries in table, 2 modified by tredit4 I_CMD 1 0 x AWAIT_BUSY5 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 I_RSP 1 0 x AWAIT_BUSY5 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x AWAIT_BUSY6 AWAIT_BUSY
;112 entries in table, 1 modified by tredit4 I_RSP x 1 x AWAIT_BUSY7 BUSY
;112 entries in table, 2 modified by tredit4 I_RSP x 0 x AWAIT_BUSY8 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 I_CMD x 0 x AWAIT_BUSY8 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x AWAIT_BUSY9 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 x AWAIT_BUSY10 BUSY
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 x AWAIT_BUSY10 BUSY
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x AWAIT_BUSY11 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x AWAIT_BUSY11 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 REJ_CMD x 0 x AWAIT_BUSY11 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 REJ_RSP x 0 x AWAIT_BUSY11 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x AWAIT_BUSY12 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x AWAIT_BUSY12 AWAIT_BUSY
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 x AWAIT_BUSY13 BUSY
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x AWAIT_BUSY14 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x AWAIT_BUSY14 AWAIT_BUSY
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x AWAIT_BUSY15 AWAIT_BUSY
;
TABLE AWAIT_REJECT
;Transition table for the AWAIT_REJECT state:
;
;frame type uexpect p bit p_flag
;received N(S) in frame
;
I_CMD 0 0 0 AWAIT_REJECT5 AWAIT
I_CMD 0 0 1 AWAIT_REJECT5 AWAIT
I_CMD 0 1 0 AWAIT_REJECT6 AWAIT
I_CMD 0 1 1 AWAIT_REJECT6 AWAIT
I_CMD 1 0 0 AWAIT_REJECT2 AWAIT_REJECT
I_CMD 1 0 1 AWAIT_REJECT2 AWAIT_REJECT
I_CMD 1 1 0 AWAIT_REJECT3 AWAIT_REJECT
I_CMD 1 1 1 AWAIT_REJECT3 AWAIT_REJECT
RR_CMD 0 0 0 AWAIT_REJECT8 AWAIT_REJECT
RR_CMD 0 0 1 AWAIT_REJECT8 AWAIT_REJECT
RR_CMD 0 1 0 AWAIT_REJECT9 AWAIT_REJECT
RR_CMD 0 1 1 AWAIT_REJECT9 AWAIT_REJECT
RR_CMD 1 0 0 AWAIT_REJECT8 AWAIT_REJECT
RR_CMD 1 0 1 AWAIT_REJECT8 AWAIT_REJECT
RR_CMD 1 1 0 AWAIT_REJECT9 AWAIT_REJECT
RR_CMD 1 1 1 AWAIT_REJECT9 AWAIT_REJECT
RNR_CMD 0 0 0 AWAIT_REJECT11 AWAIT_REJECT
RNR_CMD 0 0 1 AWAIT_REJECT11 AWAIT_REJECT
RNR_CMD 0 1 0 AWAIT_REJECT12 AWAIT_REJECT
RNR_CMD 0 1 1 AWAIT_REJECT12 AWAIT_REJECT
RNR_CMD 1 0 0 AWAIT_REJECT11 AWAIT_REJECT
RNR_CMD 1 0 1 AWAIT_REJECT11 AWAIT_REJECT
RNR_CMD 1 1 0 AWAIT_REJECT12 AWAIT_REJECT
RNR_CMD 1 1 1 AWAIT_REJECT12 AWAIT_REJECT
REJ_CMD 0 0 0 AWAIT_REJECT8 AWAIT_REJECT
REJ_CMD 0 0 1 AWAIT_REJECT8 AWAIT_REJECT
REJ_CMD 0 1 0 AWAIT_REJECT9 AWAIT_REJECT
REJ_CMD 0 1 1 AWAIT_REJECT9 AWAIT_REJECT
REJ_CMD 1 0 0 AWAIT_REJECT8 AWAIT_REJECT
REJ_CMD 1 0 1 AWAIT_REJECT8 AWAIT_REJECT
REJ_CMD 1 1 0 AWAIT_REJECT9 AWAIT_REJECT
REJ_CMD 1 1 1 AWAIT_REJECT9 AWAIT_REJECT
DISC_CMD 0 0 0 SH4 ADM
DISC_CMD 0 0 1 SH4 ADM
DISC_CMD 0 1 0 SH4 ADM
DISC_CMD 0 1 1 SH4 ADM
DISC_CMD 1 0 0 SH4 ADM
DISC_CMD 1 0 1 SH4 ADM
DISC_CMD 1 1 0 SH4 ADM
DISC_CMD 1 1 1 SH4 ADM
SABME_CMD 0 0 0 SH3 RESET_CHECK
SABME_CMD 0 0 1 SH3 RESET_CHECK
SABME_CMD 0 1 0 SH3 RESET_CHECK
SABME_CMD 0 1 1 SH3 RESET_CHECK
SABME_CMD 1 0 0 SH3 RESET_CHECK
SABME_CMD 1 0 1 SH3 RESET_CHECK
SABME_CMD 1 1 0 SH3 RESET_CHECK
SABME_CMD 1 1 1 SH3 RESET_CHECK
I_RSP 0 0 0 AWAIT_REJECT5 AWAIT
I_RSP 0 0 1 AWAIT_REJECT5 AWAIT
I_RSP 0 1 0 SH10 ERROR
I_RSP 0 1 1 AWAIT_REJECT4 NORMAL
I_RSP 1 0 0 AWAIT_REJECT2 AWAIT_REJECT
I_RSP 1 0 1 AWAIT_REJECT2 AWAIT_REJECT
I_RSP 1 1 0 SH10 ERROR
I_RSP 1 1 1 AWAIT_REJECT4 NORMAL
RR_RSP 0 0 0 AWAIT_REJECT8 AWAIT_REJECT
RR_RSP 0 0 1 AWAIT_REJECT8 AWAIT_REJECT
RR_RSP 0 1 0 SH10 ERROR
RR_RSP 0 1 1 AWAIT_REJECT7 REJECT
RR_RSP 1 0 0 AWAIT_REJECT8 AWAIT_REJECT
RR_RSP 1 0 1 AWAIT_REJECT8 AWAIT_REJECT
RR_RSP 1 1 0 SH10 ERROR
RR_RSP 1 1 1 AWAIT_REJECT7 REJECT
RNR_RSP 0 0 0 AWAIT_REJECT11 AWAIT_REJECT
RNR_RSP 0 0 1 AWAIT_REJECT11 AWAIT_REJECT
RNR_RSP 0 1 0 SH10 ERROR
RNR_RSP 0 1 1 AWAIT_REJECT10 REJECT
RNR_RSP 1 0 0 AWAIT_REJECT11 AWAIT_REJECT
RNR_RSP 1 0 1 AWAIT_REJECT11 AWAIT_REJECT
RNR_RSP 1 1 0 SH10 ERROR
RNR_RSP 1 1 1 AWAIT_REJECT10 REJECT
REJ_RSP 0 0 0 AWAIT_REJECT8 AWAIT_REJECT
REJ_RSP 0 0 1 AWAIT_REJECT8 AWAIT_REJECT
REJ_RSP 0 1 0 SH10 ERROR
REJ_RSP 0 1 1 AWAIT_REJECT7 REJECT
REJ_RSP 1 0 0 AWAIT_REJECT8 AWAIT_REJECT
REJ_RSP 1 0 1 AWAIT_REJECT8 AWAIT_REJECT
REJ_RSP 1 1 0 SH10 ERROR
REJ_RSP 1 1 1 AWAIT_REJECT7 REJECT
UA_RSP 0 0 0 SH9 ERROR
UA_RSP 0 0 1 SH9 ERROR
UA_RSP 0 1 0 SH9 ERROR
UA_RSP 0 1 1 SH9 ERROR
UA_RSP 1 0 0 SH9 ERROR
UA_RSP 1 0 1 SH9 ERROR
UA_RSP 1 1 0 SH9 ERROR
UA_RSP 1 1 1 SH9 ERROR
DM_RSP 0 0 0 SH6 ADM
DM_RSP 0 0 1 SH6 ADM
DM_RSP 0 1 0 SH6 ADM
DM_RSP 0 1 1 SH6 ADM
DM_RSP 1 0 0 SH6 ADM
DM_RSP 1 0 1 SH6 ADM
DM_RSP 1 1 0 SH6 ADM
DM_RSP 1 1 1 SH6 ADM
FRMR_RSP 0 0 0 SH5 RESET_WAIT
FRMR_RSP 0 0 1 SH5 RESET_WAIT
FRMR_RSP 0 1 0 SH5 RESET_WAIT
FRMR_RSP 0 1 1 SH5 RESET_WAIT
FRMR_RSP 1 0 0 SH5 RESET_WAIT
FRMR_RSP 1 0 1 SH5 RESET_WAIT
FRMR_RSP 1 1 0 SH5 RESET_WAIT
FRMR_RSP 1 1 1 SH5 RESET_WAIT
BAD_FRAME 0 0 0 SH7 ERROR
BAD_FRAME 0 0 1 SH7 ERROR
BAD_FRAME 0 1 0 SH7 ERROR
BAD_FRAME 0 1 1 SH7 ERROR
BAD_FRAME 1 0 0 SH7 ERROR
BAD_FRAME 1 0 1 SH7 ERROR
BAD_FRAME 1 1 0 SH7 ERROR
BAD_FRAME 1 1 1 SH7 ERROR
;
;112 entries in table, 8 modified by tredit4 SABME_CMD x x x SH3 RESET_CHECK
;112 entries in table, 8 modified by tredit4 DISC_CMD x x x SH4 ADM
;112 entries in table, 8 modified by tredit4 FRMR_RSP x x x SH5 RESET_WAIT
;112 entries in table, 8 modified by tredit4 DM_RSP x x x SH6 ADM
;112 entries in table, 8 modified by tredit4 BAD_FRAME x x x SH7 ERROR
;112 entries in table, 8 modified by tredit4 UA_RSP x x x SH9 ERROR
;112 entries in table, 8 modified by tredit4 anyrsp x 1 0 SH10 ERROR
;112 entries in table, 2 modified by tredit4 I_CMD 1 0 x AWAIT_REJECT2 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 I_RSP 1 0 x AWAIT_REJECT2 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 I_CMD 1 1 x AWAIT_REJECT3 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 I_RSP x 1 x AWAIT_REJECT4 NORMAL
;112 entries in table, 2 modified by tredit4 I_RSP x 0 x AWAIT_REJECT5 AWAIT
;112 entries in table, 2 modified by tredit4 I_CMD x 0 x AWAIT_REJECT5 AWAIT
;112 entries in table, 2 modified by tredit4 I_CMD x 1 x AWAIT_REJECT6 AWAIT
;112 entries in table, 2 modified by tredit4 RR_RSP x 1 x AWAIT_REJECT7 REJECT
;112 entries in table, 2 modified by tredit4 REJ_RSP x 1 x AWAIT_REJECT7 REJECT
;112 entries in table, 0 modified by tredit4 I_RSP 1 1 x AWAIT_REJECT7 REJECT
;112 entries in table, 4 modified by tredit4 RR_CMD x 0 x AWAIT_REJECT8 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 RR_RSP x 0 x AWAIT_REJECT8 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 REJ_CMD x 0 x AWAIT_REJECT8 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 REJ_RSP x 0 x AWAIT_REJECT8 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 RR_CMD x 1 x AWAIT_REJECT9 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 REJ_CMD x 1 x AWAIT_REJECT9 AWAIT_REJECT
;112 entries in table, 2 modified by tredit4 RNR_RSP x 1 x AWAIT_REJECT10 REJECT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 0 x AWAIT_REJECT11 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 RNR_RSP x 0 x AWAIT_REJECT11 AWAIT_REJECT
;112 entries in table, 4 modified by tredit4 RNR_CMD x 1 x AWAIT_REJECT12 AWAIT_REJECT
;112 entries in table, 0 modified by tredit4 RNR_CMD x 1 x AWAIT_REJECT15 AWAIT_BUSY
COMPILE timertr NOINDEX
TABLE XXX
;
;Transition table for expiring timers:
;
;llc state timer retry_c s_flag p_flag action newstate
; expired >= N2
;
ADM ACK_TIMER 0 0 0 NOP ADM
ADM ACK_TIMER 0 0 1 NOP ADM
ADM ACK_TIMER 0 1 0 NOP ADM
ADM ACK_TIMER 0 1 1 NOP ADM
ADM ACK_TIMER 1 0 0 NOP ADM
ADM ACK_TIMER 1 0 1 NOP ADM
ADM ACK_TIMER 1 1 0 NOP ADM
ADM ACK_TIMER 1 1 1 NOP ADM
;;
ADM P_TIMER 0 0 0 NOP ADM
ADM P_TIMER 0 0 1 NOP ADM
ADM P_TIMER 0 1 0 NOP ADM
ADM P_TIMER 0 1 1 NOP ADM
ADM P_TIMER 1 0 0 NOP ADM
ADM P_TIMER 1 0 1 NOP ADM
ADM P_TIMER 1 1 0 NOP ADM
ADM P_TIMER 1 1 1 NOP ADM
;;
ADM REJ_TIMER 0 0 0 NOP ADM
ADM REJ_TIMER 0 0 1 NOP ADM
ADM REJ_TIMER 0 1 0 NOP ADM
ADM REJ_TIMER 0 1 1 NOP ADM
ADM REJ_TIMER 1 0 0 NOP ADM
ADM REJ_TIMER 1 0 1 NOP ADM
ADM REJ_TIMER 1 1 0 NOP ADM
ADM REJ_TIMER 1 1 1 NOP ADM
;;
ADM BUSY_TIMER 0 0 0 NOP ADM
ADM BUSY_TIMER 0 0 1 NOP ADM
ADM BUSY_TIMER 0 1 0 NOP ADM
ADM BUSY_TIMER 0 1 1 NOP ADM
ADM BUSY_TIMER 1 0 0 NOP ADM
ADM BUSY_TIMER 1 0 1 NOP ADM
ADM BUSY_TIMER 1 1 0 NOP ADM
ADM BUSY_TIMER 1 1 1 NOP ADM
;;
;;
CONN ACK_TIMER 0 0 0 NOP CONN
CONN ACK_TIMER 0 0 1 NOP CONN
CONN ACK_TIMER 0 1 0 NOP CONN
CONN ACK_TIMER 0 1 1 NOP CONN
CONN ACK_TIMER 1 0 0 NOP CONN
CONN ACK_TIMER 1 0 1 NOP CONN
CONN ACK_TIMER 1 1 0 NOP CONN
CONN ACK_TIMER 1 1 1 NOP CONN
;;
CONN P_TIMER 0 0 0 NOP CONN
CONN P_TIMER 0 0 1 NOP CONN
CONN P_TIMER 0 1 0 NOP CONN
CONN P_TIMER 0 1 1 NOP CONN
CONN P_TIMER 1 0 0 NOP CONN
CONN P_TIMER 1 0 1 NOP CONN
CONN P_TIMER 1 1 0 NOP CONN
CONN P_TIMER 1 1 1 NOP CONN
;;
CONN REJ_TIMER 0 0 0 NOP CONN
CONN REJ_TIMER 0 0 1 NOP CONN
CONN REJ_TIMER 0 1 0 NOP CONN
CONN REJ_TIMER 0 1 1 NOP CONN
CONN REJ_TIMER 1 0 0 NOP CONN
CONN REJ_TIMER 1 0 1 NOP CONN
CONN REJ_TIMER 1 1 0 NOP CONN
CONN REJ_TIMER 1 1 1 NOP CONN
;;
CONN BUSY_TIMER 0 0 0 NOP CONN
CONN BUSY_TIMER 0 0 1 NOP CONN
CONN BUSY_TIMER 0 1 0 NOP CONN
CONN BUSY_TIMER 0 1 1 NOP CONN
CONN BUSY_TIMER 1 0 0 NOP CONN
CONN BUSY_TIMER 1 0 1 NOP CONN
CONN BUSY_TIMER 1 1 0 NOP CONN
CONN BUSY_TIMER 1 1 1 NOP CONN
;;
;;
RESET_WAIT ACK_TIMER 0 0 0 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 0 0 1 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 0 1 0 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 0 1 1 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 1 0 0 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 1 0 1 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 1 1 0 NOP RESET_WAIT
RESET_WAIT ACK_TIMER 1 1 1 NOP RESET_WAIT
;;
RESET_WAIT P_TIMER 0 0 0 NOP RESET_WAIT
RESET_WAIT P_TIMER 0 0 1 NOP RESET_WAIT
RESET_WAIT P_TIMER 0 1 0 NOP RESET_WAIT
RESET_WAIT P_TIMER 0 1 1 NOP RESET_WAIT
RESET_WAIT P_TIMER 1 0 0 NOP RESET_WAIT
RESET_WAIT P_TIMER 1 0 1 NOP RESET_WAIT
RESET_WAIT P_TIMER 1 1 0 NOP RESET_WAIT
RESET_WAIT P_TIMER 1 1 1 NOP RESET_WAIT
;;
RESET_WAIT REJ_TIMER 0 0 0 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 0 0 1 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 0 1 0 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 0 1 1 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 1 0 0 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 1 0 1 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 1 1 0 NOP RESET_WAIT
RESET_WAIT REJ_TIMER 1 1 1 NOP RESET_WAIT
;;
RESET_WAIT BUSY_TIMER 0 0 0 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 0 0 1 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 0 1 0 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 0 1 1 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 1 0 0 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 1 0 1 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 1 1 0 NOP RESET_WAIT
RESET_WAIT BUSY_TIMER 1 1 1 NOP RESET_WAIT
;;
;;
RESET_CHECK ACK_TIMER 0 0 0 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 0 0 1 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 0 1 0 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 0 1 1 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 1 0 0 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 1 0 1 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 1 1 0 NOP RESET_CHECK
RESET_CHECK ACK_TIMER 1 1 1 NOP RESET_CHECK
;;
RESET_CHECK P_TIMER 0 0 0 NOP RESET_CHECK
RESET_CHECK P_TIMER 0 0 1 NOP RESET_CHECK
RESET_CHECK P_TIMER 0 1 0 NOP RESET_CHECK
RESET_CHECK P_TIMER 0 1 1 NOP RESET_CHECK
RESET_CHECK P_TIMER 1 0 0 NOP RESET_CHECK
RESET_CHECK P_TIMER 1 0 1 NOP RESET_CHECK
RESET_CHECK P_TIMER 1 1 0 NOP RESET_CHECK
RESET_CHECK P_TIMER 1 1 1 NOP RESET_CHECK
;;
RESET_CHECK REJ_TIMER 0 0 0 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 0 0 1 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 0 1 0 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 0 1 1 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 1 0 0 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 1 0 1 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 1 1 0 NOP RESET_CHECK
RESET_CHECK REJ_TIMER 1 1 1 NOP RESET_CHECK
;;
RESET_CHECK BUSY_TIMER 0 0 0 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 0 0 1 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 0 1 0 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 0 1 1 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 1 0 0 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 1 0 1 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 1 1 0 NOP RESET_CHECK
RESET_CHECK BUSY_TIMER 1 1 1 NOP RESET_CHECK
;;
;;
;;
SETUP ACK_TIMER 0 0 0 SETUP7 SETUP
SETUP ACK_TIMER 0 0 1 SETUP7 SETUP
SETUP ACK_TIMER 0 1 0 SETUP3 NORMAL
SETUP ACK_TIMER 0 1 1 SETUP3 NORMAL
SETUP ACK_TIMER 1 0 0 SETUP8 ADM
SETUP ACK_TIMER 1 0 1 SETUP8 ADM
SETUP ACK_TIMER 1 1 0 SETUP3 NORMAL
SETUP ACK_TIMER 1 1 1 SETUP3 NORMAL
;;
SETUP P_TIMER 0 0 0 NOP SETUP
SETUP P_TIMER 0 0 1 NOP SETUP
SETUP P_TIMER 0 1 0 NOP SETUP
SETUP P_TIMER 0 1 1 NOP SETUP
SETUP P_TIMER 1 0 0 NOP SETUP
SETUP P_TIMER 1 0 1 NOP SETUP
SETUP P_TIMER 1 1 0 NOP SETUP
SETUP P_TIMER 1 1 1 NOP SETUP
;;
SETUP REJ_TIMER 0 0 0 NOP SETUP
SETUP REJ_TIMER 0 0 1 NOP SETUP
SETUP REJ_TIMER 0 1 0 NOP SETUP
SETUP REJ_TIMER 0 1 1 NOP SETUP
SETUP REJ_TIMER 1 0 0 NOP SETUP
SETUP REJ_TIMER 1 0 1 NOP SETUP
SETUP REJ_TIMER 1 1 0 NOP SETUP
SETUP REJ_TIMER 1 1 1 NOP SETUP
;;
SETUP BUSY_TIMER 0 0 0 NOP SETUP
SETUP BUSY_TIMER 0 0 1 NOP SETUP
SETUP BUSY_TIMER 0 1 0 NOP SETUP
SETUP BUSY_TIMER 0 1 1 NOP SETUP
SETUP BUSY_TIMER 1 0 0 NOP SETUP
SETUP BUSY_TIMER 1 0 1 NOP SETUP
SETUP BUSY_TIMER 1 1 0 NOP SETUP
SETUP BUSY_TIMER 1 1 1 NOP SETUP
;;
;;
;;
RESET ACK_TIMER 0 0 0 RESET7 RESET
RESET ACK_TIMER 0 0 1 RESET7 RESET
RESET ACK_TIMER 0 1 0 RESET3 NORMAL
RESET ACK_TIMER 0 1 1 RESET3 NORMAL
RESET ACK_TIMER 1 0 0 RESET8 ADM
RESET ACK_TIMER 1 0 1 RESET8 ADM
RESET ACK_TIMER 1 1 0 RESET3 NORMAL
RESET ACK_TIMER 1 1 1 RESET3 NORMAL
;;
RESET P_TIMER 0 0 0 NOP RESET
RESET P_TIMER 0 0 1 NOP RESET
RESET P_TIMER 0 1 0 NOP RESET
RESET P_TIMER 0 1 1 NOP RESET
RESET P_TIMER 1 0 0 NOP RESET
RESET P_TIMER 1 0 1 NOP RESET
RESET P_TIMER 1 1 0 NOP RESET
RESET P_TIMER 1 1 1 NOP RESET
;;
RESET REJ_TIMER 0 0 0 NOP RESET
RESET REJ_TIMER 0 0 1 NOP RESET
RESET REJ_TIMER 0 1 0 NOP RESET
RESET REJ_TIMER 0 1 1 NOP RESET
RESET REJ_TIMER 1 0 0 NOP RESET
RESET REJ_TIMER 1 0 1 NOP RESET
RESET REJ_TIMER 1 1 0 NOP RESET
RESET REJ_TIMER 1 1 1 NOP RESET
;;
RESET BUSY_TIMER 0 0 0 NOP RESET
RESET BUSY_TIMER 0 0 1 NOP RESET
RESET BUSY_TIMER 0 1 0 NOP RESET
RESET BUSY_TIMER 0 1 1 NOP RESET
RESET BUSY_TIMER 1 0 0 NOP RESET
RESET BUSY_TIMER 1 0 1 NOP RESET
RESET BUSY_TIMER 1 1 0 NOP RESET
RESET BUSY_TIMER 1 1 1 NOP RESET
;;
;;
D_CONN ACK_TIMER 0 0 0 D_CONN6 D_CONN
D_CONN ACK_TIMER 0 0 1 D_CONN6 D_CONN
D_CONN ACK_TIMER 0 1 0 D_CONN6 D_CONN
D_CONN ACK_TIMER 0 1 1 D_CONN6 D_CONN
D_CONN ACK_TIMER 1 0 0 D_CONN7 ADM
D_CONN ACK_TIMER 1 0 1 D_CONN7 ADM
D_CONN ACK_TIMER 1 1 0 D_CONN7 ADM
D_CONN ACK_TIMER 1 1 1 D_CONN7 ADM
;;
D_CONN P_TIMER 0 0 0 NOP D_CONN
D_CONN P_TIMER 0 0 1 NOP D_CONN
D_CONN P_TIMER 0 1 0 NOP D_CONN
D_CONN P_TIMER 0 1 1 NOP D_CONN
D_CONN P_TIMER 1 0 0 NOP D_CONN
D_CONN P_TIMER 1 0 1 NOP D_CONN
D_CONN P_TIMER 1 1 0 NOP D_CONN
D_CONN P_TIMER 1 1 1 NOP D_CONN
;;
D_CONN REJ_TIMER 0 0 0 NOP D_CONN
D_CONN REJ_TIMER 0 0 1 NOP D_CONN
D_CONN REJ_TIMER 0 1 0 NOP D_CONN
D_CONN REJ_TIMER 0 1 1 NOP D_CONN
D_CONN REJ_TIMER 1 0 0 NOP D_CONN
D_CONN REJ_TIMER 1 0 1 NOP D_CONN
D_CONN REJ_TIMER 1 1 0 NOP D_CONN
D_CONN REJ_TIMER 1 1 1 NOP D_CONN
;;
D_CONN BUSY_TIMER 0 0 0 NOP D_CONN
D_CONN BUSY_TIMER 0 0 1 NOP D_CONN
D_CONN BUSY_TIMER 0 1 0 NOP D_CONN
D_CONN BUSY_TIMER 0 1 1 NOP D_CONN
D_CONN BUSY_TIMER 1 0 0 NOP D_CONN
D_CONN BUSY_TIMER 1 0 1 NOP D_CONN
D_CONN BUSY_TIMER 1 1 0 NOP D_CONN
D_CONN BUSY_TIMER 1 1 1 NOP D_CONN
;;
;;
ERROR ACK_TIMER 0 0 0 ERR7 ERROR
ERROR ACK_TIMER 0 0 1 ERR7 ERROR
ERROR ACK_TIMER 0 1 0 ERR7 ERROR
ERROR ACK_TIMER 0 1 1 ERR7 ERROR
ERROR ACK_TIMER 1 0 0 ERR8 RESET_WAIT
ERROR ACK_TIMER 1 0 1 ERR8 RESET_WAIT
ERROR ACK_TIMER 1 1 0 ERR8 RESET_WAIT
ERROR ACK_TIMER 1 1 1 ERR8 RESET_WAIT
;;
ERROR P_TIMER 0 0 0 NOP ERROR
ERROR P_TIMER 0 0 1 NOP ERROR
ERROR P_TIMER 0 1 0 NOP ERROR
ERROR P_TIMER 0 1 1 NOP ERROR
ERROR P_TIMER 1 0 0 NOP ERROR
ERROR P_TIMER 1 0 1 NOP ERROR
ERROR P_TIMER 1 1 0 NOP ERROR
ERROR P_TIMER 1 1 1 NOP ERROR
;;
ERROR REJ_TIMER 0 0 0 NOP ERROR
ERROR REJ_TIMER 0 0 1 NOP ERROR
ERROR REJ_TIMER 0 1 0 NOP ERROR
ERROR REJ_TIMER 0 1 1 NOP ERROR
ERROR REJ_TIMER 1 0 0 NOP ERROR
ERROR REJ_TIMER 1 0 1 NOP ERROR
ERROR REJ_TIMER 1 1 0 NOP ERROR
ERROR REJ_TIMER 1 1 1 NOP ERROR
;;
ERROR BUSY_TIMER 0 0 0 NOP ERROR
ERROR BUSY_TIMER 0 0 1 NOP ERROR
ERROR BUSY_TIMER 0 1 0 NOP ERROR
ERROR BUSY_TIMER 0 1 1 NOP ERROR
ERROR BUSY_TIMER 1 0 0 NOP ERROR
ERROR BUSY_TIMER 1 0 1 NOP ERROR
ERROR BUSY_TIMER 1 1 0 NOP ERROR
ERROR BUSY_TIMER 1 1 1 NOP ERROR
;;
;;
NORMAL ACK_TIMER 0 0 0 NORMAL20 AWAIT
NORMAL ACK_TIMER 0 0 1 NOP NORMAL
NORMAL ACK_TIMER 0 1 0 NORMAL20 AWAIT
NORMAL ACK_TIMER 0 1 1 NOP NORMAL
NORMAL ACK_TIMER 1 0 0 SH11 RESET_WAIT
NORMAL ACK_TIMER 1 0 1 SH11 RESET_WAIT
NORMAL ACK_TIMER 1 1 0 SH11 RESET_WAIT
NORMAL ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
NORMAL P_TIMER 0 0 0 NORMAL19 NORMAL
NORMAL P_TIMER 0 0 1 NORMAL19 NORMAL
NORMAL P_TIMER 0 1 0 NORMAL19 NORMAL
NORMAL P_TIMER 0 1 1 NORMAL19 NORMAL
NORMAL P_TIMER 1 0 0 SH11 RESET_WAIT
NORMAL P_TIMER 1 0 1 SH11 RESET_WAIT
NORMAL P_TIMER 1 1 0 SH11 RESET_WAIT
NORMAL P_TIMER 1 1 1 SH11 RESET_WAIT
;;
NORMAL REJ_TIMER 0 0 0 NOP NORMAL
NORMAL REJ_TIMER 0 0 1 NOP NORMAL
NORMAL REJ_TIMER 0 1 0 NOP NORMAL
NORMAL REJ_TIMER 0 1 1 NOP NORMAL
NORMAL REJ_TIMER 1 0 0 SH11 RESET_WAIT
NORMAL REJ_TIMER 1 0 1 SH11 RESET_WAIT
NORMAL REJ_TIMER 1 1 0 SH11 RESET_WAIT
NORMAL REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
NORMAL BUSY_TIMER 0 0 0 NORMAL20 AWAIT
NORMAL BUSY_TIMER 0 0 1 NOP NORMAL
NORMAL BUSY_TIMER 0 1 0 NORMAL20 AWAIT
NORMAL BUSY_TIMER 0 1 1 NOP NORMAL
NORMAL BUSY_TIMER 1 0 0 SH11 RESET_WAIT
NORMAL BUSY_TIMER 1 0 1 SH11 RESET_WAIT
NORMAL BUSY_TIMER 1 1 0 SH11 RESET_WAIT
NORMAL BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
;;
BUSY ACK_TIMER 0 0 0 BUSY24 AWAIT_BUSY
BUSY ACK_TIMER 0 0 1 NOP BUSY
BUSY ACK_TIMER 0 1 0 BUSY24 AWAIT_BUSY
BUSY ACK_TIMER 0 1 1 NOP BUSY
BUSY ACK_TIMER 1 0 0 SH11 RESET_WAIT
BUSY ACK_TIMER 1 0 1 SH11 RESET_WAIT
BUSY ACK_TIMER 1 1 0 SH11 RESET_WAIT
BUSY ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
BUSY P_TIMER 0 0 0 BUSY23 BUSY
BUSY P_TIMER 0 0 1 BUSY23 BUSY
BUSY P_TIMER 0 1 0 BUSY23 BUSY
BUSY P_TIMER 0 1 1 BUSY23 BUSY
BUSY P_TIMER 1 0 0 SH11 RESET_WAIT
BUSY P_TIMER 1 0 1 SH11 RESET_WAIT
BUSY P_TIMER 1 1 0 SH11 RESET_WAIT
BUSY P_TIMER 1 1 1 SH11 RESET_WAIT
;;
BUSY REJ_TIMER 0 0 0 BUSY25 BUSY
BUSY REJ_TIMER 0 0 1 BUSY26 BUSY
BUSY REJ_TIMER 0 1 0 BUSY25 BUSY
BUSY REJ_TIMER 0 1 1 BUSY26 BUSY
BUSY REJ_TIMER 1 0 0 SH11 RESET_WAIT
BUSY REJ_TIMER 1 0 1 SH11 RESET_WAIT
BUSY REJ_TIMER 1 1 0 SH11 RESET_WAIT
BUSY REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
BUSY BUSY_TIMER 0 0 0 NOP BUSY
BUSY BUSY_TIMER 0 0 1 NOP BUSY
BUSY BUSY_TIMER 0 1 0 NOP BUSY
BUSY BUSY_TIMER 0 1 1 NOP BUSY
BUSY BUSY_TIMER 1 0 0 SH11 RESET_WAIT
BUSY BUSY_TIMER 1 0 1 SH11 RESET_WAIT
BUSY BUSY_TIMER 1 1 0 SH11 RESET_WAIT
BUSY BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
;;
REJECT ACK_TIMER 0 0 0 NOP REJECT
REJECT ACK_TIMER 0 0 1 NOP REJECT
REJECT ACK_TIMER 0 1 0 NOP REJECT
REJECT ACK_TIMER 0 1 1 NOP REJECT
REJECT ACK_TIMER 1 0 0 SH11 RESET_WAIT
REJECT ACK_TIMER 1 0 1 SH11 RESET_WAIT
REJECT ACK_TIMER 1 1 0 SH11 RESET_WAIT
REJECT ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
REJECT P_TIMER 0 0 0 NOP REJECT
REJECT P_TIMER 0 0 1 NOP REJECT
REJECT P_TIMER 0 1 0 NOP REJECT
REJECT P_TIMER 0 1 1 NOP REJECT
REJECT P_TIMER 1 0 0 SH11 RESET_WAIT
REJECT P_TIMER 1 0 1 SH11 RESET_WAIT
REJECT P_TIMER 1 1 0 SH11 RESET_WAIT
REJECT P_TIMER 1 1 1 SH11 RESET_WAIT
;;
REJECT REJ_TIMER 0 0 0 NOP REJECT
REJECT REJ_TIMER 0 0 1 NOP REJECT
REJECT REJ_TIMER 0 1 0 NOP REJECT
REJECT REJ_TIMER 0 1 1 NOP REJECT
REJECT REJ_TIMER 1 0 0 SH11 RESET_WAIT
REJECT REJ_TIMER 1 0 1 SH11 RESET_WAIT
REJECT REJ_TIMER 1 1 0 SH11 RESET_WAIT
REJECT REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
REJECT BUSY_TIMER 0 0 0 NOP REJECT
REJECT BUSY_TIMER 0 0 1 NOP REJECT
REJECT BUSY_TIMER 0 1 0 NOP REJECT
REJECT BUSY_TIMER 0 1 1 NOP REJECT
REJECT BUSY_TIMER 1 0 0 SH11 RESET_WAIT
REJECT BUSY_TIMER 1 0 1 SH11 RESET_WAIT
REJECT BUSY_TIMER 1 1 0 SH11 RESET_WAIT
REJECT BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
;;
AWAIT ACK_TIMER 0 0 0 NOP AWAIT
AWAIT ACK_TIMER 0 0 1 NOP AWAIT
AWAIT ACK_TIMER 0 1 0 NOP AWAIT
AWAIT ACK_TIMER 0 1 1 NOP AWAIT
AWAIT ACK_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT ACK_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT ACK_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT P_TIMER 0 0 0 NOP AWAIT
AWAIT P_TIMER 0 0 1 NOP AWAIT
AWAIT P_TIMER 0 1 0 NOP AWAIT
AWAIT P_TIMER 0 1 1 NOP AWAIT
AWAIT P_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT P_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT P_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT P_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT REJ_TIMER 0 0 0 NOP AWAIT
AWAIT REJ_TIMER 0 0 1 NOP AWAIT
AWAIT REJ_TIMER 0 1 0 NOP AWAIT
AWAIT REJ_TIMER 0 1 1 NOP AWAIT
AWAIT REJ_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT REJ_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT REJ_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT BUSY_TIMER 0 0 0 NOP AWAIT
AWAIT BUSY_TIMER 0 0 1 NOP AWAIT
AWAIT BUSY_TIMER 0 1 0 NOP AWAIT
AWAIT BUSY_TIMER 0 1 1 NOP AWAIT
AWAIT BUSY_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT BUSY_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT BUSY_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
;;
AWAIT_BUSY ACK_TIMER 0 0 0 NOP AWAIT_BUSY
AWAIT_BUSY ACK_TIMER 0 0 1 NOP AWAIT_BUSY
AWAIT_BUSY ACK_TIMER 0 1 0 NOP AWAIT_BUSY
AWAIT_BUSY ACK_TIMER 0 1 1 NOP AWAIT_BUSY
AWAIT_BUSY ACK_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_BUSY ACK_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_BUSY ACK_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_BUSY ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_BUSY P_TIMER 0 0 0 NOP AWAIT_BUSY
AWAIT_BUSY P_TIMER 0 0 1 NOP AWAIT_BUSY
AWAIT_BUSY P_TIMER 0 1 0 NOP AWAIT_BUSY
AWAIT_BUSY P_TIMER 0 1 1 NOP AWAIT_BUSY
AWAIT_BUSY P_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_BUSY P_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_BUSY P_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_BUSY P_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_BUSY REJ_TIMER 0 0 0 NOP AWAIT_BUSY
AWAIT_BUSY REJ_TIMER 0 0 1 NOP AWAIT_BUSY
AWAIT_BUSY REJ_TIMER 0 1 0 NOP AWAIT_BUSY
AWAIT_BUSY REJ_TIMER 0 1 1 NOP AWAIT_BUSY
AWAIT_BUSY REJ_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_BUSY REJ_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_BUSY REJ_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_BUSY REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_BUSY BUSY_TIMER 0 0 0 NOP AWAIT_BUSY
AWAIT_BUSY BUSY_TIMER 0 0 1 NOP AWAIT_BUSY
AWAIT_BUSY BUSY_TIMER 0 1 0 NOP AWAIT_BUSY
AWAIT_BUSY BUSY_TIMER 0 1 1 NOP AWAIT_BUSY
AWAIT_BUSY BUSY_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_BUSY BUSY_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_BUSY BUSY_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_BUSY BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
;;
AWAIT_REJECT ACK_TIMER 0 0 0 NOP AWAIT_REJECT
AWAIT_REJECT ACK_TIMER 0 0 1 NOP AWAIT_REJECT
AWAIT_REJECT ACK_TIMER 0 1 0 NOP AWAIT_REJECT
AWAIT_REJECT ACK_TIMER 0 1 1 NOP AWAIT_REJECT
AWAIT_REJECT ACK_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_REJECT ACK_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_REJECT ACK_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_REJECT ACK_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_REJECT P_TIMER 0 0 0 NOP AWAIT_REJECT
AWAIT_REJECT P_TIMER 0 0 1 NOP AWAIT_REJECT
AWAIT_REJECT P_TIMER 0 1 0 NOP AWAIT_REJECT
AWAIT_REJECT P_TIMER 0 1 1 NOP AWAIT_REJECT
AWAIT_REJECT P_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_REJECT P_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_REJECT P_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_REJECT P_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_REJECT REJ_TIMER 0 0 0 NOP AWAIT_REJECT
AWAIT_REJECT REJ_TIMER 0 0 1 NOP AWAIT_REJECT
AWAIT_REJECT REJ_TIMER 0 1 0 NOP AWAIT_REJECT
AWAIT_REJECT REJ_TIMER 0 1 1 NOP AWAIT_REJECT
AWAIT_REJECT REJ_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_REJECT REJ_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_REJECT REJ_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_REJECT REJ_TIMER 1 1 1 SH11 RESET_WAIT
;;
AWAIT_REJECT BUSY_TIMER 0 0 0 NOP AWAIT_REJECT
AWAIT_REJECT BUSY_TIMER 0 0 1 NOP AWAIT_REJECT
AWAIT_REJECT BUSY_TIMER 0 1 0 NOP AWAIT_REJECT
AWAIT_REJECT BUSY_TIMER 0 1 1 NOP AWAIT_REJECT
AWAIT_REJECT BUSY_TIMER 1 0 0 SH11 RESET_WAIT
AWAIT_REJECT BUSY_TIMER 1 0 1 SH11 RESET_WAIT
AWAIT_REJECT BUSY_TIMER 1 1 0 SH11 RESET_WAIT
AWAIT_REJECT BUSY_TIMER 1 1 1 SH11 RESET_WAIT
;;
......@@ -266,8 +266,13 @@ CONFIG_LAPB
module will be called lapb.o. If unsure, say N.
CONFIG_LLC
This is a Logical Link Layer protocol used for X.25 connections over
Ethernet, using ordinary Ethernet cards.
This is a Logical Link Layer protocol used for Appletalk, IPX and in
the future by NetBEUI and by the linux-sna project. It originally
came from Procom Inc. that released the code for 2.0.36 and was
ported to 2.{4,5}. Select this if you want to have support for
those protocols or if you want to have the sockets interface for
LLC.
CONFIG_NET_DIVERT
The Frame Diverter allows you to divert packets from the
......
......@@ -46,12 +46,13 @@ int llc_conn_ac_clear_remote_busy(struct sock *sk, struct llc_conn_state_ev *ev)
if (llc->remote_busy_flag) {
u8 nr;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu =
(struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
llc->remote_busy_flag = 0;
del_timer(&llc->busy_state_timer.timer);
llc->busy_state_timer.running = 0;
nr = LLC_I_GET_NR(rx_pdu);
nr = LLC_I_GET_NR(pdu);
llc_conn_resend_i_pdu_as_cmd(sk, nr, 0);
}
return 0;
......@@ -147,16 +148,17 @@ int llc_conn_ac_disc_ind(struct sock *sk, struct llc_conn_state_ev *ev)
struct llc_prim_if_block *prim = &llc_ind_prim;
if (ev->type == LLC_CONN_EV_TYPE_PDU) {
llc_pdu_un_t *rx_pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu =
(struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_RSP(rx_pdu) &&
!LLC_PDU_TYPE_IS_U(rx_pdu) &&
LLC_U_PDU_RSP(rx_pdu) == LLC_2_PDU_RSP_DM) {
if (!LLC_PDU_IS_RSP(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_DM) {
reason = LLC_DISC_REASON_RX_DM_RSP_PDU;
rc = 0;
} else if (!LLC_PDU_IS_CMD(rx_pdu) &&
!LLC_PDU_TYPE_IS_U(rx_pdu) &&
LLC_U_PDU_CMD(rx_pdu) == LLC_2_PDU_CMD_DISC) {
} else if (!LLC_PDU_IS_CMD(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_DISC) {
reason = LLC_DISC_REASON_RX_DISC_CMD_PDU;
rc = 0;
}
......@@ -200,21 +202,21 @@ int llc_conn_ac_rst_ind(struct sock *sk, struct llc_conn_state_ev *ev)
{
u8 reason = 0;
int rc = 1;
llc_pdu_un_t *rx_pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
union llc_u_prim_data *prim_data = llc_ind_prim.data;
struct llc_prim_if_block *prim = &llc_ind_prim;
struct llc_opt *llc = llc_sk(sk);
switch (ev->type) {
case LLC_CONN_EV_TYPE_PDU:
if (!LLC_PDU_IS_RSP(rx_pdu) &&
!LLC_PDU_TYPE_IS_U(rx_pdu) &&
LLC_U_PDU_RSP(rx_pdu) == LLC_2_PDU_RSP_FRMR) {
if (!LLC_PDU_IS_RSP(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_FRMR) {
reason = LLC_RESET_REASON_LOCAL;
rc = 0;
} else if (!LLC_PDU_IS_CMD(rx_pdu) &&
!LLC_PDU_TYPE_IS_U(rx_pdu) &&
LLC_U_PDU_CMD(rx_pdu) ==
} else if (!LLC_PDU_IS_CMD(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_CMD(pdu) ==
LLC_2_PDU_CMD_SABME) {
reason = LLC_RESET_REASON_REMOTE;
rc = 0;
......@@ -270,11 +272,11 @@ int llc_conn_ac_report_status(struct sock *sk, struct llc_conn_state_ev *ev)
int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_RSP(rx_pdu) &&
!LLC_PDU_TYPE_IS_I(rx_pdu) &&
!LLC_I_PF_IS_1(rx_pdu) && llc_sk(sk)->ack_pf)
if (!LLC_PDU_IS_RSP(pdu) &&
!LLC_PDU_TYPE_IS_I(pdu) &&
!LLC_I_PF_IS_1(pdu) && llc_sk(sk)->ack_pf)
llc_conn_ac_clear_remote_busy(sk, ev);
return 0;
}
......@@ -386,11 +388,11 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk,
u8 f_bit;
int rc = 1;
struct sk_buff *skb, *ev_skb = ev->data.pdu.skb;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev_skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev_skb->nh.raw;
struct llc_opt *llc = llc_sk(sk);
llc->rx_pdu_hdr = (u32)*((u32 *)rx_pdu);
if (!LLC_PDU_IS_CMD(rx_pdu))
llc->rx_pdu_hdr = *((u32 *)pdu);
if (!LLC_PDU_IS_CMD(pdu))
llc_pdu_decode_pf_bit(ev_skb, &f_bit);
else
f_bit = 0;
......@@ -401,7 +403,7 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk,
skb->dev = llc->dev;
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(skb, rx_pdu, f_bit, llc->vS,
llc_pdu_init_as_frmr_rsp(skb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
rc = 0;
......@@ -420,12 +422,12 @@ int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk,
u8 f_bit = 0;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)&llc->rx_pdu_hdr;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)&llc->rx_pdu_hdr;
skb->dev = llc->dev;
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(skb, rx_pdu, f_bit, llc->vS,
llc_pdu_init_as_frmr_rsp(skb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
rc = 0;
......@@ -446,12 +448,13 @@ int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk,
if (skb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu =
(struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
skb->dev = llc->dev;
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(skb, rx_pdu, f_bit, llc->vS,
llc_pdu_init_as_frmr_rsp(skb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
rc = 0;
......@@ -497,9 +500,8 @@ int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk,
int llc_conn_ac_resend_i_cmd_p_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(rx_pdu);
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(pdu);
llc_conn_resend_i_pdu_as_cmd(sk, nr, 1);
return 0;
......@@ -508,9 +510,8 @@ int llc_conn_ac_resend_i_cmd_p_set_1(struct sock *sk,
int llc_conn_ac_resend_i_cmd_p_set_1_or_send_rr(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(rx_pdu);
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(pdu);
int rc = llc_conn_ac_send_rr_cmd_p_set_1(sk, ev);
if (!rc)
......@@ -538,8 +539,8 @@ int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk,
int llc_conn_ac_resend_i_xxx_x_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(rx_pdu);
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(pdu);
llc_conn_resend_i_pdu_as_cmd(sk, nr, 0);
return 0;
......@@ -550,7 +551,7 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
{
u8 nr;
u8 f_bit = 0;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
int rc = 1;
struct sk_buff *skb = llc_alloc_frame();
......@@ -567,7 +568,7 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
llc_conn_send_pdu(sk, skb);
}
if (rc) {
nr = LLC_I_GET_NR(rx_pdu);
nr = LLC_I_GET_NR(pdu);
rc = 0;
llc_conn_resend_i_pdu_as_cmd(sk, nr, f_bit);
}
......@@ -577,8 +578,8 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
int llc_conn_ac_resend_i_rsp_f_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(rx_pdu);
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 nr = LLC_I_GET_NR(pdu);
llc_conn_resend_i_pdu_as_rsp(sk, nr, 1);
return 0;
......@@ -1336,10 +1337,10 @@ int llc_conn_ac_upd_nr_received(struct sock *sk, struct llc_conn_state_ev *ev)
u16 unacked = 0;
u8 fbit;
struct sk_buff *skb = ev->data.pdu.skb;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
struct llc_opt *llc = llc_sk(sk);
llc->last_nr = PDU_SUPV_GET_Nr(rx_pdu);
llc->last_nr = PDU_SUPV_GET_Nr(pdu);
acked = llc_conn_remove_acked_pdus(sk, llc->last_nr, &unacked);
/* On loopback we don't queue I frames in unack_pdu_q queue. */
if (acked > 0 || (llc->dev->flags & IFF_LOOPBACK)) {
......@@ -1375,10 +1376,10 @@ int llc_conn_ac_upd_nr_received(struct sock *sk, struct llc_conn_state_ev *ev)
int llc_conn_ac_upd_p_flag(struct sock *sk, struct llc_conn_state_ev *ev)
{
struct sk_buff *skb = ev->data.pdu.skb;
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
u8 f_bit;
if (!LLC_PDU_IS_RSP(rx_pdu) &&
if (!LLC_PDU_IS_RSP(pdu) &&
!llc_pdu_decode_pf_bit(skb, &f_bit) && f_bit) {
llc_sk(sk)->p_flag = 0;
llc_conn_ac_stop_p_timer(sk, ev);
......@@ -1556,8 +1557,8 @@ int llc_conn_ac_rst_vs(struct sock *sk, struct llc_conn_state_ev *ev)
int llc_conn_ac_upd_vs(struct sock *sk, struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *rx_pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
u8 nr = PDU_SUPV_GET_Nr(rx_pdu);
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 nr = PDU_SUPV_GET_Nr(pdu);
if (llc_circular_between(llc_sk(sk)->vS, nr, llc_sk(sk)->X))
llc_conn_ac_set_vs_nr(sk, ev);
......
......@@ -77,7 +77,7 @@ static u16 llc_util_nr_inside_tx_window(struct sock *sk, u8 nr)
{
u8 nr1, nr2;
struct sk_buff *skb;
llc_pdu_sn_t *pdu;
struct llc_pdu_sn *pdu;
struct llc_opt *llc = llc_sk(sk);
int rc = 0;
......@@ -87,10 +87,10 @@ static u16 llc_util_nr_inside_tx_window(struct sock *sk, u8 nr)
if (!skb_queue_len(&llc->pdu_unack_q))
goto out;
skb = skb_peek(&llc->pdu_unack_q);
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
nr1 = LLC_I_GET_NS(pdu);
skb = skb_peek_tail(&llc->pdu_unack_q);
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
nr2 = LLC_I_GET_NS(pdu);
rc = !llc_circular_between(nr1, nr, (nr2 + 1) % LLC_2_SEQ_NBR_MODULO);
out:
......@@ -155,7 +155,7 @@ int llc_conn_ev_rx_bad_pdu(struct sock *sk, struct llc_conn_state_ev *ev)
int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_DISC ? 0 : 1;
......@@ -164,7 +164,7 @@ int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk,
int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_DM ? 0 : 1;
......@@ -173,7 +173,7 @@ int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk,
int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_FRMR ? 0 : 1;
......@@ -182,7 +182,7 @@ int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk,
int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_I(pdu) &&
!LLC_I_PF_IS_0(pdu) &&
......@@ -192,7 +192,7 @@ int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk,
int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_I(pdu) &&
!LLC_I_PF_IS_1(pdu) &&
......@@ -202,7 +202,7 @@ int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk,
int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
......@@ -214,7 +214,7 @@ int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk,
int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
......@@ -226,7 +226,7 @@ int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk,
int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t * pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn * pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
u16 rc = !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_I(pdu) && ns != vr &&
......@@ -241,7 +241,7 @@ int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_I(pdu) &&
!LLC_I_PF_IS_0(pdu) &&
......@@ -251,7 +251,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_I(pdu) &&
!LLC_I_PF_IS_1(pdu) &&
......@@ -261,7 +261,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_I(pdu) &&
LLC_I_GET_NS(pdu) == llc_sk(sk)->vR ? 0 : 1;
......@@ -270,7 +270,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
......@@ -282,7 +282,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
......@@ -294,7 +294,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
......@@ -305,7 +305,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk,
int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vr = llc_sk(sk)->vR;
u8 ns = LLC_I_GET_NS(pdu);
u16 rc = !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_I(pdu) && ns != vr &&
......@@ -320,7 +320,7 @@ int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk,
int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -330,7 +330,7 @@ int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -340,7 +340,7 @@ int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk,
int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -350,7 +350,7 @@ int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -360,7 +360,7 @@ int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk,
int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
LLC_S_PDU_RSP(pdu) == LLC_2_PDU_RSP_REJ ? 0 : 1;
......@@ -369,7 +369,7 @@ int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk,
int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -379,7 +379,7 @@ int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -389,7 +389,7 @@ int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk,
int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -399,7 +399,7 @@ int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -409,7 +409,7 @@ int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk,
int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -419,7 +419,7 @@ int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -429,7 +429,7 @@ int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk,
int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_0(pdu) &&
......@@ -439,7 +439,7 @@ int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk,
int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_S(pdu) &&
!LLC_S_PF_IS_1(pdu) &&
......@@ -449,7 +449,7 @@ int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk,
int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_CMD(pdu) && !LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_SABME ? 0 : 1;
......@@ -458,7 +458,7 @@ int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk,
int llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return !LLC_PDU_IS_RSP(pdu) && !LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_UA ? 0 : 1;
......@@ -468,7 +468,7 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_CMD(pdu)) {
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu)) {
......@@ -484,7 +484,7 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_0(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_CMD(pdu)) {
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu)) {
......@@ -506,7 +506,7 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_CMD(pdu)) {
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu))
......@@ -526,7 +526,7 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_RSP(pdu)) {
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu)) {
......@@ -549,7 +549,7 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_IS_RSP(pdu)) {
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu))
......@@ -570,7 +570,7 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk,
int llc_conn_ev_rx_xxx_yyy(struct sock *sk, struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
if (!LLC_PDU_TYPE_IS_I(pdu) || !LLC_PDU_TYPE_IS_S(pdu))
rc = 0;
......@@ -591,7 +591,7 @@ int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vs = llc_sk(sk)->vS;
u8 nr = LLC_I_GET_NR(pdu);
......@@ -613,7 +613,7 @@ int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk,
struct llc_conn_state_ev *ev)
{
u16 rc = 1;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
u8 vs = llc_sk(sk)->vS;
u8 nr = LLC_I_GET_NR(pdu);
......
......@@ -2808,20 +2808,20 @@ static struct llc_conn_state_trans *llc_reject_state_transitions[] = {
[36] = &llc_reject_state_trans_8a,
[37] = &llc_reject_state_trans_8b,
[38] = &llc_reject_state_trans_9,
[40] = &llc_reject_state_trans_10a,
[41] = &llc_reject_state_trans_10b,
[42] = &llc_reject_state_trans_10c,
[43] = &llc_reject_state_trans_11,
[44] = &llc_reject_state_trans_12a,
[45] = &llc_reject_state_trans_12b,
[46] = &llc_reject_state_trans_12c,
[47] = &llc_reject_state_trans_13,
[48] = &llc_reject_state_trans_14a,
[49] = &llc_reject_state_trans_14b,
[50] = &llc_reject_state_trans_15a,
[51] = &llc_reject_state_trans_15b,
[52] = &llc_reject_state_trans_16,
[53] = &llc_common_state_trans_n,
[39] = &llc_reject_state_trans_10a,
[40] = &llc_reject_state_trans_10b,
[41] = &llc_reject_state_trans_10c,
[42] = &llc_reject_state_trans_11,
[43] = &llc_reject_state_trans_12a,
[44] = &llc_reject_state_trans_12b,
[45] = &llc_reject_state_trans_12c,
[46] = &llc_reject_state_trans_13,
[47] = &llc_reject_state_trans_14a,
[48] = &llc_reject_state_trans_14b,
[49] = &llc_reject_state_trans_15a,
[50] = &llc_reject_state_trans_15b,
[51] = &llc_reject_state_trans_16,
[52] = &llc_common_state_trans_n,
};
/* LLC_CONN_STATE_AWAIT transitions */
......
......@@ -162,7 +162,7 @@ void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb,
void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit)
{
struct sk_buff *skb;
llc_pdu_sn_t *pdu;
struct llc_pdu_sn *pdu;
u16 nbr_unack_pdus;
u8 howmany_resend = 0;
......@@ -173,7 +173,7 @@ void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit)
* appropriate PDUs, fix them up, and put them on mac_pdu_q.
*/
while ((skb = skb_dequeue(&llc_sk(sk)->pdu_unack_q)) != NULL) {
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
llc_pdu_set_cmd_rsp(skb, LLC_PDU_CMD);
llc_pdu_set_pf_bit(skb, first_p_bit);
skb_queue_tail(&sk->write_queue, skb);
......@@ -201,7 +201,7 @@ out:;
void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit)
{
struct sk_buff *skb;
llc_pdu_sn_t *pdu;
struct llc_pdu_sn *pdu;
u16 nbr_unack_pdus;
u8 howmany_resend = 0;
......@@ -212,7 +212,7 @@ void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit)
* appropriate PDUs, fix them up, and put them on mac_pdu_q
*/
while ((skb = skb_dequeue(&llc_sk(sk)->pdu_unack_q)) != NULL) {
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
llc_pdu_set_cmd_rsp(skb, LLC_PDU_RSP);
llc_pdu_set_pf_bit(skb, first_f_bit);
skb_queue_tail(&sk->write_queue, skb);
......@@ -240,14 +240,14 @@ int llc_conn_remove_acked_pdus(struct sock *sk, u8 nr, u16 *how_many_unacked)
{
int pdu_pos, i;
struct sk_buff *skb;
llc_pdu_sn_t *pdu;
struct llc_pdu_sn *pdu;
int nbr_acked = 0;
int q_len = skb_queue_len(&llc_sk(sk)->pdu_unack_q);
if (!q_len)
goto out;
skb = skb_peek(&llc_sk(sk)->pdu_unack_q);
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
/* finding position of last acked pdu in queue */
pdu_pos = ((int)LLC_2_SEQ_NBR_MODULO + (int)nr -
......@@ -275,7 +275,7 @@ static void llc_conn_send_pdus(struct sock *sk)
struct sk_buff *skb;
while ((skb = skb_dequeue(&sk->write_queue)) != NULL) {
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
if (!LLC_PDU_TYPE_IS_I(pdu) &&
!(skb->dev->flags & IFF_LOOPBACK))
......@@ -297,7 +297,8 @@ void llc_conn_free_ev(struct llc_conn_state_ev *ev)
{
if (ev->type == LLC_CONN_EV_TYPE_PDU) {
/* free the frame that binded to this event */
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_sn *pdu =
(struct llc_pdu_sn *)ev->data.pdu.skb->nh.raw;
if (LLC_PDU_TYPE_IS_I(pdu) || !ev->flag || !ev->ind_prim)
kfree_skb(ev->data.pdu.skb);
......@@ -488,7 +489,6 @@ void __init llc_build_offset_table(void)
struct llc_conn_state *curr_state;
int state, ev_type, next_offset;
memset(llc_offset_table, 0, sizeof(llc_offset_table));
for (state = 0; state < NBR_CONN_STATES; state++) {
curr_state = &llc_conn_state_table[state];
next_offset = 0;
......
......@@ -56,7 +56,7 @@ int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct llc_station *station,
int llc_stat_ev_rx_null_dsap_xid_c(struct llc_station *station,
struct llc_station_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_STATION_EV_TYPE_PDU &&
!LLC_PDU_IS_CMD(pdu) && /* command PDU */
......@@ -68,7 +68,7 @@ int llc_stat_ev_rx_null_dsap_xid_c(struct llc_station *station,
int llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq(struct llc_station *station,
struct llc_station_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_STATION_EV_TYPE_PDU &&
!LLC_PDU_IS_RSP(pdu) && /* response PDU */
......@@ -81,7 +81,7 @@ int llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq(struct llc_station *station,
int llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq(struct llc_station *station,
struct llc_station_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_STATION_EV_TYPE_PDU &&
!LLC_PDU_IS_RSP(pdu) && /* response PDU */
......@@ -94,7 +94,7 @@ int llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq(struct llc_station *station,
int llc_stat_ev_rx_null_dsap_test_c(struct llc_station *station,
struct llc_station_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_STATION_EV_TYPE_PDU &&
!LLC_PDU_IS_CMD(pdu) && /* command PDU */
......
......@@ -77,8 +77,8 @@ static llc_prim_call_t llc_resp_prim[LLC_NBR_PRIMITIVES] = {
* @sap: pointer to allocated SAP (output argument).
*
* Interface function to upper layer. each one who wants to get a SAP
* (for example NetBEUI) should call this function. Returns 0 for
* success, 1 for failure.
* (for example NetBEUI) should call this function. Returns the opened
* SAP for success, NULL for failure.
*/
struct llc_sap *llc_sap_open(llc_prim_call_t nw_indicate,
llc_prim_call_t nw_confirm, u8 lsap)
......
......@@ -25,10 +25,8 @@
#include <net/llc_evnt.h>
#include <net/llc_c_ev.h>
#include <net/llc_s_ev.h>
#ifdef CONFIG_TR
extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh,
struct net_device *dev);
#endif
#include <linux/trdevice.h>
/* function prototypes */
static void fix_up_incoming_skb(struct sk_buff *skb);
......@@ -78,7 +76,7 @@ int mac_indicate(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
struct llc_sap *sap;
llc_pdu_sn_t *pdu;
struct llc_pdu_sn *pdu;
u8 dest;
/* When the interface is in promisc. mode, drop all the crap that it
......@@ -92,7 +90,7 @@ int mac_indicate(struct sk_buff *skb, struct net_device *dev,
if (!skb)
goto out;
fix_up_incoming_skb(skb);
pdu = (llc_pdu_sn_t *)skb->nh.raw;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
if (!pdu->dsap) { /* NULL DSAP, refer to station */
llc_pdu_router(NULL, NULL, skb, 0);
goto out;
......@@ -165,11 +163,12 @@ int mac_indicate(struct sk_buff *skb, struct net_device *dev,
static void fix_up_incoming_skb(struct sk_buff *skb)
{
u8 llc_len = 2;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->data;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->data;
if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
llc_len = 1;
llc_len += 2;
skb->h.raw += llc_len;
skb_pull(skb, llc_len);
if (skb->protocol == htons(ETH_P_802_2)) {
u16 pdulen = ((struct ethhdr *)skb->mac.raw)->h_proto,
......@@ -197,7 +196,7 @@ static void fix_up_incoming_skb(struct sk_buff *skb)
int llc_pdu_router(struct llc_sap *sap, struct sock* sk,
struct sk_buff *skb, u8 type)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
int rc = 0;
if (!pdu->dsap) {
......@@ -246,17 +245,15 @@ int llc_pdu_router(struct llc_sap *sap, struct sock* sk,
*/
u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da)
{
u8 *saddr;
u8 *daddr;
u16 rc = 0;
switch (skb->dev->type) {
#ifdef CONFIG_TR
case ARPHRD_IEEE802_TR: {
struct trh_hdr *trh = (struct trh_hdr *)
skb_push(skb, sizeof(*trh));
struct trh_hdr *trh;
struct net_device *dev = skb->dev;
trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh));
trh->ac = AC;
trh->fc = LLC_FRAME;
if (sa)
......@@ -274,14 +271,13 @@ u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da)
case ARPHRD_ETHER:
case ARPHRD_LOOPBACK: {
unsigned short len = skb->len;
struct ethhdr *eth;
skb->mac.raw = skb_push(skb, sizeof(struct ethhdr));
memset(skb->mac.raw, 0, sizeof(struct ethhdr));
((struct ethhdr *)skb->mac.raw)->h_proto = htons(len);
daddr = ((struct ethhdr *)skb->mac.raw)->h_dest;
saddr = ((struct ethhdr *)skb->mac.raw)->h_source;
memcpy(daddr, da, ETH_ALEN);
memcpy(saddr, sa, ETH_ALEN);
skb->mac.raw = skb_push(skb, sizeof(*eth));
eth = (struct ethhdr *)skb->mac.raw;
eth->h_proto = htons(len);
memcpy(eth->h_dest, da, ETH_ALEN);
memcpy(eth->h_source, sa, ETH_ALEN);
break;
}
default:
......
......@@ -600,23 +600,23 @@ static int __init llc_init(void)
ev = kmalloc(sizeof(*ev), GFP_ATOMIC);
if (!ev)
goto err;
llc_build_offset_table();
memset(ev, 0, sizeof(*ev));
if(dev_base->next)
memcpy(llc_main_station.mac_sa, dev_base->next->dev_addr, ETH_ALEN);
else
memset(llc_main_station.mac_sa, 0, ETH_ALEN);
llc_main_station.ack_timer.expires = jiffies + 3 * HZ;
/* initialize the station component */
llc_register_sap(0, mac_indicate);
llc_main_station.maximum_retry = 1;
llc_main_station.state = LLC_STATION_STATE_DOWN;
ev->type = LLC_STATION_EV_TYPE_SIMPLE;
ev->data.a.ev = LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK;
rc = llc_station_next_state(&llc_main_station, ev);
llc_build_offset_table();
llc_ind_prim.data = &llc_ind_data_prim;
llc_cfm_prim.data = &llc_cfm_data_prim;
proc_net_create("802.2", 0, llc_proc_get_info);
/* initialize the station component */
llc_register_sap(0, mac_indicate);
llc_ui_init();
out:
return rc;
......
......@@ -20,7 +20,7 @@
static int llc_pdu_decode_pdu_type(struct sk_buff *skb, u8 *type);
static int llc_get_llc_hdr_length(u8 pdu_type);
static u8 llc_pdu_get_pf_bit(llc_pdu_sn_t *pdu);
static u8 llc_pdu_get_pf_bit(struct llc_pdu_sn *pdu);
/**
* llc_pdu_header_init - initializes pdu header
......@@ -35,18 +35,18 @@ static u8 llc_pdu_get_pf_bit(llc_pdu_sn_t *pdu);
void llc_pdu_header_init(struct sk_buff *skb, u8 pdu_type, u8 ssap,
u8 dsap, u8 cr)
{
llc_pdu_un_t *p;
struct llc_pdu_un *pdu;
skb->nh.raw = skb_push(skb, llc_get_llc_hdr_length(pdu_type));
p = (llc_pdu_un_t *)skb->nh.raw;
p->dsap = dsap;
p->ssap = ssap;
p->ssap |= cr;
pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->dsap = dsap;
pdu->ssap = ssap;
pdu->ssap |= cr;
}
void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 pdu_type)
{
((llc_pdu_un_t *)skb->nh.raw)->ssap |= pdu_type;
((struct llc_pdu_un *)skb->nh.raw)->ssap |= pdu_type;
}
/**
......@@ -61,20 +61,20 @@ void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 pdu_type)
void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value)
{
u8 pdu_type;
struct llc_pdu_sn *pdu;
if (llc_pdu_decode_pdu_type(skb, &pdu_type))
goto out;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
switch (pdu_type) {
case LLC_PDU_TYPE_I:
case LLC_PDU_TYPE_S:
((llc_pdu_sn_t *)skb->nh.raw)->ctrl_2 =
(((llc_pdu_sn_t *)skb->nh.raw)->ctrl_2 & 0xFE) |
bit_value;
pdu->ctrl_2 = (pdu->ctrl_2 & 0xFE) | bit_value;
break;
case LLC_PDU_TYPE_U:
((llc_pdu_un_t *)skb->nh.raw)->ctrl_1 |=
(((llc_pdu_un_t *)skb->nh.raw)->ctrl_1 & 0xEF) |
(bit_value << 4);
pdu->ctrl_1 |= (pdu->ctrl_1 & 0xEF) | (bit_value << 4);
break;
}
out:;
......@@ -92,19 +92,21 @@ out:;
int llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit)
{
u8 pdu_type;
struct llc_pdu_sn *pdu;
int rc = llc_pdu_decode_pdu_type(skb, &pdu_type);
if (rc)
goto out;
pdu = (struct llc_pdu_sn *)skb->nh.raw;
switch (pdu_type) {
case LLC_PDU_TYPE_I:
case LLC_PDU_TYPE_S:
*pf_bit = ((llc_pdu_sn_t *)skb->nh.raw)->ctrl_2 &
LLC_S_PF_BIT_MASK;
*pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK;
break;
case LLC_PDU_TYPE_U:
*pf_bit = (((llc_pdu_un_t *)skb->nh.raw)->ctrl_1 &
LLC_U_PF_BIT_MASK) >> 4;
*pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4;
break;
}
out:
......@@ -121,7 +123,8 @@ int llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit)
*/
int llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit)
{
*cr_bit = ((llc_pdu_un_t *)skb->nh.raw)->ssap & LLC_PDU_CMD_RSP_MASK;
*cr_bit = ((struct llc_pdu_un *)skb->nh.raw)->ssap &
LLC_PDU_CMD_RSP_MASK;
return 0;
}
......@@ -167,7 +170,7 @@ int llc_pdu_decode_da(struct sk_buff *skb, u8 *da)
*/
int llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap)
{
*dsap = ((llc_pdu_un_t *)skb->nh.raw)->dsap & 0xFE;
*dsap = ((struct llc_pdu_un *)skb->nh.raw)->dsap & 0xFE;
return 0;
}
......@@ -181,7 +184,7 @@ int llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap)
*/
int llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap)
{
*ssap = ((llc_pdu_un_t *)skb->nh.raw)->ssap & 0xFE;
*ssap = ((struct llc_pdu_un *)skb->nh.raw)->ssap & 0xFE;
return 0;
}
......@@ -193,7 +196,7 @@ int llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap)
*/
int llc_pdu_init_as_ui_cmd(struct sk_buff *skb)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_1_PDU_CMD_UI;
......@@ -210,13 +213,13 @@ int llc_pdu_init_as_ui_cmd(struct sk_buff *skb)
int llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported,
u8 rx_window)
{
llc_xid_info_t *xid_info;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_xid_info *xid_info;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
xid_info = (llc_xid_info_t *)(((u8 *)&pdu->ctrl_1) + 1);
xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */
xid_info->type = svcs_supported;
xid_info->rw = rx_window << 1; /* size of recieve window */
......@@ -232,7 +235,7 @@ int llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported,
*/
int llc_pdu_init_as_test_cmd(struct sk_buff *skb)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
......@@ -249,7 +252,7 @@ int llc_pdu_init_as_test_cmd(struct sk_buff *skb)
*/
int llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_2_PDU_CMD_DISC;
......@@ -268,7 +271,7 @@ int llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit)
*/
int llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_I;
pdu->ctrl_2 = 0;
......@@ -288,7 +291,7 @@ int llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr)
*/
int llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_CMD_REJ;
......@@ -309,7 +312,7 @@ int llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
*/
int llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_CMD_RNR;
......@@ -330,7 +333,7 @@ int llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
*/
int llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_CMD_RR;
......@@ -349,7 +352,7 @@ int llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr)
*/
int llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_2_PDU_CMD_SABME;
......@@ -366,7 +369,7 @@ int llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit)
*/
int llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_2_PDU_RSP_DM;
......@@ -385,14 +388,14 @@ int llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit)
int llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
u8 rx_window)
{
llc_xid_info_t *xid_info;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_xid_info *xid_info;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
xid_info = (llc_xid_info_t *)(((u8 *)&pdu->ctrl_1) + 1);
xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
xid_info->fmt_id = LLC_XID_FMT_ID;
xid_info->type = svcs_supported;
xid_info->rw = rx_window << 1;
......@@ -410,7 +413,7 @@ int llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
int llc_pdu_init_as_test_rsp(struct sk_buff *skb, struct sk_buff *ev_skb)
{
int dsize;
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
......@@ -435,19 +438,19 @@ int llc_pdu_init_as_test_rsp(struct sk_buff *skb, struct sk_buff *ev_skb)
*
* Builds a pdu frame as a FRMR response.
*/
int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, llc_pdu_sn_t *prev_pdu,
int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, struct llc_pdu_sn *prev_pdu,
u8 f_bit, u8 vs, u8 vr, u8 vzyxw)
{
llc_frmr_info_t *frmr_info;
struct llc_frmr_info *frmr_info;
u8 prev_pf = 0;
u8 *ctrl;
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_2_PDU_RSP_FRMR;
pdu->ctrl_1 |= ((f_bit & 1) << 4) & LLC_U_PF_BIT_MASK;
frmr_info = (llc_frmr_info_t *)&pdu->ctrl_2;
frmr_info = (struct llc_frmr_info *)&pdu->ctrl_2;
ctrl = (u8 *)&prev_pdu->ctrl_1;
FRMR_INFO_SET_REJ_CNTRL(frmr_info,ctrl);
FRMR_INFO_SET_Vs(frmr_info, vs);
......@@ -473,7 +476,7 @@ int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, llc_pdu_sn_t *prev_pdu,
*/
int llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_RSP_RR;
......@@ -494,7 +497,7 @@ int llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
*/
int llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_RSP_REJ;
......@@ -515,7 +518,7 @@ int llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
*/
int llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
{
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_S;
pdu->ctrl_1 |= LLC_2_PDU_RSP_RNR;
......@@ -535,7 +538,7 @@ int llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr)
*/
int llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
pdu->ctrl_1 = LLC_PDU_TYPE_U;
pdu->ctrl_1 |= LLC_2_PDU_RSP_UA;
......@@ -552,7 +555,7 @@ int llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit)
*/
static int llc_pdu_decode_pdu_type(struct sk_buff *skb, u8 *type)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)skb->nh.raw;
if (pdu->ctrl_1 & 1) {
if ((pdu->ctrl_1 & LLC_PDU_TYPE_U) == LLC_PDU_TYPE_U)
......@@ -574,7 +577,7 @@ static int llc_pdu_decode_pdu_type(struct sk_buff *skb, u8 *type)
int llc_decode_pdu_type(struct sk_buff *skb, u8 *dest)
{
u8 type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
llc_pdu_sn_t *pdu = (llc_pdu_sn_t *)skb->nh.raw;
struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)skb->nh.raw;
if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
goto out;
......@@ -629,7 +632,7 @@ static int llc_get_llc_hdr_length(u8 pdu_type)
* This function extracts p/f bit of input PDU. at first examines type of
* PDU and then extracts p/f bit. Returns the p/f bit.
*/
static u8 llc_pdu_get_pf_bit(llc_pdu_sn_t *pdu)
static u8 llc_pdu_get_pf_bit(struct llc_pdu_sn *pdu)
{
u8 pdu_type;
u8 pf_bit = 0;
......
......@@ -28,7 +28,7 @@ int llc_sap_ev_activation_req(struct llc_sap *sap, struct llc_sap_state_ev *ev)
int llc_sap_ev_rx_ui(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_SAP_EV_TYPE_PDU && !LLC_PDU_IS_CMD(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
......@@ -52,7 +52,7 @@ int llc_sap_ev_xid_req(struct llc_sap *sap, struct llc_sap_state_ev *ev)
int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_SAP_EV_TYPE_PDU && !LLC_PDU_IS_CMD(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
......@@ -61,7 +61,7 @@ int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct llc_sap_state_ev *ev)
int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_SAP_EV_TYPE_PDU && !LLC_PDU_IS_RSP(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
......@@ -77,7 +77,7 @@ int llc_sap_ev_test_req(struct llc_sap *sap, struct llc_sap_state_ev *ev)
int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_SAP_EV_TYPE_PDU && !LLC_PDU_IS_CMD(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
......@@ -86,7 +86,7 @@ int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct llc_sap_state_ev *ev)
int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu = (struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
return ev->type == LLC_SAP_EV_TYPE_PDU && !LLC_PDU_IS_RSP(pdu) &&
!LLC_PDU_TYPE_IS_U(pdu) &&
......
......@@ -111,7 +111,7 @@ void llc_sap_send_ev(struct llc_sap *sap, struct llc_sap_state_ev *ev)
void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb,
struct llc_sap_state_ev *ev)
{
llc_pdu_un_t *pdu;
struct llc_pdu_un *pdu;
struct llc_prim_if_block *prim = &llc_ind_prim;
union llc_u_prim_data *prim_data = llc_ind_prim.data;
u8 lfb;
......@@ -122,7 +122,7 @@ void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb,
llc_pdu_decode_ssap(skb, &prim_data->udata.saddr.lsap);
prim_data->udata.pri = 0;
prim_data->udata.skb = skb;
pdu = (llc_pdu_un_t *)skb->nh.raw;
pdu = (struct llc_pdu_un *)skb->nh.raw;
switch (LLC_U_PDU_RSP(pdu)) {
case LLC_1_PDU_CMD_TEST:
prim->prim = LLC_TEST_PRIM;
......@@ -170,7 +170,8 @@ void llc_sap_send_pdu(struct llc_sap *sap, struct sk_buff *skb)
static void llc_sap_free_ev(struct llc_sap *sap, struct llc_sap_state_ev *ev)
{
if (ev->type == LLC_SAP_EV_TYPE_PDU) {
llc_pdu_un_t *pdu = (llc_pdu_un_t *)ev->data.pdu.skb->nh.raw;
struct llc_pdu_un *pdu =
(struct llc_pdu_un *)ev->data.pdu.skb->nh.raw;
if (LLC_U_PDU_CMD(pdu) != LLC_1_PDU_CMD_UI)
kfree_skb(ev->data.pdu.skb);
......
......@@ -17,37 +17,61 @@
#include <linux/sysctl.h>
#ifdef CONFIG_INET
extern ctl_table ipv4_table[];
extern struct ctl_table ipv4_table[];
#endif
extern ctl_table core_table[];
extern struct ctl_table core_table[];
#ifdef CONFIG_NET
extern ctl_table ether_table[], e802_table[];
extern struct ctl_table ether_table[];
#endif
#ifdef CONFIG_IPV6
extern ctl_table ipv6_table[];
extern struct ctl_table ipv6_table[];
#endif
#ifdef CONFIG_TR
extern ctl_table tr_table[];
extern struct ctl_table tr_table[];
#endif
ctl_table net_table[] = {
{NET_CORE, "core", NULL, 0, 0555, core_table},
struct ctl_table net_table[] = {
{
.ctl_name = NET_CORE,
.procname = "core",
.mode = 0555,
.child = core_table,
},
#ifdef CONFIG_NET
{NET_802, "802", NULL, 0, 0555, e802_table},
{NET_ETHER, "ethernet", NULL, 0, 0555, ether_table},
{
.ctl_name = NET_ETHER,
.procname = "ethernet",
.mode = 0555,
.child = ether_table,
},
#endif
#ifdef CONFIG_INET
{NET_IPV4, "ipv4", NULL, 0, 0555, ipv4_table},
{
.ctl_name = NET_IPV4,
.procname = "ipv4",
.mode = 0555,
.child = ipv4_table
},
#endif
#ifdef CONFIG_IPV6
{NET_IPV6, "ipv6", NULL, 0, 0555, ipv6_table},
{
.ctl_name = NET_IPV6,
.procname = "ipv6",
.mode = 0555,
.child = ipv6_table,
},
#endif
#ifdef CONFIG_TR
{NET_TR, "token-ring", NULL, 0, 0555, tr_table},
{
.ctl_name = NET_TR,
.procname = "token-ring",
.mode = 0555,
.child = tr_table,
},
#endif
{0}
{ 0 },
};
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