You can really just write the entire dump nekonoko posted into any card. The serial number (SN) in there has no practical use. The start of the VPD section is apparently always 0x100 (= 256 dec). I've used the following script to call ethtool, hexsgivpd contains just the hex values, preceded by exactly one space each, as shown in the example below. Everything after byte 48 (the clear text part) is ignored. To actually execute this, remove the echo before ethtool.
If you really think you have to adjust the serial number or anything else, you should fix the checksum as well. The checksum is called RV and besides the checksum istself, it is apparently used to pad the VPD to 96 bytes, so that you'll have to adjust the length of the RV field as well if you delete or add anything. The checksum itself is in the first payload byte, i.e. the second byte after RV, the first being the length. The checksum does not cover the clear text name of the device (e.g. "SGI Gigabit Ethernet Controller"), but everything after that, including the RV itself. The sum of all the bytes covered modulo 256 should be 0x00. I've used the shell code below to compute the checksum over the hexdump, this time just hex bytes with one space, no linebreaks etc.
The original contents of the vpd of my HP NC7770 was:
I doubt that upgrading the firmware will make any difference at all, most of the eeprom is just a PC Bios boot rom, and I'm certain that the irix driver brings along its own copy that matches the driver. The firmware itself is tiny, the largest for the tg3 driver in linux is less that 2000 bytes long.
Code: Select all
#!/bin/bash
o=256;
for i in `cat hexsgivpd | cut -b 1-48 `; do
echo ethtool -E eth2 magic 0x669955aa offset 0x`(echo obase=16; echo $o) | bc` value 0x$i;
o=$[ $o + 1 ];
done
Code: Select all
82 20 00 53 47 49 20 47 69 67 61 62 69 74 20 45 . .SGI Gigabit E
74 68 65 72 6E 65 74 20 43 6F 6E 74 72 6F 6C 6C thernet Controll
65 72 00 90 5A 00 50 4E 07 39 32 31 30 32 38 39 er..Z.PN.9210289
45 43 04 30 30 30 32 53 4E 0A 57 45 43 52 46 46 EC.0002SN.WECRFF
36 41 38 39 4D 4E 04 31 30 42 37 52 56 32 78 00 6A89MN.10B7RV2x.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
If you really think you have to adjust the serial number or anything else, you should fix the checksum as well. The checksum is called RV and besides the checksum istself, it is apparently used to pad the VPD to 96 bytes, so that you'll have to adjust the length of the RV field as well if you delete or add anything. The checksum itself is in the first payload byte, i.e. the second byte after RV, the first being the length. The checksum does not cover the clear text name of the device (e.g. "SGI Gigabit Ethernet Controller"), but everything after that, including the RV itself. The sum of all the bytes covered modulo 256 should be 0x00. I've used the shell code below to compute the checksum over the hexdump, this time just hex bytes with one space, no linebreaks etc.
Code: Select all
( echo obase=16
echo ibase=16
echo \(00 `cat hexsgi | cut -b 1-$[3*16] `\)%100 | sed -e 's/ /+/g' | tr a-z A-Z ) | bc
Code: Select all
00000100 82 21 00 48 50 20 4e 43 37 37 37 30 20 47 69 67 |.!.HP NC7770 Gig|
00000110 61 62 69 74 20 53 65 72 76 65 72 20 41 64 61 70 |abit Server Adap|
00000120 74 65 72 00 90 59 00 50 4e 0a 32 38 34 36 38 35 |ter..Y.PN.284685|
00000130 2d 30 30 33 45 43 02 30 47 53 4e 0a 57 45 43 52 |-003EC.0GSN.WECR|
00000140 46 46 36 41 38 39 4d 4e 04 30 45 31 31 52 56 30 |FF6A89MN.0E11RV0|
00000150 cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|