CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
Ksz8851Ethernet Class Reference

The driver for KSZ8851 SPI Ethernet MAC. More...

#include <platform-ethernet.hh>

Classes

class  Frame
 Simple class representing a received Ethernet frame. More...

Public Member Functions

 Ksz8851Ethernet ()
 Initialise a reference to the Ethernet device.
 Ksz8851Ethernet (const Ksz8851Ethernet &)=delete
 Ksz8851Ethernet (Ksz8851Ethernet &&)=delete
void mac_address_set (MACAddress address=mac_address_default())
uint32_t receive_interrupt_value ()
int receive_interrupt_complete (Timeout *timeout, uint32_t lastInterruptValue)
bool phy_link_status ()
 Check the link status of the PHY.
std::optional< Framereceive_frame ()
bool send_frame (const uint8_t *buffer, uint16_t length, auto &&check)
 Send a packet.
 Ksz8851Ethernet ()
 Initialise a reference to the Ethernet device.
 Ksz8851Ethernet (const Ksz8851Ethernet &)=delete
 Ksz8851Ethernet (Ksz8851Ethernet &&)=delete
void mac_address_set (MACAddress address=mac_address_default())
uint32_t receive_interrupt_value ()
int receive_interrupt_complete (Timeout *timeout, uint32_t lastInterruptValue)
bool phy_link_status ()
 Check the link status of the PHY.
std::optional< Framereceive_frame ()
bool send_frame (const uint8_t *buffer, uint16_t length, auto &&check)
 Send a packet.

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 ()
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 ()

Detailed Description

The driver for KSZ8851 SPI Ethernet MAC.

Definition at line 25 of file platform-ethernet.hh.

Constructor & Destructor Documentation

◆ Ksz8851Ethernet() [1/2]

Ksz8851Ethernet::Ksz8851Ethernet ( )
inline

Initialise a reference to the Ethernet device.

Definition at line 464 of file platform-ethernet.hh.

References interrupt_futex_get(), STATIC_SEALED_VALUE, and thread_millisecond_wait().

◆ Ksz8851Ethernet() [2/2]

Ksz8851Ethernet::Ksz8851Ethernet ( )
inline

Initialise a reference to the Ethernet device.

Definition at line 461 of file platform-ethernet.hh.

References interrupt_futex_get(), STATIC_SEALED_VALUE, and thread_millisecond_wait().

Member Function Documentation

◆ has_unique_mac_address() [1/2]

constexpr bool Ksz8851Ethernet::has_unique_mac_address ( )
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 559 of file platform-ethernet.hh.

◆ has_unique_mac_address() [2/2]

constexpr bool Ksz8851Ethernet::has_unique_mac_address ( )
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 555 of file platform-ethernet.hh.

◆ mac_address_default() [1/2]

constexpr MACAddress Ksz8851Ethernet::mac_address_default ( )
inlinestaticconstexpr

Definition at line 564 of file platform-ethernet.hh.

◆ mac_address_default() [2/2]

constexpr MACAddress Ksz8851Ethernet::mac_address_default ( )
inlinestaticconstexpr

Definition at line 560 of file platform-ethernet.hh.

◆ mac_address_set() [1/2]

void Ksz8851Ethernet::mac_address_set ( MACAddress address = mac_address_default())
inline

Definition at line 569 of file platform-ethernet.hh.

◆ mac_address_set() [2/2]

void Ksz8851Ethernet::mac_address_set ( MACAddress address = mac_address_default())
inline

Definition at line 565 of file platform-ethernet.hh.

◆ phy_link_status() [1/2]

bool Ksz8851Ethernet::phy_link_status ( )
inline

Check the link status of the PHY.

Definition at line 634 of file platform-ethernet.hh.

◆ phy_link_status() [2/2]

bool Ksz8851Ethernet::phy_link_status ( )
inline

Check the link status of the PHY.

Definition at line 631 of file platform-ethernet.hh.

◆ receive_frame() [1/2]

std::optional< Frame > Ksz8851Ethernet::receive_frame ( )
inline

Definition at line 640 of file platform-ethernet.hh.

◆ receive_frame() [2/2]

std::optional< Frame > Ksz8851Ethernet::receive_frame ( )
inline

Definition at line 637 of file platform-ethernet.hh.

◆ receive_interrupt_complete() [1/2]

int Ksz8851Ethernet::receive_interrupt_complete ( Timeout * timeout,
uint32_t lastInterruptValue )
inline

Definition at line 584 of file platform-ethernet.hh.

◆ receive_interrupt_complete() [2/2]

int Ksz8851Ethernet::receive_interrupt_complete ( Timeout * timeout,
uint32_t lastInterruptValue )
inline

Definition at line 580 of file platform-ethernet.hh.

◆ receive_interrupt_value() [1/2]

uint32_t Ksz8851Ethernet::receive_interrupt_value ( )
inline

Definition at line 579 of file platform-ethernet.hh.

◆ receive_interrupt_value() [2/2]

uint32_t Ksz8851Ethernet::receive_interrupt_value ( )
inline

Definition at line 575 of file platform-ethernet.hh.

◆ send_frame() [1/2]

bool Ksz8851Ethernet::send_frame ( const uint8_t * buffer,
uint16_t length,
auto && check )
inline

Send a packet.

This will block if no buffer space is available on device.

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 760 of file platform-ethernet.hh.

References heap_claim_ephemeral().

◆ send_frame() [2/2]

bool Ksz8851Ethernet::send_frame ( const uint8_t * buffer,
uint16_t length,
auto && check )
inline

Send a packet.

This will block if no buffer space is available on device.

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 749 of file platform-ethernet.hh.

References heap_claim_ephemeral().


The documentation for this class was generated from the following files: