Changeset 5507
- Timestamp:
- 12/03/08 10:47:57 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5506 r5507 2966 2966 } 2967 2967 2968 # Returns: 1 if device added to chips_detected, undefif not2968 # Returns: features bitmask if device added to chips_detected, 0 if not 2969 2969 sub probe_superio 2970 2970 { … … 2977 2977 if (!exists $chip->{driver}) { 2978 2978 print "\n (no information available)\n"; 2979 return ;2979 return 0; 2980 2980 } 2981 2981 if ($chip->{driver} eq "not-a-sensor") { 2982 2982 print "\n (no hardware monitoring capabilities)\n"; 2983 return ;2983 return 0; 2984 2984 } 2985 2985 if ($chip->{driver} eq "via-smbus-only") { 2986 2986 print "\n (hardware monitoring capabilities accessible via SMBus only)\n"; 2987 return ;2987 return 0; 2988 2988 } 2989 2989 … … 2997 2997 if (!($val & $superio{actmask})) { 2998 2998 print "\n (but not activated)\n"; 2999 return ;2999 return 0; 3000 3000 } 3001 3001 … … 3007 3007 if ($addr == 0) { 3008 3008 print "\n (but no address specified)\n"; 3009 return ;3009 return 0; 3010 3010 } 3011 3011 print "Success!\n"; … … 3017 3017 }; 3018 3018 add_isa_to_chips_detected($chip->{driver}, $new_hash); 3019 return 1;3019 return $chip->{features}; 3020 3020 } 3021 3021 … … 3048 3048 } 3049 3049 3050 # Returns: number of device added to chips_detected (0 or 1)3050 # Returns: features supported by the device added, if any 3051 3051 sub scan_superio 3052 3052 { 3053 3053 my ($addrreg, $datareg) = @_; 3054 3054 my ($val, $found); 3055 my $ added= 0;3055 my $features = 0; 3056 3056 3057 3057 printf("Probing for Super-I/O at 0x\%x/0x\%x\n", $addrreg, $datareg); … … 3089 3089 || ($chip->{devid} <= 0xff && 3090 3090 ($val >> 8) == $chip->{devid})) { 3091 $ added = 1 ifprobe_superio($addrreg, $datareg, $chip);3091 $features |= probe_superio($addrreg, $datareg, $chip); 3092 3092 $found++; 3093 3093 } … … 3104 3104 exit_superio($addrreg, $datareg); 3105 3105 $| = 0; 3106 return $ added;3106 return $features; 3107 3107 } 3108 3108 … … 4973 4973 sub main 4974 4974 { 4975 my ($input, $superio_f ound);4975 my ($input, $superio_features); 4976 4976 4977 4977 # We won't go very far if not root … … 5021 5021 unless (<STDIN> =~ /^\s*n/i) { 5022 5022 initialize_ioports(); 5023 $superio_f ound += scan_superio(0x2e, 0x2f);5024 $superio_f ound += scan_superio(0x4e, 0x4f);5023 $superio_features |= scan_superio(0x2e, 0x2f); 5024 $superio_features |= scan_superio(0x4e, 0x4f); 5025 5025 close_ioports(); 5026 5026 } … … 5031 5031 "safe though. Yes, you do have ISA I/O ports even if you do not have any\n". 5032 5032 "ISA slots! Do you want to scan the ISA I/O ports? (\%s): ", 5033 $superio_f ound? "yes/no/IPMI ONLY" : "YES/no/ipmi only";5033 $superio_features ? "yes/no/IPMI ONLY" : "YES/no/ipmi only"; 5034 5034 $input = <STDIN>; 5035 5035 unless ($input =~ /^\s*n/i) { 5036 my $ipmi_only = ($superio_f ound&& $input !~ /^\s*y/i)5037 || (!$superio_f ound&& $input =~ /^\s*i/i);5036 my $ipmi_only = ($superio_features && $input !~ /^\s*y/i) 5037 || (!$superio_features && $input =~ /^\s*i/i); 5038 5038 initialize_ioports(); 5039 5039 scan_isa_bus($ipmi_only);
