summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/tei.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-19 19:52:38 -0800
committerJoe Perches <joe@perches.com>2012-02-21 09:04:01 -0800
commit475be4d85a274d0961593db41cf85689db1d583c (patch)
treeb2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/mISDN/tei.c
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
downloadblackbird-obmc-linux-475be4d85a274d0961593db41cf85689db1d583c.tar.gz
blackbird-obmc-linux-475be4d85a274d0961593db41cf85689db1d583c.zip
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 <joe@perches.com>
Diffstat (limited to 'drivers/isdn/mISDN/tei.c')
-rw-r--r--drivers/isdn/mISDN/tei.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index 687c9b6264ab..ba2bc0c776e2 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -34,7 +34,7 @@
#define DATIMER_VAL 10000
-static u_int *debug;
+static u_int *debug;
static struct Fsm deactfsm = {NULL, 0, 0, NULL, NULL};
static struct Fsm teifsmu = {NULL, 0, 0, NULL, NULL};
@@ -45,7 +45,7 @@ enum {
ST_L1_DEACT_PENDING,
ST_L1_ACTIV,
};
-#define DEACT_STATE_COUNT (ST_L1_ACTIV+1)
+#define DEACT_STATE_COUNT (ST_L1_ACTIV + 1)
static char *strDeactState[] =
{
@@ -63,7 +63,7 @@ enum {
EV_DATIMER,
};
-#define DEACT_EVENT_COUNT (EV_DATIMER+1)
+#define DEACT_EVENT_COUNT (EV_DATIMER + 1)
static char *strDeactEvent[] =
{
@@ -130,7 +130,7 @@ da_deactivate(struct FsmInst *fi, int event, void *arg)
/* All TEI are inactiv */
if (!test_bit(OPTION_L1_HOLD, &mgr->options)) {
mISDN_FsmAddTimer(&mgr->datimer, DATIMER_VAL, EV_DATIMER,
- NULL, 1);
+ NULL, 1);
mISDN_FsmChangeState(fi, ST_L1_DEACT_PENDING);
}
}
@@ -144,7 +144,7 @@ da_ui(struct FsmInst *fi, int event, void *arg)
if (!test_bit(OPTION_L1_HOLD, &mgr->options)) {
mISDN_FsmDelTimer(&mgr->datimer, 2);
mISDN_FsmAddTimer(&mgr->datimer, DATIMER_VAL, EV_DATIMER,
- NULL, 2);
+ NULL, 2);
}
}
@@ -169,7 +169,7 @@ da_timer(struct FsmInst *fi, int event, void *arg)
/* All TEI are inactiv */
mISDN_FsmChangeState(fi, ST_L1_DEACT);
_queue_data(&mgr->ch, PH_DEACTIVATE_REQ, MISDN_ID_ANY, 0, NULL,
- GFP_ATOMIC);
+ GFP_ATOMIC);
}
static struct FsmNode DeactFnList[] =
@@ -188,7 +188,7 @@ enum {
ST_TEI_IDVERIFY,
};
-#define TEI_STATE_COUNT (ST_TEI_IDVERIFY+1)
+#define TEI_STATE_COUNT (ST_TEI_IDVERIFY + 1)
static char *strTeiState[] =
{
@@ -209,7 +209,7 @@ enum {
EV_TIMER,
};
-#define TEI_EVENT_COUNT (EV_TIMER+1)
+#define TEI_EVENT_COUNT (EV_TIMER + 1)
static char *strTeiEvent[] =
{
@@ -257,8 +257,8 @@ get_free_id(struct manager *mgr)
list_for_each_entry(l2, &mgr->layer2, list) {
if (l2->ch.nr > 63) {
printk(KERN_WARNING
- "%s: more as 63 layer2 for one device\n",
- __func__);
+ "%s: more as 63 layer2 for one device\n",
+ __func__);
return -EBUSY;
}
test_and_set_bit(l2->ch.nr, (u_long *)&ids);
@@ -267,7 +267,7 @@ get_free_id(struct manager *mgr)
if (!test_bit(i, (u_long *)&ids))
return i;
printk(KERN_WARNING "%s: more as 63 layer2 for one device\n",
- __func__);
+ __func__);
return -EBUSY;
}
@@ -294,7 +294,7 @@ get_free_tei(struct manager *mgr)
if (!test_bit(i, (u_long *)&ids))
return i + 64;
printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n",
- __func__);
+ __func__);
return -1;
}
@@ -385,7 +385,7 @@ mgr_send_down(struct manager *mgr, struct sk_buff *skb)
skb_queue_tail(&mgr->sendq, skb);
if (!test_bit(MGR_PH_ACTIVE, &mgr->options)) {
_queue_data(&mgr->ch, PH_ACTIVATE_REQ, MISDN_ID_ANY, 0,
- NULL, GFP_KERNEL);
+ NULL, GFP_KERNEL);
} else {
do_send(mgr);
}
@@ -398,7 +398,7 @@ dl_unit_data(struct manager *mgr, struct sk_buff *skb)
return -EINVAL;
if (!test_bit(MGR_PH_ACTIVE, &mgr->options))
_queue_data(&mgr->ch, PH_ACTIVATE_REQ, MISDN_ID_ANY, 0,
- NULL, GFP_KERNEL);
+ NULL, GFP_KERNEL);
skb_push(skb, 3);
skb->data[0] = 0x02; /* SAPI 0 C/R = 1 */
skb->data[1] = 0xff; /* TEI 127 */
@@ -468,14 +468,14 @@ tei_id_request(struct FsmInst *fi, int event, void *arg)
if (tm->l2->tei != GROUP_TEI) {
tm->tei_m.printdebug(&tm->tei_m,
- "assign request for already assigned tei %d",
- tm->l2->tei);
+ "assign request for already assigned tei %d",
+ tm->l2->tei);
return;
}
tm->ri = random_ri();
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(&tm->tei_m,
- "assign request ri %d", tm->ri);
+ "assign request ri %d", tm->ri);
put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI);
mISDN_FsmChangeState(fi, ST_TEI_IDREQ);
mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 1);
@@ -496,12 +496,12 @@ tei_id_assign(struct FsmInst *fi, int event, void *arg)
tei = *dp >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity assign ri %d tei %d",
- ri, tei);
+ ri, tei);
l2 = findtei(tm->mgr, tei);
if (l2) { /* same tei is in use */
if (ri != l2->tm->ri) {
tm->tei_m.printdebug(fi,
- "possible duplicate assignment tei %d", tei);
+ "possible duplicate assignment tei %d", tei);
tei_l2(l2, MDL_ERROR_RSP, 0);
}
} else if (ri == tm->ri) {
@@ -525,12 +525,12 @@ tei_id_test_dup(struct FsmInst *fi, int event, void *arg)
tei = *dp >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "foreign identity assign ri %d tei %d",
- ri, tei);
+ ri, tei);
l2 = findtei(tm->mgr, tei);
if (l2) { /* same tei is in use */
if (ri != l2->tm->ri) { /* and it wasn't our request */
tm->tei_m.printdebug(fi,
- "possible duplicate assignment tei %d", tei);
+ "possible duplicate assignment tei %d", tei);
mISDN_FsmEvent(&l2->tm->tei_m, EV_VERIFY, NULL);
}
}
@@ -549,7 +549,7 @@ tei_id_denied(struct FsmInst *fi, int event, void *arg)
tei = *dp >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity denied ri %d tei %d",
- ri, tei);
+ ri, tei);
}
static void
@@ -559,11 +559,11 @@ tei_id_chk_req(struct FsmInst *fi, int event, void *arg)
u_char *dp = arg;
int tei;
- tei = *(dp+3) >> 1;
+ tei = *(dp + 3) >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity check req tei %d", tei);
if ((tm->l2->tei != GROUP_TEI) && ((tei == GROUP_TEI) ||
- (tei == tm->l2->tei))) {
+ (tei == tm->l2->tei))) {
mISDN_FsmDelTimer(&tm->timer, 4);
mISDN_FsmChangeState(&tm->tei_m, ST_TEI_NOP);
put_tei_msg(tm->mgr, ID_CHK_RES, random_ri(), tm->l2->tei);
@@ -577,7 +577,7 @@ tei_id_remove(struct FsmInst *fi, int event, void *arg)
u_char *dp = arg;
int tei;
- tei = *(dp+3) >> 1;
+ tei = *(dp + 3) >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity remove tei %d", tei);
if ((tm->l2->tei != GROUP_TEI) &&
@@ -595,7 +595,7 @@ tei_id_verify(struct FsmInst *fi, int event, void *arg)
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "id verify request for tei %d",
- tm->l2->tei);
+ tm->l2->tei);
put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei);
mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY);
mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 2);
@@ -611,7 +611,7 @@ tei_id_req_tout(struct FsmInst *fi, int event, void *arg)
tm->ri = random_ri();
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "assign req(%d) ri %d",
- 4 - tm->nval, tm->ri);
+ 4 - tm->nval, tm->ri);
put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI);
mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 3);
} else {
@@ -629,13 +629,13 @@ tei_id_ver_tout(struct FsmInst *fi, int event, void *arg)
if (--tm->nval) {
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi,
- "id verify req(%d) for tei %d",
- 3 - tm->nval, tm->l2->tei);
+ "id verify req(%d) for tei %d",
+ 3 - tm->nval, tm->l2->tei);
put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei);
mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4);
} else {
tm->tei_m.printdebug(fi, "verify req for tei %d failed",
- tm->l2->tei);
+ tm->l2->tei);
tei_l2(tm->l2, MDL_REMOVE_REQ, 0);
mISDN_FsmChangeState(fi, ST_TEI_NOP);
}
@@ -673,14 +673,14 @@ tei_assign_req(struct FsmInst *fi, int event, void *arg)
if (tm->l2->tei == GROUP_TEI) {
tm->tei_m.printdebug(&tm->tei_m,
- "net tei assign request without tei");
+ "net tei assign request without tei");
return;
}
tm->ri = ((unsigned int) *dp++ << 8);
tm->ri += *dp++;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(&tm->tei_m,
- "net assign request ri %d teim %d", tm->ri, *dp);
+ "net assign request ri %d teim %d", tm->ri, *dp);
put_tei_msg(tm->mgr, ID_ASSIGNED, tm->ri, tm->l2->tei);
mISDN_FsmChangeState(fi, ST_TEI_NOP);
}
@@ -692,7 +692,7 @@ tei_id_chk_req_net(struct FsmInst *fi, int event, void *arg)
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "id check request for tei %d",
- tm->l2->tei);
+ tm->l2->tei);
tm->rcnt = 0;
put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei);
mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY);
@@ -724,7 +724,7 @@ tei_id_verify_net(struct FsmInst *fi, int event, void *arg)
tei = dp[3] >> 1;
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi, "identity verify req tei %d/%d",
- tei, tm->l2->tei);
+ tei, tm->l2->tei);
if (tei == tm->l2->tei)
tei_id_chk_req_net(fi, event, arg);
}
@@ -737,7 +737,7 @@ tei_id_ver_tout_net(struct FsmInst *fi, int event, void *arg)
if (tm->rcnt == 1) {
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi,
- "check req for tei %d successful\n", tm->l2->tei);
+ "check req for tei %d successful\n", tm->l2->tei);
mISDN_FsmChangeState(fi, ST_TEI_NOP);
} else if (tm->rcnt > 1) {
/* duplicate assignment; remove */
@@ -745,13 +745,13 @@ tei_id_ver_tout_net(struct FsmInst *fi, int event, void *arg)
} else if (--tm->nval) {
if (*debug & DEBUG_L2_TEI)
tm->tei_m.printdebug(fi,
- "id check req(%d) for tei %d",
- 3 - tm->nval, tm->l2->tei);
+ "id check req(%d) for tei %d",
+ 3 - tm->nval, tm->l2->tei);
put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei);
mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4);
} else {
tm->tei_m.printdebug(fi, "check req for tei %d failed",
- tm->l2->tei);
+ tm->l2->tei);
mISDN_FsmChangeState(fi, ST_TEI_NOP);
tei_l2remove(tm->l2);
}
@@ -800,7 +800,7 @@ create_new_tei(struct manager *mgr, int tei, int sapi)
if ((tei >= 0) && (tei < 64))
test_and_set_bit(OPTION_L2_FIXEDTEI, &opt);
if (mgr->ch.st->dev->Dprotocols
- & ((1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1)))
+ & ((1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1)))
test_and_set_bit(OPTION_L2_PMX, &opt);
l2 = create_l2(mgr->up, ISDN_P_LAPD_NT, opt, tei, sapi);
if (!l2) {
@@ -880,7 +880,7 @@ ph_data_ind(struct manager *mgr, struct sk_buff *skb)
if (skb->len < 8) {
if (*debug & DEBUG_L2_TEI)
printk(KERN_DEBUG "%s: short mgr frame %d/8\n",
- __func__, skb->len);
+ __func__, skb->len);
goto done;
}
@@ -979,15 +979,15 @@ static int
create_teimgr(struct manager *mgr, struct channel_req *crq)
{
struct layer2 *l2;
- u_long opt = 0;
+ u_long opt = 0;
u_long flags;
int id;
if (*debug & DEBUG_L2_TEI)
printk(KERN_DEBUG "%s: %s proto(%x) adr(%d %d %d %d)\n",
- __func__, dev_name(&mgr->ch.st->dev->dev),
- crq->protocol, crq->adr.dev, crq->adr.channel,
- crq->adr.sapi, crq->adr.tei);
+ __func__, dev_name(&mgr->ch.st->dev->dev),
+ crq->protocol, crq->adr.dev, crq->adr.channel,
+ crq->adr.sapi, crq->adr.tei);
if (crq->adr.tei > GROUP_TEI)
return -EINVAL;
if (crq->adr.tei < 64)
@@ -1001,8 +1001,8 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
return -EINVAL;
if (mgr->up) {
printk(KERN_WARNING
- "%s: only one network manager is allowed\n",
- __func__);
+ "%s: only one network manager is allowed\n",
+ __func__);
return -EBUSY;
}
} else if (test_bit(MGR_OPT_USER, &mgr->options)) {
@@ -1017,7 +1017,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
test_and_set_bit(MGR_OPT_USER, &mgr->options);
}
if (mgr->ch.st->dev->Dprotocols
- & ((1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1)))
+ & ((1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1)))
test_and_set_bit(OPTION_L2_PMX, &opt);
if ((crq->protocol == ISDN_P_LAPD_NT) && (crq->adr.tei == 127)) {
mgr->up = crq->ch;
@@ -1035,7 +1035,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)
return 0;
}
l2 = create_l2(crq->ch, crq->protocol, opt,
- crq->adr.tei, crq->adr.sapi);
+ crq->adr.tei, crq->adr.sapi);
if (!l2)
return -ENOMEM;
l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL);
@@ -1084,7 +1084,7 @@ mgr_send(struct mISDNchannel *ch, struct sk_buff *skb)
mgr = container_of(ch, struct manager, ch);
if (*debug & DEBUG_L2_RECV)
printk(KERN_DEBUG "%s: prim(%x) id(%x)\n",
- __func__, hh->prim, hh->id);
+ __func__, hh->prim, hh->id);
switch (hh->prim) {
case PH_DATA_IND:
mISDN_FsmEvent(&mgr->deact, EV_UI, NULL);
@@ -1181,7 +1181,7 @@ check_data(struct manager *mgr, struct sk_buff *skb)
if (*debug & DEBUG_L2_CTRL)
printk(KERN_DEBUG "%s: prim(%x) id(%x)\n",
- __func__, hh->prim, hh->id);
+ __func__, hh->prim, hh->id);
if (test_bit(MGR_OPT_USER, &mgr->options))
return -ENOTCONN;
if (hh->prim != PH_DATA_IND)
@@ -1201,12 +1201,12 @@ check_data(struct manager *mgr, struct sk_buff *skb)
/* 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);
+ __func__, sapi, tei);
l2 = create_new_tei(mgr, tei, sapi);
if (!l2) {
if (*debug & DEBUG_L2_CTRL)
printk(KERN_DEBUG "%s: failed to create new tei\n",
- __func__);
+ __func__);
return -ENOMEM;
}
ret = l2->ch.send(&l2->ch, skb);
@@ -1285,15 +1285,15 @@ mgr_bcast(struct mISDNchannel *ch, struct sk_buff *skb)
if (ret) {
if (*debug & DEBUG_SEND_ERR)
printk(KERN_DEBUG
- "%s ch%d prim(%x) addr(%x)"
- " err %d\n",
- __func__, l2->ch.nr,
- hh->prim, l2->ch.addr, ret);
+ "%s ch%d prim(%x) addr(%x)"
+ " err %d\n",
+ __func__, l2->ch.nr,
+ hh->prim, l2->ch.addr, ret);
} else
cskb = NULL;
} else {
printk(KERN_WARNING "%s ch%d addr %x no mem\n",
- __func__, ch->nr, ch->addr);
+ __func__, ch->nr, ch->addr);
goto out;
}
}
OpenPOWER on IntegriCloud