dtlk.c (32032df6c2f6c9c6b2ada2ce42322231824f70c2) | dtlk.c (55929332c92e5d34d65a8f784604c92677ea3e15) |
---|---|
1/* -*- linux-c -*- 2 * dtlk.c - DoubleTalk PC driver for Linux 3 * 4 * Original author: Chris Pallotta <chris@allmedia.com> 5 * Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com> 6 * 7 * 2000-03-18 Jim Van Zandt: Fix polling. 8 * Eliminate dtlk_timer_active flag and separate dtlk_stop_timer --- 79 unchanged lines hidden (view full) --- 88/* prototypes for file_operations struct */ 89static ssize_t dtlk_read(struct file *, char __user *, 90 size_t nbytes, loff_t * ppos); 91static ssize_t dtlk_write(struct file *, const char __user *, 92 size_t nbytes, loff_t * ppos); 93static unsigned int dtlk_poll(struct file *, poll_table *); 94static int dtlk_open(struct inode *, struct file *); 95static int dtlk_release(struct inode *, struct file *); | 1/* -*- linux-c -*- 2 * dtlk.c - DoubleTalk PC driver for Linux 3 * 4 * Original author: Chris Pallotta <chris@allmedia.com> 5 * Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com> 6 * 7 * 2000-03-18 Jim Van Zandt: Fix polling. 8 * Eliminate dtlk_timer_active flag and separate dtlk_stop_timer --- 79 unchanged lines hidden (view full) --- 88/* prototypes for file_operations struct */ 89static ssize_t dtlk_read(struct file *, char __user *, 90 size_t nbytes, loff_t * ppos); 91static ssize_t dtlk_write(struct file *, const char __user *, 92 size_t nbytes, loff_t * ppos); 93static unsigned int dtlk_poll(struct file *, poll_table *); 94static int dtlk_open(struct inode *, struct file *); 95static int dtlk_release(struct inode *, struct file *); |
96static int dtlk_ioctl(struct inode *inode, struct file *file, 97 unsigned int cmd, unsigned long arg); | 96static long dtlk_ioctl(struct file *file, 97 unsigned int cmd, unsigned long arg); |
98 99static const struct file_operations dtlk_fops = 100{ 101 .owner = THIS_MODULE, 102 .read = dtlk_read, 103 .write = dtlk_write, 104 .poll = dtlk_poll, | 98 99static const struct file_operations dtlk_fops = 100{ 101 .owner = THIS_MODULE, 102 .read = dtlk_read, 103 .write = dtlk_write, 104 .poll = dtlk_poll, |
105 .ioctl = dtlk_ioctl, | 105 .unlocked_ioctl = dtlk_ioctl, |
106 .open = dtlk_open, 107 .release = dtlk_release, 108}; 109 110/* local prototypes */ 111static int dtlk_dev_probe(void); 112static struct dtlk_settings *dtlk_interrogate(void); 113static int dtlk_readable(void); --- 144 unchanged lines hidden (view full) --- 258} 259 260static void dtlk_timer_tick(unsigned long data) 261{ 262 TRACE_TEXT(" dtlk_timer_tick"); 263 wake_up_interruptible(&dtlk_process_list); 264} 265 | 106 .open = dtlk_open, 107 .release = dtlk_release, 108}; 109 110/* local prototypes */ 111static int dtlk_dev_probe(void); 112static struct dtlk_settings *dtlk_interrogate(void); 113static int dtlk_readable(void); --- 144 unchanged lines hidden (view full) --- 258} 259 260static void dtlk_timer_tick(unsigned long data) 261{ 262 TRACE_TEXT(" dtlk_timer_tick"); 263 wake_up_interruptible(&dtlk_process_list); 264} 265 |
266static int dtlk_ioctl(struct inode *inode, 267 struct file *file, 268 unsigned int cmd, 269 unsigned long arg) | 266static long dtlk_ioctl(struct file *file, 267 unsigned int cmd, 268 unsigned long arg) |
270{ 271 char __user *argp = (char __user *)arg; 272 struct dtlk_settings *sp; 273 char portval; 274 TRACE_TEXT(" dtlk_ioctl"); 275 276 switch (cmd) { 277 278 case DTLK_INTERROGATE: | 269{ 270 char __user *argp = (char __user *)arg; 271 struct dtlk_settings *sp; 272 char portval; 273 TRACE_TEXT(" dtlk_ioctl"); 274 275 switch (cmd) { 276 277 case DTLK_INTERROGATE: |
278 lock_kernel(); |
|
279 sp = dtlk_interrogate(); | 279 sp = dtlk_interrogate(); |
280 unlock_kernel(); |
|
280 if (copy_to_user(argp, sp, sizeof(struct dtlk_settings))) 281 return -EINVAL; 282 return 0; 283 284 case DTLK_STATUS: 285 portval = inb_p(dtlk_port_tts); 286 return put_user(portval, argp); 287 --- 374 unchanged lines hidden --- | 281 if (copy_to_user(argp, sp, sizeof(struct dtlk_settings))) 282 return -EINVAL; 283 return 0; 284 285 case DTLK_STATUS: 286 portval = inb_p(dtlk_port_tts); 287 return put_user(portval, argp); 288 --- 374 unchanged lines hidden --- |