diff options
author | Karsten Keil <isdn@linux-pingi.de> | 2012-05-04 00:15:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-04 11:55:05 -0400 |
commit | c626c127279b265ab293348763e043864d58d42c (patch) | |
tree | 476fa67d42bff3a1a27d97818fa66d16bf501a88 /drivers/isdn/mISDN | |
parent | 8423e6b212a19d5f02232855dec73196297b5ee9 (diff) |
mISDN: Make layer1 timer 3 value configurable
For certification test it is very useful to change the layer1
timer3 value on runtime.
Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r-- | drivers/isdn/mISDN/layer1.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c index 0fc49b375514..ff0515323c86 100644 --- a/drivers/isdn/mISDN/layer1.c +++ b/drivers/isdn/mISDN/layer1.c | |||
@@ -30,11 +30,12 @@ struct layer1 { | |||
30 | struct FsmInst l1m; | 30 | struct FsmInst l1m; |
31 | struct FsmTimer timer; | 31 | struct FsmTimer timer; |
32 | int delay; | 32 | int delay; |
33 | int t3_value; | ||
33 | struct dchannel *dch; | 34 | struct dchannel *dch; |
34 | dchannel_l1callback *dcb; | 35 | dchannel_l1callback *dcb; |
35 | }; | 36 | }; |
36 | 37 | ||
37 | #define TIMER3_VALUE 7000 | 38 | #define TIMER3_DEFAULT_VALUE 7000 |
38 | 39 | ||
39 | static | 40 | static |
40 | struct Fsm l1fsm_s = {NULL, 0, 0, NULL, NULL}; | 41 | struct Fsm l1fsm_s = {NULL, 0, 0, NULL, NULL}; |
@@ -233,7 +234,7 @@ l1_activate_s(struct FsmInst *fi, int event, void *arg) | |||
233 | { | 234 | { |
234 | struct layer1 *l1 = fi->userdata; | 235 | struct layer1 *l1 = fi->userdata; |
235 | 236 | ||
236 | mISDN_FsmRestartTimer(&l1->timer, TIMER3_VALUE, EV_TIMER3, NULL, 2); | 237 | mISDN_FsmRestartTimer(&l1->timer, l1->t3_value, EV_TIMER3, NULL, 2); |
237 | test_and_set_bit(FLG_L1_T3RUN, &l1->Flags); | 238 | test_and_set_bit(FLG_L1_T3RUN, &l1->Flags); |
238 | l1->dcb(l1->dch, HW_RESET_REQ); | 239 | l1->dcb(l1->dch, HW_RESET_REQ); |
239 | } | 240 | } |
@@ -356,6 +357,16 @@ l1_event(struct layer1 *l1, u_int event) | |||
356 | release_l1(l1); | 357 | release_l1(l1); |
357 | break; | 358 | break; |
358 | default: | 359 | default: |
360 | if ((event & ~HW_TIMER3_VMASK) == HW_TIMER3_VALUE) { | ||
361 | int val = event & HW_TIMER3_VMASK; | ||
362 | |||
363 | if (val < 5) | ||
364 | val = 5; | ||
365 | if (val > 30) | ||
366 | val = 30; | ||
367 | l1->t3_value = val; | ||
368 | break; | ||
369 | } | ||
359 | if (*debug & DEBUG_L1) | 370 | if (*debug & DEBUG_L1) |
360 | printk(KERN_DEBUG "%s %x unhandled\n", | 371 | printk(KERN_DEBUG "%s %x unhandled\n", |
361 | __func__, event); | 372 | __func__, event); |
@@ -377,6 +388,7 @@ create_l1(struct dchannel *dch, dchannel_l1callback *dcb) { | |||
377 | nl1->l1m.fsm = &l1fsm_s; | 388 | nl1->l1m.fsm = &l1fsm_s; |
378 | nl1->l1m.state = ST_L1_F3; | 389 | nl1->l1m.state = ST_L1_F3; |
379 | nl1->Flags = 0; | 390 | nl1->Flags = 0; |
391 | nl1->t3_value = TIMER3_DEFAULT_VALUE; | ||
380 | nl1->l1m.debug = *debug & DEBUG_L1_FSM; | 392 | nl1->l1m.debug = *debug & DEBUG_L1_FSM; |
381 | nl1->l1m.userdata = nl1; | 393 | nl1->l1m.userdata = nl1; |
382 | nl1->l1m.userint = 0; | 394 | nl1->l1m.userint = 0; |