lan: channel: Fix set alert on/off

From IPMI Spec, Chapter 22.22 Set Channel Access Command
Table 22, Set Channel Access Command

Byte#2, Bit#5 is "PEF Alerting Enable/Disable"
And the bit value:
    0b = enable PEF Alerting
    1b = disable PEF Alerting on this channel

In current code, alert "on" set Bit#5 to 1 and alert "off" set Bit#5 to
0, it's straightforward but just opposite of IPMI spec bit definition.

Resolves ipmitool/ipmitool#247

Reported-by: Ryan Fang <Ryan.Fang@quantatw.com>
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin
2020-10-20 17:15:59 +03:00
committed by Alexander Amelkin
parent 9328748672
commit 4b791f8bf6
2 changed files with 11 additions and 5 deletions

View File

@@ -1026,10 +1026,10 @@ ipmi_set_alert_enable(struct ipmi_intf *intf, uint8_t channel, uint8_t enable)
channel);
return (-1);
}
if (enable != 0) {
channel_access.alerting = 1;
if (enable) {
channel_access.alerting = ALERTING_ENABLED;
} else {
channel_access.alerting = 0;
channel_access.alerting = ALERTING_DISABLED;
}
/* non-volatile */
ccode = _ipmi_set_channel_access(intf, channel_access, 1, 0);