Changeset 4128

Show
Ignore:
Timestamp:
09/01/06 18:45:50 (8 years ago)
Author:
khali
Message:

Attempt to make sensors-detect slightly more user-friendly, part two.

* Shorten the date part in revision string.
* Make the chip names more consistent.
* Align the result of ISA and Super-I/O probes.
* Replace "Failed!" with a less needlessly alarming "No".
* Make the ISA and Super-I/O probe results more compact.
* Adjust some explanations.
* Don't ask again before probing secondary Super-I/O address.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r4124 r4128  
    5252$revision = '$Revision$ ($Date$)'; 
    5353$revision =~ s/\$\w+: (.*?) \$/$1/g; 
     54$revision =~ s/ \([^()]*\)//; 
    5455 
    5556# This is the list of SMBus or I2C adapters we recognize by their PCI 
     
    14061407     }, 
    14071408     { 
    1408        name => "VIA Technologies VT82C686 Integrated Sensors", 
     1409       name => "VIA VT82C686 Integrated Sensors", 
    14091410       driver => "via686a", 
    14101411       isa_addrs => [ 0 ], 
     
    14121413     }, 
    14131414     { 
    1414        name => "VIA Technologies VT8231 Integrated Sensors", 
     1415       name => "VIA VT8231 Integrated Sensors", 
    14151416       driver => "vt8231", 
    14161417       isa_addrs => [ 0 ], 
     
    16511652    [ 
    16521653      { 
    1653         name => "ITE 8702F Super IO Sensors", 
     1654        name => "ITE IT8702F Super IO Sensors", 
    16541655        driver => "to-be-written", 
    16551656        devid => 0x8702, 
     
    16571658      }, 
    16581659      { 
    1659         name => "ITE 8705F Super IO Sensors", 
     1660        name => "ITE IT8705F Super IO Sensors", 
    16601661        driver => "it87", 
    16611662        devid => 0x8705, 
     
    16631664      }, 
    16641665      { 
    1665         name => "ITE 8712F Super IO Sensors", 
     1666        name => "ITE IT8712F Super IO Sensors", 
    16661667        driver => "it87", 
    16671668        devid => 0x8712, 
     
    18131814    [ 
    18141815      { 
    1815         name => "SMSC 47B27x Super IO Fan Sensors", 
     1816        name => "SMSC LPC47B27x Super IO Fan Sensors", 
    18161817        driver => "smsc47m1", 
    18171818        devid => 0x51, 
     
    18191820      }, 
    18201821      { 
    1821         name => "SMSC 47M10x/13x Super IO Fan Sensors", 
     1822        name => "SMSC LPC47M10x/13x Super IO Fan Sensors", 
    18221823        driver => "smsc47m1", 
    18231824        devid => 0x59, 
     
    18251826      }, 
    18261827      { 
    1827         name => "SMSC 47M14x Super IO Fan Sensors", 
     1828        name => "SMSC LPC47M14x Super IO Fan Sensors", 
    18281829        driver => "smsc47m1", 
    18291830        devid => 0x5f, 
     
    18311832      }, 
    18321833      { 
    1833         name => "SMSC 47M15x/192/997 Super IO Fan Sensors", 
     1834        name => "SMSC LPC47M15x/192/997 Super IO Fan Sensors", 
    18341835        driver => "smsc47m1", 
    18351836        devid => 0x60, 
     
    18371838      }, 
    18381839      { 
    1839         name => "SMSC 47S42x Super IO Fan Sensors", 
     1840        name => "SMSC LPC47S42x Super IO Fan Sensors", 
    18401841        driver => "to-be-written", 
    18411842        devid => 0x57, 
     
    18431844      }, 
    18441845      { 
    1845         name => "SMSC 47S45x Super IO Fan Sensors", 
     1846        name => "SMSC LPC47S45x Super IO Fan Sensors", 
    18461847        driver => "to-be-written", 
    18471848        devid => 0x62, 
     
    18491850      }, 
    18501851      { 
    1851         name => "SMSC 47M172 Super IO", 
     1852        name => "SMSC LPC47M172 Super IO", 
    18521853        driver => "not-a-sensor", 
    18531854        devid => 0x14, 
     
    18821883    [ 
    18831884      { 
    1884         name => "VT1211 Super IO Sensors", 
     1885        name => "VIA VT1211 Super IO Sensors", 
    18851886        driver => "vt1211", 
    18861887        devid => 0x3c, 
     
    28412842    foreach $chip (@chip_ids) { 
    28422843      if (exists $chip->{i2c_addrs} and contains $addr, @{$chip->{i2c_addrs}}) { 
    2843         print "Probing for `$chip->{name}'... "; 
     2844        printf("\%-60s", sprintf("Probing for `\%s'... ", $chip->{name})); 
    28442845        if (($conf,@chips) = &{$chip->{i2c_detect}} (\*FILE ,$addr)) { 
    28452846          print "Success!\n", 
     
    28662867          add_i2c_to_chips_detected $chip->{driver}, $new_hash; 
    28672868        } else { 
    2868           print "Failed!\n"; 
     2869          print "No\n"; 
    28692870        } 
    28702871      } 
     
    28782879  foreach $chip (@chip_ids) { 
    28792880    next if not exists $chip->{isa_addrs} or not exists $chip->{isa_detect}; 
    2880     print "Probing for `$chip->{name}'\n"; 
    28812881    foreach $addr (@{$chip->{isa_addrs}}) { 
    2882       if ($addr) { 
    2883         printf "  Trying address 0x%04x... ", $addr; 
    2884       } else { 
    2885         print "  Trying general detect... "; 
    2886       } 
     2882      printf("\%-60s", sprintf("Probing for `\%s'\%s... ", $chip->{name}, 
     2883                               $addr ? sprintf(" at 0x\%x", $addr) : '')); 
    28872884      $conf = &{$chip->{isa_detect}} ($addr); 
    2888       print("Failed!\n"), next if not defined $conf; 
     2885      print("No\n"), next if not defined $conf; 
    28892886      print "Success!\n"; 
    28902887      printf "    (confidence %d, driver `%s')\n", $conf, $chip->{driver}; 
     
    29302927{ 
    29312928  my ($addrreg, $datareg) = @_; 
    2932   my ($val, $addr); 
     2929  my ($val, $addr, $name); 
    29332930 
    29342931  my %superio = ( 
     
    29402937  ); 
    29412938   
     2939  printf("Probing for Super-I/O at 0x\%x/0x\%x\n", $addrreg, $datareg); 
     2940 
    29422941  FAMILY:  
    29432942  foreach my $family (@superio_ids) { 
     
    29472946    } 
    29482947    foreach my $chip (@{$family->{chips}}) { 
    2949       print "Probing for `$chip->{name}'\n"; 
     2948      $name = $chip->{name}; 
     2949      $name =~ s/ Super IO//; 
     2950      printf("\%-60s", sprintf("Probing for `\%s'... ", $name)); 
    29502951# check the device ID 
    29512952      outb($addrreg, $superio{devidreg}); 
    29522953      $val = inb($datareg); 
    29532954      if ($val == 0x00 || $val == 0xff) { 
    2954         print "  Failed! (skipping family)\n"; 
     2955        print "No\n"; 
    29552956        exit_superio($addrreg, $datareg, $family, 0); 
    29562957        next FAMILY; 
     
    29612962      } 
    29622963      if (($val & ($chip->{devid_mask} || 0xffff)) != $chip->{devid}) { 
    2963         printf "  Failed! (0x%0*x)\n", $chip->{devid}>0xff ? 4 : 2, $val; 
     2964        printf "No (0x%0*x)\n", $chip->{devid}>0xff ? 4 : 2, $val; 
    29642965        next; 
    29652966      } 
    2966       print "  Success..."; 
     2967      print "Success!\n"; 
    29672968# does it have hardware monitoring capabilities 
    29682969      if (!exists $chip->{driver}) { 
    2969         print " (no information available)\n"; 
     2970        print "    (no information available)\n"; 
    29702971        next; 
    29712972      } 
    29722973      if($chip->{driver} eq "not-a-sensor") { 
    2973         print " (no hardware monitoring capabilities)\n"; 
     2974        print "    (no hardware monitoring capabilities)\n"; 
    29742975        next; 
    29752976      } 
     
    29812982      $val = inb($datareg); 
    29822983      if(!($val & $superio{actmask})) { 
    2983         print " but not activated\n"; 
     2984        print "    (but not activated)\n"; 
    29842985        next; 
    29852986      } 
     
    29902991      $addr = ($addr << 8) | inb($datareg); 
    29912992      if($addr == 0) { 
    2992         print " but no address specified\n"; 
     2993        print "    (but no address specified)\n"; 
    29932994        next; 
    29942995      }          
    2995       printf " found at address 0x%04x\n", $addr; 
     2996      printf "    (address 0x\%x, driver `%s')\n", $addr, $chip->{driver}; 
    29962997      my $new_hash = { conf => 9, 
    29972998                       isa_addr => $addr, 
     
    53405341 
    53415342  print "We are now going to do the I2C/SMBus adapter probings. Some chips may\n", 
    5342         "be double detected; we choose the one with the highest confidence value\n", 
    5343         "in that case.\n", 
    5344         "If you found that the adapter hung after probing a certain address, you\n", 
    5345         "can specify that address to remain unprobed.\n"; 
     5343        "be double detected; we choose the one with the highest confidence\n", 
     5344        "value in that case.\n", 
     5345        "If you found that the adapter hung after probing a certain address,\n", 
     5346        "you can specify that address to remain unprobed.\n"; 
    53465347 
    53475348  my ($inp,@not_to_scan,$inp2); 
     
    53745375 
    53755376  print "Some chips are also accessible through the ISA I/O ports. We have to\n". 
    5376         "write to arbitrary I/O ports to do this. This is usually safe though.\n". 
     5377        "write to arbitrary I/O ports to probe them. This is usually safe though.\n". 
    53775378        "Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n"; 
    53785379  print "Do you want to scan the ISA I/O ports? (YES/no): "; 
     
    53855386 
    53865387  print "Some Super I/O chips may also contain sensors. We have to write to\n". 
    5387         "standard I/O ports to do this. This is usually safe.\n"; 
     5388        "standard I/O ports to probe them. This is usually safe.\n"; 
    53885389  print "Do you want to scan for Super I/O sensors? (YES/no): "; 
    53895390  unless (<STDIN> =~ /^\s*n/i) { 
    53905391    initialize_ioports(); 
    53915392    scan_superio(0x2e, 0x2f); 
    5392     print "\nDo you want to scan for secondary Super I/O sensors? (YES/no): "; 
    5393     unless (<STDIN> =~ /^\s*n/i) { 
    5394       scan_superio(0x4e, 0x4f); 
    5395     } 
     5393    scan_superio(0x4e, 0x4f); 
    53965394    close_ioports(); 
    53975395  }