Changeset 5503

Show
Ignore:
Timestamp:
12/02/08 22:42:35 (4 years ago)
Author:
khali
Message:

Skip ISA detection by default if a Super I/O was found. In general,
systems have a Super-I/O chip or an ISA chip, not both.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r5502 r5503  
    3636                  Probe chip types from safest to more risky (#2322) 
    3737                  Add an option to skip ISA probes except IPMI 
     38                  Skip ISA detection by default if a Super I/O was found (#2322) 
    3839 
    39403.0.3 (2008-09-28) 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5502 r5503  
    28652865} 
    28662866 
     2867# Returns: 1 if device added to chips_detected, undef if not 
    28672868sub probe_superio 
    28682869{ 
     
    29152916        }; 
    29162917        add_isa_to_chips_detected($chip->{driver}, $new_hash); 
     2918        return 1; 
    29172919} 
    29182920 
     
    29452947} 
    29462948 
     2949# Returns: number of device added to chips_detected (0 or 1) 
    29472950sub scan_superio 
    29482951{ 
    29492952        my ($addrreg, $datareg) = @_; 
    29502953        my ($val, $found); 
     2954        my $added = 0; 
    29512955 
    29522956        printf("Probing for Super-I/O at 0x\%x/0x\%x\n", $addrreg, $datareg); 
     
    29862990                         || ($chip->{devid} <= 0xff && 
    29872991                             ($val >> 8) == $chip->{devid})) { 
    2988                                 probe_superio($addrreg, $datareg, $chip); 
     2992                                $added = 1 if probe_superio($addrreg, $datareg, $chip); 
    29892993                                $found++; 
    29902994                        } 
     
    30023006        } 
    30033007        $| = 0; 
     3008        return $added; 
    30043009} 
    30053010 
     
    48704875sub main 
    48714876{ 
    4872         my ($input); 
     4877        my ($input, $superio_found); 
    48734878 
    48744879        # We won't go very far if not root 
     
    49184923                unless (<STDIN> =~ /^\s*n/i) { 
    49194924                        initialize_ioports(); 
    4920                         scan_superio(0x2e, 0x2f); 
    4921                         scan_superio(0x4e, 0x4f); 
     4925                        $superio_found += scan_superio(0x2e, 0x2f); 
     4926                        $superio_found += scan_superio(0x4e, 0x4f); 
    49224927                        close_ioports(); 
    49234928                } 
    49244929                print "\n"; 
    49254930 
    4926                 print "Some hardware monitoring chips are accessible through the ISA I/O ports.\n". 
    4927                       "We have to write to arbitrary I/O ports to probe them. This is usually\n". 
    4928                       "safe though. Yes, you do have ISA I/O ports even if you do not have any\n". 
    4929                       "ISA slots! Do you want to scan the ISA I/O ports? (YES/no/ipmi only): "; 
     4931                printf "Some hardware monitoring chips are accessible through the ISA I/O ports.\n". 
     4932                       "We have to write to arbitrary I/O ports to probe them. This is usually\n". 
     4933                       "safe though. Yes, you do have ISA I/O ports even if you do not have any\n". 
     4934                       "ISA slots! Do you want to scan the ISA I/O ports? (\%s): ", 
     4935                       $superio_found ? "yes/no/IPMI ONLY" : "YES/no/ipmi only"; 
    49304936                $input = <STDIN>; 
    49314937                unless ($input =~ /^\s*n/i) { 
     4938                        my $ipmi_only = ($superio_found && $input !~ /^\s*y/i) 
     4939                                     || (!$superio_found && $input =~ /^\s*i/i); 
    49324940                        initialize_ioports(); 
    4933                         scan_isa_bus($input =~ /^\s*i/i); 
     4941                        scan_isa_bus($ipmi_only); 
    49344942                        close_ioports(); 
    49354943                }