mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Fixed Ethernet lwIP netif error indication
This commit is contained in:
parent
f5ee7093b8
commit
ba62cbc04f
@ -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;
|
||||
emac_esp32_t *emac = __containerof(mac, emac_esp32_t, parent);
|
||||
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;
|
||||
err:
|
||||
return ret;
|
||||
|
@ -134,11 +134,12 @@ static err_t ethernet_low_level_output(struct netif *netif, struct pbuf *p)
|
||||
pbuf_free(q);
|
||||
}
|
||||
/* Check error */
|
||||
if (unlikely(ret != ESP_OK)) {
|
||||
return ERR_ABRT;
|
||||
} else {
|
||||
if (likely(ret == ESP_OK)) {
|
||||
return ERR_OK;
|
||||
} else if (ret == ESP_ERR_NO_MEM) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
return ERR_IF;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user