diff options
Diffstat (limited to 'drivers/isdn/mISDN/layer1.c')
-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; |