Skip to content

Commit

Permalink
Merge branch 'bugfix/tx_only_link_up_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
Ethernet minor fixes (v5.1)

See merge request espressif/esp-idf!23968
  • Loading branch information
jack0c committed Jul 5, 2023
2 parents 46396d7 + 888e433 commit b8cfb56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/esp_eth/src/esp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ esp_err_t esp_eth_transmit_vargs(esp_eth_handle_t hdl, uint32_t argc, ...)
esp_err_t ret = ESP_OK;
esp_eth_driver_t *eth_driver = (esp_eth_driver_t *)hdl;

if (atomic_load(&eth_driver->fsm) != ESP_ETH_FSM_START) {
if (atomic_load(&eth_driver->link) != ETH_LINK_UP) {
ret = ESP_ERR_INVALID_STATE;
ESP_LOGD(TAG, "Ethernet is not started");
ESP_LOGD(TAG, "Ethernet link is not up, can't transmit");
goto err;
}

Expand Down
1 change: 1 addition & 0 deletions components/esp_eth/test_apps/main/esp_eth_test_l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ TEST_CASE("ethernet start/stop stress test under heavy traffic", "[ethernet_l2]"
poke_and_wait(eth_handle, &rx_i, sizeof(rx_i), eth_event_rx_group);

// wait for dummy traffic
xEventGroupClearBits(eth_event_rx_group, ETH_UNICAST_RECV_BIT);
recv_info.unicast_rx_cnt = 0;
bits = xEventGroupWaitBits(eth_event_rx_group, ETH_UNICAST_RECV_BIT, true, true, pdMS_TO_TICKS(3000));
TEST_ASSERT((bits & ETH_UNICAST_RECV_BIT) == ETH_UNICAST_RECV_BIT);
Expand Down

0 comments on commit b8cfb56

Please sign in to comment.