summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer2
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2000-10-09 13:18:17 +0000
committerhm <hm@FreeBSD.org>2000-10-09 13:18:17 +0000
commit9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb (patch)
treeca1e99e8eac9fd3f8c8cecbcbfc102b0bfa6f03f /sys/i4b/layer2
parent7fc1fa165474e47dca5d7dfb2584d97d169d686d (diff)
downloadFreeBSD-src-9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb.zip
FreeBSD-src-9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb.tar.gz
update to i4b version 0.95.04
Diffstat (limited to 'sys/i4b/layer2')
-rw-r--r--sys/i4b/layer2/i4b_iframe.c35
-rw-r--r--sys/i4b/layer2/i4b_l2.c68
-rw-r--r--sys/i4b/layer2/i4b_l2.h13
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.c171
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.h6
-rw-r--r--sys/i4b/layer2/i4b_l2timer.c99
-rw-r--r--sys/i4b/layer2/i4b_lme.c25
-rw-r--r--sys/i4b/layer2/i4b_mbuf.c13
-rw-r--r--sys/i4b/layer2/i4b_sframe.c35
-rw-r--r--sys/i4b/layer2/i4b_tei.c51
-rw-r--r--sys/i4b/layer2/i4b_uframe.c45
-rw-r--r--sys/i4b/layer2/i4b_util.c41
12 files changed, 286 insertions, 316 deletions
diff --git a/sys/i4b/layer2/i4b_iframe.c b/sys/i4b/layer2/i4b_iframe.c
index 5c4851d..aedd2a0 100644
--- a/sys/i4b/layer2/i4b_iframe.c
+++ b/sys/i4b/layer2/i4b_iframe.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_iframe.c - i frame handling routines
* ------------------------------------------
*
- * $Id: i4b_iframe.c,v 1.22 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_iframe.c,v 1.25 2000/08/24 11:48:57 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:16 1999]
+ * last edit-date: [Thu Aug 24 12:49:18 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,18 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -98,7 +96,7 @@ i4b_rxd_i_frame(int unit, struct mbuf *m)
if((l2sc->Q921_state != ST_MULTIFR) && (l2sc->Q921_state != ST_TIMREC))
{
i4b_Dfreembuf(m);
- DBGL2(L2_I_ERR, "i4b_rxd_i_frame", ("ERROR, state != (MF || TR)!\n"));
+ NDBGL2(L2_I_ERR, "ERROR, state != (MF || TR)!");
return;
}
@@ -223,12 +221,12 @@ i4b_i_frame_queued_up(l2_softc_t *l2sc)
{
if(l2sc->peer_busy)
{
- DBGL2(L2_I_MSG, "i4b_i_frame_queued_up", ("regen IFQUP, cause: peer busy!\n"));
+ NDBGL2(L2_I_MSG, "regen IFQUP, cause: peer busy!");
}
if(l2sc->vs == ((l2sc->va + MAX_K_VALUE) & 127))
{
- DBGL2(L2_I_MSG, "i4b_i_frame_queued_up", ("regen IFQUP, cause: vs=va+k!\n"));
+ NDBGL2(L2_I_MSG, "regen IFQUP, cause: vs=va+k!");
}
/*
@@ -238,13 +236,8 @@ i4b_i_frame_queued_up(l2_softc_t *l2sc)
if(!(IF_QEMPTY(&l2sc->i_queue)))
{
- DBGL2(L2_I_MSG, "i4b_i_frame_queued_up", ("re-scheduling IFQU call!\n"));
-
-#if defined(__FreeBSD__)
- l2sc->IFQU_callout = timeout((TIMEOUT_FUNC_T)i4b_i_frame_queued_up, (void *)l2sc, IFQU_DLY);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_i_frame_queued_up, (void *)l2sc, IFQU_DLY);
-#endif
+ NDBGL2(L2_I_MSG, "re-scheduling IFQU call!");
+ START_TIMER(l2sc->IFQU_callout, i4b_i_frame_queued_up, l2sc, IFQU_DLY);
}
CRIT_END;
return;
@@ -254,7 +247,7 @@ i4b_i_frame_queued_up(l2_softc_t *l2sc)
if(!m)
{
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, mbuf NULL after IF_DEQUEUE\n"));
+ NDBGL2(L2_I_ERR, "ERROR, mbuf NULL after IF_DEQUEUE");
CRIT_END;
return;
}
@@ -275,7 +268,7 @@ i4b_i_frame_queued_up(l2_softc_t *l2sc)
if(l2sc->ua_num != UA_EMPTY) /* failsafe */
{
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, l2sc->ua_num: %d != UA_EMPTY\n", l2sc->ua_num));
+ NDBGL2(L2_I_ERR, "ERROR, l2sc->ua_num: %d != UA_EMPTY", l2sc->ua_num);
i4b_print_l2var(l2sc);
i4b_Dfreembuf(l2sc->ua_frame);
}
diff --git a/sys/i4b/layer2/i4b_l2.c b/sys/i4b/layer2/i4b_l2.c
index 9ecbe41..6f76196 100644
--- a/sys/i4b/layer2/i4b_l2.c
+++ b/sys/i4b/layer2/i4b_l2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2.c - ISDN layer 2 (Q.921)
* -------------------------------
*
- * $Id: i4b_l2.c,v 1.30 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2.c,v 1.35 2000/08/24 11:48:57 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:23 1999]
+ * last edit-date: [Thu Aug 24 13:40:35 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -78,11 +77,10 @@ int i4b_dl_release_cnf(int);
int i4b_dl_data_ind(int, struct mbuf *);
int i4b_dl_unit_data_ind(int, struct mbuf *);
-static int i4b_mdl_command_req(int, int, int);
+static int i4b_mdl_command_req(int, int, void *);
/* from layer 2 */
-extern int i4b_mdl_attach_ind(int, int);
extern int i4b_mdl_status_ind(int, int, int);
/* this layers debug level */
@@ -113,7 +111,7 @@ struct i4b_l2l3_func i4b_l2l3_func = {
/* Layer 3 --> Layer 2 management */
- (int (*)(int, int, int)) i4b_mdl_command_req
+ (int (*)(int, int, void *)) i4b_mdl_command_req
};
/*---------------------------------------------------------------------------*
@@ -123,7 +121,7 @@ int i4b_dl_establish_req(int unit)
{
l2_softc_t *l2sc = &l2_softc[unit];
- DBGL2(L2_PRIM, "DL-ESTABLISH-REQ", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "unit %d",unit);
i4b_l1_activate(l2sc);
i4b_next_l2state(l2sc, EV_DLESTRQ);
return(0);
@@ -136,7 +134,7 @@ int i4b_dl_release_req(int unit)
{
l2_softc_t *l2sc = &l2_softc[unit];
- DBGL2(L2_PRIM, "DL-RELEASE-REQ", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "unit %d",unit);
i4b_next_l2state(l2sc, EV_DLRELRQ);
return(0);
}
@@ -147,7 +145,7 @@ int i4b_dl_release_req(int unit)
int i4b_dl_unit_data_req(int unit, struct mbuf *m)
{
#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-REQ", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "unit %d",unit);
#endif
return(0);
}
@@ -160,7 +158,7 @@ int i4b_dl_data_req(int unit, struct mbuf *m)
l2_softc_t *l2sc = &l2_softc[unit];
#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-REQ", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "unit %d",unit);
#endif
switch(l2sc->Q921_state)
{
@@ -170,7 +168,7 @@ int i4b_dl_data_req(int unit, struct mbuf *m)
if(IF_QFULL(&l2sc->i_queue))
{
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("i_queue full!!\n"));
+ NDBGL2(L2_ERROR, "i_queue full!!");
i4b_Dfreembuf(m);
}
else
@@ -186,7 +184,7 @@ int i4b_dl_data_req(int unit, struct mbuf *m)
break;
default:
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("unit %d ERROR in state [%s], freeing mbuf\n", unit, i4b_print_l2state(l2sc)));
+ NDBGL2(L2_ERROR, "unit %d ERROR in state [%s], freeing mbuf", unit, i4b_print_l2state(l2sc));
i4b_Dfreembuf(m);
break;
}
@@ -201,7 +199,7 @@ i4b_ph_activate_ind(int unit)
{
l2_softc_t *l2sc = &l2_softc[unit];
- DBGL1(L1_PRIM, "PH-ACTIVATE-IND", ("unit %d\n",unit));
+ NDBGL1(L1_PRIM, "unit %d",unit);
l2sc->ph_active = PH_ACTIVE;
return(0);
}
@@ -214,7 +212,7 @@ i4b_ph_deactivate_ind(int unit)
{
l2_softc_t *l2sc = &l2_softc[unit];
- DBGL1(L1_PRIM, "PH-DEACTIVATE-IND", ("unit %d\n",unit));
+ NDBGL1(L1_PRIM, "unit %d",unit);
l2sc->ph_active = PH_INACTIVE;
return(0);
}
@@ -275,7 +273,7 @@ i4b_mph_status_ind(int unit, int status, int parm)
CRIT_BEG;
- DBGL1(L1_PRIM, "MPH-STATUS-IND", ("unit %d, status=%d, parm=%d\n", unit, status, parm));
+ NDBGL1(L1_PRIM, "unit %d, status=%d, parm=%d", unit, status, parm);
switch(status)
{
@@ -293,6 +291,14 @@ i4b_mph_status_ind(int unit, int status, int parm)
callout_handle_init(&l2sc->T203_callout);
callout_handle_init(&l2sc->IFQU_callout);
#endif
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+ /* initialize the callout handles for timeout routines */
+ callout_init(&l2sc->T200_callout);
+ callout_init(&l2sc->T202_callout);
+ callout_init(&l2sc->T203_callout);
+ callout_init(&l2sc->IFQU_callout);
+#endif
+
break;
case STI_L1STAT: /* state of layer 1 */
@@ -302,7 +308,7 @@ i4b_mph_status_ind(int unit, int status, int parm)
/*XXX*/ if((l2sc->Q921_state >= ST_AW_EST) &&
(l2sc->Q921_state <= ST_TIMREC))
{
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, persistent deactivation!\n", unit));
+ NDBGL2(L2_ERROR, "unit %d, persistent deactivation!", unit);
i4b_l2_unit_init(unit);
}
else
@@ -313,11 +319,11 @@ i4b_mph_status_ind(int unit, int status, int parm)
case STI_NOL1ACC:
i4b_l2_unit_init(unit);
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, cannot access S0 bus!\n", unit));
+ NDBGL2(L2_ERROR, "unit %d, cannot access S0 bus!", unit);
break;
default:
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("ERROR, unit %d, unknown status message!\n", unit));
+ NDBGL2(L2_ERROR, "ERROR, unit %d, unknown status message!", unit);
break;
}
@@ -332,9 +338,9 @@ i4b_mph_status_ind(int unit, int status, int parm)
/*---------------------------------------------------------------------------*
* MDL_COMMAND_REQ from layer 3
*---------------------------------------------------------------------------*/
-int i4b_mdl_command_req(int unit, int command, int parm)
+int i4b_mdl_command_req(int unit, int command, void * parm)
{
- DBGL2(L2_PRIM, "MDL-COMMAND-REQ", ("unit %d, command=%d, parm=%d\n", unit, command, parm));
+ NDBGL2(L2_PRIM, "unit %d, command=%d, parm=%d", unit, command, (unsigned int)parm);
switch(command)
{
@@ -356,7 +362,7 @@ i4b_ph_data_ind(int unit, struct mbuf *m)
{
l2_softc_t *l2sc = &l2_softc[unit];
#ifdef NOTDEF
- DBGL1(L1_PRIM, "PH-DATA-IND", ("unit %d\n", unit));
+ NDBGL1(L1_PRIM, "unit %d", unit);
#endif
u_char *ptr = m->m_data;
@@ -365,7 +371,7 @@ i4b_ph_data_ind(int unit, struct mbuf *m)
if(m->m_len < 4) /* 6 oct - 2 chksum oct */
{
l2sc->stat.err_rx_len++;
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, I-frame < 6 octetts!\n"));
+ NDBGL2(L2_ERROR, "ERROR, I-frame < 6 octetts!");
i4b_Dfreembuf(m);
return(0);
}
@@ -376,7 +382,7 @@ i4b_ph_data_ind(int unit, struct mbuf *m)
if(m->m_len < 4) /* 6 oct - 2 chksum oct */
{
l2sc->stat.err_rx_len++;
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, S-frame < 6 octetts!\n"));
+ NDBGL2(L2_ERROR, "ERROR, S-frame < 6 octetts!");
i4b_Dfreembuf(m);
return(0);
}
@@ -387,7 +393,7 @@ i4b_ph_data_ind(int unit, struct mbuf *m)
if(m->m_len < 3) /* 5 oct - 2 chksum oct */
{
l2sc->stat.err_rx_len++;
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, U-frame < 5 octetts!\n"));
+ NDBGL2(L2_ERROR, "ERROR, U-frame < 5 octetts!");
i4b_Dfreembuf(m);
return(0);
}
@@ -396,7 +402,7 @@ i4b_ph_data_ind(int unit, struct mbuf *m)
else
{
l2sc->stat.err_rx_badf++;
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, bad frame rx'd - "));
+ NDBGL2(L2_ERROR, "ERROR, bad frame rx'd - ");
i4b_print_frame(m->m_len, m->m_data);
i4b_Dfreembuf(m);
}
diff --git a/sys/i4b/layer2/i4b_l2.h b/sys/i4b/layer2/i4b_l2.h
index b00c386..5277a06 100644
--- a/sys/i4b/layer2/i4b_l2.h
+++ b/sys/i4b/layer2/i4b_l2.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2.h - ISDN layer 2 (Q.921) definitions
* ---------------------------------------------
*
- * $Id: i4b_l2.h,v 1.20 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2.h,v 1.23 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:29 1999]
+ * last edit-date: [Sat Mar 18 10:28:22 2000]
*
*---------------------------------------------------------------------------*/
@@ -69,6 +69,12 @@ typedef struct {
struct callout_handle T203_callout;
struct callout_handle IFQU_callout;
#endif
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+ struct callout T200_callout;
+ struct callout T202_callout;
+ struct callout T203_callout;
+ struct callout IFQU_callout;
+#endif
/*
* i4b_iframe.c, i4b_i_frame_queued_up(): value of IFQU_DLY
@@ -314,7 +320,6 @@ extern int i4b_l2_nr_ok ( int nr, int va, int vs );
extern void i4b_make_rand_ri ( l2_softc_t *l2sc );
extern void i4b_mdl_assign_ind ( l2_softc_t *l2sc );
extern void i4b_mdl_error_ind ( l2_softc_t *l2sc, char *where, int errorcode );
-extern int i4b_mph_attach_ind ( int unit, int type );
extern int i4b_mph_status_ind ( int unit, int status, int parm );
extern void i4b_next_l2state ( l2_softc_t *l2sc, int event );
extern void i4b_nr_error_recovery ( l2_softc_t *l2sc );
diff --git a/sys/i4b/layer2/i4b_l2fsm.c b/sys/i4b/layer2/i4b_l2fsm.c
index 9c6d513..51912ab 100644
--- a/sys/i4b/layer2/i4b_l2fsm.c
+++ b/sys/i4b/layer2/i4b_l2fsm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2fsm.c - layer 2 FSM
* -------------------------
*
- * $Id: i4b_l2fsm.c,v 1.17 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2fsm.c,v 1.22 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:36 1999]
+ * last edit-date: [Tue May 30 15:48:20 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -71,8 +70,9 @@
#include <i4b/layer2/i4b_l2.h>
#include <i4b/layer2/i4b_l2fsm.h>
-l2_softc_t l2_softc[ISIC_MAXUNIT];
+l2_softc_t l2_softc[MAXL1UNITS];
+#if DO_I4B_DEBUG
static char *l2state_text[N_STATES] = {
"ST_TEI_UNAS",
"ST_ASG_AW_TEI",
@@ -111,6 +111,7 @@ static char *l2event_text[N_EVENTS] = {
"EV_RXFRMR",
"Illegal Event"
};
+#endif
static void F_TU01 __P((l2_softc_t *));
static void F_TU03 __P((l2_softc_t *));
@@ -193,7 +194,7 @@ static void F_NCNA __P((l2_softc_t *));
static void
F_ILL(l2_softc_t *l2sc)
{
- DBGL2(L2_F_ERR, "F_ILL", ("FSM function F_ILL executing\n"));
+ NDBGL2(L2_F_ERR, "FSM function F_ILL executing");
}
/*---------------------------------------------------------------------------*
@@ -202,7 +203,7 @@ F_ILL(l2_softc_t *l2sc)
static void
F_NCNA(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_NCNA", ("FSM function F_NCNA executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_NCNA executing");
}
/*---------------------------------------------------------------------------*
@@ -261,10 +262,10 @@ void i4b_next_l2state(l2_softc_t *l2sc, int event)
if(newstate != ST_SUBSET)
{ /* state function does NOT set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM event [%s]: [%s/%d => %s/%d]\n",
+ NDBGL2(L2_F_MSG, "FSM event [%s]: [%s/%d => %s/%d]",
l2event_text[event],
l2state_text[currstate], currstate,
- l2state_text[newstate], newstate));
+ l2state_text[newstate], newstate);
}
/* execute state transition function */
@@ -272,9 +273,9 @@ void i4b_next_l2state(l2_softc_t *l2sc, int event)
if(newstate == ST_SUBSET)
{ /* state function DOES set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM S-event [%s]: [%s => %s]\n", l2event_text[event],
+ NDBGL2(L2_F_MSG, "FSM S-event [%s]: [%s => %s]", l2event_text[event],
l2state_text[currstate],
- l2state_text[l2sc->Q921_state]));
+ l2state_text[l2sc->Q921_state]);
}
/* check for illegal new state */
@@ -282,9 +283,9 @@ void i4b_next_l2state(l2_softc_t *l2sc, int event)
if(newstate == ST_ILL)
{
newstate = currstate;
- DBGL2(L2_F_ERR, "i4b_next_l2state", ("FSM illegal state, state = %s, event = %s!\n",
+ NDBGL2(L2_F_ERR, "FSM illegal state, state = %s, event = %s!",
l2state_text[currstate],
- l2event_text[event]));
+ l2event_text[event]);
}
/* check if state machine function has to set new state */
@@ -294,7 +295,7 @@ void i4b_next_l2state(l2_softc_t *l2sc, int event)
if(l2sc->postfsmfunc != NULL)
{
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM executing postfsmfunc!\n"));
+ NDBGL2(L2_F_MSG, "FSM executing postfsmfunc!");
/* try to avoid an endless loop */
savpostfsmfunc = l2sc->postfsmfunc;
l2sc->postfsmfunc = NULL;
@@ -302,6 +303,7 @@ void i4b_next_l2state(l2_softc_t *l2sc, int event)
}
}
+#if DO_I4B_DEBUG
/*---------------------------------------------------------------------------*
* return pointer to current state description
*---------------------------------------------------------------------------*/
@@ -309,6 +311,7 @@ char *i4b_print_l2state(l2_softc_t *l2sc)
{
return((char *) l2state_text[l2sc->Q921_state]);
}
+#endif
/*---------------------------------------------------------------------------*
* FSM state ST_TEI_UNAS event dl establish request
@@ -316,7 +319,7 @@ char *i4b_print_l2state(l2_softc_t *l2sc)
static void
F_TU01(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TU01", ("FSM function F_TU01 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TU01 executing");
i4b_mdl_assign_ind(l2sc);
}
@@ -326,7 +329,7 @@ F_TU01(l2_softc_t *l2sc)
static void
F_TU03(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TU03", ("FSM function F_TU03 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TU03 executing");
}
/*---------------------------------------------------------------------------*
@@ -335,7 +338,7 @@ F_TU03(l2_softc_t *l2sc)
static void
F_TA03(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TA03", ("FSM function F_TA03 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TA03 executing");
}
/*---------------------------------------------------------------------------*
@@ -344,7 +347,7 @@ F_TA03(l2_softc_t *l2sc)
static void
F_TA04(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TA04", ("FSM function F_TA04 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TA04 executing");
}
/*---------------------------------------------------------------------------*
@@ -353,7 +356,7 @@ F_TA04(l2_softc_t *l2sc)
static void
F_TA05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TA05", ("FSM function F_TA05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TA05 executing");
}
/*---------------------------------------------------------------------------*
@@ -362,7 +365,7 @@ F_TA05(l2_softc_t *l2sc)
static void
F_TE03(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TE03", ("FSM function F_TE03 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TE03 executing");
i4b_establish_data_link(l2sc);
l2sc->l3initiated = 1;
}
@@ -373,7 +376,7 @@ F_TE03(l2_softc_t *l2sc)
static void
F_TE04(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TE04", ("FSM function F_TE04 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TE04 executing");
l2sc->postfsmarg = l2sc->unit;
l2sc->postfsmfunc = DL_Rel_Ind_A;
}
@@ -384,7 +387,7 @@ F_TE04(l2_softc_t *l2sc)
static void
F_TE05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TE05", ("FSM function F_TE05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TE05 executing");
l2sc->postfsmarg = l2sc->unit;
l2sc->postfsmfunc = DL_Rel_Ind_A;
}
@@ -395,7 +398,7 @@ F_TE05(l2_softc_t *l2sc)
static void
F_T01(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T01", ("FSM function F_T01 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T01 executing");
i4b_establish_data_link(l2sc);
l2sc->l3initiated = 1;
}
@@ -406,7 +409,7 @@ F_T01(l2_softc_t *l2sc)
static void
F_T05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T05", ("FSM function F_T05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T05 executing");
}
/*---------------------------------------------------------------------------*
@@ -415,7 +418,7 @@ F_T05(l2_softc_t *l2sc)
static void
F_T06(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T06", ("FSM function F_T06 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T06 executing");
/*XXX*/ i4b_mdl_assign_ind(l2sc);
}
@@ -425,7 +428,7 @@ F_T06(l2_softc_t *l2sc)
static void
F_T07(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T07", ("FSM function F_T07 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T07 executing");
/* XXX */
#ifdef NOTDEF
@@ -461,7 +464,7 @@ F_T07(l2_softc_t *l2sc)
static void
F_T08(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T08", ("FSM function F_T08 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T08 executing");
MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
i4b_tx_ua(l2sc, l2sc->rxd_PF);
}
@@ -472,7 +475,7 @@ F_T08(l2_softc_t *l2sc)
static void
F_T09(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T09", ("FSM function F_T09 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T09 executing");
i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_C);
i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_D);
}
@@ -483,7 +486,7 @@ F_T09(l2_softc_t *l2sc)
static void
F_T10(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T10", ("FSM function F_T10 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T10 executing");
if(l2sc->rxd_PF)
{
@@ -512,7 +515,7 @@ F_T10(l2_softc_t *l2sc)
static void
F_T13(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_T13", ("FSM function F_T13 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_T13 executing");
l2sc->postfsmarg = l2sc->unit;
l2sc->postfsmfunc = DL_Rel_Cnf_A;
}
@@ -523,7 +526,7 @@ F_T13(l2_softc_t *l2sc)
static void
F_AE01(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE01", ("FSM function F_AE01 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE01 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -536,7 +539,7 @@ F_AE01(l2_softc_t *l2sc)
static void
F_AE05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE05", ("FSM function F_AE05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE05 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -552,7 +555,7 @@ F_AE05(l2_softc_t *l2sc)
static void
F_AE06(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE06", ("FSM function F_AE06 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE06 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -570,7 +573,7 @@ F_AE06(l2_softc_t *l2sc)
static void
F_AE07(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE07", ("FSM function F_AE07 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE07 executing");
MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
i4b_tx_ua(l2sc, l2sc->rxd_PF);
}
@@ -581,7 +584,7 @@ F_AE07(l2_softc_t *l2sc)
static void
F_AE08(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE08", ("FSM function F_AE08 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE08 executing");
i4b_tx_dm(l2sc, l2sc->rxd_PF);
}
@@ -591,7 +594,7 @@ F_AE08(l2_softc_t *l2sc)
static void
F_AE09(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE09", ("FSM function F_AE09 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE09 executing");
if(l2sc->rxd_PF == 0)
{
@@ -635,7 +638,7 @@ F_AE09(l2_softc_t *l2sc)
static void
F_AE10(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE10", ("FSM function F_AE10 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE10 executing");
if(l2sc->rxd_PF == 0)
{
@@ -660,7 +663,7 @@ F_AE10(l2_softc_t *l2sc)
static void
F_AE11(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE11", ("FSM function F_AE11 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE11 executing");
if(l2sc->RC >= N200)
{
@@ -691,7 +694,7 @@ F_AE11(l2_softc_t *l2sc)
static void
F_AE12(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AE12", ("FSM function F_AE12 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AE12 executing");
if(l2sc->l3initiated == 0)
{
@@ -705,7 +708,7 @@ F_AE12(l2_softc_t *l2sc)
static void
F_AR05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR05", ("FSM function F_AR05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR05 executing");
l2sc->postfsmarg = l2sc->unit;
l2sc->postfsmfunc = DL_Rel_Cnf_A;
@@ -719,7 +722,7 @@ F_AR05(l2_softc_t *l2sc)
static void
F_AR06(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR06", ("FSM function F_AR06 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR06 executing");
l2sc->postfsmarg = l2sc->unit;
l2sc->postfsmfunc = DL_Rel_Cnf_A;
@@ -735,7 +738,7 @@ F_AR06(l2_softc_t *l2sc)
static void
F_AR07(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR07", ("FSM function F_AR07 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR07 executing");
i4b_tx_dm(l2sc, l2sc->rxd_PF);
}
@@ -745,7 +748,7 @@ F_AR07(l2_softc_t *l2sc)
static void
F_AR08(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR08", ("FSM function F_AR08 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR08 executing");
MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
i4b_tx_ua(l2sc, l2sc->rxd_PF);
}
@@ -756,7 +759,7 @@ F_AR08(l2_softc_t *l2sc)
static void
F_AR09(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR09", ("FSM function F_AR09 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR09 executing");
if(l2sc->rxd_PF)
{
@@ -781,7 +784,7 @@ F_AR09(l2_softc_t *l2sc)
static void
F_AR10(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR10", ("FSM function F_AR10 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR10 executing");
if(l2sc->rxd_PF)
{
@@ -804,7 +807,7 @@ F_AR10(l2_softc_t *l2sc)
static void
F_AR11(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_AR11", ("FSM function F_AR11 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_AR11 executing");
if(l2sc->RC >= N200)
{
@@ -833,7 +836,7 @@ F_AR11(l2_softc_t *l2sc)
static void
F_MF01(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF01", ("FSM function F_MF01 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF01 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -848,7 +851,7 @@ F_MF01(l2_softc_t *l2sc)
static void
F_MF05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF05", ("FSM function F_MF05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF05 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -865,7 +868,7 @@ F_MF05(l2_softc_t *l2sc)
static void
F_MF06(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF06", ("FSM function F_MF06 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF06 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -884,7 +887,7 @@ F_MF06(l2_softc_t *l2sc)
static void
F_MF07(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF07", ("FSM function F_MF07 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF07 executing");
i4b_clear_exception_conditions(l2sc);
@@ -916,7 +919,7 @@ F_MF07(l2_softc_t *l2sc)
static void
F_MF08(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF08", ("FSM function F_MF08 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF08 executing");
i4b_Dcleanifq(&l2sc->i_queue);
MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
@@ -935,7 +938,7 @@ F_MF08(l2_softc_t *l2sc)
static void
F_MF09(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF09", ("FSM function F_MF09 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF09 executing");
if(l2sc->rxd_PF)
i4b_mdl_error_ind(l2sc, "F_MF09", MDL_ERR_C);
else
@@ -948,7 +951,7 @@ F_MF09(l2_softc_t *l2sc)
static void
F_MF10(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF10", ("FSM function F_MF10 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF10 executing");
if(l2sc->rxd_PF)
{
@@ -974,7 +977,7 @@ F_MF10(l2_softc_t *l2sc)
static void
F_MF11(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF11", ("FSM function F_MF11 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF11 executing");
l2sc->RC = 0;
@@ -989,7 +992,7 @@ F_MF11(l2_softc_t *l2sc)
static void
F_MF12(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF12", ("FSM function F_MF12 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF12 executing");
i4b_i_frame_queued_up(l2sc);
}
@@ -1000,7 +1003,7 @@ F_MF12(l2_softc_t *l2sc)
static void
F_MF13(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF13", ("FSM function F_MF13 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF13 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -1018,7 +1021,7 @@ F_MF13(l2_softc_t *l2sc)
static void
F_MF14(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF14", ("FSM function F_MF14 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF14 executing");
i4b_transmit_enquire(l2sc);
@@ -1031,7 +1034,7 @@ F_MF14(l2_softc_t *l2sc)
static void
F_MF15(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF15", ("FSM function F_MF15 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF15 executing");
if(l2sc->own_busy == 0)
{
@@ -1049,7 +1052,7 @@ F_MF15(l2_softc_t *l2sc)
static void
F_MF16(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF16", ("FSM function F_MF16 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF16 executing");
if(l2sc->own_busy != 0)
{
@@ -1067,7 +1070,7 @@ F_MF16(l2_softc_t *l2sc)
static void
F_MF17(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF17", ("FSM function F_MF17 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF17 executing");
l2sc->peer_busy = 0;
@@ -1114,7 +1117,7 @@ F_MF17(l2_softc_t *l2sc)
static void
F_MF18(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF18", ("FSM function F_MF18 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF18 executing");
l2sc->peer_busy = 0;
@@ -1154,7 +1157,7 @@ F_MF18(l2_softc_t *l2sc)
static void
F_MF19(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF19", ("FSM function F_MF19 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF19 executing");
l2sc->peer_busy = 1;
@@ -1193,7 +1196,7 @@ F_MF19(l2_softc_t *l2sc)
static void
F_MF20(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_MF20", ("FSM function F_MF20 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_MF20 executing");
i4b_mdl_error_ind(l2sc, "F_MF20", MDL_ERR_K);
@@ -1208,7 +1211,7 @@ F_MF20(l2_softc_t *l2sc)
static void
F_TR01(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR01", ("FSM function F_TR01 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR01 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -1223,7 +1226,7 @@ F_TR01(l2_softc_t *l2sc)
static void
F_TR05(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR05", ("FSM function F_TR05 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR05 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -1239,7 +1242,7 @@ F_TR05(l2_softc_t *l2sc)
static void
F_TR06(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR06", ("FSM function F_TR06 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR06 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -1257,7 +1260,7 @@ F_TR06(l2_softc_t *l2sc)
static void
F_TR07(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR07", ("FSM function F_TR07 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR07 executing");
i4b_clear_exception_conditions(l2sc);
@@ -1289,7 +1292,7 @@ F_TR07(l2_softc_t *l2sc)
static void
F_TR08(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR08", ("FSM function F_TR08 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR08 executing");
i4b_Dcleanifq(&l2sc->i_queue);
MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
@@ -1307,7 +1310,7 @@ F_TR08(l2_softc_t *l2sc)
static void
F_TR09(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR09", ("FSM function F_TR09 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR09 executing");
if(l2sc->rxd_PF)
i4b_mdl_error_ind(l2sc, "F_TR09", MDL_ERR_C);
else
@@ -1320,7 +1323,7 @@ F_TR09(l2_softc_t *l2sc)
static void
F_TR10(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR10", ("FSM function F_TR10 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR10 executing");
if(l2sc->rxd_PF)
{
@@ -1342,7 +1345,7 @@ F_TR10(l2_softc_t *l2sc)
static void
F_TR11(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR11", ("FSM function F_TR11 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR11 executing");
if(l2sc->RC >= N200)
{
@@ -1370,7 +1373,7 @@ F_TR11(l2_softc_t *l2sc)
static void
F_TR12(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR12", ("FSM function F_TR12 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR12 executing");
i4b_i_frame_queued_up(l2sc);
}
@@ -1381,7 +1384,7 @@ F_TR12(l2_softc_t *l2sc)
static void
F_TR13(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR13", ("FSM function F_TR13 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR13 executing");
i4b_Dcleanifq(&l2sc->i_queue);
@@ -1398,7 +1401,7 @@ F_TR13(l2_softc_t *l2sc)
static void
F_TR15(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR15", ("FSM function F_TR15 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR15 executing");
if(l2sc->own_busy == 0)
{
@@ -1416,7 +1419,7 @@ F_TR15(l2_softc_t *l2sc)
static void
F_TR16(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR16", ("FSM function F_TR16 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR16 executing");
if(l2sc->own_busy != 0)
{
@@ -1434,7 +1437,7 @@ F_TR16(l2_softc_t *l2sc)
static void
F_TR17(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR17", ("FSM function F_TR17 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR17 executing");
l2sc->peer_busy = 0;
@@ -1485,7 +1488,7 @@ F_TR17(l2_softc_t *l2sc)
static void
F_TR18(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR18", ("FSM function F_TR18 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR18 executing");
l2sc->peer_busy = 0;
@@ -1536,7 +1539,7 @@ F_TR18(l2_softc_t *l2sc)
static void
F_TR19(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR19", ("FSM function F_TR19 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR19 executing");
l2sc->peer_busy = 0;
@@ -1586,7 +1589,7 @@ F_TR19(l2_softc_t *l2sc)
static void
F_TR20(l2_softc_t *l2sc)
{
- DBGL2(L2_F_MSG, "F_TR20", ("FSM function F_TR20 executing\n"));
+ NDBGL2(L2_F_MSG, "FSM function F_TR20 executing");
i4b_mdl_error_ind(l2sc, "F_TR20", MDL_ERR_K);
diff --git a/sys/i4b/layer2/i4b_l2fsm.h b/sys/i4b/layer2/i4b_l2fsm.h
index 56a11ff..c7ddaee 100644
--- a/sys/i4b/layer2/i4b_l2fsm.h
+++ b/sys/i4b/layer2/i4b_l2fsm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2fsm.h - layer 2 FSM
* -------------------------
*
- * $Id: i4b_l2fsm.h,v 1.5 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2fsm.h,v 1.6 2000/03/18 09:33:48 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:48 1999]
+ * last edit-date: [Sat Mar 18 10:28:37 2000]
*
*---------------------------------------------------------------------------*/
diff --git a/sys/i4b/layer2/i4b_l2timer.c b/sys/i4b/layer2/i4b_l2timer.c
index 6372b43..d06d205 100644
--- a/sys/i4b/layer2/i4b_l2timer.c
+++ b/sys/i4b/layer2/i4b_l2timer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2timer.c - layer 2 timer handling
* --------------------------------------
*
- * $Id: i4b_l2timer.c,v 1.17 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2timer.c,v 1.20 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:03:56 1999]
+ * last edit-date: [Thu Aug 24 12:48:52 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -77,7 +76,7 @@
static void
i4b_T200_timeout(l2_softc_t *l2sc)
{
- DBGL2(L2_T_ERR, "i4b_T200_timeout", ("unit %d, RC = %d\n", l2sc->unit, l2sc->RC));
+ NDBGL2(L2_T_ERR, "unit %d, RC = %d", l2sc->unit, l2sc->RC);
i4b_next_l2state(l2sc, EV_T200EXP);
}
@@ -90,14 +89,10 @@ i4b_T200_start(l2_softc_t *l2sc)
if(l2sc->T200 == TIMER_ACTIVE)
return;
- DBGL2(L2_T_MSG, "i4b_T200_start", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
l2sc->T200 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
+ START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
}
/*---------------------------------------------------------------------------*
@@ -110,15 +105,11 @@ i4b_T200_stop(l2_softc_t *l2sc)
CRIT_BEG;
if(l2sc->T200 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
+ STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
l2sc->T200 = TIMER_IDLE;
}
CRIT_END;
- DBGL2(L2_T_MSG, "i4b_T200_stop", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
}
/*---------------------------------------------------------------------------*
@@ -131,24 +122,16 @@ i4b_T200_restart(l2_softc_t *l2sc)
CRIT_BEG;
if(l2sc->T200 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
+ STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
}
else
{
l2sc->T200 = TIMER_ACTIVE;
}
-#if defined(__FreeBSD__)
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
+ START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
CRIT_END;
- DBGL2(L2_T_MSG, "i4b_T200_restart", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
}
/*---------------------------------------------------------------------------*
@@ -157,7 +140,7 @@ i4b_T200_restart(l2_softc_t *l2sc)
static void
i4b_T202_timeout(l2_softc_t *l2sc)
{
- DBGL2(L2_T_ERR, "i4b_T202_timeout", ("unit %d, N202 = %d\n", l2sc->unit, l2sc->N202));
+ NDBGL2(L2_T_ERR, "unit %d, N202 = %d", l2sc->unit, l2sc->N202);
if(--(l2sc->N202))
{
@@ -174,15 +157,11 @@ i4b_T202_start(l2_softc_t *l2sc)
if (l2sc->N202 == TIMER_ACTIVE)
return;
- DBGL2(L2_T_MSG, "i4b_T202_start", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
l2sc->N202 = N202DEF;
l2sc->T202 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- l2sc->T202_callout = timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#endif
+ START_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc, T202DEF);
}
/*---------------------------------------------------------------------------*
@@ -195,15 +174,11 @@ i4b_T202_stop(l2_softc_t *l2sc)
CRIT_BEG;
if(l2sc->T202 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, l2sc->T202_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc);
-#endif
+ STOP_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc);
l2sc->T202 = TIMER_IDLE;
}
CRIT_END;
- DBGL2(L2_T_MSG, "i4b_T202_stop", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
}
/*---------------------------------------------------------------------------*
@@ -213,7 +188,7 @@ i4b_T202_stop(l2_softc_t *l2sc)
static void
i4b_T203_timeout(l2_softc_t *l2sc)
{
- DBGL2(L2_T_ERR, "i4b_T203_timeout", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_ERR, "unit %d", l2sc->unit);
i4b_next_l2state(l2sc, EV_T203EXP);
}
#endif
@@ -228,14 +203,10 @@ i4b_T203_start(l2_softc_t *l2sc)
if (l2sc->T203 == TIMER_ACTIVE)
return;
- DBGL2(L2_T_MSG, "i4b_T203_start", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
l2sc->T203 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
+ START_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc, T203DEF);
#endif
}
@@ -250,15 +221,11 @@ i4b_T203_stop(l2_softc_t *l2sc)
CRIT_BEG;
if(l2sc->T203 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
+ STOP_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc);
l2sc->T203 = TIMER_IDLE;
}
CRIT_END;
- DBGL2(L2_T_MSG, "i4b_T203_stop", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
#endif
}
@@ -274,24 +241,16 @@ i4b_T203_restart(l2_softc_t *l2sc)
if(l2sc->T203 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
+ STOP_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc);
}
else
{
l2sc->T203 = TIMER_ACTIVE;
}
-
-#if defined(__FreeBSD__)
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
+
+ START_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc, T203DEF);
CRIT_END;
- DBGL2(L2_T_MSG, "i4b_T203_restart", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
#endif
}
diff --git a/sys/i4b/layer2/i4b_lme.c b/sys/i4b/layer2/i4b_lme.c
index f4ae9f5..429ddc2 100644
--- a/sys/i4b/layer2/i4b_lme.c
+++ b/sys/i4b/layer2/i4b_lme.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_lme.c - layer management entity
* -------------------------------------
*
- * $Id: i4b_lme.c,v 1.11 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_lme.c,v 1.15 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:03 1999]
+ * last edit-date: [Mon May 29 16:55:12 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -76,7 +75,7 @@
void
i4b_mdl_assign_ind(l2_softc_t *l2sc)
{
- DBGL2(L2_PRIM, "MDL-ASSIGN-IND", ("unit %d\n", l2sc->unit));
+ NDBGL2(L2_PRIM, "unit %d", l2sc->unit);
i4b_l1_activate(l2sc);
@@ -100,6 +99,7 @@ i4b_mdl_assign_ind(l2_softc_t *l2sc)
void
i4b_mdl_error_ind(l2_softc_t *l2sc, char *where, int errorcode)
{
+#if DO_I4B_DEBUG
static char *error_text[] = {
"MDL_ERR_A: rx'd unsolicited response - supervisory (F=1)",
"MDL_ERR_B: rx'd unsolicited response - DM (F=1)",
@@ -118,12 +118,13 @@ i4b_mdl_error_ind(l2_softc_t *l2sc, char *where, int errorcode)
"MDL_ERR_O: other error - N201 error",
"MDL_ERR_MAX: i4b_mdl_error_ind called with wrong parameter!!!"
};
+#endif
if(errorcode > MDL_ERR_MAX)
errorcode = MDL_ERR_MAX;
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("unit = %d, location = %s\n", l2sc->unit, where));
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("error = %s\n", error_text[errorcode]));
+ NDBGL2(L2_ERROR, "unit = %d, location = %s", l2sc->unit, where);
+ NDBGL2(L2_ERROR, "error = %s", error_text[errorcode]);
switch(errorcode)
{
diff --git a/sys/i4b/layer2/i4b_mbuf.c b/sys/i4b/layer2/i4b_mbuf.c
index cdd3969..ea6f479 100644
--- a/sys/i4b/layer2/i4b_mbuf.c
+++ b/sys/i4b/layer2/i4b_mbuf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,26 +27,21 @@
* i4b - mbuf handling support routines
* ------------------------------------
*
- * $Id: i4b_mbuf.c,v 1.13 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_mbuf.c,v 1.15 2000/05/29 15:41:42 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:10 1999]
+ * last edit-date: [Mon May 29 16:55:18 2000]
*
*---------------------------------------------------------------------------*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/uio.h>
+#include <sys/kernel.h>
#include <sys/socket.h>
#include <net/if.h>
diff --git a/sys/i4b/layer2/i4b_sframe.c b/sys/i4b/layer2/i4b_sframe.c
index 6644082..5e3ef26 100644
--- a/sys/i4b/layer2/i4b_sframe.c
+++ b/sys/i4b/layer2/i4b_sframe.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_sframe.c - s frame handling routines
* ----------------------------------------
*
- * $Id: i4b_sframe.c,v 1.12 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_sframe.c,v 1.15 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:17 1999]
+ * last edit-date: [Mon May 29 16:55:23 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -96,25 +95,25 @@ i4b_rxd_s_frame(int unit, struct mbuf *m)
{
case RR:
l2sc->stat.rx_rr++; /* update statistics */
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RR, N(R) = %d\n", l2sc->rxd_NR));
+ NDBGL2(L2_S_MSG, "rx'd RR, N(R) = %d", l2sc->rxd_NR);
i4b_next_l2state(l2sc, EV_RXRR);
break;
case RNR:
l2sc->stat.rx_rnr++; /* update statistics */
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RNR, N(R) = %d\n", l2sc->rxd_NR));
+ NDBGL2(L2_S_MSG, "rx'd RNR, N(R) = %d", l2sc->rxd_NR);
i4b_next_l2state(l2sc, EV_RXRNR);
break;
case REJ:
l2sc->stat.rx_rej++; /* update statistics */
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd REJ, N(R) = %d\n", l2sc->rxd_NR));
+ NDBGL2(L2_S_MSG, "rx'd REJ, N(R) = %d", l2sc->rxd_NR);
i4b_next_l2state(l2sc, EV_RXREJ);
break;
default:
l2sc->stat.err_rx_bads++; /* update statistics */
- DBGL2(L2_S_ERR, "i4b_rxd_s_frame", ("ERROR, unknown code, frame = \n"));
+ NDBGL2(L2_S_ERR, "ERROR, unknown code, frame = ");
i4b_print_frame(m->m_len, m->m_data);
break;
}
@@ -129,7 +128,7 @@ i4b_tx_rr_command(l2_softc_t *l2sc, pbit_t pbit)
{
struct mbuf *m;
- DBGL2(L2_S_MSG, "i4b_tx_rr_command", ("tx RR, unit = %d\n", l2sc->unit));
+ NDBGL2(L2_S_MSG, "tx RR, unit = %d", l2sc->unit);
m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RR);
@@ -146,7 +145,7 @@ i4b_tx_rr_response(l2_softc_t *l2sc, fbit_t fbit)
{
struct mbuf *m;
- DBGL2(L2_S_MSG, "i4b_tx_rr_response", ("tx RR, unit = %d\n", l2sc->unit));
+ NDBGL2(L2_S_MSG, "tx RR, unit = %d", l2sc->unit);
m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RR);
@@ -163,7 +162,7 @@ i4b_tx_rnr_command(l2_softc_t *l2sc, pbit_t pbit)
{
struct mbuf *m;
- DBGL2(L2_S_MSG, "i4b_tx_rnr_command", ("tx RNR, unit = %d\n", l2sc->unit));
+ NDBGL2(L2_S_MSG, "tx RNR, unit = %d", l2sc->unit);
m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RNR);
@@ -180,7 +179,7 @@ i4b_tx_rnr_response(l2_softc_t *l2sc, fbit_t fbit)
{
struct mbuf *m;
- DBGL2(L2_S_MSG, "i4b_tx_rnr_response", ("tx RNR, unit = %d\n", l2sc->unit));
+ NDBGL2(L2_S_MSG, "tx RNR, unit = %d", l2sc->unit);
m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RNR);
@@ -197,7 +196,7 @@ i4b_tx_rej_response(l2_softc_t *l2sc, fbit_t fbit)
{
struct mbuf *m;
- DBGL2(L2_S_MSG, "i4b_tx_rej_response", ("tx REJ, unit = %d\n", l2sc->unit));
+ NDBGL2(L2_S_MSG, "tx REJ, unit = %d", l2sc->unit);
m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, REJ);
diff --git a/sys/i4b/layer2/i4b_tei.c b/sys/i4b/layer2/i4b_tei.c
index a57ff9a..b07074b 100644
--- a/sys/i4b/layer2/i4b_tei.c
+++ b/sys/i4b/layer2/i4b_tei.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_tei.c - tei handling procedures
* -----------------------------------
*
- * $Id: i4b_tei.c,v 1.17 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_tei.c,v 1.25 2000/09/01 14:11:51 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:24 1999]
+ * last edit-date: [Fri Sep 1 16:04:58 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,19 +43,25 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#include <sys/random.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/syslog.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
+#if defined(__FreeBSD__)
+#if defined (__FreeBSD_version) && __FreeBSD_version <= 400000
+#include <machine/random.h>
+#else
+#include <sys/random.h>
+#endif
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -98,7 +104,7 @@ i4b_tei_rxframe(int unit, struct mbuf *m)
log(LOG_INFO, "i4b: unit %d, assigned TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Assign - TEI = %d\n", l2sc->tei));
+ NDBGL2(L2_TEI_MSG, "TEI ID Assign - TEI = %d", l2sc->tei);
i4b_next_l2state(l2sc, EV_MDASGRQ);
}
@@ -114,12 +120,12 @@ i4b_tei_rxframe(int unit, struct mbuf *m)
if(l2sc->tei == GROUP_TEI)
{
log(LOG_WARNING, "i4b: unit %d, denied TEI, no TEI values available from exchange!\n", l2sc->unit);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied, No TEI values available from exchange!\n"));
+ NDBGL2(L2_TEI_ERR, "TEI ID Denied, No TEI values available from exchange!");
}
else
{
log(LOG_WARNING, "i4b: unit %d, denied TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied - TEI = %d\n", l2sc->tei));
+ NDBGL2(L2_TEI_ERR, "TEI ID Denied - TEI = %d", l2sc->tei);
}
MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
i4b_next_l2state(l2sc, EV_MDERRRS);
@@ -135,7 +141,7 @@ i4b_tei_rxframe(int unit, struct mbuf *m)
if(l2sc->tei != lasttei)
{
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Check Req - TEI = %d\n", l2sc->tei));
+ NDBGL2(L2_TEI_MSG, "TEI ID Check Req - TEI = %d", l2sc->tei);
lasttei = l2sc->tei;
}
@@ -154,14 +160,14 @@ i4b_tei_rxframe(int unit, struct mbuf *m)
l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
log(LOG_INFO, "i4b: unit %d, removed TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Remove - TEI = %d\n", l2sc->tei));
+ NDBGL2(L2_TEI_MSG, "TEI ID Remove - TEI = %d", l2sc->tei);
MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
i4b_next_l2state(l2sc, EV_MDREMRQ);
}
break;
default:
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("UNKNOWN TEI MGMT Frame, type = 0x%x\n", *(ptr + OFF_MT)));
+ NDBGL2(L2_TEI_ERR, "UNKNOWN TEI MGMT Frame, type = 0x%x", *(ptr + OFF_MT));
i4b_print_frame(m->m_len, m->m_data);
break;
}
@@ -225,7 +231,7 @@ i4b_tei_assign(l2_softc_t *l2sc)
{
struct mbuf *m;
- DBGL2(L2_TEI_MSG, "i4b_tei_assign", ("tx TEI ID_Request\n"));
+ NDBGL2(L2_TEI_MSG, "tx TEI ID_Request");
m = build_tei_mgmt_frame(l2sc, MT_ID_REQEST);
@@ -246,7 +252,7 @@ i4b_tei_verify(l2_softc_t *l2sc)
{
struct mbuf *m;
- DBGL2(L2_TEI_MSG, "i4b_tei_verify", ("tx TEI ID_Verify\n"));
+ NDBGL2(L2_TEI_MSG, "tx TEI ID_Verify");
m = build_tei_mgmt_frame(l2sc, MT_ID_VERIFY);
@@ -270,7 +276,7 @@ i4b_tei_chkresp(l2_softc_t *l2sc)
if(l2sc->tei != lasttei)
{
lasttei = l2sc->tei;
- DBGL2(L2_TEI_MSG, "i4b_tei_chkresp", ("tx TEI ID_Check_Response\n"));
+ NDBGL2(L2_TEI_MSG, "tx TEI ID_Check_Response");
}
m = build_tei_mgmt_frame(l2sc, MT_ID_CHK_RSP);
@@ -291,7 +297,12 @@ i4b_make_rand_ri(l2_softc_t *l2sc)
#if defined(__FreeBSD__)
u_short val;
- read_random((char *)&val, sizeof(val));
+
+#ifdef RANDOMDEV
+ read_random((char *)&val, sizeof(val));
+#else
+ val = (u_short)random();
+#endif /* RANDOMDEV */
#else
diff --git a/sys/i4b/layer2/i4b_uframe.c b/sys/i4b/layer2/i4b_uframe.c
index cc6234b..7376eb5 100644
--- a/sys/i4b/layer2/i4b_uframe.c
+++ b/sys/i4b/layer2/i4b_uframe.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_uframe.c - routines for handling U-frames
* -----------------------------------------------
*
- * $Id: i4b_uframe.c,v 1.10 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_uframe.c,v 1.13 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:30 1999]
+ * last edit-date: [Mon May 29 16:55:30 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -92,7 +91,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_sabme++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("SABME, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "SABME, sapi = %d, tei = %d", sapi, tei);
l2sc->rxd_PF = pfbit;
i4b_next_l2state(l2sc, EV_RXSABME);
}
@@ -120,7 +119,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
else
{
l2sc->stat.err_rx_badui++;
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("unknown UI frame!\n"));
+ NDBGL2(L2_U_ERR, "unknown UI frame!");
i4b_Dfreembuf(m);
}
break;
@@ -130,7 +129,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_disc++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DISC, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "DISC, sapi = %d, tei = %d", sapi, tei);
l2sc->rxd_PF = pfbit;
i4b_next_l2state(l2sc, EV_RXDISC);
}
@@ -142,7 +141,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_xid++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("XID, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "XID, sapi = %d, tei = %d", sapi, tei);
}
i4b_Dfreembuf(m);
break;
@@ -154,7 +153,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_dm++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DM, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "DM, sapi = %d, tei = %d", sapi, tei);
i4b_print_frame(m->m_len, m->m_data);
l2sc->rxd_PF = pfbit;
i4b_next_l2state(l2sc, EV_RXDM);
@@ -167,7 +166,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_ua++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("UA, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "UA, sapi = %d, tei = %d", sapi, tei);
l2sc->rxd_PF = pfbit;
i4b_next_l2state(l2sc, EV_RXUA);
}
@@ -179,7 +178,7 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
l2sc->stat.rx_frmr++;
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("FRMR, sapi = %d, tei = %d\n", sapi, tei));
+ NDBGL2(L2_U_MSG, "FRMR, sapi = %d, tei = %d", sapi, tei);
l2sc->rxd_PF = pfbit;
i4b_next_l2state(l2sc, EV_RXFRMR);
}
@@ -190,12 +189,12 @@ i4b_rxd_u_frame(int unit, struct mbuf *m)
if((l2sc->tei_valid == TEI_VALID) &&
(l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
{
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
+ NDBGL2(L2_U_ERR, "UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei);
i4b_print_frame(m->m_len, m->m_data);
}
else
{
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("not mine - UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
+ NDBGL2(L2_U_ERR, "not mine - UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei);
i4b_print_frame(m->m_len, m->m_data);
}
l2sc->stat.err_rx_badui++;
@@ -236,7 +235,7 @@ i4b_tx_sabme(l2_softc_t *l2sc, pbit_t pbit)
struct mbuf *m;
l2sc->stat.tx_sabme++;
- DBGL2(L2_U_MSG, "i4b_tx_sabme", ("tx SABME, tei = %d\n", l2sc->tei));
+ NDBGL2(L2_U_MSG, "tx SABME, tei = %d", l2sc->tei);
m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, SABME);
PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
@@ -250,7 +249,7 @@ i4b_tx_dm(l2_softc_t *l2sc, fbit_t fbit)
struct mbuf *m;
l2sc->stat.tx_dm++;
- DBGL2(L2_U_MSG, "i4b_tx_dm", ("tx DM, tei = %d\n", l2sc->tei));
+ NDBGL2(L2_U_MSG, "tx DM, tei = %d", l2sc->tei);
m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, DM);
PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
@@ -264,7 +263,7 @@ i4b_tx_disc(l2_softc_t *l2sc, pbit_t pbit)
struct mbuf *m;
l2sc->stat.tx_disc++;
- DBGL2(L2_U_MSG, "i4b_tx_disc", ("tx DISC, tei = %d\n", l2sc->tei));
+ NDBGL2(L2_U_MSG, "tx DISC, tei = %d", l2sc->tei);
m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, DISC);
PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
@@ -278,7 +277,7 @@ i4b_tx_ua(l2_softc_t *l2sc, fbit_t fbit)
struct mbuf *m;
l2sc->stat.tx_ua++;
- DBGL2(L2_U_MSG, "i4b_tx_ua", ("tx UA, tei = %d\n", l2sc->tei));
+ NDBGL2(L2_U_MSG, "tx UA, tei = %d", l2sc->tei);
m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, UA);
PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
@@ -292,7 +291,7 @@ i4b_tx_frmr(l2_softc_t *l2sc, fbit_t fbit)
struct mbuf *m;
l2sc->stat.tx_frmr++;
- DBGL2(L2_U_MSG, "i4b_tx_frmr", ("tx FRMR, tei = %d\n", l2sc->tei));
+ NDBGL2(L2_U_MSG, "tx FRMR, tei = %d", l2sc->tei);
m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, FRMR);
PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
diff --git a/sys/i4b/layer2/i4b_util.c b/sys/i4b/layer2/i4b_util.c
index 23eb29f..676c877 100644
--- a/sys/i4b/layer2/i4b_util.c
+++ b/sys/i4b/layer2/i4b_util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_util.c - layer 2 utility routines
* -------------------------------------
*
- * $Id: i4b_util.c,v 1.22 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_util.c,v 1.26 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:37 1999]
+ * last edit-date: [Mon May 29 16:55:35 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ921 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -176,11 +175,11 @@ i4b_invoke_retransmission(l2_softc_t *l2sc, int nr)
CRIT_BEG;
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr = %d\n", nr ));
+ NDBGL2(L2_ERROR, "nr = %d", nr );
while(l2sc->vs != nr)
{
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr(%d) != vs(%d)\n", nr, l2sc->vs));
+ NDBGL2(L2_ERROR, "nr(%d) != vs(%d)", nr, l2sc->vs);
M128DEC(l2sc->vs);
@@ -190,7 +189,7 @@ i4b_invoke_retransmission(l2_softc_t *l2sc, int nr)
{
if(IF_QFULL(&l2sc->i_queue))
{
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("ERROR, I-queue full!\n"));
+ NDBGL2(L2_ERROR, "ERROR, I-queue full!");
}
else
{
@@ -200,7 +199,7 @@ i4b_invoke_retransmission(l2_softc_t *l2sc, int nr)
}
else
{
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("ERROR, l2sc->vs = %d, l2sc->ua_num = %d \n",l2sc->vs, l2sc->ua_num));
+ NDBGL2(L2_ERROR, "ERROR, l2sc->vs = %d, l2sc->ua_num = %d ",l2sc->vs, l2sc->ua_num);
}
/* XXXXXXXXXXXXXXXXX */
@@ -230,7 +229,7 @@ i4b_acknowledge_pending(l2_softc_t *l2sc)
void
i4b_print_frame(int len, u_char *buf)
{
-#ifdef DO_I4B_DEBUG
+#if DO_I4B_DEBUG
int i;
if (!(i4b_l2_debug & L2_ERROR)) /* XXXXXXXXXXXXXXXXXXXXX */
@@ -248,14 +247,14 @@ i4b_print_frame(int len, u_char *buf)
void
i4b_print_l2var(l2_softc_t *l2sc)
{
- DBGL2(L2_ERROR, "i4b_print_l2var", ("unit%d V(R)=%d, V(S)=%d, V(A)=%d,ACKP=%d,PBSY=%d,OBSY=%d\n",
+ NDBGL2(L2_ERROR, "unit%d V(R)=%d, V(S)=%d, V(A)=%d,ACKP=%d,PBSY=%d,OBSY=%d",
l2sc->unit,
l2sc->vr,
l2sc->vs,
l2sc->va,
l2sc->ack_pend,
l2sc->peer_busy,
- l2sc->own_busy));
+ l2sc->own_busy);
}
/*---------------------------------------------------------------------------*
@@ -266,12 +265,12 @@ i4b_rxd_ack(l2_softc_t *l2sc, int nr)
{
#ifdef NOTDEF
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d\n",
+ NDBGL2(L2_ERROR, "N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d",
nr,
l2sc->ua_num,
l2sc->vr,
l2sc->vs,
- l2sc->va));
+ l2sc->va);
#endif
if(l2sc->ua_num != UA_EMPTY)
@@ -283,7 +282,7 @@ i4b_rxd_ack(l2_softc_t *l2sc, int nr)
M128DEC(nr);
if(l2sc->ua_num != nr)
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("((N(R)-1)=%d) != (UA=%d) !!!\n", nr, l2sc->ua_num));
+ NDBGL2(L2_ERROR, "((N(R)-1)=%d) != (UA=%d) !!!", nr, l2sc->ua_num);
i4b_Dfreembuf(l2sc->ua_frame);
l2sc->ua_num = UA_EMPTY;
@@ -315,13 +314,13 @@ i4b_l2_nr_ok(int nr, int va, int vs)
{
if((va > nr) && ((nr != 0) || (va != 127)))
{
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [1]\n", va, nr, vs));
+ NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [1]", va, nr, vs);
return 0; /* fail */
}
if((nr > vs) && ((vs != 0) || (nr != 127)))
{
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [2]\n", va, nr, vs));
+ NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [2]", va, nr, vs);
return 0; /* fail */
}
return 1; /* good */
OpenPOWER on IntegriCloud