[thirdparty-commits] rmudgett: mISDN/trunk r32 - in /mISDN/trunk: drivers/isdn/hardware/mISDN/ inc...

SVN commits to the Digium third-party software repository thirdparty-commits at lists.digium.com
Thu Dec 18 21:27:23 CST 2008


Author: rmudgett
Date: Thu Dec 18 21:27:20 2008
New Revision: 32

URL: http://svn.digium.com/view/thirdparty?view=rev&rev=32
Log:
JIRA AST-123/ABE-1705
*  Added REGISTER message support for CCBS-T/CCNR-T.

Modified:
    mISDN/trunk/drivers/isdn/hardware/mISDN/dss1.h
    mISDN/trunk/drivers/isdn/hardware/mISDN/l3_udss1.c
    mISDN/trunk/drivers/isdn/hardware/mISDN/layer3.h
    mISDN/trunk/include/linux/mISDNif.h

Modified: mISDN/trunk/drivers/isdn/hardware/mISDN/dss1.h
URL: http://svn.digium.com/view/thirdparty/mISDN/trunk/drivers/isdn/hardware/mISDN/dss1.h?view=diff&rev=32&r1=31&r2=32
==============================================================================
--- mISDN/trunk/drivers/isdn/hardware/mISDN/dss1.h (original)
+++ mISDN/trunk/drivers/isdn/hardware/mISDN/dss1.h Thu Dec 18 21:27:20 2008
@@ -76,6 +76,7 @@
 #define MT_CONGESTION_CONTROL	0x79
 #define MT_INFORMATION		0x7b
 #define MT_FACILITY		0x62
+#define MT_REGISTER		0x64
 #define MT_NOTIFY		0x6e
 #define MT_STATUS		0x7d
 #define MT_STATUS_ENQUIRY	0x75

Modified: mISDN/trunk/drivers/isdn/hardware/mISDN/l3_udss1.c
URL: http://svn.digium.com/view/thirdparty/mISDN/trunk/drivers/isdn/hardware/mISDN/l3_udss1.c?view=diff&rev=32&r1=31&r2=32
==============================================================================
--- mISDN/trunk/drivers/isdn/hardware/mISDN/l3_udss1.c (original)
+++ mISDN/trunk/drivers/isdn/hardware/mISDN/l3_udss1.c Thu Dec 18 21:27:20 2008
@@ -456,16 +456,17 @@
 static int ie_RETRIEVE[] = {IE_CHANNEL_ID| IE_MANDATORY, IE_DISPLAY, -1};
 static int ie_RETRIEVE_ACKNOWLEDGE[] = {IE_CHANNEL_ID| IE_MANDATORY, IE_DISPLAY, -1};
 static int ie_RETRIEVE_REJECT[] = {IE_CAUSE | IE_MANDATORY, IE_DISPLAY, -1};
-/* not used
- * static int ie_CONGESTION_CONTROL[] = {IE_CONGESTION | IE_MANDATORY,
- *		IE_CAUSE | IE_MANDATORY, IE_DISPLAY, -1};
- * static int ie_USER_INFORMATION[] = {IE_MORE_DATA, IE_USER_USER | IE_MANDATORY, -1};
- * static int ie_RESTART[] = {IE_CHANNEL_ID, IE_DISPLAY, IE_RESTART_IND |
- *		IE_MANDATORY, -1};
- */
+#ifdef NOT_USED
+static int ie_CONGESTION_CONTROL[] = {IE_CONGESTION | IE_MANDATORY,
+	IE_CAUSE | IE_MANDATORY, IE_DISPLAY, -1};
+static int ie_USER_INFORMATION[] = {IE_MORE_DATA, IE_USER_USER | IE_MANDATORY, -1};
+static int ie_RESTART[] = {IE_CHANNEL_ID, IE_DISPLAY, IE_RESTART_IND |
+	IE_MANDATORY, -1};
+#endif	/* NOT_USED */
 static int ie_FACILITY[] = {IE_FACILITY | IE_MANDATORY, IE_DISPLAY, -1};
