|
The Pedigree Project 0.1
|
#include <3Com90x.h>
Inheritance diagram for Nic3C90x:
Collaboration diagram for Nic3C90x:Classes | |
| struct | RXD |
| struct | TXD |
Public Member Functions | |
| Nic3C90x (Network *pDev) | |
| virtual void | getName (String &str) |
| virtual bool | send (size_t nBytes, uintptr_t buffer) |
| virtual bool | setStationInfo (const StationInfo &info) |
| virtual const StationInfo & | getStationInfo () |
| bool | isInitialised () const |
| virtual IrqDisposition | irq (irq_id_t number) |
Public Member Functions inherited from Network | |
| Network (Network *pDev) | |
| virtual Type | getType () |
| virtual void | dump (String &str) |
| virtual bool | isConnected () |
| virtual void | gotPacket () |
| virtual void | droppedPacket () |
| Called when a packet is dropped by the system. | |
| virtual void | badPacket () |
Public Member Functions inherited from Device | |
| Device (Device *p) | |
| Device * | getParent () const |
| void | setParent (Device *p) |
| virtual const String & | getSpecificType () |
| virtual void | setSpecificType (String str) |
| void | setPciPosition (uint32_t bus, uint32_t device, uint32_t func) |
| void | setPciIdentifiers (uint8_t classCode, uint8_t subclassCode, uint16_t vendorId, uint16_t deviceId, uint8_t progIf) |
| void | setPciConfigHeader (const PciBus::ConfigSpace &space) |
| PciBus::ConfigSpace | getPciConfigHeader () const |
| uint8_t | getPciClassCode () |
| uint8_t | getPciSubclassCode () |
| uint16_t | getPciVendorId () |
| uint16_t | getPciDeviceId () |
| uint8_t | getPciProgInterface () |
| uint32_t | getPciBusPosition () |
| uint32_t | getPciDevicePosition () |
| uint32_t | getPciFunctionNumber () |
| Device * | getPhysicalFunction () const |
| size_t | getVirtualFunctionIndex () const |
| void | setVirtualFunction (Device *physicalFunction, size_t index) |
| virtual Vector< Address * > & | addresses () |
| virtual uintptr_t | getInterruptNumber () |
| virtual void | setInterruptNumber (uintptr_t n) |
| void | addChild (Device *pDevice) |
| Device * | getChild (size_t n) |
| size_t | getNumChildren () |
| void | removeChild (size_t n) |
| void | removeChild (Device *d) |
| void | replaceChild (Device *src, Device *dest) |
Public Member Functions inherited from IrqHandler | |
| virtual bool | acceptsSpuriousInterrupts () const |
Public Attributes | |
| IoBase * | m_pBase |
Private Member Functions | |
| bool | issueCommand (int cmd, int param) |
| int | setWindow (int window) |
| bool | waitForEepromReady () |
| bool | readEeprom (int address, uint16_t &value) |
| int | writeEepromWord (int address, uint16_t value) |
| int | writeEeprom (int address, uint16_t value) |
| bool | reset () |
| bool | quiesce () |
| bool | stopDeviceLocked () |
| struct Nic3C90x::TXD | __attribute__ ((aligned(8))) |
| struct Nic3C90x::RXD | __attribute__ ((aligned(8))) |
| Nic3C90x (const Nic3C90x &) | |
| void | operator= (const Nic3C90x &) |
Private Attributes | |
| uint8_t | m_isBrev |
| uint8_t | m_CurrentWindow |
| uint8_t * | m_pRxBuffVirt |
| uint8_t * | m_pTxBuffVirt |
| uintptr_t | m_pRxBuffPhys |
| uintptr_t | m_pTxBuffPhys |
| MemoryRegion | m_RxBuffMR |
| MemoryRegion | m_TxBuffMR |
| uintptr_t | m_pDPD |
| MemoryRegion | m_DPDMR |
| uintptr_t | m_pUPD |
| MemoryRegion | m_UPDMR |
| TXD * | m_TransmitDPD |
| RXD * | m_ReceiveUPD |
| uint8_t | m_ReceiveStaging [NUM_UPDS *ReceiveSlotSize] |
| Semaphore | m_TxMutex |
| Mutex | m_DeviceLock |
| Mutex | m_SendLock |
| size_t | m_RxConsumerIndex |
| irq_id_t | m_IrqId |
| bool | m_Active |
| bool | m_Stopping |
| bool | m_TxSuccessful |
| bool | m_Initialised |
Static Private Attributes | |
| static constexpr size_t | ReceiveSlotSize = 1536 |
Additional Inherited Members | |
Public Types inherited from Device | |
| enum | Type { Generic , Root , Disk , Bus , Display , Network , Sound , Console , Mouse , Controller , UsbController , UsbGeneric , UsbContainer } |
| typedef Device *(* | Callback) (Device *) |
Static Public Member Functions inherited from Network | |
| static EXPORTED_PUBLIC uint32_t | convertToIpv4 (uint8_t a, uint8_t b, uint8_t c, uint8_t d) |
| static EXPORTED_PUBLIC IpAddress | convertToIpv6 (uint8_t a, uint8_t b=0, uint8_t c=0, uint8_t d=0, uint8_t e=0, uint8_t f=0, uint8_t g=0, uint8_t h=0, uint8_t i=0, uint8_t j=0, uint8_t k=0, uint8_t l=0, uint8_t m=0, uint8_t n=0, uint8_t o=0, uint8_t p=0) |
| static EXPORTED_PUBLIC uint16_t | calculateChecksum (uintptr_t buffer, size_t nBytes) |
Static Public Member Functions inherited from Device | |
| static bool | treeLockHeldByCurrentThread () |
| static void | foreach (Callback callback, Device *root=0) |
| template<class F , class... Args> | |
| static void | foreach (pedigree_std::Callable< F > &callback, Device *root, Args... args) |
| static void | addToRoot (Device *device) |
| static void | searchByVendorId (uint16_t vendorId, void(*callback)(Device *), Device *root=0) |
| static void | searchByVendorIdAndDeviceId (uint16_t vendorId, uint16_t deviceId, void(*callback)(Device *), Device *root=0) |
| static void | searchByClass (uint16_t classCode, void(*callback)(Device *), Device *root=0) |
| static void | searchByClassAndSubclass (uint16_t classCode, uint16_t subclassCode, void(*callback)(Device *), Device *root=0) |
| static void | searchByClassSubclassAndProgInterface (uint16_t classCode, uint16_t subclassCode, uint8_t progInterface, void(*callback)(Device *), Device *root=0) |
Protected Member Functions inherited from Device | |
| NOT_COPYABLE_OR_ASSIGNABLE (Device) | |
Protected Member Functions inherited from IrqHandler | |
| virtual | ~IrqHandler () |
Protected Member Functions inherited from IrqHandlerBase | |
| virtual | ~IrqHandlerBase () |
Static Protected Member Functions inherited from Device | |
| static Device & | root () |
Protected Attributes inherited from Network | |
| StationInfo | m_StationInfo |
Protected Attributes inherited from Device | |
| Vector< Address * > | m_Addresses |
| Vector< Device * > | m_Children |
| Device * | m_pParent |
| Device * | m_PhysicalFunction |
| size_t | m_VirtualFunctionIndex |
| uintptr_t | m_InterruptNumber |
| String | m_SpecificType |
| PciBus::ConfigSpace | m_ConfigHeader |
| uint8_t | m_ClassCode |
| uint8_t | m_SubclassCode |
| uint16_t | m_VendorId |
| uint16_t | m_DeviceId |
| uint8_t | m_ProgInterface |
| uint32_t | m_PciBusPos |
| uint32_t | m_PciDevicePos |
| uint32_t | m_PciFunctionNum |
Static Protected Attributes inherited from Device | |
| static Device | m_Root |
| static Mutex | m_TreeLock |
| Nic3C90x::Nic3C90x | ( | Network * | pDev | ) |
10 Base TPO
10/100 T4
10/100 TPO
10 Base Combo
10 Base TPO
10 Base Combo
10 Base TPO and Base2
10 Base FL
10/100 TPO
10/100 T4
10 Base FX
Load EEPROM contents
Get the hardware address
Program the MAC address into the station address registers
Read the media options register, print a message and set default xcvr.
Uses Media Option command on B revision, Reset Option on non-B revision cards – same register address
mask out VCO bit that is defined as 10 base FL bit on B-rev cards
Determine transceiver type to use, depending on value stored in eeprom 0x16
Enable DC converter for 10-BASE-T
Set the link to the type we just determined
Now that we've set the xcvr type, reset TX and RX, re-enable
reset of the receiver on B-revision cards re-negotiates the link takes several seconds
Set the RX filter = receive only individual packets & multicast & broadcast
Configure indications but leave the physical source gated.
Definition at line 433 of file 3Com90x.cc.
References PhysicalMemoryManager::allocateRegion(), NetworkStack::deRegisterDevice(), NetworkStack::instance(), PhysicalMemoryManager::instance(), issueCommand(), Device::m_Addresses, m_isBrev, MemoryRegion::physicalAddress(), IoBase::read16(), IoBase::read32(), readEeprom(), NetworkStack::registerDevice(), IrqManager::registerPciIrqHandler(), reset(), Device::setSpecificType(), setWindow(), MemoryRegion::virtualAddress(), VirtualAddressSpace::Write, IoBase::write16(), IoBase::write32(), IoBase::write8(), and writeEeprom().
| Nic3C90x::~Nic3C90x | ( | ) |
Definition at line 764 of file 3Com90x.cc.
|
inlinevirtual |
|
virtual |
Gets station information (such as IP addresses)
Reimplemented from Network.
Definition at line 974 of file 3Com90x.cc.
|
virtual |
Handles a pending IRQ in thread context.
Implements IrqHandler.
Definition at line 786 of file 3Com90x.cc.
References NetworkStack::instance(), issueCommand(), Quiesced, IoBase::read16(), IoBase::read8(), NetworkStack::receive(), Semaphore::release(), IoBase::write32(), and IoBase::write8().
|
private |
Build the cmd.
Send the cmd to the cmd register
Wait for the cmd to complete, if necessary
Definition at line 95 of file 3Com90x.cc.
References Hex, IoBase::read16(), and IoBase::write16().
Referenced by irq(), Nic3C90x(), reset(), send(), and setWindow().
Here is the caller graph for this function:
|
private |
Definition at line 314 of file 3Com90x.cc.
|
private |
Select correct window
Make sure the eeprom isn't busy
Read the value
Definition at line 158 of file 3Com90x.cc.
References IoBase::read16(), setWindow(), and IoBase::write16().
Referenced by Nic3C90x(), and writeEeprom().
Here is the caller graph for this function:
|
private |
Send the reset command to the card
Global reset command resets station mask, non-B revision cards require explicit reset of values
Issue transmit reset, wait for command completion
Reset of the receiver on B-revision cards re-negotiates the link Takes several seconds
Configure indications but leave the physical source gated.
Definition at line 242 of file 3Com90x.cc.
References issueCommand(), m_isBrev, IoBase::read32(), setWindow(), IoBase::write16(), IoBase::write32(), and IoBase::write8().
Referenced by Nic3C90x().
Here is the caller graph for this function:
|
virtual |
Sends a given packet through the device.
| nBytes | The number of bytes to send. |
| buffer | A buffer with the packet to send |
Stall the download engine
Setup the DPD (download descriptor)
Set notification for transmission complete (bit 15)
Send the packet
End Stall and Wait for upload to complete.
Implements Network.
Definition at line 347 of file 3Com90x.cc.
References Semaphore::acquireForCompletion(), Dec, Semaphore::drainAvailable(), Hex, issueCommand(), IoBase::read32(), and IoBase::write32().
|
virtual |
Sets station information (such as IP addresses)
| info | The information to set as the station info |
Reimplemented from Network.
Definition at line 947 of file 3Com90x.cc.
References Dec, StationInfo::gateway, Hex, and StationInfo::nDnsServers.
|
private |
Window already as set?
Issue the window command
Definition at line 132 of file 3Com90x.cc.
References issueCommand().
Referenced by Nic3C90x(), readEeprom(), reset(), and writeEepromWord().
Here is the caller graph for this function:
|
private |
Definition at line 331 of file 3Com90x.cc.
|
private |
Definition at line 145 of file 3Com90x.cc.
|
private |
Write the value.
Recompute the checksum
Write the checksum to the location in the eeprom
Definition at line 209 of file 3Com90x.cc.
References m_isBrev, readEeprom(), and writeEepromWord().
Referenced by Nic3C90x().
Here is the caller graph for this function:
|
private |
Select register window
Verify Eeprom not busy
Issue WriteEnable, and wait for completion
Issue EraseReigster, and wait for completion
Send the new data to the eeprom, and wait for completion
Burn the new data into the eeprom, and wait for completion
Definition at line 176 of file 3Com90x.cc.
References setWindow(), and IoBase::write16().
Referenced by writeEeprom().
Here is the caller graph for this function:
|
private |
|
private |
Local NIC information
Definition at line 80 of file 3Com90x.h.
Referenced by Nic3C90x(), reset(), and writeEeprom().
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |