Changeset 5027

Show
Ignore:
Timestamp:
11/19/07 23:21:04 (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
  • i2c-tools/trunk/CHANGES

    r5026 r5027  
    66                Update manufacturer IDs. 
    77  decode-vaio: Private data might not be readable by non-root users 
     8               Print the asset tag 
    89  i2cset: Final status messages go to stdout 
    910          Return success even when readback fails or doesn't match 
  • i2c-tools/trunk/eeprom/decode-vaio.pl

    r5026 r5027  
    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));