Changeset 4143
- Timestamp:
- 09/05/06 13:35:51 (7 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
prog/detect/sensors-detect (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r4142 r4143 83 83 Remove detection of nVidia graphics adapters 84 84 Use sysfs for PCI device enumeration 85 Add generic PCI SMBus adapter detection 85 86 86 87 -
lm-sensors/trunk/prog/detect/sensors-detect
r4142 r4143 2209 2209 } 2210 2210 2211 # Build and return a PCI device's bus ID 2212 sub pci_busid($) 2213 { 2214 my $device = shift; 2215 my $busid; 2216 2217 $busid = sprintf("\%02x:\%02x.\%x", 2218 $device->{bus}, $device->{slot}, $device->{func}); 2219 $busid = sprintf("\%04x:", $device->{domain}) . $busid 2220 if defined $device->{domain}; 2221 2222 return $busid; 2223 } 2224 2211 2225 sub adapter_pci_detection 2212 2226 { 2213 my ($key, $device,$try,@res);2227 my ($key, $device, $try, @res, %smbus); 2214 2228 print "Probing for PCI bus adapters...\n"; 2215 2229 … … 2217 2231 adapter_pci_detection_sis_96x(); 2218 2232 2219 # Generic detection loop 2233 # Build a list of detected SMBus devices 2234 foreach $key (keys %pci_list) { 2235 $device = $pci_list{$key}; 2236 $smbus{$key}++ 2237 if exists $device->{class} && $device->{class} == 0x0c05; # SMBus 2238 } 2239 2240 # Loop over the known I2C/SMBus adapters 2220 2241 foreach $try (@pci_adapters) { 2221 2242 $key = sprintf("%04x:%04x", $try->{vendid}, $try->{devid}); … … 2223 2244 $device = $pci_list{$key}; 2224 2245 printf "Use driver `\%s' for device \%s: \%s\n", 2225 $try->{driver}, 2226 (defined $device->{domain} ? 2227 sprintf("\%04x:\%02x:\%02x.\%x", $device->{domain}, 2228 $device->{bus}, $device->{slot}, $device->{func}) : 2229 sprintf("\%02x:\%02x.\%x", 2230 $device->{bus}, $device->{slot}, $device->{func})), 2231 $try->{procid}; 2246 $try->{driver}, pci_busid($device), $try->{procid}; 2232 2247 if ($try->{driver} eq "to-be-tested") { 2233 2248 print "\nWe are currently looking for testers for this adapter!\n". … … 2239 2254 } 2240 2255 push @res,$try->{driver}; 2256 2257 # Delete from detected SMBus device list 2258 delete $smbus{$key}; 2241 2259 } 2242 2260 } 2261 2262 # Now see if there are unknown SMBus devices left 2263 foreach $key (keys %smbus) { 2264 $device = $pci_list{$key}; 2265 printf "Found unknown SMBus adapter \%04x:\%04x at \%s.\n", 2266 $device->{vendid}, $device->{devid}, pci_busid($device); 2267 } 2268 2243 2269 if (! @res) { 2244 print ("Sorry, no PCI bus adapters found.\n"); 2245 } else { 2246 printf ("Probe successfully concluded.\n"); 2270 print "Sorry, no known PCI bus adapters found.\n"; 2247 2271 } 2248 2272 return @res;
