aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-03-02 22:37:51 +0100
committerMichael S. Tsirkin <mst@redhat.com>2010-03-03 13:34:04 +0200
commitb1e87018f24cc4c5aac8f448efe6bf616163bf4e (patch)
treef25a008fce8146dca47888c369ae21d88c7cf222 /hw
parentc5bac30252cc06d226bb7d57e40cdee5a532a4c8 (diff)
eepro100: Use symbolic names for bits in EEPROM id
V2 - Use UPPER_CASE for enum values Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/eepro100.c17
1 files changed, 16 insertions, 1 deletions
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;