summaryrefslogtreecommitdiffstats
path: root/linux-kernel/linux-2.6.27.4-misdn-abis.diff
blob: 3691eda8a31d37b2f6c8d9aaea873b44191b6eb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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)