Changeset 5244
- Timestamp:
- 05/09/08 20:01:00 (3 months ago)
- Files:
-
- lm-sensors/trunk/CHANGES (modified) (1 diff)
- lm-sensors/trunk/prog/detect/sensors-detect (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/CHANGES
r5234 r5244 18 18 Add Intel ICH10 (bus) detection 19 19 Don't probe I2C addresses 0x40-0x47 20 Fix the parsing of I2C addresses not to scan 20 21 21 22 2.10.6 "Welcome Home Lina" (20080306) lm-sensors/trunk/prog/detect/sensors-detect
r5234 r5244 2074 2074 } 2075 2075 2076 # Address can be decimal or hexadecimal 2077 sub valid_address 2078 { 2079 my $value = shift; 2080 2081 if ($value !~ m/^(0x[0-9a-f]+|[0-9]+)$/i) { 2082 print "$value is not a valid address, sorry.\n"; 2083 exit -1; 2084 } 2085 $value = oct($value) if $value =~ /^0x/i; 2086 2087 return $value; 2088 } 2089 2076 2090 sub parse_not_to_scan 2077 2091 { … … 2081 2095 my $range; 2082 2096 foreach $range (@ranges) { 2083 my ($start, $end) = split /\s*-s*/, $range;2084 $start = oct $start if $start =~ /^0/;2097 my ($start, $end) = split /\s*-\s*/, $range; 2098 $start = valid_address($start); 2085 2099 if (defined $end) { 2086 $end = oct $end if $end =~ /^0/; 2100 $end = valid_address($end); 2101 if ($end <= $start) { 2102 print "$start-$end is not a valid range, sorry.\n"; 2103 exit -1; 2104 } 2087 2105 $start = $min if $start < $min; 2088 2106 $end = $max if $end > $max; 2089 push @res, ($start +0..$end+0);2107 push @res, ($start..$end); 2090 2108 } else { 2091 push @res, $start +0if $start >= $min and $start <= $max;2109 push @res, $start if $start >= $min and $start <= $max; 2092 2110 } 2093 2111 } … … 3042 3060 foreach $addr (@{$i2c_addresses_to_scan}) { 3043 3061 # As the not_to_scan list is sorted, we can check it fast 3062 shift @not_to_scan # User skipped an address which we didn't intend to probe anyway 3063 while (@not_to_scan and $not_to_scan[0] < $addr); 3044 3064 if (@not_to_scan and $not_to_scan[0] == $addr) { 3045 3065 shift @not_to_scan; … … 5676 5696 $inp2 = <STDIN>; 5677 5697 chop $inp2; 5678 @not_to_scan = parse_not_to_scan 0,0x7f,$inp2;5698 @not_to_scan = parse_not_to_scan(0x03, 0x77, $inp2); 5679 5699 } 5680 5700 scan_adapter $dev_nr, $adap, $i2c_adapters[$dev_nr]->{'driver'},
