Endpoint configuration

Multi-register configuration requires quiescent local and remote users. MAC addresses are six octets in network order. Zero multicast disables oETP group reception. Response timeouts count endpoint clock cycles; zero disables timeout. They begin after request transmission and do not bound complete API-call or whole-transfer duration.

openenoc_endpoint_status_t openenoc_endpoint_get_config(volatile const csr__endpoint_interface_t *endpoint, openenoc_endpoint_config_t *config)

Read the current endpoint configuration.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • config – Out; required configuration destination.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer or required argument.

Side effects:

Reads configuration CSRs; returns the written fragment value, before rounding.

openenoc_endpoint_status_t openenoc_endpoint_set_config(volatile csr__endpoint_interface_t *endpoint, const openenoc_endpoint_config_t *config)

Apply all endpoint configuration values.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • config – In; required configuration. Unicast I/G must be zero; multicast must be zero or a group address; receive mode must be valid.

Returns:

OK; INVALID_ARGUMENT for invalid pointers, MACs or receive mode; OUT_OF_RANGE for an invalid effective fragment limit when peer DMA is supported.

Preconditions:

Local and remote users must be quiescent; this call does not enforce an atomic hardware-wide update.

Side effects:

Writes MACs, receive policy, both timeouts, and the requested fragment size after validation.

openenoc_endpoint_status_t openenoc_endpoint_set_mac_address(volatile csr__endpoint_interface_t *endpoint, const openenoc_endpoint_mac_t *address)

Set the endpoint source and individual destination MAC.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • address – In; required six-octet address with its first-octet I/G bit zero.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer, null address, or group MAC.

Preconditions:

Coordinate users affected by the MAC change.

Side effects:

Writes the generated lower and upper MAC fields.

openenoc_endpoint_status_t openenoc_endpoint_set_multicast_address(volatile csr__endpoint_interface_t *endpoint, const openenoc_endpoint_mac_t *address)

Set the exact oETP group destination filter.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • address – In; required zero address or address with its first-octet I/G bit set.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer, null address, or nonzero individual MAC.

Preconditions:

Coordinate users affected by the filter change.

Side effects:

Writes the generated lower and upper multicast fields.

openenoc_endpoint_status_t openenoc_endpoint_set_receive_mode(volatile csr__endpoint_interface_t *endpoint, openenoc_endpoint_receive_mode_t mode)

Set the non-oETP receive policy.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • mode – In; DROP, FILTERED, MULTICAST, or PROMISCUOUS receive enum.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer or receive mode.

Side effects:

Writes the receive policy. FILTERED accepts local unicast and broadcast; MULTICAST additionally accepts group traffic.

openenoc_endpoint_status_t openenoc_endpoint_set_rmem_timeout(volatile csr__endpoint_interface_t *endpoint, uint32_t cycles)

Set the response timeout for transparent RMEM.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • cycles – In; maximum response-wait cycles, or zero for no timeout.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer; UNSUPPORTED when RMEM is absent.

Side effects:

Writes the timeout sampled for subsequent RMEM operations.

openenoc_endpoint_status_t openenoc_endpoint_set_dma_timeout(volatile csr__endpoint_interface_t *endpoint, uint32_t cycles)

Set the common unicast peer-DMA fragment response timeout.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • cycles – In; maximum response-wait cycles per fragment, or zero for no timeout.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer; UNSUPPORTED when peer DMA is absent.

Side effects:

Writes the timeout sampled for subsequent fragment requests. It does not apply to raw DMA or multicast writes.

openenoc_endpoint_status_t openenoc_endpoint_set_dma_max_fragment_size(volatile csr__endpoint_interface_t *endpoint, uint32_t requested_bytes, uint32_t *effective_bytes)

Set the requested peer-DMA fragment limit.

Parameters:
  • endpoint – In; required mapped, word-aligned endpoint-interface pointer.

  • requested_bytes – In; written memory-byte limit; hardware executes its value rounded down to a multiple of four.

  • effective_bytes – Out; optional rounded byte limit; may be null.

Returns:

OK; INVALID_ARGUMENT for an invalid endpoint pointer; UNSUPPORTED when peer DMA is absent; OUT_OF_RANGE when the rounded value is below four or above the advertised fragment ceiling.

Preconditions:

The upper bound is 4 * floor((max_raw_frame_size_bytes - 32) / 4). Hardware snapshots the limit at block acceptance.

Side effects:

Writes the original requested value and, on success, returns its effective value when requested.

Public declarations

The maintained header below provides the exact public type and enum definitions.

Configuration types
 1typedef enum {
 2    OPENENOC_ENDPOINT_RECEIVE_DROP = 0,
 3    OPENENOC_ENDPOINT_RECEIVE_FILTERED = 1,
 4    OPENENOC_ENDPOINT_RECEIVE_MULTICAST = 2,
 5    OPENENOC_ENDPOINT_RECEIVE_PROMISCUOUS = 3
 6} openenoc_endpoint_receive_mode_t;
 7
 8typedef struct {
 9    openenoc_endpoint_mac_t mac_address;
10    openenoc_endpoint_mac_t multicast_address;
11    openenoc_endpoint_receive_mode_t receive_mode;
12    uint32_t rmem_timeout_cycles;
13    uint32_t dma_timeout_cycles;
14    uint32_t dma_max_fragment_size_bytes;
15} openenoc_endpoint_config_t;
16