Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7452
b: refs/heads/master
c: c14979b
h: refs/heads/master
v: v3
  • Loading branch information
Corey Minyard authored and Linus Torvalds committed Sep 7, 2005
1 parent 612dfe0 commit ca76aa8
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 61 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b224cd3a0ca376dd52f382905c1aaf5a83a54692
refs/heads/master: c14979b993021377228958498937bcdd9539cbce
94 changes: 84 additions & 10 deletions trunk/drivers/char/ipmi/ipmi_devintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ static int ipmi_ioctl(struct inode *inode,
break;
}

/* The next four are legacy, not per-channel. */
case IPMICTL_SET_MY_ADDRESS_CMD:
{
unsigned int val;
Expand All @@ -420,22 +421,25 @@ static int ipmi_ioctl(struct inode *inode,
break;
}

ipmi_set_my_address(priv->user, val);
rv = 0;
rv = ipmi_set_my_address(priv->user, 0, val);
break;
}

case IPMICTL_GET_MY_ADDRESS_CMD:
{
unsigned int val;
unsigned int val;
unsigned char rval;

rv = ipmi_get_my_address(priv->user, 0, &rval);
if (rv)
break;

val = ipmi_get_my_address(priv->user);
val = rval;

if (copy_to_user(arg, &val, sizeof(val))) {
rv = -EFAULT;
break;
}
rv = 0;
break;
}

Expand All @@ -448,24 +452,94 @@ static int ipmi_ioctl(struct inode *inode,
break;
}

ipmi_set_my_LUN(priv->user, val);
rv = 0;
rv = ipmi_set_my_LUN(priv->user, 0, val);
break;
}

case IPMICTL_GET_MY_LUN_CMD:
{
unsigned int val;
unsigned int val;
unsigned char rval;

rv = ipmi_get_my_LUN(priv->user, 0, &rval);
if (rv)
break;

val = ipmi_get_my_LUN(priv->user);
val = rval;

if (copy_to_user(arg, &val, sizeof(val))) {
rv = -EFAULT;
break;
}
rv = 0;
break;
}

case IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD:
{
struct ipmi_channel_lun_address_set val;

if (copy_from_user(&val, arg, sizeof(val))) {
rv = -EFAULT;
break;
}

return ipmi_set_my_address(priv->user, val.channel, val.value);
break;
}

case IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD:
{
struct ipmi_channel_lun_address_set val;

if (copy_from_user(&val, arg, sizeof(val))) {
rv = -EFAULT;
break;
}

rv = ipmi_get_my_address(priv->user, val.channel, &val.value);
if (rv)
break;

if (copy_to_user(arg, &val, sizeof(val))) {
rv = -EFAULT;
break;
}
break;
}

case IPMICTL_SET_MY_CHANNEL_LUN_CMD:
{
struct ipmi_channel_lun_address_set val;

if (copy_from_user(&val, arg, sizeof(val))) {
rv = -EFAULT;
break;
}

rv = ipmi_set_my_LUN(priv->user, val.channel, val.value);
break;
}

case IPMICTL_GET_MY_CHANNEL_LUN_CMD:
{
struct ipmi_channel_lun_address_set val;

if (copy_from_user(&val, arg, sizeof(val))) {
rv = -EFAULT;
break;
}

rv = ipmi_get_my_LUN(priv->user, val.channel, &val.value);
if (rv)
break;

if (copy_to_user(arg, &val, sizeof(val))) {
rv = -EFAULT;
break;
}
break;
}

case IPMICTL_SET_TIMING_PARMS_CMD:
{
struct ipmi_timing_parms parms;
Expand Down
Loading

0 comments on commit ca76aa8

Please sign in to comment.