mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
Ethernet: optimize and bugfix
1. simplify deallocate in esp_eth_mac_new_esp32, esp_eth_mac_new_dm9051 2. remove blocking operation in os timer callback 3. check buffer size in ethernet receive function
This commit is contained in:
@@ -148,9 +148,14 @@ esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, uint8_t *buf, uint32_t length);
|
||||
* @param[out] buf: buffer to preserve the received packet
|
||||
* @param[out] length: length of the received packet
|
||||
*
|
||||
* @note Before this function got invoked, the value of "length" should set by user, equals the size of buffer.
|
||||
* After the function returned, the value of "length" means the real length of received data.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: receive frame buffer successfully
|
||||
* - ESP_ERR_INVALID_ARG: receive frame buffer failed because of some invalid argument
|
||||
* - ESP_ERR_INVALID_SIZE: input buffer size is not enough to hold the incoming data.
|
||||
* in this case, value of returned "length" indicates the real size of incoming data.
|
||||
* - ESP_FAIL: receive frame buffer failed because some other error occurred
|
||||
*/
|
||||
esp_err_t esp_eth_receive(esp_eth_handle_t hdl, uint8_t *buf, uint32_t *length);
|
||||
|
||||
@@ -99,10 +99,14 @@ struct esp_eth_mac_s {
|
||||
* @param[out] length: length of the received packet
|
||||
*
|
||||
* @note Memory of buf is allocated in the Layer2, make sure it get free after process.
|
||||
* @note Before this function got invoked, the value of "length" should set by user, equals the size of buffer.
|
||||
* After the function returned, the value of "length" means the real length of received data.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: receive packet successfully
|
||||
* - ESP_ERR_INVALID_ARG: receive packet failed because of invalid argument
|
||||
* - ESP_ERR_INVALID_SIZE: input buffer size is not enough to hold the incoming data.
|
||||
* in this case, value of returned "length" indicates the real size of incoming data.
|
||||
* - ESP_FAIL: receive packet failed because some other error occurred
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user