diff options
author | Vincent Bossier <vincent.bossier@gmail.com> | 2011-06-09 15:49:30 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 14:13:05 -0700 |
commit | dca22184262de0171bafdf613a8d3992a818b70f (patch) | |
tree | 7b1e8feb4f2177d474634fcd8cc952b87dece774 /drivers/staging/vme | |
parent | 54b4a779c9565c475a17cc1254a38f293a5ba3ef (diff) | |
download | op-kernel-dev-dca22184262de0171bafdf613a8d3992a818b70f.zip op-kernel-dev-dca22184262de0171bafdf613a8d3992a818b70f.tar.gz |
Staging: VME: Introduce IOCTL to generate VME interrupts.
The vme_irq_set is oblviously not needed (a remnant from old tests) and the
IOCTL exchange types have been updated following Greg's comments.
Allow the IOCTL call to generate VME interrupts when called on the vme/ctl
device with the right arguments.
Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme')
-rw-r--r-- | drivers/staging/vme/devices/vme_user.c | 16 | ||||
-rw-r--r-- | drivers/staging/vme/devices/vme_user.h | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index db12879..91d2cc7 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -461,6 +461,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, { struct vme_master master; struct vme_slave slave; + struct vme_irq_id irq_req; unsigned long copied; unsigned int minor = MINOR(inode->i_rdev); int retval; @@ -471,6 +472,21 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, switch (type[minor]) { case CONTROL_MINOR: + switch (cmd) { + case VME_IRQ_GEN: + copied = copy_from_user(&irq_req, (char *)arg, + sizeof(struct vme_irq_id)); + if (copied != 0) { + printk(KERN_WARNING "Partial copy from userspace\n"); + return -EFAULT; + } + + retval = vme_irq_generate(vme_user_bridge, + irq_req.level, + irq_req.statid); + + return retval; + } break; case MASTER_MINOR: switch (cmd) { diff --git a/drivers/staging/vme/devices/vme_user.h b/drivers/staging/vme/devices/vme_user.h index ede77d7..24bf4e5 100644 --- a/drivers/staging/vme/devices/vme_user.h +++ b/drivers/staging/vme/devices/vme_user.h @@ -43,10 +43,16 @@ struct vme_slave { #endif }; +struct vme_irq_id { + __u8 level; + __u8 statid; +}; + #define VME_GET_SLAVE _IOR(VME_IOC_MAGIC, 1, struct vme_slave) #define VME_SET_SLAVE _IOW(VME_IOC_MAGIC, 2, struct vme_slave) #define VME_GET_MASTER _IOR(VME_IOC_MAGIC, 3, struct vme_master) #define VME_SET_MASTER _IOW(VME_IOC_MAGIC, 4, struct vme_master) +#define VME_IRQ_GEN _IOW(VME_IOC_MAGIC, 5, struct vme_irq_id) #endif /* _VME_USER_H_ */ |