From fd366fac9e6d9debdf0918bbda8930e3ec6133fd Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 27 May 2022 09:12:31 +0200 Subject: [PATCH] esp_eth: Remove deprecated esp_eth_receive() --- components/esp_eth/include/esp_eth_driver.h | 23 --------------------- components/esp_eth/src/esp_eth.c | 13 ------------ 2 files changed, 36 deletions(-) diff --git a/components/esp_eth/include/esp_eth_driver.h b/components/esp_eth/include/esp_eth_driver.h index ab19f210cf..f6f358f015 100644 --- a/components/esp_eth/include/esp_eth_driver.h +++ b/components/esp_eth/include/esp_eth_driver.h @@ -268,29 +268,6 @@ esp_err_t esp_eth_transmit(esp_eth_handle_t hdl, void *buf, size_t length); */ esp_err_t esp_eth_transmit_vargs(esp_eth_handle_t hdl, uint32_t argc, ...); -/** -* @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 -* @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. -* @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 -* - 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) __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 * diff --git a/components/esp_eth/src/esp_eth.c b/components/esp_eth/src/esp_eth.c index a3662453e9..566c96b1c5 100644 --- a/components/esp_eth/src/esp_eth.c +++ b/components/esp_eth/src/esp_eth.c @@ -388,19 +388,6 @@ err: return ret; } -esp_err_t esp_eth_receive(esp_eth_handle_t hdl, uint8_t *buf, uint32_t *length) -{ - esp_err_t ret = ESP_OK; - esp_eth_driver_t *eth_driver = (esp_eth_driver_t *)hdl; - ESP_GOTO_ON_FALSE(buf && length, ESP_ERR_INVALID_ARG, err, TAG, "can't set buf and length to null"); - ESP_GOTO_ON_FALSE(*length > 60, ESP_ERR_INVALID_ARG, err, TAG, "length can't be less than 60"); - ESP_GOTO_ON_FALSE(eth_driver, ESP_ERR_INVALID_ARG, err, TAG, "ethernet driver handle can't be null"); - esp_eth_mac_t *mac = eth_driver->mac; - ret = mac->receive(mac, buf, length); -err: - return ret; -} - esp_err_t esp_eth_ioctl(esp_eth_handle_t hdl, esp_eth_io_cmd_t cmd, void *data) { esp_err_t ret = ESP_OK;