diff --git a/ncsid/src/platforms/nemora/portable/default_addresses.h b/ncsid/src/platforms/nemora/portable/default_addresses.h
new file mode 100644
index 0000000..469264b
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/default_addresses.h
@@ -0,0 +1,7 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_DEFAULT_ADDRESSES_H_
+#define PLATFORMS_NEMORA_PORTABLE_DEFAULT_ADDRESSES_H_
+//
+// Nemora dedicated port. Filtered by NIC. See //depot/eng/ports.
+#define DEFAULT_ADDRESSES_RX_PORT 3959
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_DEFAULT_ADDRESSES_H_
diff --git a/ncsid/src/platforms/nemora/portable/ncsi.h b/ncsid/src/platforms/nemora/portable/ncsi.h
new file mode 100644
index 0000000..18c535d
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi.h
@@ -0,0 +1,420 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_NCSI_H_
+#define PLATFORMS_NEMORA_PORTABLE_NCSI_H_
+
+/*
+ * Module for interacting with NC-SI capable network cards.
+ *
+ * DMTF v1.0.0 NC-SI specification:
+ * http://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "platforms/nemora/portable/net_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
+// Define states for our NC-SI connection to the NIC.
+// There is no mapping to the NC-SI specification for these states, but they
+// reflect the outcome of NC-SI commands used in our configuration state
+// machine.
+//
+// 'DOWN' - while in this state, periodically restart the configuration state
+//   machine until it succeeds.
+// 'LOOPBACK' - the response to the first NC-SI command of the configuration
+//   state machine was identical to the command: from this we infer we are in
+//   loopback. While in this state, periodically restart the configuration state
+//   machine.
+// 'UP' - all commands were responded successfully, but need DHCP configuration
+//   to go to the next state. While in this state, the connection is tested
+//   periodically for failures, which can bring back to 'DOWN'.
+// 'UP_AND_CONFIGURED' - NC-SI OEM commands for L3/L4 configuration (which
+//   depend on DHCP configuration) were responded successfully. While in this
+//   state, the connection and configuration are tested periodically for
+//   failures, which can bring back to 'DOWN'.
+// 'DISABLED' - reset default state. As soon as network is enabled (which
+//   noticeably means that ProdID must be disabled), the state goes to DOWN.
+// TODO: connection state has nothing to do with ncsi protocol and needs
+// to be moved to ncsi_fsm.h. The main problem with the move is that
+// ncsi_client.h defines an extern function with this return type, that is used
+// in a lot of places that have no business including ncsi_fsm.h
+typedef enum {
+  NCSI_CONNECTION_DOWN,
+  NCSI_CONNECTION_LOOPBACK,
+  NCSI_CONNECTION_UP,
+  NCSI_CONNECTION_UP_AND_CONFIGURED,
+  NCSI_CONNECTION_DISABLED,
+} ncsi_connection_state_t;
+
+typedef enum {
+  NCSI_RESPONSE_NONE,
+  NCSI_RESPONSE_ACK,
+  NCSI_RESPONSE_NACK,
+  NCSI_RESPONSE_UNDERSIZED,
+  NCSI_RESPONSE_UNEXPECTED_TYPE,
+  NCSI_RESPONSE_UNEXPECTED_SIZE,
+  NCSI_RESPONSE_OEM_FORMAT_ERROR,
+  NCSI_RESPONSE_TIMEOUT,
+  NCSI_RESPONSE_UNEXPECTED_PARAMS,
+} ncsi_response_type_t;
+
+// For NC-SI Rev 1.0.0, the management controller ID (mc_id) is 0.
+#define NCSI_MC_ID 0
+// For NC-SI Rev 1.0.0, the header revision is 0x01.
+#define NCSI_HEADER_REV 1
+#define NCSI_ETHERTYPE 0x88F8
+#define NCSI_RESPONSE 0x80
+
+// Command IDs
+enum {
+  NCSI_CLEAR_INITIAL_STATE,
+  NCSI_SELECT_PACKAGE,
+  NCSI_DESELECT_PACKAGE,
+  NCSI_ENABLE_CHANNEL,
+  NCSI_DISABLE_CHANNEL,
+  NCSI_RESET_CHANNEL,
+  NCSI_ENABLE_CHANNEL_NETWORK_TX,
+  NCSI_DISABLE_CHANNEL_NETWORK_TX,
+  NCSI_AEN_ENABLE,
+  NCSI_SET_LINK,
+  NCSI_GET_LINK_STATUS,
+  NCSI_SET_VLAN_FILTER,
+  NCSI_ENABLE_VLAN,
+  NCSI_DISABLE_VLAN,
+  NCSI_SET_MAC_ADDRESS,
+  // 0x0F is not a valid command
+  NCSI_ENABLE_BROADCAST_FILTER = 0x10,
+  NCSI_DISABLE_BROADCAST_FILTER,
+  NCSI_ENABLE_GLOBAL_MULTICAST_FILTER,
+  NCSI_DISABLE_GLOBAL_MULTICAST_FILTER,
+  NCSI_SET_NCSI_FLOW_CONTROL,
+  NCSI_GET_VERSION_ID,
+  NCSI_GET_CAPABILITIES,
+  NCSI_GET_PARAMETERS,
+  NCSI_GET_CONTROLLER_PACKET_STATISTICS,
+  NCSI_GET_NCSI_STATISTICS,
+  NCSI_GET_PASSTHROUGH_STATISTICS,
+  // 0x1B-0x4F are not valid commands
+  NCSI_OEM_COMMAND = 0x50,
+};
+// OEM Command IDs (subtypes of NCSI_OEM_COMMAND)
+#define NCSI_OEM_COMMAND_GET_HOST_MAC 0x00
+#define NCSI_OEM_COMMAND_SET_FILTER 0x01
+#define NCSI_OEM_COMMAND_GET_FILTER 0x02
+#define NCSI_OEM_COMMAND_ECHO 0x03
+
+#define NCSI_OEM_MANUFACTURER_ID 11129  // IANA Enterprise Number for Google.
+#define NCSI_OEM_ECHO_PATTERN_SIZE 64
+
+/*
+ * NCSI command frame with packet header as described in section 8.2.1.
+ * Prepended with an ethernet header.
+ */
+typedef struct __packed {
+  eth_hdr_t ethhdr;
+  uint8_t mc_id;
+  uint8_t header_revision;
+  uint8_t reserved_00;
+  uint8_t instance_id;          // Destinguish retried commands from new ones.
+  uint8_t control_packet_type;  // See section 8.3, and Table 17.
+  uint8_t channel_id;
+  uint16_t payload_length;  // In Bytes. Excludes header, checksum, padding.
+  uint16_t reserved_01[4];
+} ncsi_header_t;
+
+/*
+ * Simple NCSI response packet.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+} ncsi_simple_response_t;
+
+/*
+ * Simple NCSI command packet.
+ */
+typedef struct {
+  ncsi_header_t hdr;
+} ncsi_simple_command_t;
+
+/*
+ * Get Link Status Response. 8.4.24
+ */
+typedef struct __packed {
+  uint32_t link_status;
+  uint32_t other_indications;
+  uint32_t oem_link_status;
+} ncsi_link_status_t;
+
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_link_status_t link_status;
+} ncsi_link_status_response_t;
+
+#define NCSI_LINK_STATUS_UP (1 << 0)
+
+/*
+ * Set MAC Address packet. 8.4.31
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  mac_addr_t mac_addr;
+  uint8_t mac_addr_num;
+  uint8_t misc;
+} ncsi_set_mac_command_t;
+
+/*
+ * Enable Broadcast Filter packet. 8.4.33
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint32_t filter_settings;
+} ncsi_enable_broadcast_filter_command_t;
+
+#define NCSI_BROADCAST_FILTER_MASK_ARP         (1 << 0)
+#define NCSI_BROADCAST_FILTER_MASK_DHCP_CLIENT (1 << 1)
+#define NCSI_BROADCAST_FILTER_MASK_DHCP_SERVER (1 << 2)
+#define NCSI_BROADCAST_FILTER_MASK_NETBIOS     (1 << 3)
+
+/*
+ * Get Version ID Response. 8.4.44
+ */
+typedef struct __packed {
+  struct {
+    uint8_t major;
+    uint8_t minor;
+    uint8_t update;
+    uint8_t alpha1;
+    uint8_t reserved[3];
+    uint8_t alpha2;
+  } ncsi_version;
+  uint8_t firmware_name_string[12];
+  uint32_t firmware_version;
+  uint16_t pci_did;
+  uint16_t pci_vid;
+  uint16_t pci_ssid;
+  uint16_t pci_svid;
+  uint32_t manufacturer_id;
+} ncsi_version_id_t;
+
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_version_id_t version;
+} ncsi_version_id_response_t;
+
+/*
+ * Get Capabilities Response 8.4.46
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  uint32_t capabilities_flags;
+  uint32_t broadcast_packet_filter_capabilties;
+  uint32_t multicast_packet_filter_capabilties;
+  uint32_t buffering_capability;
+  uint32_t aen_control_support;
+  uint8_t vlan_filter_count;
+  uint8_t mixed_filter_count;
+  uint8_t multicast_filter_count;
+  uint8_t unicast_filter_count;
+  uint16_t reserved;
+  uint8_t vlan_mode_support;
+  uint8_t channel_count;
+} ncsi_capabilities_response_t;
+
+/*
+ * Get Parameters Response 8.4.48
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  // TODO: Note: Mellanox 1.4 FW has mac count swapped with mac flags.
+  uint8_t mac_address_count;
+  uint16_t reserved_01;
+  uint8_t mac_address_flags;
+  uint8_t vlan_tag_count;
+  uint8_t reserved_02;
+  uint16_t vlan_tag_flags;
+  uint32_t link_settings;
+  uint32_t broadcast_settings;
+  uint32_t configuration_flags;
+  uint8_t vlan_mode;
+  uint8_t flow_control_enable;
+  uint16_t reserved_03;
+  uint32_t aen_control;
+  mac_addr_t mac_address[2];
+  // TODO: Variable number of mac address filters (max 8. See 8.4.48)
+  uint16_t vlan_tags[2];
+  // TODO: Variable of vlan filters (up to 15 based on 8.4.48)
+} ncsi_parameters_response_t;
+
+/*
+ * Get Passthrough statistics response. 8.4.54
+ *
+ * The legacy data structure matches MLX implementation up to vX
+ * (Google vX), however the standard requires the first field to be
+ * 64bits and MLX fixed it in vX (Google vX).
+ *
+ */
+typedef struct __packed {
+  uint32_t tx_packets_received;  // EC -> NIC
+  uint32_t tx_packets_dropped;
+  uint32_t tx_channel_errors;
+  uint32_t tx_undersized_errors;
+  uint32_t tx_oversized_errors;
+  uint32_t rx_packets_received;  // Network -> NIC
+  uint32_t rx_packets_dropped;
+  uint32_t rx_channel_errors;
+  uint32_t rx_undersized_errors;
+  uint32_t rx_oversized_errors;
+} ncsi_passthrough_stats_legacy_t;
+
+typedef struct __packed {
+  uint32_t tx_packets_received_hi;  // EC -> NIC (higher 32bit)
+  uint32_t tx_packets_received_lo;  // EC -> NIC (lower 32bit)
+  uint32_t tx_packets_dropped;
+  uint32_t tx_channel_errors;
+  uint32_t tx_undersized_errors;
+  uint32_t tx_oversized_errors;
+  uint32_t rx_packets_received;  // Network -> NIC
+  uint32_t rx_packets_dropped;
+  uint32_t rx_channel_errors;
+  uint32_t rx_undersized_errors;
+  uint32_t rx_oversized_errors;
+} ncsi_passthrough_stats_t;
+
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_passthrough_stats_legacy_t stats;
+} ncsi_passthrough_stats_legacy_response_t;
+
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_passthrough_stats_t stats;
+} ncsi_passthrough_stats_response_t;
+
+/*
+ * OEM extension header for custom commands.
+ */
+typedef struct __packed {
+  uint32_t manufacturer_id;
+  uint8_t reserved[3];
+  uint8_t oem_cmd;
+} ncsi_oem_extension_header_t;
+
+/*
+ * Response format for simple OEM command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_oem_extension_header_t oem_header;
+} ncsi_oem_simple_response_t;
+
+/*
+ * Response format for OEM get MAC command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_oem_extension_header_t oem_header;
+  uint16_t reserved0;
+  uint8_t mac[6];
+} ncsi_host_mac_response_t;
+
+/*
+ * Format for OEM filter.
+ */
+typedef struct __packed {
+  uint16_t reserved0;
+  uint8_t mac[6];
+  // If ip is set to zero, the filter will match any IP address, including any
+  // IPv6 address.
+  uint32_t ip;  // Network order
+  uint16_t port;  // Network order
+  uint8_t reserved1;
+  uint8_t flags;
+  uint8_t regid[8];
+} ncsi_oem_filter_t;
+
+// Set flags
+#define NCSI_OEM_FILTER_FLAGS_ENABLE      (0x01)
+
+// Get flags
+#define NCSI_OEM_FILTER_FLAGS_ENABLED     (0x01)
+#define NCSI_OEM_FILTER_FLAGS_REGISTERED  (0x02)
+#define NCSI_OEM_FILTER_FLAGS_HOSTLESS    (0x04)
+
+/*
+ * Command format for simple OEM command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  ncsi_oem_extension_header_t oem_header;
+} ncsi_oem_simple_cmd_t;
+
+/*
+ * Response format for OEM get filter command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_oem_extension_header_t oem_header;
+  ncsi_oem_filter_t filter;
+} ncsi_oem_get_filter_response_t;
+
+/*
+ * Command format for OEM set filter command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  ncsi_oem_extension_header_t oem_header;
+  ncsi_oem_filter_t filter;
+} ncsi_oem_set_filter_cmd_t;
+
+/*
+ * Command format for OEM echo command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  ncsi_oem_extension_header_t oem_header;
+  uint8_t pattern[NCSI_OEM_ECHO_PATTERN_SIZE];
+} ncsi_oem_echo_cmd_t;
+
+/*
+ * Response format for OEM echo command.
+ */
+typedef struct __packed {
+  ncsi_header_t hdr;
+  uint16_t response_code;
+  uint16_t reason_code;
+  ncsi_oem_extension_header_t oem_header;
+  uint8_t pattern[NCSI_OEM_ECHO_PATTERN_SIZE];
+} ncsi_oem_echo_response_t;
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_NCSI_H_
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_client.c b/ncsid/src/platforms/nemora/portable/ncsi_client.c
new file mode 100644
index 0000000..38ab9e3
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_client.c
@@ -0,0 +1,307 @@
+/*
+ * Library of NC-SI commands compliant with version 1.0.0.
+ *
+ * This implements a subset of the commands provided in the specification.
+ *
+ * Checksums are optional and not implemented here. All NC-SI checksums are set
+ * to 0 to indicate that per 8.2.2.3.
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <arpa/inet.h>
+
+#include "platforms/nemora/portable/ncsi_client.h"
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
+// todo - To save space these tables use the notion that no response is
+//            larger than 255 bytes. Need a BUILD_ASSERT.
+// todo - Replace 0's with actual sizes once the commands are supported
+static const uint8_t ncsi_response_size_table[] = {
+  sizeof(ncsi_simple_response_t),        // NCSI_CLEAR_INITIAL_STATE
+  sizeof(ncsi_simple_response_t),        // NCSI_SELECT_PACKAGE
+  sizeof(ncsi_simple_response_t),        // NCSI_DESELECT_PACKAGE
+  sizeof(ncsi_simple_response_t),        // NCSI_ENABLE_CHANNEL
+  sizeof(ncsi_simple_response_t),        // NCSI_DISABLE_CHANNEL
+  sizeof(ncsi_simple_response_t),        // NCSI_RESET_CHANNEL
+  sizeof(ncsi_simple_response_t),        // NCSI_ENABLE_CHANNEL_NETWORK_TX
+  sizeof(ncsi_simple_response_t),        // NCSI_DISABLE_CHANNEL_NETWORK_TX
+  sizeof(ncsi_simple_response_t),        // NCSI_AEN_ENABLE
+  sizeof(ncsi_simple_response_t),        // NCSI_SET_LINK
+  sizeof(ncsi_link_status_response_t),   // NCSI_GET_LINK_STATUS
+  sizeof(ncsi_simple_response_t),        // NCSI_SET_VLAN_FILTER
+  sizeof(ncsi_simple_response_t),        // NCSI_ENABLE_VLAN
+  sizeof(ncsi_simple_response_t),        // NCSI_DISABLE_VLAN
+  sizeof(ncsi_simple_response_t),        // NCSI_SET_MAC_ADDRESS
+  0,                                     // 0x0F is not a valid command
+  sizeof(ncsi_simple_response_t),        // NCSI_ENABLE_BROADCAST_FILTER
+  sizeof(ncsi_simple_response_t),        // NCSI_DISABLE_BROADCAST_FILTER
+  sizeof(ncsi_simple_response_t),        // NCSI_ENABLE_GLOBAL_MULTICAST_FILTER
+  sizeof(ncsi_simple_response_t),        // NCSI_DISABLE_GLOBAL_MULTICAST_FILTER
+  sizeof(ncsi_simple_response_t),        // NCSI_SET_NCSI_FLOW_CONTROL
+  sizeof(ncsi_version_id_response_t),    // NCSI_GET_VERSION_ID
+  sizeof(ncsi_capabilities_response_t),  // NCSI_GET_CAPABILITIES
+  sizeof(ncsi_parameters_response_t),    // NCSI_GET_PARAMETERS
+  0,  // NCSI_GET_CONTROLLER_PACKET_STATISTICS
+  0,  // NCSI_GET_NCSI_STATISTICS
+  sizeof(ncsi_passthrough_stats_response_t),  // NCSI_GET_PASSTHROUGH_STATISTICS
+};
+
+static const uint8_t ncsi_oem_response_size_table[] = {
+  sizeof(ncsi_host_mac_response_t),        // NCSI_OEM_COMMAND_GET_HOST_MAC
+  sizeof(ncsi_oem_simple_response_t),      // NCSI_OEM_COMMAND_SET_FILTER
+  sizeof(ncsi_oem_get_filter_response_t),  // NCSI_OEM_COMMAND_GET_FILTER
+  sizeof(ncsi_oem_echo_response_t),        // NCSI_OEM_COMMAND_ECHO
+};
+
+// TODO Should increment when we send a packet that is not a retry.
+static uint8_t current_instance_id;
+
+/*
+ * Sets _most_ of the NC-SI header fields. Caller is expected to set
+ * payload_length field if it is > 0. For many NC-SI commands it is 0.
+ */
+static void set_header_fields(ncsi_header_t* header, uint8_t ch_id,
+                              uint8_t cmd_type)
+{
+  // Destination MAC must be all 0xFF.
+  memset(header->ethhdr.dest.octet, 0xFF, sizeof(header->ethhdr.dest.octet));
+  // Source MAC can be any value.
+  memset(header->ethhdr.src.octet, 0xAB, sizeof(header->ethhdr.src.octet));
+  header->ethhdr.ethertype = htons(NCSI_ETHERTYPE);
+
+  // NC-SI Header
+  header->mc_id = NCSI_MC_ID;
+  header->header_revision = NCSI_HEADER_REV;
+  header->reserved_00 = 0;
+  header->instance_id = current_instance_id;
+  header->control_packet_type = cmd_type;
+  header->channel_id = ch_id;
+  header->payload_length = 0;  // Caller is expected to set this if != 0.
+  memset(header->reserved_01, 0, sizeof(header->reserved_01));
+}
+
+uint32_t ncsi_get_response_size(uint8_t cmd_type)
+{
+  return (cmd_type < ARRAY_SIZE(ncsi_response_size_table))
+             ? ncsi_response_size_table[cmd_type]
+             : 0;
+}
+
+uint32_t ncsi_oem_get_response_size(uint8_t oem_cmd_type)
+{
+  return (oem_cmd_type < ARRAY_SIZE(ncsi_oem_response_size_table))
+             ? ncsi_oem_response_size_table[oem_cmd_type]
+             : 0;
+}
+
+/*
+ * Clear initial state.
+ */
+uint32_t ncsi_cmd_clear_initial_state(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_CLEAR_INITIAL_STATE);
+  return sizeof(ncsi_simple_command_t);
+}
+
+/*
+ * Set MAC address filters.
+ */
+uint32_t ncsi_cmd_set_mac(uint8_t* buf, uint8_t channel_id, mac_addr_t* mac)
+{
+  ncsi_set_mac_command_t* cmd = (ncsi_set_mac_command_t*)buf;
+
+  set_header_fields((ncsi_header_t*)buf, channel_id, NCSI_SET_MAC_ADDRESS);
+  cmd->hdr.payload_length =
+      htons(sizeof(ncsi_set_mac_command_t) - sizeof(ncsi_header_t));
+  memcpy(cmd->mac_addr.octet, mac->octet, sizeof(cmd->mac_addr.octet));
+  cmd->mac_addr_num = 1;
+  // Unicast MAC address (AT=0), enabled (E=1).
+  cmd->misc = 0x01;
+  return sizeof(ncsi_set_mac_command_t);
+}
+
+uint32_t ncsi_cmd_enable_broadcast_filter(uint8_t* buf, uint8_t channel,
+                                          uint32_t filter_settings)
+{
+  ncsi_enable_broadcast_filter_command_t* cmd =
+      (ncsi_enable_broadcast_filter_command_t*)buf;
+  set_header_fields((ncsi_header_t*)buf, channel,
+                    NCSI_ENABLE_BROADCAST_FILTER);
+  cmd->hdr.payload_length = htons(
+      sizeof(ncsi_enable_broadcast_filter_command_t) - sizeof(ncsi_header_t));
+  cmd->filter_settings = htonl(filter_settings);
+  return sizeof(ncsi_enable_broadcast_filter_command_t);
+}
+
+
+uint32_t ncsi_cmd_disable_broadcast_filter(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel,
+                    NCSI_DISABLE_BROADCAST_FILTER);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_enable_channel(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_ENABLE_CHANNEL);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_get_link_status(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_GET_LINK_STATUS);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_reset_channel(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_RESET_CHANNEL);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_enable_tx(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel,
+                    NCSI_ENABLE_CHANNEL_NETWORK_TX);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_get_version(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_GET_VERSION_ID);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_get_capabilities(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_GET_CAPABILITIES);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_get_parameters(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_GET_PARAMETERS);
+  return sizeof(ncsi_simple_command_t);
+}
+
+uint32_t ncsi_cmd_get_passthrough_stats(uint8_t* buf, uint8_t channel)
+{
+  set_header_fields((ncsi_header_t*)buf, channel,
+                    NCSI_GET_PASSTHROUGH_STATISTICS);
+  return sizeof(ncsi_simple_command_t);
+}
+
+/* OEM commands */
+
+uint32_t ncsi_oem_cmd_get_host_mac(uint8_t* buf, uint8_t channel)
+{
+  ncsi_oem_simple_cmd_t* cmd = (ncsi_oem_simple_cmd_t*)buf;
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_OEM_COMMAND);
+  cmd->hdr.payload_length =
+      htons(sizeof(ncsi_oem_simple_cmd_t) - sizeof(ncsi_header_t));
+  cmd->oem_header.manufacturer_id = htonl(NCSI_OEM_MANUFACTURER_ID);
+  memset(cmd->oem_header.reserved, 0, sizeof(cmd->oem_header.reserved));
+  cmd->oem_header.oem_cmd = NCSI_OEM_COMMAND_GET_HOST_MAC;
+  return sizeof(ncsi_oem_simple_cmd_t);
+}
+
+uint32_t ncsi_oem_cmd_get_filter(uint8_t* buf, uint8_t channel)
+{
+  ncsi_oem_simple_cmd_t* cmd = (ncsi_oem_simple_cmd_t*)buf;
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_OEM_COMMAND);
+  cmd->hdr.payload_length =
+      htons(sizeof(ncsi_oem_simple_cmd_t) - sizeof(ncsi_header_t));
+  cmd->oem_header.manufacturer_id = htonl(NCSI_OEM_MANUFACTURER_ID);
+  memset(cmd->oem_header.reserved, 0, sizeof(cmd->oem_header.reserved));
+  cmd->oem_header.oem_cmd = NCSI_OEM_COMMAND_GET_FILTER;
+  return sizeof(ncsi_oem_simple_cmd_t);
+}
+
+uint32_t ncsi_oem_cmd_set_filter(uint8_t* buf, uint8_t channel, mac_addr_t* mac,
+                                 uint32_t ip, uint16_t port, uint8_t flags)
+{
+  ncsi_oem_set_filter_cmd_t* cmd = (ncsi_oem_set_filter_cmd_t*)buf;
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_OEM_COMMAND);
+  cmd->hdr.payload_length =
+      htons(sizeof(ncsi_oem_set_filter_cmd_t) - sizeof(ncsi_header_t));
+  cmd->oem_header.manufacturer_id = htonl(NCSI_OEM_MANUFACTURER_ID);
+  memset(cmd->oem_header.reserved, 0, sizeof(cmd->oem_header.reserved));
+  cmd->oem_header.oem_cmd = NCSI_OEM_COMMAND_SET_FILTER;
+
+  cmd->filter.reserved0 = 0;
+  memcpy(cmd->filter.mac, mac->octet, sizeof(cmd->filter.mac));
+  cmd->filter.ip = htonl(ip);
+  cmd->filter.port = htons(port);
+  cmd->filter.reserved1 = 0;
+  cmd->filter.flags = flags;
+  memset(cmd->filter.regid, 0, sizeof(cmd->filter.regid));  // reserved for set
+  return sizeof(ncsi_oem_set_filter_cmd_t);
+}
+
+uint32_t ncsi_oem_cmd_echo(uint8_t* buf, uint8_t channel, uint8_t pattern[64])
+{
+  ncsi_oem_echo_cmd_t* cmd = (ncsi_oem_echo_cmd_t*)buf;
+  set_header_fields((ncsi_header_t*)buf, channel, NCSI_OEM_COMMAND);
+  cmd->hdr.payload_length =
+      htons(sizeof(ncsi_oem_echo_cmd_t) - sizeof(ncsi_header_t));
+  cmd->oem_header.manufacturer_id = htonl(NCSI_OEM_MANUFACTURER_ID);
+  memset(cmd->oem_header.reserved, 0, sizeof(cmd->oem_header.reserved));
+  cmd->oem_header.oem_cmd = NCSI_OEM_COMMAND_ECHO;
+  memcpy(cmd->pattern, pattern, sizeof(cmd->pattern));
+  return sizeof(ncsi_oem_echo_cmd_t);
+}
+
+ncsi_response_type_t ncsi_validate_response(uint8_t* buf, uint32_t len,
+                                            uint8_t cmd_type, bool is_oem,
+                                            uint32_t expected_size) {
+  if (len < sizeof(ncsi_simple_response_t)) {
+    return NCSI_RESPONSE_UNDERSIZED;
+  }
+
+  const ncsi_simple_response_t* response = (ncsi_simple_response_t*)buf;
+  if (response->response_code || response->reason_code) {
+    return NCSI_RESPONSE_NACK;
+  }
+
+  const uint8_t std_cmd_type = is_oem ? NCSI_OEM_COMMAND : cmd_type;
+  if (response->hdr.control_packet_type != (std_cmd_type | NCSI_RESPONSE)) {
+    return NCSI_RESPONSE_UNEXPECTED_TYPE;
+  }
+
+  if (len < expected_size ||
+      ntohs(response->hdr.payload_length) !=
+          expected_size - sizeof(ncsi_header_t)) {
+    return NCSI_RESPONSE_UNEXPECTED_SIZE;
+  }
+
+  if (is_oem) {
+    /* Since the expected_size was checked above, we know that if this is an oem
+     * command, it is the right size. */
+    const ncsi_oem_simple_response_t* oem_response =
+        (ncsi_oem_simple_response_t*)buf;
+    if (oem_response->oem_header.manufacturer_id !=
+            htonl(NCSI_OEM_MANUFACTURER_ID) ||
+        oem_response->oem_header.oem_cmd != cmd_type) {
+      return NCSI_RESPONSE_OEM_FORMAT_ERROR;
+    }
+  }
+
+  return NCSI_RESPONSE_ACK;
+}
+
+ncsi_response_type_t ncsi_validate_std_response(uint8_t* buf, uint32_t len,
+                                                uint8_t cmd_type) {
+  const uint32_t expected_size = ncsi_get_response_size(cmd_type);
+  return ncsi_validate_response(buf, len, cmd_type, false, expected_size);
+}
+
+ncsi_response_type_t ncsi_validate_oem_response(uint8_t* buf, uint32_t len,
+                                                uint8_t cmd_type) {
+  const uint32_t expected_size = ncsi_oem_get_response_size(cmd_type);
+  return ncsi_validate_response(buf, len, cmd_type, true, expected_size);
+}
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_client.h b/ncsid/src/platforms/nemora/portable/ncsi_client.h
new file mode 100644
index 0000000..0354b30
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_client.h
@@ -0,0 +1,263 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_NCSI_CLIENT_H_
+#define PLATFORMS_NEMORA_PORTABLE_NCSI_CLIENT_H_
+
+/*
+ * Client module for interacting with NC-SI capable network cards.
+ *
+ * DMTF v1.0.0 NC-SI specification:
+ * http://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/net_types.h"
+
+#define CHANNEL_0_ID 0
+#define CHANNEL_1_ID 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Return the state of our connection to the NIC. Does not map to NC-SI spec.
+ * TODO remove this function from here. It is neither defined nor used
+ * in ncsi_client.c.
+ */
+ncsi_connection_state_t ncsi_connection_state(void);
+
+/*
+ * Return the expected length for the response to a given NC-SI comamnds
+ *
+ * Args:
+ *  cmd_type: id for the given commands as defined in the NC-SI spec
+ *
+ * Caveat: returns 0 for commands that have not been implemented yet or for
+ *         NCSI_OEM_COMMAND.
+ */
+uint32_t ncsi_get_response_size(uint8_t cmd_type);
+
+/*
+ * Return the expected length for the response to a given OEM NC-SI comamnds
+ *
+ * Args:
+ *  oem_cmd_type: id for the given OEM command as defined in the
+ *                ncsi_oem_extension_header_t (and not to be confused with the
+ *                id of standard commands)
+ */
+uint32_t ncsi_oem_get_response_size(uint8_t oem_cmd_type);
+
+/*
+ * The following commands write the message to the buffer provided.
+ * The length of the message (including the ethernet header and padding) is
+ * returned.
+ */
+
+/* Standard NC-SI commands */
+
+/*
+ * Construct MAC address filtering command. 8.4.15
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_set_mac_command_t) where command will
+ *       be placed.
+ *  channel: NC-SI channel to filter on (corresponds to a physical port).
+ *  mac_filter: MAC address to match against incoming traffic.
+ */
+uint32_t ncsi_cmd_set_mac(uint8_t* buf, uint8_t channel,
+                          mac_addr_t* mac_filter);
+
+/*
+ * Construct clear initial state command. 8.4.3
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t) where command will be
+ *       placed.
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_clear_initial_state(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct enable broadcast filter command. 8.4.33
+ *
+ * Args:
+ *  filter_settings: filter mask (host order).
+ */
+uint32_t ncsi_cmd_enable_broadcast_filter(uint8_t* buf, uint8_t channel,
+                                          uint32_t filter_settings);
+/*
+ * Construct disable broadcast filter command. 8.4.35
+ *
+ * Note: disable filtering == allow forwarding of broadcast traffic
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_disable_broadcast_filter(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct enable channel command. 8.4.9
+ *
+ * Required before any NC-SI passthrough traffic will go in or out of that
+ * channel.
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_enable_channel(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct reset channel command. 8.4.13
+ *
+ * Put channel into its initial state
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_reset_channel(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct enable TX command. 8.4.15
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_enable_tx(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct get link status command. 8.4.23
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_get_link_status(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct get capabilities command. 8.4.44
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_get_version(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct get capabilities command. 8.4.45
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_get_capabilities(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct get parameters command. 8.4.47
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_get_parameters(uint8_t* buf, uint8_t channel);
+
+/*
+ * Construct get pass-through statistics. 8.4.53
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_simple_command_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_cmd_get_passthrough_stats(uint8_t* buf, uint8_t channel);
+
+/* OEM commands */
+// TODO: Move OEM commands to another file.
+
+/*
+ * Get Host MAC address. Query the NIC for its MAC address(es).
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_oem_simple_cmd_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ */
+uint32_t ncsi_oem_cmd_get_host_mac(uint8_t* buf, uint8_t channel);
+
+/*
+ * Get filter used for RX traffic.
+ */
+uint32_t ncsi_oem_cmd_get_filter(uint8_t* buf, uint8_t channel);
+
+/*
+ * Set filter for RX traffic. Incoming packets that match all the fields
+ * specified here will be forwarded over the NC-SI link.
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_oem_set_filter_cmd_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ *  mac: mac address to filter on (byte array in network order)
+ *  ip: IPv4 address to filter on (little-endian)
+ *  port: TCP/UDP port number to filter on (little-endian)
+ *  flags: bitfield of options.
+ */
+uint32_t ncsi_oem_cmd_set_filter(uint8_t* buf, uint8_t channel, mac_addr_t* mac,
+                                 uint32_t ip, uint16_t port, uint8_t flags);
+
+/*
+ * Send NC-SI packet to test connectivity with NIC.
+ *
+ * Args:
+ *  buf: buffer of length >= sizeof(ncsi_oem_echo_cmd_t)
+ *  channel: NC-SI channel targeted (corresponds to a physical port).
+ *  pattern: echo payload.
+ */
+uint32_t ncsi_oem_cmd_echo(uint8_t* buf, uint8_t channel,
+                           uint8_t pattern[NCSI_OEM_ECHO_PATTERN_SIZE]);
+
+/*
+ * Validate NC-SI response in the buffer and return validation result.
+ * Exposes "expected_size" as part of interface to handle legacy NICs. Avoid
+ * using this function directly, use ncsi_validate_std_response or
+ * ncsi_validate_oem_response instead.
+ *
+ * Args:
+ *  buf: buffer containint NC-SI response.
+ *  len: size of the response in the buffer.
+ *  cmd_type: Id of the command *that was sent* to NIC.
+ *  is_eom: true if the response in the buffer is OEM response.
+ *  expected_size: expected size of the response.
+ */
+ncsi_response_type_t ncsi_validate_response(uint8_t* buf, uint32_t len,
+                                            uint8_t cmd_type, bool is_oem,
+                                            uint32_t expected_size);
+/*
+ * Validate NC-SI response in the buffer and return validation result.
+ *
+ * Args:
+ *  buf: buffer containint NC-SI response.
+ *  len: size of the response in the buffer.
+ *  cmd_type: Id of the command *that was sent* to NIC.
+ */
+ncsi_response_type_t ncsi_validate_std_response(uint8_t* buf, uint32_t len,
+                                                uint8_t cmd_type);
+
+/*
+ * Validate NC-SI OEM response in the buffer and return validation result.
+ *
+ * Args:
+ *  buf: buffer containint NC-SI response.
+ *  len: size of the response in the buffer.
+ *  cmd_type: Id of the OEM command *that was sent* to NIC.
+ */
+ncsi_response_type_t ncsi_validate_oem_response(uint8_t* buf, uint32_t len,
+                                                uint8_t cmd_type);
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_NCSI_CLIENT_H_
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_fsm.c b/ncsid/src/platforms/nemora/portable/ncsi_fsm.c
new file mode 100644
index 0000000..0bef65d
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_fsm.c
@@ -0,0 +1,651 @@
+#include <string.h>
+
+#include <arpa/inet.h>
+
+#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/ncsi_client.h"
+#include "platforms/nemora/portable/ncsi_fsm.h"
+
+#define GO_TO_STATE(variable, state) do { *variable = state; } while (0)
+#define GO_TO_NEXT_STATE(variable) do { (*variable)++; } while (0)
+
+// TODO - This state machine needs to be rewritten, now that we have a
+// better idea of the states and transitions involved.
+// The NC-SI related states of the state machine are currently organized in
+// request/response pairs. However when I added support for the second channel
+// this resulted in more hard-coded pairs which worked okay for X
+// (despite some ugliness, see ch_under_test below) but broke down for X
+// since it only supports 1 channel. For now just add a little more ugliness
+// by stepping by 1 or 3 when going from a pair to the next depending on whether
+// the second channel is supported (1) or not (3 - skip over the second channel
+// pair).
+#define GO_TO_NEXT_CHANNEL(variable, ncsi_state)\
+  do { *variable += (ncsi_state->channel_count == 1)\
+      ? 3 : 1; } while (0)
+
+static void ncsi_fsm_clear_state(ncsi_state_t* ncsi_state) {
+  // This implicitly resets:
+  //   l2_config_state   to NCSI_STATE_L2_CONFIG_BEGIN
+  //   l3l4_config_state to NCSI_STATE_L3L4_CONFIG_BEGIN
+  //   test_state        to NCSI_STATE_TEST_BEGIN
+  memset(ncsi_state, 0, sizeof(ncsi_state_t));
+}
+
+static void ncsi_fsm_fail(ncsi_state_t* ncsi_state,
+                          network_debug_t* network_debug) {
+  network_debug->ncsi.fail_count++;
+  memcpy(&network_debug->ncsi.state_that_failed, ncsi_state,
+         sizeof(network_debug->ncsi.state_that_failed));
+  ncsi_fsm_clear_state(ncsi_state);
+}
+
+ncsi_connection_state_t ncsi_fsm_connection_state(
+    const ncsi_state_t* ncsi_state, const network_debug_t* network_debug) {
+  if (!network_debug->ncsi.enabled) {
+    return NCSI_CONNECTION_DISABLED;
+  }
+  if (ncsi_state->l2_config_state != NCSI_STATE_L2_CONFIG_END) {
+    if (network_debug->ncsi.loopback) {
+      return NCSI_CONNECTION_LOOPBACK;
+    } else {
+      return NCSI_CONNECTION_DOWN;
+    }
+  }
+  if (ncsi_state->l3l4_config_state != NCSI_STATE_L3L4_CONFIG_END) {
+    return NCSI_CONNECTION_UP;
+  }
+  return NCSI_CONNECTION_UP_AND_CONFIGURED;
+}
+
+ncsi_response_type_t ncsi_fsm_poll_l2_config(ncsi_state_t* ncsi_state,
+                                             network_debug_t* network_debug,
+                                             ncsi_buf_t* ncsi_buf,
+                                             mac_addr_t* mac) {
+  ncsi_l2_config_state_t* const state_variable = &ncsi_state->l2_config_state;
+  ncsi_response_type_t ncsi_response_type = NCSI_RESPONSE_NONE;
+  uint32_t len = 0;
+
+  switch(*state_variable) {
+  case NCSI_STATE_RESTART:
+    if (++ncsi_state->restart_delay_count >= NCSI_FSM_RESTART_DELAY_COUNT) {
+      network_debug->ncsi.pending_restart = false;
+      GO_TO_NEXT_STATE(state_variable);
+      ncsi_state->restart_delay_count = 0;
+    }
+    break;
+  case NCSI_STATE_CLEAR_0: // necessary to get mac
+    len = ncsi_cmd_clear_initial_state(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_CLEAR_0_RESPONSE:
+    {
+      bool loopback = false;
+      ncsi_response_type = ncsi_validate_std_response(
+          ncsi_buf->data, ncsi_buf->len, NCSI_CLEAR_INITIAL_STATE);
+      if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+        GO_TO_NEXT_STATE(state_variable);
+      } else {
+        // If we did not receive a response but we did receive something,
+        // then maybe there is a physical loopback, so check that we received
+        // exactly what we sent
+        if (ncsi_buf->len >= sizeof(ncsi_simple_command_t)) {
+          ncsi_simple_command_t expected_loopback_data;
+          (void)ncsi_cmd_clear_initial_state((uint8_t*)&expected_loopback_data,
+                                             CHANNEL_0_ID);
+          if (0 == memcmp((uint8_t*)&expected_loopback_data,
+                          ncsi_buf->data, sizeof(expected_loopback_data))) {
+            loopback = true;
+          }
+        }
+        ncsi_fsm_fail(ncsi_state, network_debug);
+      }
+      network_debug->ncsi.loopback = loopback;
+    }
+    break;
+  case NCSI_STATE_GET_VERSION:
+    len = ncsi_cmd_get_version(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_GET_VERSION_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_GET_VERSION_ID);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      ncsi_version_id_response_t* get_version_response =
+          (ncsi_version_id_response_t*)ncsi_buf->data;
+      // TODO - Add check for this being actually X
+      network_debug->ncsi.mlx_legacy =
+          ((ntohl(get_version_response->version.firmware_version) >> 24) ==
+           0x08);
+      GO_TO_NEXT_CHANNEL(state_variable, ncsi_state);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_GET_CAPABILITIES:
+    len = ncsi_cmd_get_capabilities(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_GET_CAPABILITIES_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_GET_CAPABILITIES);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      const ncsi_capabilities_response_t* get_capabilities_response =
+        (ncsi_capabilities_response_t*) ncsi_buf->data;
+      if (1 != get_capabilities_response->channel_count &&
+          2 != get_capabilities_response->channel_count) {
+        /* TODO: Return Error
+        CPRINTF("[NCSI Unsupported channel count %d]\n",
+                get_capabilities_response->channel_count);
+          */
+        ncsi_fsm_fail(ncsi_state, network_debug);
+      } else {
+        ncsi_state->channel_count =
+          get_capabilities_response->channel_count;
+        GO_TO_NEXT_CHANNEL(state_variable, ncsi_state);
+      }
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_CLEAR_1:
+    len = ncsi_cmd_clear_initial_state(ncsi_buf->data, CHANNEL_1_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_CLEAR_1_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_CLEAR_INITIAL_STATE);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_RESET_CHANNEL_0:
+    if (network_debug->ncsi.pending_stop) {
+      len = ncsi_cmd_reset_channel(ncsi_buf->data, CHANNEL_0_ID);
+      GO_TO_NEXT_STATE(state_variable);
+    } else {
+      // skip resetting channels
+      GO_TO_STATE(state_variable, NCSI_STATE_GET_MAC);
+    }
+    break;
+  case NCSI_STATE_RESET_CHANNEL_0_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_RESET_CHANNEL);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_CHANNEL(state_variable, ncsi_state);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_RESET_CHANNEL_1:
+    len = ncsi_cmd_reset_channel(ncsi_buf->data, CHANNEL_1_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_RESET_CHANNEL_1_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_RESET_CHANNEL);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_STOPPED:
+    network_debug->ncsi.pending_stop = false;
+    // Reset the L2 config state machine through fail(). This state machine
+    // will not be executed again so long as 'enabled' is false.
+    network_debug->ncsi.enabled = false;
+    ncsi_fsm_fail(ncsi_state, network_debug);
+    break;
+    // TODO: Add check for MFG ID and firmware version before trying
+    // any OEM commands.
+  case NCSI_STATE_GET_MAC:
+    // Only get MAC from channel 0, because that's the one that identifies the
+    // host machine (for both MDB and DHCP).
+    len = ncsi_oem_cmd_get_host_mac(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_GET_MAC_RESPONSE:
+    ncsi_response_type = ncsi_validate_oem_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_OEM_COMMAND_GET_HOST_MAC);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      ncsi_host_mac_response_t* get_mac_response =
+        (ncsi_host_mac_response_t*) ncsi_buf->data;
+      memcpy(mac->octet, get_mac_response->mac, sizeof(mac_addr_t));
+      GO_TO_NEXT_STATE(state_variable);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_SET_MAC_FILTER_0:
+    len = ncsi_cmd_set_mac(ncsi_buf->data, CHANNEL_0_ID, mac);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_SET_MAC_FILTER_0_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_SET_MAC_ADDRESS);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_CHANNEL(state_variable, ncsi_state);
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_SET_MAC_FILTER_1:
+    len = ncsi_cmd_set_mac(ncsi_buf->data, CHANNEL_1_ID, mac);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_SET_MAC_FILTER_1_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_SET_MAC_ADDRESS);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_ENABLE_CHANNEL_0:
+    len = ncsi_cmd_enable_channel(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_ENABLE_CHANNEL_0_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_ENABLE_CHANNEL);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_CHANNEL(state_variable, ncsi_state);
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_ENABLE_CHANNEL_1:
+    len = ncsi_cmd_enable_channel(ncsi_buf->data, CHANNEL_1_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_ENABLE_CHANNEL_1_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_ENABLE_CHANNEL);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  // TODO: Enable broadcast filter to block ARP.
+  case NCSI_STATE_ENABLE_TX:
+    // The NIC FW transmits all passthrough TX on the lowest enabled channel,
+    // so there is no point in enabling TX on the second channel.
+    // TODO: - In the future we may add a check for link status,
+    //         in which case we may want to intelligently disable ch.0
+    //         (if down) and enable ch.1
+    len = ncsi_cmd_enable_tx(ncsi_buf->data, CHANNEL_0_ID);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_ENABLE_TX_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_ENABLE_CHANNEL_NETWORK_TX);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else{
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_L2_CONFIG_END:
+    // Done
+    break;
+  default:
+    ncsi_fsm_fail(ncsi_state, network_debug);
+    break;
+  }
+
+  ncsi_buf->len = len;
+  return ncsi_response_type;
+}
+
+static uint32_t write_ncsi_oem_config_filter(uint8_t* buffer, uint8_t channel,
+                                             network_debug_t* network_debug,
+                                             mac_addr_t* mac,
+                                             uint32_t ipv4_addr,
+                                             uint16_t rx_port) {
+  uint32_t len;
+  (void)ipv4_addr;
+  if (network_debug->ncsi.oem_filter_disable) {
+    mac_addr_t zero_mac = {.octet = {0,}};
+    len = ncsi_oem_cmd_set_filter(buffer, channel, &zero_mac, 0, 0, 0);
+
+  } else {
+    len = ncsi_oem_cmd_set_filter(buffer, channel, mac, 0, rx_port, 1);
+  }
+  return len;
+}
+
+ncsi_response_type_t ncsi_fsm_poll_l3l4_config(ncsi_state_t* ncsi_state,
+                                               network_debug_t* network_debug,
+                                               ncsi_buf_t* ncsi_buf,
+                                               mac_addr_t* mac,
+                                               uint32_t ipv4_addr,
+                                               uint16_t rx_port) {
+  uint32_t len = 0;
+  ncsi_response_type_t ncsi_response_type = NCSI_RESPONSE_NONE;
+
+  if (ncsi_state->l3l4_config_state == NCSI_STATE_L3L4_CONFIG_BEGIN) {
+    ncsi_state->l3l4_channel = 0;
+    ncsi_state->l3l4_waiting_response = false;
+    ncsi_state->l3l4_config_state = NCSI_STATE_CONFIG_FILTERS;
+  }
+
+  /* Go through every state with every channel. */
+  if (ncsi_state->l3l4_waiting_response) {
+    ncsi_response_type = ncsi_validate_oem_response(
+        ncsi_buf->data, ncsi_buf->len, ncsi_state->l3l4_command);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      /* Current channel ACK'ed, go to the next one. */
+      ncsi_state->l3l4_channel++;
+      if (ncsi_state->l3l4_channel >= ncsi_state->channel_count) {
+        /* All channels done, reset channel number and go to the next state.
+         * NOTE: This assumes that state numbers are sequential.*/
+        ncsi_state->l3l4_config_state += 1;
+        ncsi_state->l3l4_channel = 0;
+      }
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+
+    ncsi_state->l3l4_waiting_response = false;
+  } else {
+    // Send appropriate command.
+    switch(ncsi_state->l3l4_config_state) {
+      case NCSI_STATE_CONFIG_FILTERS:
+        len =
+            write_ncsi_oem_config_filter(ncsi_buf->data, ncsi_state->l3l4_channel,
+                                         network_debug, mac, ipv4_addr, rx_port);
+        ncsi_state->l3l4_command = NCSI_OEM_COMMAND_SET_FILTER;
+        ncsi_state->l3l4_waiting_response = true;
+        break;
+      default:
+        ncsi_fsm_fail(ncsi_state, network_debug);
+        break;
+    }
+  }
+
+  ncsi_buf->len = len;
+  return ncsi_response_type;
+}
+
+/*
+ * Start a sub-section of the state machine that runs health checks.
+ * This is dependent on the NC-SI configuration being completed
+ * (e.g. ncsi_channel_count must be known).
+ */
+static bool ncsi_fsm_start_test(network_debug_t* network_debug,
+                                uint8_t channel_count) {
+  if (network_debug->ncsi.test.max_tries > 0) {
+    network_debug->ncsi.test.runs++;
+    if (2 == channel_count) {
+      network_debug->ncsi.test.ch_under_test ^= 1;
+    } else {
+      network_debug->ncsi.test.ch_under_test = 0;
+    }
+    return true;
+  }
+  return false;
+}
+
+/*
+ * Allow for a limited number of retries for the NC-SI test because
+ * it can fail under heavy TCP/IP load (since NC-SI responses share
+ * the RX buffers in chip/$(CHIP)/net.c with TCP/IP incoming traffic).
+ */
+static bool ncsi_fsm_retry_test(network_debug_t* network_debug) {
+  const uint8_t max_tries = network_debug->ncsi.test.max_tries;
+  if (max_tries) {
+    uint8_t remaining_tries = max_tries - 1 - network_debug->ncsi.test.tries;
+    if (remaining_tries > 0) {
+      network_debug->ncsi.test.tries++;
+      return true;
+    }
+  }
+  network_debug->ncsi.test.tries = 0;
+  return false;
+}
+
+/*
+ * Returns true if we have executed an NC-SI Get OEM Filter command for all
+ * channels and the flags indicate that it is running in hostless mode.
+ * This means that we can DHCP/ARP if needed.
+ * Otherwise returns false.
+ *
+ * NOTE: We default to false, if we cannot complete the L2 config state
+ *   machine or the test sequence.
+ */
+bool ncsi_fsm_is_nic_hostless(const ncsi_state_t* ncsi_state) {
+  uint8_t flags = ncsi_state->flowsteering[0].flags;
+  if (ncsi_state->channel_count > 1) {
+    flags &= ncsi_state->flowsteering[1].flags;
+  }
+  return flags & NCSI_OEM_FILTER_FLAGS_HOSTLESS;
+}
+
+static void ncsi_fsm_update_passthrough_stats(
+    const ncsi_passthrough_stats_t* increment, network_debug_t* network_debug) {
+  ncsi_passthrough_stats_t* accumulated =
+      &network_debug->ncsi.pt_stats_be[network_debug->ncsi.test.ch_under_test];
+#define ACCUMULATE_PT_STATS(stat) accumulated->stat += increment->stat;
+  ACCUMULATE_PT_STATS(tx_packets_received_hi);
+  ACCUMULATE_PT_STATS(tx_packets_received_lo);
+  ACCUMULATE_PT_STATS(tx_packets_dropped);
+  ACCUMULATE_PT_STATS(tx_channel_errors);
+  ACCUMULATE_PT_STATS(tx_undersized_errors);
+  ACCUMULATE_PT_STATS(tx_oversized_errors);
+  ACCUMULATE_PT_STATS(rx_packets_received);
+  ACCUMULATE_PT_STATS(rx_packets_dropped);
+  ACCUMULATE_PT_STATS(rx_channel_errors);
+  ACCUMULATE_PT_STATS(rx_undersized_errors);
+  ACCUMULATE_PT_STATS(rx_oversized_errors);
+#undef ACCUMULATE_PT_STATS
+}
+
+static void ncsi_fsm_update_passthrough_stats_legacy(
+    const ncsi_passthrough_stats_legacy_t* read,
+    network_debug_t* network_debug) {
+  // Legacy MLX response does not include tx_packets_received_hi and also MLX
+  // counters
+  // are not reset on read (i.e. we cannot accumulate them).
+  ncsi_passthrough_stats_t* accumulated =
+      &network_debug->ncsi.pt_stats_be[network_debug->ncsi.test.ch_under_test];
+  accumulated->tx_packets_received_hi = 0;
+  accumulated->tx_packets_received_lo = read->tx_packets_received;
+#define COPY_PT_STATS(stat) accumulated->stat = read->stat;
+  COPY_PT_STATS(tx_packets_dropped);
+  COPY_PT_STATS(tx_channel_errors);
+  COPY_PT_STATS(tx_undersized_errors);
+  COPY_PT_STATS(tx_oversized_errors);
+  COPY_PT_STATS(rx_packets_received);
+  COPY_PT_STATS(rx_packets_dropped);
+  COPY_PT_STATS(rx_channel_errors);
+  COPY_PT_STATS(rx_undersized_errors);
+  COPY_PT_STATS(rx_oversized_errors);
+#undef COPY_PT_STATS
+}
+
+ncsi_response_type_t ncsi_fsm_poll_test(ncsi_state_t* ncsi_state,
+                                        network_debug_t* network_debug,
+                                        ncsi_buf_t* ncsi_buf, mac_addr_t* mac,
+                                        uint32_t ipv4_addr, uint16_t rx_port) {
+  ncsi_test_state_t* const state_variable =
+      &ncsi_state->test_state;
+  ncsi_response_type_t ncsi_response_type = NCSI_RESPONSE_NONE;
+  uint32_t len = 0;
+
+  switch(*state_variable) {
+  case NCSI_STATE_TEST_PARAMS:
+    if (ncsi_fsm_start_test(network_debug, ncsi_state->channel_count)) {
+      GO_TO_NEXT_STATE(state_variable);
+    } else {
+      // debugging only - skip test by setting max_tries to 0
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_END);
+    }
+    break;
+  case NCSI_STATE_ECHO:
+    len = ncsi_oem_cmd_echo(ncsi_buf->data,
+                            network_debug->ncsi.test.ch_under_test,
+                            network_debug->ncsi.test.ping.tx);
+    network_debug->ncsi.test.ping.tx_count++;
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_ECHO_RESPONSE:
+    ncsi_response_type = ncsi_validate_oem_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_OEM_COMMAND_ECHO);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      network_debug->ncsi.test.ping.rx_count++;
+      ncsi_oem_echo_response_t* echo_response =
+        (ncsi_oem_echo_response_t*) ncsi_buf->data;
+      if (0 == memcmp(echo_response->pattern,
+                      network_debug->ncsi.test.ping.tx,
+                      sizeof(echo_response->pattern))) {
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      } else {
+        network_debug->ncsi.test.ping.bad_rx_count++;
+        memcpy(network_debug->ncsi.test.ping.last_bad_rx,
+               echo_response->pattern,
+               sizeof(network_debug->ncsi.test.ping.last_bad_rx));
+      }
+    }
+    if (ncsi_fsm_retry_test(network_debug)) {
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_BEGIN);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_CHECK_FILTERS:
+    len = ncsi_oem_cmd_get_filter(ncsi_buf->data,
+                                  network_debug->ncsi.test.ch_under_test);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_CHECK_FILTERS_RESPONSE:
+    ncsi_response_type = ncsi_validate_oem_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_OEM_COMMAND_GET_FILTER);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      ncsi_oem_get_filter_response_t* get_filter_response =
+        (ncsi_oem_get_filter_response_t*) ncsi_buf->data;
+      // Stash away response because it contains information about NIC mode
+      memcpy((void*)ncsi_state->flowsteering[
+          network_debug->ncsi.test.ch_under_test].regid,
+             (void*)get_filter_response->filter.regid,
+             sizeof(ncsi_state->flowsteering[0].regid));
+      ncsi_state->flowsteering[
+          network_debug->ncsi.test.ch_under_test].flags =
+          get_filter_response->filter.flags;
+      // Test filter parameters only if we know that we configured the NIC,
+      // and if the NIC is in host-based mode (it appears to return all zeros's
+      // in hostless mode!).
+      if (NCSI_STATE_L3L4_CONFIG_END != ncsi_state->l3l4_config_state ||
+          ncsi_fsm_is_nic_hostless(ncsi_state)) {
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      }
+      ncsi_oem_set_filter_cmd_t expected;
+      (void)write_ncsi_oem_config_filter(
+          (uint8_t*)&expected, network_debug->ncsi.test.ch_under_test,
+          network_debug, mac, ipv4_addr, rx_port);
+      /* TODO: handle these responses in error reporting routine */
+      if (0 != memcmp((void*)&get_filter_response->filter.mac,
+                       (void*)&expected.filter.mac,
+                       sizeof(expected.filter.mac))) {
+        ncsi_response_type = NCSI_RESPONSE_UNEXPECTED_PARAMS;
+      } else if (get_filter_response->filter.ip != expected.filter.ip ||
+            get_filter_response->filter.port != expected.filter.port) {
+        ncsi_response_type = NCSI_RESPONSE_UNEXPECTED_PARAMS;
+      } else {
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      }
+    }
+    if (ncsi_fsm_retry_test(network_debug)) {
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_BEGIN);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_GET_PT_STATS:
+    len = ncsi_cmd_get_passthrough_stats(
+        ncsi_buf->data, network_debug->ncsi.test.ch_under_test);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_GET_PT_STATS_RESPONSE:
+    if (!network_debug->ncsi.mlx_legacy) {
+      ncsi_response_type = ncsi_validate_std_response(
+          ncsi_buf->data, ncsi_buf->len, NCSI_GET_PASSTHROUGH_STATISTICS);
+      if (ncsi_response_type == NCSI_RESPONSE_ACK) {
+        const ncsi_passthrough_stats_response_t* response =
+            (const ncsi_passthrough_stats_response_t*)ncsi_buf->data;
+        ncsi_fsm_update_passthrough_stats(&response->stats, network_debug);
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      }
+    } else {
+      uint32_t response_size =
+          ncsi_get_response_size(NCSI_GET_PASSTHROUGH_STATISTICS) -
+          sizeof(uint32_t);
+      ncsi_response_type = ncsi_validate_response(
+          ncsi_buf->data, ncsi_buf->len, NCSI_GET_PASSTHROUGH_STATISTICS, false,
+          response_size);
+      if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+        const ncsi_passthrough_stats_legacy_response_t* legacy_response =
+            (const ncsi_passthrough_stats_legacy_response_t*)ncsi_buf->data;
+        ncsi_fsm_update_passthrough_stats_legacy(&legacy_response->stats,
+                                                 network_debug);
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      }
+    }
+    if (ncsi_fsm_retry_test(network_debug)) {
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_BEGIN);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_GET_LINK_STATUS:
+    // We only care about ch.0 link status because that's the only one we use
+    // to transmit.
+    len = ncsi_cmd_get_link_status(ncsi_buf->data, 0);
+    GO_TO_NEXT_STATE(state_variable);
+    break;
+  case NCSI_STATE_GET_LINK_STATUS_RESPONSE:
+    ncsi_response_type = ncsi_validate_std_response(
+        ncsi_buf->data, ncsi_buf->len, NCSI_GET_LINK_STATUS);
+    if (NCSI_RESPONSE_ACK == ncsi_response_type) {
+      const ncsi_link_status_response_t* response =
+          (const ncsi_link_status_response_t*)ncsi_buf->data;
+      const uint32_t link_status = ntohl(response->link_status.link_status);
+      if (link_status & NCSI_LINK_STATUS_UP) {
+        GO_TO_NEXT_STATE(state_variable);
+        break;
+      }
+      // TODO: report this error.
+      // CPRINTF("[NCSI Link Status down 0x%08lx]\n", link_status);
+    }
+    if (ncsi_fsm_retry_test(network_debug)) {
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_BEGIN);
+    } else {
+      ncsi_fsm_fail(ncsi_state, network_debug);
+    }
+    break;
+  case NCSI_STATE_TEST_END:
+    network_debug->ncsi.test.tries = 0;
+    if (network_debug->ncsi.pending_restart) {
+      ncsi_fsm_fail(ncsi_state, network_debug); // (Ab)use fail to restart.
+    }
+    if (++ncsi_state->retest_delay_count >= NCSI_FSM_RETEST_DELAY_COUNT) {
+      GO_TO_STATE(state_variable, NCSI_STATE_TEST_BEGIN);
+      ncsi_state->retest_delay_count = 0;
+    }
+    break;
+  default:
+    ncsi_fsm_fail(ncsi_state, network_debug);
+    break;
+  }
+
+  ncsi_buf->len = len;
+  return ncsi_response_type;
+}
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_fsm.h b/ncsid/src/platforms/nemora/portable/ncsi_fsm.h
new file mode 100644
index 0000000..9ab2d82
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_fsm.h
@@ -0,0 +1,219 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_NCSI_FSM_H_
+#define PLATFORMS_NEMORA_PORTABLE_NCSI_FSM_H_
+
+/* Nemora NC-SI (Finite) State Machine implementation */
+
+#include <stdint.h>
+
+#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/net_types.h"
+
+/* TODO put this into config somewhere? */
+#define NCSI_FSM_RESTART_DELAY_COUNT 100
+#define NCSI_FSM_RETEST_DELAY_COUNT 100
+
+/* The network state is defined as a combination of the NC-SI connection state
+ * and the network configuration. However the two cannot be decoupled:
+ * - we cannot DHCP unless the NC-SI connection is up
+ * - we cannot do the OEM L3/L4 NC-SI configuration unless we have a valid
+ *   network configuration
+ *
+ * For additional complexity we cannot get DHCP/ARP responses after the host
+ * has loaded the Mellanox NIC driver but we want to be able to periodically
+ * test the NC-SI connection regardless of whether we have network configuration
+ * (so that flaky cables can be troubleshooted using the host interface).
+ *
+ * For this reason there are actually 3 NC-SI finite state machines:
+ * - L2 configuration (i.e. enabling all available NC-SI channel for passthrough
+ *   RX and TX, although only TX will work after the host loads the NIC driver)
+ * - L3/L4 configuration (i.e. configuring flow steering for RX traffic that
+ *   matches our IP address and dedicated Nemora port so that we can receive
+ *   Nemora requests even after the host loaded the NIC driver)
+ * - Connection test (i.e. periodically doing a ping test between the EC and the
+ *   NIC) and also ensuring that L3/L4 configuration parameters have not been
+ *   wiped out)
+ *
+ * For good karma, try to keep the state machines as linear as possible (one
+ * step after the other).
+ */
+
+typedef enum {
+  // First
+  NCSI_STATE_L2_CONFIG_BEGIN,
+  // Actual sequence
+  NCSI_STATE_RESTART = NCSI_STATE_L2_CONFIG_BEGIN,
+  NCSI_STATE_CLEAR_0,
+  NCSI_STATE_CLEAR_0_RESPONSE,
+  NCSI_STATE_GET_VERSION,
+  NCSI_STATE_GET_VERSION_RESPONSE,
+  NCSI_STATE_GET_CAPABILITIES,
+  NCSI_STATE_GET_CAPABILITIES_RESPONSE,
+  NCSI_STATE_CLEAR_1,
+  NCSI_STATE_CLEAR_1_RESPONSE,
+  NCSI_STATE_RESET_CHANNEL_0,
+  NCSI_STATE_RESET_CHANNEL_0_RESPONSE,
+  NCSI_STATE_RESET_CHANNEL_1,
+  NCSI_STATE_RESET_CHANNEL_1_RESPONSE,
+  NCSI_STATE_STOPPED,
+  NCSI_STATE_GET_MAC,
+  NCSI_STATE_GET_MAC_RESPONSE,
+  NCSI_STATE_SET_MAC_FILTER_0,
+  NCSI_STATE_SET_MAC_FILTER_0_RESPONSE,
+  NCSI_STATE_SET_MAC_FILTER_1,
+  NCSI_STATE_SET_MAC_FILTER_1_RESPONSE,
+  NCSI_STATE_ENABLE_CHANNEL_0,
+  NCSI_STATE_ENABLE_CHANNEL_0_RESPONSE,
+  NCSI_STATE_ENABLE_CHANNEL_1,
+  NCSI_STATE_ENABLE_CHANNEL_1_RESPONSE,
+  NCSI_STATE_ENABLE_TX,
+  NCSI_STATE_ENABLE_TX_RESPONSE,
+  // Last
+  NCSI_STATE_L2_CONFIG_END
+} ncsi_l2_config_state_t;
+
+typedef enum {
+  // First
+  NCSI_STATE_L3L4_CONFIG_BEGIN,
+  // Actual sequence
+  NCSI_STATE_CONFIG_FILTERS,
+  // Last
+  NCSI_STATE_L3L4_CONFIG_END
+} ncsi_l3l4_config_state_t;
+
+typedef enum {
+  // First
+  NCSI_STATE_TEST_BEGIN,
+  // Actual sequence
+  NCSI_STATE_TEST_PARAMS = NCSI_STATE_TEST_BEGIN,
+  NCSI_STATE_ECHO,
+  NCSI_STATE_ECHO_RESPONSE,
+  NCSI_STATE_CHECK_FILTERS,
+  NCSI_STATE_CHECK_FILTERS_RESPONSE,
+  NCSI_STATE_GET_PT_STATS,
+  NCSI_STATE_GET_PT_STATS_RESPONSE,
+  NCSI_STATE_GET_LINK_STATUS,
+  NCSI_STATE_GET_LINK_STATUS_RESPONSE,
+  // Last
+  NCSI_STATE_TEST_END
+} ncsi_test_state_t;
+
+typedef struct {
+  ncsi_l2_config_state_t l2_config_state;
+  ncsi_l3l4_config_state_t l3l4_config_state;
+  ncsi_test_state_t test_state;
+  // Last (OEM) command that was sent. (L3L4 SM only)
+  // Valid only if l3l4_waiting_response is true.
+  uint8_t l3l4_command;
+  // Number of the channel we are currently operating on. (L3L4 SM only)
+  uint8_t l3l4_channel;
+  // If true, means the request was sent and we are waiting for response.
+  bool l3l4_waiting_response;
+  uint8_t channel_count;
+  // The re-start and re-test delays ensures that we can flush the DMA
+  // buffers of potential out-of-sequence NC-SI packets (e.g. from
+  // packet that may have been received shortly after we timed out on
+  // them). The re-test delays also reduce the effect of NC-SI
+  // testing on more useful traffic.
+  uint8_t restart_delay_count;
+  uint8_t retest_delay_count;
+  struct {
+    uint8_t flags;
+    uint8_t regid[8];
+  } flowsteering[2];
+} ncsi_state_t;
+
+// Debug variables.
+// TODO - Change name to something more meaningful since the NC-SI test
+//   is not a debug-only feature.
+typedef struct {
+  uint32_t task_count;
+  uint32_t host_ctrl_flags;
+  struct {
+    bool enabled;
+    bool pending_stop;
+    bool pending_restart;
+    bool oem_filter_disable;
+    bool loopback;
+    bool mlx_legacy;
+    uint32_t fail_count;
+    ncsi_state_t state_that_failed;
+    uint32_t tx_count;
+    uint32_t rx_count;
+    uint32_t tx_error_count;
+    struct {
+      uint32_t timeout_count;
+      uint32_t oversized_count;
+      uint32_t undersized_count;
+      uint32_t nack_count;
+      uint32_t unexpected_size_count;
+      uint32_t unexpected_type_count;
+    } rx_error;
+    struct {
+      uint32_t runs;
+      uint8_t ch_under_test;
+      uint8_t tries;
+      uint8_t max_tries;  // 0 = skip test, 1 = restart on failure, > 1 = retry
+      struct {
+        uint8_t tx[NCSI_OEM_ECHO_PATTERN_SIZE];
+        uint32_t tx_count;
+        uint32_t rx_count;
+        uint32_t bad_rx_count;
+        uint8_t last_bad_rx[NCSI_OEM_ECHO_PATTERN_SIZE];
+      } ping;
+    } test;
+    ncsi_passthrough_stats_t pt_stats_be[2];  // big-endian as received from NIC
+  } ncsi;
+} network_debug_t;
+
+typedef struct {
+  uint8_t data[ETH_BUFFER_SIZE];
+  uint32_t len;  // Non-zero when there's a new NC-SI response.
+} ncsi_buf_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ncsi_response_type_t ncsi_fsm_poll_l2_config(ncsi_state_t* ncsi_state,
+                                             network_debug_t* network_debug,
+                                             ncsi_buf_t* ncsi_buf,
+                                             mac_addr_t* mac);
+
+ncsi_response_type_t ncsi_fsm_poll_l3l4_config(ncsi_state_t* ncsi_state,
+                                               network_debug_t* network_debug,
+                                               ncsi_buf_t* ncsi_buf,
+                                               mac_addr_t* mac,
+                                               uint32_t ipv4_addr,
+                                               uint16_t rx_port);
+
+ncsi_response_type_t ncsi_fsm_poll_test(ncsi_state_t* ncsi_state,
+                                        network_debug_t* network_debug,
+                                        ncsi_buf_t* ncsi_buf, mac_addr_t* mac,
+                                        uint32_t ipv4_addr, uint16_t rx_port);
+
+/*
+ * Report a global state of the NC-SI connection as a function of the state
+ * of the 3 finite state machines.
+ * Note: Additionally for the case where the connection is down it reports
+ *   whether a loopback is inferred.
+ */
+ncsi_connection_state_t ncsi_fsm_connection_state(
+    const ncsi_state_t* ncsi_state, const network_debug_t* network_debug);
+
+/*
+ * Returns true if we have executed an NC-SI Get OEM Filter command for all
+ * channels and the flags indicate that it is running in hostless mode.
+ * This means that we can DHCP/ARP if needed.
+ * Otherwise returns false.
+ *
+ * NOTE: We default to false, if we cannot complete the L2 config state
+ *   machine or the test sequence.
+ */
+bool ncsi_fsm_is_nic_hostless(const ncsi_state_t* ncsi_state);
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_NCSI_FSM_H_
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_server.c b/ncsid/src/platforms/nemora/portable/ncsi_server.c
new file mode 100644
index 0000000..c7bc5e7
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_server.c
@@ -0,0 +1,160 @@
+/*
+ * Library of NC-SI commands compliant with version 1.0.0.
+ *
+ * This implements a subset of the commands provided in the specification.
+ *
+ * Checksums are optional and not implemented here. All NC-SI checksums are set
+ * to 0 to indicate that per 8.2.2.3.
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <netinet/in.h>
+
+#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/ncsi_server.h"
+
+
+void ncsi_build_response_header(const uint8_t* request_buf,
+                                uint8_t* response_buf, uint16_t response_code,
+                                uint16_t reason_code, uint16_t payload_length) {
+  /* Copy the header from the command */
+  memcpy(response_buf, request_buf, sizeof(ncsi_header_t));
+  ncsi_simple_response_t* response = (ncsi_simple_response_t*)response_buf;
+  response->response_code = response_code;
+  response->reason_code = reason_code;
+
+  const ncsi_header_t* request_header = (const ncsi_header_t*)request_buf;
+  response->hdr.control_packet_type =
+      request_header->control_packet_type | NCSI_RESPONSE;
+  response->hdr.payload_length = htons(payload_length);
+}
+
+uint32_t ncsi_build_simple_ack(const uint8_t* request_buf,
+                               uint8_t* response_buf) {
+  /* Copy the header from the command */
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      sizeof(ncsi_simple_response_t) - sizeof(ncsi_header_t));
+
+  return sizeof(ncsi_simple_response_t);
+}
+
+uint32_t ncsi_build_simple_nack(const uint8_t* request_buf,
+                                uint8_t* response_buf, uint16_t response_code,
+                                uint16_t reason_code) {
+  ncsi_build_response_header(
+      request_buf, response_buf, response_code, reason_code,
+      sizeof(ncsi_simple_response_t) - sizeof(ncsi_header_t));
+
+  return sizeof(ncsi_simple_response_t);
+}
+
+static void ncsi_build_oem_ack(const uint8_t* request_buf,
+                               uint8_t* response_buf, uint32_t response_size) {
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      response_size - sizeof(ncsi_header_t));
+  const ncsi_oem_simple_cmd_t* oem_command =
+      (const ncsi_oem_simple_cmd_t*)request_buf;
+  ncsi_oem_simple_response_t* oem_response =
+      (ncsi_oem_simple_response_t*)response_buf;
+  memmove(&oem_response->oem_header, &oem_command->oem_header,
+          sizeof(ncsi_oem_extension_header_t));
+  oem_response->oem_header.manufacturer_id = htonl(NCSI_OEM_MANUFACTURER_ID);
+}
+
+uint32_t ncsi_build_version_id_ack(const uint8_t* request_buf,
+                                   uint8_t* response_buf,
+                                   const ncsi_version_id_t* version_id) {
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      sizeof(ncsi_version_id_response_t) - sizeof(ncsi_header_t));
+  ncsi_version_id_response_t* version_id_response =
+      (ncsi_version_id_response_t*)response_buf;
+  memcpy(&version_id_response->version, version_id, sizeof(ncsi_version_id_t));
+  return sizeof(ncsi_version_id_response_t);
+}
+
+uint32_t ncsi_build_oem_get_mac_ack(const uint8_t* request_buf,
+                                    uint8_t* response_buf,
+                                    const mac_addr_t* mac) {
+  ncsi_build_oem_ack(request_buf, response_buf,
+                     sizeof(ncsi_host_mac_response_t));
+  ncsi_host_mac_response_t* response = (ncsi_host_mac_response_t*)response_buf;
+  memcpy(response->mac, mac->octet, MAC_ADDR_SIZE);
+  return sizeof(ncsi_host_mac_response_t);
+}
+
+uint32_t ncsi_build_oem_simple_ack(const uint8_t* request_buf,
+                                   uint8_t* response_buf) {
+  ncsi_build_oem_ack(request_buf, response_buf,
+                     sizeof(ncsi_oem_simple_response_t));
+  return sizeof(ncsi_oem_simple_response_t);
+}
+
+uint32_t ncsi_build_oem_echo_ack(const uint8_t* request_buf,
+                                 uint8_t* response_buf) {
+  ncsi_oem_echo_response_t* echo_response =
+      (ncsi_oem_echo_response_t*)response_buf;
+  const ncsi_oem_echo_cmd_t* echo_cmd = (const ncsi_oem_echo_cmd_t*)request_buf;
+  memmove(echo_response->pattern, echo_cmd->pattern, sizeof(echo_cmd->pattern));
+  // Because we allow request and response to be the same buffer, it is
+  // important that pattern copy precedes the call to ncsi_build_oem_ack.
+  ncsi_build_oem_ack(request_buf, response_buf,
+                     sizeof(ncsi_oem_echo_response_t));
+
+  return sizeof(ncsi_oem_echo_response_t);
+}
+
+uint32_t ncsi_build_oem_get_filter_ack(const uint8_t* request_buf,
+                                       uint8_t* response_buf,
+                                       const ncsi_oem_filter_t* filter) {
+  ncsi_build_oem_ack(request_buf, response_buf,
+                     sizeof(ncsi_oem_get_filter_response_t));
+  ncsi_oem_get_filter_response_t* get_filter_response =
+      (ncsi_oem_get_filter_response_t*)response_buf;
+  memcpy(&get_filter_response->filter, filter,
+         sizeof(get_filter_response->filter));
+  return sizeof(ncsi_oem_get_filter_response_t);
+}
+
+uint32_t ncsi_build_pt_stats_ack(const uint8_t* request_buf,
+                                 uint8_t* response_buf,
+                                 const ncsi_passthrough_stats_t* stats) {
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      sizeof(ncsi_passthrough_stats_response_t) - sizeof(ncsi_header_t));
+  ncsi_passthrough_stats_response_t* pt_stats_response =
+      (ncsi_passthrough_stats_response_t*)response_buf;
+  /* TODO: endianness? */
+  memcpy(&pt_stats_response->stats, stats, sizeof(pt_stats_response->stats));
+  return sizeof(ncsi_passthrough_stats_response_t);
+}
+
+uint32_t ncsi_build_pt_stats_legacy_ack(
+    const uint8_t* request_buf, uint8_t* response_buf,
+    const ncsi_passthrough_stats_legacy_t* stats) {
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      sizeof(ncsi_passthrough_stats_legacy_response_t) - sizeof(ncsi_header_t));
+  ncsi_passthrough_stats_legacy_response_t* pt_stats_response =
+      (ncsi_passthrough_stats_legacy_response_t*)response_buf;
+  /* TODO: endianness? */
+  memcpy(&pt_stats_response->stats, stats, sizeof(pt_stats_response->stats));
+  return sizeof(ncsi_passthrough_stats_legacy_response_t);
+}
+
+uint32_t ncsi_build_link_status_ack(const uint8_t* request_buf,
+                                    uint8_t* response_buf,
+                                    const ncsi_link_status_t* link_status) {
+  ncsi_build_response_header(
+      request_buf, response_buf, 0, 0,
+      sizeof(ncsi_link_status_response_t) - sizeof(ncsi_header_t));
+  ncsi_link_status_response_t* link_status_response =
+      (ncsi_link_status_response_t*)response_buf;
+  memcpy(&link_status_response->link_status, link_status,
+         sizeof(link_status_response->link_status));
+  return sizeof(ncsi_link_status_response_t);
+}
diff --git a/ncsid/src/platforms/nemora/portable/ncsi_server.h b/ncsid/src/platforms/nemora/portable/ncsi_server.h
new file mode 100644
index 0000000..6a411aa
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/ncsi_server.h
@@ -0,0 +1,189 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_NCSI_SERVER_H_
+#define PLATFORMS_NEMORA_PORTABLE_NCSI_SERVER_H_
+
+/*
+ * Module for constructing NC-SI response commands on the NIC
+ *
+ * DMTF v1.0.0 NC-SI specification:
+ * http://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf
+ */
+
+#include <stdint.h>
+
+#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/net_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Build the header for the response to the command in the buffer.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  response_code: Response Code. Must be zero for ACK.
+ *  reason_code: Reason Code. Must be zero for ACK.
+ *  payload_length: size of a payload.
+ */
+void ncsi_build_response_header(const uint8_t* request_buf,
+                                uint8_t* response_buf, uint16_t response_code,
+                                uint16_t reason_code, uint16_t payload_length);
+
+/*
+ * Construct simple ACK command in the buffer, given the buffer with the
+ * received command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_simple_ack(const uint8_t* request_buf,
+                               uint8_t* response_buf);
+
+/*
+ * Construct simple NACK command in the buffer, given the buffer with the
+ * received command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  response_code: Response Code
+ *  reason_code: Reason Code
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_simple_nack(const uint8_t* request_buf,
+                                uint8_t* response_buf, uint16_t response_code,
+                                uint16_t reason_code);
+
+/*
+ * Construct ACK command in the buffer, given the buffer with the
+ * received command, which in this case must be NCSI_GET_VERSION_ID command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  version_id: Version ID struct.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_version_id_ack(const uint8_t* request_buf,
+                                   uint8_t* response_buf,
+                                   const ncsi_version_id_t* version_id);
+
+/*
+ * Construct OEM ACK command in the buffer, given the buffer with the
+ * received OEM command, which in this case must be
+ * NCSI_OEM_COMMAND_GET_HOST_MAC.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  mac: NIC's MAC address.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_oem_get_mac_ack(const uint8_t* request_buf,
+                                    uint8_t* response_buf,
+                                    const mac_addr_t* mac);
+
+/*
+ * Construct simple OEM ACK command in the buffer, given the buffer with the
+ * received command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_oem_simple_ack(const uint8_t* request_buf,
+                                   uint8_t* response_buf);
+
+/*
+ * Construct OEM ACK command in the buffer, given the buffer with the
+ * received command, which in this case must be NCSI_OEM_COMMAND_ECHO.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_oem_echo_ack(const uint8_t* request_buf,
+                                 uint8_t* response_buf);
+
+/*
+ * Construct ACK response in the buffer, given the buffer with the
+ * received NCSI_OEM_COMMAND_GET_FILTER.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  filter: active NIC traffic filter.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_oem_get_filter_ack(const uint8_t* request_buf,
+                                       uint8_t* response_buf,
+                                       const ncsi_oem_filter_t* filter);
+
+/*
+ * Construct ACK response in the buffer, given the buffer with the
+ * received NCSI_GET_PASSTHROUGH_STATISTICS command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  stats: ncsi_passthrough_stats_t struct with stats.
+ *  TODO): it is not clear what is the endianness of the data in stats
+ *  struct. There does not seem to be any conversion on EC side.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_pt_stats_ack(const uint8_t* request_buf,
+                                 uint8_t* response_buf,
+                                 const ncsi_passthrough_stats_t* stats);
+
+/*
+ * This function is similar to ncsi_build_pt_stats_ack, except that it simulates
+ * the bug in MLX X - X firmware. It should not be used outside of tests.
+ */
+uint32_t ncsi_build_pt_stats_legacy_ack(
+    const uint8_t* request_buf, uint8_t* response_buf,
+    const ncsi_passthrough_stats_legacy_t* stats);
+
+/*
+ * Construct ACK response in the buffer, given the buffer with the
+ * received NCSI_GET_LINK_STATUS command.
+ *
+ * Args:
+ *  request_buf: buffer containing NC-SI request.
+ *  response_buf: buffer, where to put the response. Must be big enough to fit
+ *    the response.
+ *  link_status: ncsi_link_status_t struct.
+ *
+ * Returns the size of the response in the buffer.
+ */
+uint32_t ncsi_build_link_status_ack(const uint8_t* request_buf,
+                                    uint8_t* response_buf,
+                                    const ncsi_link_status_t* link_status);
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_NCSI_SERVER_H_
diff --git a/ncsid/src/platforms/nemora/portable/net_types.h b/ncsid/src/platforms/nemora/portable/net_types.h
new file mode 100644
index 0000000..872d94f
--- /dev/null
+++ b/ncsid/src/platforms/nemora/portable/net_types.h
@@ -0,0 +1,37 @@
+#ifndef PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_
+#define PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_
+
+#include <stdint.h>
+
+// Buffer big enough for largest frame we expect
+// to receive from EMAC (in bytes)
+//   1500 (max payload IEEE 802.3) +
+//   14 (header) +
+//   4 (crc, if not stripped by EMAC) +
+//   4 (optional VLAN tag, if not stripped by EMAC)
+#define ETH_BUFFER_SIZE 1522
+#define IPV4_ETHERTYPE 0x0800
+#define IPV6_ADDR_SIZE 16
+#define MAC_ADDR_SIZE 6
+
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
+/* MAC address */
+typedef struct __packed {
+  uint8_t octet[MAC_ADDR_SIZE];  // network order
+} mac_addr_t;
+
+/*
+ * Ethernet header.
+ * Note: This assumes a packet without VLAN tags.
+ * TODO: configure HW to strip VLAN field.
+ */
+typedef struct __packed {
+  mac_addr_t dest;
+  mac_addr_t src;
+  uint16_t ethertype;
+} eth_hdr_t;
+
+#endif  // PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_
