|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
The driver for Kunyan Liu's custom Ethernet MAC for the Arty A7. More...
#include <platform-ethernet.hh>
Classes | |
| class | BufferedFrame |
| Class encapsulating a frame that has been received. More... | |
Public Member Functions | |
| KunyanEthernet () | |
| Initialise a reference to the Ethernet device. | |
| KunyanEthernet (const KunyanEthernet &)=delete | |
| KunyanEthernet (KunyanEthernet &&)=delete | |
| void | mac_address_set (MACAddress address=mac_address_default()) |
| uint32_t | receive_interrupt_value () |
| int | receive_interrupt_complete (Timeout *timeout, uint32_t lastInterruptValue) |
| void | autonegotiation_enable (uint8_t phyAddress=1) |
| Enable autonegotiation on the PHY. | |
| bool | phy_link_status () |
| Check the link status of the PHY. | |
| std::optional< uint16_t > | check_frame (BufferID index=BufferID::Ping) |
| void | complete_receive (BufferID index=BufferID::Ping) |
| std::optional< BufferedFrame > | receive_frame () |
| bool | send_frame (const uint8_t *buffer, uint16_t length, auto &&check) |
| Send a packet. | |
| void | dropped_frames_log_all_if_changed () |
| If debugging dropped frames is enabled, log any counter values that have changed since the last call to this function. | |
| void | received_frames_log () |
Static Public Member Functions | |
| static constexpr bool | has_unique_mac_address () |
| This device does not have a unique MAC address and so users must provide a locally administered MAC address if more than one device is present on the same network. | |
| static constexpr MACAddress | mac_address_default () |
The driver for Kunyan Liu's custom Ethernet MAC for the Arty A7.
This is intended to run at 10Mb/s. It provides two send and two receive buffers in shared SRAM.
WARNING: This is currently evolving and is not yet stable.
Definition at line 27 of file platform-ethernet.hh.
|
inline |
Initialise a reference to the Ethernet device.
This will check the ID registers to make sure that this is the kind of device that we're expecting.
Definition at line 455 of file platform-ethernet.hh.
References autonegotiation_enable(), interrupt_futex_get(), and STATIC_SEALED_VALUE.
|
inline |
Enable autonegotiation on the PHY.
FIXME: This blocks forever if the cable is disconnected!
Definition at line 549 of file platform-ethernet.hh.
Referenced by KunyanEthernet().
|
inline |
Definition at line 595 of file platform-ethernet.hh.
|
inline |
Definition at line 611 of file platform-ethernet.hh.
|
inline |
If debugging dropped frames is enabled, log any counter values that have changed since the last call to this function.
Definition at line 802 of file platform-ethernet.hh.
|
inlinestaticconstexpr |
This device does not have a unique MAC address and so users must provide a locally administered MAC address if more than one device is present on the same network.
Definition at line 490 of file platform-ethernet.hh.
|
inlinestaticconstexpr |
Definition at line 495 of file platform-ethernet.hh.
|
inline |
Definition at line 500 of file platform-ethernet.hh.
|
inline |
Check the link status of the PHY.
Definition at line 590 of file platform-ethernet.hh.
|
inline |
Definition at line 680 of file platform-ethernet.hh.
|
inline |
Definition at line 514 of file platform-ethernet.hh.
|
inline |
Definition at line 509 of file platform-ethernet.hh.
|
inline |
Definition at line 816 of file platform-ethernet.hh.
|
inline |
Send a packet.
This is synchronous and will block until the packet has been sent. A better version would use the next available ping or pong buffer and return as soon as the send operation had been enqueued.
The third argument is a callback that allows the caller to check the frame before it's sent but after it's copied into memory that isn't shared with other compartments.
Definition at line 747 of file platform-ethernet.hh.
References heap_claim_ephemeral().