diff options
author | Benjamin Nash <benash@umich.edu> | 2005-08-12 18:30:35 -0400 |
---|---|---|
committer | Benjamin Nash <benash@umich.edu> | 2005-08-12 18:30:35 -0400 |
commit | 49063eb24f8fd2ad010224cc282c55dd5471dd65 (patch) | |
tree | 96595b8b1b650696467c87c6be08e1eaf18f47ca /dev/ns_gige.hh | |
parent | a115249eb07f6e3c9666bf408e214fcd38a665fb (diff) | |
download | gem5-49063eb24f8fd2ad010224cc282c55dd5471dd65.tar.xz |
Improve FreeBSD networking support.
dev/ns_gige.cc:
Added FreeBSD support. Required additional register read/write functionality, hash filtering (faked), and EEPROM read access.
dev/ns_gige.hh:
Added constants and variables for FreeBSD support. Also created eepromKick() to advance state machine.
dev/ns_gige_reg.h:
Defined additional register bit fields.
dev/pcidev.cc:
Fix &= typo.
dev/sinic.cc:
Remove an INIT_PARAM_DFLT macro.
dev/tsunami_io.cc:
Fix DPRINTF typo.
kern/freebsd/freebsd_system.cc:
Edit comments.
--HG--
extra : convert_revision : 37aaa1303d57d3784381e85acb3bc1743adeb8c0
Diffstat (limited to 'dev/ns_gige.hh')
-rw-r--r-- | dev/ns_gige.hh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dev/ns_gige.hh b/dev/ns_gige.hh index 67f1b7ef5..b6554e5d6 100644 --- a/dev/ns_gige.hh +++ b/dev/ns_gige.hh @@ -45,6 +45,17 @@ #include "mem/bus/bus.hh" #include "sim/eventq.hh" +// Hash filtering constants +const uint16_t FHASH_ADDR = 0x100; +const uint16_t FHASH_SIZE = 0x100; + +// EEPROM constants +const uint8_t EEPROM_READ = 0x2; +const uint8_t EEPROM_SIZE = 64; // Size in words of NSC93C46 EEPROM +const uint8_t EEPROM_PMATCH2_ADDR = 0xA; // EEPROM Address of PMATCH word 2 +const uint8_t EEPROM_PMATCH1_ADDR = 0xB; // EEPROM Address of PMATCH word 1 +const uint8_t EEPROM_PMATCH0_ADDR = 0xC; // EEPROM Address of PMATCH word 0 + /** * Ethernet device registers */ @@ -69,6 +80,8 @@ struct dp_regs { uint32_t pcr; uint32_t rfcr; uint32_t rfdr; + uint32_t brar; + uint32_t brdr; uint32_t srr; uint32_t mibc; uint32_t vrcr; @@ -89,6 +102,12 @@ struct dp_rom { * the linux driver doesn't use any other ROM */ uint8_t perfectMatch[ETH_ADDR_LEN]; + + /** + * for hash table memory. + * used by the freebsd driver + */ + uint8_t filterHash[FHASH_SIZE]; }; class NSGigEInt; @@ -137,6 +156,15 @@ class NSGigE : public PciDev dmaWriteWaiting }; + /** EEPROM State Machine States */ + enum EEPROMState + { + eepromStart, + eepromGetOpcode, + eepromGetAddress, + eepromRead + }; + private: Addr addr; static const Addr size = sizeof(dp_regs); @@ -211,6 +239,14 @@ class NSGigE : public PciDev bool extstsEnable; + /** EEPROM State Machine */ + EEPROMState eepromState; + bool eepromClk; + uint8_t eepromBitsToRx; + uint8_t eepromOpcode; + uint8_t eepromAddress; + uint16_t eepromData; + protected: Tick dmaReadDelay; Tick dmaWriteDelay; @@ -274,6 +310,8 @@ class NSGigE : public PciDev friend void TxKickEvent::process(); TxKickEvent txKickEvent; + void eepromKick(); + /** * Retransmit event */ @@ -301,6 +339,7 @@ class NSGigE : public PciDev bool acceptUnicast; bool acceptPerfect; bool acceptArp; + bool multicastHashEnable; PhysicalMemory *physmem; |