diff --git a/components/ethernet/Kconfig b/components/ethernet/Kconfig index a5723a116..9444f78e4 100644 --- a/components/ethernet/Kconfig +++ b/components/ethernet/Kconfig @@ -1,6 +1,6 @@ menu Ethernet - config DMA_RX_BUF_NUM + config ETH_DMA_RX_BUF_NUM int "Number of DMA RX buffers" range 3 20 default 10 @@ -10,7 +10,7 @@ menu Ethernet More buffers will increase throughput. If flow ctrl is enabled, make sure this number is larger than 9. - config DMA_TX_BUF_NUM + config ETH_DMA_TX_BUF_NUM int "Number of DMA TX buffers" range 3 20 default 10 @@ -19,7 +19,7 @@ menu Ethernet These buffers are allocated dynamically. More buffers will increase throughput. - config EMAC_L2_TO_L3_RX_BUF_MODE + config ETH_EMAC_L2_TO_L3_RX_BUF_MODE bool "Enable received buffers be copied to Layer3 from Layer2" default y help @@ -30,7 +30,7 @@ menu Ethernet If this option is not selected, IP layer only uses the pointers to the DMA buffers owned by Ethernet MAC. When Ethernet MAC doesn't have any available buffers left, it will drop the incoming packets. - config EMAC_CHECK_LINK_PERIOD_MS + config ETH_CHECK_LINK_STATUS_PERIOD_MS int "Period (ms) of checking Ethernet linkup status" range 1000 5000 default 2000 @@ -38,14 +38,14 @@ menu Ethernet The emac driver uses an internal timer to check the Ethernet linkup status. Here you should choose a valid interval time. - config EMAC_TASK_PRIORITY + config ETH_EMAC_TASK_PRIORITY int "EMAC_TASK_PRIORITY" default 20 range 3 22 help Priority of Ethernet MAC task. - config EMAC_TASK_STACK_SIZE + config ETH_EMAC_TASK_STACK_SIZE int "Stack Size of EMAC Task" default 3072 range 2000 8000 diff --git a/components/ethernet/emac_common.h b/components/ethernet/emac_common.h index 64a0bf9f2..e60de6186 100644 --- a/components/ethernet/emac_common.h +++ b/components/ethernet/emac_common.h @@ -102,10 +102,10 @@ struct emac_close_cmd { int8_t err; }; -#define DMA_RX_BUF_NUM CONFIG_DMA_RX_BUF_NUM -#define DMA_TX_BUF_NUM CONFIG_DMA_TX_BUF_NUM -#define EMAC_TASK_PRIORITY CONFIG_EMAC_TASK_PRIORITY -#define EMAC_TASK_STACK_SIZE CONFIG_EMAC_TASK_STACK_SIZE +#define DMA_RX_BUF_NUM CONFIG_ETH_DMA_RX_BUF_NUM +#define DMA_TX_BUF_NUM CONFIG_ETH_DMA_TX_BUF_NUM +#define EMAC_TASK_PRIORITY CONFIG_ETH_EMAC_TASK_PRIORITY +#define EMAC_TASK_STACK_SIZE CONFIG_ETH_EMAC_TASK_STACK_SIZE #define DMA_RX_BUF_SIZE 1600 #define DMA_TX_BUF_SIZE 1600 diff --git a/components/ethernet/emac_main.c b/components/ethernet/emac_main.c index b93ea98a2..2f9feedf1 100644 --- a/components/ethernet/emac_main.c +++ b/components/ethernet/emac_main.c @@ -467,7 +467,7 @@ static uint32_t IRAM_ATTR emac_get_rxbuf_count_in_intr(void) return cnt; } -#if CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#if CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE static void emac_process_rx(void) { if (emac_config.emac_status == EMAC_RUNTIME_STOP) { @@ -649,7 +649,7 @@ static void emac_check_phy_init(void) } else { REG_CLR_BIT(EMAC_GMACCONFIG_REG, EMAC_EMACFESPEED); } -#if CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#if CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE emac_disable_flowctrl(); emac_config.emac_flow_ctrl_partner_support = false; #else @@ -768,7 +768,7 @@ void emac_link_check_func(void *pv_parameters) static bool emac_link_check_timer_init(void) { emac_timer = xTimerCreate("emac_timer", - (CONFIG_EMAC_CHECK_LINK_PERIOD_MS / portTICK_PERIOD_MS), + (CONFIG_ETH_CHECK_LINK_STATUS_PERIOD_MS / portTICK_PERIOD_MS), pdTRUE, NULL, emac_link_check_func); diff --git a/components/ethernet/sdkconfig.rename b/components/ethernet/sdkconfig.rename new file mode 100644 index 000000000..d70ede315 --- /dev/null +++ b/components/ethernet/sdkconfig.rename @@ -0,0 +1,9 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_DMA_RX_BUF_NUM CONFIG_ETH_DMA_RX_BUF_NUM +CONFIG_DMA_TX_BUF_NUM CONFIG_ETH_DMA_TX_BUF_NUM +CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE +CONFIG_EMAC_CHECK_LINK_PERIOD_MS CONFIG_ETH_CHECK_LINK_STATUS_PERIOD_MS +CONFIG_EMAC_TASK_PRIORITY CONFIG_ETH_EMAC_TASK_PRIORITY +CONFIG_EMAC_TASK_STACK_SIZE CONFIG_ETH_EMAC_TASK_STACK_SIZE diff --git a/components/lwip/port/esp32/netif/ethernetif.c b/components/lwip/port/esp32/netif/ethernetif.c index 48693a934..d61653fca 100644 --- a/components/lwip/port/esp32/netif/ethernetif.c +++ b/components/lwip/port/esp32/netif/ethernetif.c @@ -83,7 +83,7 @@ ethernet_low_level_init(struct netif *netif) #endif #endif -#ifndef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifndef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE netif->l2_buffer_free_notify = esp_eth_free_rx_buf; #endif } @@ -150,7 +150,7 @@ ethernet_low_level_output(struct netif *netif, struct pbuf *p) * @param buffer the ethernet buffer * @param len the len of buffer * - * @note When CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE is enabled, a copy of buffer + * @note When CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE is enabled, a copy of buffer * will be made for high layer (LWIP) and ethernet is responsible for * freeing the buffer. Otherwise, high layer and ethernet share the * same buffer and high layer is responsible for freeing the buffer. @@ -161,7 +161,7 @@ ethernetif_input(struct netif *netif, void *buffer, uint16_t len) struct pbuf *p; if(buffer== NULL || !netif_is_up(netif)) { -#ifndef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifndef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE if (buffer) { esp_eth_free_rx_buf(buffer); } @@ -169,7 +169,7 @@ ethernetif_input(struct netif *netif, void *buffer, uint16_t len) return; } -#ifdef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifdef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE p = pbuf_alloc(PBUF_RAW, len, PBUF_RAM); if (p == NULL) { return; diff --git a/examples/ethernet/iperf/sdkconfig.defaults b/examples/ethernet/iperf/sdkconfig.defaults index 74d1647a7..a07acc2dd 100644 --- a/examples/ethernet/iperf/sdkconfig.defaults +++ b/examples/ethernet/iperf/sdkconfig.defaults @@ -23,5 +23,5 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 # Ethernet -CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=y +CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE=y diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index c6d56b713..8fa6cf3c0 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -243,10 +243,10 @@ CONFIG_ADC_CAL_LUT_ENABLE=y # # Ethernet # -CONFIG_DMA_RX_BUF_NUM=10 -CONFIG_DMA_TX_BUF_NUM=10 -CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE= -CONFIG_EMAC_TASK_PRIORITY=20 +CONFIG_ETH_DMA_RX_BUF_NUM=10 +CONFIG_ETH_DMA_TX_BUF_NUM=10 +CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE= +CONFIG_ETH_EMAC_TASK_PRIORITY=20 # # FAT Filesystem support