tty->disc_data = pInfo;
tty->receive_room = 65536;
- init_timer(&pInfo->tmr);
- pInfo->tmr.data = (unsigned long)pInfo;
- pInfo->tmr.function = on_timeout;
+ setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo);
return 0;
}
struct r3964_client_info *pClient;
struct r3964_message *pMsg;
struct r3964_client_message theMsg;
- DECLARE_WAITQUEUE(wait, current);
-
int count;
TRACE_L("read()");
return -EAGAIN;
}
/* block until there is a message: */
- add_wait_queue(&pInfo->read_wait, &wait);
-repeat:
- current->state = TASK_INTERRUPTIBLE;
- pMsg = remove_msg(pInfo, pClient);
- if (!pMsg && !signal_pending(current)) {
- schedule();
- goto repeat;
- }
- current->state = TASK_RUNNING;
- remove_wait_queue(&pInfo->read_wait, &wait);
+ wait_event_interruptible(pInfo->read_wait,
+ (pMsg = remove_msg(pInfo, pClient)));
}
/* If we still haven't got a message, we must have been signalled */