patch-1.3.93 linux/drivers/isdn/teles/l3_1TR6.c
Next file: linux/drivers/isdn/teles/l3_1TR6.h
Previous file: linux/drivers/isdn/teles/isdnl3.c
Back to the patch index
Back to the overall index
- Lines: 116
- Date:
Sun Apr 21 11:56:15 1996
- Orig file:
v1.3.92/linux/drivers/isdn/teles/l3_1TR6.c
- Orig date:
Fri Apr 12 15:51:54 1996
diff -u --recursive --new-file v1.3.92/linux/drivers/isdn/teles/l3_1TR6.c linux/drivers/isdn/teles/l3_1TR6.c
@@ -1,4 +1,16 @@
-#define DEBUG_1TR6 0
+/* $Id: l3_1TR6.c,v 1.2 1996/04/20 16:47:23 fritz Exp $
+ *
+ * $Log: l3_1TR6.c,v $
+ * Revision 1.2 1996/04/20 16:47:23 fritz
+ * Changed statemachine to allow reject of an incoming call.
+ * Report all incoming calls, not just those with Service = 7.
+ * Misc. typos
+ *
+ * Revision 1.1 1996/04/13 10:25:16 fritz
+ * Initial revision
+ *
+ *
+ */
char *
mt_trans(int pd, int mt)
@@ -101,15 +113,15 @@
byte *p;
struct BufHeader *ibh = arg;
-#if DEBUG_1TR6
- printk(KERN_INFO "1tr6: TU_SETUP\n");
-#endif
-
p = DATAPTR(ibh);
p += st->l2.uihsize;
st->pa->callref = getcallref(p);
st->l3.callref = 0x80 + st->pa->callref;
+#if DEBUG_1TR6
+ printk(KERN_INFO "1tr6: TU_SETUP cr=%d\n",st->l3.callref);
+#endif
+
/*
* Channel Identification
*/
@@ -144,10 +156,14 @@
BufPoolRelease(ibh);
- if (st->pa->info == 7) {
- newl3state(st, 6);
- st->l3.l3l4(st, CC_SETUP_IND, NULL);
+ /* Signal all services, linklevel takes care of Service-Indicator */
+ if (st->pa->info != 7) {
+ printk(KERN_INFO "non-digital call: %s -> %s\n",
+ st->pa->calling,
+ st->pa->called);
}
+ newl3state(st, 6);
+ st->l3.l3l4(st, CC_SETUP_IND, NULL);
}
static void
@@ -413,13 +429,14 @@
l3_1tr6_disconn_req(struct PStack *st, byte pr, void *arg)
{
struct BufHeader *dibh;
- byte *p;
+ byte *p;
+ byte rejflg;
#if DEBUG_1TR6
printk(KERN_INFO "1tr6: send DISCON\n");
#endif
- BufPoolGet(&dibh, st->l1.sbufpool, GFP_ATOMIC, (void *) st, 20);
+ BufPoolGet(&dibh, st->l1.sbufpool, GFP_ATOMIC, (void *) st, 21);
p = DATAPTR(dibh);
p += st->l2.ihsize;
@@ -428,14 +445,25 @@
*p++ = st->l3.callref;
*p++ = MT_N1_DISC;
- *p++ = WE0_cause;
- *p++ = 0x0; /* Laenge = 0 normales Ausloesen */
+ if (st->l3.state == 7) {
+ rejflg = 1;
+ *p++ = WE0_cause; /* Anruf abweisen */
+ *p++ = 0x01; /* Laenge = 1 */
+ *p++ = CAUSE_CallRejected;
+ } else {
+ rejflg = 0;
+ *p++ = WE0_cause;
+ *p++ = 0x0; /* Laenge = 0 normales Ausloesen */
+ }
dibh->datasize = p - DATAPTR(dibh);
i_down(st, dibh);
- newl3state(st, 11);
+ if (rejflg)
+ newl3state(st, 0);
+ else
+ newl3state(st, 11);
}
static void
@@ -450,11 +478,13 @@
static struct stateentry downstatelist_1tr6t[] =
{
{0, CC_SETUP_REQ, l3_1tr6_setup},
+ {4, CC_DISCONNECT_REQ, l3_1tr6_disconn_req},
{6, CC_REJECT_REQ, l3_1tr6_ignore},
{6, CC_SETUP_RSP, l3_1tr6_conn},
{6, CC_ALERTING_REQ, l3_1tr6_alert},
{7, CC_SETUP_RSP, l3_1tr6_conn},
{7, CC_DISCONNECT_REQ, l3_1tr6_disconn_req},
+ {7, CC_DLRL, l3_1tr6_disconn_req},
{8, CC_DISCONNECT_REQ, l3_1tr6_disconn_req},
{10, CC_DISCONNECT_REQ, l3_1tr6_disconn_req},
{12, CC_RELEASE_REQ, l3_1tr6_rel_req}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this