-
-static int l3_valid_states[] = {0,1,2,3,4,6,7,8,9,10,11,12,15,17,19,25,-1};
+static int ie_REGISTER[] = {IE_FACILITY, IE_DISPLAY, -1};
+
+static int l3_valid_states[] = {0,1,2,3,4,6,7,8,9,10,11,12,15,17,19,25,31,-1};
 
 struct ie_len {
 	int ie;
@@ -613,6 +614,7 @@
 		case MT_INFORMATION:
 		case MT_FACILITY:
 		case MT_NOTIFY:
+		case MT_REGISTER:
 		case MT_PROGRESS:
 		case MT_RELEASE:
 		case MT_RELEASE_COMPLETE:
@@ -940,6 +942,14 @@
 }
 
 static void
+l3dss1_register_req(l3_process_t *pc, u_char pr, void *arg)
+{
+	if (arg) {
+		SendMsg(pc, arg, 31);/* call state: Call Independent Service (U31/N31) */
+	}
+}
+
+static void
 l3dss1_restart_req(l3_process_t *pc, u_char pr, void *arg)
 {
 	pc->callref=0;
@@ -1009,7 +1019,7 @@
 		l3dss1_status_send(pc, cause);
 		return;
 	}
-	/* Now we are on none mandatory IEs */
+	/* Now we are on non-mandatory IEs */
 	ret = check_infoelements(pc, skb, ie_CALL_PROCEEDING);
 	if (ERR_IE_COMPREHENSION == ret) {
 		l3dss1_std_ie_err(pc, ret);
@@ -1023,7 +1033,7 @@
 	}
 	newl3state(pc, 3);
 	L3AddTimer(&pc->timer, T310, CC_T310);
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 	if (mISDN_l3up(pc, CC_PROCEEDING | INDICATION, skb))
 		dev_kfree_skb(skb);
@@ -1146,7 +1156,7 @@
 		dev_kfree_skb(skb);
 		return;
 	}
-	/* Now we are on none mandatory IEs */
+	/* Now we are on non-mandatory IEs */
 	ret = check_infoelements(pc, skb, ie_SETUP_ACKNOWLEDGE);
 	if (ERR_IE_COMPREHENSION == ret) {
 		l3dss1_std_ie_err(pc, ret);
@@ -1160,7 +1170,7 @@
 	}
 	newl3state(pc, 2);
 	L3AddTimer(&pc->timer, T304, CC_T304);
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 	if (mISDN_l3up(pc, CC_SETUP_ACKNOWLEDGE | INDICATION, skb))
 		dev_kfree_skb(skb);
@@ -1262,7 +1272,7 @@
 		dev_kfree_skb(skb);
 		return;
 	}
-	/* Now we are on none mandatory IEs */
+	/* Now we are on non-mandatory IEs */
 	err = check_infoelements(pc, skb, ie_SETUP);
 	if (ERR_IE_COMPREHENSION == err) {
 		l3dss1_msg_without_setup(pc, CAUSE_MANDATORY_IE_MISS);
@@ -1272,7 +1282,7 @@
 	newl3state(pc, 6);
 	L3DelTimer(&pc->timer);
 	L3AddTimer(&pc->timer, T_CTRL, CC_TCTRL);
-	if (err) /* STATUS for none mandatory IE errors after actions are taken */
+	if (err) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, err);
 // already done
 //	err = mISDN_l3up(pc, CC_NEW_CR | INDICATION, NULL);
@@ -1366,7 +1376,7 @@
 		dev_kfree_skb(skb);
 		return;
 	}
-	/* Now we are on none mandatory IEs */
+	/* Now we are on non-mandatory IEs */
 	err = check_infoelements(pc, skb, ie_PROGRESS);
 	if (err)
 		l3dss1_std_ie_err(pc, err);
