From 475be4d85a274d0961593db41cf85689db1d583c Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sun, 19 Feb 2012 19:52:38 -0800 Subject: isdn: whitespace coding style cleanup isdn source code uses a not-current coding style. Update the coding style used on a per-line basis so that git diff -w shows only elided blank lines at EOF. Done with emacs and some scripts and some typing. Built x86 allyesconfig. No detected change in objdump -d or size. Signed-off-by: Joe Perches --- drivers/isdn/pcbit/callbacks.c | 303 +++++++++++---------- drivers/isdn/pcbit/callbacks.h | 28 +- drivers/isdn/pcbit/capi.c | 585 ++++++++++++++++++++--------------------- drivers/isdn/pcbit/capi.h | 46 ++-- drivers/isdn/pcbit/drv.c | 248 ++++++++--------- drivers/isdn/pcbit/edss1.c | 414 +++++++++++++++-------------- drivers/isdn/pcbit/edss1.h | 13 +- drivers/isdn/pcbit/layer2.c | 36 +-- drivers/isdn/pcbit/layer2.h | 265 +++++++++---------- drivers/isdn/pcbit/module.c | 35 ++- drivers/isdn/pcbit/pcbit.h | 32 +-- 11 files changed, 987 insertions(+), 1018 deletions(-) (limited to 'drivers/isdn/pcbit') diff --git a/drivers/isdn/pcbit/callbacks.c b/drivers/isdn/pcbit/callbacks.c index 976143b2346d..efb6d6a3639a 100644 --- a/drivers/isdn/pcbit/callbacks.c +++ b/drivers/isdn/pcbit/callbacks.c @@ -2,16 +2,16 @@ * Callbacks for the FSM * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. */ /* * Fix: 19981230 - Carlos Morgado - * Port of Nelson Escravana's fix to CalledPN + * Port of Nelson Escravana's fix to CalledPN * NULL pointer dereference in cb_in_1 (originally fixed in 2.0) */ @@ -39,86 +39,86 @@ ushort last_ref_num = 1; * */ -void cb_out_1(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *cbdata) +void cb_out_1(struct pcbit_dev *dev, struct pcbit_chan *chan, + struct callb_data *cbdata) { struct sk_buff *skb; int len; - ushort refnum; + ushort refnum; #ifdef DEBUG - printk(KERN_DEBUG "Called Party Number: %s\n", - cbdata->data.setup.CalledPN); + printk(KERN_DEBUG "Called Party Number: %s\n", + cbdata->data.setup.CalledPN); #endif - /* - * hdr - kmalloc in capi_conn_req - * - kfree when msg has been sent - */ + /* + * hdr - kmalloc in capi_conn_req + * - kfree when msg has been sent + */ - if ((len = capi_conn_req(cbdata->data.setup.CalledPN, &skb, + if ((len = capi_conn_req(cbdata->data.setup.CalledPN, &skb, chan->proto)) < 0) - { - printk("capi_conn_req failed\n"); - return; - } + { + printk("capi_conn_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; + refnum = last_ref_num++ & 0x7fffU; - chan->callref = 0; - chan->layer2link = 0; - chan->snum = 0; - chan->s_refnum = refnum; + chan->callref = 0; + chan->layer2link = 0; + chan->snum = 0; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_CONN_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_CONN_REQ, refnum, skb, len); } /* * rcv CONNECT * will go into ACTIVE state * send CONN_ACTIVE_RESP - * send Select protocol request + * send Select protocol request */ -void cb_out_2(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *data) +void cb_out_2(struct pcbit_dev *dev, struct pcbit_chan *chan, + struct callb_data *data) { - isdn_ctrl ictl; - struct sk_buff *skb; + isdn_ctrl ictl; + struct sk_buff *skb; int len; - ushort refnum; + ushort refnum; - if ((len=capi_conn_active_resp(chan, &skb)) < 0) - { - printk("capi_conn_active_req failed\n"); - return; - } + if ((len = capi_conn_active_resp(chan, &skb)) < 0) + { + printk("capi_conn_active_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_CONN_ACTV_RESP, refnum, skb, len); + pcbit_l2_write(dev, MSG_CONN_ACTV_RESP, refnum, skb, len); - ictl.command = ISDN_STAT_DCONN; - ictl.driver=dev->id; - ictl.arg=chan->id; - dev->dev_if->statcallb(&ictl); + ictl.command = ISDN_STAT_DCONN; + ictl.driver = dev->id; + ictl.arg = chan->id; + dev->dev_if->statcallb(&ictl); - /* ACTIVE D-channel */ + /* ACTIVE D-channel */ - /* Select protocol */ + /* Select protocol */ - if ((len=capi_select_proto_req(chan, &skb, 1 /*outgoing*/)) < 0) { - printk("capi_select_proto_req failed\n"); - return; - } + if ((len = capi_select_proto_req(chan, &skb, 1 /*outgoing*/)) < 0) { + printk("capi_select_proto_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_SELP_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_SELP_REQ, refnum, skb, len); } @@ -127,22 +127,22 @@ void cb_out_2(struct pcbit_dev * dev, struct pcbit_chan* chan, * inform user */ -void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *cbdata) +void cb_in_1(struct pcbit_dev *dev, struct pcbit_chan *chan, + struct callb_data *cbdata) { - isdn_ctrl ictl; - unsigned short refnum; - struct sk_buff *skb; + isdn_ctrl ictl; + unsigned short refnum; + struct sk_buff *skb; int len; - ictl.command = ISDN_STAT_ICALL; - ictl.driver=dev->id; - ictl.arg=chan->id; - - /* - * ictl.num >= strlen() + strlen() + 5 - */ + ictl.command = ISDN_STAT_ICALL; + ictl.driver = dev->id; + ictl.arg = chan->id; + + /* + * ictl.num >= strlen() + strlen() + 5 + */ if (cbdata->data.setup.CallingPN == NULL) { printk(KERN_DEBUG "NULL CallingPN to phone; using 0\n"); @@ -167,18 +167,18 @@ void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan, printk(KERN_DEBUG "statstr: %s\n", ictl.num); #endif - dev->dev_if->statcallb(&ictl); + dev->dev_if->statcallb(&ictl); + - - if ((len=capi_conn_resp(chan, &skb)) < 0) { - printk(KERN_DEBUG "capi_conn_resp failed\n"); - return; + if ((len = capi_conn_resp(chan, &skb)) < 0) { + printk(KERN_DEBUG "capi_conn_resp failed\n"); + return; } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_CONN_RESP, refnum, skb, len); + pcbit_l2_write(dev, MSG_CONN_RESP, refnum, skb, len); } /* @@ -187,24 +187,24 @@ void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan, * send CONNECT message CONNECT_ACTIVE_REQ in CAPI */ -void cb_in_2(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_in_2(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { - unsigned short refnum; + unsigned short refnum; struct sk_buff *skb; - int len; - - if ((len = capi_conn_active_req(chan, &skb)) < 0) { - printk(KERN_DEBUG "capi_conn_active_req failed\n"); - return; - } + int len; + + if ((len = capi_conn_active_req(chan, &skb)) < 0) { + printk(KERN_DEBUG "capi_conn_active_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; printk(KERN_DEBUG "sending MSG_CONN_ACTV_REQ\n"); - pcbit_l2_write(dev, MSG_CONN_ACTV_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_CONN_ACTV_REQ, refnum, skb, len); } /* @@ -213,23 +213,23 @@ void cb_in_2(struct pcbit_dev * dev, struct pcbit_chan* chan, * */ -void cb_in_3(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_in_3(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { - unsigned short refnum; - struct sk_buff *skb; + unsigned short refnum; + struct sk_buff *skb; int len; - - if ((len = capi_select_proto_req(chan, &skb, 0 /*incoming*/)) < 0) - { - printk("capi_select_proto_req failed\n"); - return; - } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + if ((len = capi_select_proto_req(chan, &skb, 0 /*incoming*/)) < 0) + { + printk("capi_select_proto_req failed\n"); + return; + } + + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_SELP_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_SELP_REQ, refnum, skb, len); } @@ -239,52 +239,52 @@ void cb_in_3(struct pcbit_dev * dev, struct pcbit_chan* chan, * send disconnect resp * send msg to user */ -void cb_disc_1(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_disc_1(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { - struct sk_buff *skb; + struct sk_buff *skb; int len; - ushort refnum; - isdn_ctrl ictl; - - if ((len = capi_disc_resp(chan, &skb)) < 0) { - printk("capi_disc_resp failed\n"); - return; - } - - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; - - pcbit_l2_write(dev, MSG_DISC_RESP, refnum, skb, len); - - ictl.command = ISDN_STAT_BHUP; - ictl.driver=dev->id; - ictl.arg=chan->id; - dev->dev_if->statcallb(&ictl); + ushort refnum; + isdn_ctrl ictl; + + if ((len = capi_disc_resp(chan, &skb)) < 0) { + printk("capi_disc_resp failed\n"); + return; + } + + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; + + pcbit_l2_write(dev, MSG_DISC_RESP, refnum, skb, len); + + ictl.command = ISDN_STAT_BHUP; + ictl.driver = dev->id; + ictl.arg = chan->id; + dev->dev_if->statcallb(&ictl); } - + /* * User HANGUP on active/call proceeding state * send disc.req */ -void cb_disc_2(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_disc_2(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { - struct sk_buff *skb; + struct sk_buff *skb; int len; - ushort refnum; + ushort refnum; - if ((len = capi_disc_req(chan->callref, &skb, CAUSE_NORMAL)) < 0) - { - printk("capi_disc_req failed\n"); - return; - } + if ((len = capi_disc_req(chan->callref, &skb, CAUSE_NORMAL)) < 0) + { + printk("capi_disc_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_DISC_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_DISC_REQ, refnum, skb, len); } /* @@ -292,18 +292,18 @@ void cb_disc_2(struct pcbit_dev * dev, struct pcbit_chan* chan, * Problem: when the HL driver sends the disc req itself * LL receives BHUP */ -void cb_disc_3(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_disc_3(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { - isdn_ctrl ictl; + isdn_ctrl ictl; - ictl.command = ISDN_STAT_BHUP; - ictl.driver=dev->id; - ictl.arg=chan->id; - dev->dev_if->statcallb(&ictl); + ictl.command = ISDN_STAT_BHUP; + ictl.driver = dev->id; + ictl.arg = chan->id; + dev->dev_if->statcallb(&ictl); } -void cb_notdone(struct pcbit_dev * dev, struct pcbit_chan* chan, +void cb_notdone(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data) { } @@ -311,38 +311,35 @@ void cb_notdone(struct pcbit_dev * dev, struct pcbit_chan* chan, /* * send activate b-chan protocol */ -void cb_selp_1(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *data) +void cb_selp_1(struct pcbit_dev *dev, struct pcbit_chan *chan, + struct callb_data *data) { - struct sk_buff *skb; + struct sk_buff *skb; int len; - ushort refnum; + ushort refnum; - if ((len = capi_activate_transp_req(chan, &skb)) < 0) - { - printk("capi_conn_activate_transp_req failed\n"); - return; - } + if ((len = capi_activate_transp_req(chan, &skb)) < 0) + { + printk("capi_conn_activate_transp_req failed\n"); + return; + } - refnum = last_ref_num++ & 0x7fffU; - chan->s_refnum = refnum; + refnum = last_ref_num++ & 0x7fffU; + chan->s_refnum = refnum; - pcbit_l2_write(dev, MSG_ACT_TRANSP_REQ, refnum, skb, len); + pcbit_l2_write(dev, MSG_ACT_TRANSP_REQ, refnum, skb, len); } /* * Inform User that the B-channel is available */ -void cb_open(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *data) +void cb_open(struct pcbit_dev *dev, struct pcbit_chan *chan, + struct callb_data *data) { - isdn_ctrl ictl; + isdn_ctrl ictl; - ictl.command = ISDN_STAT_BCONN; - ictl.driver=dev->id; - ictl.arg=chan->id; - dev->dev_if->statcallb(&ictl); + ictl.command = ISDN_STAT_BCONN; + ictl.driver = dev->id; + ictl.arg = chan->id; + dev->dev_if->statcallb(&ictl); } - - - diff --git a/drivers/isdn/pcbit/callbacks.h b/drivers/isdn/pcbit/callbacks.h index 17aa0f54bfc3..a036b4a7ffad 100644 --- a/drivers/isdn/pcbit/callbacks.h +++ b/drivers/isdn/pcbit/callbacks.h @@ -2,10 +2,10 @@ * Callbacks prototypes for FSM * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. */ @@ -13,34 +13,32 @@ #define CALLBACKS_H -extern void cb_out_1(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_out_1(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_out_2(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_out_2(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_in_1(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_in_2(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_in_2(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_in_3(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_in_3(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_disc_1(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_disc_1(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_disc_2(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_disc_2(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_disc_3(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_disc_3(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_notdone(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_notdone(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_selp_1(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_selp_1(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); -extern void cb_open(struct pcbit_dev * dev, struct pcbit_chan* chan, +extern void cb_open(struct pcbit_dev *dev, struct pcbit_chan *chan, struct callb_data *data); #endif - - diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c index ac5a91ccde81..4e3cbf857d60 100644 --- a/drivers/isdn/pcbit/capi.c +++ b/drivers/isdn/pcbit/capi.c @@ -3,10 +3,10 @@ * Portugal Telecom CAPI 2.0 * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. * * Not compatible with the AVM Gmbh. CAPI 2.0 @@ -51,39 +51,39 @@ * */ -int capi_conn_req(const char * calledPN, struct sk_buff **skb, int proto) +int capi_conn_req(const char *calledPN, struct sk_buff **skb, int proto) { - ushort len; - - /* - * length - * AppInfoMask - 2 - * BC0 - 3 - * BC1 - 1 - * Chan - 2 - * Keypad - 1 - * CPN - 1 - * CPSA - 1 - * CalledPN - 2 + strlen - * CalledPSA - 1 - * rest... - 4 - * ---------------- - * Total 18 + strlen - */ - - len = 18 + strlen(calledPN); + ushort len; + + /* + * length + * AppInfoMask - 2 + * BC0 - 3 + * BC1 - 1 + * Chan - 2 + * Keypad - 1 + * CPN - 1 + * CPSA - 1 + * CalledPN - 2 + strlen + * CalledPSA - 1 + * rest... - 4 + * ---------------- + * Total 18 + strlen + */ + + len = 18 + strlen(calledPN); if (proto == ISDN_PROTO_L2_TRANS) len++; if ((*skb = dev_alloc_skb(len)) == NULL) { - - printk(KERN_WARNING "capi_conn_req: alloc_skb failed\n"); + + printk(KERN_WARNING "capi_conn_req: alloc_skb failed\n"); return -1; } - /* InfoElmMask */ - *((ushort*) skb_put(*skb, 2)) = AppInfoMask; + /* InfoElmMask */ + *((ushort *)skb_put(*skb, 2)) = AppInfoMask; if (proto == ISDN_PROTO_L2_TRANS) { @@ -101,162 +101,162 @@ int capi_conn_req(const char * calledPN, struct sk_buff **skb, int proto) *(skb_put(*skb, 1)) = 0x90; /* BC0.Octect4 */ } - /* Bearer Capability - Optional*/ - *(skb_put(*skb, 1)) = 0; /* BC1.Length = 0 */ + /* Bearer Capability - Optional*/ + *(skb_put(*skb, 1)) = 0; /* BC1.Length = 0 */ - *(skb_put(*skb, 1)) = 1; /* ChannelID.Length = 1 */ - *(skb_put(*skb, 1)) = 0x83; /* Basic Interface - Any Channel */ + *(skb_put(*skb, 1)) = 1; /* ChannelID.Length = 1 */ + *(skb_put(*skb, 1)) = 0x83; /* Basic Interface - Any Channel */ - *(skb_put(*skb, 1)) = 0; /* Keypad.Length = 0 */ - + *(skb_put(*skb, 1)) = 0; /* Keypad.Length = 0 */ - *(skb_put(*skb, 1)) = 0; /* CallingPN.Length = 0 */ - *(skb_put(*skb, 1)) = 0; /* CallingPSA.Length = 0 */ - /* Called Party Number */ - *(skb_put(*skb, 1)) = strlen(calledPN) + 1; - *(skb_put(*skb, 1)) = 0x81; - memcpy(skb_put(*skb, strlen(calledPN)), calledPN, strlen(calledPN)); + *(skb_put(*skb, 1)) = 0; /* CallingPN.Length = 0 */ + *(skb_put(*skb, 1)) = 0; /* CallingPSA.Length = 0 */ - /* '#' */ + /* Called Party Number */ + *(skb_put(*skb, 1)) = strlen(calledPN) + 1; + *(skb_put(*skb, 1)) = 0x81; + memcpy(skb_put(*skb, strlen(calledPN)), calledPN, strlen(calledPN)); - *(skb_put(*skb, 1)) = 0; /* CalledPSA.Length = 0 */ + /* '#' */ - /* LLC.Length = 0; */ - /* HLC0.Length = 0; */ - /* HLC1.Length = 0; */ - /* UTUS.Length = 0; */ - memset(skb_put(*skb, 4), 0, 4); + *(skb_put(*skb, 1)) = 0; /* CalledPSA.Length = 0 */ - return len; + /* LLC.Length = 0; */ + /* HLC0.Length = 0; */ + /* HLC1.Length = 0; */ + /* UTUS.Length = 0; */ + memset(skb_put(*skb, 4), 0, 4); + + return len; } -int capi_conn_resp(struct pcbit_chan* chan, struct sk_buff **skb) +int capi_conn_resp(struct pcbit_chan *chan, struct sk_buff **skb) { - + if ((*skb = dev_alloc_skb(5)) == NULL) { - + printk(KERN_WARNING "capi_conn_resp: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; - *(skb_put(*skb, 1)) = 0x01; /* ACCEPT_CALL */ - *(skb_put(*skb, 1)) = 0; - *(skb_put(*skb, 1)) = 0; + *((ushort *)skb_put(*skb, 2)) = chan->callref; + *(skb_put(*skb, 1)) = 0x01; /* ACCEPT_CALL */ + *(skb_put(*skb, 1)) = 0; + *(skb_put(*skb, 1)) = 0; - return 5; + return 5; } -int capi_conn_active_req(struct pcbit_chan* chan, struct sk_buff **skb) +int capi_conn_active_req(struct pcbit_chan *chan, struct sk_buff **skb) { - /* - * 8 bytes - */ - + /* + * 8 bytes + */ + if ((*skb = dev_alloc_skb(8)) == NULL) { - + printk(KERN_WARNING "capi_conn_active_req: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; #ifdef DEBUG - printk(KERN_DEBUG "Call Reference: %04x\n", chan->callref); + printk(KERN_DEBUG "Call Reference: %04x\n", chan->callref); #endif - *(skb_put(*skb, 1)) = 0; /* BC.Length = 0; */ - *(skb_put(*skb, 1)) = 0; /* ConnectedPN.Length = 0 */ - *(skb_put(*skb, 1)) = 0; /* PSA.Length */ - *(skb_put(*skb, 1)) = 0; /* LLC.Length = 0; */ - *(skb_put(*skb, 1)) = 0; /* HLC.Length = 0; */ - *(skb_put(*skb, 1)) = 0; /* UTUS.Length = 0; */ + *(skb_put(*skb, 1)) = 0; /* BC.Length = 0; */ + *(skb_put(*skb, 1)) = 0; /* ConnectedPN.Length = 0 */ + *(skb_put(*skb, 1)) = 0; /* PSA.Length */ + *(skb_put(*skb, 1)) = 0; /* LLC.Length = 0; */ + *(skb_put(*skb, 1)) = 0; /* HLC.Length = 0; */ + *(skb_put(*skb, 1)) = 0; /* UTUS.Length = 0; */ return 8; } -int capi_conn_active_resp(struct pcbit_chan* chan, struct sk_buff **skb) +int capi_conn_active_resp(struct pcbit_chan *chan, struct sk_buff **skb) { - /* - * 2 bytes - */ - + /* + * 2 bytes + */ + if ((*skb = dev_alloc_skb(2)) == NULL) { - + printk(KERN_WARNING "capi_conn_active_resp: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; - return 2; + return 2; } -int capi_select_proto_req(struct pcbit_chan *chan, struct sk_buff **skb, - int outgoing) +int capi_select_proto_req(struct pcbit_chan *chan, struct sk_buff **skb, + int outgoing) { - /* - * 18 bytes - */ + /* + * 18 bytes + */ if ((*skb = dev_alloc_skb(18)) == NULL) { - + printk(KERN_WARNING "capi_select_proto_req: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; - /* Layer2 protocol */ + /* Layer2 protocol */ - switch (chan->proto) { - case ISDN_PROTO_L2_X75I: - *(skb_put(*skb, 1)) = 0x05; /* LAPB */ - break; - case ISDN_PROTO_L2_HDLC: - *(skb_put(*skb, 1)) = 0x02; - break; + switch (chan->proto) { + case ISDN_PROTO_L2_X75I: + *(skb_put(*skb, 1)) = 0x05; /* LAPB */ + break; + case ISDN_PROTO_L2_HDLC: + *(skb_put(*skb, 1)) = 0x02; + break; case ISDN_PROTO_L2_TRANS: - /* + /* * Voice (a-law) */ *(skb_put(*skb, 1)) = 0x06; break; - default: -#ifdef DEBUG - printk(KERN_DEBUG "Transparent\n"); + default: +#ifdef DEBUG + printk(KERN_DEBUG "Transparent\n"); #endif - *(skb_put(*skb, 1)) = 0x03; - break; - } - - *(skb_put(*skb, 1)) = (outgoing ? 0x02 : 0x42); /* Don't ask */ - *(skb_put(*skb, 1)) = 0x00; - - *((ushort *) skb_put(*skb, 2)) = MRU; - - - *(skb_put(*skb, 1)) = 0x08; /* Modulo */ - *(skb_put(*skb, 1)) = 0x07; /* Max Window */ - - *(skb_put(*skb, 1)) = 0x01; /* No Layer3 Protocol */ - - /* - * 2 - layer3 MTU [10] - * - Modulo [12] - * - Window - * - layer1 proto [14] - * - bitrate - * - sub-channel [16] - * - layer1dataformat [17] - */ - - memset(skb_put(*skb, 8), 0, 8); - - return 18; + *(skb_put(*skb, 1)) = 0x03; + break; + } + + *(skb_put(*skb, 1)) = (outgoing ? 0x02 : 0x42); /* Don't ask */ + *(skb_put(*skb, 1)) = 0x00; + + *((ushort *) skb_put(*skb, 2)) = MRU; + + + *(skb_put(*skb, 1)) = 0x08; /* Modulo */ + *(skb_put(*skb, 1)) = 0x07; /* Max Window */ + + *(skb_put(*skb, 1)) = 0x01; /* No Layer3 Protocol */ + + /* + * 2 - layer3 MTU [10] + * - Modulo [12] + * - Window + * - layer1 proto [14] + * - bitrate + * - sub-channel [16] + * - layer1dataformat [17] + */ + + memset(skb_put(*skb, 8), 0, 8); + + return 18; } @@ -264,45 +264,45 @@ int capi_activate_transp_req(struct pcbit_chan *chan, struct sk_buff **skb) { if ((*skb = dev_alloc_skb(7)) == NULL) { - + printk(KERN_WARNING "capi_activate_transp_req: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; - - *(skb_put(*skb, 1)) = chan->layer2link; /* Layer2 id */ - *(skb_put(*skb, 1)) = 0x00; /* Transmit by default */ - *((ushort *) skb_put(*skb, 2)) = MRU; + *(skb_put(*skb, 1)) = chan->layer2link; /* Layer2 id */ + *(skb_put(*skb, 1)) = 0x00; /* Transmit by default */ - *(skb_put(*skb, 1)) = 0x01; /* Enables reception*/ + *((ushort *) skb_put(*skb, 2)) = MRU; - return 7; + *(skb_put(*skb, 1)) = 0x01; /* Enables reception*/ + + return 7; } -int capi_tdata_req(struct pcbit_chan* chan, struct sk_buff *skb) +int capi_tdata_req(struct pcbit_chan *chan, struct sk_buff *skb) { ushort data_len; - - /* - * callref - 2 + + /* + * callref - 2 * layer2link - 1 - * wBlockLength - 2 + * wBlockLength - 2 * data - 4 * sernum - 1 */ - + data_len = skb->len; - if(skb_headroom(skb) < 10) + if (skb_headroom(skb) < 10) { printk(KERN_CRIT "No headspace (%u) on headroom %p for capi header\n", skb_headroom(skb), skb); } else - { + { skb_push(skb, 10); } @@ -318,58 +318,58 @@ int capi_tdata_req(struct pcbit_chan* chan, struct sk_buff *skb) return 10; } -int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff ** skb) - +int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff **skb) + { if ((*skb = dev_alloc_skb(4)) == NULL) { - + printk(KERN_WARNING "capi_tdata_resp: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; - *(skb_put(*skb, 1)) = chan->layer2link; - *(skb_put(*skb, 1)) = chan->r_refnum; + *(skb_put(*skb, 1)) = chan->layer2link; + *(skb_put(*skb, 1)) = chan->r_refnum; - return (*skb)->len; + return (*skb)->len; } int capi_disc_req(ushort callref, struct sk_buff **skb, u_char cause) { if ((*skb = dev_alloc_skb(6)) == NULL) { - + printk(KERN_WARNING "capi_disc_req: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2) ) = callref; + *((ushort *)skb_put(*skb, 2)) = callref; - *(skb_put(*skb, 1)) = 2; /* Cause.Length = 2; */ - *(skb_put(*skb, 1)) = 0x80; - *(skb_put(*skb, 1)) = 0x80 | cause; + *(skb_put(*skb, 1)) = 2; /* Cause.Length = 2; */ + *(skb_put(*skb, 1)) = 0x80; + *(skb_put(*skb, 1)) = 0x80 | cause; - /* - * Change it: we should send 'Sic transit gloria Mundi' here ;-) - */ + /* + * Change it: we should send 'Sic transit gloria Mundi' here ;-) + */ - *(skb_put(*skb, 1)) = 0; /* UTUS.Length = 0; */ + *(skb_put(*skb, 1)) = 0; /* UTUS.Length = 0; */ - return 6; + return 6; } int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb) { if ((*skb = dev_alloc_skb(2)) == NULL) { - + printk(KERN_WARNING "capi_disc_resp: alloc_skb failed\n"); return -1; } - *((ushort*) skb_put(*skb, 2)) = chan->callref; + *((ushort *)skb_put(*skb, 2)) = chan->callref; - return 2; + return 2; } @@ -378,57 +378,57 @@ int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb) * */ -int capi_decode_conn_ind(struct pcbit_chan * chan, - struct sk_buff *skb, - struct callb_data *info) +int capi_decode_conn_ind(struct pcbit_chan *chan, + struct sk_buff *skb, + struct callb_data *info) { - int CIlen, len; + int CIlen, len; - /* Call Reference [CAPI] */ - chan->callref = *((ushort*) skb->data); - skb_pull(skb, 2); + /* Call Reference [CAPI] */ + chan->callref = *((ushort *)skb->data); + skb_pull(skb, 2); #ifdef DEBUG - printk(KERN_DEBUG "Call Reference: %04x\n", chan->callref); + printk(KERN_DEBUG "Call Reference: %04x\n", chan->callref); #endif - /* Channel Identification */ + /* Channel Identification */ - /* Expect - Len = 1 - Octect 3 = 0100 10CC - [ 7 Basic, 4 , 2-1 chan ] - */ + /* Expect + Len = 1 + Octect 3 = 0100 10CC - [ 7 Basic, 4 , 2-1 chan ] + */ - CIlen = skb->data[0]; + CIlen = skb->data[0]; #ifdef DEBUG - if (CIlen == 1) { + if (CIlen == 1) { - if ( ((skb->data[1]) & 0xFC) == 0x48 ) - printk(KERN_DEBUG "decode_conn_ind: chan ok\n"); - printk(KERN_DEBUG "phyChan = %d\n", skb->data[1] & 0x03); - } + if (((skb->data[1]) & 0xFC) == 0x48) + printk(KERN_DEBUG "decode_conn_ind: chan ok\n"); + printk(KERN_DEBUG "phyChan = %d\n", skb->data[1] & 0x03); + } else printk(KERN_DEBUG "conn_ind: CIlen = %d\n", CIlen); #endif - skb_pull(skb, CIlen + 1); + skb_pull(skb, CIlen + 1); - /* Calling Party Number */ - /* An "additional service" as far as Portugal Telecom is concerned */ + /* Calling Party Number */ + /* An "additional service" as far as Portugal Telecom is concerned */ - len = skb->data[0]; + len = skb->data[0]; if (len > 0) { int count = 1; - + #ifdef DEBUG printk(KERN_DEBUG "CPN: Octect 3 %02x\n", skb->data[1]); #endif if ((skb->data[1] & 0x80) == 0) count = 2; - + if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC))) return -1; - + skb_copy_from_linear_data_offset(skb, count + 1, info->data.setup.CallingPN, len - count); @@ -442,22 +442,22 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, skb_pull(skb, len + 1); - /* Calling Party Subaddress */ - skb_pull(skb, skb->data[0] + 1); + /* Calling Party Subaddress */ + skb_pull(skb, skb->data[0] + 1); - /* Called Party Number */ + /* Called Party Number */ - len = skb->data[0]; + len = skb->data[0]; if (len > 0) { int count = 1; - + if ((skb->data[1] & 0x80) == 0) count = 2; - + if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC))) return -1; - + skb_copy_from_linear_data_offset(skb, count + 1, info->data.setup.CalledPN, len - count); @@ -471,73 +471,73 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, skb_pull(skb, len + 1); - /* Called Party Subaddress */ - skb_pull(skb, skb->data[0] + 1); + /* Called Party Subaddress */ + skb_pull(skb, skb->data[0] + 1); - /* LLC */ - skb_pull(skb, skb->data[0] + 1); + /* LLC */ + skb_pull(skb, skb->data[0] + 1); - /* HLC */ - skb_pull(skb, skb->data[0] + 1); + /* HLC */ + skb_pull(skb, skb->data[0] + 1); - /* U2U */ - skb_pull(skb, skb->data[0] + 1); + /* U2U */ + skb_pull(skb, skb->data[0] + 1); - return 0; + return 0; } /* * returns errcode */ -int capi_decode_conn_conf(struct pcbit_chan * chan, struct sk_buff *skb, - int *complete) +int capi_decode_conn_conf(struct pcbit_chan *chan, struct sk_buff *skb, + int *complete) { - int errcode; - - chan->callref = *((ushort *) skb->data); /* Update CallReference */ - skb_pull(skb, 2); + int errcode; + + chan->callref = *((ushort *)skb->data); /* Update CallReference */ + skb_pull(skb, 2); + + errcode = *((ushort *) skb->data); /* read errcode */ + skb_pull(skb, 2); - errcode = *((ushort *) skb->data); /* read errcode */ - skb_pull(skb, 2); + *complete = *(skb->data); + skb_pull(skb, 1); - *complete = *(skb->data); - skb_pull(skb, 1); + /* FIX ME */ + /* This is actually a firmware bug */ + if (!*complete) + { + printk(KERN_DEBUG "complete=%02x\n", *complete); + *complete = 1; + } - /* FIX ME */ - /* This is actually a firmware bug */ - if (!*complete) - { - printk(KERN_DEBUG "complete=%02x\n", *complete); - *complete = 1; - } + /* Optional Bearer Capability */ + skb_pull(skb, *(skb->data) + 1); - /* Optional Bearer Capability */ - skb_pull(skb, *(skb->data) + 1); - - /* Channel Identification */ - skb_pull(skb, *(skb->data) + 1); + /* Channel Identification */ + skb_pull(skb, *(skb->data) + 1); - /* High Layer Compatibility follows */ - skb_pull(skb, *(skb->data) + 1); + /* High Layer Compatibility follows */ + skb_pull(skb, *(skb->data) + 1); - return errcode; + return errcode; } -int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb) +int capi_decode_conn_actv_ind(struct pcbit_chan *chan, struct sk_buff *skb) { - ushort len; + ushort len; #ifdef DEBUG - char str[32]; + char str[32]; #endif - /* Yet Another Bearer Capability */ - skb_pull(skb, *(skb->data) + 1); - + /* Yet Another Bearer Capability */ + skb_pull(skb, *(skb->data) + 1); - /* Connected Party Number */ - len=*(skb->data); + + /* Connected Party Number */ + len = *(skb->data); #ifdef DEBUG if (len > 1 && len < 31) { @@ -549,106 +549,101 @@ int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb) printk(KERN_DEBUG "actv_ind CPN len = %d\n", len); #endif - skb_pull(skb, len + 1); + skb_pull(skb, len + 1); - /* Connected Subaddress */ - skb_pull(skb, *(skb->data) + 1); + /* Connected Subaddress */ + skb_pull(skb, *(skb->data) + 1); - /* Low Layer Capability */ - skb_pull(skb, *(skb->data) + 1); + /* Low Layer Capability */ + skb_pull(skb, *(skb->data) + 1); - /* High Layer Capability */ - skb_pull(skb, *(skb->data) + 1); + /* High Layer Capability */ + skb_pull(skb, *(skb->data) + 1); - return 0; + return 0; } -int capi_decode_conn_actv_conf(struct pcbit_chan * chan, struct sk_buff *skb) +int capi_decode_conn_actv_conf(struct pcbit_chan *chan, struct sk_buff *skb) { - ushort errcode; - - errcode = *((ushort*) skb->data); - skb_pull(skb, 2); - - /* Channel Identification - skb_pull(skb, skb->data[0] + 1); - */ - return errcode; + ushort errcode; + + errcode = *((ushort *)skb->data); + skb_pull(skb, 2); + + /* Channel Identification + skb_pull(skb, skb->data[0] + 1); + */ + return errcode; } int capi_decode_sel_proto_conf(struct pcbit_chan *chan, struct sk_buff *skb) { - ushort errcode; - - chan->layer2link = *(skb->data); - skb_pull(skb, 1); + ushort errcode; - errcode = *((ushort*) skb->data); - skb_pull(skb, 2); + chan->layer2link = *(skb->data); + skb_pull(skb, 1); - return errcode; + errcode = *((ushort *)skb->data); + skb_pull(skb, 2); + + return errcode; } int capi_decode_actv_trans_conf(struct pcbit_chan *chan, struct sk_buff *skb) { - ushort errcode; + ushort errcode; - if (chan->layer2link != *(skb->data) ) - printk("capi_decode_actv_trans_conf: layer2link doesn't match\n"); + if (chan->layer2link != *(skb->data)) + printk("capi_decode_actv_trans_conf: layer2link doesn't match\n"); - skb_pull(skb, 1); + skb_pull(skb, 1); - errcode = *((ushort*) skb->data); - skb_pull(skb, 2); + errcode = *((ushort *)skb->data); + skb_pull(skb, 2); - return errcode; + return errcode; } int capi_decode_disc_ind(struct pcbit_chan *chan, struct sk_buff *skb) { - ushort len; + ushort len; #ifdef DEBUG - int i; + int i; #endif - /* Cause */ - - len = *(skb->data); - skb_pull(skb, 1); + /* Cause */ + + len = *(skb->data); + skb_pull(skb, 1); #ifdef DEBUG - for (i=0; idata + i)); + for (i = 0; i < len; i++) + printk(KERN_DEBUG "Cause Octect %d: %02x\n", i + 3, + *(skb->data + i)); #endif - skb_pull(skb, len); + skb_pull(skb, len); - return 0; + return 0; } #ifdef DEBUG int capi_decode_debug_188(u_char *hdr, ushort hdrlen) { - char str[64]; - int len; - - len = hdr[0]; - - if (len < 64 && len == hdrlen - 1) { - memcpy(str, hdr + 1, hdrlen - 1); - str[hdrlen - 1] = 0; - printk("%s\n", str); - } - else - printk("debug message incorrect\n"); - - return 0; -} -#endif - - + char str[64]; + int len; + len = hdr[0]; + if (len < 64 && len == hdrlen - 1) { + memcpy(str, hdr + 1, hdrlen - 1); + str[hdrlen - 1] = 0; + printk("%s\n", str); + } + else + printk("debug message incorrect\n"); + return 0; +} +#endif diff --git a/drivers/isdn/pcbit/capi.h b/drivers/isdn/pcbit/capi.h index df8e73c04d7f..635f63476944 100644 --- a/drivers/isdn/pcbit/capi.h +++ b/drivers/isdn/pcbit/capi.h @@ -2,10 +2,10 @@ * CAPI encode/decode prototypes and defines * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. */ @@ -15,42 +15,42 @@ #define REQ_CAUSE 0x01 #define REQ_DISPLAY 0x04 -#define REQ_USER_TO_USER 0x08 +#define REQ_USER_TO_USER 0x08 -#define AppInfoMask REQ_CAUSE|REQ_DISPLAY|REQ_USER_TO_USER +#define AppInfoMask REQ_CAUSE | REQ_DISPLAY | REQ_USER_TO_USER /* Connection Setup */ -extern int capi_conn_req(const char * calledPN, struct sk_buff **buf, +extern int capi_conn_req(const char *calledPN, struct sk_buff **buf, int proto); -extern int capi_decode_conn_conf(struct pcbit_chan * chan, struct sk_buff *skb, - int *complete); +extern int capi_decode_conn_conf(struct pcbit_chan *chan, struct sk_buff *skb, + int *complete); -extern int capi_decode_conn_ind(struct pcbit_chan * chan, struct sk_buff *skb, +extern int capi_decode_conn_ind(struct pcbit_chan *chan, struct sk_buff *skb, struct callb_data *info); -extern int capi_conn_resp(struct pcbit_chan* chan, struct sk_buff **skb); +extern int capi_conn_resp(struct pcbit_chan *chan, struct sk_buff **skb); -extern int capi_conn_active_req(struct pcbit_chan* chan, struct sk_buff **skb); -extern int capi_decode_conn_actv_conf(struct pcbit_chan * chan, +extern int capi_conn_active_req(struct pcbit_chan *chan, struct sk_buff **skb); +extern int capi_decode_conn_actv_conf(struct pcbit_chan *chan, struct sk_buff *skb); -extern int capi_decode_conn_actv_ind(struct pcbit_chan * chan, +extern int capi_decode_conn_actv_ind(struct pcbit_chan *chan, struct sk_buff *skb); -extern int capi_conn_active_resp(struct pcbit_chan* chan, +extern int capi_conn_active_resp(struct pcbit_chan *chan, struct sk_buff **skb); /* Data */ extern int capi_select_proto_req(struct pcbit_chan *chan, struct sk_buff **skb, int outgoing); -extern int capi_decode_sel_proto_conf(struct pcbit_chan *chan, +extern int capi_decode_sel_proto_conf(struct pcbit_chan *chan, struct sk_buff *skb); -extern int capi_activate_transp_req(struct pcbit_chan *chan, +extern int capi_activate_transp_req(struct pcbit_chan *chan, struct sk_buff **skb); -extern int capi_decode_actv_trans_conf(struct pcbit_chan *chan, +extern int capi_decode_actv_trans_conf(struct pcbit_chan *chan, struct sk_buff *skb); -extern int capi_tdata_req(struct pcbit_chan* chan, struct sk_buff *skb); -extern int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff ** skb); +extern int capi_tdata_req(struct pcbit_chan *chan, struct sk_buff *skb); +extern int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff **skb); /* Connection Termination */ extern int capi_disc_req(ushort callref, struct sk_buff **skb, u_char cause); @@ -62,12 +62,12 @@ extern int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb); extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen); #endif -static inline struct pcbit_chan * +static inline struct pcbit_chan * capi_channel(struct pcbit_dev *dev, struct sk_buff *skb) { ushort callref; - callref = *((ushort*) skb->data); + callref = *((ushort *)skb->data); skb_pull(skb, 2); if (dev->b1->callref == callref) @@ -79,9 +79,3 @@ capi_channel(struct pcbit_dev *dev, struct sk_buff *skb) } #endif - - - - - - diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 1507d2e83fbb..1eaf62273903 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -2,10 +2,10 @@ * PCBIT-D interface with isdn4linux * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. */ @@ -14,7 +14,7 @@ * * Nuno Grilo * fixed msn_list NULL pointer dereference. - * + * */ #include @@ -43,9 +43,9 @@ extern ushort last_ref_num; -static int pcbit_ioctl(isdn_ctrl* ctl); +static int pcbit_ioctl(isdn_ctrl *ctl); -static char* pcbit_devname[MAX_PCBIT_CARDS] = { +static char *pcbit_devname[MAX_PCBIT_CARDS] = { "pcbit0", "pcbit1", "pcbit2", @@ -56,12 +56,12 @@ static char* pcbit_devname[MAX_PCBIT_CARDS] = { * prototypes */ -static int pcbit_command(isdn_ctrl* ctl); -static int pcbit_stat(u_char __user * buf, int len, int, int); +static int pcbit_command(isdn_ctrl *ctl); +static int pcbit_stat(u_char __user *buf, int len, int, int); static int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb); static int pcbit_writecmd(const u_char __user *, int, int, int); -static int set_protocol_running(struct pcbit_dev * dev); +static int set_protocol_running(struct pcbit_dev *dev); static void pcbit_clear_msn(struct pcbit_dev *dev); static void pcbit_set_msn(struct pcbit_dev *dev, char *list); @@ -73,7 +73,7 @@ int pcbit_init_dev(int board, int mem_base, int irq) struct pcbit_dev *dev; isdn_if *dev_if; - if ((dev=kzalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL) + if ((dev = kzalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL) { printk("pcbit_init: couldn't malloc pcbit_dev struct\n"); return -ENOMEM; @@ -83,19 +83,19 @@ int pcbit_init_dev(int board, int mem_base, int irq) init_waitqueue_head(&dev->set_running_wq); spin_lock_init(&dev->lock); - if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) { + if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF) { dev->ph_mem = mem_base; if (!request_mem_region(dev->ph_mem, 4096, "PCBIT mem")) { printk(KERN_WARNING - "PCBIT: memory region %lx-%lx already in use\n", - dev->ph_mem, dev->ph_mem + 4096); + "PCBIT: memory region %lx-%lx already in use\n", + dev->ph_mem, dev->ph_mem + 4096); kfree(dev); dev_pcbit[board] = NULL; return -EACCES; } dev->sh_mem = ioremap(dev->ph_mem, 4096); } - else + else { printk("memory address invalid"); kfree(dev); @@ -111,7 +111,7 @@ int pcbit_init_dev(int board, int mem_base, int irq) kfree(dev); return -ENOMEM; } - + dev->b2 = kzalloc(sizeof(struct pcbit_chan), GFP_KERNEL); if (!dev->b2) { printk("pcbit_init: couldn't malloc pcbit_chan struct\n"); @@ -130,7 +130,7 @@ int pcbit_init_dev(int board, int mem_base, int irq) * interrupts */ - if (request_irq(irq, &pcbit_irq_handler, 0, pcbit_devname[board], dev) != 0) + if (request_irq(irq, &pcbit_irq_handler, 0, pcbit_devname[board], dev) != 0) { kfree(dev->b1); kfree(dev->b2); @@ -168,16 +168,16 @@ int pcbit_init_dev(int board, int mem_base, int irq) dev_if->owner = THIS_MODULE; dev_if->channels = 2; - - dev_if->features = (ISDN_FEATURE_P_EURO | ISDN_FEATURE_L3_TRANS | - ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS ); + + dev_if->features = (ISDN_FEATURE_P_EURO | ISDN_FEATURE_L3_TRANS | + ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS); dev_if->writebuf_skb = pcbit_xmit; dev_if->hl_hdrlen = 16; dev_if->maxbufsize = MAXBUFSIZE; dev_if->command = pcbit_command; - + dev_if->writecmd = pcbit_writecmd; dev_if->readstat = pcbit_stat; @@ -211,12 +211,12 @@ int pcbit_init_dev(int board, int mem_base, int irq) #ifdef MODULE void pcbit_terminate(int board) { - struct pcbit_dev * dev; + struct pcbit_dev *dev; dev = dev_pcbit[board]; if (dev) { - /* unregister_isdn(dev->dev_if); */ + /* unregister_isdn(dev->dev_if); */ free_irq(dev->irq, dev); pcbit_clear_msn(dev); kfree(dev->dev_if); @@ -233,9 +233,9 @@ void pcbit_terminate(int board) } #endif -static int pcbit_command(isdn_ctrl* ctl) +static int pcbit_command(isdn_ctrl *ctl) { - struct pcbit_dev *dev; + struct pcbit_dev *dev; struct pcbit_chan *chan; struct callb_data info; @@ -250,7 +250,7 @@ static int pcbit_command(isdn_ctrl* ctl) chan = (ctl->arg & 0x0F) ? dev->b2 : dev->b1; - switch(ctl->command) { + switch (ctl->command) { case ISDN_CMD_IOCTL: return pcbit_ioctl(ctl); break; @@ -299,10 +299,10 @@ static int pcbit_command(isdn_ctrl* ctl) static void pcbit_block_timer(unsigned long data) { struct pcbit_chan *chan; - struct pcbit_dev * dev; + struct pcbit_dev *dev; isdn_ctrl ictl; - chan = (struct pcbit_chan *) data; + chan = (struct pcbit_chan *)data; dev = chan2dev(chan); @@ -316,12 +316,12 @@ static void pcbit_block_timer(unsigned long data) #ifdef DEBUG printk(KERN_DEBUG "pcbit_block_timer\n"); -#endif +#endif chan->queued = 0; ictl.driver = dev->id; ictl.command = ISDN_STAT_BSENT; ictl.arg = chan->id; - dev->dev_if->statcallb(&ictl); + dev->dev_if->statcallb(&ictl); } #endif @@ -329,7 +329,7 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) { ushort hdrlen; int refnum, len; - struct pcbit_chan * chan; + struct pcbit_chan *chan; struct pcbit_dev *dev; dev = finddev(driver); @@ -345,10 +345,10 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) if (chan->fsm_state != ST_ACTIVE) return -1; - if (chan->queued >= MAX_QUEUED ) + if (chan->queued >= MAX_QUEUED) { #ifdef DEBUG_QUEUE - printk(KERN_DEBUG + printk(KERN_DEBUG "pcbit: %d packets already in queue - write fails\n", chan->queued); #endif @@ -365,14 +365,14 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) chan->block_timer.expires = jiffies + 1 * HZ; add_timer(&chan->block_timer); } -#endif - return 0; +#endif + return 0; } chan->queued++; - - len = skb->len; + + len = skb->len; hdrlen = capi_tdata_req(chan, skb); @@ -386,10 +386,10 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel) { - struct pcbit_dev * dev; + struct pcbit_dev *dev; int i, j; - const u_char * loadbuf; - u_char * ptr = NULL; + const u_char *loadbuf; + u_char *ptr = NULL; u_char *cbuf; int errstat; @@ -402,7 +402,7 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha return -ENODEV; } - switch(dev->l2_state) { + switch (dev->l2_state) { case L2_LWMODE: /* check (size <= rdp_size); write buf into board */ if (len < 0 || len > BANK4 + 1 || len > 1024) @@ -422,19 +422,19 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha /* this is the hard part */ /* dumb board */ /* get it into kernel space */ - if ((ptr = kmalloc(len, GFP_KERNEL))==NULL) + if ((ptr = kmalloc(len, GFP_KERNEL)) == NULL) return -ENOMEM; if (copy_from_user(ptr, buf, len)) { kfree(ptr); return -EFAULT; } loadbuf = ptr; - + errstat = 0; - for (i=0; i < len; i++) + for (i = 0; i < len; i++) { - for(j=0; j < LOAD_RETRY; j++) + for (j = 0; j < LOAD_RETRY; j++) if (!(readb(dev->sh_mem + dev->loadptr))) break; @@ -464,9 +464,9 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha * */ -void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, - struct sk_buff * skb, - ushort hdr_len, ushort refnum) +void pcbit_l3_receive(struct pcbit_dev *dev, ulong msg, + struct sk_buff *skb, + ushort hdr_len, ushort refnum) { struct pcbit_chan *chan; struct sk_buff *skb2; @@ -475,11 +475,11 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, int complete, err; isdn_ctrl ictl; - switch(msg) { + switch (msg) { case MSG_TDATA_IND: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } @@ -488,30 +488,30 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, dev->dev_if->rcvcallb_skb(dev->id, chan->id, skb); - if (capi_tdata_resp(chan, &skb2) > 0) - pcbit_l2_write(dev, MSG_TDATA_RESP, refnum, + if (capi_tdata_resp(chan, &skb2) > 0) + pcbit_l2_write(dev, MSG_TDATA_RESP, refnum, skb2, skb2->len); return; - break; + break; case MSG_TDATA_CONF: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } #ifdef DEBUG - if ( (*((ushort *) (skb->data + 2) )) != 0) { - printk(KERN_DEBUG "TDATA_CONF error\n"); + if ((*((ushort *)(skb->data + 2))) != 0) { + printk(KERN_DEBUG "TDATA_CONF error\n"); } #endif #ifdef BLOCK_TIMER - if (chan->queued == MAX_QUEUED) { - del_timer(&chan->block_timer); + if (chan->queued == MAX_QUEUED) { + del_timer(&chan->block_timer); chan->block_timer.function = NULL; } - -#endif + +#endif chan->queued--; ictl.driver = dev->id; @@ -523,7 +523,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, case MSG_CONN_IND: /* * channel: 1st not used will do - * if both are used we're in trouble + * if both are used we're in trouble */ if (!dev->b1->fsm_state) @@ -531,12 +531,12 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, else if (!dev->b2->fsm_state) chan = dev->b2; else { - printk(KERN_INFO + printk(KERN_INFO "Incoming connection: no channels available"); - if ((len = capi_disc_req(*(ushort*)(skb->data), &skb2, CAUSE_NOCHAN)) > 0) + if ((len = capi_disc_req(*(ushort *)(skb->data), &skb2, CAUSE_NOCHAN)) > 0) pcbit_l2_write(dev, MSG_DISC_REQ, refnum, skb2, len); - break; + break; } cbdata.data.setup.CalledPN = NULL; @@ -547,7 +547,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, pcbit_fsm_event(dev, chan, EV_NET_SETUP, NULL); - if (pcbit_check_msn(dev, cbdata.data.setup.CallingPN)) + if (pcbit_check_msn(dev, cbdata.data.setup.CallingPN)) pcbit_fsm_event(dev, chan, EV_USR_PROCED_REQ, &cbdata); else pcbit_fsm_event(dev, chan, EV_USR_RELEASE_REQ, NULL); @@ -555,26 +555,26 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, kfree(cbdata.data.setup.CalledPN); kfree(cbdata.data.setup.CallingPN); break; - + case MSG_CONN_CONF: - /* + /* * We should be able to find the channel by the message * reference number. The current version of the firmware * doesn't sent the ref number correctly. */ #ifdef DEBUG - printk(KERN_DEBUG "refnum=%04x b1=%04x b2=%04x\n", refnum, - dev->b1->s_refnum, + printk(KERN_DEBUG "refnum=%04x b1=%04x b2=%04x\n", refnum, + dev->b1->s_refnum, dev->b2->s_refnum); #endif /* We just try to find a channel in the right state */ if (dev->b1->fsm_state == ST_CALL_INIT) chan = dev->b1; - else { + else { if (dev->b2->s_refnum == ST_CALL_INIT) chan = dev->b2; - else { + else { chan = NULL; printk(KERN_WARNING "Connection Confirm - no channel in Call Init state\n"); break; @@ -589,18 +589,18 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, pcbit_fsm_event(dev, chan, EV_NET_CALL_PROC, NULL); else pcbit_fsm_event(dev, chan, EV_NET_SETUP_ACK, NULL); - break; + break; case MSG_CONN_ACTV_IND: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } - + if (capi_decode_conn_actv_ind(chan, skb)) { printk("error in capi_decode_conn_actv_ind\n"); - /* pcbit_fsm_event(dev, chan, EV_ERROR, NULL); */ + /* pcbit_fsm_event(dev, chan, EV_ERROR, NULL); */ break; } chan->r_refnum = refnum; @@ -609,14 +609,14 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, case MSG_CONN_ACTV_CONF: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } if (capi_decode_conn_actv_conf(chan, skb) == 0) pcbit_fsm_event(dev, chan, EV_NET_CONN_ACK, NULL); - + else printk(KERN_DEBUG "decode_conn_actv_conf failed\n"); break; @@ -624,7 +624,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, case MSG_SELP_CONF: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } @@ -638,7 +638,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, break; case MSG_ACT_TRANSP_CONF: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } @@ -650,7 +650,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, case MSG_DISC_IND: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } @@ -662,7 +662,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, break; case MSG_DISC_CONF: if (!(chan = capi_channel(dev, skb))) { - printk(KERN_WARNING + printk(KERN_WARNING "CAPI header: unknown channel id\n"); break; } @@ -711,24 +711,24 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel) stat_count = STATBUF_LEN - stat_st + stat_end; /* FIXME: should we sleep and wait for more cookies ? */ - if (len > stat_count) + if (len > stat_count) len = stat_count; if (stat_st < stat_end) { if (copy_to_user(buf, statbuf + stat_st, len)) return -EFAULT; - stat_st += len; + stat_st += len; } else { if (len > STATBUF_LEN - stat_st) { if (copy_to_user(buf, statbuf + stat_st, - STATBUF_LEN - stat_st)) + STATBUF_LEN - stat_st)) return -EFAULT; if (copy_to_user(buf, statbuf, - len - (STATBUF_LEN - stat_st))) + len - (STATBUF_LEN - stat_st))) return -EFAULT; stat_st = len - (STATBUF_LEN - stat_st); @@ -739,7 +739,7 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel) return -EFAULT; stat_st += len; - + if (stat_st == STATBUF_LEN) stat_st = 0; } @@ -756,27 +756,27 @@ static void pcbit_logstat(struct pcbit_dev *dev, char *str) int i; isdn_ctrl ictl; - for (i=stat_end; iid; - ictl.arg=strlen(str); + ictl.command = ISDN_STAT_STAVAIL; + ictl.driver = dev->id; + ictl.arg = strlen(str); dev->dev_if->statcallb(&ictl); } - -void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan, + +void pcbit_state_change(struct pcbit_dev *dev, struct pcbit_chan *chan, unsigned short i, unsigned short ev, unsigned short f) { char buf[256]; - + sprintf(buf, "change on device: %d channel:%d\n%s -> %s -> %s\n", - dev->id, chan->id, + dev->id, chan->id, isdn_state_table[i], strisdnevent(ev), isdn_state_table[f] ); @@ -789,7 +789,7 @@ void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan, static void set_running_timeout(unsigned long ptr) { - struct pcbit_dev * dev; + struct pcbit_dev *dev; #ifdef DEBUG printk(KERN_DEBUG "set_running_timeout\n"); @@ -799,7 +799,7 @@ static void set_running_timeout(unsigned long ptr) wake_up_interruptible(&dev->set_running_wq); } -static int set_protocol_running(struct pcbit_dev * dev) +static int set_protocol_running(struct pcbit_dev *dev) { isdn_ctrl ctl; @@ -813,7 +813,7 @@ static int set_protocol_running(struct pcbit_dev * dev) dev->l2_state = L2_STARTING; - writeb((0x80U | ((dev->rcv_seq & 0x07) << 3) | (dev->send_seq & 0x07)), + writeb((0x80U | ((dev->rcv_seq & 0x07) << 3) | (dev->send_seq & 0x07)), dev->sh_mem + BANK4); add_timer(&dev->set_running_timer); @@ -830,8 +830,8 @@ static int set_protocol_running(struct pcbit_dev * dev) dev->writeptr = dev->sh_mem; dev->readptr = dev->sh_mem + BANK2; - - /* tell the good news to the upper layer */ + + /* tell the good news to the upper layer */ ctl.driver = dev->id; ctl.command = ISDN_STAT_RUN; @@ -845,7 +845,7 @@ static int set_protocol_running(struct pcbit_dev * dev) dev->l2_state = L2_DOWN; #ifdef DEBUG - printk(KERN_DEBUG "Bank3 = %02x\n", + printk(KERN_DEBUG "Bank3 = %02x\n", readb(dev->sh_mem + BANK3)); #endif writeb(0x40, dev->sh_mem + BANK4); @@ -862,13 +862,13 @@ static int set_protocol_running(struct pcbit_dev * dev) return 0; } -static int pcbit_ioctl(isdn_ctrl* ctl) +static int pcbit_ioctl(isdn_ctrl *ctl) { - struct pcbit_dev * dev; + struct pcbit_dev *dev; struct pcbit_ioctl *cmd; dev = finddev(ctl->driver); - + if (!dev) { printk(KERN_DEBUG "pcbit_ioctl: unknown device\n"); @@ -877,7 +877,7 @@ static int pcbit_ioctl(isdn_ctrl* ctl) cmd = (struct pcbit_ioctl *) ctl->parm.num; - switch(ctl->arg) { + switch (ctl->arg) { case PCBIT_IOCTL_GETSTAT: cmd->info.l2_status = dev->l2_state; break; @@ -890,7 +890,7 @@ static int pcbit_ioctl(isdn_ctrl* ctl) dev->writeptr = dev->sh_mem; dev->readptr = dev->sh_mem + BANK2; - + dev->l2_state = L2_LOADING; break; @@ -907,21 +907,21 @@ static int pcbit_ioctl(isdn_ctrl* ctl) dev->loadptr = LOAD_ZONE_START; dev->l2_state = L2_FWMODE; - break; + break; case PCBIT_IOCTL_ENDLOAD: if (dev->l2_state == L2_RUNNING) return -EBUSY; dev->l2_state = L2_DOWN; - break; + break; - case PCBIT_IOCTL_SETBYTE: + case PCBIT_IOCTL_SETBYTE: if (dev->l2_state == L2_RUNNING) return -EBUSY; /* check addr */ if (cmd->info.rdp_byte.addr > BANK4) return -EFAULT; - + writeb(cmd->info.rdp_byte.value, dev->sh_mem + cmd->info.rdp_byte.addr); break; case PCBIT_IOCTL_GETBYTE: @@ -935,10 +935,10 @@ static int pcbit_ioctl(isdn_ctrl* ctl) printk("getbyte: invalid addr %04x\n", cmd->info.rdp_byte.addr); return -EFAULT; } - - cmd->info.rdp_byte.value = readb(dev->sh_mem + cmd->info.rdp_byte.addr); + + cmd->info.rdp_byte.value = readb(dev->sh_mem + cmd->info.rdp_byte.addr); break; - case PCBIT_IOCTL_RUNNING: + case PCBIT_IOCTL_RUNNING: if (dev->l2_state == L2_RUNNING) return -EBUSY; return set_protocol_running(dev); @@ -972,25 +972,25 @@ static int pcbit_ioctl(isdn_ctrl* ctl) return 0; } -/* +/* * MSN list handling * * if null reject all calls - * if first entry has null MSN accept all calls + * if first entry has null MSN accept all calls */ static void pcbit_clear_msn(struct pcbit_dev *dev) { struct msn_entry *ptr, *back; - for (ptr=dev->msn_list; ptr; ) + for (ptr = dev->msn_list; ptr;) { back = ptr->next; kfree(ptr); ptr = back; } - dev->msn_list = NULL; + dev->msn_list = NULL; } static void pcbit_set_msn(struct pcbit_dev *dev, char *list) @@ -1016,12 +1016,12 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list) } if (dev->msn_list) - for (back=dev->msn_list; back->next; back=back->next); - + for (back = dev->msn_list; back->next; back = back->next); + sp = list; do { - cp=strchr(sp, ','); + cp = strchr(sp, ','); if (cp) len = cp - sp; else @@ -1034,7 +1034,7 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list) return; } ptr->next = NULL; - + ptr->msn = kmalloc(len, GFP_ATOMIC); if (!ptr->msn) { printk(KERN_WARNING "kmalloc failed\n"); @@ -1054,7 +1054,7 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list) back->next = ptr; back = ptr; sp += len; - } while(cp); + } while (cp); } /* @@ -1063,12 +1063,12 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list) static int pcbit_check_msn(struct pcbit_dev *dev, char *msn) { struct msn_entry *ptr; - - for (ptr=dev->msn_list; ptr; ptr=ptr->next) { - if (ptr->msn == NULL) + for (ptr = dev->msn_list; ptr; ptr = ptr->next) { + + if (ptr->msn == NULL) return 1; - + if (strcmp(ptr->msn, msn) == 0) return 1; } diff --git a/drivers/isdn/pcbit/edss1.c b/drivers/isdn/pcbit/edss1.c index 80c9c16fd5ef..b2262ba6f0c9 100644 --- a/drivers/isdn/pcbit/edss1.c +++ b/drivers/isdn/pcbit/edss1.c @@ -3,10 +3,10 @@ * base: ITU-T Rec Q.931 * * Copyright (C) 1996 Universidade de Lisboa - * + * * Written by Pedro Roque Marques (roque@di.fc.ul.pt) * - * This software may be used and distributed according to the terms of + * This software may be used and distributed according to the terms of * the GNU General Public License, incorporated herein by reference. */ @@ -34,145 +34,145 @@ const char * const isdn_state_table[] = { - "Closed", - "Call initiated", - "Overlap sending", - "Outgoing call proceeding", - "NOT DEFINED", - "Call delivered", - "Call present", - "Call received", - "Connect request", - "Incoming call proceeding", - "Active", - "Disconnect request", - "Disconnect indication", - "NOT DEFINED", - "NOT DEFINED", - "Suspend request", - "NOT DEFINED", - "Resume request", - "NOT DEFINED", - "Release Request", - "NOT DEFINED", - "NOT DEFINED", - "NOT DEFINED", - "NOT DEFINED", - "NOT DEFINED", - "Overlap receiving", - "Select protocol on B-Channel", - "Activate B-channel protocol" + "Closed", + "Call initiated", + "Overlap sending", + "Outgoing call proceeding", + "NOT DEFINED", + "Call delivered", + "Call present", + "Call received", + "Connect request", + "Incoming call proceeding", + "Active", + "Disconnect request",