mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(esp_netif): Change debug->verbose level for tracing logs
This commit is contained in:
committed by
David Čermák
parent
6bfcd4b41c
commit
a6b216ac22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -345,7 +345,7 @@ bool esp_netif_is_netif_up(esp_netif_t *esp_netif)
|
||||
|
||||
esp_err_t esp_netif_get_old_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -356,7 +356,7 @@ esp_err_t esp_netif_get_old_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t
|
||||
|
||||
esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -374,7 +374,7 @@ bool esp_netif_is_valid_static_ip(esp_netif_ip_info_t *ip_info)
|
||||
|
||||
esp_err_t esp_netif_set_old_ip_info(esp_netif_t *esp_netif, const esp_netif_ip_info_t *ip_info)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
|
||||
@@ -224,7 +224,7 @@ static void esp_netif_api_cb(void *api_msg)
|
||||
}
|
||||
|
||||
msg->ret = msg->api_fn(msg);
|
||||
ESP_LOGD(TAG, "call api in lwip: ret=0x%x, give sem", msg->ret);
|
||||
ESP_LOGV(TAG, "call api in lwip: ret=0x%x, give sem", msg->ret);
|
||||
#if !LWIP_TCPIP_CORE_LOCKING
|
||||
sys_sem_signal(&api_sync_sem);
|
||||
#endif
|
||||
@@ -238,7 +238,7 @@ static void esp_netif_api_cb(void *api_msg)
|
||||
static inline esp_err_t esp_netif_lwip_ipc_call_msg(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
|
||||
ESP_LOGD(TAG, "check: remote, if=%p fn=%p", msg->esp_netif, msg->api_fn);
|
||||
ESP_LOGV(TAG, "check: remote, if=%p fn=%p", msg->esp_netif, msg->api_fn);
|
||||
#if LWIP_TCPIP_CORE_LOCKING
|
||||
tcpip_send_msg_wait_sem((tcpip_callback_fn)esp_netif_api_cb, msg, NULL);
|
||||
#else
|
||||
@@ -248,7 +248,7 @@ static inline esp_err_t esp_netif_lwip_ipc_call_msg(esp_netif_api_msg_t *msg)
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
return msg->ret;
|
||||
}
|
||||
ESP_LOGD(TAG, "check: local, if=%p fn=%p", msg->esp_netif, msg->api_fn);
|
||||
ESP_LOGV(TAG, "check: local, if=%p fn=%p", msg->esp_netif, msg->api_fn);
|
||||
return msg->api_fn(msg);
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ static esp_err_t esp_netif_update_default_netif_lwip(esp_netif_api_msg_t *msg)
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
esp_netif_route_prio_action_t action = (esp_netif_route_prio_action_t)msg->data;
|
||||
|
||||
ESP_LOGD(TAG, "%s %p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s %p", __func__, esp_netif);
|
||||
|
||||
if (s_is_last_default_esp_netif_overridden && action != ESP_NETIF_SET_DEFAULT) {
|
||||
// check if manually configured default interface hasn't been destroyed
|
||||
@@ -1161,7 +1161,7 @@ esp_err_t esp_netif_get_mac(esp_netif_t *esp_netif, uint8_t mac[])
|
||||
static void esp_netif_dhcps_cb(void* arg, uint8_t ip[4], uint8_t mac[6])
|
||||
{
|
||||
esp_netif_t *esp_netif = arg;
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ip_event_assigned_ip_to_client_t evt = { .esp_netif = esp_netif };
|
||||
memcpy((char *)&evt.ip.addr, (char *)ip, sizeof(evt.ip.addr));
|
||||
memcpy((char *)&evt.mac, mac, sizeof(evt.mac));
|
||||
@@ -1210,7 +1210,7 @@ static esp_err_t esp_netif_start_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t * esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s %p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s %p", __func__, esp_netif);
|
||||
if (ESP_NETIF_IS_POINT2POINT_TYPE(esp_netif, PPP_LWIP_NETIF)) {
|
||||
#if CONFIG_PPP_SUPPORT
|
||||
return esp_netif_start_ppp(esp_netif);
|
||||
@@ -1379,7 +1379,7 @@ static esp_err_t esp_netif_tx_rx_event_api(esp_netif_api_msg_t *msg)
|
||||
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
||||
}
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
esp_netif->tx_rx_events_enabled = enable;
|
||||
|
||||
return ESP_OK;
|
||||
@@ -1458,7 +1458,7 @@ static esp_err_t esp_netif_start_ip_lost_timer(esp_netif_t *esp_netif);
|
||||
static void esp_netif_internal_dhcpc_cb(struct netif *netif)
|
||||
{
|
||||
esp_netif_t *esp_netif;
|
||||
ESP_LOGD(TAG, "%s lwip-netif:%p", __func__, netif);
|
||||
ESP_LOGV(TAG, "%s lwip-netif:%p", __func__, netif);
|
||||
if (netif == NULL || (esp_netif = lwip_get_esp_netif(netif)) == NULL) {
|
||||
// internal pointer hasn't been configured yet (probably in the interface init_fn())
|
||||
return;
|
||||
@@ -1529,11 +1529,11 @@ static void esp_netif_ip_lost_timer(void *arg)
|
||||
esp_netif_t *esp_netif = esp_netif_is_active(arg);
|
||||
|
||||
if (esp_netif == NULL) {
|
||||
ESP_LOGD(TAG, "%s esp_netif=%p not active any more", __func__, arg);
|
||||
ESP_LOGV(TAG, "%s esp_netif=%p not active any more", __func__, arg);
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
esp_netif->timer_running = false;
|
||||
|
||||
@@ -1568,7 +1568,7 @@ static esp_err_t esp_netif_start_ip_lost_timer(esp_netif_t *esp_netif)
|
||||
esp_netif_ip_info_t *ip_info_old = esp_netif->ip_info;
|
||||
struct netif *netif = esp_netif->lwip_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif->timer_running) {
|
||||
ESP_LOGD(TAG, "if%p start ip lost tmr: already started", esp_netif);
|
||||
@@ -1592,7 +1592,7 @@ static esp_err_t esp_netif_dhcpc_stop_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL) {
|
||||
ESP_LOGE(TAG, "dhcp client stop called with NULL api");
|
||||
@@ -1644,7 +1644,7 @@ static esp_err_t esp_netif_dhcpc_start_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1720,7 +1720,7 @@ static esp_err_t esp_netif_dhcps_start_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1761,7 +1761,7 @@ static esp_err_t esp_netif_dhcps_stop_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1791,7 +1791,7 @@ static esp_err_t esp_netif_set_hostname_api(esp_netif_api_msg_t *msg)
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
const char *hostname = msg->data;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p hostname %s", __func__, esp_netif, hostname);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p hostname %s", __func__, esp_netif, hostname);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1828,7 +1828,7 @@ esp_err_t esp_netif_set_hostname(esp_netif_t *esp_netif, const char *hostname) _
|
||||
|
||||
esp_err_t esp_netif_get_hostname(esp_netif_t *esp_netif, const char **hostname)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif || _IS_NETIF_ANY_POINT2POINT_TYPE(esp_netif)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1852,7 +1852,7 @@ static esp_err_t esp_netif_up_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
@@ -1881,7 +1881,7 @@ static esp_err_t esp_netif_down_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (!esp_netif) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
@@ -1949,7 +1949,7 @@ bool esp_netif_is_netif_up(esp_netif_t *esp_netif)
|
||||
#if CONFIG_LWIP_IPV4
|
||||
esp_err_t esp_netif_get_old_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1960,7 +1960,7 @@ esp_err_t esp_netif_get_old_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t
|
||||
|
||||
esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
@@ -1996,7 +1996,7 @@ static esp_err_t esp_netif_set_ip_old_info_api(esp_netif_api_msg_t *msg)
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
const esp_netif_ip_info_t *ip_info = msg->data;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
@@ -2013,7 +2013,7 @@ static esp_err_t esp_netif_set_ip_info_api(esp_netif_api_msg_t *msg)
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
const esp_netif_ip_info_t *ip_info = msg->data;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || ip_info == NULL) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
@@ -2278,7 +2278,7 @@ esp_ip6_addr_type_t esp_netif_ip6_get_addr_type(const esp_ip6_addr_t* ip6_addr)
|
||||
static void esp_netif_internal_nd6_cb(struct netif *netif, uint8_t ip_index)
|
||||
{
|
||||
esp_netif_t *esp_netif;
|
||||
ESP_LOGD(TAG, "%s lwip-netif:%p", __func__, netif);
|
||||
ESP_LOGV(TAG, "%s lwip-netif:%p", __func__, netif);
|
||||
if (netif == NULL || (esp_netif = lwip_get_esp_netif(netif)) == NULL) {
|
||||
// internal pointer hasn't been configured yet (probably in the interface init_fn())
|
||||
return;
|
||||
@@ -2711,7 +2711,7 @@ esp_err_t esp_netif_get_netif_impl_name_api(esp_netif_api_msg_t *msg)
|
||||
|
||||
esp_err_t esp_netif_get_netif_impl_name(esp_netif_t *esp_netif, char* name)
|
||||
{
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
if (esp_netif == NULL || esp_netif->lwip_netif == NULL) {
|
||||
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
||||
@@ -2724,7 +2724,7 @@ static esp_err_t esp_netif_napt_control_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
bool enable = (bool)msg->data;
|
||||
esp_netif_t *esp_netif = msg->esp_netif;
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
||||
|
||||
/* Check if the interface is up */
|
||||
if (!netif_is_up(esp_netif->lwip_netif)) {
|
||||
@@ -2798,7 +2798,7 @@ static esp_err_t esp_netif_set_link_speed_api(esp_netif_api_msg_t *msg)
|
||||
{
|
||||
uint32_t speed = *((uint32_t*)msg->data);
|
||||
esp_err_t error = ESP_OK;
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
NETIF_INIT_SNMP(msg->esp_netif->lwip_netif, snmp_ifType_ethernet_csmacd, speed);
|
||||
LWIP_UNUSED_ARG(speed); // Maybe unused if SNMP disabled
|
||||
return error;
|
||||
@@ -2822,7 +2822,7 @@ static esp_err_t esp_netif_join_ip6_multicast_group_api(esp_netif_api_msg_t *msg
|
||||
esp_err_t error = ESP_OK;
|
||||
ip6_addr_t ip6addr;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
memcpy(ip6addr.addr, addr->addr, sizeof(ip6addr.addr));
|
||||
#if LWIP_IPV6_SCOPES
|
||||
ip6addr.zone = 0;
|
||||
@@ -2842,7 +2842,7 @@ static esp_err_t esp_netif_leave_ip6_multicast_group_api(esp_netif_api_msg_t *ms
|
||||
esp_ip6_addr_t *addr = (esp_ip6_addr_t *)msg->data;
|
||||
ip6_addr_t ip6addr;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
memcpy(ip6addr.addr, addr->addr, sizeof(ip6addr.addr));
|
||||
#if LWIP_IPV6_SCOPES
|
||||
ip6addr.zone = 0;
|
||||
@@ -2862,7 +2862,7 @@ static esp_err_t esp_netif_add_ip6_address_api(esp_netif_api_msg_t *msg)
|
||||
esp_err_t error = ESP_OK;
|
||||
int8_t index = -1;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
memcpy(ip6addr.addr, addr->addr.addr, sizeof(ip6addr.addr));
|
||||
#if LWIP_IPV6_SCOPES
|
||||
ip6addr.zone = 0;
|
||||
@@ -2895,7 +2895,7 @@ static esp_err_t esp_netif_remove_ip6_address_api(esp_netif_api_msg_t *msg)
|
||||
esp_ip6_addr_t *addr = (esp_ip6_addr_t *)msg->data;
|
||||
ip6_addr_t ip6addr;
|
||||
|
||||
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
ESP_LOGV(TAG, "%s esp_netif:%p", __func__, msg->esp_netif);
|
||||
memcpy(ip6addr.addr, addr->addr, sizeof(ip6addr.addr));
|
||||
#if LWIP_IPV6_SCOPES
|
||||
ip6addr.zone = 0;
|
||||
|
||||
Reference in New Issue
Block a user