Browse Source

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

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5027 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.1
Jean Delvare 18 years ago
parent
commit
16a99f4b96
  1. 1
      CHANGES
  2. 19
      eeprom/decode-vaio.pl

1
CHANGES

@ -5,6 +5,7 @@ SVN
decode-dimms: Fix DDR2 SDRAM module speed decoding decode-dimms: Fix DDR2 SDRAM module speed decoding
Update manufacturer IDs. Update manufacturer IDs.
decode-vaio: Private data might not be readable by non-root users decode-vaio: Private data might not be readable by non-root users
Print the asset tag
i2cset: Final status messages go to stdout i2cset: Final status messages go to stdout
Return success even when readback fails or doesn't match Return success even when readback fails or doesn't match
i2c-stub-from-dump: New helper script to use with i2c-stub i2c-stub-from-dump: New helper script to use with i2c-stub

19
eeprom/decode-vaio.pl

@ -45,6 +45,7 @@
# Detect and skip false positives (e.g. EDID EEPROMs). # Detect and skip false positives (e.g. EDID EEPROMs).
# Version 1.5 2007-11-19 Jean Delvare <khali@linux-fr.org> # Version 1.5 2007-11-19 Jean Delvare <khali@linux-fr.org>
# UUID and serial number might be hidden # UUID and serial number might be hidden
# The model name is actually the first half of the asset tag
# #
# EEPROM data decoding for Sony Vaio laptops. # EEPROM data decoding for Sony Vaio laptops.
# #
@ -163,6 +164,21 @@ sub decode_string
return($string); return($string);
} }
sub decode_hexa
{
my ($bus, $addr, $offset, $length) = @_;
my @bytes = unpack('C*', read_eeprom_bytes($bus, $addr, $offset, $length));
my $string='';
for(my $i=0;$i<$length;$i++)
{
$string.=sprintf('%02X', shift(@bytes));
}
return($string);
}
sub decode_uuid sub decode_uuid
{ {
my ($bus,$addr,$base) = @_; my ($bus,$addr,$base) = @_;
@ -204,7 +220,8 @@ sub vaio_decode
my $revision = decode_string($bus, $addr, 160, 10); my $revision = decode_string($bus, $addr, 160, 10);
print_item(length($revision) > 2 ? 'Service Tag' : 'Revision', print_item(length($revision) > 2 ? 'Service Tag' : 'Revision',
$revision); $revision);
print_item('Model Name', 'PCG-'.decode_string($bus, $addr, 170, 4));
print_item('Asset Tag', decode_string($bus, $addr, 170, 4).
decode_hexa($bus, $addr, 174, 12));
print_item('OEM Data', decode_string($bus, $addr, 32, 16)); print_item('OEM Data', decode_string($bus, $addr, 32, 16));
print_item('Timestamp', decode_string($bus, $addr, 224, 32)); print_item('Timestamp', decode_string($bus, $addr, 224, 32));
return 1; return 1;

Loading…
Cancel
Save