mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-02 21:13:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			145 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			145 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.6.27.4-clean/drivers/isdn/mISDN/layer2.c linux-2.6.27.4/drivers/isdn/mISDN/layer2.c
 | 
						|
--- linux-2.6.27.4-clean/drivers/isdn/mISDN/layer2.c	2008-10-26 00:05:07.000000000 +0200
 | 
						|
+++ linux-2.6.27.4/drivers/isdn/mISDN/layer2.c	2008-12-23 16:16:29.000000000 +0100
 | 
						|
@@ -94,8 +94,10 @@
 | 
						|
 	struct layer2 *l2 = fi->userdata;
 | 
						|
 	va_list va;
 | 
						|
 
 | 
						|
+#if 0
 | 
						|
 	if (!(*debug & DEBUG_L2_FSM))
 | 
						|
 		return;
 | 
						|
+#endif
 | 
						|
 	va_start(va, fmt);
 | 
						|
 	printk(KERN_DEBUG "l2 (tei %d): ", l2->tei);
 | 
						|
 	vprintk(fmt, va);
 | 
						|
@@ -882,6 +884,8 @@
 | 
						|
 	l2->va = 0;
 | 
						|
 	l2->vr = 0;
 | 
						|
 	l2->sow = 0;
 | 
						|
+	l2->sapi = skb->data[0] >> 2;
 | 
						|
+	set_channel_address(&l2->ch, l2->sapi, l2->tei);
 | 
						|
 	clear_exception(l2);
 | 
						|
 	send_uframe(l2, NULL, UA | get_PollFlag(l2, skb), RSP);
 | 
						|
 	mISDN_FsmChangeState(fi, ST_L2_7);
 | 
						|
@@ -898,6 +902,7 @@
 | 
						|
 	struct layer2 *l2 = fi->userdata;
 | 
						|
 	struct sk_buff *skb = arg;
 | 
						|
 
 | 
						|
+	printk(KERN_DEBUG "l2_send_UA()\n");
 | 
						|
 	send_uframe(l2, skb, UA | get_PollFlag(l2, skb), RSP);
 | 
						|
 }
 | 
						|
 
 | 
						|
@@ -931,6 +936,8 @@
 | 
						|
 	l2->va = 0;
 | 
						|
 	l2->vr = 0;
 | 
						|
 	l2->sow = 0;
 | 
						|
+	l2->sapi = skb->data[0] >> 2;
 | 
						|
+	set_channel_address(&l2->ch, l2->sapi, l2->tei);
 | 
						|
 	mISDN_FsmChangeState(fi, ST_L2_7);
 | 
						|
 	stop_t200(l2, 3);
 | 
						|
 	mISDN_FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
 | 
						|
@@ -982,6 +989,8 @@
 | 
						|
 	} else if (l2->vs != l2->va) {
 | 
						|
 		skb_queue_purge(&l2->i_queue);
 | 
						|
 		pr = DL_ESTABLISH_IND;
 | 
						|
+		//l2->sapi = skb->data[0] >> 2;
 | 
						|
+		//set_channel_address(&l2->ch, l2->sapi, l2->tei);
 | 
						|
 	}
 | 
						|
 	stop_t200(l2, 5);
 | 
						|
 	l2->vr = 0;
 | 
						|
@@ -1841,11 +1850,14 @@
 | 
						|
 	u_int	l;
 | 
						|
 	int	c = 0;
 | 
						|
 
 | 
						|
+	printk(KERN_DEBUG "ph_data_indication 0x%x 0x%x 0x%x\n", datap[0], datap[1], datap[2]);
 | 
						|
+
 | 
						|
 	l = l2addrsize(l2);
 | 
						|
 	if (skb->len <= l) {
 | 
						|
 		mISDN_FsmEvent(&l2->l2m, EV_L2_FRAME_ERROR, (void *) 'N');
 | 
						|
 		return ret;
 | 
						|
 	}
 | 
						|
+#if 0
 | 
						|
 	if (test_bit(FLG_LAPD, &l2->flag)) { /* Maybe not needed */
 | 
						|
 		psapi = *datap++;
 | 
						|
 		ptei = *datap++;
 | 
						|
@@ -1875,6 +1887,7 @@
 | 
						|
 			return 0;
 | 
						|
 		}
 | 
						|
 	} else
 | 
						|
