Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ur lsadrv/fakemouse.c lsadrv-nuevo/fakemouse.c
- --- lsadrv/fakemouse.c 2015-02-23 07:42:02.000000000 +0100
- +++ lsadrv-nuevo/fakemouse.c 2021-10-18 13:47:19.359346693 +0200
- @@ -25,38 +25,24 @@
- #define REPORT(FMT,VAL) printk(KERN_ALERT stringify( MODNAME ) ":" FMT "!\n", VAL);
- #define WARN(X) printk(KERN_WARNING stringify( MODNAME ) ":" X "!\n");
- -static int fakemouse_ioctl(struct file *filp,unsigned int command, unsigned long arg);
- +static long fakemouse_ioctl(struct file *filp,unsigned int command, unsigned long arg);
- static int fakemouse_device_open(struct inode *inode, struct file *filp);
- static int fakemouse_device_release(struct inode *inode, struct file *filp);
- -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
- -struct file_operations fakemouse_fops =
- +static const struct file_operations fakemouse_fops =
- {
- .owner = THIS_MODULE,
- .llseek = 0,
- .read = 0,
- .write = 0,
- - .compat_ioctl = fakemouse_ioctl,
- + .compat_ioctl = fakemouse_ioctl,
- .open = fakemouse_device_open,
- .release = fakemouse_device_release,
- };
- -#else
- -struct file_operations fakemouse_fops =
- - {
- - .owner = THIS_MODULE,
- - .llseek = 0,
- - .read = 0,
- - .write = 0,
- - .unlocked_ioctl = fakemouse_ioctl,
- - .open = fakemouse_device_open,
- - .release = fakemouse_device_release,
- - };
- -#endif
- -
- int lsadrv_ioctl_mouseevent_dispatch(void *arg);
- -static int fakemouse_ioctl(struct file *filp,unsigned int command, unsigned long arg)
- +static long fakemouse_ioctl(struct file *filp,unsigned int command, unsigned long arg)
- {
- struct lsadrv_mouse_input *minp = (struct lsadrv_mouse_input*)arg;
- diff -ur lsadrv/lsadrv.h lsadrv-nuevo/lsadrv.h
- --- lsadrv/lsadrv.h 2015-02-23 07:42:02.000000000 +0100
- +++ lsadrv-nuevo/lsadrv.h 2021-10-18 10:53:22.414217359 +0200
- @@ -152,8 +152,8 @@
- void lsadrv_init_waitqueue_head(wait_queue_head_t **q);
- void lsadrv_free_waitqueue_head(wait_queue_head_t *q);
- void lsadrv_init_waitqueue_entry(void *buf, int size);
- -void lsadrv_add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
- -void lsadrv_remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
- +void lsadrv_add_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait);
- +void lsadrv_remove_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait);
- void lsadrv_wake_up_interruptible(wait_queue_head_t *q);
- void lsadrv_modlock(struct lsadrv_device *xdev);
- void lsadrv_modunlock(struct lsadrv_device *xdev);
- diff -ur lsadrv/lsadrv-isoc.c lsadrv-nuevo/lsadrv-isoc.c
- --- lsadrv/lsadrv-isoc.c 2015-02-23 07:42:02.000000000 +0100
- +++ lsadrv-nuevo/lsadrv-isoc.c 2021-10-18 10:53:37.790458387 +0200
- @@ -509,7 +509,7 @@
- struct lsadrv_ring_buffer *ringBuffer;
- //DECLARE_WAITQUEUE(wait, current);
- unsigned char waitbuf[64]; /* sufficient size */
- - wait_queue_t *wait = (wait_queue_t *) waitbuf;
- + wait_queue_entry_t *wait = (wait_queue_entry_t *) waitbuf;
- struct lsadrv_device *xdev;
- unsigned int pendingTransfers;
- @@ -780,7 +780,7 @@
- struct lsadrv_ring_buffer *ringBuffer;
- //DECLARE_WAITQUEUE(wait, current);
- unsigned char waitbuf[64]; /* sufficient size */
- - wait_queue_t *wait = (wait_queue_t *) waitbuf;
- + wait_queue_entry_t *wait = (wait_queue_entry_t *) waitbuf;
- unsigned int recSize = PacketSize + sizeof(struct lsadrv_iso_packet_desc);
- unsigned int bytesToRead = PacketCount * recSize;
- unsigned int bytesRead = 0;
- diff -ur lsadrv/lsadrv-main.c lsadrv-nuevo/lsadrv-main.c
- --- lsadrv/lsadrv-main.c 2015-02-23 07:42:02.000000000 +0100
- +++ lsadrv-nuevo/lsadrv-main.c 2021-10-18 11:08:53.593146006 +0200
- @@ -18,7 +18,7 @@
- *
- ============================================================================*/
- -#include <linux/sched.h>
- +#include <linux/sched/signal.h>
- #ifdef MODVERSIONS
- #include <linux/modversions.h>
- #endif
- @@ -451,14 +451,14 @@
- static void lsadrv_create_procfs_dir(void)
- {
- struct lsadrv_proc_files *files = &lsadrv_files;
- - static struct file_operations proc_fops = {
- + static struct proc_ops proc_fops = {
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
- .owner = THIS_MODULE,
- #endif
- - .open = lsadrv_devices_open,
- - .read = seq_read,
- - .llseek = seq_lseek,
- - .release = seq_release
- + .proc_open = lsadrv_devices_open,
- + .proc_read = seq_read,
- + .proc_lseek = seq_lseek,
- + .proc_release = seq_release
- };
- /* Make procfs/driver/lsadrv directory */
- /* files->lsadrvDirEntry = create_proc_entry("lsadrv", S_IFDIR, proc_root_driver);*/
- diff -ur lsadrv/lsadrv-sub.c lsadrv-nuevo/lsadrv-sub.c
- --- lsadrv/lsadrv-sub.c 2015-02-23 07:42:02.000000000 +0100
- +++ lsadrv-nuevo/lsadrv-sub.c 2021-10-18 11:17:23.589224894 +0200
- @@ -25,9 +25,9 @@
- #include <linux/kernel.h> /* for linux kernel */
- #include <linux/slab.h>
- #include <linux/version.h>
- -#include <asm/uaccess.h>
- +#include <linux/uaccess.h>
- -#include <linux/sched.h>
- +#include <linux/sched/signal.h>
- #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22)) & (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31))
- #define find_task_by_pid(pid) find_task_by_pid_type_ns(PIDTYPE_PID, pid, &init_pid_ns)
- @@ -119,20 +119,20 @@
- void lsadrv_init_waitqueue_entry(void *buf, int size)
- {
- - wait_queue_t *wait = (wait_queue_t *) buf;
- - if (size < sizeof(wait_queue_t)) {
- + wait_queue_entry_t *wait = (wait_queue_entry_t *) buf;
- + if (size < sizeof(wait_queue_entry_t)) {
- BUG();
- }
- - memset(wait, 0, sizeof(wait_queue_t));
- + memset(wait, 0, sizeof(wait_queue_entry_t));
- init_waitqueue_entry(wait, current);
- }
- -void lsadrv_add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
- +void lsadrv_add_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait)
- {
- add_wait_queue(q, wait);
- }
- -void lsadrv_remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
- +void lsadrv_remove_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait)
- {
- remove_wait_queue(q, wait);
- }
- @@ -179,7 +179,7 @@
- int lsadrv_write_ok(void *addr, unsigned long size)
- {
- - return access_ok(VERIFY_WRITE, addr, size);
- + return access_ok(addr, size);
- }
- unsigned long lsadrv_copy_to_user(void *to, const void *from, unsigned long n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement