Changeset 5031

Show
Ignore:
Timestamp:
11/19/07 23:27:47 (1 year ago)
Author:
khali
Message:

The model name is actually the first half of the asset tag.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r5030 r5031  
    1111                           Update manufacturer IDs. 
    1212  Program decode-vaio.pl: Private data might not be readable by non-root users 
     13                          Print the asset tag 
    1314  Program pwmconfig: Better diagnostics in pwmdisable 
    1415                     Give the fans some time to spin up 
  • lm-sensors/trunk/prog/eeprom/decode-vaio.pl

    r5030 r5031  
    4646# Version 1.5  2007-11-19  Jean Delvare <khali@linux-fr.org> 
    4747#  UUID and serial number might be hidden 
     48#  The model name is actually the first half of the asset tag 
    4849# 
    4950# EEPROM data decoding for Sony Vaio laptops.  
     
    164165} 
    165166 
     167sub decode_hexa 
     168{ 
     169        my ($bus, $addr, $offset, $length) = @_; 
     170 
     171        my @bytes = unpack('C*', read_eeprom_bytes($bus, $addr, $offset, $length)); 
     172        my $string=''; 
     173 
     174        for(my $i=0;$i<$length;$i++) 
     175        { 
     176                $string.=sprintf('%02X', shift(@bytes)); 
     177        } 
     178 
     179        return($string); 
     180} 
     181 
    166182sub decode_uuid 
    167183{ 
     
    205221        print_item(length($revision) > 2 ? 'Service Tag' : 'Revision', 
    206222                   $revision); 
    207         print_item('Model Name', 'PCG-'.decode_string($bus, $addr, 170, 4)); 
     223        print_item('Asset Tag', decode_string($bus, $addr, 170, 4). 
     224                                decode_hexa($bus, $addr, 174, 12)); 
    208225        print_item('OEM Data', decode_string($bus, $addr, 32, 16)); 
    209226        print_item('Timestamp', decode_string($bus, $addr, 224, 32));