mgcp: Parse a Digital Trunk endpoint name.
[openbsc.git] / linux-kernel / linux-2.6.27.4-misdn-abis.diff
blob3691eda8a31d37b2f6c8d9aaea873b44191b6eb2
1 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
2 --- linux-2.6.27.4-clean/drivers/isdn/mISDN/layer2.c 2008-10-26 00:05:07.000000000 +0200
3 +++ linux-2.6.27.4/drivers/isdn/mISDN/layer2.c 2008-12-23 16:16:29.000000000 +0100
4 @@ -94,8 +94,10 @@
5 struct layer2 *l2 = fi->userdata;
6 va_list va;
8 +#if 0
9 if (!(*debug & DEBUG_L2_FSM))
10 return;
11 +#endif
12 va_start(va, fmt);
13 printk(KERN_DEBUG "l2 (tei %d): ", l2->tei);
14 vprintk(fmt, va);
15 @@ -882,6 +884,8 @@
16 l2->va = 0;
17 l2->vr = 0;
18 l2->sow = 0;
19 + l2->sapi = skb->data[0] >> 2;
20 + set_channel_address(&l2->ch, l2->sapi, l2->tei);
21 clear_exception(l2);
22 send_uframe(l2, NULL, UA | get_PollFlag(l2, skb), RSP);
23 mISDN_FsmChangeState(fi, ST_L2_7);
24 @@ -898,6 +902,7 @@
25 struct layer2 *l2 = fi->userdata;
26 struct sk_buff *skb = arg;
28 + printk(KERN_DEBUG "l2_send_UA()\n");
29 send_uframe(l2, skb, UA | get_PollFlag(l2, skb), RSP);
32 @@ -931,6 +936,8 @@
33 l2->va = 0;
34 l2->vr = 0;
35 l2->sow = 0;
36 + l2->sapi = skb->data[0] >> 2;
37 + set_channel_address(&l2->ch, l2->sapi, l2->tei);
38 mISDN_FsmChangeState(fi, ST_L2_7);
39 stop_t200(l2, 3);
40 mISDN_FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
41 @@ -982,6 +989,8 @@
42 } else if (l2->vs != l2->va) {
43 skb_queue_purge(&l2->i_queue);
44 pr = DL_ESTABLISH_IND;
45 + //l2->sapi = skb->data[0] >> 2;
46 + //set_channel_address(&l2->ch, l2->sapi, l2->tei);
48 stop_t200(l2, 5);
49 l2->vr = 0;
50 @@ -1841,11 +1850,14 @@
51 u_int l;
52 int c = 0;
54 + printk(KERN_DEBUG "ph_data_indication 0x%x 0x%x 0x%x\n", datap[0], datap[1], datap[2]);
56 l = l2addrsize(l2);
57 if (skb->len <= l) {
58 mISDN_FsmEvent(&l2->l2m, EV_L2_FRAME_ERROR, (void *) 'N');
59 return ret;
61 +#if 0
62 if (test_bit(FLG_LAPD, &l2->flag)) { /* Maybe not needed */
63 psapi = *datap++;
64 ptei = *datap++;
65 @@ -1875,6 +1887,7 @@
66 return 0;
68 } else
69 +#endif
70 datap += l;
71 if (!(*datap & 1)) { /* I-Frame */
72 c = iframe_error(l2, skb);
73 @@ -1890,6 +1903,7 @@
74 ret = mISDN_FsmEvent(&l2->l2m, EV_L2_UI, skb);
75 } else if (IsSABME(datap, l2)) {
76 c = unnum_error(l2, skb, CMD);
77 + printk(KERN_DEBUG "IsSABME() returned true, unnum_error=%d\n", c);
78 if (!c)
79 ret = mISDN_FsmEvent(&l2->l2m, EV_L2_SABME, skb);
80 } else if (IsUA(datap)) {
81 @@ -2087,7 +2101,7 @@
82 test_and_set_bit(FLG_LAPD, &l2->flag);
83 test_and_set_bit(FLG_LAPD_NET, &l2->flag);
84 test_and_set_bit(FLG_MOD128, &l2->flag);
85 - l2->sapi = 0;
86 + l2->sapi = 62;
87 l2->maxlen = MAX_DFRAME_LEN;
88 if (test_bit(OPTION_L2_PMX, &options))
89 l2->window = 7;
90 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
91 --- linux-2.6.27.4-clean/drivers/isdn/mISDN/tei.c 2008-10-26 00:05:07.000000000 +0200
92 +++ linux-2.6.27.4/drivers/isdn/mISDN/tei.c 2008-12-23 16:32:59.000000000 +0100
93 @@ -830,18 +830,29 @@
94 int tei, ri;
95 struct layer2 *l2;
97 + printk(KERN_DEBUG "new tei request: tei=%d\n", dp[3] >> 1);
99 ri = dp[0] << 8;
100 ri += dp[1];
101 - if (!mgr->up)
102 - goto denied;
103 - tei = get_free_tei(mgr);
104 - if (tei < 0) {
105 - printk(KERN_WARNING "%s:No free tei\n", __func__);
106 + if (!mgr->up) {
107 + printk(KERN_DEBUG "mgr->up == NULL\n");
108 goto denied;
110 + if (dp[3] != 0xff) {
111 + /* This is a TEI request according to 3GPP TS 08.56 6.1.11.2 */
112 + tei = dp[3] >> 1;
113 + } else {
114 + tei = get_free_tei(mgr);
115 + if (tei < 0) {
116 + printk(KERN_WARNING "%s:No free tei\n", __func__);
117 + goto denied;
120 l2 = create_new_tei(mgr, tei);
121 - if (!l2)
122 + if (!l2) {
123 + printk(KERN_DEBUG "create_new_tei == NULL\n");
124 goto denied;
126 else
127 mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp);
128 return;
129 @@ -1159,12 +1170,14 @@
130 return -ENOTCONN;
131 if (skb->len != 3)
132 return -ENOTCONN;
133 +#if 0
134 if (skb->data[0] != 0)
135 /* only SAPI 0 command */
136 return -ENOTCONN;
137 +#endif
138 if (!(skb->data[1] & 1)) /* invalid EA1 */
139 return -EINVAL;
140 - tei = skb->data[1] >> 0;
141 + tei = skb->data[1] >> 1;
142 if (tei > 63) /* not a fixed tei */
143 return -ENOTCONN;
144 if ((skb->data[2] & ~0x10) != SABME)