OpenWrt – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --- a/src/include/drv_dsl_cpe_os_linux.h |
2 | +++ b/src/include/drv_dsl_cpe_os_linux.h |
||
3 | @@ -214,12 +214,25 @@ static inline int dsl_mutex_lock(struct |
||
4 | #define DSL_DRV_MUTEX_LOCK(id) down_interruptible(&(id)) |
||
5 | #define DSL_DRV_MUTEX_UNLOCK(id) up(&(id)) |
||
6 | #endif |
||
7 | + |
||
8 | +static inline long |
||
9 | +ugly_hack_sleep_on_timeout(wait_queue_head_t *q, long timeout) |
||
10 | +{ |
||
11 | + DEFINE_WAIT(wait); |
||
12 | + |
||
13 | + prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE); |
||
14 | + timeout = schedule_timeout(timeout); |
||
15 | + finish_wait(q, &wait); |
||
16 | + |
||
17 | + return timeout; |
||
18 | +} |
||
19 | + |
||
20 | #define DSL_DRV_INIT_WAKELIST(name,queue) init_waitqueue_head(&(queue)) |
||
21 | #define DSL_DRV_WAKEUP_WAKELIST(queue) wake_up_interruptible(&(queue)) |
||
22 | #define DSL_DRV_INIT_EVENT(name,ev) init_waitqueue_head(&(ev)) |
||
23 | /* wait for an event, timeout is measured in ms */ |
||
24 | -#define DSL_DRV_WAIT_EVENT_TIMEOUT(ev,t) interruptible_sleep_on_timeout(&(ev), (t) * HZ / 1000) |
||
25 | -#define DSL_DRV_WAIT_EVENT(ev) interruptible_sleep_on(&(ev)) |
||
26 | +#define DSL_DRV_WAIT_EVENT_TIMEOUT(ev,t) ugly_hack_sleep_on_timeout(&(ev), (t) * HZ / 1000) |
||
27 | +#define DSL_DRV_WAIT_EVENT(ev) ugly_hack_sleep_on_timeout(&(ev), MAX_SCHEDULE_TIMEOUT) |
||
28 | #define DSL_DRV_WAKEUP_EVENT(ev) wake_up_interruptible(&(ev)) |
||
29 | #define DSL_DRV_TimeMSecGet() DSL_DRV_ElapsedTimeMSecGet(0) |
||
30 | #define DSL_WAIT(ms) msleep(ms) |