diff options
Diffstat (limited to 'drivers/char/ipmi/ipmi_devintf.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_devintf.c | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 68d7c61a864e..ff2d052177cb 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
@@ -377,7 +377,8 @@ static int ipmi_ioctl(struct inode *inode, | |||
377 | break; | 377 | break; |
378 | } | 378 | } |
379 | 379 | ||
380 | rv = ipmi_register_for_cmd(priv->user, val.netfn, val.cmd); | 380 | rv = ipmi_register_for_cmd(priv->user, val.netfn, val.cmd, |
381 | IPMI_CHAN_ALL); | ||
381 | break; | 382 | break; |
382 | } | 383 | } |
383 | 384 | ||
@@ -390,7 +391,36 @@ static int ipmi_ioctl(struct inode *inode, | |||
390 | break; | 391 | break; |
391 | } | 392 | } |
392 | 393 | ||
393 | rv = ipmi_unregister_for_cmd(priv->user, val.netfn, val.cmd); | 394 | rv = ipmi_unregister_for_cmd(priv->user, val.netfn, val.cmd, |
395 | IPMI_CHAN_ALL); | ||
396 | break; | ||
397 | } | ||
398 | |||
399 | case IPMICTL_REGISTER_FOR_CMD_CHANS: | ||
400 | { | ||
401 | struct ipmi_cmdspec_chans val; | ||
402 | |||
403 | if (copy_from_user(&val, arg, sizeof(val))) { | ||
404 | rv = -EFAULT; | ||
405 | break; | ||
406 | } | ||
407 | |||
408 | rv = ipmi_register_for_cmd(priv->user, val.netfn, val.cmd, | ||
409 | val.chans); | ||
410 | break; | ||
411 | } | ||
412 | |||
413 | case IPMICTL_UNREGISTER_FOR_CMD_CHANS: | ||
414 | { | ||
415 | struct ipmi_cmdspec_chans val; | ||
416 | |||
417 | if (copy_from_user(&val, arg, sizeof(val))) { | ||
418 | rv = -EFAULT; | ||
419 | break; | ||
420 | } | ||
421 | |||
422 | rv = ipmi_unregister_for_cmd(priv->user, val.netfn, val.cmd, | ||
423 | val.chans); | ||
394 | break; | 424 | break; |
395 | } | 425 | } |
396 | 426 | ||
@@ -566,6 +596,31 @@ static int ipmi_ioctl(struct inode *inode, | |||
566 | rv = 0; | 596 | rv = 0; |
567 | break; | 597 | break; |
568 | } | 598 | } |
599 | |||
600 | case IPMICTL_GET_MAINTENANCE_MODE_CMD: | ||
601 | { | ||
602 | int mode; | ||
603 | |||
604 | mode = ipmi_get_maintenance_mode(priv->user); | ||
605 | if (copy_to_user(arg, &mode, sizeof(mode))) { | ||
606 | rv = -EFAULT; | ||
607 | break; | ||
608 | } | ||
609 | rv = 0; | ||
610 | break; | ||
611 | } | ||
612 | |||
613 | case IPMICTL_SET_MAINTENANCE_MODE_CMD: | ||
614 | { | ||
615 | int mode; | ||
616 | |||
617 | if (copy_from_user(&mode, arg, sizeof(mode))) { | ||
618 | rv = -EFAULT; | ||
619 | break; | ||
620 | } | ||
621 | rv = ipmi_set_maintenance_mode(priv->user, mode); | ||
622 | break; | ||
623 | } | ||
569 | } | 624 | } |
570 | 625 | ||
571 | return rv; | 626 | return rv; |
@@ -743,7 +798,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, | |||
743 | if (copy_to_user(precv64, &recv64, sizeof(recv64))) | 798 | if (copy_to_user(precv64, &recv64, sizeof(recv64))) |
744 | return -EFAULT; | 799 | return -EFAULT; |
745 | 800 | ||
746 | rc = ipmi_ioctl(filep->f_dentry->d_inode, filep, | 801 | rc = ipmi_ioctl(filep->f_path.dentry->d_inode, filep, |
747 | ((cmd == COMPAT_IPMICTL_RECEIVE_MSG) | 802 | ((cmd == COMPAT_IPMICTL_RECEIVE_MSG) |
748 | ? IPMICTL_RECEIVE_MSG | 803 | ? IPMICTL_RECEIVE_MSG |
749 | : IPMICTL_RECEIVE_MSG_TRUNC), | 804 | : IPMICTL_RECEIVE_MSG_TRUNC), |
@@ -760,7 +815,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, | |||
760 | return rc; | 815 | return rc; |
761 | } | 816 | } |
762 | default: | 817 | default: |
763 | return ipmi_ioctl(filep->f_dentry->d_inode, filep, cmd, arg); | 818 | return ipmi_ioctl(filep->f_path.dentry->d_inode, filep, cmd, arg); |
764 | } | 819 | } |
765 | } | 820 | } |
766 | #endif | 821 | #endif |
@@ -779,7 +834,7 @@ static const struct file_operations ipmi_fops = { | |||
779 | 834 | ||
780 | #define DEVICE_NAME "ipmidev" | 835 | #define DEVICE_NAME "ipmidev" |
781 | 836 | ||
782 | static int ipmi_major = 0; | 837 | static int ipmi_major; |
783 | module_param(ipmi_major, int, 0); | 838 | module_param(ipmi_major, int, 0); |
784 | MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device. By" | 839 | MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device. By" |
785 | " default, or if you set it to zero, it will choose the next" | 840 | " default, or if you set it to zero, it will choose the next" |