mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
Fixed Ethernet lwIP netif error indication
This commit is contained in:
@@ -226,7 +226,7 @@ static esp_err_t emac_esp32_transmit(esp_eth_mac_t *mac, uint8_t *buf, uint32_t
|
|||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
emac_esp32_t *emac = __containerof(mac, emac_esp32_t, parent);
|
emac_esp32_t *emac = __containerof(mac, emac_esp32_t, parent);
|
||||||
uint32_t sent_len = emac_hal_transmit_frame(&emac->hal, buf, length);
|
uint32_t sent_len = emac_hal_transmit_frame(&emac->hal, buf, length);
|
||||||
ESP_GOTO_ON_FALSE(sent_len == length, ESP_ERR_INVALID_SIZE, err, TAG, "insufficient TX buffer size");
|
ESP_GOTO_ON_FALSE(sent_len == length, ESP_ERR_NO_MEM, err, TAG, "insufficient TX buffer size");
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
err:
|
err:
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -134,11 +134,12 @@ static err_t ethernet_low_level_output(struct netif *netif, struct pbuf *p)
|
|||||||
pbuf_free(q);
|
pbuf_free(q);
|
||||||
}
|
}
|
||||||
/* Check error */
|
/* Check error */
|
||||||
if (unlikely(ret != ESP_OK)) {
|
if (likely(ret == ESP_OK)) {
|
||||||
return ERR_ABRT;
|
|
||||||
} else {
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
} else if (ret == ESP_ERR_NO_MEM) {
|
||||||
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
return ERR_IF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user