diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /net/802 | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'net/802')
30 files changed, 6168 insertions, 634 deletions
diff --git a/net/802/Makefile b/net/802/Makefile index cb8d33a61..a8d25f77e 100644 --- a/net/802/Makefile +++ b/net/802/Makefile @@ -8,7 +8,17 @@ # Note 2! The CFLAGS definition is now in the main makefile... O_TARGET := 802.o -O_OBJS = p8023.o sysctl_net_802.o +O_OBJS = p8023.o + +ifeq ($(CONFIG_SYSCTL),y) +O_OBJS += sysctl_net_802.o +endif + +ifeq ($(CONFIG_LLC),y) +SUB_DIRS += transit +O_OBJS += llc_sendpdu.o llc_utility.o cl2llc.o +OX_OBJS += llc_macinit.o +endif ifdef CONFIG_TR O_OBJS += tr.o @@ -30,5 +40,8 @@ endif include $(TOPDIR)/Rules.make +cl2llc.c: cl2llc.pre + sed -f ./pseudo/opcd2num.sed cl2llc.pre >cl2llc.c + tar: tar -cvf /dev/f1 . diff --git a/net/802/TODO b/net/802/TODO new file mode 100644 index 000000000..639b10caf --- /dev/null +++ b/net/802/TODO @@ -0,0 +1,29 @@ +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 incomming 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. diff --git a/net/802/cl2llc.c b/net/802/cl2llc.c new file mode 100644 index 000000000..5e1d12837 --- /dev/null +++ b/net/802/cl2llc.c @@ -0,0 +1,615 @@ +/* + * 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/malloc.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 incomming 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 9: + if ((type != I_CMD) || (fr->i_hdr.i_pflag =0)) + break; + case 1: + 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 2: + lp->state = NORMAL; /* needed to eliminate connect_response() */ + lp->llc_mode = MODE_ABM; + lp->llc_callbacks|=LLC_CONN_INDICATION; + break; + case 3: + lp->llc_mode = MODE_ABM; + lp->llc_callbacks|=LLC_CONN_CONFIRM; + break; + case 4: + skb_pull(skb, 4); + lp->inc_skb=skb; + lp->llc_callbacks|=LLC_DATA_INDIC; + break; + case 5: + lp->llc_mode = MODE_ADM; + lp->llc_callbacks|=LLC_DISC_INDICATION; + break; + case 70: + lp->llc_callbacks|=LLC_RESET_INDIC_LOC; + break; + case 71: + lp->llc_callbacks|=LLC_RESET_INDIC_REM; + break; + case 7: + lp->llc_callbacks|=LLC_RST_CONFIRM; + break; + case 66: + lp->llc_callbacks|=LLC_FRMR_RECV; + break; + case 67: + lp->llc_callbacks|=LLC_FRMR_SENT; + break; + case 68: + lp->llc_callbacks|=LLC_REMOTE_BUSY; + break; + case 69: + lp->llc_callbacks|=LLC_REMOTE_NOTBUSY; + break; + case 11: + llc_sendpdu(lp, DISC_CMD, lp->f_flag, 0, NULL); + break; + case 12: + llc_sendpdu(lp, DM_RSP, 0, 0, NULL); + break; + case 13: + 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 14: + llc_sendpdu(lp, FRMR_RSP, 0, 5, (char *) &lp->frmr_info_fld); + break; + case 15: + llc_sendpdu(lp, FRMR_RSP, lp->p_flag, + 5, (char *) &lp->frmr_info_fld); + break; + case 16: + llc_sendipdu(lp, I_CMD, 1, skb); + break; + case 17: + resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 1); + break; + case 18: + 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 19: + llc_sendipdu(lp, I_CMD, 0, skb); + break; + case 20: + resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_CMD, 0); + break; + case 21: + 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 22: + resend_count = llc_resend_ipdu(lp, fr->i_hdr.nr, I_RSP, 1); + break; + case 23: + llc_sendpdu(lp, REJ_CMD, 1, 0, NULL); + break; + case 24: + llc_sendpdu(lp, REJ_RSP, 1, 0, NULL); + break; + case 25: + if (IS_RSP(fr)) + llc_sendpdu(lp, REJ_CMD, 0, 0, NULL); + else + llc_sendpdu(lp, REJ_RSP, 0, 0, NULL); + break; + case 26: + llc_sendpdu(lp, RNR_CMD, 1, 0, NULL); + break; + case 27: + llc_sendpdu(lp, RNR_RSP, 1, 0, NULL); + break; + case 28: + if (IS_RSP(fr)) + llc_sendpdu(lp, RNR_CMD, 0, 0, NULL); + else + llc_sendpdu(lp, RNR_RSP, 0, 0, NULL); + break; + case 29: + 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 30: + if (IS_RSP(fr)) + llc_sendpdu(lp, RNR_CMD, 0, 0, NULL); + else + llc_sendpdu(lp, RNR_RSP, 0, 0, NULL); + break; + case 31: + llc_sendpdu(lp, RR_CMD, 1, 0, NULL); + break; + case 32: + llc_sendpdu(lp, RR_CMD, 1, 0, NULL); + break; + case 33: + llc_sendpdu(lp, RR_RSP, 1, 0, NULL); + break; + case 34: + llc_sendpdu(lp, RR_RSP, 1, 0, NULL); + break; + case 35: + llc_sendpdu(lp, RR_RSP, 0, 0, NULL); + break; + case 36: + if (IS_RSP(fr)) + llc_sendpdu(lp, RR_CMD, 0, 0, NULL); + else + llc_sendpdu(lp, RR_RSP, 0, 0, NULL); + break; + case 37: + llc_sendpdu(lp, SABME_CMD, 0, 0, NULL); + lp->f_flag = 0; + break; + case 38: + llc_sendpdu(lp, UA_RSP, lp->f_flag, 0, NULL); + break; + case 39: + lp->s_flag = 0; + break; + case 40: + lp->s_flag = 1; + break; + case 41: + 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 44: + if (lp->timer_state[ACK_TIMER] == TIMER_IDLE) + llc_start_timer(lp, ACK_TIMER); + break; + case 42: + llc_start_timer(lp, ACK_TIMER); + break; + case 43: + llc_start_timer(lp, REJ_TIMER); + break; + case 45: + llc_stop_timer(lp, ACK_TIMER); + break; + case 46: + llc_stop_timer(lp, ACK_TIMER); + lp->p_flag = 0; + break; + case 10: + if (lp->data_flag == 2) + llc_stop_timer(lp, REJ_TIMER); + break; + case 47: + llc_stop_timer(lp, REJ_TIMER); + break; + case 48: + 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 49: + llc_stop_timer(lp, P_TIMER); + llc_stop_timer(lp, REJ_TIMER); + llc_stop_timer(lp, BUSY_TIMER); + break; + case 50: + 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 51: + 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 52: + lp->data_flag = 2; + break; + case 53: + lp->data_flag = 0; + break; + case 54: + lp->data_flag = 1; + break; + case 55: + if (lp->data_flag == 0) + lp->data_flag = 1; + break; + case 56: + lp->p_flag = 0; + break; + case 57: + lp->p_flag = lp->f_flag; + break; + case 58: + lp->remote_busy = 0; + break; + case 59: + lp->retry_count = 0; + break; + case 60: + lp->retry_count++; + break; + case 61: + lp->vr = 0; + break; + case 62: + lp->vr++; + break; + case 63: + lp->vs = 0; + break; + case 64: + lp->vs = fr->i_hdr.nr; + break; + case 65: + 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 != 0) + { + 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 != 0) + { + 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 + */ +} + diff --git a/net/802/cl2llc.pre b/net/802/cl2llc.pre new file mode 100644 index 000000000..8e10cf32a --- /dev/null +++ b/net/802/cl2llc.pre @@ -0,0 +1,615 @@ +/* + * 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/malloc.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 incomming 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 + */ +} + diff --git a/net/802/fddi.c b/net/802/fddi.c index 24fcff127..c57a967d1 100644 --- a/net/802/fddi.c +++ b/net/802/fddi.c @@ -20,7 +20,11 @@ * 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 : New arp/rebuild header */ + #include <asm/segment.h> #include <asm/system.h> #include <linux/types.h> @@ -33,6 +37,7 @@ #include <linux/inet.h> #include <linux/netdevice.h> #include <linux/fddidevice.h> +#include <linux/if_ether.h> #include <linux/skbuff.h> #include <linux/errno.h> #include <net/arp.h> @@ -45,28 +50,26 @@ * daddr=NULL means leave destination address (eg unresolved arp) */ -int fddi_header( - struct sk_buff *skb, - struct device *dev, - unsigned short type, - void *daddr, - void *saddr, - unsigned len - ) - +int fddi_header(struct sk_buff *skb, struct device *dev, unsigned short type, + void *daddr, void *saddr, unsigned len) +{ + int hl = FDDI_K_SNAP_HLEN; + struct fddihdr *fddi; + + if(type!=htons(ETH_P_IP)) + hl=FDDI_K_8022_HLEN-3; + fddi = (struct fddihdr *)skb_push(skb, hl); + fddi->fc = FDDI_FC_K_ASYNC_LLC_DEF; + if(type==htons(ETH_P_IP)) { - struct fddihdr *fddi = (struct fddihdr *)skb_push(skb, FDDI_K_SNAP_HLEN); - - /* Fill in frame header - assume 802.2 SNAP frames for now */ - - fddi->fc = FDDI_FC_K_ASYNC_LLC_DEF; - fddi->hdr.llc_snap.dsap = FDDI_EXTENDED_SAP; - fddi->hdr.llc_snap.ssap = FDDI_EXTENDED_SAP; - fddi->hdr.llc_snap.ctrl = FDDI_UI_CMD; - fddi->hdr.llc_snap.oui[0] = 0x00; - fddi->hdr.llc_snap.oui[1] = 0x00; - fddi->hdr.llc_snap.oui[2] = 0x00; - fddi->hdr.llc_snap.ethertype = htons(type); + fddi->hdr.llc_snap.dsap = FDDI_EXTENDED_SAP; + fddi->hdr.llc_snap.ssap = FDDI_EXTENDED_SAP; + fddi->hdr.llc_snap.ctrl = FDDI_UI_CMD; + fddi->hdr.llc_snap.oui[0] = 0x00; + fddi->hdr.llc_snap.oui[1] = 0x00; + fddi->hdr.llc_snap.oui[2] = 0x00; + fddi->hdr.llc_snap.ethertype = htons(type); + } /* Set the source and destination hardware addresses */ @@ -76,12 +79,12 @@ int fddi_header( memcpy(fddi->saddr, dev->dev_addr, dev->addr_len); if (daddr != NULL) - { + { memcpy(fddi->daddr, daddr, dev->addr_len); - return(FDDI_K_SNAP_HLEN); - } - return(-FDDI_K_SNAP_HLEN); + return(hl); } + return(-hl); +} /* @@ -90,32 +93,22 @@ int fddi_header( * this sk_buff. We now let ARP fill in the other fields. */ -int fddi_rebuild_header( - void *buff, - struct device *dev, - unsigned long dest, - struct sk_buff *skb - ) - - { - struct fddihdr *fddi = (struct fddihdr *)buff; +int fddi_rebuild_header(struct sk_buff *skb) +{ + struct fddihdr *fddi = (struct fddihdr *)skb->data; /* Only ARP/IP is currently supported */ if (fddi->hdr.llc_snap.ethertype != htons(ETH_P_IP)) - { + { printk("fddi_rebuild_header: Don't know how to resolve type %04X addresses?\n", (unsigned int)htons(fddi->hdr.llc_snap.ethertype)); return(0); - } + } /* Try to get ARP to resolve the header and fill destination address */ - if (arp_find(fddi->daddr, dest, dev, dev->pa_addr, skb)) - return(1); - else - return(0); - } - + return arp_find(fddi->daddr, skb) ? 1 : 0; +} /* * Determine the packet's protocol ID and fill in skb fields. @@ -124,39 +117,47 @@ int fddi_rebuild_header( * the proper pointer to the start of packet data (skb->data). */ -unsigned short fddi_type_trans( - struct sk_buff *skb, - struct device *dev - ) - - { +unsigned short fddi_type_trans(struct sk_buff *skb, struct device *dev) +{ struct fddihdr *fddi = (struct fddihdr *)skb->data; - + unsigned short type; + /* * Set mac.raw field to point to FC byte, set data field to point * to start of packet data. Assume 802.2 SNAP frames for now. */ skb->mac.raw = skb->data; /* point to frame control (FC) */ - skb_pull(skb, FDDI_K_SNAP_HLEN); /* adjust for 21 byte header */ - + + if(fddi->hdr.llc_8022_1.dsap==0xe0) + { + skb_pull(skb, FDDI_K_8022_HLEN-3); + type=htons(ETH_P_802_2); + } + else + { + skb_pull(skb, FDDI_K_SNAP_HLEN); /* adjust for 21 byte header */ + type=fddi->hdr.llc_snap.ethertype; + } + /* Set packet type based on destination address and flag settings */ if (*fddi->daddr & 0x01) - { + { if (memcmp(fddi->daddr, dev->broadcast, FDDI_K_ALEN) == 0) skb->pkt_type = PACKET_BROADCAST; else skb->pkt_type = PACKET_MULTICAST; - } + } else if (dev->flags & IFF_PROMISC) - { + { if (memcmp(fddi->daddr, dev->dev_addr, FDDI_K_ALEN)) skb->pkt_type = PACKET_OTHERHOST; - } + } /* Assume 802.2 SNAP frames, for now */ - return(fddi->hdr.llc_snap.ethertype); - } + return(type); + +} diff --git a/net/802/llc.c b/net/802/llc.c deleted file mode 100644 index d280fb38f..000000000 --- a/net/802/llc.c +++ /dev/null @@ -1,412 +0,0 @@ -/* - * 802.2 Class 2 LLC service. - */ - - -int llc_rx_adm(struct sock *sk,struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==DISC) - send_response(sk,DM|pf); - else if(cmd==SABM) - { - if(sk->state!=TCP_LISTEN) - send_response(sk. DM|pf); - else - { - sk=ll_rx_accept(sk); - if(sk!=NULL) - { - send_response(sk, UA|pf); - sk->llc.vs=0; - sk->llc.vr=0; - sk->llc.p_flag=0; - sk->llc.remote_busy=0; - llc_state(sk,LLC_NORMAL); - } - } - } - else if(pf) - send_response(sk, DM|PF); - } - return 0; -} - -int llc_rx_setup(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==SABM) - { - sk->llc.vs=0; - sk->llc.vr=0; - send_response(sk, UA|pf); - } - if(cmd==DISC) - { - send_response(sk, DM|pf); - llc_error(sk,ECONNRESET); - llc_state(sk, LLC_ADM); - } - } - else - { - if(cmd==UA && pf==sk->llc.p_flag) - { - del_timer(&sk->llc.t1); - sk->llc.vs=0; - llc_update_p_flag(sk,pf); - llc_state(sk,LLC_NORMAL); - } - if(cmd==DM) - { - llc_error(sk, ECONNRESET); - llc_state(sk, LLC_ADM); - } - } -} - -int llc_rx_reset(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==SABM) - { - sk->llc.vr=0; - sk->llc.vs=0; - send_response(sk, UA|pf); - } - else if(cmd==DISC) - { - if(sk->llc.cause_flag==1) - llc_shutdown(sk,SHUTDOWN_MASK); - else - llc_eror(sk, ECONNREFUSED); - send_response(sk, DM|pf); - llc_state(sk, LLC_ADM); - } - } - else - { - if(cmd==UA) - { - if(sk->llc.p_flag==pf) - { - del_timer(&sk->llc.t1); - sk->llc.vs=0; - sk->llc.vr=0; - llc_update_p_flag(sk,pf); - llc_confirm_reset(sk, sk->llc.cause_flag); - sk->llc.remote_busy=0; - llc_state(sk, LLC_NORMAL); - } - } - if(cmd==DM) - { /* Should check cause_flag */ - llc_shutdown(sk, SHUTDOWN_MASK); - llc_state(sk, LLC_ADM); - } - } - return 0; -} - -int llc_rx_d_conn(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==SABM) - { - llc_error(sk, ECONNRESET); - llc_state(sk, ADM); - } - else if(cmd==DISC) - { - send_response(UA|pf); - llc_state(sk, LLC_D_CONN); - } - else if(pf) - send_response(sk, DM|PF); - } - else - { - if(cmd==UA && pf==sk->llc.p_flag) - { - del_timer(&sk->llc.t1); - llc_state(sk, ADM); - llc_confirm_reset(sk, sk->llc.cause_flag); - } - if(cmd==DM) - { - del_timer(&sk->llc.t1); - /*if(sk->llc.cause_flag)*/ - llc_shutdown(sk, SHUTDOWN_MASK); - } - - } - return 0; -} - -int llc_rx_error(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==SABM) - { - sk->llc.vs=0; - sk->llc.vr=0; - send_response(sk, UA|pf); - llc_error(sk,ECONNRESET); - sk->llc.p_flag=0; - sk->llc.remote_busy=0; - llc_state(sk, LLC_NORMAL); - } - else if(cmd==DISC) - { - send_response(sk, UA|pf); - llc_shutdown(sk, SHUTDOWN_MASK); - llc_state(sk, LLC_ADM); - } - else - llc_resend_frmr_rsp(sk,pf); - } - else - { - if(cmd==DM) - { - llc_error(sk, ECONNRESET); - del_timer(&sk->llc.t1); - llc_state(sk, LLC_ADM); - } - if(cmd==FRMR) - { - send_command(sk, SABM); - sk->llc.p_flag=pf; - llc_start_t1(); - sk->llc.retry_count=0; - sk->llc.cause_flag=0; - llc_error(sk, EPROTO); - llc_state(sk, LLC_RESET); - } - } -} - - -/* - * Subroutine for handling the shared cases of the data modes. - */ - -int llc_rx_nr_shared(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(type==CMD) - { - if(cmd==SABM) - { - /* - * Optional reset processing. We decline resets. - */ - send_response(sk,DM|pf); - llc_error(sk, ECONNRESET); - llc_state(sk, LLC_ADM); - } - else if(cmd==DISC) - { - send_response(sk,UA|pf); - llc_state(sk, LLC_ADM); - llc_shutdown(sk, SHUTDOWN_MASK); - } - /* - * We only ever use windows of 7, so there is no illegal NR/NS value - * otherwise we would FRMR here and go to ERROR state - */ - else if(cmd==ILLEGAL) - { - llc_send_frmr_response(sk, ILLEGAL_TYPE,pf); - llc_state(sk, LLC_ERROR); - llc_error(sk, EPROTO); - } - else - /* - * Not covered by general rule - */ - return 0; - } - else - { - /* - * We close on errors - */ - if(cmd==FRMR) - { - send_command(sk, DM|pf); - sk->llc.p_flag=pf; - llc_start_t1(sk); - llc_error(sk, EPROTO); - sk->llc.cause_flag=0; - llc_state(sk, LLC_D_CONN): - } - else if(cmd==DM) - { - llc_state(sk, LLC_ADM); - llc_error(sk, ECONNREFUSED); - } - /* - * We always use a window of 7 so can't get I resp - * with invalid NS, or any resp with invalid NR. If - * we add this they do the same as.. - */ - else if(cmd==UA) - { - llc_send_frmr_response(sk, UNEXPECTED_CONTROL, pf); - llc_state(sk, LLC_ERROR); - llc_error(sk, EPROTO); - } - else if(pf==1 && sk->llc.p_flag==0) - { - llc_send_frmr_response(sk, UNEXPECTED_RESPONSE, pf); - llc_state(sk, LLC_ERROR); - llc_error(sk, EPROTO); - } - else if(cmd==ILLEGAL) - { - llc_send_frmr_response(sk, ILLEGAL_TYPE,pf); - llc_state(sk, LLC_ERROR); - llc_error(sk, EPROTO); - } - else - /* - * Not covered by general rule - */ - return 0 - } - /* - * Processed. - */ - return 1; -} - -int llc_rx_normal(struct sock *sk, struct sk_buff *skb, int type, int cmd, int pf, int nr, int ns) -{ - if(llc_rx_nr_shared(sk, skb, type, cmd, pf, nr, ns)) - return 0; - if(cmd==I) - { - if(llc_invalid_ns(sk,ns)) - { - if((type==RESP && sk->llc.p_flag==pf)||(type==CMD && pf==0 && sk->llc.p_flag==0)) - { - llc_command(sk, REJ|PF); - llc_ack_frames(sk,nr); /* Ack frames and update N(R) */ - sk->llc.p_flag=PF; - llc_state(sk, LLC_REJECT); - sk->llc.retry_count=0; - llc_start_t1(sk); - sk->llc.remote_busy=0; - } - else if((type==CMD && !pf && sk->llc.p_flag==1) || (type==RESP && !pf && sk->llc.p_flag==1)) - { - if(type==CMD) - llc_response(sk, REJ); - else - llc_command(sk, REJ); - llc_ack_frames(sk,nr); - sk->llc.retry_count=0; - llc_state(sk, LLC_REJECT); - llc_start_t1(sk); - } - else if(pf && type==CMD) - { - llc_response(sk, REJ|PF); - llc_ack_frames(sk,nr); - sk->llc.retry_count=0; - llc_start_t1(sk); - } - } - else - { - /* - * Valid I frame cases - */ - - if(sk->llc.p_flag==pf && !(type==CMD && pf)) - { - sk->llc.vr=(sk->llc.vr+1)&7; - llc_queue_rr_cmd(sk, PF); - sk->llc.retry_count=0; - llc_start_t1(sk); - sk->llc.p_flag=1; - llc_ack_frames(sk,nr); - sk->llc.remote_busy=0; - } - else if(sk->ppc.p_flag!=pf) - { - sk->llc.vr=(sk->llc.vr+1)&7; - if(type==CMD) - llc_queue_rr_resp(sk, 0); - else - llc_queue_rr_cmd(sk, 0); - if(sk->llc.nr!=nr) - { - llc_ack_frames(sk,nr); - llc_reset_t1(sk); - } - } - else if(pf) - { - sk->llc.vr=(sk->llc.vr+1)&7; - llc_queue_rr_resp(sk,PF); - if(sk->llc.nr!=nr) - { - llc_ack_frames(sk,nr); - llc_reset_t1(sk); - } - } - llc_queue_data(sk,skb); - return 1; - } - } - else if(cmd==RR||cmd==RNR) - { - if(type==CMD || (type==RESP && (!pf || pf==1 && sk->llc.p_flag==1))) - { - llc_update_p_flag(sk,pf); - if(sk->llc.nr!=nr) - { - llc_ack_frames(sk,nr); - llc_reset_t1(sk); - } - if(cmd==RR) - sk->llc.remote_busy=0; - else - { sk->llc.remote_busy=1; - if(!llc_t1_running(sk)) - llc_start_t1(sk); - } - } - else if(type==cmd && pf) - { - if(cmd==RR) - llc_queue_rr_resp(sk,PF); - else - { - send_response(sk, RR|PF); - if(!llc_t1_running(sk)) - llc_start_t1(sk); - } - if(sk->llc.nr!=nr) - { - llc_ack_frames(sk,nr); - llc_reset_t1(sk); - } - if(cmd==RR) - sk->llc.remote_busy=0; - else - sk->llc.remote_busy=1; - } - } - else if(cmd==REJ) - { - - } -} - diff --git a/net/802/llc_macinit.c b/net/802/llc_macinit.c new file mode 100644 index 000000000..1ee0a9699 --- /dev/null +++ b/net/802/llc_macinit.c @@ -0,0 +1,225 @@ +/* + * 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 + */ + +#include <linux/config.h> +#include <linux/module.h> +#include <linux/version.h> +#include <linux/kernel.h> +#include <linux/malloc.h> +#include <linux/unistd.h> +#include <linux/netdevice.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(). + * Here an llc structure is associated with an skb depending on the source + * MAC address in the pdu. + * 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, struct device *dev, struct packet_type *pt) +{ + 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, FREE_READ); + } + + if(lp->llc_callbacks) + { + 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(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; + lp->remote_mac_len = lp->dev->addr_len; + memcpy(lp->remote_mac, rmac, lp->remote_mac_len); + 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); + + +#define ALL_TYPES_8022 0 + +void llc_init(struct net_proto *proto) +{ + printk(KERN_NOTICE "IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts\n"); + return; +} + +#ifdef MODULE + + +int init_module(void) +{ + llc_init(NULL); + return 0; +} + +void cleanup_module(void) +{ + +} + +#endif diff --git a/net/802/llc_sendpdu.c b/net/802/llc_sendpdu.c new file mode 100644 index 000000000..436ddb9c7 --- /dev/null +++ b/net/802/llc_sendpdu.c @@ -0,0 +1,363 @@ +/* + * 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/malloc.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 transmision. + * 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->arp = 1; + skb->priority=SOPRI_NORMAL; + 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 transmision. + * 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); + skb->arp = 1; + ADD_TO_RTQ(skb); /* add skb to the retransmit queue */ + tmp=skb_clone(skb, GFP_ATOMIC); + if(tmp!=NULL) + { + tmp->dev=lp->dev; + tmp->priority=SOPRI_NORMAL; + 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->arp = 1; + tmp->dev = lp->dev; + tmp->priority = SOPRI_NORMAL; + 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, FREE_WRITE); + ack_count++; + + if (ns_save == ack) + break; + pp = skb_dequeue(&lp->rtq); + } + restore_flags(flags); + return ack_count; +} + diff --git a/net/802/llc_utility.c b/net/802/llc_utility.c new file mode 100644 index 000000000..d0a58018f --- /dev/null +++ b/net/802/llc_utility.c @@ -0,0 +1,253 @@ +/* + * 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); +} + diff --git a/net/802/p8022.c b/net/802/p8022.c index f8754e5c0..23e6f2fad 100644 --- a/net/802/p8022.c +++ b/net/802/p8022.c @@ -1,3 +1,22 @@ +/* + * NET3: Support for 802.2 demultiplexing off ethernet (Token ring + * is kept seperate see p8022tr.c) + * 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. + * + * Demultiplex 802.2 encoded protocols. We match the entry by the + * SSAP/DSAP pair and then deliver to the registered datalink that + * matches. The control byte is ignored and handling of such items + * is up to the routine passed the frame. + * + * Unlike the 802.3 datalink we have a list of 802.2 entries as there + * are multiple protocols to demux. The list is currently short (3 or + * 4 entries at most). The current demux assumes this. + */ + +#include <linux/config.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> @@ -12,11 +31,11 @@ static struct datalink_proto *p8022_list = NULL; * We don't handle the loopback SAP stuff, the extended * 802.2 command set, multicast SAP identifiers and non UI * frames. We have the absolute minimum needed for IPX, - * IP and Appletalk phase 2. + * IP and Appletalk phase 2. See the llc_* routines for + * support libraries if your protocol needs these. */ - -static struct datalink_proto * -find_8022_client(unsigned char type) + +static struct datalink_proto *find_8022_client(unsigned char type) { struct datalink_proto *proto; @@ -28,14 +47,15 @@ find_8022_client(unsigned char type) return proto; } -int -p8022_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) +int p8022_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) { struct datalink_proto *proto; proto = find_8022_client(*(skb->h.raw)); - if (proto != NULL) { + if (proto != NULL) + { skb->h.raw += 3; + skb->nh.raw += 3; skb_pull(skb,3); return proto->rcvfunc(skb, dev, pt); } @@ -45,8 +65,7 @@ p8022_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) return 0; } -static void -p8022_datalink_header(struct datalink_proto *dl, +static void p8022_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest_node) { struct device *dev = skb->dev; @@ -59,7 +78,7 @@ p8022_datalink_header(struct datalink_proto *dl, dev->hard_header(skb, dev, ETH_P_802_3, dest_node, NULL, skb->len); } -static struct packet_type p8022_packet_type = +static struct packet_type p8022_packet_type = { 0, /* MUTTER ntohs(ETH_P_8022),*/ NULL, /* All devices */ @@ -68,23 +87,16 @@ static struct packet_type p8022_packet_type = NULL, }; -static struct symbol_table p8022_proto_syms = { -#include <linux/symtab_begin.h> - X(register_8022_client), - X(unregister_8022_client), -#include <linux/symtab_end.h> -}; - +EXPORT_SYMBOL(register_8022_client); +EXPORT_SYMBOL(unregister_8022_client); void p8022_proto_init(struct net_proto *pro) { p8022_packet_type.type=htons(ETH_P_802_2); dev_add_pack(&p8022_packet_type); - register_symtab(&p8022_proto_syms); } - -struct datalink_proto * -register_8022_client(unsigned char type, int (*rcvfunc)(struct sk_buff *, struct device *, struct packet_type *)) + +struct datalink_proto *register_8022_client(unsigned char type, int (*rcvfunc)(struct sk_buff *, struct device *, struct packet_type *)) { struct datalink_proto *proto; diff --git a/net/802/p8022tr.c b/net/802/p8022tr.c index d1fcc5c46..6a5864d54 100644 --- a/net/802/p8022tr.c +++ b/net/802/p8022tr.c @@ -1,3 +1,14 @@ +/* + * NET3: Handling for token ring frames that are not IP. IP is hooked + * early in the token ring support code. + * + * 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. + */ + +#include <linux/config.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> @@ -14,11 +25,14 @@ static struct datalink_proto *p8022tr_list = NULL; * We don't handle the loopback SAP stuff, the extended * 802.2 command set, multicast SAP identifiers and non UI * frames. We have the absolute minimum needed for IPX, - * IP and Appletalk phase 2. + * IP and Appletalk phase 2. See the llc_* routines for support + * to handle the fun stuff. + * + * We assume the list will be very short (at the moment its normally + * one or two entries). */ - -static struct datalink_proto * -find_8022tr_client(unsigned char type) + +static struct datalink_proto *find_8022tr_client(unsigned char type) { struct datalink_proto *proto; @@ -30,8 +44,7 @@ find_8022tr_client(unsigned char type) return proto; } -int -p8022tr_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) +int p8022tr_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) { struct datalink_proto *proto; @@ -47,8 +60,7 @@ p8022tr_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) return 0; } -static void -p8022tr_datalink_header(struct datalink_proto *dl, +static void p8022tr_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest_node) { struct device *dev = skb->dev; @@ -66,32 +78,27 @@ p8022tr_datalink_header(struct datalink_proto *dl, memmove(newdata, olddata, dev->hard_header_len - SNAP_HEADER_LEN); } -static struct packet_type p8022tr_packet_type = +static struct packet_type p8022tr_packet_type = { - 0, + 0, NULL, /* All devices */ p8022tr_rcv, NULL, NULL, }; - -static struct symbol_table p8022tr_proto_syms = { -#include <linux/symtab_begin.h> - X(register_8022tr_client), - X(unregister_8022tr_client), -#include <linux/symtab_end.h> -}; + +EXPORT_SYMBOL(register_8022tr_client); +EXPORT_SYMBOL(unregister_8022tr_client); void p8022tr_proto_init(struct net_proto *pro) { p8022tr_packet_type.type=htons(ETH_P_TR_802_2); dev_add_pack(&p8022tr_packet_type); - register_symtab(&p8022tr_proto_syms); } - -struct datalink_proto * -register_8022tr_client(unsigned char type, int (*rcvfunc)(struct sk_buff *, struct device *, struct packet_type *)) + +struct datalink_proto *register_8022tr_client(unsigned char type, + int (*rcvfunc)(struct sk_buff *, struct device *, struct packet_type *)) { struct datalink_proto *proto; @@ -134,4 +141,3 @@ void unregister_8022tr_client(unsigned char type) restore_flags(flags); } - diff --git a/net/802/p8023.c b/net/802/p8023.c index 57bd6a74a..82a80c3c2 100644 --- a/net/802/p8023.c +++ b/net/802/p8023.c @@ -1,34 +1,59 @@ +/* + * NET3: 802.3 data link hooks used for IPX 802.3 + * + * 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. + * + * 802.3 isn't really a protocol data link layer. Some old IPX stuff + * uses it however. Note that there is only one 802.3 protocol layer + * in the system. We don't currently support different protocols + * running raw 802.3 on different devices. Thankfully nobody else + * has done anything like the old IPX. + */ + #include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/datalink.h> #include <linux/mm.h> #include <linux/in.h> -static void -p8023_datalink_header(struct datalink_proto *dl, +/* + * Place an 802.3 header on a packet. The driver will do the mac + * addresses, we just need to give it the buffer length. + */ + +static void p8023_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest_node) { struct device *dev = skb->dev; - dev->hard_header(skb, dev, ETH_P_802_3, dest_node, NULL, skb->len); } -struct datalink_proto * -make_8023_client(void) +/* + * Create an 802.3 client. Note there can be only one 802.3 client + */ + +struct datalink_proto *make_8023_client(void) { struct datalink_proto *proto; proto = (struct datalink_proto *) kmalloc(sizeof(*proto), GFP_ATOMIC); - if (proto != NULL) { + if (proto != NULL) + { proto->type_len = 0; proto->header_length = 0; proto->datalink_header = p8023_datalink_header; proto->string_name = "802.3"; } - return proto; } +/* + * Destroy the 802.3 client. + */ + void destroy_8023_client(struct datalink_proto *dl) { if (dl) diff --git a/net/802/pseudo/Makefile b/net/802/pseudo/Makefile new file mode 100644 index 000000000..d9f416029 --- /dev/null +++ b/net/802/pseudo/Makefile @@ -0,0 +1,13 @@ +all: pseudocode.h actionnm.h + +clean: + touch pseudocode.h actionnm.h + rm pseudocode.h actionnm.h + +pseudocode.h: pseudocode opcd2num.sed compile.awk + sed -f opcd2num.sed pseudocode | awk -f compile.awk >pseudocode.h + +actionnm.h: pseudocode.h actionnm.awk + awk -f actionnm.awk pseudocode.h>actionnm.h + + diff --git a/net/802/pseudo/actionnm.awk b/net/802/pseudo/actionnm.awk new file mode 100644 index 000000000..b5ca78289 --- /dev/null +++ b/net/802/pseudo/actionnm.awk @@ -0,0 +1,27 @@ +# 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") +} + diff --git a/net/802/pseudo/actionnm.h b/net/802/pseudo/actionnm.h new file mode 100644 index 000000000..924cf9972 --- /dev/null +++ b/net/802/pseudo/actionnm.h @@ -0,0 +1,51 @@ + +/* this file generated on Thu Oct 24 11:42:37 GMT 1996 */ + +static char *action_names[] = { + "NOP" ,"ADM1" ,"ADM2" ,"ADM3" , + "ADM4" ,"ADM5" ,"CONN2" ,"CONN3" , + "CONN4" ,"CONN5" ,"RESWAIT1" ,"RESWAIT2" , + "RESWAIT3" ,"RESWAIT4" ,"RESWAIT5" ,"RESWAIT6" , + "RESWAIT7" ,"RESWAIT8" ,"RESCHK1" ,"RESCHK2" , + "RESCHK3" ,"RESCHK4" ,"RESCHK5" ,"RESCHK6" , + "SETUP1" ,"SETUP2" ,"SETUP3" ,"SETUP4" , + "SETUP5" ,"SETUP6" ,"SETUP7" ,"SETUP8" , + "RESET1" ,"RESET2" ,"RESET3" ,"RESET4" , + "RESET5" ,"RESET6" ,"RESET7" ,"RESET8" , + "D_CONN1" ,"D_CONN2" ,"D_CONN3" ,"D_CONN4" , + "D_CONN5" ,"D_CONN6" ,"D_CONN7" ,"ERR1" , + "ERR2" ,"ERR3" ,"ERR4" ,"ERR5" , + "ERR6" ,"ERR7" ,"ERR8" ,"SH1" , + "SH2" ,"SH3" ,"SH4" ,"SH5" , + "SH6" ,"SH7" ,"SH8" ,"SH9" , + "SH10" ,"SH11" ,"NORMAL1" ,"NORMAL2" , + "NORMAL3" ,"NORMAL4" ,"NORMAL5" ,"NORMAL6" , + "NORMAL7" ,"NORMAL8A" ,"NORMAL8B" ,"NORMAL9" , + "NORMAL10" ,"NORMAL11" ,"NORMAL12" ,"NORMAL13" , + "NORMAL14" ,"NORMAL15" ,"NORMAL16" ,"NORMAL17" , + "NORMAL18" ,"NORMAL19" ,"NORMAL20" ,"BUSY1" , + "BUSY2" ,"BUSY3" ,"BUSY4" ,"BUSY5" , + "BUSY6" ,"BUSY7" ,"BUSY8" ,"BUSY9" , + "BUSY10" ,"BUSY11" ,"BUSY12" ,"BUSY13" , + "BUSY14" ,"BUSY15" ,"BUSY16" ,"BUSY17" , + "BUSY18" ,"BUSY19" ,"BUSY20" ,"BUSY21" , + "BUSY22" ,"BUSY23" ,"BUSY24" ,"BUSY25" , + "BUSY26" ,"REJECT1" ,"REJECT2" ,"REJECT3" , + "REJECT4" ,"REJECT5" ,"REJECT6" ,"REJECT7" , + "REJECT8" ,"REJECT9" ,"REJECT10" ,"REJECT11" , + "REJECT12" ,"REJECT13" ,"REJECT14" ,"REJECT15" , + "REJECT16" ,"REJECT17" ,"REJECT18" ,"REJECT19" , + "REJECT20" ,"AWAIT1" ,"AWAIT2" ,"AWAIT3" , + "AWAIT4" ,"AWAIT5" ,"AWAIT6" ,"AWAIT7" , + "AWAIT8" ,"AWAIT9" ,"AWAIT10" ,"AWAIT11" , + "AWAIT12" ,"AWAIT13" ,"AWAIT14" ,"AWAIT_BUSY1" , + "AWAIT_BUSY2" ,"AWAIT_BUSY3" ,"AWAIT_BUSY4" ,"AWAIT_BUSY5" , + "AWAIT_BUSY6" ,"AWAIT_BUSY7" ,"AWAIT_BUSY8" ,"AWAIT_BUSY9" , + "AWAIT_BUSY10" ,"AWAIT_BUSY11" ,"AWAIT_BUSY12" ,"AWAIT_BUSY13" , + "AWAIT_BUSY14" ,"AWAIT_BUSY15" ,"AWAIT_BUSY16" ,"AWAIT_REJECT1" , + "AWAIT_REJECT2" ,"AWAIT_REJECT3" ,"AWAIT_REJECT4" ,"AWAIT_REJECT5" , + "AWAIT_REJECT6" ,"AWAIT_REJECT7" ,"AWAIT_REJECT8" ,"AWAIT_REJECT9" , + "AWAIT_REJECT10" ,"AWAIT_REJECT11" ,"AWAIT_REJECT12" ,"AWAIT_REJECT13" , + 0 +}; + diff --git a/net/802/pseudo/compile.awk b/net/802/pseudo/compile.awk new file mode 100644 index 000000000..ca901fa35 --- /dev/null +++ b/net/802/pseudo/compile.awk @@ -0,0 +1,57 @@ +# 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++ +} + diff --git a/net/802/pseudo/opcd2num.sed b/net/802/pseudo/opcd2num.sed new file mode 100644 index 000000000..c66f85a65 --- /dev/null +++ b/net/802/pseudo/opcd2num.sed @@ -0,0 +1,72 @@ +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/ diff --git a/net/802/pseudo/opcodes b/net/802/pseudo/opcodes new file mode 100644 index 000000000..1bd7e7240 --- /dev/null +++ b/net/802/pseudo/opcodes @@ -0,0 +1,72 @@ + 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) diff --git a/net/802/pseudo/opcodesnm.h b/net/802/pseudo/opcodesnm.h new file mode 100644 index 000000000..d24f2c320 --- /dev/null +++ b/net/802/pseudo/opcodesnm.h @@ -0,0 +1,23 @@ +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)" +}; diff --git a/net/802/pseudo/pseudocode b/net/802/pseudo/pseudocode new file mode 100644 index 000000000..f91978ef7 --- /dev/null +++ b/net/802/pseudo/pseudocode @@ -0,0 +1,780 @@ +;============================================================================ +; +; 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 incomming 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 +;============================================================================ + diff --git a/net/802/pseudo/pseudocode.h b/net/802/pseudo/pseudocode.h new file mode 100644 index 000000000..f32bfeb4d --- /dev/null +++ b/net/802/pseudo/pseudocode.h @@ -0,0 +1,287 @@ + +/* this file generated on Thu Oct 24 11:42:35 GMT 1996 */ + +static char pseudo_code [ ] = { + 0, 37, 57, 42, 59, 39, 0, 65, 38, + 63, 61, 59, 56, 58, 2, 0, 12, 0, + 12, 0, 0, 0, 12, 0, 65, 0, 5, + 0, 0, 0, 37, 57, 42, 59, 0, 38, + 63, 61, 59, 56, 58, 7, 0, 11, 57, + 42, 59, 0, 12, 0, 5, 0, 40, 65, + 0, 12, 5, 0, 0, 0, 38, 63, 61, + 59, 56, 58, 0, 12, 0, 5, 0, 65, + 0, 12, 5, 0, 0, 0, 38, 63, 61, + 59, 40, 0, 45, 63, 61, 59, 51, 3, + 58, 0, 56, 3, 58, 0, 12, 5, 45, + 0, 5, 45, 0, 0, 0, 37, 57, 42, + 60, 0, 5, 0, 38, 63, 61, 59, 40, + 0, 45, 63, 61, 59, 51, 7, 58, 0, + 56, 7, 58, 0, 12, 5, 45, 0, 5, + 45, 0, 0, 0, 37, 57, 42, 60, 0, + 5, 0, 12, 45, 0, 45, 0, 38, 0, + 45, 0, 0, 0, 11, 57, 42, 60, 0, + 0, 0, 71, 45, 65, 0, 38, 5, 45, + 0, 5, 45, 0, 70, 45, 66, 39, 0, + 15, 42, 0, 0, 0, 14, 42, 60, 0, + 39, 70, 0, 11, 57, 42, 49, 59, 0, + 37, 57, 42, 49, 59, 39, 0, 71, 65, + 48, 0, 38, 5, 48, 0, 48, 70, 66, + 39, 0, 5, 48, 0, 13, 67, 42, 49, + 59, 0, 0, 67, 42, 49, 59, 0, 0, + 67, 42, 49, 59, 0, 13, 67, 42, 49, + 59, 0, 48, 70, 39, 0, 16, 41, 44, + 0, 19, 44, 0, 26, 41, 53, 0, 28, + 53, 0, 25, 50, 51, 43, 9, 0, 25, + 50, 43, 0, 24, 50, 43, 0, 62, 32, + 41, 50, 9, 4, 0, 62, 51, 36, 50, + 9, 4, 0, 62, 36, 50, 4, 0, 62, + 34, 50, 4, 0, 51, 50, 1, 0, 34, + 50, 1, 0, 51, 50, 29, 0, 33, 50, + 29, 0, 64, 50, 51, 20, 1, 0, 64, + 50, 20, 1, 0, 64, 50, 22, 1, 0, + 31, 41, 0, 56, 0, 31, 41, 60, 0, + 16, 41, 44, 0, 19, 44, 0, 23, 43, + 41, 0, 25, 43, 0, 31, 41, 35, 0, + 35, 0, 31, 41, 35, 0, 35, 0, 30, + 51, 50, 55, 9, 0, 30, 50, 55, 0, + 27, 50, 55, 0, 27, 50, 10, 54, 0, + 30, 51, 50, 10, 54, 9, 0, 30, 50, + 10, 54, 0, 51, 50, 1, 0, 27, 50, + 1, 0, 51, 50, 29, 0, 27, 50, 29, + 0, 64, 50, 51, 20, 1, 0, 64, 50, + 20, 1, 0, 64, 50, 27, 20, 1, 0, + 26, 41, 0, 56, 0, 26, 41, 60, 0, + 54, 0, 54, 0, 16, 41, 44, 0, 19, + 44, 0, 26, 41, 52, 0, 28, 52, 0, + 50, 51, 9, 0, 33, 50, 0, 62, 32, + 41, 50, 9, 47, 4, 0, 62, 36, 50, + 47, 4, 0, 62, 34, 50, 47, 4, 0, + 51, 50, 1, 0, 34, 50, 1, 0, 51, + 50, 29, 0, 33, 50, 29, 0, 64, 50, + 51, 20, 1, 0, 64, 50, 20, 1, 0, + 64, 50, 22, 1, 0, 31, 41, 0, 23, + 41, 43, 60, 0, 56, 0, 31, 41, 43, + 60, 0, 28, 53, 0, 25, 50, 64, 46, + 20, 43, 1, 0, 25, 50, 43, 0, 24, + 50, 43, 0, 62, 50, 64, 18, 41, 1, + 4, 0, 62, 35, 50, 4, 0, 62, 33, + 50, 4, 0, 50, 64, 46, 20, 1, 0, + 50, 1, 0, 33, 50, 1, 0, 50, 64, + 46, 29, 0, 50, 29, 0, 33, 50, 29, + 0, 31, 41, 60, 0, 25, 43, 0, 35, + 0, 35, 0, 30, 50, 64, 46, 54, 1, + 20, 0, 30, 50, 54, 0, 27, 50, 54, + 0, 30, 50, 64, 54, 46, 1, 20, 0, + 30, 50, 54, 0, 27, 50, 54, 0, 50, + 64, 46, 20, 1, 0, 50, 1, 0, 27, + 50, 1, 0, 50, 64, 46, 29, 0, 50, + 29, 0, 27, 50, 29, 0, 26, 41, 60, + 0, 28, 52, 0, 50, 0, 33, 50, 0, + 62, 50, 64, 18, 41, 47, 1, 4, 0, + 62, 35, 47, 50, 4, 0, 62, 33, 47, + 50, 4, 0, 50, 64, 46, 20, 1, 0, + 50, 1, 0, 33, 50, 1, 0, 50, 64, + 46, 29, 0, 50, 29, 0, 33, 50, 29, + 0, 23, 41, 60, 0 +}; + +static short int pseudo_code_idx [ ] ={ + 0, 1, 7, 16, 18, 20, 22, 24, 26, + 28, 30, 35, 43, 48, 50, 52, 55, 58, + 60, 67, 69, 71, 73, 76, 78, 84, 92, + 96, 100, 103, 105, 110, 112, 118, 126, 130, + 134, 137, 139, 144, 146, 149, 151, 153, 155, + 157, 162, 164, 168, 172, 175, 180, 183, 185, + 189, 192, 198, 205, 209, 213, 218, 221, 227, + 233, 239, 245, 249, 253, 256, 260, 263, 269, + 273, 277, 284, 291, 296, 301, 305, 309, 313, + 317, 323, 328, 333, 336, 338, 342, 346, 349, + 353, 356, 360, 362, 366, 368, 374, 378, 382, + 387, 394, 399, 403, 407, 411, 415, 421, 426, + 432, 435, 437, 441, 443, 445, 449, 452, 456, + 459, 463, 466, 474, 480, 486, 490, 494, 498, + 502, 508, 513, 518, 521, 526, 528, 533, 536, + 544, 548, 552, 560, 565, 570, 576, 579, 583, + 588, 591, 595, 599, 602, 604, 606, 614, 618, + 622, 630, 634, 638, 644, 647, 651, 656, 659, + 663, 667, 670, 672, 675, 684, 690, 696, 702, + 705, 709, 714, 717, 721, 0 +}; + +#define NOP 0 +#define ADM1 1 +#define ADM2 2 +#define ADM3 3 +#define ADM4 4 +#define ADM5 5 +#define CONN2 6 +#define CONN3 7 +#define CONN4 8 +#define CONN5 9 +#define RESWAIT1 10 +#define RESWAIT2 11 +#define RESWAIT3 12 +#define RESWAIT4 13 +#define RESWAIT5 14 +#define RESWAIT6 15 +#define RESWAIT7 16 +#define RESWAIT8 17 +#define RESCHK1 18 +#define RESCHK2 19 +#define RESCHK3 20 +#define RESCHK4 21 +#define RESCHK5 22 +#define RESCHK6 23 +#define SETUP1 24 +#define SETUP2 25 +#define SETUP3 26 +#define SETUP4 27 +#define SETUP5 28 +#define SETUP6 29 +#define SETUP7 30 +#define SETUP8 31 +#define RESET1 32 +#define RESET2 33 +#define RESET3 34 +#define RESET4 35 +#define RESET5 36 +#define RESET6 37 +#define RESET7 38 +#define RESET8 39 +#define D_CONN1 40 +#define D_CONN2 41 +#define D_CONN3 42 +#define D_CONN4 43 +#define D_CONN5 44 +#define D_CONN6 45 +#define D_CONN7 46 +#define ERR1 47 +#define ERR2 48 +#define ERR3 49 +#define ERR4 50 +#define ERR5 51 +#define ERR6 52 +#define ERR7 53 +#define ERR8 54 +#define SH1 55 +#define SH2 56 +#define SH3 57 +#define SH4 58 +#define SH5 59 +#define SH6 60 +#define SH7 61 +#define SH8 62 +#define SH9 63 +#define SH10 64 +#define SH11 65 +#define NORMAL1 66 +#define NORMAL2 67 +#define NORMAL3 68 +#define NORMAL4 69 +#define NORMAL5 70 +#define NORMAL6 71 +#define NORMAL7 72 +#define NORMAL8A 73 +#define NORMAL8B 74 +#define NORMAL9 75 +#define NORMAL10 76 +#define NORMAL11 77 +#define NORMAL12 78 +#define NORMAL13 79 +#define NORMAL14 80 +#define NORMAL15 81 +#define NORMAL16 82 +#define NORMAL17 83 +#define NORMAL18 84 +#define NORMAL19 85 +#define NORMAL20 86 +#define BUSY1 87 +#define BUSY2 88 +#define BUSY3 89 +#define BUSY4 90 +#define BUSY5 91 +#define BUSY6 92 +#define BUSY7 93 +#define BUSY8 94 +#define BUSY9 95 +#define BUSY10 96 +#define BUSY11 97 +#define BUSY12 98 +#define BUSY13 99 +#define BUSY14 100 +#define BUSY15 101 +#define BUSY16 102 +#define BUSY17 103 +#define BUSY18 104 +#define BUSY19 105 +#define BUSY20 106 +#define BUSY21 107 +#define BUSY22 108 +#define BUSY23 109 +#define BUSY24 110 +#define BUSY25 111 +#define BUSY26 112 +#define REJECT1 113 +#define REJECT2 114 +#define REJECT3 115 +#define REJECT4 116 +#define REJECT5 117 +#define REJECT6 118 +#define REJECT7 119 +#define REJECT8 120 +#define REJECT9 121 +#define REJECT10 122 +#define REJECT11 123 +#define REJECT12 124 +#define REJECT13 125 +#define REJECT14 126 +#define REJECT15 127 +#define REJECT16 128 +#define REJECT17 129 +#define REJECT18 130 +#define REJECT19 131 +#define REJECT20 132 +#define AWAIT1 133 +#define AWAIT2 134 +#define AWAIT3 135 +#define AWAIT4 136 +#define AWAIT5 137 +#define AWAIT6 138 +#define AWAIT7 139 +#define AWAIT8 140 +#define AWAIT9 141 +#define AWAIT10 142 +#define AWAIT11 143 +#define AWAIT12 144 +#define AWAIT13 145 +#define AWAIT14 146 +#define AWAIT_BUSY1 147 +#define AWAIT_BUSY2 148 +#define AWAIT_BUSY3 149 +#define AWAIT_BUSY4 150 +#define AWAIT_BUSY5 151 +#define AWAIT_BUSY6 152 +#define AWAIT_BUSY7 153 +#define AWAIT_BUSY8 154 +#define AWAIT_BUSY9 155 +#define AWAIT_BUSY10 156 +#define AWAIT_BUSY11 157 +#define AWAIT_BUSY12 158 +#define AWAIT_BUSY13 159 +#define AWAIT_BUSY14 160 +#define AWAIT_BUSY15 161 +#define AWAIT_BUSY16 162 +#define AWAIT_REJECT1 163 +#define AWAIT_REJECT2 164 +#define AWAIT_REJECT3 165 +#define AWAIT_REJECT4 166 +#define AWAIT_REJECT5 167 +#define AWAIT_REJECT6 168 +#define AWAIT_REJECT7 169 +#define AWAIT_REJECT8 170 +#define AWAIT_REJECT9 171 +#define AWAIT_REJECT10 172 +#define AWAIT_REJECT11 173 +#define AWAIT_REJECT12 174 +#define AWAIT_REJECT13 175 + diff --git a/net/802/psnap.c b/net/802/psnap.c index 4f17352ab..bdcb5efd2 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -9,7 +9,8 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ - + +#include <linux/config.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> @@ -25,7 +26,7 @@ static struct datalink_proto *snap_dl = NULL; /* 802.2 DL for SNAP */ /* * Find a snap client by matching the 5 bytes. */ - + static struct datalink_proto *find_snap_client(unsigned char *desc) { struct datalink_proto *proto; @@ -37,27 +38,27 @@ static struct datalink_proto *find_snap_client(unsigned char *desc) /* * A SNAP packet has arrived */ - + int snap_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) { - static struct packet_type psnap_packet_type = + static struct packet_type psnap_packet_type = { - 0, + 0, NULL, /* All Devices */ snap_rcv, NULL, NULL, }; - + struct datalink_proto *proto; proto = find_snap_client(skb->h.raw); - if (proto != NULL) + if (proto != NULL) { /* * Pass the frame on. */ - + skb->h.raw += 5; skb_pull(skb,5); if (psnap_packet_type.type == 0) @@ -72,7 +73,7 @@ int snap_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) /* * Put a SNAP header on a frame and pass to 802.2 */ - + static void snap_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest_node) { memcpy(skb_push(skb,5),dl->type,5); @@ -83,25 +84,20 @@ static void snap_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, * Set up the SNAP layer */ -static struct symbol_table snap_proto_syms = { -#include <linux/symtab_begin.h> - X(register_snap_client), - X(unregister_snap_client), -#include <linux/symtab_end.h> -}; - +EXPORT_SYMBOL(register_snap_client); +EXPORT_SYMBOL(unregister_snap_client); + void snap_proto_init(struct net_proto *pro) { snap_dl=register_8022_client(0xAA, snap_rcv); if(snap_dl==NULL) printk("SNAP - unable to register with 802.2\n"); - register_symtab(&snap_proto_syms); } - + /* * Register SNAP clients. We don't yet use this for IP or IPX. */ - + struct datalink_proto *register_snap_client(unsigned char *desc, int (*rcvfunc)(struct sk_buff *, struct device *, struct packet_type *)) { struct datalink_proto *proto; @@ -110,7 +106,7 @@ struct datalink_proto *register_snap_client(unsigned char *desc, int (*rcvfunc)( return NULL; proto = (struct datalink_proto *) kmalloc(sizeof(*proto), GFP_ATOMIC); - if (proto != NULL) + if (proto != NULL) { memcpy(proto->type, desc,5); proto->type_len = 5; @@ -152,4 +148,3 @@ void unregister_snap_client(unsigned char *desc) restore_flags(flags); } - diff --git a/net/802/sysctl_net_802.c b/net/802/sysctl_net_802.c index 96f51588c..f97141d3c 100644 --- a/net/802/sysctl_net_802.c +++ b/net/802/sysctl_net_802.c @@ -1,13 +1,27 @@ /* -*- linux-c -*- - * sysctl_net_802.c: sysctl interface to net 802 subsystem. + * sysctl_net_802.c: sysctl interface to net 802 subsystem. * - * Begun April 1, 1996, Mike Shaver. - * Added /proc/sys/net/802 directory entry (empty =) ). [MS] + * Begun April 1, 1996, Mike Shaver. + * Added /proc/sys/net/802 directory entry (empty =) ). [MS] + * + * 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. */ #include <linux/mm.h> #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}, +}; +#endif diff --git a/net/802/tr.c b/net/802/tr.c index c12a66d83..e903924f7 100644 --- a/net/802/tr.c +++ b/net/802/tr.c @@ -1,5 +1,20 @@ +/* + * NET3: Token ring device handling subroutines + * + * 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. + * + * Fixes: 3 Feb 97 Paul Norton <pnorton@cts.com> Minor routing fixes. + * Added rif table to /proc/net/tr_rif and rif timeout to + * /proc/sys/net/token-ring/rif_timeout. + * + */ + #include <asm/uaccess.h> #include <asm/system.h> +#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -15,29 +30,56 @@ #include <linux/string.h> #include <linux/timer.h> #include <linux/net.h> +#include <linux/proc_fs.h> #include <net/arp.h> -static void tr_source_route(struct trh_hdr *trh,struct device *dev); -static void tr_add_rif_info(struct trh_hdr *trh); +static void tr_source_route(struct trh_hdr *trh, struct device *dev); +static void tr_add_rif_info(struct trh_hdr *trh, struct device *dev); static void rif_check_expire(unsigned long dummy); +#define TR_SR_DEBUG 0 + typedef struct rif_cache_s *rif_cache; +/* + * Each RIF entry we learn is kept this way + */ + struct rif_cache_s { - unsigned char addr[TR_ALEN]; - unsigned short rcf; - unsigned short rseg[8]; - rif_cache next; - unsigned long last_used; + unsigned char addr[TR_ALEN]; + unsigned char iface[5]; + __u16 rcf; + __u8 rseg[8]; + rif_cache next; + unsigned long last_used; + unsigned char local_ring; }; -#define RIF_TABLE_SIZE 16 +#define RIF_TABLE_SIZE 32 + +/* + * We hash the RIF cache 32 ways. We do after all have to look it + * up a lot. + */ + rif_cache rif_table[RIF_TABLE_SIZE]={ NULL, }; #define RIF_TIMEOUT 60*10*HZ #define RIF_CHECK_INTERVAL 60*HZ -static struct timer_list rif_timer={ NULL,NULL,RIF_CHECK_INTERVAL,0L,rif_check_expire }; +/* + * Garbage disposal timer. + */ + +static struct timer_list rif_timer; + +int sysctl_tr_rif_timeout = RIF_TIMEOUT; + +/* + * Put the headers on a token ring packet. Token ring source routing + * makes this a little more exciting than on ethernet. + */ + int tr_header(struct sk_buff *skb, struct device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) { @@ -53,13 +95,23 @@ int tr_header(struct sk_buff *skb, struct device *dev, unsigned short type, else memset(trh->saddr,0,dev->addr_len); /* Adapter fills in address */ + /* + * This is the stuff needed for IP encoding - IP over 802.2 + * with SNAP. + */ + trllc->dsap=trllc->ssap=EXTENDED_SAP; trllc->llc=UI_CMD; trllc->protid[0]=trllc->protid[1]=trllc->protid[2]=0x00; trllc->ethertype=htons(type); - if(daddr) { + /* + * Build the destination and then source route the frame + */ + + if(daddr) + { memcpy(trh->daddr,daddr,dev->addr_len); tr_source_route(trh,dev); return(dev->hard_header_len); @@ -68,27 +120,44 @@ int tr_header(struct sk_buff *skb, struct device *dev, unsigned short type, } -int tr_rebuild_header(void *buff, struct device *dev, unsigned long dest, - struct sk_buff *skb) { - - struct trh_hdr *trh=(struct trh_hdr *)buff; - struct trllc *trllc=(struct trllc *)(buff+sizeof(struct trh_hdr)); +/* + * A neighbour discovery of some species (eg arp) has completed. We + * can now send the packet. + */ + +int tr_rebuild_header(struct sk_buff *skb) +{ + struct trh_hdr *trh=(struct trh_hdr *)skb->data; + struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr)); + struct device *dev = skb->dev; + /* + * FIXME: We don't yet support IPv6 over token rings + */ + if(trllc->ethertype != htons(ETH_P_IP)) { - printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n",(unsigned int)htons( trllc->ethertype)); + printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n",(unsigned int)htons(trllc->ethertype)); return 0; } - if(arp_find(trh->daddr, dest, dev, dev->pa_addr, skb)) { + if(arp_find(trh->daddr, skb)) { return 1; } - else { + else + { tr_source_route(trh,dev); return 0; } } -unsigned short tr_type_trans(struct sk_buff *skb, struct device *dev) { +/* + * Some of this is a bit hackish. We intercept RIF information + * used for source routing. We also grab IP directly and don't feed + * it via SNAP. + */ + +unsigned short tr_type_trans(struct sk_buff *skb, struct device *dev) +{ struct trh_hdr *trh=(struct trh_hdr *)skb->data; struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr)); @@ -97,8 +166,7 @@ unsigned short tr_type_trans(struct sk_buff *skb, struct device *dev) { skb_pull(skb,dev->hard_header_len); - if(trh->saddr[0] & TR_RII) - tr_add_rif_info(trh); + tr_add_rif_info(trh, dev); if(*trh->daddr & 1) { @@ -117,174 +185,296 @@ unsigned short tr_type_trans(struct sk_buff *skb, struct device *dev) { return trllc->ethertype; } -/* We try to do source routing... */ +/* + * We try to do source routing... + */ -static void tr_source_route(struct trh_hdr *trh,struct device *dev) { +static void tr_source_route(struct trh_hdr *trh,struct device *dev) +{ int i; unsigned int hash; rif_cache entry; - /* Broadcasts are single route as stated in RFC 1042 */ - if(!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) { + /* + * Broadcasts are single route as stated in RFC 1042 + */ + if(!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) + { trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK) | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST); trh->saddr[0]|=TR_RII; } - else { + else + { for(i=0,hash=0;i<TR_ALEN;hash+=trh->daddr[i++]); hash&=RIF_TABLE_SIZE-1; + /* + * Walk the hash table and look for an entry + */ for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->daddr[0]),TR_ALEN);entry=entry->next); - if(entry) { -#if 0 + /* + * If we found an entry we can route the frame. + */ + if(entry) + { +#if TR_SR_DEBUG printk("source routing for %02X %02X %02X %02X %02X %02X\n",trh->daddr[0], trh->daddr[1],trh->daddr[2],trh->daddr[3],trh->daddr[4],trh->daddr[5]); #endif - if((ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8) { + if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8) + { trh->rcf=entry->rcf; memcpy(&trh->rseg[0],&entry->rseg[0],8*sizeof(unsigned short)); trh->rcf^=htons(TR_RCF_DIR_BIT); trh->rcf&=htons(0x1fff); /* Issam Chehab <ichehab@madge1.demon.co.uk> */ trh->saddr[0]|=TR_RII; - entry->last_used=jiffies; +#if TR_SR_DEBUG + printk("entry found with rcf %04x\n", entry->rcf); + } + else + { + printk("entry found but without rcf length, local=%02x\n", entry->local_ring); +#endif } + entry->last_used=jiffies; } - else { + else + { + /* + * Without the information we simply have to shout + * on the wire. The replies should rapidly clean this + * situation up. + */ trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK) | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST); trh->saddr[0]|=TR_RII; + printk("no entry in rif table found - broadcasting frame\n"); } } - } -static void tr_add_rif_info(struct trh_hdr *trh) { - +/* + * We have learned some new RIF information for our source + * routing. + */ + +static void tr_add_rif_info(struct trh_hdr *trh, struct device *dev) +{ int i; - unsigned int hash; + unsigned int hash, rii_p = 0; rif_cache entry; + /* + * Firstly see if the entry exists + */ + + if(trh->saddr[0] & TR_RII) + { + trh->saddr[0]&=0x7f; + if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2) + { + rii_p = 1; + } + } - trh->saddr[0]&=0x7f; for(i=0,hash=0;i<TR_ALEN;hash+=trh->saddr[i++]); hash&=RIF_TABLE_SIZE-1; -#if 0 - printk("hash: %d\n",hash); -#endif for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);entry=entry->next); - if(entry==NULL) { -#if 0 + if(entry==NULL) + { +#if TR_SR_DEBUG printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", trh->saddr[0],trh->saddr[1],trh->saddr[2], trh->saddr[3],trh->saddr[4],trh->saddr[5], - trh->rcf); + ntohs(trh->rcf)); #endif + /* + * Allocate our new entry. A failure to allocate loses + * use the information. This is harmless. + * + * FIXME: We ought to keep some kind of cache size + * limiting and adjust the timers to suit. + */ entry=kmalloc(sizeof(struct rif_cache_s),GFP_ATOMIC); - if(!entry) { - printk("tr.c: Couldn't malloc rif cache entry !\n"); + + if(!entry) + { + printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n"); return; } - entry->rcf=trh->rcf; - memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); + + if (rii_p) + { + entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); + memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); + entry->local_ring = 0; + } + else + { + entry->local_ring = 1; + } + memcpy(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN); + memcpy(&(entry->iface[0]),dev->name,5); entry->next=rif_table[hash]; entry->last_used=jiffies; rif_table[hash]=entry; - } -/* Y. Tahara added */ - else { - if ( entry->rcf != trh->rcf ) { - if (!(trh->rcf & htons(TR_RCF_BROADCAST_MASK))) { -#if 0 + } + else /* Y. Tahara added */ + { + /* + * Update existing entries + */ + if (!entry->local_ring) + if (entry->rcf != (trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK)) && + !(trh->rcf & htons(TR_RCF_BROADCAST_MASK))) + { +#if TR_SR_DEBUG printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", trh->saddr[0],trh->saddr[1],trh->saddr[2], trh->saddr[3],trh->saddr[4],trh->saddr[5], - trh->rcf); + ntohs(trh->rcf)); #endif - entry->rcf = trh->rcf; + entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); - entry->last_used=jiffies; - } - } + } + entry->last_used=jiffies; } - } -static void rif_check_expire(unsigned long dummy) { +/* + * Scan the cache with a timer and see what we need to throw out. + */ +static void rif_check_expire(unsigned long dummy) +{ int i; unsigned long now=jiffies,flags; save_flags(flags); cli(); - for(i=0; i < RIF_TABLE_SIZE;i++) { - - rif_cache entry, *pentry=rif_table+i; - + for(i=0; i < RIF_TABLE_SIZE;i++) + { + rif_cache entry, *pentry=rif_table+i; while((entry=*pentry)) - if((now-entry->last_used) > RIF_TIMEOUT) { + { + /* + * Out it goes + */ + if((now-entry->last_used) > sysctl_tr_rif_timeout) + { *pentry=entry->next; kfree_s(entry,sizeof(struct rif_cache_s)); } else - pentry=&entry->next; + pentry=&entry->next; + } } restore_flags(flags); + /* + * Reset the timer + */ + del_timer(&rif_timer); - rif_timer.expires=jiffies+RIF_CHECK_INTERVAL; + rif_timer.expires = jiffies + sysctl_tr_rif_timeout; add_timer(&rif_timer); } -int rif_get_info(char *buffer,char **start, off_t offset, int length) { - - int len=0; - off_t begin=0; - off_t pos=0; - int size,i; +/* + * Generate the /proc/net information for the token ring RIF + * routing. + */ + +#ifdef CONFIG_PROC_FS +int rif_get_info(char *buffer,char **start, off_t offset, int length, int dummy) +{ + int len=0; + off_t begin=0; + off_t pos=0; + int size,i,j,rcf_len; + unsigned long now=jiffies; - rif_cache entry; + rif_cache entry; size=sprintf(buffer, -" TR address rcf routing segments TTL\n\n"); - pos+=size; - len+=size; + "if TR address TTL rcf routing segments\n\n"); + pos+=size; + len+=size; - for(i=0;i < RIF_TABLE_SIZE;i++) { + for(i=0;i < RIF_TABLE_SIZE;i++) + { for(entry=rif_table[i];entry;entry=entry->next) { - size=sprintf(buffer+len,"%02X:%02X:%02X:%02X:%02X:%02X %04X %04X %04X %04X %04X %04X %04X %04X %04X %lu\n", - entry->addr[0],entry->addr[1],entry->addr[2],entry->addr[3],entry->addr[4],entry->addr[5], - entry->rcf,entry->rseg[0],entry->rseg[1],entry->rseg[2],entry->rseg[3], - entry->rseg[4],entry->rseg[5],entry->rseg[6],entry->rseg[7],jiffies-entry->last_used); + size=sprintf(buffer+len,"%s %02X:%02X:%02X:%02X:%02X:%02X %7li ", + entry->iface,entry->addr[0],entry->addr[1],entry->addr[2],entry->addr[3],entry->addr[4],entry->addr[5], + sysctl_tr_rif_timeout-(now-entry->last_used)); + len+=size; + pos=begin+len; + if (entry->local_ring) + size=sprintf(buffer+len,"local\n"); + else { + size=sprintf(buffer+len,"%04X", ntohs(entry->rcf)); + rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2; + if (rcf_len) + rcf_len >>= 1; + for(j = 0; j < rcf_len; j++) { + len+=size; + pos=begin+len; + size=sprintf(buffer+len," %04X",ntohs(entry->rseg[j])); + } + len+=size; + pos=begin+len; + size=sprintf(buffer+len,"\n"); + } len+=size; pos=begin+len; - if(pos<offset) { + if(pos<offset) + { len=0; begin=pos; } if(pos>offset+length) break; - } + } if(pos>offset+length) break; } - *start=buffer+(offset-begin); /* Start of wanted data */ - len-=(offset-begin); /* Start slop */ - if(len>length) - len=length; /* Ending slop */ - return len; + *start=buffer+(offset-begin); /* Start of wanted data */ + len-=(offset-begin); /* Start slop */ + if(len>length) + len=length; /* Ending slop */ + return len; } +#endif -void rif_init(struct net_proto *unused) { +/* + * Called during bootup. We don't actually have to initialise + * too much for this. + */ + +void rif_init(struct net_proto *unused) +{ + rif_timer.expires = RIF_TIMEOUT; + rif_timer.data = 0L; + rif_timer.function = rif_check_expire; + init_timer(&rif_timer); add_timer(&rif_timer); +#ifdef CONFIG_PROC_FS + proc_net_register(&(struct proc_dir_entry) { + PROC_NET_TR_RIF, 6, "tr_rif", + S_IFREG | S_IRUGO, 1, 0, 0, + 0, &proc_net_inode_operations, + rif_get_info + }); +#endif } - diff --git a/net/802/transit/Makefile b/net/802/transit/Makefile new file mode 100644 index 000000000..d2e2e5de4 --- /dev/null +++ b/net/802/transit/Makefile @@ -0,0 +1,13 @@ +all: pdutr.h timertr.h + +pdutr.h: pdutr.pre compile.awk + awk -f ./compile.awk pdutr.pre > pdutr.h + +timertr.h: timertr.pre compile.awk + awk -f ./compile.awk timertr.pre > timertr.h + +clean: + touch pdutr.h timertr.h + rm pdutr.h timertr.h + + diff --git a/net/802/transit/compile.awk b/net/802/transit/compile.awk new file mode 100644 index 000000000..1b3b56c37 --- /dev/null +++ b/net/802/transit/compile.awk @@ -0,0 +1,81 @@ +# 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 +} diff --git a/net/802/transit/pdutr.h b/net/802/transit/pdutr.h new file mode 100644 index 000000000..55a65001d --- /dev/null +++ b/net/802/transit/pdutr.h @@ -0,0 +1,309 @@ + +/* this file was generated on Thu Dec 5 13:58:11 GMT 1996 */ + +/* index name #defines: */ + +#define ADM 0 +#define CONN 1 +#define RESET_WAIT 2 +#define RESET_CHECK 3 +#define SETUP 4 +#define RESET 5 +#define D_CONN 6 +#define ERROR 7 +#define NORMAL 8 +#define BUSY 9 +#define REJECT 10 +#define AWAIT 11 +#define AWAIT_BUSY 12 +#define AWAIT_REJECT 13 + + +/* size of transition table is 1684 bytes */ + +static short int pdutr_offset [ ] ={ + 0, 54, 82, 110, 138, 192, 246, 300, 328, 554, + 780, 1006, 1232, 1458 }; + +static char pdutr_entry [ ] = { + ADM5 , ADM , ADM4 , ADM , ADM5 , ADM , + ADM4 , ADM , ADM5 , ADM , ADM4 , ADM , + ADM5 , ADM , ADM4 , ADM , ADM3 , ADM , + ADM3 , ADM , ADM2 , CONN , ADM2 , CONN , + ADM5 , ADM , ADM5 , ADM , ADM5 , ADM , + ADM5 , ADM , ADM5 , ADM , ADM5 , ADM , + ADM5 , ADM , ADM5 , ADM , ADM5 , ADM , + ADM5 , ADM , ADM5 , ADM , ADM5 , ADM , + ADM5 , ADM , ADM5 , ADM , ADM5 , ADM , + CONN5 , CONN , CONN5 , CONN , CONN5 , CONN , + CONN5 , CONN , CONN5 , CONN , CONN3 , CONN , + CONN5 , CONN , CONN5 , CONN , CONN5 , CONN , + CONN5 , CONN , CONN5 , CONN , CONN4 , ADM , + CONN5 , CONN , CONN5 , CONN , RESWAIT8 , RESET_WAIT , + RESWAIT8 , RESET_WAIT , RESWAIT8 , RESET_WAIT , RESWAIT8 , RESET_WAIT , + RESWAIT7 , RESET_WAIT , RESWAIT6 , RESET_WAIT , RESWAIT8 , RESET_WAIT , + RESWAIT8 , RESET_WAIT , RESWAIT8 , RESET_WAIT , RESWAIT8 , RESET_WAIT , + RESWAIT8 , RESET_WAIT , RESWAIT5 , ADM , RESWAIT8 , RESET_WAIT , + RESWAIT8 , RESET_WAIT , RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , + RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , RESCHK5 , ADM , + RESCHK4 , RESET_CHECK , RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , + RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , + RESCHK3 , ADM , RESCHK6 , RESET_CHECK , RESCHK6 , RESET_CHECK , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP4 , ADM , + SETUP4 , ADM , SETUP1 , SETUP , SETUP1 , SETUP , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + SETUP2 , NORMAL , SETUP5 , ADM , SETUP5 , ADM , + SETUP6 , SETUP , SETUP6 , SETUP , SETUP6 , SETUP , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + RESET6 , RESET , RESET6 , RESET , RESET4 , ADM , + RESET4 , ADM , RESET1 , RESET , RESET1 , RESET , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + RESET2 , NORMAL , RESET5 , ADM , RESET5 , ADM , + RESET6 , RESET , RESET6 , RESET , RESET6 , RESET , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN3 , D_CONN , + D_CONN3 , D_CONN , D_CONN1 , ADM , D_CONN1 , ADM , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + D_CONN4 , ADM , D_CONN4 , ADM , D_CONN5 , ADM , + D_CONN5 , D_CONN , D_CONN5 , D_CONN , D_CONN5 , D_CONN , + ERR5 , ERROR , ERR5 , ERROR , ERR5 , ERROR , + ERR5 , ERROR , ERR2 , ADM , ERR1 , RESET_CHECK , + ERR6 , ERROR , ERR6 , ERROR , ERR6 , ERROR , + ERR6 , ERROR , ERR6 , ERROR , ERR3 , ADM , + ERR4 , RESET_WAIT , ERR4 , RESET_WAIT , NORMAL8B , NORMAL , + NORMAL9 , NORMAL , NORMAL10 , NORMAL , NORMAL10 , NORMAL , + NORMAL5 , REJECT , NORMAL6 , REJECT , NORMAL7 , REJECT , + NORMAL7 , REJECT , NORMAL11 , NORMAL , NORMAL11 , NORMAL , + NORMAL12 , NORMAL , NORMAL12 , NORMAL , NORMAL11 , NORMAL , + NORMAL11 , NORMAL , NORMAL12 , NORMAL , NORMAL12 , NORMAL , + NORMAL13 , NORMAL , NORMAL13 , NORMAL , NORMAL14 , NORMAL , + NORMAL14 , NORMAL , NORMAL13 , NORMAL , NORMAL13 , NORMAL , + NORMAL14 , NORMAL , NORMAL14 , NORMAL , NORMAL15 , NORMAL , + NORMAL16 , NORMAL , NORMAL17 , NORMAL , NORMAL17 , NORMAL , + NORMAL15 , NORMAL , NORMAL16 , NORMAL , NORMAL17 , NORMAL , + NORMAL17 , NORMAL , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , NORMAL8B , NORMAL , + NORMAL9 , NORMAL , SH10 , ERROR , NORMAL8A , NORMAL , + NORMAL5 , REJECT , NORMAL6 , REJECT , SH10 , ERROR , + NORMAL5 , REJECT , NORMAL11 , NORMAL , NORMAL11 , NORMAL , + SH10 , ERROR , NORMAL11 , NORMAL , NORMAL11 , NORMAL , + NORMAL11 , NORMAL , SH10 , ERROR , NORMAL11 , NORMAL , + NORMAL13 , NORMAL , NORMAL13 , NORMAL , SH10 , ERROR , + NORMAL13 , NORMAL , NORMAL13 , NORMAL , NORMAL13 , NORMAL , + SH10 , ERROR , NORMAL13 , NORMAL , NORMAL15 , NORMAL , + NORMAL16 , NORMAL , SH10 , ERROR , NORMAL15 , NORMAL , + NORMAL15 , NORMAL , NORMAL16 , NORMAL , SH10 , ERROR , + NORMAL15 , NORMAL , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , BUSY13 , BUSY , BUSY14 , BUSY , + BUSY12 , BUSY , BUSY12 , BUSY , BUSY9 , BUSY , + BUSY10 , BUSY , BUSY11 , BUSY , BUSY11 , BUSY , + BUSY15 , BUSY , BUSY15 , BUSY , BUSY16 , BUSY , + BUSY16 , BUSY , BUSY15 , BUSY , BUSY15 , BUSY , + BUSY16 , BUSY , BUSY16 , BUSY , BUSY17 , BUSY , + BUSY17 , BUSY , BUSY18 , BUSY , BUSY18 , BUSY , + BUSY17 , BUSY , BUSY17 , BUSY , BUSY18 , BUSY , + BUSY18 , BUSY , BUSY19 , BUSY , BUSY20 , BUSY , + BUSY21 , BUSY , BUSY21 , BUSY , BUSY19 , BUSY , + BUSY20 , BUSY , BUSY21 , BUSY , BUSY21 , BUSY , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , BUSY13 , BUSY , BUSY14 , BUSY , + SH10 , ERROR , BUSY13 , BUSY , BUSY9 , BUSY , + BUSY10 , BUSY , SH10 , ERROR , BUSY9 , BUSY , + BUSY15 , BUSY , BUSY15 , BUSY , SH10 , ERROR , + BUSY15 , BUSY , BUSY15 , BUSY , BUSY15 , BUSY , + SH10 , ERROR , BUSY15 , BUSY , BUSY17 , BUSY , + BUSY17 , BUSY , SH10 , ERROR , BUSY17 , BUSY , + BUSY17 , BUSY , BUSY17 , BUSY , SH10 , ERROR , + BUSY17 , BUSY , BUSY19 , BUSY , BUSY20 , BUSY , + SH10 , ERROR , BUSY19 , BUSY , BUSY19 , BUSY , + BUSY20 , BUSY , SH10 , ERROR , BUSY19 , BUSY , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + REJECT7 , REJECT , REJECT8 , REJECT , REJECT9 , REJECT , + REJECT9 , REJECT , REJECT5 , REJECT , REJECT5 , REJECT , + REJECT6 , REJECT , REJECT6 , REJECT , REJECT10 , REJECT , + REJECT10 , REJECT , REJECT11 , REJECT , REJECT11 , REJECT , + REJECT10 , REJECT , REJECT10 , REJECT , REJECT11 , REJECT , + REJECT11 , REJECT , REJECT12 , REJECT , REJECT12 , REJECT , + REJECT13 , REJECT , REJECT13 , REJECT , REJECT12 , REJECT , + REJECT12 , REJECT , REJECT13 , REJECT , REJECT13 , REJECT , + REJECT14 , REJECT , REJECT15 , REJECT , REJECT16 , REJECT , + REJECT16 , REJECT , REJECT14 , REJECT , REJECT15 , REJECT , + REJECT16 , REJECT , REJECT16 , REJECT , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + REJECT7 , REJECT , REJECT8 , REJECT , SH10 , ERROR , + REJECT7 , REJECT , REJECT5 , REJECT , REJECT5 , REJECT , + SH10 , ERROR , REJECT5 , REJECT , REJECT10 , REJECT , + REJECT10 , REJECT , SH10 , ERROR , REJECT10 , REJECT , + REJECT10 , REJECT , REJECT10 , REJECT , SH10 , ERROR , + REJECT10 , REJECT , REJECT12 , REJECT , REJECT12 , REJECT , + SH10 , ERROR , REJECT12 , REJECT , REJECT12 , REJECT , + REJECT12 , REJECT , SH10 , ERROR , REJECT12 , REJECT , + REJECT14 , REJECT , REJECT15 , REJECT , SH10 , ERROR , + REJECT14 , REJECT , REJECT14 , REJECT , REJECT15 , REJECT , + SH10 , ERROR , REJECT14 , REJECT , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , AWAIT6 , AWAIT , + AWAIT6 , AWAIT , AWAIT7 , AWAIT , AWAIT7 , AWAIT , + AWAIT3 , AWAIT_REJECT , AWAIT3 , AWAIT_REJECT , AWAIT4 , AWAIT_REJECT , + AWAIT4 , AWAIT_REJECT , AWAIT9 , AWAIT , AWAIT9 , AWAIT , + AWAIT10 , AWAIT , AWAIT10 , AWAIT , AWAIT9 , AWAIT , + AWAIT9 , AWAIT , AWAIT10 , AWAIT , AWAIT10 , AWAIT , + AWAIT12 , AWAIT , AWAIT12 , AWAIT , AWAIT13 , AWAIT , + AWAIT13 , AWAIT , AWAIT12 , AWAIT , AWAIT12 , AWAIT , + AWAIT13 , AWAIT , AWAIT13 , AWAIT , AWAIT9 , AWAIT , + AWAIT9 , AWAIT , AWAIT10 , AWAIT , AWAIT10 , AWAIT , + AWAIT9 , AWAIT , AWAIT9 , AWAIT , AWAIT10 , AWAIT , + AWAIT10 , AWAIT , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , AWAIT6 , AWAIT , + AWAIT6 , AWAIT , SH10 , ERROR , AWAIT5 , NORMAL , + AWAIT3 , AWAIT_REJECT , AWAIT3 , AWAIT_REJECT , SH10 , ERROR , + AWAIT2 , REJECT , AWAIT9 , AWAIT , AWAIT9 , AWAIT , + SH10 , ERROR , AWAIT8 , AWAIT , AWAIT9 , AWAIT , + AWAIT9 , AWAIT , SH10 , ERROR , AWAIT8 , AWAIT , + AWAIT12 , AWAIT , AWAIT12 , AWAIT , SH10 , ERROR , + AWAIT11 , AWAIT , AWAIT12 , AWAIT , AWAIT12 , AWAIT , + SH10 , ERROR , AWAIT11 , AWAIT , AWAIT9 , AWAIT , + AWAIT9 , AWAIT , SH10 , ERROR , AWAIT8 , AWAIT , + AWAIT9 , AWAIT , AWAIT9 , AWAIT , SH10 , ERROR , + AWAIT8 , AWAIT , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , AWAIT_BUSY8 , AWAIT_BUSY , AWAIT_BUSY8 , AWAIT_BUSY , + AWAIT_BUSY9 , AWAIT_BUSY , AWAIT_BUSY9 , AWAIT_BUSY , AWAIT_BUSY5 , AWAIT_BUSY , + AWAIT_BUSY5 , AWAIT_BUSY , AWAIT_BUSY6 , AWAIT_BUSY , AWAIT_BUSY6 , AWAIT_BUSY , + AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY12 , AWAIT_BUSY , + AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY14 , AWAIT_BUSY , + AWAIT_BUSY14 , AWAIT_BUSY , AWAIT_BUSY15 , AWAIT_BUSY , AWAIT_BUSY15 , AWAIT_BUSY , + AWAIT_BUSY14 , AWAIT_BUSY , AWAIT_BUSY14 , AWAIT_BUSY , AWAIT_BUSY15 , AWAIT_BUSY , + AWAIT_BUSY15 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY12 , AWAIT_BUSY , AWAIT_BUSY12 , AWAIT_BUSY , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , AWAIT_BUSY8 , AWAIT_BUSY , AWAIT_BUSY8 , AWAIT_BUSY , + SH10 , ERROR , AWAIT_BUSY7 , BUSY , AWAIT_BUSY5 , AWAIT_BUSY , + AWAIT_BUSY5 , AWAIT_BUSY , SH10 , ERROR , AWAIT_BUSY4 , BUSY , + AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , SH10 , ERROR , + AWAIT_BUSY10 , BUSY , AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + SH10 , ERROR , AWAIT_BUSY10 , BUSY , AWAIT_BUSY14 , AWAIT_BUSY , + AWAIT_BUSY14 , AWAIT_BUSY , SH10 , ERROR , AWAIT_BUSY13 , BUSY , + AWAIT_BUSY14 , AWAIT_BUSY , AWAIT_BUSY14 , AWAIT_BUSY , SH10 , ERROR , + AWAIT_BUSY13 , BUSY , AWAIT_BUSY11 , AWAIT_BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + SH10 , ERROR , AWAIT_BUSY10 , BUSY , AWAIT_BUSY11 , AWAIT_BUSY , + AWAIT_BUSY11 , AWAIT_BUSY , SH10 , ERROR , AWAIT_BUSY10 , BUSY , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + AWAIT_REJECT5 , AWAIT , AWAIT_REJECT5 , AWAIT , AWAIT_REJECT6 , AWAIT , + AWAIT_REJECT6 , AWAIT , AWAIT_REJECT2 , AWAIT_REJECT , AWAIT_REJECT2 , AWAIT_REJECT , + AWAIT_REJECT3 , AWAIT_REJECT , AWAIT_REJECT3 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT9 , AWAIT_REJECT , AWAIT_REJECT9 , AWAIT_REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT9 , AWAIT_REJECT , + AWAIT_REJECT9 , AWAIT_REJECT , AWAIT_REJECT11, AWAIT_REJECT , AWAIT_REJECT11, AWAIT_REJECT , + AWAIT_REJECT12, AWAIT_REJECT , AWAIT_REJECT12, AWAIT_REJECT , AWAIT_REJECT11, AWAIT_REJECT , + AWAIT_REJECT11, AWAIT_REJECT , AWAIT_REJECT12, AWAIT_REJECT , AWAIT_REJECT12, AWAIT_REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT9 , AWAIT_REJECT , + AWAIT_REJECT9 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , + AWAIT_REJECT9 , AWAIT_REJECT , AWAIT_REJECT9 , AWAIT_REJECT , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH4 , ADM , SH4 , ADM , + SH4 , ADM , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + SH3 , RESET_CHECK , SH3 , RESET_CHECK , SH3 , RESET_CHECK , + AWAIT_REJECT5 , AWAIT , AWAIT_REJECT5 , AWAIT , SH10 , ERROR , + AWAIT_REJECT4 , NORMAL , AWAIT_REJECT2 , AWAIT_REJECT , AWAIT_REJECT2 , AWAIT_REJECT , + SH10 , ERROR , AWAIT_REJECT4 , NORMAL , AWAIT_REJECT8 , AWAIT_REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , SH10 , ERROR , AWAIT_REJECT7 , REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , SH10 , ERROR , + AWAIT_REJECT7 , REJECT , AWAIT_REJECT11, AWAIT_REJECT , AWAIT_REJECT11, AWAIT_REJECT , + SH10 , ERROR , AWAIT_REJECT10, REJECT , AWAIT_REJECT11, AWAIT_REJECT , + AWAIT_REJECT11, AWAIT_REJECT , SH10 , ERROR , AWAIT_REJECT10, REJECT , + AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , SH10 , ERROR , + AWAIT_REJECT7 , REJECT , AWAIT_REJECT8 , AWAIT_REJECT , AWAIT_REJECT8 , AWAIT_REJECT , + SH10 , ERROR , AWAIT_REJECT7 , REJECT , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH9 , ERROR , SH9 , ERROR , + SH9 , ERROR , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH6 , ADM , SH6 , ADM , SH6 , ADM , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH5 , RESET_WAIT , + SH5 , RESET_WAIT , SH5 , RESET_WAIT , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR , SH7 , ERROR , + SH7 , ERROR , SH7 , ERROR }; diff --git a/net/802/transit/pdutr.pre b/net/802/transit/pdutr.pre new file mode 100644 index 000000000..0e74987ac --- /dev/null +++ b/net/802/transit/pdutr.pre @@ -0,0 +1,1121 @@ +COMPILE pdutr INDEX +; +; Transition tables for incomming 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 diff --git a/net/802/transit/timertr.h b/net/802/transit/timertr.h new file mode 100644 index 000000000..9b9403b5a --- /dev/null +++ b/net/802/transit/timertr.h @@ -0,0 +1,157 @@ + +/* this file was generated on Mon Mar 10 22:45:36 GMT 1997 */ + + +/* size of transition table is 898 bytes */ + +static char timertr_entry [ ] = { + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , ADM , + NOP , ADM , NOP , ADM , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , CONN , NOP , CONN , + NOP , CONN , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_WAIT , NOP , RESET_WAIT , NOP , RESET_WAIT , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , NOP , RESET_CHECK , + NOP , RESET_CHECK , NOP , RESET_CHECK , SETUP7 , SETUP , + SETUP7 , SETUP , SETUP3 , NORMAL , SETUP3 , NORMAL , + SETUP8 , ADM , SETUP8 , ADM , SETUP3 , NORMAL , + SETUP3 , NORMAL , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , NOP , SETUP , NOP , SETUP , + NOP , SETUP , RESET7 , RESET , RESET7 , RESET , + RESET3 , NORMAL , RESET3 , NORMAL , RESET8 , ADM , + RESET8 , ADM , RESET3 , NORMAL , RESET3 , NORMAL , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + NOP , RESET , NOP , RESET , NOP , RESET , + D_CONN6 , D_CONN , D_CONN6 , D_CONN , D_CONN6 , D_CONN , + D_CONN6 , D_CONN , D_CONN7 , ADM , D_CONN7 , ADM , + D_CONN7 , ADM , D_CONN7 , ADM , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , NOP , D_CONN , + NOP , D_CONN , NOP , D_CONN , ERR7 , ERROR , + ERR7 , ERROR , ERR7 , ERROR , ERR7 , ERROR , + ERR8 , RESET_WAIT , ERR8 , RESET_WAIT , ERR8 , RESET_WAIT , + ERR8 , RESET_WAIT , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NOP , ERROR , NOP , ERROR , + NOP , ERROR , NORMAL20 , AWAIT , NOP , NORMAL , + NORMAL20 , AWAIT , NOP , NORMAL , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NORMAL19 , NORMAL , NORMAL19 , NORMAL , NORMAL19 , NORMAL , + NORMAL19 , NORMAL , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , NORMAL , + NOP , NORMAL , NOP , NORMAL , NOP , NORMAL , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NORMAL20 , AWAIT , NOP , NORMAL , + NORMAL20 , AWAIT , NOP , NORMAL , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + BUSY24 , AWAIT_BUSY , NOP , BUSY , BUSY24 , AWAIT_BUSY , + NOP , BUSY , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , BUSY23 , BUSY , + BUSY23 , BUSY , BUSY23 , BUSY , BUSY23 , BUSY , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , BUSY25 , BUSY , BUSY26 , BUSY , + BUSY25 , BUSY , BUSY26 , BUSY , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , BUSY , NOP , BUSY , NOP , BUSY , + NOP , BUSY , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , REJECT , + NOP , REJECT , NOP , REJECT , NOP , REJECT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NOP , REJECT , NOP , REJECT , + NOP , REJECT , NOP , REJECT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , REJECT , NOP , REJECT , NOP , REJECT , + NOP , REJECT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , REJECT , + NOP , REJECT , NOP , REJECT , NOP , REJECT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NOP , AWAIT , NOP , AWAIT , + NOP , AWAIT , NOP , AWAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , AWAIT , NOP , AWAIT , NOP , AWAIT , + NOP , AWAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , AWAIT , + NOP , AWAIT , NOP , AWAIT , NOP , AWAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NOP , AWAIT , NOP , AWAIT , + NOP , AWAIT , NOP , AWAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , + NOP , AWAIT_BUSY , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , AWAIT_BUSY , + NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , + NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , NOP , AWAIT_BUSY , + NOP , AWAIT_BUSY , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , AWAIT_REJECT , + NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , + NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , + NOP , AWAIT_REJECT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , NOP , AWAIT_REJECT , + NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , NOP , AWAIT_REJECT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT , SH11 , RESET_WAIT , + SH11 , RESET_WAIT , SH11 , RESET_WAIT }; diff --git a/net/802/transit/timertr.pre b/net/802/transit/timertr.pre new file mode 100644 index 000000000..f082912dd --- /dev/null +++ b/net/802/transit/timertr.pre @@ -0,0 +1,527 @@ +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 +;; |