From a80af336c23f447ad259c492ec8322133a0e3cbf Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Wed, 4 Sep 2024 12:38:18 -0400 Subject: [PATCH] drivers: wifi: esp_at: only log errors in active mode with full IPD Removes constant error logging when parsing IPD headers in active mode and waiting on remote IP and port. Currently an error message is logged for every character in the remote IP and port until the full length obtained. Signed-off-by: Daniel Mangum --- drivers/wifi/esp_at/esp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index 711d3783702..203991900a2 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -825,13 +825,19 @@ static int cmd_ipd_parse_hdr(struct esp_data *dev, err = esp_pull_quoted(&str, str_end, &remote_ip); if (err) { - LOG_ERR("Failed to pull remote_ip"); + if (err == -EAGAIN && match_len >= MAX_IPD_LEN) { + LOG_ERR("Failed to pull remote_ip"); + err = -EBADMSG; + } goto socket_unref; } err = esp_pull_long(&str, str_end, &port); if (err) { - LOG_ERR("Failed to pull port"); + if (err == -EAGAIN && match_len >= MAX_IPD_LEN) { + LOG_ERR("Failed to pull port"); + err = -EBADMSG; + } goto socket_unref; }