@@ -1424,7 +1434,7 @@
 		dev_kfree_skb(skb);
 		return;
 	}
-	/* Now we are on none mandatory IEs */
+	/* Now we are on non-mandatory IEs */
 	err = check_infoelements(pc, skb, ie_NOTIFY);
 	if (err)
 		l3dss1_std_ie_err(pc, err);
@@ -1589,6 +1599,19 @@
 }
 
 static void
+l3dss1_register(l3_process_t *pc, u_char pr, void *arg)
+{
+	struct sk_buff *skb = arg;
+	int ret;
+
+	ret = check_infoelements(pc, skb, ie_REGISTER);
+	l3dss1_std_ie_err(pc, ret);
+	if (mISDN_l3up(pc, CC_REGISTER | INDICATION, skb)) {
+		dev_kfree_skb(skb);
+	}
+}
+
+static void
 l3dss1_suspend_ack(l3_process_t *pc, u_char pr, void *arg) {
 	struct sk_buff	*skb = arg;
 	int		ret;
@@ -1632,7 +1655,7 @@
 	if (mISDN_l3up(pc, CC_SUSPEND_REJECT | INDICATION, skb))
 		dev_kfree_skb(skb);
 	newl3state(pc, 10);
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -1669,7 +1692,7 @@
 	if (mISDN_l3up(pc, CC_RESUME_ACKNOWLEDGE | INDICATION, skb))
 		dev_kfree_skb(skb);
 	newl3state(pc, 10);
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -1701,7 +1724,7 @@
 	if (mISDN_l3up(pc, CC_RESUME_REJECT | INDICATION, skb))
 		dev_kfree_skb(skb);
 	newl3state(pc, 0);
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 	release_l3_process(pc);
 }
@@ -1908,7 +1931,7 @@
 			dev_kfree_skb(skb);
 			return;
 	}
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -1982,7 +2005,7 @@
 			int_errtxt("HOLD_ACK in wrong aux state %d\n", pc->aux_state);
 			dev_kfree_skb(skb);
 	}
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -2097,7 +2120,7 @@
 			dev_kfree_skb(skb);
 			return;
 	}
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -2133,7 +2156,7 @@
 		default:
 			int_errtxt("RETRIEVE_ACK in wrong aux state %d\n", pc->aux_state);
 	}
-	if (ret) /* STATUS for none mandatory IE errors after actions are taken */
+	if (ret) /* STATUS for non-mandatory IE errors after actions are taken */
 		l3dss1_std_ie_err(pc, ret);
 }
 
@@ -2437,6 +2460,8 @@
 	 CC_HOLD  | REQUEST, l3dss1_hold_req},
 	{ALL_STATES,
 	 CC_FACILITY | REQUEST, l3dss1_facility_req},
+	{SBIT(0),
+	 CC_REGISTER | REQUEST, l3dss1_register_req},
 	{ALL_STATES,
 	 CC_STATUS_ENQUIRY | REQUEST, l3dss1_status_enq_req},
 };
@@ -2450,6 +2475,8 @@
 	 MT_STATUS_ENQUIRY, l3dss1_status_enq},
 	{ALL_STATES,
 	 MT_FACILITY, l3dss1_facility},
