[PATCH 3/3] fastboot net: workaround for receiving before sending

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

 



eth_rx will poll a device only if it is active, but the only way to
activate a device is by calling eth_check_open. Although eth_check_open is
called both by eth_send and __eth_rx, only the call from eth_send has an
effect, because eth_rx will not call __eth_rx unless it is active.

Signed-off-by: Daniel Glöckner <dg@xxxxxxxxx>
---
 include/net.h  | 1 +
 net/eth.c      | 2 +-
 net/fastboot.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net.h b/include/net.h
index 6912a557b..b9b821c9a 100644
--- a/include/net.h
+++ b/include/net.h
@@ -83,6 +83,7 @@ int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr);
 
 int eth_send(struct eth_device *edev, void *packet, int length);	   /* Send a packet		*/
 int eth_rx(void);			/* Check for received packets	*/
+int eth_check_open(struct eth_device *edev);
 
 /* associate a MAC address to a ethernet device. Should be called by
  * board code for boards which store their MAC address at some unusual
diff --git a/net/eth.c b/net/eth.c
index 53d24baa1..25ed9a88e 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -215,7 +215,7 @@ static int eth_carrier_check(struct eth_device *edev, int force)
  * Check if we have a current ethernet device and
  * eventually open it if we have to.
  */
-static int eth_check_open(struct eth_device *edev)
+int eth_check_open(struct eth_device *edev)
 {
 	int ret;
 
diff --git a/net/fastboot.c b/net/fastboot.c
index 41d1859ab..57128258d 100644
--- a/net/fastboot.c
+++ b/net/fastboot.c
@@ -393,6 +393,7 @@ struct fastboot_net *fastboot_net_init(struct fastboot_opts *opts)
 	}
 	net_udp_bind(fbn->net_con, FASTBOOT_PORT);
 
+	eth_check_open(fbn->net_con->edev);
 	fbn->poller.func = fastboot_poll;
 	ret = poller_register(&fbn->poller);
 	if (ret)
-- 
2.17.1


_______________________________________________
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