Changeset 5419

Show
Ignore:
Timestamp:
11/24/08 16:50:00 (4 years ago)
Author:
khali
Message:

Refactor IPMI detection functions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5418 r5419  
    13311331       driver => "ipmisensors", 
    13321332       isa_addrs => [0x0ca0], 
    1333        isa_detect => sub { ipmi_kcs_detect(@_); }, 
     1333       isa_detect => sub { ipmi_detect(@_); }, 
    13341334     }, 
    13351335     { 
     
    13371337       driver => "ipmisensors", 
    13381338       isa_addrs => [0x0ca8], 
    1339        isa_detect => sub { ipmi_smic_detect(@_); }, 
     1339       isa_detect => sub { ipmi_detect(@_); }, 
    13401340     }, 
    13411341); 
     
    52125212} 
    52135213 
    5214 # These are simple detectors that only look for a register at the 
    5215 # standard location. 
     5214# We simply look for a register at standard locations. 
    52165215# For KCS, use the STATUS register. For SMIC, use the FLAGS register. 
    5217 sub ipmi_kcs_detect 
    5218 { 
    5219   return if inb(0x0ca3) == 0xff; 
    5220   return 4; 
    5221 } 
    5222  
    5223 sub ipmi_smic_detect 
    5224 { 
    5225   return if inb(0x0cab) == 0xff; 
     5216# Incidentally they live at the same offset. 
     5217sub ipmi_detect 
     5218{ 
     5219  my ($addr) = @_; 
     5220  return if inb($addr + 3) == 0xff; 
    52265221  return 4; 
    52275222}