+#endif
 | 
						|
 		datap += l;
 | 
						|
 	if (!(*datap & 1)) {	/* I-Frame */
 | 
						|
 		c = iframe_error(l2, skb);
 | 
						|
@@ -1890,6 +1903,7 @@
 | 
						|
 			ret = mISDN_FsmEvent(&l2->l2m, EV_L2_UI, skb);
 | 
						|
 	} else if (IsSABME(datap, l2)) {
 | 
						|
 		c = unnum_error(l2, skb, CMD);
 | 
						|
+		printk(KERN_DEBUG "IsSABME() returned true, unnum_error=%d\n", c);
 | 
						|
 		if (!c)
 | 
						|
 			ret = mISDN_FsmEvent(&l2->l2m, EV_L2_SABME, skb);
 | 
						|
 	} else if (IsUA(datap)) {
 | 
						|
@@ -2087,7 +2101,7 @@
 | 
						|
 		test_and_set_bit(FLG_LAPD, &l2->flag);
 | 
						|
 		test_and_set_bit(FLG_LAPD_NET, &l2->flag);
 | 
						|
 		test_and_set_bit(FLG_MOD128, &l2->flag);
 | 
						|
-		l2->sapi = 0;
 | 
						|
+		l2->sapi = 62;
 | 
						|
 		l2->maxlen = MAX_DFRAME_LEN;
 | 
						|
 		if (test_bit(OPTION_L2_PMX, &options))
 | 
						|
 			l2->window = 7;
 | 
						|
diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.6.27.4-clean/drivers/isdn/mISDN/tei.c linux-2.6.27.4/drivers/isdn/mISDN/tei.c
 | 
						|
--- linux-2.6.27.4-clean/drivers/isdn/mISDN/tei.c	2008-10-26 00:05:07.000000000 +0200
 | 
						|
+++ linux-2.6.27.4/drivers/isdn/mISDN/tei.c	2008-12-23 16:32:59.000000000 +0100
 | 
						|
@@ -830,18 +830,29 @@
 | 
						|
 	int		tei, ri;
 | 
						|
 	struct layer2	*l2;
 | 
						|
 
 | 
						|
+	printk(KERN_DEBUG "new tei request: tei=%d\n", dp[3] >> 1);
 | 
						|
+
 | 
						|
 	ri = dp[0] << 8;
 | 
						|
 	ri += dp[1];
 | 
						|
-	if (!mgr->up)
 | 
						|
-		goto denied;
 | 
						|
-	tei = get_free_tei(mgr);
 | 
						|
-	if (tei < 0) {
 | 
						|
-		printk(KERN_WARNING "%s:No free tei\n", __func__);
 | 
						|
+	if (!mgr->up) {
 | 
						|
+		printk(KERN_DEBUG "mgr->up == NULL\n");
 | 
						|
 		goto denied;
 | 
						|
 	}
 | 
						|
+	if (dp[3] != 0xff) {
 | 
						|
+		/* This is a TEI request according to 3GPP TS 08.56 6.1.11.2 */
 | 
						|
+		tei = dp[3] >> 1;
 | 
						|
+	} else {
 | 
						|
+		tei = get_free_tei(mgr);
 | 
						|
+		if (tei < 0) {
 | 
						|
+			printk(KERN_WARNING "%s:No free tei\n", __func__);
 | 
						|
+			goto denied;
 | 
						|
+		}
 | 
						|
+	}
 | 
						|
 	l2 = create_new_tei(mgr, tei);
 | 
						|
-	if (!l2)
 | 
						|
+	if (!l2) {
 | 
						|
+		printk(KERN_DEBUG "create_new_tei == NULL\n");
 | 
						|
 		goto denied;
 | 
						|
+	}
 | 
						|
 	else
 | 
						|
 		mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp);
 | 
						|
 	return;
 | 
						|
@@ -1159,12 +1170,14 @@
 | 
						|
 		return -ENOTCONN;
 | 
						|
 	if (skb->len != 3)
 | 
						|
 		return -ENOTCONN;
 | 
						|
+#if 0
 | 
						|
 	if (skb->data[0] != 0)
 | 
						|
 		/* only SAPI 0 command */
 | 
						|
 		return -ENOTCONN;
 | 
						|
+#endif
 | 
						|
 	if (!(skb->data[1] & 1)) /* invalid EA1 */
 | 
						|
 		return -EINVAL;
 | 
						|
-	tei = skb->data[1] >> 0;
 | 
						|
+	tei = skb->data[1] >> 1;
 | 
						|
 	if (tei > 63) /* not a fixed tei */
 | 
						|
 		return -ENOTCONN;
 | 
						|
 	if ((skb->data[2] & ~0x10) != SABME)
 |