mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-01 06:45:24 +00:00
Refactor IPMI detection functions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5419 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -1330,13 +1330,13 @@ use vars qw(@i2c_adapter_names);
|
|||||||
name => "IPMI BMC KCS",
|
name => "IPMI BMC KCS",
|
||||||
driver => "ipmisensors",
|
driver => "ipmisensors",
|
||||||
isa_addrs => [0x0ca0],
|
isa_addrs => [0x0ca0],
|
||||||
isa_detect => sub { ipmi_kcs_detect(@_); },
|
isa_detect => sub { ipmi_detect(@_); },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "IPMI BMC SMIC",
|
name => "IPMI BMC SMIC",
|
||||||
driver => "ipmisensors",
|
driver => "ipmisensors",
|
||||||
isa_addrs => [0x0ca8],
|
isa_addrs => [0x0ca8],
|
||||||
isa_detect => sub { ipmi_smic_detect(@_); },
|
isa_detect => sub { ipmi_detect(@_); },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -5211,18 +5211,13 @@ sub w83781d_isa_detect
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
# These are simple detectors that only look for a register at the
|
# We simply look for a register at standard locations.
|
||||||
# standard location.
|
|
||||||
# For KCS, use the STATUS register. For SMIC, use the FLAGS register.
|
# For KCS, use the STATUS register. For SMIC, use the FLAGS register.
|
||||||
sub ipmi_kcs_detect
|
# Incidentally they live at the same offset.
|
||||||
|
sub ipmi_detect
|
||||||
{
|
{
|
||||||
return if inb(0x0ca3) == 0xff;
|
my ($addr) = @_;
|
||||||
return 4;
|
return if inb($addr + 3) == 0xff;
|
||||||
}
|
|
||||||
|
|
||||||
sub ipmi_smic_detect
|
|
||||||
{
|
|
||||||
return if inb(0x0cab) == 0xff;
|
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user