+	{SBIT(0),
+	 MT_REGISTER, l3dss1_register},
 	{SBIT(19),
 	 MT_STATUS, l3dss1_release_ind},
 	{ALL_STATES,
@@ -2473,7 +2500,7 @@
 	{ALL_STATES,
 	 MT_NOTIFY, l3dss1_notify},
 	{SBIT(0) | SBIT(1) | SBIT(2) | SBIT(3) | SBIT(4) | SBIT(7) | SBIT(8) | SBIT(10) |
-	 SBIT(11) | SBIT(12) | SBIT(15) | SBIT(17) | SBIT(19) | SBIT(25),
+	 SBIT(11) | SBIT(12) | SBIT(15) | SBIT(17) | SBIT(19) | SBIT(25) | SBIT(31),
 	 MT_RELEASE_COMPLETE, l3dss1_release_cmpl},
 	{SBIT(1) | SBIT(2) | SBIT(3) | SBIT(4) | SBIT(7) | SBIT(8) | SBIT(9) | SBIT(10) | SBIT(11) | SBIT(12) | SBIT(15) | SBIT(17) | SBIT(25),
 	 MT_RELEASE, l3dss1_release},
@@ -2583,7 +2610,7 @@
 	proc->callref = skb->data[2]; /* cr flag */
 	for (i = 0; i < GLOBALM_LEN; i++)
 		if ((mt == globalmes_list[i].primitive) &&
-		    ((1 << proc->state) & globalmes_list[i].state))
+		    ((1UL << proc->state) & globalmes_list[i].state))
 			break;
 	if (i == GLOBALM_LEN) {
 		if (l3->debug & L3_DEB_STATE) {
@@ -2663,16 +2690,14 @@
 		l3_debug(l3, "dss1up cr %d", qi->cr);
 	if (qi->crlen == 0) {	/* Dummy Callref */
 		switch(qi->type) {
-			case MT_FACILITY:
-				l3dss1_facility(l3->dummy, hh->prim, skb);
-			return(0);
-			default:
+		case MT_FACILITY:
+			l3dss1_facility(l3->dummy, hh->prim, skb);
+			break;
+		default:
 			if (l3->debug & L3_DEB_WARN)
 				l3_debug(l3, "dss1up dummy Callref (no facility msg or ie)");
-
-			break;
-		}
-
+			break;
+		}
 		return(0);
 	} else if ((qi->cr & 0x7fff) == 0) {	/* Global CallRef */
 		if (l3->debug & L3_DEB_STATE)
@@ -2683,10 +2708,12 @@
 		/* No transaction process exist, that means no call with
 		 * this callreference is active
 		 */
-		if (qi->type == MT_SETUP) {
-			/* Setup creates a new l3 process */
+		switch (qi->type) {
+		case MT_REGISTER:
+		case MT_SETUP:
+			/* Creates a new l3 process */
 			if (qi->cr & 0x8000) {
-				/* Setup with wrong CREF flag */
+				/* Wrong CREF flag */
 				if (l3->debug & L3_DEB_STATE)
 					l3_debug(l3, "dss1up wrong CRef flag");
 				dev_kfree_skb(skb);
@@ -2709,7 +2736,8 @@
 				release_l3_process(proc);
 				return(0);
 			}
-		} else if (qi->type == MT_STATUS) {
+			break;
+		case MT_STATUS:
 			cause = 0;
 			if (qi->cause.off) {
 				if (ptr[qi->cause.off +1] >= 2)
@@ -2739,15 +2767,14 @@
 			}
 			dev_kfree_skb(skb);
 			return(0);
-		} else if (qi->type == MT_RELEASE_COMPLETE) {
+		case MT_RELEASE_COMPLETE:
 			dev_kfree_skb(skb);
 			return(0);
-		} else {
+		default:
 			/* ETS 300-104 part 2
-			 * if setup has not been made and a message type
-			 * (except MT_SETUP and RELEASE_COMPLETE) is received,
+			 * if setup/register has not been made and a message type
+			 * (except MT_SETUP, MT_REGISTER, and RELEASE_COMPLETE) is received,
 			 * we must send MT_RELEASE_COMPLETE cause 81 */
-			
 			printk("We got Message with Invalid Callref\n");
 			
 			if ((proc = new_l3_process(l3, qi->cr, N303, MISDN_ID_ANY))) {
@@ -2756,7 +2783,7 @@
 			}
 			dev_kfree_skb(skb);
 			return(0);
-		}
+		}	/* end switch */
 	}
 	if (l3dss1_check_messagetype_validity(proc, qi->type, skb)) {
 		dev_kfree_skb(skb);
@@ -2764,7 +2791,7 @@
 	}
 	for (i = 0; i < DATASLLEN; i++)
 		if ((qi->type == datastatelist[i].primitive) &&
-		    ((1 << proc->state) & datastatelist[i].state))
+		    ((1UL << proc->state) & datastatelist[i].state))
 			break;
 	if (i == DATASLLEN) {
 		if (l3->debug & L3_DEB_STATE) {
@@ -2845,7 +2872,7 @@
 	}
 	for (i = 0; i < DOWNSLLEN; i++)
 		if ((hh->prim == downstatelist[i].primitive) &&
-		    ((1 << proc->state) & downstatelist[i].state))
+		    ((1UL << proc->state) & downstatelist[i].state))
 			break;
 	if (i == DOWNSLLEN) {
 		if (l3->debug & L3_DEB_STATE) {
@@ -2879,7 +2906,7 @@
 	}
 	for (i = 0; i < MANSLLEN; i++)
 		if ((pr == manstatelist[i].primitive) &&
-			((1 << proc->state) & manstatelist[i].state))
+			((1UL << proc->state) & manstatelist[i].state))
 			break;
 		if (i == MANSLLEN) {
 			if (proc->l3->debug & L3_DEB_STATE) {

Modified: mISDN/trunk/drivers/isdn/hardware/mISDN/layer3.h
URL: http://svn.digium.com/view/thirdparty/mISDN/trunk/drivers/isdn/hardware/mISDN/layer3.h?view=diff&rev=32&r1=31&r2=32
==============================================================================
--- mISDN/trunk/drivers/isdn/hardware/mISDN/layer3.h (original)
+++ mISDN/trunk/drivers/isdn/hardware/mISDN/layer3.h Thu Dec 18 21:27:20 2008
@@ -11,8 +11,8 @@
 #include "memdbg.h"
 #endif
 
-#define SBIT(state) (1<<state)
-#define ALL_STATES  0x03ffffff
+#define SBIT(state)	(1UL << state)
+#define ALL_STATES	0xffffffff
 
 #define PROTO_DIS_EURO	0x08
 
@@ -73,7 +73,7 @@
 } layer3_t;
 
 struct stateentry {
-	int	state;
+	unsigned long state;
 	u_int	primitive;
 	void	(*rout) (l3_process_t *, u_char, void *);
 };

Modified: mISDN/trunk/include/linux/mISDNif.h
URL: http://svn.digium.com/view/thirdparty/mISDN/trunk/include/linux/mISDNif.h?view=diff&rev=32&r1=31&r2=32
==============================================================================
--- mISDN/trunk/include/linux/mISDNif.h (original)
+++ mISDN/trunk/include/linux/mISDNif.h Thu Dec 18 21:27:20 2008
@@ -285,6 +285,7 @@
 #define CC_RELEASE		0x034d00
 #define CC_RELEASE_COMPLETE	0x035a00
 #define CC_FACILITY		0x036200
+#define CC_REGISTER		0x036400
 #define CC_NOTIFY		0x036e00
 #define CC_STATUS_ENQUIRY	0x037500
 #define CC_INFORMATION		0x037b00
@@ -708,6 +709,8 @@
 	u_char		type;
 	u_char		crlen;
 	u16		cr;
+
+	/* The following ie_info_t elements are treated as an array */
 	ie_info_t	bearer_capability;
 	ie_info_t	cause;
 	ie_info_t	call_id;
@@ -741,10 +744,12 @@
 	ie_info_t	llc;
 	ie_info_t	hlc;
 	ie_info_t	useruser;
+
 	ie_info_t	more_data;
 	ie_info_t	sending_complete;
 	ie_info_t	congestion_level;
 	ie_info_t	comprehension_required;
+
 	ie_info_ext_t	ext[8];
 }  __attribute__((packed)) Q931_info_t;
 




More information about the thirdparty-commits mailing list