20 #include <linux/poll.h>
22 #include <linux/slab.h>
25 #include <linux/module.h>
92 mISDN_read(
struct file *filep,
char __user *
buf,
size_t count, loff_t *off)
101 filep, buf, (
int)count, off);
103 if (list_empty(&dev->
expired) && (dev->
work == 0)) {
111 if (count <
sizeof(
int))
115 if (!list_empty(&dev->
expired)) {
119 spin_unlock_irqrestore(&dev->
lock, flags);
135 if (*
debug & DEBUG_TIMER)
138 poll_wait(filep, &dev->
wait, wait);
142 if (*
debug & DEBUG_TIMER)
150 dev_expire_timer(
unsigned long data)
156 list_move_tail(&timer->
list, &timer->
dev->expired);
157 spin_unlock_irqrestore(&timer->
dev->lock, flags);
181 spin_unlock_irqrestore(&dev->
lock, flags);
183 timer->
tl.data = (
long)timer;
184 timer->
tl.function = dev_expire_timer;
202 if (timer->
id ==
id) {
203 list_del_init(&timer->
list);
214 spin_unlock_irqrestore(&dev->
lock, flags);
219 mISDN_ioctl(
struct file *filep,
unsigned int cmd,
unsigned long arg)
222 int id, tout, ret = 0;
225 if (*
debug & DEBUG_TIMER)
231 if (
get_user(tout, (
int __user *)arg)) {
235 id = misdn_add_timer(dev, tout);
236 if (*
debug & DEBUG_TIMER)
243 if (
put_user(
id, (
int __user *)arg))
247 if (
get_user(
id, (
int __user *)arg)) {
251 if (*
debug & DEBUG_TIMER)
253 id = misdn_del_timer(dev,
id);
254 if (
put_user(
id, (
int __user *)arg))
267 .unlocked_ioctl = mISDN_ioctl,
269 .release = mISDN_close,
275 .name =
"mISDNtimer",