[PATCH] net: disable all other devices when enabling the new one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some network devices need proper reinitialization before they can be
used. This is especially the case when using devices that share the same
driver.

Therefor the current approach, starting the open routine of an ether
device just once with the first call of send, runs those devices into
some unreliable behaviour.

This patch disables all devices that are not being used so they get
reinitialized with the next usage.

Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
---
 net/eth.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/eth.c b/net/eth.c
index 53d24baa16..0c26324d3f 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -217,6 +217,7 @@ static int eth_carrier_check(struct eth_device *edev, int force)
  */
 static int eth_check_open(struct eth_device *edev)
 {
+	struct eth_device *tmpedev;
 	int ret;
 
 	if (edev->active)
@@ -226,6 +227,9 @@ static int eth_check_open(struct eth_device *edev)
 	if (ret)
 		return ret;
 
+	for_each_netdev(tmpedev)
+		tmpedev->active = 0;
+
 	edev->active = 1;
 
 	return eth_carrier_check(edev, 1);
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux