|
OpenNet
|
This class defines the hardware interface. More...
#include <Hardware.h>
Public Member Functions | |
| void * | operator new (size_t aSize_byte, void *aAddress) |
| new operator without allocation More... | |
| unsigned int | GetCommonBufferSize () const |
| Retrieve the common buffer size. More... | |
| unsigned int | GetPacketSize () const |
| Retrieve the configured maximum packet size. More... | |
| virtual void | GetState (Adapter_State *aState)=0 |
| Retrieve the current state. More... | |
| virtual void | ResetMemory () |
| Reset all memory regions. More... | |
| virtual void | SetAdapter (Adapter *aAdapter) |
| Connect the adapter. More... | |
| virtual void | SetCommonBuffer (uint64_t aCommon_PA, void *aCommon_CA) |
| Set the common buffer. More... | |
| virtual void | SetConfig (const Adapter_Config &aConfig) |
| Set the configuation. More... | |
| virtual bool | SetMemory (unsigned int aIndex, void *aMemory_MA, unsigned int aSize_byte) |
| Set a memory region. More... | |
| virtual void | D0_Entry () |
| Enter the D0 state. More... | |
| virtual bool | D0_Exit () |
| Exit the D0 state. More... | |
| virtual void | Interrupt_Disable () |
| Disable the interrupts. More... | |
| virtual void | Interrupt_Enable () |
| Enable the interrupts. More... | |
| virtual bool | Interrupt_Process (unsigned int aMessageId, bool *aNeedMoreProcessing) |
| Process an interrupt. More... | |
| virtual void | Interrupt_Process2 (bool *aNeedMoreProcessing) |
| Process an interrupt at seconde level. More... | |
| virtual void | Interrupt_Process3 () |
| Process an interrupt at third level. More... | |
| void | Lock () |
| Lock the hardware. More... | |
| void | Unlock () |
| Unlock the hardware. More... | |
| void | Unlock_AfterReceive_FromThread (volatile long *aCounter, unsigned int aPacketQty, uint32_t aFlags) |
| Unlock the hardware after programming receive descriptors. More... | |
| void | Unlock_AfterSend_FromThread (volatile long *aCounter, unsigned int aPacketQty, uint32_t aFlags) |
| Unlock the hardware after programming transmit descriptors. More... | |
| virtual bool | Packet_Drop ()=0 |
| Add a buffer to the receiving queue. More... | |
| virtual void | Packet_Receive_NoLock (Packet *aPacket, volatile long *aCounter)=0 |
| Add the packet to the receiving queue. More... | |
| virtual void | Packet_Send_NoLock (uint64_t aPacket_PA, const void *aPacket_XA, unsigned int aSize_byte, volatile long *aCounter)=0 |
| Add the packet to the send queue. More... | |
| virtual bool | Packet_Send (const void *aPacket, unsigned int aSize_byte, bool aPriority, unsigned int aRepeatCount=1)=0 |
| Add the packet to the send queue. More... | |
| virtual unsigned int | Statistics_Get (uint32_t *aOut, unsigned int aOutSize_byte, bool aReset) |
| Retrieve statistics. More... | |
| virtual void | Statistics_Reset () |
| Reset the statistics. More... | |
| bool | Tx_IsEnabled () const |
| Is Tx enabled? More... | |
| virtual void | Tx_Disable () |
| Disable transmission. More... | |
| virtual void | Tx_Enable () |
| Enable transmission. More... | |
Protected Member Functions | |
| Hardware (OpenNetK::Adapter_Type aType, unsigned int aPacketSize_byte) | |
| The default constructor. More... | |
| virtual void | Unlock_AfterReceive_Internal ()=0 |
| Hardware dependent part of the Unlock_AfterReceive. More... | |
| virtual void | Unlock_AfterSend_Internal ()=0 |
| Hardware dependent part of the Unlock_AfterSend. More... | |
Static Protected Member Functions | |
| static void | SkipDangerousBoundary (uint64_t *aIn_PA, uint8_t **aIn_XA, unsigned int aSize_byte, uint64_t *aOut_PA, uint8_t **aOut_XA) |
| Skip the dangerous 64 KiB boundaries. More... | |
Protected Attributes | |
| Adapter_Config | mConfig |
| The adapter configuration. | |
| Adapter_Info | mInfo |
| The information about the adapter. | |
| uint32_t | mStatistics [64] |
| The adapter configuration. | |
| SpinLock * | mZone0 |
| The SpinLock used to lock the hardware. | |
This class defines the hardware interface.
|
protected |
The default constructor.
| aType | Type of adapter |
| aPacketSize_byte | The maximum and default packet size |
|
virtual |
|
virtual |
Exit the D0 state.
| false | Error |
| true | OK |
| unsigned int OpenNetK::Hardware::GetCommonBufferSize | ( | ) | const |
Retrieve the common buffer size.
| unsigned int OpenNetK::Hardware::GetPacketSize | ( | ) | const |
Retrieve the configured maximum packet size.
|
pure virtual |
Retrieve the current state.
| aState | The OpenNet_State instance |
|
virtual |
Disable the interrupts.
|
virtual |
Enable the interrupts.
|
virtual |
Process an interrupt.
| aMessageId | The message associated to the interrupt |
| aNeedMoreProcessing |
| The | adapter did not cause the interrupt. |
| The | adapter caused the interrupt. |
|
virtual |
Process an interrupt at seconde level.
| aNeedMoreProcessing |
|
virtual |
Process an interrupt at third level.
|
inline |
Lock the hardware.
| void* OpenNetK::Hardware::operator new | ( | size_t | aSize_byte, |
| void * | aAddress | ||
| ) |
new operator without allocation
| aSize_byte | The size |
| aAddress | The address |
|
pure virtual |
Add a buffer to the receiving queue.
| false | No available buffer |
| true | OK |
|
pure virtual |
|
pure virtual |
Add the packet to the send queue.
| aPacket | The packet |
| aSize_byte | The packet size |
| aPriority | Set to true for packet with high priority |
| aRepeatCount | The repeat count |
| false | Error |
| true | OK |
|
pure virtual |
Add the packet to the send queue.
| aPacket_PA | The data |
| aPacket_XA | The data (C or M) |
| aSize_byte | The data size |
| aCounter | The operation counter |
|
virtual |
|
virtual |
|
virtual |
Set the common buffer.
aCommon_PA The physical address the hardware uses aCommon_CA The virtual address the software uses
|
virtual |
Set the configuation.
| aConfig | The configuration |
|
virtual |
Set a memory region.
| aIndex | The index |
| aMemory_MA | The virtual address |
| aSize_byte | The size |
| false | Error |
| true | OK |
|
staticprotected |
Skip the dangerous 64 KiB boundaries.
| aIn_PA | |
| aIn_XA | (C or M) |
| aSize_byte | |
| aOut_PA | |
| aOut_XA | (C or M) |
|
virtual |
Retrieve statistics.
| aOut | The output buffer |
| aOutSize_byte | The output buffer size |
| aReset | Reset the statitics after getting them |
|
virtual |
Reset the statistics.
|
virtual |
Disable transmission.
|
virtual |
Enable transmission.
|
inline |
Is Tx enabled?
| false | |
| true |
|
inline |
| void OpenNetK::Hardware::Unlock_AfterReceive_FromThread | ( | volatile long * | aCounter, |
| unsigned int | aPacketQty, | ||
| uint32_t | aFlags | ||
| ) |
Unlock the hardware after programming receive descriptors.
| aCounter | The counter to increment |
| aPacketQty | The number of descriptor programmed |
| aFlags | Value to pass to SpinLock::UnlockFromThread |
|
protectedpure virtual |
Hardware dependent part of the Unlock_AfterReceive.
| void OpenNetK::Hardware::Unlock_AfterSend_FromThread | ( | volatile long * | aCounter, |
| unsigned int | aPacketQty, | ||
| uint32_t | aFlags | ||
| ) |
Unlock the hardware after programming transmit descriptors.
| aCounter | The counter to increment |
| aPacketQty | The number of descriptor programmed |
| aFlags | Value to pass to SpinLock::UnlockFromThread |
|
protectedpure virtual |
Hardware dependent part of the Unlock_AfterSend.
1.8.9.1