[PATCH 4/7] net: e1000: configure tx/rx and rctl in open() instead of init()

Denis Orlov denorl2009 at gmail.com
Wed Jul 20 06:30:57 PDT 2022


Otherwise, ifdowning the interface leads to a state in which trying to
ifup it again fails.

Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
 drivers/net/e1000/main.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 4ca598eb2f..363730de0a 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -62,7 +62,9 @@ static int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
 static int e1000_phy_reset(struct e1000_hw *hw);
 static int e1000_detect_gig_phy(struct e1000_hw *hw);
 static void e1000_set_media_type(struct e1000_hw *hw);
-
+static void e1000_configure_tx(struct e1000_hw *hw);
+static void e1000_configure_rx(struct e1000_hw *hw);
+static void e1000_setup_rctl(struct e1000_hw *hw);
 
 static int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
 
@@ -811,6 +813,10 @@ static int e1000_open(struct eth_device *edev)
 		e1000_write_reg(hw, E1000_CTRL_EXT, ctrl_ext);
 	}
 
+	e1000_configure_tx(hw);
+	e1000_configure_rx(hw);
+	e1000_setup_rctl(hw);
+
 	return 0;
 }
 
@@ -3575,10 +3581,6 @@ static int e1000_init(struct eth_device *edev)
 	if (hw->mac_type == e1000_igb)
 		mdelay(15);
 
-	e1000_configure_tx(hw);
-	e1000_configure_rx(hw);
-	e1000_setup_rctl(hw);
-
 	return 0;
 }
 
-- 
2.20.1




More information about the barebox mailing list