Rename Kconfig options (components/ethernet)

This commit is contained in:
Roland Dobai 2019-04-30 12:30:32 +02:00
parent b8111ab1d5
commit d4af5e6fff
7 changed files with 31 additions and 22 deletions

View file

@ -1,6 +1,6 @@
menu Ethernet menu Ethernet
config DMA_RX_BUF_NUM config ETH_DMA_RX_BUF_NUM
int "Number of DMA RX buffers" int "Number of DMA RX buffers"
range 3 20 range 3 20
default 10 default 10
@ -10,7 +10,7 @@ menu Ethernet
More buffers will increase throughput. More buffers will increase throughput.
If flow ctrl is enabled, make sure this number is larger than 9. 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" int "Number of DMA TX buffers"
range 3 20 range 3 20
default 10 default 10
@ -19,7 +19,7 @@ menu Ethernet
These buffers are allocated dynamically. These buffers are allocated dynamically.
More buffers will increase throughput. 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" bool "Enable received buffers be copied to Layer3 from Layer2"
default y default y
help 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. 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. 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" int "Period (ms) of checking Ethernet linkup status"
range 1000 5000 range 1000 5000
default 2000 default 2000
@ -38,14 +38,14 @@ menu Ethernet
The emac driver uses an internal timer to check the Ethernet linkup status. The emac driver uses an internal timer to check the Ethernet linkup status.
Here you should choose a valid interval time. Here you should choose a valid interval time.
config EMAC_TASK_PRIORITY config ETH_EMAC_TASK_PRIORITY
int "EMAC_TASK_PRIORITY" int "EMAC_TASK_PRIORITY"
default 20 default 20
range 3 22 range 3 22
help help
Priority of Ethernet MAC task. Priority of Ethernet MAC task.
config EMAC_TASK_STACK_SIZE config ETH_EMAC_TASK_STACK_SIZE
int "Stack Size of EMAC Task" int "Stack Size of EMAC Task"
default 3072 default 3072
range 2000 8000 range 2000 8000

View file

@ -102,10 +102,10 @@ struct emac_close_cmd {
int8_t err; int8_t err;
}; };
#define DMA_RX_BUF_NUM CONFIG_DMA_RX_BUF_NUM #define DMA_RX_BUF_NUM CONFIG_ETH_DMA_RX_BUF_NUM
#define DMA_TX_BUF_NUM CONFIG_DMA_TX_BUF_NUM #define DMA_TX_BUF_NUM CONFIG_ETH_DMA_TX_BUF_NUM
#define EMAC_TASK_PRIORITY CONFIG_EMAC_TASK_PRIORITY #define EMAC_TASK_PRIORITY CONFIG_ETH_EMAC_TASK_PRIORITY
#define EMAC_TASK_STACK_SIZE CONFIG_EMAC_TASK_STACK_SIZE #define EMAC_TASK_STACK_SIZE CONFIG_ETH_EMAC_TASK_STACK_SIZE
#define DMA_RX_BUF_SIZE 1600 #define DMA_RX_BUF_SIZE 1600
#define DMA_TX_BUF_SIZE 1600 #define DMA_TX_BUF_SIZE 1600

View file

@ -467,7 +467,7 @@ static uint32_t IRAM_ATTR emac_get_rxbuf_count_in_intr(void)
return cnt; 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) static void emac_process_rx(void)
{ {
if (emac_config.emac_status == EMAC_RUNTIME_STOP) { if (emac_config.emac_status == EMAC_RUNTIME_STOP) {
@ -649,7 +649,7 @@ static void emac_check_phy_init(void)
} else { } else {
REG_CLR_BIT(EMAC_GMACCONFIG_REG, EMAC_EMACFESPEED); 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_disable_flowctrl();
emac_config.emac_flow_ctrl_partner_support = false; emac_config.emac_flow_ctrl_partner_support = false;
#else #else
@ -768,7 +768,7 @@ void emac_link_check_func(void *pv_parameters)
static bool emac_link_check_timer_init(void) static bool emac_link_check_timer_init(void)
{ {
emac_timer = xTimerCreate("emac_timer", 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, pdTRUE,
NULL, NULL,
emac_link_check_func); emac_link_check_func);

View file

@ -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

View file

@ -83,7 +83,7 @@ ethernet_low_level_init(struct netif *netif)
#endif #endif
#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; netif->l2_buffer_free_notify = esp_eth_free_rx_buf;
#endif #endif
} }
@ -150,7 +150,7 @@ ethernet_low_level_output(struct netif *netif, struct pbuf *p)
* @param buffer the ethernet buffer * @param buffer the ethernet buffer
* @param len the len of 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 * will be made for high layer (LWIP) and ethernet is responsible for
* freeing the buffer. Otherwise, high layer and ethernet share the * freeing the buffer. Otherwise, high layer and ethernet share the
* same buffer and high layer is responsible for freeing the buffer. * 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; struct pbuf *p;
if(buffer== NULL || !netif_is_up(netif)) { 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) { if (buffer) {
esp_eth_free_rx_buf(buffer); esp_eth_free_rx_buf(buffer);
} }
@ -169,7 +169,7 @@ ethernetif_input(struct netif *netif, void *buffer, uint16_t len)
return; 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); p = pbuf_alloc(PBUF_RAW, len, PBUF_RAM);
if (p == NULL) { if (p == NULL) {
return; return;

View file

@ -23,5 +23,5 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
# Ethernet # Ethernet
CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=y CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE=y

View file

@ -243,10 +243,10 @@ CONFIG_ADC_CAL_LUT_ENABLE=y
# #
# Ethernet # Ethernet
# #
CONFIG_DMA_RX_BUF_NUM=10 CONFIG_ETH_DMA_RX_BUF_NUM=10
CONFIG_DMA_TX_BUF_NUM=10 CONFIG_ETH_DMA_TX_BUF_NUM=10
CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE= CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE=
CONFIG_EMAC_TASK_PRIORITY=20 CONFIG_ETH_EMAC_TASK_PRIORITY=20
# #
# FAT Filesystem support # FAT Filesystem support