2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

Add support for Shuttle eeproms.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2321 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2004-02-28 16:57:34 +00:00
parent 1288153498
commit dce540bec8
3 changed files with 55 additions and 0 deletions

View File

@@ -2839,6 +2839,8 @@ void print_ddcmon(const sensors_chip_name *name)
* (Khali, 2003-08-09) Rewrote Sony Vaio EEPROMs detection, and move it
* to the top. This should prevent such EEPROMs from being accidentally
* detected as valid memory modules.
* (Khali, 2004-02-23) Add support for Shuttle EEPROMs, which contain
* MAC ethernet addresses.
*/
void print_eeprom(const sensors_chip_name *name)
{
@@ -2888,6 +2890,37 @@ void print_eeprom(const sensors_chip_name *name)
free_the_label(&label);
}
/* then Shuttle EEPROMs */
if (name->addr == 0x53) {
unsigned char buffer[6];
/* first make sure it is a Shuttle EEPROM */
if (!sensors_get_label_and_valid(*name, SENSORS_EEPROM_SHUTTLE, &label, &valid)
&& valid) {
for (i = 0; i < 3; i++)
if (!sensors_get_feature(*name, SENSORS_EEPROM_SHUTTLE+i, &a))
buffer[i] = (unsigned char) a;
if (buffer[0] == 0x00
&& buffer[1] == 0x30
&& buffer[2] == 0x1b)
{
/* must be a real Shuttle EEPROM */
for (i = 4; i < 6; i++)
if (!sensors_get_feature(*name, SENSORS_EEPROM_SHUTTLE+i, &a))
buffer[i] = (unsigned char) a;
print_label(label, 24);
printf("%02X:%02X:%02X:%02X:%02X:%02X\n", buffer[0],
buffer[1], buffer[2], buffer[3], buffer[4], buffer[5]);
free_the_label(&label);
return;
}
} else
printf("ERROR: data Shuttle\n");
free_the_label(&label);
}
if (!sensors_get_label_and_valid(*name, SENSORS_EEPROM_TYPE, &label, &valid)
&& !sensors_get_feature(*name, SENSORS_EEPROM_TYPE, &a)) {
if (valid) {