Commit d796509a authored by Andreas Eversberg's avatar Andreas Eversberg Committed by David S. Miller

mISDN: Add "sapi" information to debug messages

Using sapi values other than 0 work now.
The "OpenBSC" project does not require special kernel patch anymore.
Signed-off-by: default avatarAndreas Eversberg <andreas@eversberg.eu>
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3dc40393
...@@ -99,7 +99,7 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...) ...@@ -99,7 +99,7 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...)
if (!(*debug & DEBUG_L2_FSM)) if (!(*debug & DEBUG_L2_FSM))
return; return;
va_start(va, fmt); va_start(va, fmt);
printk(KERN_DEBUG "l2 (tei %d): ", l2->tei); printk(KERN_DEBUG "l2 (sapi %d tei %d): ", l2->sapi, l2->tei);
vprintk(fmt, va); vprintk(fmt, va);
printk("\n"); printk("\n");
va_end(va); va_end(va);
...@@ -1859,20 +1859,18 @@ ph_data_indication(struct layer2 *l2, struct mISDNhead *hh, struct sk_buff *skb) ...@@ -1859,20 +1859,18 @@ ph_data_indication(struct layer2 *l2, struct mISDNhead *hh, struct sk_buff *skb)
psapi >>= 2; psapi >>= 2;
ptei >>= 1; ptei >>= 1;
if (psapi != l2->sapi) { if (psapi != l2->sapi) {
/* not our bussiness /* not our bussiness */
* printk(KERN_DEBUG "%s: sapi %d/%d sapi mismatch\n", if (*debug & DEBUG_L2)
* __func__, printk(KERN_DEBUG "%s: sapi %d/%d mismatch\n",
* psapi, l2->sapi); __func__, psapi, l2->sapi);
*/
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
} }
if ((ptei != l2->tei) && (ptei != GROUP_TEI)) { if ((ptei != l2->tei) && (ptei != GROUP_TEI)) {
/* not our bussiness /* not our bussiness */
* printk(KERN_DEBUG "%s: tei %d/%d sapi %d mismatch\n", if (*debug & DEBUG_L2)
* __func__, printk(KERN_DEBUG "%s: tei %d/%d mismatch\n",
* ptei, l2->tei, psapi); __func__, ptei, l2->tei);
*/
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
} }
...@@ -1927,8 +1925,8 @@ l2_send(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -1927,8 +1925,8 @@ l2_send(struct mISDNchannel *ch, struct sk_buff *skb)
int ret = -EINVAL; int ret = -EINVAL;
if (*debug & DEBUG_L2_RECV) if (*debug & DEBUG_L2_RECV)
printk(KERN_DEBUG "%s: prim(%x) id(%x) tei(%d)\n", printk(KERN_DEBUG "%s: prim(%x) id(%x) sapi(%d) tei(%d)\n",
__func__, hh->prim, hh->id, l2->tei); __func__, hh->prim, hh->id, l2->sapi, l2->tei);
switch (hh->prim) { switch (hh->prim) {
case PH_DATA_IND: case PH_DATA_IND:
ret = ph_data_indication(l2, hh, skb); ret = ph_data_indication(l2, hh, skb);
......
...@@ -227,7 +227,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...) ...@@ -227,7 +227,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...)
if (!(*debug & DEBUG_L2_TEIFSM)) if (!(*debug & DEBUG_L2_TEIFSM))
return; return;
va_start(va, fmt); va_start(va, fmt);
printk(KERN_DEBUG "tei(%d): ", tm->l2->tei); printk(KERN_DEBUG "sapi(%d) tei(%d): ", tm->l2->sapi, tm->l2->tei);
vprintk(fmt, va); vprintk(fmt, va);
printk("\n"); printk("\n");
va_end(va); va_end(va);
...@@ -1191,9 +1191,16 @@ check_data(struct manager *mgr, struct sk_buff *skb) ...@@ -1191,9 +1191,16 @@ check_data(struct manager *mgr, struct sk_buff *skb)
if ((skb->data[2] & ~0x10) != SABME) if ((skb->data[2] & ~0x10) != SABME)
return -ENOTCONN; return -ENOTCONN;
/* We got a SABME for a fixed TEI */ /* We got a SABME for a fixed TEI */
if (*debug & DEBUG_L2_CTRL)
printk(KERN_DEBUG "%s: SABME sapi(%d) tei(%d)\n",
__func__, sapi, tei);
l2 = create_new_tei(mgr, tei, sapi); l2 = create_new_tei(mgr, tei, sapi);
if (!l2) if (!l2) {
if (*debug & DEBUG_L2_CTRL)
printk(KERN_DEBUG "%s: failed to create new tei\n",
__func__);
return -ENOMEM; return -ENOMEM;
}
ret = l2->ch.send(&l2->ch, skb); ret = l2->ch.send(&l2->ch, skb);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment