aboutsummaryrefslogtreecommitdiffstats
path: root/efi/tcp.c
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2013-11-27 16:48:55 -0500
committerGene Cumm <gene.cumm@gmail.com>2014-01-29 11:55:14 -0500
commit5bf9bdcf0b2e3b4b9161c55713d8004ce6924900 (patch)
tree3eb0dcf215a128573568a4c369ae9dccaa109d20 /efi/tcp.c
parent1264f6ac132e9b399bfb846358ae1f055a42c23a (diff)
downloadsyslinux-5bf9bdcf0b2e3b4b9161c55713d8004ce6924900.tar.gz
syslinux-5bf9bdcf0b2e3b4b9161c55713d8004ce6924900.tar.xz
syslinux-5bf9bdcf0b2e3b4b9161c55713d8004ce6924900.zip
efi: Loop on Configure when EFI_NO_MAPPING in udp.c/tcp.c
This should help hardware that doesn't return EFI_SUCCESS immediately. Reported-by: Jason Matthews <jason.david.matthews@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Diffstat (limited to 'efi/tcp.c')
-rw-r--r--efi/tcp.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/efi/tcp.c b/efi/tcp.c
index 274456d0..f4dfc7e8 100644
--- a/efi/tcp.c
+++ b/efi/tcp.c
@@ -52,6 +52,8 @@ int core_tcp_connect(struct pxe_pvt_inode *socket, uint32_t ip, uint16_t port)
EFI_STATUS status;
EFI_TCP4 *tcp = (EFI_TCP4 *)b->this;
int rv = -1;
+ int unmapped = 1;
+ jiffies_t start, last, cur;
memset(&tdata, 0, sizeof(tdata));
@@ -63,7 +65,22 @@ int core_tcp_connect(struct pxe_pvt_inode *socket, uint32_t ip, uint16_t port)
tdata.TimeToLive = 64;
- status = uefi_call_wrapper(tcp->Configure, 2, tcp, &tdata);
+ last = start = jiffies();
+ while (unmapped){
+ status = uefi_call_wrapper(tcp->Configure, 2, tcp, &tdata);
+ if (status != EFI_NO_MAPPING)
+ unmapped = 0;
+ else {
+ cur = jiffies();
+ if ( (cur - last) >= EFI_NOMAP_PRINT_DELAY ) {
+ last = cur;
+ Print(L"core_tcp_connect: stalling on configure with no mapping\n");
+ } else if ( (cur - start) > EFI_NOMAP_PRINT_DELAY * EFI_NOMAP_PRINT_COUNT) {
+ Print(L"core_tcp_connect: aborting on no mapping\n");
+ unmapped = 0;
+ }
+ }
+ }
if (status != EFI_SUCCESS)
return -1;