[PATCH 23/25] net: efi-snp: Check for carrier before sending

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

 



We have carrier informations available, so check them before sending a
packet.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/net/efi-snp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/efi-snp.c b/drivers/net/efi-snp.c
index def2714bee..3c0663c802 100644
--- a/drivers/net/efi-snp.c
+++ b/drivers/net/efi-snp.c
@@ -134,6 +134,9 @@ static int efi_snp_eth_send(struct eth_device *edev, void *packet, int length)
 	void *txbuf;
 	uint64_t start;
 
+	if (!priv->snp->Mode->MediaPresent)
+		return -ENOMEDIUM;
+
 	efiret = priv->snp->transmit(priv->snp, 0, length, packet, NULL, NULL, NULL);
 	if (EFI_ERROR(efiret)) {
 		dev_err(priv->dev, "failed to send: %s\n", efi_strerror(efiret));
-- 
2.30.2


_______________________________________________
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