aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/isdnl3.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-19 22:52:38 -0500
committerJoe Perches <joe@perches.com>2012-02-21 12:04:01 -0500
commit475be4d85a274d0961593db41cf85689db1d583c (patch)
treeb2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/hisax/isdnl3.c
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
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/hisax/isdnl3.c')
-rw-r--r--drivers/isdn/hisax/isdnl3.c174
1 files changed, 87 insertions, 87 deletions
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index 1c24e4457b6f..45b03840f716 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -3,7 +3,7 @@
3 * Author Karsten Keil 3 * Author Karsten Keil
4 * based on the teles driver from Jan den Ouden 4 * based on the teles driver from Jan den Ouden
5 * Copyright by Karsten Keil <keil@isdn4linux.de> 5 * Copyright by Karsten Keil <keil@isdn4linux.de>
6 * 6 *
7 * This software may be used and distributed according to the terms 7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference. 8 * of the GNU General Public License, incorporated herein by reference.
9 * 9 *
@@ -27,12 +27,12 @@ static struct Fsm l3fsm;
27enum { 27enum {
28 ST_L3_LC_REL, 28 ST_L3_LC_REL,
29 ST_L3_LC_ESTAB_WAIT, 29 ST_L3_LC_ESTAB_WAIT,
30 ST_L3_LC_REL_DELAY, 30 ST_L3_LC_REL_DELAY,
31 ST_L3_LC_REL_WAIT, 31 ST_L3_LC_REL_WAIT,
32 ST_L3_LC_ESTAB, 32 ST_L3_LC_ESTAB,
33}; 33};
34 34
35#define L3_STATE_COUNT (ST_L3_LC_ESTAB+1) 35#define L3_STATE_COUNT (ST_L3_LC_ESTAB + 1)
36 36
37static char *strL3State[] = 37static char *strL3State[] =
38{ 38{
@@ -53,7 +53,7 @@ enum {
53 EV_TIMEOUT, 53 EV_TIMEOUT,
54}; 54};
55 55
56#define L3_EVENT_COUNT (EV_TIMEOUT+1) 56#define L3_EVENT_COUNT (EV_TIMEOUT + 1)
57 57
58static char *strL3Event[] = 58static char *strL3Event[] =
59{ 59{
@@ -67,7 +67,7 @@ static char *strL3Event[] =
67}; 67};
68 68
69static __printf(2, 3) void 69static __printf(2, 3) void
70l3m_debug(struct FsmInst *fi, char *fmt, ...) 70 l3m_debug(struct FsmInst *fi, char *fmt, ...)
71{ 71{
72 va_list args; 72 va_list args;
73 struct PStack *st = fi->userdata; 73 struct PStack *st = fi->userdata;
@@ -78,7 +78,7 @@ l3m_debug(struct FsmInst *fi, char *fmt, ...)
78} 78}
79 79
80u_char * 80u_char *
81findie(u_char * p, int size, u_char ie, int wanted_set) 81findie(u_char *p, int size, u_char ie, int wanted_set)
82{ 82{
83 int l, codeset, maincodeset; 83 int l, codeset, maincodeset;
84 u_char *pend = p + size; 84 u_char *pend = p + size;
@@ -102,14 +102,14 @@ findie(u_char * p, int size, u_char ie, int wanted_set)
102 else { 102 else {
103 if (codeset == wanted_set) { 103 if (codeset == wanted_set) {
104 if (*p == ie) 104 if (*p == ie)
105 { /* improved length check (Werner Cornelius) */ 105 { /* improved length check (Werner Cornelius) */
106 if ((pend - p) < 2) 106 if ((pend - p) < 2)
107 return(NULL); 107 return (NULL);
108 if (*(p+1) > (pend - (p+2))) 108 if (*(p + 1) > (pend - (p + 2)))
109 return(NULL); 109 return (NULL);
110 return (p); 110 return (p);
111 } 111 }
112 112
113 if (*p > ie) 113 if (*p > ie)
114 return (NULL); 114 return (NULL);
115 } 115 }
@@ -123,16 +123,16 @@ findie(u_char * p, int size, u_char ie, int wanted_set)
123} 123}
124 124
125int 125int
126getcallref(u_char * p) 126getcallref(u_char *p)
127{ 127{
128 int l, cr = 0; 128 int l, cr = 0;
129 129
130 p++; /* prot discr */ 130 p++; /* prot discr */
131 if (*p & 0xfe) /* wrong callref BRI only 1 octet*/ 131 if (*p & 0xfe) /* wrong callref BRI only 1 octet*/
132 return(-2); 132 return (-2);
133 l = 0xf & *p++; /* callref length */ 133 l = 0xf & *p++; /* callref length */
134 if (!l) /* dummy CallRef */ 134 if (!l) /* dummy CallRef */
135 return(-1); 135 return (-1);
136 cr = *p++; 136 cr = *p++;
137 return (cr); 137 return (cr);
138} 138}
@@ -153,7 +153,7 @@ void
153newl3state(struct l3_process *pc, int state) 153newl3state(struct l3_process *pc, int state)
154{ 154{
155 if (pc->debug & L3_DEB_STATE) 155 if (pc->debug & L3_DEB_STATE)
156 l3_debug(pc->st, "newstate cr %d %d --> %d", 156 l3_debug(pc->st, "newstate cr %d %d --> %d",
157 pc->callref & 0x7F, 157 pc->callref & 0x7F,
158 pc->state, state); 158 pc->state, state);
159 pc->state = state; 159 pc->state = state;
@@ -228,8 +228,8 @@ no_l3_proto(struct PStack *st, int pr, void *arg)
228static int 228static int
229no_l3_proto_spec(struct PStack *st, isdn_ctrl *ic) 229no_l3_proto_spec(struct PStack *st, isdn_ctrl *ic)
230{ 230{
231 printk(KERN_WARNING "HiSax: no specific protocol handler for proto %lu\n",ic->arg & 0xFF); 231 printk(KERN_WARNING "HiSax: no specific protocol handler for proto %lu\n", ic->arg & 0xFF);
232 return(-1); 232 return (-1);
233} 233}
234 234
235struct l3_process 235struct l3_process
@@ -287,7 +287,7 @@ release_l3_process(struct l3_process *p)
287 if (pp) 287 if (pp)
288 pp->next = np->next; 288 pp->next = np->next;
289 else if (!(p->st->l3.proc = np->next) && 289 else if (!(p->st->l3.proc = np->next) &&
290 !test_bit(FLG_PTP, &p->st->l2.flag)) { 290 !test_bit(FLG_PTP, &p->st->l2.flag)) {
291 if (p->debug) 291 if (p->debug)
292 l3_debug(p->st, "release_l3_process: last process"); 292 l3_debug(p->st, "release_l3_process: last process");
293 if (skb_queue_empty(&p->st->l3.squeue)) { 293 if (skb_queue_empty(&p->st->l3.squeue)) {
@@ -301,7 +301,7 @@ release_l3_process(struct l3_process *p)
301 if (p->debug) 301 if (p->debug)
302 l3_debug(p->st, "release_l3_process: not release link"); 302 l3_debug(p->st, "release_l3_process: not release link");
303 } 303 }
304 } 304 }
305 kfree(p); 305 kfree(p);
306 return; 306 return;
307 } 307 }
@@ -340,42 +340,42 @@ setstack_l3dc(struct PStack *st, struct Channel *chanp)
340 st->l3.l3m.userdata = st; 340 st->l3.l3m.userdata = st;
341 st->l3.l3m.userint = 0; 341 st->l3.l3m.userint = 0;
342 st->l3.l3m.printdebug = l3m_debug; 342 st->l3.l3m.printdebug = l3m_debug;
343 FsmInitTimer(&st->l3.l3m, &st->l3.l3m_timer); 343 FsmInitTimer(&st->l3.l3m, &st->l3.l3m_timer);
344 strcpy(st->l3.debug_id, "L3DC "); 344 strcpy(st->l3.debug_id, "L3DC ");
345 st->lli.l4l3_proto = no_l3_proto_spec; 345 st->lli.l4l3_proto = no_l3_proto_spec;
346 346
347#ifdef CONFIG_HISAX_EURO 347#ifdef CONFIG_HISAX_EURO
348 if (st->protocol == ISDN_PTYPE_EURO) { 348 if (st->protocol == ISDN_PTYPE_EURO) {
349 setstack_dss1(st); 349 setstack_dss1(st);
350 } else 350 } else
351#endif 351#endif
352#ifdef CONFIG_HISAX_NI1 352#ifdef CONFIG_HISAX_NI1
353 if (st->protocol == ISDN_PTYPE_NI1) { 353 if (st->protocol == ISDN_PTYPE_NI1) {
354 setstack_ni1(st); 354 setstack_ni1(st);
355 } else 355 } else
356#endif 356#endif
357#ifdef CONFIG_HISAX_1TR6 357#ifdef CONFIG_HISAX_1TR6
358 if (st->protocol == ISDN_PTYPE_1TR6) { 358 if (st->protocol == ISDN_PTYPE_1TR6) {
359 setstack_1tr6(st); 359 setstack_1tr6(st);
360 } else 360 } else
361#endif 361#endif
362 if (st->protocol == ISDN_PTYPE_LEASED) { 362 if (st->protocol == ISDN_PTYPE_LEASED) {
363 st->lli.l4l3 = no_l3_proto; 363 st->lli.l4l3 = no_l3_proto;
364 st->l2.l2l3 = no_l3_proto; 364 st->l2.l2l3 = no_l3_proto;
365 st->l3.l3ml3 = no_l3_proto; 365 st->l3.l3ml3 = no_l3_proto;
366 printk(KERN_INFO "HiSax: Leased line mode\n"); 366 printk(KERN_INFO "HiSax: Leased line mode\n");
367 } else { 367 } else {
368 st->lli.l4l3 = no_l3_proto; 368 st->lli.l4l3 = no_l3_proto;
369 st->l2.l2l3 = no_l3_proto; 369 st->l2.l2l3 = no_l3_proto;
370 st->l3.l3ml3 = no_l3_proto; 370 st->l3.l3ml3 = no_l3_proto;
371 sprintf(tmp, "protocol %s not supported", 371 sprintf(tmp, "protocol %s not supported",
372 (st->protocol == ISDN_PTYPE_1TR6) ? "1tr6" : 372 (st->protocol == ISDN_PTYPE_1TR6) ? "1tr6" :
373 (st->protocol == ISDN_PTYPE_EURO) ? "euro" : 373 (st->protocol == ISDN_PTYPE_EURO) ? "euro" :
374 (st->protocol == ISDN_PTYPE_NI1) ? "ni1" : 374 (st->protocol == ISDN_PTYPE_NI1) ? "ni1" :
375 "unknown"); 375 "unknown");
376 printk(KERN_WARNING "HiSax: %s\n", tmp); 376 printk(KERN_WARNING "HiSax: %s\n", tmp);
377 st->protocol = -1; 377 st->protocol = -1;
378 } 378 }
379} 379}
380 380
381static void 381static void
@@ -469,22 +469,22 @@ lc_connected(struct FsmInst *fi, int event, void *arg)
469static void 469static void
470lc_start_delay(struct FsmInst *fi, int event, void *arg) 470lc_start_delay(struct FsmInst *fi, int event, void *arg)
471{ 471{
472 struct PStack *st = fi->userdata; 472 struct PStack *st = fi->userdata;
473 473
474 FsmChangeState(fi, ST_L3_LC_REL_DELAY); 474 FsmChangeState(fi, ST_L3_LC_REL_DELAY);
475 FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50); 475 FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50);
476} 476}
477 477
478static void 478static void
479lc_start_delay_check(struct FsmInst *fi, int event, void *arg) 479lc_start_delay_check(struct FsmInst *fi, int event, void *arg)
480/* 20/09/00 - GE timer not user for NI-1 as layer 2 should stay up */ 480/* 20/09/00 - GE timer not user for NI-1 as layer 2 should stay up */
481{ 481{
482 struct PStack *st = fi->userdata; 482 struct PStack *st = fi->userdata;
483 483
484 FsmChangeState(fi, ST_L3_LC_REL_DELAY); 484 FsmChangeState(fi, ST_L3_LC_REL_DELAY);
485 /* 19/09/00 - GE timer not user for NI-1 */ 485 /* 19/09/00 - GE timer not user for NI-1 */
486 if (st->protocol != ISDN_PTYPE_NI1) 486 if (st->protocol != ISDN_PTYPE_NI1)
487 FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50); 487 FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50);
488} 488}
489 489
490static void 490static void
@@ -536,9 +536,9 @@ static struct FsmNode L3FnList[] __initdata =
536 {ST_L3_LC_ESTAB_WAIT, EV_RELEASE_IND, lc_release_ind}, 536 {ST_L3_LC_ESTAB_WAIT, EV_RELEASE_IND, lc_release_ind},
537 {ST_L3_LC_ESTAB, EV_RELEASE_IND, lc_release_ind}, 537 {ST_L3_LC_ESTAB, EV_RELEASE_IND, lc_release_ind},
538 {ST_L3_LC_ESTAB, EV_RELEASE_REQ, lc_start_delay_check}, 538 {ST_L3_LC_ESTAB, EV_RELEASE_REQ, lc_start_delay_check},
539 {ST_L3_LC_REL_DELAY, EV_RELEASE_IND, lc_release_ind}, 539 {ST_L3_LC_REL_DELAY, EV_RELEASE_IND, lc_release_ind},
540 {ST_L3_LC_REL_DELAY, EV_ESTABLISH_REQ, lc_connected}, 540 {ST_L3_LC_REL_DELAY, EV_ESTABLISH_REQ, lc_connected},
541 {ST_L3_LC_REL_DELAY, EV_TIMEOUT, lc_release_req}, 541 {ST_L3_LC_REL_DELAY, EV_TIMEOUT, lc_release_req},
542 {ST_L3_LC_REL_WAIT, EV_RELEASE_CNF, lc_release_cnf}, 542 {ST_L3_LC_REL_WAIT, EV_RELEASE_CNF, lc_release_cnf},
543 {ST_L3_LC_REL_WAIT, EV_ESTABLISH_REQ, lc_activate}, 543 {ST_L3_LC_REL_WAIT, EV_ESTABLISH_REQ, lc_activate},
544}; 544};
@@ -548,34 +548,34 @@ void
548l3_msg(struct PStack *st, int pr, void *arg) 548l3_msg(struct PStack *st, int pr, void *arg)
549{ 549{
550 switch (pr) { 550 switch (pr) {
551 case (DL_DATA | REQUEST): 551 case (DL_DATA | REQUEST):
552 if (st->l3.l3m.state == ST_L3_LC_ESTAB) { 552 if (st->l3.l3m.state == ST_L3_LC_ESTAB) {
553 st->l3.l3l2(st, pr, arg); 553 st->l3.l3l2(st, pr, arg);
554 } else { 554 } else {
555 struct sk_buff *skb = arg; 555 struct sk_buff *skb = arg;
556 556
557 skb_queue_tail(&st->l3.squeue, skb); 557 skb_queue_tail(&st->l3.squeue, skb);
558 FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL);
559 }
560 break;
561 case (DL_ESTABLISH | REQUEST):
562 FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL); 558 FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL);
563 break; 559 }
564 case (DL_ESTABLISH | CONFIRM): 560 break;
565 FsmEvent(&st->l3.l3m, EV_ESTABLISH_CNF, NULL); 561 case (DL_ESTABLISH | REQUEST):
566 break; 562 FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL);
567 case (DL_ESTABLISH | INDICATION): 563 break;
568 FsmEvent(&st->l3.l3m, EV_ESTABLISH_IND, NULL); 564 case (DL_ESTABLISH | CONFIRM):
569 break; 565 FsmEvent(&st->l3.l3m, EV_ESTABLISH_CNF, NULL);
570 case (DL_RELEASE | INDICATION): 566 break;
571 FsmEvent(&st->l3.l3m, EV_RELEASE_IND, NULL); 567 case (DL_ESTABLISH | INDICATION):
572 break; 568 FsmEvent(&st->l3.l3m, EV_ESTABLISH_IND, NULL);
573 case (DL_RELEASE | CONFIRM): 569 break;
574 FsmEvent(&st->l3.l3m, EV_RELEASE_CNF, NULL); 570 case (DL_RELEASE | INDICATION):
575 break; 571 FsmEvent(&st->l3.l3m, EV_RELEASE_IND, NULL);
576 case (DL_RELEASE | REQUEST): 572 break;
577 FsmEvent(&st->l3.l3m, EV_RELEASE_REQ, NULL); 573 case (DL_RELEASE | CONFIRM):
578 break; 574 FsmEvent(&st->l3.l3m, EV_RELEASE_CNF, NULL);
575 break;
576 case (DL_RELEASE | REQUEST):
577 FsmEvent(&st->l3.l3m, EV_RELEASE_REQ, NULL);
578 break;
579 } 579 }
580} 580}
581 581