From b1e87018f24cc4c5aac8f448efe6bf616163bf4e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 2 Mar 2010 22:37:51 +0100 Subject: [PATCH] eepro100: Use symbolic names for bits in EEPROM id V2 - Use UPPER_CASE for enum values Signed-off-by: Stefan Weil Signed-off-by: Michael S. Tsirkin --- hw/eepro100.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index c2ff569e54..2a871b8264 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -272,6 +272,21 @@ typedef enum { EEPROM_SMBUS_ADDR = 0x90, } EEPROMOffset; +/* Bit values for EEPROM ID word. */ +typedef enum { + EEPROM_ID_MDM = BIT(0), /* Modem */ + EEPROM_ID_STB = BIT(1), /* Standby Enable */ + EEPROM_ID_WMR = BIT(2), /* ??? */ + EEPROM_ID_WOL = BIT(5), /* Wake on LAN */ + EEPROM_ID_DPD = BIT(6), /* Deep Power Down */ + EEPROM_ID_ALT = BIT(7), /* */ + /* BITS(10, 8) device revision */ + EEPROM_ID_BD = BIT(11), /* boot disable */ + EEPROM_ID_ID = BIT(13), /* id bit */ + /* BITS(15, 14) signature */ + EEPROM_ID_VALID = BIT(14), /* signature for valid eeprom */ +} eeprom_id_bit; + /* Default values for MDI (PHY) registers */ static const uint16_t eepro100_mdi_default[] = { /* MDI Registers 0 - 6, 7 */ @@ -643,7 +658,7 @@ static void nic_selective_reset(EEPRO100State * s) uint16_t *eeprom_contents = eeprom93xx_data(s->eeprom); //~ eeprom93xx_reset(s->eeprom); memcpy(eeprom_contents, s->conf.macaddr.a, 6); - eeprom_contents[EEPROM_ID] = 0x4000; + eeprom_contents[EEPROM_ID] = EEPROM_ID_VALID; if (s->device == i82557B || s->device == i82557C) eeprom_contents[5] = 0x0100; eeprom_contents[EEPROM_PHY_ID] = 1; -- 2.11.4.GIT