From: Josef Bacik <jbacik@fb.com>
To: grub-devel@gnu.org, mchang@suse.com, pjones@redhat.com,
kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: [PATCH 1/3] efinet: handle get_status() properly
Date: Wed, 5 Aug 2015 10:50:38 -0700 [thread overview]
Message-ID: <1438797040-1667541-2-git-send-email-jbacik@fb.com> (raw)
In-Reply-To: <1438797040-1667541-1-git-send-email-jbacik@fb.com>
The EFI SNP documentation isn't super clear on the value that is returned in
txbuf when calling into GetStatus. The documentation says its the pointer to
the recycle buffer, but the documentation for Transmit() says that it should be
the pointer to the buffer that we transmitted. On the boxes I'm using it's just
a random pointer (usually 0x1). It is definitely transmitting stuff, but the
get_status call is not returning the pointer to the txbuf we passed in. Looking
at a few EFI implementations and other SNP drivers it seems like there is
confusion everywhere on this. So since we only transmit one buffer at a time,
just assume that a non-NULL txbuf means that our transmit happened properly.
With this patch I can now do networking on our EFI enabled boxes. Thanks,
cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
grub-core/net/drivers/efi/efinet.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index f27a117..4d3f8aa 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -47,19 +47,11 @@ send_card_buffer (struct grub_net_card *dev,
if (st != GRUB_EFI_SUCCESS)
return grub_error (GRUB_ERR_IO,
N_("couldn't send network packet"));
- if (txbuf == dev->txbuf)
+ if (txbuf)
{
dev->txbusy = 0;
break;
}
- if (txbuf)
- {
- st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size,
- dev->txbuf, NULL, NULL, NULL);
- if (st != GRUB_EFI_SUCCESS)
- return grub_error (GRUB_ERR_IO,
- N_("couldn't send network packet"));
- }
if (limit_time < grub_get_time_ms ())
return grub_error (GRUB_ERR_TIMEOUT,
N_("couldn't send network packet"));
@@ -84,8 +76,9 @@ send_card_buffer (struct grub_net_card *dev,
we run in the GRUB_ERR_TIMEOUT case above.
Perhaps a timeout in the FW has discarded the recycle buffer.
*/
+ txbuf = NULL;
st = efi_call_3 (net->get_status, net, 0, &txbuf);
- dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf == dev->txbuf);
+ dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf);
return GRUB_ERR_NONE;
}
--
1.8.5.6
next prev parent reply other threads:[~2015-08-05 18:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 17:50 [PATCH 0/3] fix ipv6 support Josef Bacik
2015-08-05 17:50 ` Josef Bacik [this message]
2015-08-05 17:50 ` [PATCH 2/3] net: add local route when creating link local ipv6 interface Josef Bacik
2015-08-05 17:50 ` [PATCH 3/3] net: fix ipv6 routing Josef Bacik
2015-08-06 4:06 ` [PATCH 0/3] fix ipv6 support Michael Chang
2015-08-06 14:23 ` Josef Bacik
-- strict thread matches above, loose matches on Subject: below --
2015-08-05 18:36 [PATCH 1/3] efinet: handle get_status() properly Josef Bacik
2015-08-05 20:04 ` Andrei Borzenkov
2015-08-05 20:26 ` Josef Bacik
2015-08-05 20:32 ` Vladimir 'phcoder' Serbinenko
2015-08-05 20:39 ` Josef Bacik
2015-08-05 20:50 ` Josef Bacik
2015-08-05 20:52 ` Vladimir 'phcoder' Serbinenko
2015-08-06 3:42 ` Andrei Borzenkov
2015-08-06 14:26 ` Josef Bacik
2015-08-05 20:57 ` Seth Goldberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438797040-1667541-2-git-send-email-jbacik@fb.com \
--to=jbacik@fb.com \
--cc=grub-devel@gnu.org \
--cc=kernel-team@fb.com \
--cc=mchang@suse.com \
--cc=pjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).