Go to the documentation of this file.
18 #ifndef __SERVER_NETWORK_SUN8I_SUN8IEMAC_H
19 #define __SERVER_NETWORK_SUN8I_SUN8IEMAC_H
21 #include <FreeNOS/System.h>
Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets > m_transmitPending
List of pointers to packets pending transmission.
Memory::Range m_receiveDescRange
Memory range for receive descriptors.
virtual FileSystem::Result transmit(NetworkQueue::Packet *pkt)
Add a network packet to the transmit queue.
@ TransmitCtl0
< Interrupt Enable
MiiRegisters
Registers provided by the PHY on the Media-Independent-Interface (MII)
@ TransmitStatus
< MAC Address Low
Input/Output operations specific to the ARM architecture.
Network Device abstract class.
TransmitCtl0Flags
Flags for the Transmit Control 0 register.
@ BasicCtl1
< Basic Control 0
@ ReceiveStatus
< Transmit Current Buffer
Transmit/receive frame descriptor.
static const Address MemoryAddress
Physical memory address of the device memory mapped registers.
@ ReceiveHash0
< Receive Frame Filter
Index is a N-sized array of pointers to items of type T.
@ TransmitDescList
< Transmit Flow Control
unsigned long Address
A memory address.
@ TransmitCtl1
< Transmit Control 0
MiiAdvFlags
Flags in the Mii Advertised abilities register.
Size m_transmitIndex
Current transmit packet index.
Size m_receiveIndex
Current receive packet index.
@ ReceiveCtl0
< Transmit Descriptor List Address
Registers
Hardware registers.
BasicCtl1Flags
Flags for the Basic Control 1 register.
Sun8iEmac(const u32 inode, NetworkServer &server)
Constructor.
Network device of the Allwinner Sun8i family System-on-Chips.
@ MiiData
< Management Interface Command
Memory::Range m_transmitDescRange
Memory range for transmit descriptors.
void printRx()
Print diagnostic information about the receive queue (RX)
FileSystem::Result receive()
Receive packets.
void printTx()
Print diagnostic information about the transmit queue (TX)
Ethernet network address.
Index< FrameDescriptor, NetworkQueue::MaxPackets > m_transmitDesc
List of pointers to transmit descriptors.
Allwinner System Control (SYSCON) module.
@ IntEnable
< Interrupt Status
ReceiveCtl1Flags
Flags for the Receive Control 1 register.
bool miiBusyWait() const
Wait until the PHY comes out of busy state.
virtual FileSystem::Result interrupt(const Size vector)
Called when an interrupt has been triggered for this device.
@ ReceiveHash1
< Receive Hash Table 0
@ MiiRegAdv
< Identifier Low
FileSystem::Result resetPhy()
Reset the PHY connected to the MAC controller.
BasicCtl0Flags
Flags for the Basic Control 0 register.
SunxiClockControl m_ccu
Clock Control Unit.
@ TransmitCurDesc
< Transmit DMA Status
Allwinner Clock Control Unit (CCU)
@ RgmiiStatus
< Receive Current Buffer
@ ReceiveDescList
< Receive Control 1
@ ReceiveCurDesc
< Receive DMA Status
unsigned int u32
Unsigned 32-bit number.
MiiStatusFlags
Flags in the Mii Status register.
unsigned int Size
Any sane size indicator cannot go negative.
u32 miiRead(const u8 phyAddr, const u8 regAddr)
Read a Media-Independent-Interface (MII) register on the PHY.
TransmitCtl1Flags
Flags for the Transmit Control 1 register.
ReceiveCtl0Flags
Flags for the Receive Control 0 register.
SunxiSystemControl m_syscon
System Control Unit.
@ MiiRegIdLow
< Identifier High
@ ReceiveFrmFilter
< Receive Descriptor List Address
virtual FileSystem::Result initialize()
Initialize the device.
static const Size MaximumResetPoll
Maximum number of polling reset iterations.
@ AddrLow
< MAC Address High
MiiCmdFlags
Flags for Media-Independent-Interface (MII) Command register.
FileSystem::Result configPhy()
Configure the PHY connected to the MAC controller.
@ ReceiveCurBuf
< Receive Current Descriptor
Arch::IO m_io
Memory mapped registers.
IntStatusFlags
Flags for the Interrupt Status register.
virtual FileSystem::Result startDMA()
Start DMA processing.
static const u8 PhyMdioAddress
Fixed address of the PHY on the MDIO bus.
Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets > m_transmitPackets
List of pointers to packets that the driver has submitted for transmission.
MiiControlFlags
Flags in the Mii Control register.
virtual FileSystem::Result getAddress(Ethernet::Address *address)
Read ethernet address.
Result
Result code for filesystem Actions.
unsigned char u8
Unsigned 8-bit number.
@ AddrHigh
< Management Interface Data
static const Size InterruptNumber
Interrupt number for this device on a sun8i family SoC.
@ MiiRegLink
< Advertised abilities
FrameDescriptorFlags
Flags for frame descriptors.
Index< NetworkQueue::Packet, NetworkQueue::MaxPackets > m_receivePackets
List of pointers to receive packets.
static const Size MaximumMiiPoll
Maximum number of polling reads for MII-busy flag.
@ IntStatus
< Basic Control 1
@ TransmitCurBuf
< Transmit Current Descriptor
@ ReceiveCtl1
< Receive Control 0
Represents a network packet.
FileSystem::Result resetReceive()
Reset receive control functions.
IntEnableFlags
Flags for the Interrupt Enable register.
FileSystem::Result reset()
Reset the controller.
Index< FrameDescriptor, NetworkQueue::MaxPackets > m_receiveDesc
List of pointers to receive descriptors.
void miiWrite(const u8 phyAddr, const u8 regAddr, const u32 data)
Write a Media-Independent-Interface (MII) register on the PHY.
virtual ~Sun8iEmac()
Destructor.
FileSystem::Result resetTransmit()
Reset transmit control functions.
@ MiiCmd
< Receive Hash Table 1
@ TransmitFlowCtl
< Transmit Control 1
virtual FileSystem::Result setAddress(const Ethernet::Address *address)
Set ethernet address.