#include "gasket_page_table.h"
#include "gasket_sysfs.h"
+#include <linux/compiler.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/init.h>
{
struct gasket_dev *gasket_dev;
const struct gasket_driver_desc *driver_desc;
+ void __user *argp = (void __user *)arg;
char path[256];
if (!filp)
* check_and_invoke_callback.
*/
if (driver_desc->ioctl_handler_cb)
- return driver_desc->ioctl_handler_cb(filp, cmd, arg);
+ return driver_desc->ioctl_handler_cb(filp, cmd, argp);
gasket_log_error(
gasket_dev, "Received unknown ioctl 0x%x", cmd);
return -EINVAL;
}
- return gasket_handle_ioctl(filp, cmd, arg);
+ return gasket_handle_ioctl(filp, cmd, argp);
}
int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type)
struct hlist_node legacy_hlist_node;
};
+/* Type of the ioctl handler callback. */
+typedef long (*gasket_ioctl_handler_cb_t)
+ (struct file *file, uint cmd, void __user *argp);
/* Type of the ioctl permissions check callback. See below. */
typedef int (*gasket_ioctl_permissions_cb_t)(
- struct file *filp, uint cmd, ulong arg);
+ struct file *filp, uint cmd, void __user *argp);
/*
* Device type descriptor.
* return -EINVAL. Should return an error status (either -EINVAL or
* the error result of the ioctl being handled).
*/
- long (*ioctl_handler_cb)(struct file *filp, uint cmd, ulong arg);
+ gasket_ioctl_handler_cb_t ioctl_handler_cb;
/*
* device_status_cb: Callback to determine device health.