diff options
author | Joe Perches <joe@perches.com> | 2012-02-19 22:52:38 -0500 |
---|---|---|
committer | Joe Perches <joe@perches.com> | 2012-02-21 12:04:01 -0500 |
commit | 475be4d85a274d0961593db41cf85689db1d583c (patch) | |
tree | b2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/capi/capidrv.c | |
parent | 0b0a635f79f91f3755b6518627ea06dd0dbfd523 (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/capi/capidrv.c')
-rw-r--r-- | drivers/isdn/capi/capidrv.c | 956 |
1 files changed, 478 insertions, 478 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 92607ed25e2e..6f5016b479f8 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c | |||
@@ -40,7 +40,7 @@ static int debugmode = 0; | |||
40 | MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux"); | 40 | MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux"); |
41 | MODULE_AUTHOR("Carsten Paeth"); | 41 | MODULE_AUTHOR("Carsten Paeth"); |
42 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
43 | module_param(debugmode, uint, S_IRUGO|S_IWUSR); | 43 | module_param(debugmode, uint, S_IRUGO | S_IWUSR); |
44 | 44 | ||
45 | /* -------- type definitions ----------------------------------------- */ | 45 | /* -------- type definitions ----------------------------------------- */ |
46 | 46 | ||
@@ -64,7 +64,7 @@ struct capidrv_contr { | |||
64 | int state; | 64 | int state; |
65 | u32 cipmask; | 65 | u32 cipmask; |
66 | u32 cipmask2; | 66 | u32 cipmask2; |
67 | struct timer_list listentimer; | 67 | struct timer_list listentimer; |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * ID of capi message sent | 70 | * ID of capi message sent |
@@ -105,9 +105,9 @@ struct capidrv_contr { | |||
105 | /* */ | 105 | /* */ |
106 | u16 datahandle; | 106 | u16 datahandle; |
107 | struct ncci_datahandle_queue { | 107 | struct ncci_datahandle_queue { |
108 | struct ncci_datahandle_queue *next; | 108 | struct ncci_datahandle_queue *next; |
109 | u16 datahandle; | 109 | u16 datahandle; |
110 | int len; | 110 | int len; |
111 | } *ackqueue; | 111 | } *ackqueue; |
112 | } *ncci_list; | 112 | } *ncci_list; |
113 | } *plcip; | 113 | } *plcip; |
@@ -142,7 +142,7 @@ static capidrv_data global; | |||
142 | static DEFINE_SPINLOCK(global_lock); | 142 | static DEFINE_SPINLOCK(global_lock); |
143 | 143 | ||
144 | static void handle_dtrace_data(capidrv_contr *card, | 144 | static void handle_dtrace_data(capidrv_contr *card, |
145 | int send, int level2, u8 *data, u16 len); | 145 | int send, int level2, u8 *data, u16 len); |
146 | 146 | ||
147 | /* -------- convert functions ---------------------------------------- */ | 147 | /* -------- convert functions ---------------------------------------- */ |
148 | 148 | ||
@@ -158,11 +158,11 @@ static inline u32 b1prot(int l2, int l3) | |||
158 | return 0; | 158 | return 0; |
159 | case ISDN_PROTO_L2_TRANS: | 159 | case ISDN_PROTO_L2_TRANS: |
160 | return 1; | 160 | return 1; |
161 | case ISDN_PROTO_L2_V11096: | 161 | case ISDN_PROTO_L2_V11096: |
162 | case ISDN_PROTO_L2_V11019: | 162 | case ISDN_PROTO_L2_V11019: |
163 | case ISDN_PROTO_L2_V11038: | 163 | case ISDN_PROTO_L2_V11038: |
164 | return 2; | 164 | return 2; |
165 | case ISDN_PROTO_L2_FAX: | 165 | case ISDN_PROTO_L2_FAX: |
166 | return 4; | 166 | return 4; |
167 | case ISDN_PROTO_L2_MODEM: | 167 | case ISDN_PROTO_L2_MODEM: |
168 | return 8; | 168 | return 8; |
@@ -179,12 +179,12 @@ static inline u32 b2prot(int l2, int l3) | |||
179 | return 0; | 179 | return 0; |
180 | case ISDN_PROTO_L2_HDLC: | 180 | case ISDN_PROTO_L2_HDLC: |
181 | case ISDN_PROTO_L2_TRANS: | 181 | case ISDN_PROTO_L2_TRANS: |
182 | case ISDN_PROTO_L2_V11096: | 182 | case ISDN_PROTO_L2_V11096: |
183 | case ISDN_PROTO_L2_V11019: | 183 | case ISDN_PROTO_L2_V11019: |
184 | case ISDN_PROTO_L2_V11038: | 184 | case ISDN_PROTO_L2_V11038: |
185 | case ISDN_PROTO_L2_MODEM: | 185 | case ISDN_PROTO_L2_MODEM: |
186 | return 1; | 186 | return 1; |
187 | case ISDN_PROTO_L2_FAX: | 187 | case ISDN_PROTO_L2_FAX: |
188 | return 4; | 188 | return 4; |
189 | } | 189 | } |
190 | } | 190 | } |
@@ -197,13 +197,13 @@ static inline u32 b3prot(int l2, int l3) | |||
197 | case ISDN_PROTO_L2_X75BUI: | 197 | case ISDN_PROTO_L2_X75BUI: |
198 | case ISDN_PROTO_L2_HDLC: | 198 | case ISDN_PROTO_L2_HDLC: |
199 | case ISDN_PROTO_L2_TRANS: | 199 | case ISDN_PROTO_L2_TRANS: |
200 | case ISDN_PROTO_L2_V11096: | 200 | case ISDN_PROTO_L2_V11096: |
201 | case ISDN_PROTO_L2_V11019: | 201 | case ISDN_PROTO_L2_V11019: |
202 | case ISDN_PROTO_L2_V11038: | 202 | case ISDN_PROTO_L2_V11038: |
203 | case ISDN_PROTO_L2_MODEM: | 203 | case ISDN_PROTO_L2_MODEM: |
204 | default: | 204 | default: |
205 | return 0; | 205 | return 0; |
206 | case ISDN_PROTO_L2_FAX: | 206 | case ISDN_PROTO_L2_FAX: |
207 | return 4; | 207 | return 4; |
208 | } | 208 | } |
209 | } | 209 | } |
@@ -231,38 +231,38 @@ static _cstruct b1config(int l2, int l3) | |||
231 | case ISDN_PROTO_L2_TRANS: | 231 | case ISDN_PROTO_L2_TRANS: |
232 | default: | 232 | default: |
233 | return NULL; | 233 | return NULL; |
234 | case ISDN_PROTO_L2_V11096: | 234 | case ISDN_PROTO_L2_V11096: |
235 | return b1config_async_v110(9600); | 235 | return b1config_async_v110(9600); |
236 | case ISDN_PROTO_L2_V11019: | 236 | case ISDN_PROTO_L2_V11019: |
237 | return b1config_async_v110(19200); | 237 | return b1config_async_v110(19200); |
238 | case ISDN_PROTO_L2_V11038: | 238 | case ISDN_PROTO_L2_V11038: |
239 | return b1config_async_v110(38400); | 239 | return b1config_async_v110(38400); |
240 | } | 240 | } |
241 | } | 241 | } |
242 | 242 | ||
243 | static inline u16 si2cip(u8 si1, u8 si2) | 243 | static inline u16 si2cip(u8 si1, u8 si2) |
244 | { | 244 | { |
245 | static const u8 cip[17][5] = | 245 | static const u8 cip[17][5] = |
246 | { | 246 | { |
247 | /* 0 1 2 3 4 */ | 247 | /* 0 1 2 3 4 */ |
248 | {0, 0, 0, 0, 0}, /*0 */ | 248 | {0, 0, 0, 0, 0}, /*0 */ |
249 | {16, 16, 4, 26, 16}, /*1 */ | 249 | {16, 16, 4, 26, 16}, /*1 */ |
250 | {17, 17, 17, 4, 4}, /*2 */ | 250 | {17, 17, 17, 4, 4}, /*2 */ |
251 | {2, 2, 2, 2, 2}, /*3 */ | 251 | {2, 2, 2, 2, 2}, /*3 */ |
252 | {18, 18, 18, 18, 18}, /*4 */ | 252 | {18, 18, 18, 18, 18}, /*4 */ |
253 | {2, 2, 2, 2, 2}, /*5 */ | 253 | {2, 2, 2, 2, 2}, /*5 */ |
254 | {0, 0, 0, 0, 0}, /*6 */ | 254 | {0, 0, 0, 0, 0}, /*6 */ |
255 | {2, 2, 2, 2, 2}, /*7 */ | 255 | {2, 2, 2, 2, 2}, /*7 */ |
256 | {2, 2, 2, 2, 2}, /*8 */ | 256 | {2, 2, 2, 2, 2}, /*8 */ |
257 | {21, 21, 21, 21, 21}, /*9 */ | 257 | {21, 21, 21, 21, 21}, /*9 */ |
258 | {19, 19, 19, 19, 19}, /*10 */ | 258 | {19, 19, 19, 19, 19}, /*10 */ |
259 | {0, 0, 0, 0, 0}, /*11 */ | 259 | {0, 0, 0, 0, 0}, /*11 */ |
260 | {0, 0, 0, 0, 0}, /*12 */ | 260 | {0, 0, 0, 0, 0}, /*12 */ |
261 | {0, 0, 0, 0, 0}, /*13 */ | 261 | {0, 0, 0, 0, 0}, /*13 */ |
262 | {0, 0, 0, 0, 0}, /*14 */ | 262 | {0, 0, 0, 0, 0}, /*14 */ |
263 | {22, 22, 22, 22, 22}, /*15 */ | 263 | {22, 22, 22, 22, 22}, /*15 */ |
264 | {27, 27, 27, 28, 27} /*16 */ | 264 | {27, 27, 27, 28, 27} /*16 */ |
265 | }; | 265 | }; |
266 | if (si1 > 16) | 266 | if (si1 > 16) |
267 | si1 = 0; | 267 | si1 = 0; |
268 | if (si2 > 4) | 268 | if (si2 > 4) |
@@ -274,10 +274,10 @@ static inline u16 si2cip(u8 si1, u8 si2) | |||
274 | static inline u8 cip2si1(u16 cipval) | 274 | static inline u8 cip2si1(u16 cipval) |
275 | { | 275 | { |
276 | static const u8 si[32] = | 276 | static const u8 si[32] = |
277 | {7, 1, 7, 7, 1, 1, 7, 7, /*0-7 */ | 277 | {7, 1, 7, 7, 1, 1, 7, 7, /*0-7 */ |
278 | 7, 1, 0, 0, 0, 0, 0, 0, /*8-15 */ | 278 | 7, 1, 0, 0, 0, 0, 0, 0, /*8-15 */ |
279 | 1, 2, 4, 10, 9, 9, 15, 7, /*16-23 */ | 279 | 1, 2, 4, 10, 9, 9, 15, 7, /*16-23 */ |
280 | 7, 7, 1, 16, 16, 0, 0, 0}; /*24-31 */ | 280 | 7, 7, 1, 16, 16, 0, 0, 0}; /*24-31 */ |
281 | 281 | ||
282 | if (cipval > 31) | 282 | if (cipval > 31) |
283 | cipval = 0; /* .... */ | 283 | cipval = 0; /* .... */ |
@@ -287,10 +287,10 @@ static inline u8 cip2si1(u16 cipval) | |||
287 | static inline u8 cip2si2(u16 cipval) | 287 | static inline u8 cip2si2(u16 cipval) |
288 | { | 288 | { |
289 | static const u8 si[32] = | 289 | static const u8 si[32] = |
290 | {0, 0, 0, 0, 2, 3, 0, 0, /*0-7 */ | 290 | {0, 0, 0, 0, 2, 3, 0, 0, /*0-7 */ |
291 | 0, 3, 0, 0, 0, 0, 0, 0, /*8-15 */ | 291 | 0, 3, 0, 0, 0, 0, 0, 0, /*8-15 */ |
292 | 1, 2, 0, 0, 9, 0, 0, 0, /*16-23 */ | 292 | 1, 2, 0, 0, 9, 0, 0, 0, /*16-23 */ |
293 | 0, 0, 3, 2, 3, 0, 0, 0}; /*24-31 */ | 293 | 0, 0, 3, 2, 3, 0, 0, 0}; /*24-31 */ |
294 | 294 | ||
295 | if (cipval > 31) | 295 | if (cipval > 31) |
296 | cipval = 0; /* .... */ | 296 | cipval = 0; /* .... */ |
@@ -302,7 +302,7 @@ static inline u8 cip2si2(u16 cipval) | |||
302 | 302 | ||
303 | static inline capidrv_contr *findcontrbydriverid(int driverid) | 303 | static inline capidrv_contr *findcontrbydriverid(int driverid) |
304 | { | 304 | { |
305 | unsigned long flags; | 305 | unsigned long flags; |
306 | capidrv_contr *p; | 306 | capidrv_contr *p; |
307 | 307 | ||
308 | spin_lock_irqsave(&global_lock, flags); | 308 | spin_lock_irqsave(&global_lock, flags); |
@@ -329,7 +329,7 @@ static capidrv_contr *findcontrbynumber(u32 contr) | |||
329 | 329 | ||
330 | /* -------- plci management ------------------------------------------ */ | 330 | /* -------- plci management ------------------------------------------ */ |
331 | 331 | ||
332 | static capidrv_plci *new_plci(capidrv_contr * card, int chan) | 332 | static capidrv_plci *new_plci(capidrv_contr *card, int chan) |
333 | { | 333 | { |
334 | capidrv_plci *plcip; | 334 | capidrv_plci *plcip; |
335 | 335 | ||
@@ -349,7 +349,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan) | |||
349 | return plcip; | 349 | return plcip; |
350 | } | 350 | } |
351 | 351 | ||
352 | static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci) | 352 | static capidrv_plci *find_plci_by_plci(capidrv_contr *card, u32 plci) |
353 | { | 353 | { |
354 | capidrv_plci *p; | 354 | capidrv_plci *p; |
355 | for (p = card->plci_list; p; p = p->next) | 355 | for (p = card->plci_list; p; p = p->next) |
@@ -358,7 +358,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci) | |||
358 | return NULL; | 358 | return NULL; |
359 | } | 359 | } |
360 | 360 | ||
361 | static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid) | 361 | static capidrv_plci *find_plci_by_msgid(capidrv_contr *card, u16 msgid) |
362 | { | 362 | { |
363 | capidrv_plci *p; | 363 | capidrv_plci *p; |
364 | for (p = card->plci_list; p; p = p->next) | 364 | for (p = card->plci_list; p; p = p->next) |
@@ -367,7 +367,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid) | |||
367 | return NULL; | 367 | return NULL; |
368 | } | 368 | } |
369 | 369 | ||
370 | static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci) | 370 | static capidrv_plci *find_plci_by_ncci(capidrv_contr *card, u32 ncci) |
371 | { | 371 | { |
372 | capidrv_plci *p; | 372 | capidrv_plci *p; |
373 | for (p = card->plci_list; p; p = p->next) | 373 | for (p = card->plci_list; p; p = p->next) |
@@ -376,7 +376,7 @@ static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci) | |||
376 | return NULL; | 376 | return NULL; |
377 | } | 377 | } |
378 | 378 | ||
379 | static void free_plci(capidrv_contr * card, capidrv_plci * plcip) | 379 | static void free_plci(capidrv_contr *card, capidrv_plci *plcip) |
380 | { | 380 | { |
381 | capidrv_plci **pp; | 381 | capidrv_plci **pp; |
382 | 382 | ||
@@ -396,8 +396,8 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip) | |||
396 | 396 | ||
397 | /* -------- ncci management ------------------------------------------ */ | 397 | /* -------- ncci management ------------------------------------------ */ |
398 | 398 | ||
399 | static inline capidrv_ncci *new_ncci(capidrv_contr * card, | 399 | static inline capidrv_ncci *new_ncci(capidrv_contr *card, |
400 | capidrv_plci * plcip, | 400 | capidrv_plci *plcip, |
401 | u32 ncci) | 401 | u32 ncci) |
402 | { | 402 | { |
403 | capidrv_ncci *nccip; | 403 | capidrv_ncci *nccip; |
@@ -421,7 +421,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card, | |||
421 | return nccip; | 421 | return nccip; |
422 | } | 422 | } |
423 | 423 | ||
424 | static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci) | 424 | static inline capidrv_ncci *find_ncci(capidrv_contr *card, u32 ncci) |
425 | { | 425 | { |
426 | capidrv_plci *plcip; | 426 | capidrv_plci *plcip; |
427 | capidrv_ncci *p; | 427 | capidrv_ncci *p; |
@@ -435,7 +435,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci) | |||
435 | return NULL; | 435 | return NULL; |
436 | } | 436 | } |
437 | 437 | ||
438 | static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card, | 438 | static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr *card, |
439 | u32 ncci, u16 msgid) | 439 | u32 ncci, u16 msgid) |
440 | { | 440 | { |
441 | capidrv_plci *plcip; | 441 | capidrv_plci *plcip; |
@@ -450,7 +450,7 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card, | |||
450 | return NULL; | 450 | return NULL; |
451 | } | 451 | } |
452 | 452 | ||
453 | static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip) | 453 | static void free_ncci(capidrv_contr *card, struct capidrv_ncci *nccip) |
454 | { | 454 | { |
455 | struct capidrv_ncci **pp; | 455 | struct capidrv_ncci **pp; |
456 | 456 | ||
@@ -465,20 +465,20 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip) | |||
465 | } | 465 | } |
466 | 466 | ||
467 | static int capidrv_add_ack(struct capidrv_ncci *nccip, | 467 | static int capidrv_add_ack(struct capidrv_ncci *nccip, |
468 | u16 datahandle, int len) | 468 | u16 datahandle, int len) |
469 | { | 469 | { |
470 | struct ncci_datahandle_queue *n, **pp; | 470 | struct ncci_datahandle_queue *n, **pp; |
471 | 471 | ||
472 | n = (struct ncci_datahandle_queue *) | 472 | n = (struct ncci_datahandle_queue *) |
473 | kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC); | 473 | kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC); |
474 | if (!n) { | 474 | if (!n) { |
475 | printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n"); | 475 | printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n"); |
476 | return -1; | 476 | return -1; |
477 | } | 477 | } |
478 | n->next = NULL; | 478 | n->next = NULL; |
479 | n->datahandle = datahandle; | 479 | n->datahandle = datahandle; |
480 | n->len = len; | 480 | n->len = len; |
481 | for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ; | 481 | for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next); |
482 | *pp = n; | 482 | *pp = n; |
483 | return 0; | 483 | return 0; |
484 | } | 484 | } |
@@ -489,11 +489,11 @@ static int capidrv_del_ack(struct capidrv_ncci *nccip, u16 datahandle) | |||
489 | int len; | 489 | int len; |
490 | 490 | ||
491 | for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) { | 491 | for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) { |
492 | if ((*pp)->datahandle == datahandle) { | 492 | if ((*pp)->datahandle == datahandle) { |
493 | p = *pp; | 493 | p = *pp; |
494 | len = p->len; | 494 | len = p->len; |
495 | *pp = (*pp)->next; | 495 | *pp = (*pp)->next; |
496 | kfree(p); | 496 | kfree(p); |
497 | return len; | 497 | return len; |
498 | } | 498 | } |
499 | } | 499 | } |
@@ -502,7 +502,7 @@ static int capidrv_del_ack(struct capidrv_ncci *nccip, u16 datahandle) | |||
502 | 502 | ||
503 | /* -------- convert and send capi message ---------------------------- */ | 503 | /* -------- convert and send capi message ---------------------------- */ |
504 | 504 | ||
505 | static void send_message(capidrv_contr * card, _cmsg * cmsg) | 505 | static void send_message(capidrv_contr *card, _cmsg *cmsg) |
506 | { | 506 | { |
507 | struct sk_buff *skb; | 507 | struct sk_buff *skb; |
508 | size_t len; | 508 | size_t len; |
@@ -529,18 +529,18 @@ struct listenstatechange { | |||
529 | 529 | ||
530 | static struct listenstatechange listentable[] = | 530 | static struct listenstatechange listentable[] = |
531 | { | 531 | { |
532 | {ST_LISTEN_NONE, ST_LISTEN_WAIT_CONF, EV_LISTEN_REQ}, | 532 | {ST_LISTEN_NONE, ST_LISTEN_WAIT_CONF, EV_LISTEN_REQ}, |
533 | {ST_LISTEN_ACTIVE, ST_LISTEN_ACTIVE_WAIT_CONF, EV_LISTEN_REQ}, | 533 | {ST_LISTEN_ACTIVE, ST_LISTEN_ACTIVE_WAIT_CONF, EV_LISTEN_REQ}, |
534 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_ERROR}, | 534 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_ERROR}, |
535 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_ERROR}, | 535 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_ERROR}, |
536 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY}, | 536 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY}, |
537 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY}, | 537 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY}, |
538 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK}, | 538 | {ST_LISTEN_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK}, |
539 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK}, | 539 | {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK}, |
540 | {}, | 540 | {}, |
541 | }; | 541 | }; |
542 | 542 | ||
543 | static void listen_change_state(capidrv_contr * card, int event) | 543 | static void listen_change_state(capidrv_contr *card, int event) |
544 | { | 544 | { |
545 | struct listenstatechange *p = listentable; | 545 | struct listenstatechange *p = listentable; |
546 | while (p->event) { | 546 | while (p->event) { |
@@ -560,7 +560,7 @@ static void listen_change_state(capidrv_contr * card, int event) | |||
560 | 560 | ||
561 | /* ------------------------------------------------------------------ */ | 561 | /* ------------------------------------------------------------------ */ |
562 | 562 | ||
563 | static void p0(capidrv_contr * card, capidrv_plci * plci) | 563 | static void p0(capidrv_contr *card, capidrv_plci *plci) |
564 | { | 564 | { |
565 | isdn_ctrl cmd; | 565 | isdn_ctrl cmd; |
566 | 566 | ||
@@ -578,71 +578,71 @@ struct plcistatechange { | |||
578 | int actstate; | 578 | int actstate; |
579 | int nextstate; | 579 | int nextstate; |
580 | int event; | 580 | int event; |
581 | void (*changefunc) (capidrv_contr * card, capidrv_plci * plci); | 581 | void (*changefunc)(capidrv_contr *card, capidrv_plci *plci); |
582 | }; | 582 | }; |
583 | 583 | ||
584 | static struct plcistatechange plcitable[] = | 584 | static struct plcistatechange plcitable[] = |
585 | { | 585 | { |
586 | /* P-0 */ | 586 | /* P-0 */ |
587 | {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL}, | 587 | {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL}, |
588 | {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL}, | 588 | {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL}, |
589 | {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL}, | 589 | {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL}, |
590 | {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL}, | 590 | {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL}, |
591 | /* P-0.1 */ | 591 | /* P-0.1 */ |
592 | {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0}, | 592 | {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0}, |
593 | {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL}, | 593 | {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL}, |
594 | /* P-1 */ | 594 | /* P-1 */ |
595 | {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, | 595 | {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, |
596 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, | 596 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, |
597 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, | 597 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, |
598 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 598 | {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
599 | /* P-ACT */ | 599 | /* P-ACT */ |
600 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, | 600 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, |
601 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, | 601 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, |
602 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 602 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
603 | {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL}, | 603 | {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL}, |
604 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL}, | 604 | {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL}, |
605 | /* P-2 */ | 605 | /* P-2 */ |
606 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, | 606 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, |
607 | {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL}, | 607 | {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL}, |
608 | {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL}, | 608 | {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL}, |
609 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, | 609 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, |
610 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, | 610 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, |
611 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 611 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
612 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL}, | 612 | {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL}, |
613 | /* P-3 */ | 613 | /* P-3 */ |
614 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, | 614 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, |
615 | {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, | 615 | {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, |
616 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, | 616 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, |
617 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, | 617 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, |
618 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 618 | {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
619 | /* P-4 */ | 619 | /* P-4 */ |
620 | {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, | 620 | {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, |
621 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, | 621 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, |
622 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, | 622 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, |
623 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 623 | {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
624 | /* P-5 */ | 624 | /* P-5 */ |
625 | {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, | 625 | {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, |
626 | /* P-6 */ | 626 | /* P-6 */ |
627 | {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0}, | 627 | {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0}, |
628 | /* P-0.Res */ | 628 | /* P-0.Res */ |
629 | {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0}, | 629 | {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0}, |
630 | {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL}, | 630 | {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL}, |
631 | /* P-RES */ | 631 | /* P-RES */ |
632 | {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL}, | 632 | {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL}, |
633 | /* P-HELD */ | 633 | /* P-HELD */ |
634 | {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL}, | 634 | {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL}, |
635 | {}, | 635 | {}, |
636 | }; | 636 | }; |
637 | 637 | ||
638 | static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int event) | 638 | static void plci_change_state(capidrv_contr *card, capidrv_plci *plci, int event) |
639 | { | 639 | { |
640 | struct plcistatechange *p = plcitable; | 640 | struct plcistatechange *p = plcitable; |
641 | while (p->event) { | 641 | while (p->event) { |
642 | if (plci->state == p->actstate && p->event == event) { | 642 | if (plci->state == p->actstate && p->event == event) { |
643 | if (debugmode) | 643 | if (debugmode) |
644 | printk(KERN_DEBUG "capidrv-%d: plci_change_state:0x%x %d -> %d\n", | 644 | printk(KERN_DEBUG "capidrv-%d: plci_change_state:0x%x %d -> %d\n", |
645 | card->contrnr, plci->plci, plci->state, p->nextstate); | 645 | card->contrnr, plci->plci, plci->state, p->nextstate); |
646 | plci->state = p->nextstate; | 646 | plci->state = p->nextstate; |
647 | if (p->changefunc) | 647 | if (p->changefunc) |
648 | p->changefunc(card, plci); | 648 | p->changefunc(card, plci); |
@@ -658,7 +658,7 @@ static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int eve | |||
658 | 658 | ||
659 | static _cmsg cmsg; | 659 | static _cmsg cmsg; |
660 | 660 | ||
661 | static void n0(capidrv_contr * card, capidrv_ncci * ncci) | 661 | static void n0(capidrv_contr *card, capidrv_ncci *ncci) |
662 | { | 662 | { |
663 | isdn_ctrl cmd; | 663 | isdn_ctrl cmd; |
664 | 664 | ||
@@ -670,7 +670,7 @@ static void n0(capidrv_contr * card, capidrv_ncci * ncci) | |||
670 | NULL, /* Keypadfacility */ | 670 | NULL, /* Keypadfacility */ |
671 | NULL, /* Useruserdata */ /* $$$$ */ | 671 | NULL, /* Useruserdata */ /* $$$$ */ |
672 | NULL /* Facilitydataarray */ | 672 | NULL /* Facilitydataarray */ |
673 | ); | 673 | ); |
674 | plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ); | 674 | plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ); |
675 | send_message(card, &cmsg); | 675 | send_message(card, &cmsg); |
676 | 676 | ||
@@ -687,51 +687,51 @@ struct nccistatechange { | |||
687 | int actstate; | 687 | int actstate; |
688 | int nextstate; | 688 | int nextstate; |
689 | int event; | 689 | int event; |
690 | void (*changefunc) (capidrv_contr * card, capidrv_ncci * ncci); | 690 | void (*changefunc)(capidrv_contr *card, capidrv_ncci *ncci); |
691 | }; | 691 | }; |
692 | 692 | ||
693 | static struct nccistatechange nccitable[] = | 693 | static struct nccistatechange nccitable[] = |
694 | { | 694 | { |
695 | /* N-0 */ | 695 | /* N-0 */ |
696 | {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL}, | 696 | {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL}, |
697 | {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL}, | 697 | {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL}, |
698 | /* N-0.1 */ | 698 | /* N-0.1 */ |
699 | {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL}, | 699 | {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL}, |
700 | {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0}, | 700 | {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0}, |
701 | /* N-1 */ | 701 | /* N-1 */ |
702 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL}, | 702 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL}, |
703 | {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL}, | 703 | {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL}, |
704 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, | 704 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, |
705 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, | 705 | {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, |
706 | /* N-2 */ | 706 | /* N-2 */ |
707 | {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL}, | 707 | {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL}, |
708 | {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, | 708 | {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, |
709 | {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, | 709 | {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, |
710 | /* N-ACT */ | 710 | /* N-ACT */ |
711 | {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, | 711 | {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, |
712 | {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL}, | 712 | {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL}, |
713 | {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, | 713 | {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, |
714 | {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, | 714 | {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, |
715 | /* N-3 */ | 715 | /* N-3 */ |
716 | {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, | 716 | {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, |
717 | {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, | 717 | {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, |
718 | {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, | 718 | {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, |
719 | /* N-4 */ | 719 | /* N-4 */ |
720 | {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, | 720 | {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, |
721 | {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL}, | 721 | {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR, NULL}, |
722 | /* N-5 */ | 722 | /* N-5 */ |
723 | {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0}, | 723 | {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0}, |
724 | {}, | 724 | {}, |
725 | }; | 725 | }; |
726 | 726 | ||
727 | static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int event) | 727 | static void ncci_change_state(capidrv_contr *card, capidrv_ncci *ncci, int event) |
728 | { | 728 | { |
729 | struct nccistatechange *p = nccitable; | 729 | struct nccistatechange *p = nccitable; |
730 | while (p->event) { | 730 | while (p->event) { |
731 | if (ncci->state == p->actstate && p->event == event) { | 731 | if (ncci->state == p->actstate && p->event == event) { |
732 | if (debugmode) | 732 | if (debugmode) |
733 | printk(KERN_DEBUG "capidrv-%d: ncci_change_state:0x%x %d -> %d\n", | 733 | printk(KERN_DEBUG "capidrv-%d: ncci_change_state:0x%x %d -> %d\n", |
734 | card->contrnr, ncci->ncci, ncci->state, p->nextstate); | 734 | card->contrnr, ncci->ncci, ncci->state, p->nextstate); |
735 | if (p->nextstate == ST_NCCI_PREVIOUS) { | 735 | if (p->nextstate == ST_NCCI_PREVIOUS) { |
736 | ncci->state = ncci->oldstate; | 736 | ncci->state = ncci->oldstate; |
737 | ncci->oldstate = p->actstate; | 737 | ncci->oldstate = p->actstate; |
@@ -751,7 +751,7 @@ static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int eve | |||
751 | 751 | ||
752 | /* ------------------------------------------------------------------- */ | 752 | /* ------------------------------------------------------------------- */ |
753 | 753 | ||
754 | static inline int new_bchan(capidrv_contr * card) | 754 | static inline int new_bchan(capidrv_contr *card) |
755 | { | 755 | { |
756 | int i; | 756 | int i; |
757 | for (i = 0; i < card->nbchan; i++) { | 757 | for (i = 0; i < card->nbchan; i++) { |
@@ -765,7 +765,7 @@ static inline int new_bchan(capidrv_contr * card) | |||
765 | 765 | ||
766 | /* ------------------------------------------------------------------- */ | 766 | /* ------------------------------------------------------------------- */ |
767 | 767 | ||
768 | static void handle_controller(_cmsg * cmsg) | 768 | static void handle_controller(_cmsg *cmsg) |
769 | { | 769 | { |
770 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); | 770 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); |
771 | 771 | ||
@@ -791,54 +791,54 @@ static void handle_controller(_cmsg * cmsg) | |||
791 | break; | 791 | break; |
792 | 792 | ||
793 | case CAPI_MANUFACTURER_IND: /* Controller */ | 793 | case CAPI_MANUFACTURER_IND: /* Controller */ |
794 | if ( cmsg->ManuID == 0x214D5641 | 794 | if (cmsg->ManuID == 0x214D5641 |
795 | && cmsg->Class == 0 | 795 | && cmsg->Class == 0 |
796 | && cmsg->Function == 1) { | 796 | && cmsg->Function == 1) { |
797 | u8 *data = cmsg->ManuData+3; | 797 | u8 *data = cmsg->ManuData + 3; |
798 | u16 len = cmsg->ManuData[0]; | 798 | u16 len = cmsg->ManuData[0]; |
799 | u16 layer; | 799 | u16 layer; |
800 | int direction; | 800 | int direction; |
801 | if (len == 255) { | 801 | if (len == 255) { |
802 | len = (cmsg->ManuData[1] | (cmsg->ManuData[2] << 8)); | 802 | len = (cmsg->ManuData[1] | (cmsg->ManuData[2] << 8)); |
803 | data += 2; | 803 | data += 2; |
804 | } | 804 | } |
805 | len -= 2; | 805 | len -= 2; |
806 | layer = ((*(data-1)) << 8) | *(data-2); | 806 | layer = ((*(data - 1)) << 8) | *(data - 2); |
807 | if (layer & 0x300) | 807 | if (layer & 0x300) |
808 | direction = (layer & 0x200) ? 0 : 1; | 808 | direction = (layer & 0x200) ? 0 : 1; |
809 | else direction = (layer & 0x800) ? 0 : 1; | 809 | else direction = (layer & 0x800) ? 0 : 1; |
810 | if (layer & 0x0C00) { | 810 | if (layer & 0x0C00) { |
811 | if ((layer & 0xff) == 0x80) { | 811 | if ((layer & 0xff) == 0x80) { |
812 | handle_dtrace_data(card, direction, 1, data, len); | 812 | handle_dtrace_data(card, direction, 1, data, len); |
813 | break; | 813 | break; |
814 | } | 814 | } |
815 | } else if ((layer & 0xff) < 0x80) { | 815 | } else if ((layer & 0xff) < 0x80) { |
816 | handle_dtrace_data(card, direction, 0, data, len); | 816 | handle_dtrace_data(card, direction, 0, data, len); |
817 | break; | 817 | break; |
818 | } | 818 | } |
819 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x layer 0x%x, ignored\n", | 819 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x layer 0x%x, ignored\n", |
820 | card->contrnr, | 820 | card->contrnr, |
821 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 821 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
822 | cmsg->adr.adrController, layer); | 822 | cmsg->adr.adrController, layer); |
823 | break; | 823 | break; |
824 | } | 824 | } |
825 | goto ignored; | 825 | goto ignored; |
826 | case CAPI_MANUFACTURER_CONF: /* Controller */ | 826 | case CAPI_MANUFACTURER_CONF: /* Controller */ |
827 | if (cmsg->ManuID == 0x214D5641) { | 827 | if (cmsg->ManuID == 0x214D5641) { |
828 | char *s = NULL; | 828 | char *s = NULL; |
829 | switch (cmsg->Class) { | 829 | switch (cmsg->Class) { |
830 | case 0: break; | 830 | case 0: break; |
831 | case 1: s = "unknown class"; break; | 831 | case 1: s = "unknown class"; break; |
832 | case 2: s = "unknown function"; break; | 832 | case 2: s = "unknown function"; break; |
833 | default: s = "unknown error"; break; | 833 | default: s = "unknown error"; break; |
834 | } | 834 | } |
835 | if (s) | 835 | if (s) |
836 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x function %d: %s\n", | 836 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x function %d: %s\n", |
837 | card->contrnr, | 837 | card->contrnr, |
838 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 838 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
839 | cmsg->adr.adrController, | 839 | cmsg->adr.adrController, |
840 | cmsg->Function, s); | 840 | cmsg->Function, s); |
841 | break; | 841 | break; |
842 | } | 842 | } |
843 | goto ignored; | 843 | goto ignored; |
844 | case CAPI_FACILITY_IND: /* Controller/plci/ncci */ | 844 | case CAPI_FACILITY_IND: /* Controller/plci/ncci */ |
@@ -858,14 +858,14 @@ static void handle_controller(_cmsg * cmsg) | |||
858 | } | 858 | } |
859 | return; | 859 | return; |
860 | 860 | ||
861 | ignored: | 861 | ignored: |
862 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x ignored\n", | 862 | printk(KERN_INFO "capidrv-%d: %s from controller 0x%x ignored\n", |
863 | card->contrnr, | 863 | card->contrnr, |
864 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 864 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
865 | cmsg->adr.adrController); | 865 | cmsg->adr.adrController); |
866 | } | 866 | } |
867 | 867 | ||
868 | static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | 868 | static void handle_incoming_call(capidrv_contr *card, _cmsg *cmsg) |
869 | { | 869 | { |
870 | capidrv_plci *plcip; | 870 | capidrv_plci *plcip; |
871 | capidrv_bchan *bchan; | 871 | capidrv_bchan *bchan; |
@@ -890,27 +890,27 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | |||
890 | cmd.arg = chan; | 890 | cmd.arg = chan; |
891 | memset(&cmd.parm.setup, 0, sizeof(cmd.parm.setup)); | 891 | memset(&cmd.parm.setup, 0, sizeof(cmd.parm.setup)); |
892 | strncpy(cmd.parm.setup.phone, | 892 | strncpy(cmd.parm.setup.phone, |
893 | cmsg->CallingPartyNumber + 3, | 893 | cmsg->CallingPartyNumber + 3, |
894 | cmsg->CallingPartyNumber[0] - 2); | 894 | cmsg->CallingPartyNumber[0] - 2); |
895 | strncpy(cmd.parm.setup.eazmsn, | 895 | strncpy(cmd.parm.setup.eazmsn, |
896 | cmsg->CalledPartyNumber + 2, | 896 | cmsg->CalledPartyNumber + 2, |
897 | cmsg->CalledPartyNumber[0] - 1); | 897 | cmsg->CalledPartyNumber[0] - 1); |
898 | cmd.parm.setup.si1 = cip2si1(cmsg->CIPValue); | 898 | cmd.parm.setup.si1 = cip2si1(cmsg->CIPValue); |
899 | cmd.parm.setup.si2 = cip2si2(cmsg->CIPValue); | 899 | cmd.parm.setup.si2 = cip2si2(cmsg->CIPValue); |
900 | cmd.parm.setup.plan = cmsg->CallingPartyNumber[1]; | 900 | cmd.parm.setup.plan = cmsg->CallingPartyNumber[1]; |
901 | cmd.parm.setup.screen = cmsg->CallingPartyNumber[2]; | 901 | cmd.parm.setup.screen = cmsg->CallingPartyNumber[2]; |
902 | 902 | ||
903 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s\n", | 903 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s\n", |
904 | card->contrnr, | 904 | card->contrnr, |
905 | cmd.parm.setup.phone, | 905 | cmd.parm.setup.phone, |
906 | cmd.parm.setup.si1, | 906 | cmd.parm.setup.si1, |
907 | cmd.parm.setup.si2, | 907 | cmd.parm.setup.si2, |
908 | cmd.parm.setup.eazmsn); | 908 | cmd.parm.setup.eazmsn); |
909 | 909 | ||
910 | if (cmd.parm.setup.si1 == 1 && cmd.parm.setup.si2 != 0) { | 910 | if (cmd.parm.setup.si1 == 1 && cmd.parm.setup.si2 != 0) { |
911 | printk(KERN_INFO "capidrv-%d: patching si2=%d to 0 for VBOX\n", | 911 | printk(KERN_INFO "capidrv-%d: patching si2=%d to 0 for VBOX\n", |
912 | card->contrnr, | 912 | card->contrnr, |
913 | cmd.parm.setup.si2); | 913 | cmd.parm.setup.si2); |
914 | cmd.parm.setup.si2 = 0; | 914 | cmd.parm.setup.si2 = 0; |
915 | } | 915 | } |
916 | 916 | ||
@@ -927,11 +927,11 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | |||
927 | plci_change_state(card, plcip, EV_PLCI_CONNECT_REJECT); | 927 | plci_change_state(card, plcip, EV_PLCI_CONNECT_REJECT); |
928 | send_message(card, cmsg); | 928 | send_message(card, cmsg); |
929 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s ignored\n", | 929 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s ignored\n", |
930 | card->contrnr, | 930 | card->contrnr, |
931 | cmd.parm.setup.phone, | 931 | cmd.parm.setup.phone, |
932 | cmd.parm.setup.si1, | 932 | cmd.parm.setup.si1, |
933 | cmd.parm.setup.si2, | 933 | cmd.parm.setup.si2, |
934 | cmd.parm.setup.eazmsn); | 934 | cmd.parm.setup.eazmsn); |
935 | break; | 935 | break; |
936 | case 1: | 936 | case 1: |
937 | /* At least one device matching this call (RING on ttyI) | 937 | /* At least one device matching this call (RING on ttyI) |
@@ -945,11 +945,11 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | |||
945 | */ | 945 | */ |
946 | if (plcip->state == ST_PLCI_INCOMING) { | 946 | if (plcip->state == ST_PLCI_INCOMING) { |
947 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s tty alerting\n", | 947 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s tty alerting\n", |
948 | card->contrnr, | 948 | card->contrnr, |
949 | cmd.parm.setup.phone, | 949 | cmd.parm.setup.phone, |
950 | cmd.parm.setup.si1, | 950 | cmd.parm.setup.si1, |
951 | cmd.parm.setup.si2, | 951 | cmd.parm.setup.si2, |
952 | cmd.parm.setup.eazmsn); | 952 | cmd.parm.setup.eazmsn); |
953 | capi_fill_ALERT_REQ(cmsg, | 953 | capi_fill_ALERT_REQ(cmsg, |
954 | global.ap.applid, | 954 | global.ap.applid, |
955 | card->msgid++, | 955 | card->msgid++, |
@@ -958,16 +958,16 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | |||
958 | NULL,/* Keypadfacility */ | 958 | NULL,/* Keypadfacility */ |
959 | NULL,/* Useruserdata */ | 959 | NULL,/* Useruserdata */ |
960 | NULL /* Facilitydataarray */ | 960 | NULL /* Facilitydataarray */ |
961 | ); | 961 | ); |
962 | plcip->msgid = cmsg->Messagenumber; | 962 | plcip->msgid = cmsg->Messagenumber; |
963 | send_message(card, cmsg); | 963 | send_message(card, cmsg); |
964 | } else { | 964 | } else { |
965 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s on netdev\n", | 965 | printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s on netdev\n", |
966 | card->contrnr, | 966 | card->contrnr, |
967 | cmd.parm.setup.phone, | 967 | cmd.parm.setup.phone, |
968 | cmd.parm.setup.si1, | 968 | cmd.parm.setup.si1, |
969 | cmd.parm.setup.si2, | 969 | cmd.parm.setup.si2, |
970 | cmd.parm.setup.eazmsn); | 970 | cmd.parm.setup.eazmsn); |
971 | } | 971 | } |
972 | break; | 972 | break; |
973 | 973 | ||
@@ -990,7 +990,7 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) | |||
990 | return; | 990 | return; |
991 | } | 991 | } |
992 | 992 | ||
993 | static void handle_plci(_cmsg * cmsg) | 993 | static void handle_plci(_cmsg *cmsg) |
994 | { | 994 | { |
995 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); | 995 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); |
996 | capidrv_plci *plcip; | 996 | capidrv_plci *plcip; |
@@ -1008,8 +1008,8 @@ static void handle_plci(_cmsg * cmsg) | |||
1008 | case CAPI_DISCONNECT_IND: /* plci */ | 1008 | case CAPI_DISCONNECT_IND: /* plci */ |
1009 | if (cmsg->Reason) { | 1009 | if (cmsg->Reason) { |
1010 | printk(KERN_INFO "capidrv-%d: %s reason 0x%x (%s) for plci 0x%x\n", | 1010 | printk(KERN_INFO "capidrv-%d: %s reason 0x%x (%s) for plci 0x%x\n", |
1011 | card->contrnr, | 1011 | card->contrnr, |
1012 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1012 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1013 | cmsg->Reason, capi_info2str(cmsg->Reason), cmsg->adr.adrPLCI); | 1013 | cmsg->Reason, capi_info2str(cmsg->Reason), cmsg->adr.adrPLCI); |
1014 | } | 1014 | } |
1015 | if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI))) { | 1015 | if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI))) { |
@@ -1027,9 +1027,9 @@ static void handle_plci(_cmsg * cmsg) | |||
1027 | case CAPI_DISCONNECT_CONF: /* plci */ | 1027 | case CAPI_DISCONNECT_CONF: /* plci */ |
1028 | if (cmsg->Info) { | 1028 | if (cmsg->Info) { |
1029 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", | 1029 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", |
1030 | card->contrnr, | 1030 | card->contrnr, |
1031 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1031 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1032 | cmsg->Info, capi_info2str(cmsg->Info), | 1032 | cmsg->Info, capi_info2str(cmsg->Info), |
1033 | cmsg->adr.adrPLCI); | 1033 | cmsg->adr.adrPLCI); |
1034 | } | 1034 | } |
1035 | if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI))) | 1035 | if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI))) |
@@ -1041,9 +1041,9 @@ static void handle_plci(_cmsg * cmsg) | |||
1041 | case CAPI_ALERT_CONF: /* plci */ | 1041 | case CAPI_ALERT_CONF: /* plci */ |
1042 | if (cmsg->Info) { | 1042 | if (cmsg->Info) { |
1043 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", | 1043 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", |
1044 | card->contrnr, | 1044 | card->contrnr, |
1045 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1045 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1046 | cmsg->Info, capi_info2str(cmsg->Info), | 1046 | cmsg->Info, capi_info2str(cmsg->Info), |
1047 | cmsg->adr.adrPLCI); | 1047 | cmsg->adr.adrPLCI); |
1048 | } | 1048 | } |
1049 | break; | 1049 | break; |
@@ -1055,9 +1055,9 @@ static void handle_plci(_cmsg * cmsg) | |||
1055 | case CAPI_CONNECT_CONF: /* plci */ | 1055 | case CAPI_CONNECT_CONF: /* plci */ |
1056 | if (cmsg->Info) { | 1056 | if (cmsg->Info) { |
1057 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", | 1057 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n", |
1058 | card->contrnr, | 1058 | card->contrnr, |
1059 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1059 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1060 | cmsg->Info, capi_info2str(cmsg->Info), | 1060 | cmsg->Info, capi_info2str(cmsg->Info), |
1061 | cmsg->adr.adrPLCI); | 1061 | cmsg->adr.adrPLCI); |
1062 | } | 1062 | } |
1063 | if (!(plcip = find_plci_by_msgid(card, cmsg->Messagenumber))) | 1063 | if (!(plcip = find_plci_by_msgid(card, cmsg->Messagenumber))) |
@@ -1096,7 +1096,7 @@ static void handle_plci(_cmsg * cmsg) | |||
1096 | card->msgid++, | 1096 | card->msgid++, |
1097 | plcip->plci, /* adr */ | 1097 | plcip->plci, /* adr */ |
1098 | NULL /* NCPI */ | 1098 | NULL /* NCPI */ |
1099 | ); | 1099 | ); |
1100 | nccip->msgid = cmsg->Messagenumber; | 1100 | nccip->msgid = cmsg->Messagenumber; |
1101 | plci_change_state(card, plcip, | 1101 | plci_change_state(card, plcip, |
1102 | EV_PLCI_CONNECT_ACTIVE_IND); | 1102 | EV_PLCI_CONNECT_ACTIVE_IND); |
@@ -1122,8 +1122,8 @@ static void handle_plci(_cmsg * cmsg) | |||
1122 | sprintf(cmd.parm.num, "%lu", | 1122 | sprintf(cmd.parm.num, "%lu", |
1123 | (unsigned long) | 1123 | (unsigned long) |
1124 | ((u32) cmsg->InfoElement[1] | 1124 | ((u32) cmsg->InfoElement[1] |
1125 | | ((u32) (cmsg->InfoElement[2]) << 8) | 1125 | | ((u32) (cmsg->InfoElement[2]) << 8) |
1126 | | ((u32) (cmsg->InfoElement[3]) << 16) | 1126 | | ((u32) (cmsg->InfoElement[3]) << 16) |
1127 | | ((u32) (cmsg->InfoElement[4]) << 24))); | 1127 | | ((u32) (cmsg->InfoElement[4]) << 24))); |
1128 | card->interface.statcallb(&cmd); | 1128 | card->interface.statcallb(&cmd); |
1129 | break; | 1129 | break; |
@@ -1132,11 +1132,11 @@ static void handle_plci(_cmsg * cmsg) | |||
1132 | cdb = capi_cmsg2str(cmsg); | 1132 | cdb = capi_cmsg2str(cmsg); |
1133 | if (cdb) { | 1133 | if (cdb) { |
1134 | printk(KERN_WARNING "capidrv-%d: %s\n", | 1134 | printk(KERN_WARNING "capidrv-%d: %s\n", |
1135 | card->contrnr, cdb->buf); | 1135 | card->contrnr, cdb->buf); |
1136 | cdebbuf_free(cdb); | 1136 | cdebbuf_free(cdb); |
1137 | } else | 1137 | } else |
1138 | printk(KERN_WARNING "capidrv-%d: CAPI_INFO_IND InfoNumber %x not handled\n", | 1138 | printk(KERN_WARNING "capidrv-%d: CAPI_INFO_IND InfoNumber %x not handled\n", |
1139 | card->contrnr, cmsg->InfoNumber); | 1139 | card->contrnr, cmsg->InfoNumber); |
1140 | 1140 | ||
1141 | break; | 1141 | break; |
1142 | 1142 | ||
@@ -1159,13 +1159,13 @@ static void handle_plci(_cmsg * cmsg) | |||
1159 | cmsg->adr.adrPLCI); | 1159 | cmsg->adr.adrPLCI); |
1160 | } | 1160 | } |
1161 | return; | 1161 | return; |
1162 | ignored: | 1162 | ignored: |
1163 | printk(KERN_INFO "capidrv-%d: %s for plci 0x%x ignored\n", | 1163 | printk(KERN_INFO "capidrv-%d: %s for plci 0x%x ignored\n", |
1164 | card->contrnr, | 1164 | card->contrnr, |
1165 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1165 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1166 | cmsg->adr.adrPLCI); | 1166 | cmsg->adr.adrPLCI); |
1167 | return; | 1167 | return; |
1168 | notfound: | 1168 | notfound: |
1169 | printk(KERN_ERR "capidrv-%d: %s: plci 0x%x not found\n", | 1169 | printk(KERN_ERR "capidrv-%d: %s: plci 0x%x not found\n", |
1170 | card->contrnr, | 1170 | card->contrnr, |
1171 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1171 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
@@ -1173,7 +1173,7 @@ static void handle_plci(_cmsg * cmsg) | |||
1173 | return; | 1173 | return; |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | static void handle_ncci(_cmsg * cmsg) | 1176 | static void handle_ncci(_cmsg *cmsg) |
1177 | { | 1177 | { |
1178 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); | 1178 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); |
1179 | capidrv_plci *plcip; | 1179 | capidrv_plci *plcip; |
@@ -1222,7 +1222,7 @@ static void handle_ncci(_cmsg * cmsg) | |||
1222 | nccip->ncci, /* adr */ | 1222 | nccip->ncci, /* adr */ |
1223 | 0, /* Reject */ | 1223 | 0, /* Reject */ |
1224 | NULL /* NCPI */ | 1224 | NULL /* NCPI */ |
1225 | ); | 1225 | ); |
1226 | ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP); | 1226 | ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP); |
1227 | send_message(card, cmsg); | 1227 | send_message(card, cmsg); |
1228 | break; | 1228 | break; |
@@ -1230,8 +1230,8 @@ static void handle_ncci(_cmsg * cmsg) | |||
1230 | printk(KERN_ERR "capidrv-%d: no mem for ncci, sorry\n", card->contrnr); | 1230 | printk(KERN_ERR "capidrv-%d: no mem for ncci, sorry\n", card->contrnr); |
1231 | } else { | 1231 | } else { |
1232 | printk(KERN_ERR "capidrv-%d: %s: plci for ncci 0x%x not found\n", | 1232 | printk(KERN_ERR "capidrv-%d: %s: plci for ncci 0x%x not found\n", |
1233 | card->contrnr, | 1233 | card->contrnr, |
1234 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1234 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1235 | cmsg->adr.adrNCCI); | 1235 | cmsg->adr.adrNCCI); |
1236 | } | 1236 | } |
1237 | capi_fill_CONNECT_B3_RESP(cmsg, | 1237 | capi_fill_CONNECT_B3_RESP(cmsg, |
@@ -1240,7 +1240,7 @@ static void handle_ncci(_cmsg * cmsg) | |||
1240 | cmsg->adr.adrNCCI, | 1240 | cmsg->adr.adrNCCI, |
1241 | 2, /* Reject */ | 1241 | 2, /* Reject */ |
1242 | NULL /* NCPI */ | 1242 | NULL /* NCPI */ |
1243 | ); | 1243 | ); |
1244 | send_message(card, cmsg); | 1244 | send_message(card, cmsg); |
1245 | break; | 1245 | break; |
1246 | 1246 | ||
@@ -1254,9 +1254,9 @@ static void handle_ncci(_cmsg * cmsg) | |||
1254 | nccip->ncci = cmsg->adr.adrNCCI; | 1254 | nccip->ncci = cmsg->adr.adrNCCI; |
1255 | if (cmsg->Info) { | 1255 | if (cmsg->Info) { |
1256 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n", | 1256 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n", |
1257 | card->contrnr, | 1257 | card->contrnr, |
1258 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1258 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1259 | cmsg->Info, capi_info2str(cmsg->Info), | 1259 | cmsg->Info, capi_info2str(cmsg->Info), |
1260 | cmsg->adr.adrNCCI); | 1260 | cmsg->adr.adrNCCI); |
1261 | } | 1261 | } |
1262 | 1262 | ||
@@ -1278,7 +1278,7 @@ static void handle_ncci(_cmsg * cmsg) | |||
1278 | case CAPI_DATA_B3_CONF: /* ncci */ | 1278 | case CAPI_DATA_B3_CONF: /* ncci */ |
1279 | if (cmsg->Info) { | 1279 | if (cmsg->Info) { |
1280 | printk(KERN_WARNING "CAPI_DATA_B3_CONF: Info %x - %s\n", | 1280 | printk(KERN_WARNING "CAPI_DATA_B3_CONF: Info %x - %s\n", |
1281 | cmsg->Info, capi_info2str(cmsg->Info)); | 1281 | cmsg->Info, capi_info2str(cmsg->Info)); |
1282 | } | 1282 | } |
1283 | if (!(nccip = find_ncci(card, cmsg->adr.adrNCCI))) | 1283 | if (!(nccip = find_ncci(card, cmsg->adr.adrNCCI))) |
1284 | goto notfound; | 1284 | goto notfound; |
@@ -1286,11 +1286,11 @@ static void handle_ncci(_cmsg * cmsg) | |||
1286 | len = capidrv_del_ack(nccip, cmsg->DataHandle); | 1286 | len = capidrv_del_ack(nccip, cmsg->DataHandle); |
1287 | if (len < 0) | 1287 | if (len < 0) |
1288 | break; | 1288 | break; |
1289 | cmd.command = ISDN_STAT_BSENT; | 1289 | cmd.command = ISDN_STAT_BSENT; |
1290 | cmd.driver = card->myid; | 1290 | cmd.driver = card->myid; |
1291 | cmd.arg = nccip->chan; | 1291 | cmd.arg = nccip->chan; |
1292 | cmd.parm.length = len; | 1292 | cmd.parm.length = len; |
1293 | card->interface.statcallb(&cmd); | 1293 | card->interface.statcallb(&cmd); |
1294 | break; | 1294 | break; |
1295 | 1295 | ||
1296 | case CAPI_DISCONNECT_B3_IND: /* ncci */ | 1296 | case CAPI_DISCONNECT_B3_IND: /* ncci */ |
@@ -1309,9 +1309,9 @@ static void handle_ncci(_cmsg * cmsg) | |||
1309 | goto notfound; | 1309 | goto notfound; |
1310 | if (cmsg->Info) { | 1310 | if (cmsg->Info) { |
1311 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n", | 1311 | printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n", |
1312 | card->contrnr, | 1312 | card->contrnr, |
1313 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1313 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1314 | cmsg->Info, capi_info2str(cmsg->Info), | 1314 | cmsg->Info, capi_info2str(cmsg->Info), |
1315 | cmsg->adr.adrNCCI); | 1315 | cmsg->adr.adrNCCI); |
1316 | ncci_change_state(card, nccip, EV_NCCI_DISCONNECT_B3_CONF_ERROR); | 1316 | ncci_change_state(card, nccip, EV_NCCI_DISCONNECT_B3_CONF_ERROR); |
1317 | } | 1317 | } |
@@ -1340,13 +1340,13 @@ static void handle_ncci(_cmsg * cmsg) | |||
1340 | cmsg->adr.adrNCCI); | 1340 | cmsg->adr.adrNCCI); |
1341 | } | 1341 | } |
1342 | return; | 1342 | return; |
1343 | ignored: | 1343 | ignored: |
1344 | printk(KERN_INFO "capidrv-%d: %s for ncci 0x%x ignored\n", | 1344 | printk(KERN_INFO "capidrv-%d: %s for ncci 0x%x ignored\n", |
1345 | card->contrnr, | 1345 | card->contrnr, |
1346 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1346 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
1347 | cmsg->adr.adrNCCI); | 1347 | cmsg->adr.adrNCCI); |
1348 | return; | 1348 | return; |
1349 | notfound: | 1349 | notfound: |
1350 | printk(KERN_ERR "capidrv-%d: %s: ncci 0x%x not found\n", | 1350 | printk(KERN_ERR "capidrv-%d: %s: ncci 0x%x not found\n", |
1351 | card->contrnr, | 1351 | card->contrnr, |
1352 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), | 1352 | capi_cmd2str(cmsg->Command, cmsg->Subcommand), |
@@ -1354,7 +1354,7 @@ static void handle_ncci(_cmsg * cmsg) | |||
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | 1356 | ||
1357 | static void handle_data(_cmsg * cmsg, struct sk_buff *skb) | 1357 | static void handle_data(_cmsg *cmsg, struct sk_buff *skb) |
1358 | { | 1358 | { |
1359 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); | 1359 | capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); |
1360 | capidrv_ncci *nccip; | 1360 | capidrv_ncci *nccip; |
@@ -1390,12 +1390,12 @@ static void capidrv_recv_message(struct capi20_appl *ap, struct sk_buff *skb) | |||
1390 | 1390 | ||
1391 | if (cdb) { | 1391 | if (cdb) { |
1392 | printk(KERN_DEBUG "%s: applid=%d %s\n", __func__, | 1392 | printk(KERN_DEBUG "%s: applid=%d %s\n", __func__, |
1393 | ap->applid, cdb->buf); | 1393 | ap->applid, cdb->buf); |
1394 | cdebbuf_free(cdb); | 1394 | cdebbuf_free(cdb); |
1395 | } else | 1395 | } else |
1396 | printk(KERN_DEBUG "%s: applid=%d %s not traced\n", | 1396 | printk(KERN_DEBUG "%s: applid=%d %s not traced\n", |
1397 | __func__, ap->applid, | 1397 | __func__, ap->applid, |
1398 | capi_cmd2str(s_cmsg.Command, s_cmsg.Subcommand)); | 1398 | capi_cmd2str(s_cmsg.Command, s_cmsg.Subcommand)); |
1399 | } | 1399 | } |
1400 | if (s_cmsg.Command == CAPI_DATA_B3 | 1400 | if (s_cmsg.Command == CAPI_DATA_B3 |
1401 | && s_cmsg.Subcommand == CAPI_IND) { | 1401 | && s_cmsg.Subcommand == CAPI_IND) { |
@@ -1418,38 +1418,38 @@ static void capidrv_recv_message(struct capi20_appl *ap, struct sk_buff *skb) | |||
1418 | 1418 | ||
1419 | /* ------------------------------------------------------------------- */ | 1419 | /* ------------------------------------------------------------------- */ |
1420 | 1420 | ||
1421 | #define PUTBYTE_TO_STATUS(card, byte) \ | 1421 | #define PUTBYTE_TO_STATUS(card, byte) \ |
1422 | do { \ | 1422 | do { \ |
1423 | *(card)->q931_write++ = (byte); \ | 1423 | *(card)->q931_write++ = (byte); \ |
1424 | if ((card)->q931_write > (card)->q931_end) \ | 1424 | if ((card)->q931_write > (card)->q931_end) \ |
1425 | (card)->q931_write = (card)->q931_buf; \ | 1425 | (card)->q931_write = (card)->q931_buf; \ |
1426 | } while (0) | 1426 | } while (0) |
1427 | 1427 | ||
1428 | static void handle_dtrace_data(capidrv_contr *card, | 1428 | static void handle_dtrace_data(capidrv_contr *card, |
1429 | int send, int level2, u8 *data, u16 len) | 1429 | int send, int level2, u8 *data, u16 len) |
1430 | { | 1430 | { |
1431 | u8 *p, *end; | 1431 | u8 *p, *end; |
1432 | isdn_ctrl cmd; | 1432 | isdn_ctrl cmd; |
1433 | 1433 | ||
1434 | if (!len) { | 1434 | if (!len) { |
1435 | printk(KERN_DEBUG "capidrv-%d: avmb1_q931_data: len == %d\n", | 1435 | printk(KERN_DEBUG "capidrv-%d: avmb1_q931_data: len == %d\n", |
1436 | card->contrnr, len); | 1436 | card->contrnr, len); |
1437 | return; | 1437 | return; |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | if (level2) { | 1440 | if (level2) { |
1441 | PUTBYTE_TO_STATUS(card, 'D'); | 1441 | PUTBYTE_TO_STATUS(card, 'D'); |
1442 | PUTBYTE_TO_STATUS(card, '2'); | 1442 | PUTBYTE_TO_STATUS(card, '2'); |
1443 | PUTBYTE_TO_STATUS(card, send ? '>' : '<'); | 1443 | PUTBYTE_TO_STATUS(card, send ? '>' : '<'); |
1444 | PUTBYTE_TO_STATUS(card, ':'); | 1444 | PUTBYTE_TO_STATUS(card, ':'); |
1445 | } else { | 1445 | } else { |
1446 | PUTBYTE_TO_STATUS(card, 'D'); | 1446 | PUTBYTE_TO_STATUS(card, 'D'); |
1447 | PUTBYTE_TO_STATUS(card, '3'); | 1447 | PUTBYTE_TO_STATUS(card, '3'); |
1448 | PUTBYTE_TO_STATUS(card, send ? '>' : '<'); | 1448 | PUTBYTE_TO_STATUS(card, send ? '>' : '<'); |
1449 | PUTBYTE_TO_STATUS(card, ':'); | 1449 | PUTBYTE_TO_STATUS(card, ':'); |
1450 | } | 1450 | } |
1451 | 1451 | ||
1452 | for (p = data, end = data+len; p < end; p++) { | 1452 | for (p = data, end = data + len; p < end; p++) { |
1453 | PUTBYTE_TO_STATUS(card, ' '); | 1453 | PUTBYTE_TO_STATUS(card, ' '); |
1454 | PUTBYTE_TO_STATUS(card, hex_asc_hi(*p)); | 1454 | PUTBYTE_TO_STATUS(card, hex_asc_hi(*p)); |
1455 | PUTBYTE_TO_STATUS(card, hex_asc_lo(*p)); | 1455 | PUTBYTE_TO_STATUS(card, hex_asc_lo(*p)); |
@@ -1458,7 +1458,7 @@ static void handle_dtrace_data(capidrv_contr *card, | |||
1458 | 1458 | ||
1459 | cmd.command = ISDN_STAT_STAVAIL; | 1459 | cmd.command = ISDN_STAT_STAVAIL; |
1460 | cmd.driver = card->myid; | 1460 | cmd.driver = card->myid; |
1461 | cmd.arg = len*3+5; | 1461 | cmd.arg = len * 3 + 5; |
1462 | card->interface.statcallb(&cmd); | 1462 | card->interface.statcallb(&cmd); |
1463 | } | 1463 | } |
1464 | 1464 | ||
@@ -1466,17 +1466,17 @@ static void handle_dtrace_data(capidrv_contr *card, | |||
1466 | 1466 | ||
1467 | static _cmsg cmdcmsg; | 1467 | static _cmsg cmdcmsg; |
1468 | 1468 | ||
1469 | static int capidrv_ioctl(isdn_ctrl * c, capidrv_contr * card) | 1469 | static int capidrv_ioctl(isdn_ctrl *c, capidrv_contr *card) |
1470 | { | 1470 | { |
1471 | switch (c->arg) { | 1471 | switch (c->arg) { |
1472 | case 1: | 1472 | case 1: |
1473 | debugmode = (int)(*((unsigned int *)c->parm.num)); | 1473 | debugmode = (int)(*((unsigned int *)c->parm.num)); |
1474 | printk(KERN_DEBUG "capidrv-%d: debugmode=%d\n", | 1474 | printk(KERN_DEBUG "capidrv-%d: debugmode=%d\n", |
1475 | card->contrnr, debugmode); | 1475 | card->contrnr, debugmode); |
1476 | return 0; | 1476 | return 0; |
1477 | default: | 1477 | default: |
1478 | printk(KERN_DEBUG "capidrv-%d: capidrv_ioctl(%ld) called ??\n", | 1478 | printk(KERN_DEBUG "capidrv-%d: capidrv_ioctl(%ld) called ??\n", |
1479 | card->contrnr, c->arg); | 1479 | card->contrnr, c->arg); |
1480 | return -EINVAL; | 1480 | return -EINVAL; |
1481 | } | 1481 | } |
1482 | return -EINVAL; | 1482 | return -EINVAL; |
@@ -1487,9 +1487,9 @@ static int capidrv_ioctl(isdn_ctrl * c, capidrv_contr * card) | |||
1487 | */ | 1487 | */ |
1488 | 1488 | ||
1489 | struct internal_bchannelinfo { | 1489 | struct internal_bchannelinfo { |
1490 | unsigned short channelalloc; | 1490 | unsigned short channelalloc; |
1491 | unsigned short operation; | 1491 | unsigned short operation; |
1492 | unsigned char cmask[31]; | 1492 | unsigned char cmask[31]; |
1493 | }; | 1493 | }; |
1494 | 1494 | ||
1495 | static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) | 1495 | static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) |
@@ -1540,10 +1540,10 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) | |||
1540 | if (digit2 <= 0 || digit2 > 30) return -4; | 1540 | if (digit2 <= 0 || digit2 > 30) return -4; |
1541 | if (*s == 0 || *s == ',' || *s == ' ') { | 1541 | if (*s == 0 || *s == ',' || *s == ' ') { |
1542 | if (digit1 > digit2) | 1542 | if (digit1 > digit2) |
1543 | for (i = digit2; i <= digit1 ; i++) | 1543 | for (i = digit2; i <= digit1; i++) |
1544 | bmask |= (1 << i); | 1544 | bmask |= (1 << i); |
1545 | else | 1545 | else |
1546 | for (i = digit1; i <= digit2 ; i++) | 1546 | for (i = digit1; i <= digit2; i++) |
1547 | bmask |= (1 << i); | 1547 | bmask |= (1 << i); |
1548 | digit1 = digit2 = 0; | 1548 | digit1 = digit2 = 0; |
1549 | if (*s) s++; | 1549 | if (*s) s++; |
@@ -1556,131 +1556,131 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) | |||
1556 | return 0; | 1556 | return 0; |
1557 | } | 1557 | } |
1558 | 1558 | ||
1559 | static int FVteln2capi20(char *teln, u8 AdditionalInfo[1+2+2+31]) | 1559 | static int FVteln2capi20(char *teln, u8 AdditionalInfo[1 + 2 + 2 + 31]) |
1560 | { | 1560 | { |
1561 | unsigned long bmask; | 1561 | unsigned long bmask; |
1562 | int active; | 1562 | int active; |
1563 | int rc, i; | 1563 | int rc, i; |
1564 | 1564 | ||
1565 | rc = decodeFVteln(teln, &bmask, &active); | 1565 | rc = decodeFVteln(teln, &bmask, &active); |
1566 | if (rc) return rc; | 1566 | if (rc) return rc; |
1567 | /* Length */ | 1567 | /* Length */ |
1568 | AdditionalInfo[0] = 2+2+31; | 1568 | AdditionalInfo[0] = 2 + 2 + 31; |
1569 | /* Channel: 3 => use channel allocation */ | 1569 | /* Channel: 3 => use channel allocation */ |
1570 | AdditionalInfo[1] = 3; AdditionalInfo[2] = 0; | 1570 | AdditionalInfo[1] = 3; AdditionalInfo[2] = 0; |
1571 | /* Operation: 0 => DTE mode, 1 => DCE mode */ | 1571 | /* Operation: 0 => DTE mode, 1 => DCE mode */ |
1572 | if (active) { | 1572 | if (active) { |
1573 | AdditionalInfo[3] = 0; AdditionalInfo[4] = 0; | 1573 | AdditionalInfo[3] = 0; AdditionalInfo[4] = 0; |
1574 | } else { | 1574 | } else { |
1575 | AdditionalInfo[3] = 1; AdditionalInfo[4] = 0; | 1575 | AdditionalInfo[3] = 1; AdditionalInfo[4] = 0; |
1576 | } | 1576 | } |
1577 | /* Channel mask array */ | 1577 | /* Channel mask array */ |
1578 | AdditionalInfo[5] = 0; /* no D-Channel */ | 1578 | AdditionalInfo[5] = 0; /* no D-Channel */ |
1579 | for (i=1; i <= 30; i++) | 1579 | for (i = 1; i <= 30; i++) |
1580 | AdditionalInfo[5+i] = (bmask & (1 << i)) ? 0xff : 0; | 1580 | AdditionalInfo[5 + i] = (bmask & (1 << i)) ? 0xff : 0; |
1581 | return 0; | 1581 | return 0; |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | 1584 | static int capidrv_command(isdn_ctrl *c, capidrv_contr *card) |
1585 | { | 1585 | { |
1586 | isdn_ctrl cmd; | 1586 | isdn_ctrl cmd; |
1587 | struct capidrv_bchan *bchan; | 1587 | struct capidrv_bchan *bchan; |
1588 | struct capidrv_plci *plcip; | 1588 | struct capidrv_plci *plcip; |
1589 | u8 AdditionalInfo[1+2+2+31]; | 1589 | u8 AdditionalInfo[1 + 2 + 2 + 31]; |
1590 | int rc, isleasedline = 0; | 1590 | int rc, isleasedline = 0; |
1591 | 1591 | ||
1592 | if (c->command == ISDN_CMD_IOCTL) | 1592 | if (c->command == ISDN_CMD_IOCTL) |
1593 | return capidrv_ioctl(c, card); | 1593 | return capidrv_ioctl(c, card); |
1594 | 1594 | ||
1595 | switch (c->command) { | 1595 | switch (c->command) { |
1596 | case ISDN_CMD_DIAL:{ | 1596 | case ISDN_CMD_DIAL:{ |
1597 | u8 calling[ISDN_MSNLEN + 3]; | 1597 | u8 calling[ISDN_MSNLEN + 3]; |
1598 | u8 called[ISDN_MSNLEN + 2]; | 1598 | u8 called[ISDN_MSNLEN + 2]; |
1599 | 1599 | ||
1600 | if (debugmode) | 1600 | if (debugmode) |
1601 | printk(KERN_DEBUG "capidrv-%d: ISDN_CMD_DIAL(ch=%ld,\"%s,%d,%d,%s\")\n", | 1601 | printk(KERN_DEBUG "capidrv-%d: ISDN_CMD_DIAL(ch=%ld,\"%s,%d,%d,%s\")\n", |
1602 | card->contrnr, | 1602 | card->contrnr, |
1603 | c->arg, | 1603 | c->arg, |
1604 | c->parm.setup.phone, | 1604 | c->parm.setup.phone, |
1605 | c->parm.setup.si1, | 1605 | c->parm.setup.si1, |
1606 | c->parm.setup.si2, | 1606 | c->parm.setup.si2, |
1607 | c->parm.setup.eazmsn); | 1607 | c->parm.setup.eazmsn); |
1608 | |||
1609 | bchan = &card->bchans[c->arg % card->nbchan]; | ||
1610 | |||
1611 | if (bchan->plcip) { | ||
1612 | printk(KERN_ERR "capidrv-%d: dail ch=%ld,\"%s,%d,%d,%s\" in use (plci=0x%x)\n", | ||
1613 | card->contrnr, | ||
1614 | c->arg, | ||
1615 | c->parm.setup.phone, | ||
1616 | c->parm.setup.si1, | ||
1617 | c->parm.setup.si2, | ||
1618 | c->parm.setup.eazmsn, | ||
1619 | bchan->plcip->plci); | ||
1620 | return 0; | ||
1621 | } | ||
1622 | bchan->si1 = c->parm.setup.si1; | ||
1623 | bchan->si2 = c->parm.setup.si2; | ||
1624 | |||
1625 | strncpy(bchan->num, c->parm.setup.phone, sizeof(bchan->num)); | ||
1626 | strncpy(bchan->mynum, c->parm.setup.eazmsn, sizeof(bchan->mynum)); | ||
1627 | rc = FVteln2capi20(bchan->num, AdditionalInfo); | ||
1628 | isleasedline = (rc == 0); | ||
1629 | if (rc < 0) | ||
1630 | printk(KERN_ERR "capidrv-%d: WARNING: invalid leased linedefinition \"%s\"\n", card->contrnr, bchan->num); | ||
1631 | |||
1632 | if (isleasedline) { | ||
1633 | calling[0] = 0; | ||
1634 | called[0] = 0; | ||
1635 | if (debugmode) | ||
1636 | printk(KERN_DEBUG "capidrv-%d: connecting leased line\n", card->contrnr); | ||
1637 | } else { | ||
1638 | calling[0] = strlen(bchan->mynum) + 2; | ||
1639 | calling[1] = 0; | ||
1640 | calling[2] = 0x80; | ||
1641 | strncpy(calling + 3, bchan->mynum, ISDN_MSNLEN); | ||
1642 | called[0] = strlen(bchan->num) + 1; | ||
1643 | called[1] = 0x80; | ||
1644 | strncpy(called + 2, bchan->num, ISDN_MSNLEN); | ||
1645 | } | ||
1646 | 1608 | ||
1647 | capi_fill_CONNECT_REQ(&cmdcmsg, | 1609 | bchan = &card->bchans[c->arg % card->nbchan]; |
1648 | global.ap.applid, | 1610 | |
1649 | card->msgid++, | 1611 | if (bchan->plcip) { |
1650 | card->contrnr, /* adr */ | 1612 | printk(KERN_ERR "capidrv-%d: dail ch=%ld,\"%s,%d,%d,%s\" in use (plci=0x%x)\n", |
1651 | si2cip(bchan->si1, bchan->si2), /* cipvalue */ | 1613 | card->contrnr, |
1652 | called, /* CalledPartyNumber */ | 1614 | c->arg, |
1653 | calling, /* CallingPartyNumber */ | 1615 | c->parm.setup.phone, |
1654 | NULL, /* CalledPartySubaddress */ | 1616 | c->parm.setup.si1, |
1655 | NULL, /* CallingPartySubaddress */ | 1617 | c->parm.setup.si2, |
1656 | b1prot(bchan->l2, bchan->l3), /* B1protocol */ | 1618 | c->parm.setup.eazmsn, |
1657 | b2prot(bchan->l2, bchan->l3), /* B2protocol */ | 1619 | bchan->plcip->plci); |
1658 | b3prot(bchan->l2, bchan->l3), /* B3protocol */ | ||
1659 | b1config(bchan->l2, bchan->l3), /* B1configuration */ | ||
1660 | NULL, /* B2configuration */ | ||
1661 | NULL, /* B3configuration */ | ||
1662 | NULL, /* BC */ | ||
1663 | NULL, /* LLC */ | ||
1664 | NULL, /* HLC */ | ||
1665 | /* BChannelinformation */ | ||
1666 | isleasedline ? AdditionalInfo : NULL, | ||
1667 | NULL, /* Keypadfacility */ | ||
1668 | NULL, /* Useruserdata */ | ||
1669 | NULL /* Facilitydataarray */ | ||
1670 | ); | ||
1671 | if ((plcip = new_plci(card, (c->arg % card->nbchan))) == NULL) { | ||
1672 | cmd.command = ISDN_STAT_DHUP; | ||
1673 | cmd.driver = card->myid; | ||
1674 | cmd.arg = (c->arg % card->nbchan); | ||
1675 | card->interface.statcallb(&cmd); | ||
1676 | return -1; | ||
1677 | } | ||
1678 | plcip->msgid = cmdcmsg.Messagenumber; | ||
1679 | plcip->leasedline = isleasedline; | ||
1680 | plci_change_state(card, plcip, EV_PLCI_CONNECT_REQ); | ||
1681 | send_message(card, &cmdcmsg); | ||
1682 | return 0; | 1620 | return 0; |
1683 | } | 1621 | } |
1622 | bchan->si1 = c->parm.setup.si1; | ||
1623 | bchan->si2 = c->parm.setup.si2; | ||
1624 | |||
1625 | strncpy(bchan->num, c->parm.setup.phone, sizeof(bchan->num)); | ||
1626 | strncpy(bchan->mynum, c->parm.setup.eazmsn, sizeof(bchan->mynum)); | ||
1627 | rc = FVteln2capi20(bchan->num, AdditionalInfo); | ||
1628 | isleasedline = (rc == 0); | ||
1629 | if (rc < 0) | ||
1630 | printk(KERN_ERR "capidrv-%d: WARNING: invalid leased linedefinition \"%s\"\n", card->contrnr, bchan->num); | ||
1631 | |||
1632 | if (isleasedline) { | ||
1633 | calling[0] = 0; | ||
1634 | called[0] = 0; | ||
1635 | if (debugmode) | ||
1636 | printk(KERN_DEBUG "capidrv-%d: connecting leased line\n", card->contrnr); | ||
1637 | } else { | ||
1638 | calling[0] = strlen(bchan->mynum) + 2; | ||
1639 | calling[1] = 0; | ||
1640 | calling[2] = 0x80; | ||
1641 | strncpy(calling + 3, bchan->mynum, ISDN_MSNLEN); | ||
1642 | called[0] = strlen(bchan->num) + 1; | ||
1643 | called[1] = 0x80; | ||
1644 | strncpy(called + 2, bchan->num, ISDN_MSNLEN); | ||
1645 | } | ||
1646 | |||
1647 | capi_fill_CONNECT_REQ(&cmdcmsg, | ||
1648 | global.ap.applid, | ||
1649 | card->msgid++, | ||
1650 | card->contrnr, /* adr */ | ||
1651 | si2cip(bchan->si1, bchan->si2), /* cipvalue */ | ||
1652 | called, /* CalledPartyNumber */ | ||
1653 | calling, /* CallingPartyNumber */ | ||
1654 | NULL, /* CalledPartySubaddress */ | ||
1655 | NULL, /* CallingPartySubaddress */ | ||
1656 | b1prot(bchan->l2, bchan->l3), /* B1protocol */ | ||
1657 | b2prot(bchan->l2, bchan->l3), /* B2protocol */ | ||
1658 | b3prot(bchan->l2, bchan->l3), /* B3protocol */ | ||
1659 | b1config(bchan->l2, bchan->l3), /* B1configuration */ | ||
1660 | NULL, /* B2configuration */ | ||
1661 | NULL, /* B3configuration */ | ||
1662 | NULL, /* BC */ | ||
1663 | NULL, /* LLC */ | ||
1664 | NULL, /* HLC */ | ||
1665 | /* BChannelinformation */ | ||
1666 | isleasedline ? AdditionalInfo : NULL, | ||
1667 | NULL, /* Keypadfacility */ | ||
1668 | NULL, /* Useruserdata */ | ||
1669 | NULL /* Facilitydataarray */ | ||
1670 | ); | ||
1671 | if ((plcip = new_plci(card, (c->arg % card->nbchan))) == NULL) { | ||
1672 | cmd.command = ISDN_STAT_DHUP; | ||
1673 | cmd.driver = card->myid; | ||
1674 | cmd.arg = (c->arg % card->nbchan); | ||
1675 | card->interface.statcallb(&cmd); | ||
1676 | return -1; | ||
1677 | } | ||
1678 | plcip->msgid = cmdcmsg.Messagenumber; | ||
1679 | plcip->leasedline = isleasedline; | ||
1680 | plci_change_state(card, plcip, EV_PLCI_CONNECT_REQ); | ||
1681 | send_message(card, &cmdcmsg); | ||
1682 | return 0; | ||
1683 | } | ||
1684 | 1684 | ||
1685 | case ISDN_CMD_ACCEPTD: | 1685 | case ISDN_CMD_ACCEPTD: |
1686 | 1686 | ||
@@ -1708,7 +1708,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | |||
1708 | NULL, /* Keypadfacility */ | 1708 | NULL, /* Keypadfacility */ |
1709 | NULL, /* Useruserdata */ | 1709 | NULL, /* Useruserdata */ |
1710 | NULL /* Facilitydataarray */ | 1710 | NULL /* Facilitydataarray */ |
1711 | ); | 1711 | ); |
1712 | capi_cmsg2message(&cmdcmsg, cmdcmsg.buf); | 1712 | capi_cmsg2message(&cmdcmsg, cmdcmsg.buf); |
1713 | plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP); | 1713 | plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP); |
1714 | send_message(card, &cmdcmsg); | 1714 | send_message(card, &cmdcmsg); |
@@ -1742,7 +1742,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | |||
1742 | card->msgid++, | 1742 | card->msgid++, |
1743 | bchan->nccip->ncci, | 1743 | bchan->nccip->ncci, |
1744 | NULL /* NCPI */ | 1744 | NULL /* NCPI */ |
1745 | ); | 1745 | ); |
1746 | ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ); | 1746 | ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ); |
1747 | send_message(card, &cmdcmsg); | 1747 | send_message(card, &cmdcmsg); |
1748 | return 0; | 1748 | return 0; |
@@ -1761,12 +1761,12 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | |||
1761 | capi_fill_DISCONNECT_REQ(&cmdcmsg, | 1761 | capi_fill_DISCONNECT_REQ(&cmdcmsg, |
1762 | global.ap.applid, | 1762 | global.ap.applid, |
1763 | card->msgid++, | 1763 | card->msgid++, |
1764 | bchan->plcip->plci, | 1764 | bchan->plcip->plci, |
1765 | NULL, /* BChannelinformation */ | 1765 | NULL, /* BChannelinformation */ |
1766 | NULL, /* Keypadfacility */ | 1766 | NULL, /* Keypadfacility */ |
1767 | NULL, /* Useruserdata */ | 1767 | NULL, /* Useruserdata */ |
1768 | NULL /* Facilitydataarray */ | 1768 | NULL /* Facilitydataarray */ |
1769 | ); | 1769 | ); |
1770 | plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ); | 1770 | plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ); |
1771 | send_message(card, &cmdcmsg); | 1771 | send_message(card, &cmdcmsg); |
1772 | return 0; | 1772 | return 0; |
@@ -1778,8 +1778,8 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | |||
1778 | } | 1778 | } |
1779 | } | 1779 | } |
1780 | printk(KERN_ERR "capidrv-%d: chan %ld disconnect request on free channel\n", | 1780 | printk(KERN_ERR "capidrv-%d: chan %ld disconnect request on free channel\n", |
1781 | card->contrnr, | 1781 | card->contrnr, |
1782 | c->arg); | 1782 | c->arg); |
1783 | return -EINVAL; | 1783 | return -EINVAL; |
1784 | /* ready */ | 1784 | /* ready */ |
1785 | 1785 | ||
@@ -1813,20 +1813,20 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) | |||
1813 | case ISDN_CMD_CLREAZ: | 1813 | case ISDN_CMD_CLREAZ: |
1814 | if (debugmode) | 1814 | if (debugmode) |
1815 | printk(KERN_DEBUG "capidrv-%d: clearing EAZ on chan %ld\n", | 1815 | printk(KERN_DEBUG "capidrv-%d: clearing EAZ on chan %ld\n", |
1816 | card->contrnr, c->arg); | 1816 | card->contrnr, c->arg); |
1817 | bchan = &card->bchans[c->arg % card->nbchan]; | 1817 | bchan = &card->bchans[c->arg % card->nbchan]; |
1818 | bchan->msn[0] = 0; | 1818 | bchan->msn[0] = 0; |
1819 | return 0; | 1819 | return 0; |
1820 | 1820 | ||
1821 | default: | 1821 | default: |
1822 | printk(KERN_ERR "capidrv-%d: ISDN_CMD_%d, Huh?\n", | 1822 | printk(KERN_ERR "capidrv-%d: ISDN_CMD_%d, Huh?\n", |
1823 | card->contrnr, c->command); | 1823 | card->contrnr, c->command); |
1824 | return -EINVAL; | 1824 | return -EINVAL; |
1825 | } | 1825 | } |
1826 | return 0; | 1826 | return 0; |
1827 | } | 1827 | } |
1828 | 1828 | ||
1829 | static int if_command(isdn_ctrl * c) | 1829 | static int if_command(isdn_ctrl *c) |
1830 | { | 1830 | { |
1831 | capidrv_contr *card = findcontrbydriverid(c->driver); | 1831 | capidrv_contr *card = findcontrbydriverid(c->driver); |
1832 | 1832 | ||
@@ -1834,8 +1834,8 @@ static int if_command(isdn_ctrl * c) | |||
1834 | return capidrv_command(c, card); | 1834 | return capidrv_command(c, card); |
1835 | 1835 | ||
1836 | printk(KERN_ERR | 1836 | printk(KERN_ERR |
1837 | "capidrv: if_command %d called with invalid driverId %d!\n", | 1837 | "capidrv: if_command %d called with invalid driverId %d!\n", |
1838 | c->command, c->driver); | 1838 | c->command, c->driver); |
1839 | return -ENODEV; | 1839 | return -ENODEV; |
1840 | } | 1840 | } |
1841 | 1841 | ||
@@ -1859,7 +1859,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1859 | } | 1859 | } |
1860 | if (debugmode > 4) | 1860 | if (debugmode > 4) |
1861 | printk(KERN_DEBUG "capidrv-%d: sendbuf len=%d skb=%p doack=%d\n", | 1861 | printk(KERN_DEBUG "capidrv-%d: sendbuf len=%d skb=%p doack=%d\n", |
1862 | card->contrnr, len, skb, doack); | 1862 | card->contrnr, len, skb, doack); |
1863 | bchan = &card->bchans[channel % card->nbchan]; | 1863 | bchan = &card->bchans[channel % card->nbchan]; |
1864 | nccip = bchan->nccip; | 1864 | nccip = bchan->nccip; |
1865 | if (!nccip || nccip->state != ST_NCCI_ACTIVE) { | 1865 | if (!nccip || nccip->state != ST_NCCI_ACTIVE) { |
@@ -1891,10 +1891,10 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1891 | skb->len, /* DataLength */ | 1891 | skb->len, /* DataLength */ |
1892 | datahandle, /* DataHandle */ | 1892 | datahandle, /* DataHandle */ |
1893 | 0 /* Flags */ | 1893 | 0 /* Flags */ |
1894 | ); | 1894 | ); |
1895 | 1895 | ||
1896 | if (capidrv_add_ack(nccip, datahandle, doack ? (int)skb->len : -1) < 0) | 1896 | if (capidrv_add_ack(nccip, datahandle, doack ? (int)skb->len : -1) < 0) |
1897 | return 0; | 1897 | return 0; |
1898 | 1898 | ||
1899 | capi_cmsg2message(&sendcmsg, sendcmsg.buf); | 1899 | capi_cmsg2message(&sendcmsg, sendcmsg.buf); |
1900 | msglen = CAPIMSG_LEN(sendcmsg.buf); | 1900 | msglen = CAPIMSG_LEN(sendcmsg.buf); |
@@ -1902,8 +1902,8 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1902 | struct sk_buff *nskb = skb_realloc_headroom(skb, msglen); | 1902 | struct sk_buff *nskb = skb_realloc_headroom(skb, msglen); |
1903 | if (!nskb) { | 1903 | if (!nskb) { |
1904 | printk(KERN_ERR "capidrv-%d: if_sendbuf: no memory\n", | 1904 | printk(KERN_ERR "capidrv-%d: if_sendbuf: no memory\n", |
1905 | card->contrnr); | 1905 | card->contrnr); |
1906 | (void)capidrv_del_ack(nccip, datahandle); | 1906 | (void)capidrv_del_ack(nccip, datahandle); |
1907 | return 0; | 1907 | return 0; |
1908 | } | 1908 | } |
1909 | printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n", | 1909 | printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n", |
@@ -1917,9 +1917,9 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1917 | } | 1917 | } |
1918 | if (debugmode > 3) | 1918 | if (debugmode > 3) |
1919 | printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n", | 1919 | printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n", |
1920 | card->contrnr, errcode, capi_info2str(errcode)); | 1920 | card->contrnr, errcode, capi_info2str(errcode)); |
1921 | (void)capidrv_del_ack(nccip, datahandle); | 1921 | (void)capidrv_del_ack(nccip, datahandle); |
1922 | dev_kfree_skb(nskb); | 1922 | dev_kfree_skb(nskb); |
1923 | return errcode == CAPI_SENDQUEUEFULL ? 0 : -1; | 1923 | return errcode == CAPI_SENDQUEUEFULL ? 0 : -1; |
1924 | } else { | 1924 | } else { |
1925 | memcpy(skb_push(skb, msglen), sendcmsg.buf, msglen); | 1925 | memcpy(skb_push(skb, msglen), sendcmsg.buf, msglen); |
@@ -1930,9 +1930,9 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1930 | } | 1930 | } |
1931 | if (debugmode > 3) | 1931 | if (debugmode > 3) |
1932 | printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n", | 1932 | printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n", |
1933 | card->contrnr, errcode, capi_info2str(errcode)); | 1933 | card->contrnr, errcode, capi_info2str(errcode)); |
1934 | skb_pull(skb, msglen); | 1934 | skb_pull(skb, msglen); |
1935 | (void)capidrv_del_ack(nccip, datahandle); | 1935 | (void)capidrv_del_ack(nccip, datahandle); |
1936 | return errcode == CAPI_SENDQUEUEFULL ? 0 : -1; | 1936 | return errcode == CAPI_SENDQUEUEFULL ? 0 : -1; |
1937 | } | 1937 | } |
1938 | } | 1938 | } |
@@ -1949,11 +1949,11 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel) | |||
1949 | return -ENODEV; | 1949 | return -ENODEV; |
1950 | } | 1950 | } |
1951 | 1951 | ||
1952 | for (p=buf, count=0; count < len; p++, count++) { | 1952 | for (p = buf, count = 0; count < len; p++, count++) { |
1953 | if (put_user(*card->q931_read++, p)) | 1953 | if (put_user(*card->q931_read++, p)) |
1954 | return -EFAULT; | 1954 | return -EFAULT; |
1955 | if (card->q931_read > card->q931_end) | 1955 | if (card->q931_read > card->q931_end) |
1956 | card->q931_read = card->q931_buf; | 1956 | card->q931_read = card->q931_buf; |
1957 | } | 1957 | } |
1958 | return count; | 1958 | return count; |
1959 | 1959 | ||
@@ -1961,35 +1961,35 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel) | |||
1961 | 1961 | ||
1962 | static void enable_dchannel_trace(capidrv_contr *card) | 1962 | static void enable_dchannel_trace(capidrv_contr *card) |
1963 | { | 1963 | { |
1964 | u8 manufacturer[CAPI_MANUFACTURER_LEN]; | 1964 | u8 manufacturer[CAPI_MANUFACTURER_LEN]; |
1965 | capi_version version; | 1965 | capi_version version; |
1966 | u16 contr = card->contrnr; | 1966 | u16 contr = card->contrnr; |
1967 | u16 errcode; | 1967 | u16 errcode; |
1968 | u16 avmversion[3]; | 1968 | u16 avmversion[3]; |
1969 | 1969 | ||
1970 | errcode = capi20_get_manufacturer(contr, manufacturer); | 1970 | errcode = capi20_get_manufacturer(contr, manufacturer); |
1971 | if (errcode != CAPI_NOERROR) { | 1971 | if (errcode != CAPI_NOERROR) { |
1972 | printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n", | 1972 | printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n", |
1973 | card->name, errcode); | 1973 | card->name, errcode); |
1974 | return; | 1974 | return; |
1975 | } | 1975 | } |
1976 | if (strstr(manufacturer, "AVM") == NULL) { | 1976 | if (strstr(manufacturer, "AVM") == NULL) { |
1977 | printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n", | 1977 | printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n", |
1978 | card->name, manufacturer); | 1978 | card->name, manufacturer); |
1979 | return; | 1979 | return; |
1980 | } | 1980 | } |
1981 | errcode = capi20_get_version(contr, &version); | 1981 | errcode = capi20_get_version(contr, &version); |
1982 | if (errcode != CAPI_NOERROR) { | 1982 | if (errcode != CAPI_NOERROR) { |
1983 | printk(KERN_ERR "%s: can't get version (0x%x)\n", | 1983 | printk(KERN_ERR "%s: can't get version (0x%x)\n", |
1984 | card->name, errcode); | 1984 | card->name, errcode); |
1985 | return; | 1985 | return; |
1986 | } | 1986 | } |
1987 | avmversion[0] = (version.majormanuversion >> 4) & 0x0f; | 1987 | avmversion[0] = (version.majormanuversion >> 4) & 0x0f; |
1988 | avmversion[1] = (version.majormanuversion << 4) & 0xf0; | 1988 | avmversion[1] = (version.majormanuversion << 4) & 0xf0; |
1989 | avmversion[1] |= (version.minormanuversion >> 4) & 0x0f; | 1989 | avmversion[1] |= (version.minormanuversion >> 4) & 0x0f; |
1990 | avmversion[2] |= version.minormanuversion & 0x0f; | 1990 | avmversion[2] |= version.minormanuversion & 0x0f; |
1991 | 1991 | ||
1992 | if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) { | 1992 | if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) { |
1993 | printk(KERN_INFO "%s: D2 trace enabled\n", card->name); | 1993 | printk(KERN_INFO "%s: D2 trace enabled\n", card->name); |
1994 | capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.ap.applid, | 1994 | capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.ap.applid, |
1995 | card->msgid++, | 1995 | card->msgid++, |
@@ -2030,8 +2030,8 @@ static void listentimerfunc(unsigned long x) | |||
2030 | capidrv_contr *card = (capidrv_contr *)x; | 2030 | capidrv_contr *card = (capidrv_contr *)x; |
2031 | if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE) | 2031 | if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE) |
2032 | printk(KERN_ERR "%s: controller dead ??\n", card->name); | 2032 | printk(KERN_ERR "%s: controller dead ??\n", card->name); |
2033 | send_listen(card); | 2033 | send_listen(card); |
2034 | mod_timer(&card->listentimer, jiffies + 60*HZ); | 2034 | mod_timer(&card->listentimer, jiffies + 60 * HZ); |
2035 | } | 2035 | } |
2036 | 2036 | ||
2037 | 2037 | ||
@@ -2050,7 +2050,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2050 | } | 2050 | } |
2051 | if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { | 2051 | if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { |
2052 | printk(KERN_WARNING | 2052 | printk(KERN_WARNING |
2053 | "capidrv: (%s) Could not allocate contr-struct.\n", id); | 2053 | "capidrv: (%s) Could not allocate contr-struct.\n", id); |
2054 | return -1; | 2054 | return -1; |
2055 | } | 2055 | } |
2056 | card->owner = THIS_MODULE; | 2056 | card->owner = THIS_MODULE; |
@@ -2061,7 +2061,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2061 | card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC); | 2061 | card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC); |
2062 | if (!card->bchans) { | 2062 | if (!card->bchans) { |
2063 | printk(KERN_WARNING | 2063 | printk(KERN_WARNING |
2064 | "capidrv: (%s) Could not allocate bchan-structs.\n", id); | 2064 | "capidrv: (%s) Could not allocate bchan-structs.\n", id); |
2065 | module_put(card->owner); | 2065 | module_put(card->owner); |
2066 | kfree(card); | 2066 | kfree(card); |
2067 | return -1; | 2067 | return -1; |
@@ -2073,17 +2073,17 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2073 | card->interface.writecmd = NULL; | 2073 | card->interface.writecmd = NULL; |
2074 | card->interface.readstat = if_readstat; | 2074 | card->interface.readstat = if_readstat; |
2075 | card->interface.features = ISDN_FEATURE_L2_HDLC | | 2075 | card->interface.features = ISDN_FEATURE_L2_HDLC | |
2076 | ISDN_FEATURE_L2_TRANS | | 2076 | ISDN_FEATURE_L2_TRANS | |
2077 | ISDN_FEATURE_L3_TRANS | | 2077 | ISDN_FEATURE_L3_TRANS | |
2078 | ISDN_FEATURE_P_UNKNOWN | | 2078 | ISDN_FEATURE_P_UNKNOWN | |
2079 | ISDN_FEATURE_L2_X75I | | 2079 | ISDN_FEATURE_L2_X75I | |
2080 | ISDN_FEATURE_L2_X75UI | | 2080 | ISDN_FEATURE_L2_X75UI | |
2081 | ISDN_FEATURE_L2_X75BUI; | 2081 | ISDN_FEATURE_L2_X75BUI; |
2082 | if (profp->support1 & (1<<2)) | 2082 | if (profp->support1 & (1 << 2)) |
2083 | card->interface.features |= ISDN_FEATURE_L2_V11096 | | 2083 | card->interface.features |= ISDN_FEATURE_L2_V11096 | |
2084 | ISDN_FEATURE_L2_V11019 | | 2084 | ISDN_FEATURE_L2_V11019 | |
2085 | ISDN_FEATURE_L2_V11038; | 2085 | ISDN_FEATURE_L2_V11038; |
2086 | if (profp->support1 & (1<<8)) | 2086 | if (profp->support1 & (1 << 8)) |
2087 | card->interface.features |= ISDN_FEATURE_L2_MODEM; | 2087 | card->interface.features |= ISDN_FEATURE_L2_MODEM; |
2088 | card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */ | 2088 | card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */ |
2089 | strncpy(card->interface.id, id, sizeof(card->interface.id) - 1); | 2089 | strncpy(card->interface.id, id, sizeof(card->interface.id) - 1); |
@@ -2122,10 +2122,10 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2122 | card->listentimer.data = (unsigned long)card; | 2122 | card->listentimer.data = (unsigned long)card; |
2123 | card->listentimer.function = listentimerfunc; | 2123 | card->listentimer.function = listentimerfunc; |
2124 | send_listen(card); | 2124 | send_listen(card); |
2125 | mod_timer(&card->listentimer, jiffies + 60*HZ); | 2125 | mod_timer(&card->listentimer, jiffies + 60 * HZ); |
2126 | 2126 | ||
2127 | printk(KERN_INFO "%s: now up (%d B channels)\n", | 2127 | printk(KERN_INFO "%s: now up (%d B channels)\n", |
2128 | card->name, card->nbchan); | 2128 | card->name, card->nbchan); |
2129 | 2129 | ||
2130 | enable_dchannel_trace(card); | 2130 | enable_dchannel_trace(card); |
2131 | 2131 | ||
@@ -2158,7 +2158,7 @@ static int capidrv_delcontr(u16 contr) | |||
2158 | 2158 | ||
2159 | if (debugmode) | 2159 | if (debugmode) |
2160 | printk(KERN_DEBUG "capidrv-%d: id=%d unloading\n", | 2160 | printk(KERN_DEBUG "capidrv-%d: id=%d unloading\n", |
2161 | card->contrnr, card->myid); | 2161 | card->contrnr, card->myid); |
2162 | 2162 | ||
2163 | cmd.command = ISDN_STAT_STOP; | 2163 | cmd.command = ISDN_STAT_STOP; |
2164 | cmd.driver = card->myid; | 2164 | cmd.driver = card->myid; |
@@ -2168,17 +2168,17 @@ static int capidrv_delcontr(u16 contr) | |||
2168 | 2168 | ||
2169 | cmd.command = ISDN_STAT_DISCH; | 2169 | cmd.command = ISDN_STAT_DISCH; |
2170 | cmd.driver = card->myid; | 2170 | cmd.driver = card->myid; |
2171 | cmd.arg = card->nbchan-1; | 2171 | cmd.arg = card->nbchan - 1; |
2172 | cmd.parm.num[0] = 0; | 2172 | cmd.parm.num[0] = 0; |
2173 | if (debugmode) | 2173 | if (debugmode) |
2174 | printk(KERN_DEBUG "capidrv-%d: id=%d disable chan=%ld\n", | 2174 | printk(KERN_DEBUG "capidrv-%d: id=%d disable chan=%ld\n", |
2175 | card->contrnr, card->myid, cmd.arg); | 2175 | card->contrnr, card->myid, cmd.arg); |
2176 | card->interface.statcallb(&cmd); | 2176 | card->interface.statcallb(&cmd); |
2177 | 2177 | ||
2178 | if (card->bchans[card->nbchan-1].nccip) | 2178 | if (card->bchans[card->nbchan - 1].nccip) |
2179 | free_ncci(card, card->bchans[card->nbchan-1].nccip); | 2179 | free_ncci(card, card->bchans[card->nbchan - 1].nccip); |
2180 | if (card->bchans[card->nbchan-1].plcip) | 2180 | if (card->bchans[card->nbchan - 1].plcip) |
2181 | free_plci(card, card->bchans[card->nbchan-1].plcip); | 2181 | free_plci(card, card->bchans[card->nbchan - 1].plcip); |
2182 | if (card->plci_list) | 2182 | if (card->plci_list) |
2183 | printk(KERN_ERR "capidrv: bug in free_plci()\n"); | 2183 | printk(KERN_ERR "capidrv: bug in free_plci()\n"); |
2184 | card->nbchan--; | 2184 | card->nbchan--; |
@@ -2188,7 +2188,7 @@ static int capidrv_delcontr(u16 contr) | |||
2188 | 2188 | ||
2189 | if (debugmode) | 2189 | if (debugmode) |
2190 | printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n", | 2190 | printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n", |
2191 | card->contrnr, card->myid); | 2191 | card->contrnr, card->myid); |
2192 | 2192 | ||
2193 | cmd.command = ISDN_STAT_UNLOAD; | 2193 | cmd.command = ISDN_STAT_UNLOAD; |
2194 | cmd.driver = card->myid; | 2194 | cmd.driver = card->myid; |
@@ -2196,7 +2196,7 @@ static int capidrv_delcontr(u16 contr) | |||
2196 | 2196 | ||
2197 | if (debugmode) | 2197 | if (debugmode) |
2198 | printk(KERN_DEBUG "capidrv-%d: id=%d remove contr from list\n", | 2198 | printk(KERN_DEBUG "capidrv-%d: id=%d remove contr from list\n", |
2199 | card->contrnr, card->myid); | 2199 | card->contrnr, card->myid); |
2200 | 2200 | ||
2201 | spin_lock_irqsave(&global_lock, flags); | 2201 | spin_lock_irqsave(&global_lock, flags); |
2202 | for (pp = &global.contr_list; *pp; pp = &(*pp)->next) { | 2202 | for (pp = &global.contr_list; *pp; pp = &(*pp)->next) { |
@@ -2243,10 +2243,10 @@ lower_callback(struct notifier_block *nb, unsigned long val, void *v) | |||
2243 | static int capidrv_proc_show(struct seq_file *m, void *v) | 2243 | static int capidrv_proc_show(struct seq_file *m, void *v) |
2244 | { | 2244 | { |
2245 | seq_printf(m, "%lu %lu %lu %lu\n", | 2245 | seq_printf(m, "%lu %lu %lu %lu\n", |
2246 | global.ap.nrecvctlpkt, | 2246 | global.ap.nrecvctlpkt, |
2247 | global.ap.nrecvdatapkt, | 2247 | global.ap.nrecvdatapkt, |
2248 | global.ap.nsentctlpkt, | 2248 | global.ap.nsentctlpkt, |
2249 | global.ap.nsentdatapkt); | 2249 | global.ap.nsentdatapkt); |
2250 | return 0; | 2250 | return 0; |
2251 | } | 2251 | } |
2252 | 2252 | ||