Explorar o código

esp_eth: adapt ksz8041.c to changes from commit 03a6c49

Closes https://github.com/espressif/esp-idf/issues/7570
Merges https://github.com/espressif/esp-idf/pull/7573
Christian Fischerauer %!s(int64=4) %!d(string=hai) anos
pai
achega
3bd69d296d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      components/esp_eth/src/esp_eth_phy_ksz8041.c

+ 2 - 2
components/esp_eth/src/esp_eth_phy_ksz8041.c

@@ -198,6 +198,8 @@ static esp_err_t ksz8041_negotiate(esp_eth_phy_t *phy)
 {
 {
     phy_ksz8041_t *ksz8041 = __containerof(phy, phy_ksz8041_t, parent);
     phy_ksz8041_t *ksz8041 = __containerof(phy, phy_ksz8041_t, parent);
     esp_eth_mediator_t *eth = ksz8041->eth;
     esp_eth_mediator_t *eth = ksz8041->eth;
+    /* in case any link status has changed, let's assume we're in link down status */
+    ksz8041->link_status = ETH_LINK_DOWN;
     /* Restart auto negotiation */
     /* Restart auto negotiation */
     bmcr_reg_t bmcr = {
     bmcr_reg_t bmcr = {
         .speed_select = 1,     /* 100Mbps */
         .speed_select = 1,     /* 100Mbps */
@@ -224,8 +226,6 @@ static esp_err_t ksz8041_negotiate(esp_eth_phy_t *phy)
     if ((to >= ksz8041->autonego_timeout_ms / 100) && (ksz8041->link_status == ETH_LINK_UP)) {
     if ((to >= ksz8041->autonego_timeout_ms / 100) && (ksz8041->link_status == ETH_LINK_UP)) {
         ESP_LOGW(TAG, "auto negotiation timeout");
         ESP_LOGW(TAG, "auto negotiation timeout");
     }
     }
-    /* Updata information about link, speed, duplex */
-    PHY_CHECK(ksz8041_update_link_duplex_speed(ksz8041) == ESP_OK, "update link duplex speed failed", err);
     return ESP_OK;
     return ESP_OK;
 err:
 err:
     return ESP_FAIL;
     return ESP_FAIL;