From c010f24d8bde0e643729b568bf0b127453c7522f Mon Sep 17 00:00:00 2001 From: morris Date: Wed, 27 Jan 2021 15:48:01 +0800 Subject: [PATCH 1/2] esp_eth: deprecate esp_eth_receive Ethernet driver is interrupt driven only, don't support polling mode. So deprecate esp_eth_receive API. --- components/esp_eth/include/esp_eth.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp_eth/include/esp_eth.h b/components/esp_eth/include/esp_eth.h index 76eff00b56..480349d56d 100644 --- a/components/esp_eth/include/esp_eth.h +++ b/components/esp_eth/include/esp_eth.h @@ -195,7 +195,8 @@ esp_err_t esp_eth_update_input_path( esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, void *buf, size_t length); /** -* @brief General Receive +* @brief General Receive is deprecated and shall not be accessed from app code, +* as polling is not supported by Ethernet. * * @param[in] hdl: handle of Ethernet driver * @param[out] buf: buffer to preserve the received packet @@ -203,6 +204,9 @@ esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, void *buf, size_t length); * * @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. +* @note This API was exposed by accident, users should not use this API in their applications. +* Ethernet driver is interrupt driven, and doesn't support polling mode. +* Instead, users should register input callback with ``esp_eth_update_input_path``. * * @return * - ESP_OK: receive frame buffer successfully @@ -211,7 +215,7 @@ esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, void *buf, size_t length); * 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); +esp_err_t esp_eth_receive(esp_eth_handle_t hdl, uint8_t *buf, uint32_t *length) __attribute__((deprecated("Ethernet driver is interrupt driven only, please register input callback with esp_eth_update_input_path"))); /** * @brief Misc IO function of Etherent driver From 0208810ecae27c3b7d436ef769528267a847f953 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Wed, 27 Jan 2021 23:44:13 +0800 Subject: [PATCH 2/2] esp_eth: fix typo in lan8720 driver Closes https://github.com/espressif/esp-idf/issues/6469 --- components/esp_eth/src/esp_eth_phy_lan8720.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_eth/src/esp_eth_phy_lan8720.c b/components/esp_eth/src/esp_eth_phy_lan8720.c index 8693e96df2..af846574be 100644 --- a/components/esp_eth/src/esp_eth_phy_lan8720.c +++ b/components/esp_eth/src/esp_eth_phy_lan8720.c @@ -109,7 +109,7 @@ typedef union { struct { uint32_t reserved1 : 1; /* Reserved */ uint32_t auto_nego_page_received : 1; /* Auto-Negotiation Page Received */ - uint32_t parallel_detect_falut : 1; /* Parallel Detection Fault */ + uint32_t parallel_detect_fault : 1; /* Parallel Detection Fault */ uint32_t auto_nego_lp_acknowledge : 1; /* Auto-Negotiation LP Acknowledge */ uint32_t link_down : 1; /* Link Down */ uint32_t remote_fault_detect : 1; /* Remote Fault Detect */ @@ -129,12 +129,12 @@ typedef union { struct { uint32_t reserved1 : 1; /* Reserved */ uint32_t auto_nego_page_received : 1; /* Auto-Negotiation Page Received */ - uint32_t parallel_detect_falut : 1; /* Parallel Detection Fault */ + uint32_t parallel_detect_fault : 1; /* Parallel Detection Fault */ uint32_t auto_nego_lp_acknowledge : 1; /* Auto-Negotiation LP Acknowledge */ uint32_t link_down : 1; /* Link Down */ uint32_t remote_fault_detect : 1; /* Remote Fault Detect */ uint32_t auto_nego_complete : 1; /* Auto-Negotiation Complete */ - uint32_t energy_on_generate : 1; /* ENERYON generated */ + uint32_t energy_on_generate : 1; /* ENERGY ON generated */ uint32_t reserved2 : 8; /* Reserved */ }; uint32_t val;