fix(esp_eth): correct PHYCFGR sanity check mask and bit validation

Closes https://github.com/espressif/esp-idf/issues/17530
This commit is contained in:
Guilherme Ferreira
2026-03-19 20:51:09 -03:00
committed by Euripedes Rocha
parent 2b5623970b
commit 3a739eba9b
@@ -613,7 +613,7 @@ static inline bool is_w5500_sane_for_rxtx(emac_w5500_t *emac)
{
uint8_t phycfg;
/* phy is ok for rx and tx operations if bits RST and LNK are set (no link down, no reset) */
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x8001)) {
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x81) == 0x81) {
return true;
}
return false;