diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-07-12 13:34:06 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-07-20 10:20:19 +0100 |
commit | f0bbf9dd40f37f8c4870a33784996efd56955a75 (patch) | |
tree | 2a50425df977a28bee4304437daf008a93893624 /com32/libupload/upload_tftp.c | |
parent | 8486142cf30499e1d53d7faf3a168c8ed3163ab2 (diff) | |
download | syslinux-f0bbf9dd40f37f8c4870a33784996efd56955a75.tar.gz syslinux-f0bbf9dd40f37f8c4870a33784996efd56955a75.tar.xz syslinux-f0bbf9dd40f37f8c4870a33784996efd56955a75.zip |
Use pxe_call() instead of COMBOOT API
This involved some other changes, such as passing flags to
unload_pxe() now that we only call it from C code, and hence don't
need to update KeepPXE.
We also needed to move some of the pxe function prototypes to
com32/include/syslinux/pxe_api.h because they are now referenced
outside of the core.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/libupload/upload_tftp.c')
-rw-r--r-- | com32/libupload/upload_tftp.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/com32/libupload/upload_tftp.c b/com32/libupload/upload_tftp.c index 5e73c1c5..6a0dacb7 100644 --- a/com32/libupload/upload_tftp.c +++ b/com32/libupload/upload_tftp.c @@ -53,7 +53,6 @@ const char *tftp_string_error_message[]={ static int send_ack_packet(struct tftp_state *tftp, const void *pkt, size_t len) { - com32sys_t ireg, oreg; t_PXENV_UDP_WRITE *uw; t_PXENV_UDP_READ *ur; clock_t start; @@ -67,9 +66,6 @@ static int send_ack_packet(struct tftp_state *tftp, uw = lmalloc(sizeof *uw + len); ur = lmalloc(sizeof *ur + RCV_BUF); - memset(&ireg, 0, sizeof ireg); - ireg.eax.w[0] = 0x0009; - for (timeout = timeouts ; *timeout ; timeout++) { memset(uw, 0, sizeof *uw); memcpy(uw+1, pkt, len); @@ -80,11 +76,7 @@ static int send_ack_packet(struct tftp_state *tftp, uw->buffer_size = len; uw->buffer = FAR_PTR(uw+1); - ireg.ebx.w[0] = PXENV_UDP_WRITE; - ireg.es = SEG(uw); - ireg.edi.w[0] = OFFS(uw); - - __intcall(0x22, &ireg, &oreg); + pxe_call(PXENV_UDP_WRITE, uw); start = times(NULL); @@ -97,13 +89,9 @@ static int send_ack_packet(struct tftp_state *tftp, ur->buffer_size = RCV_BUF; ur->buffer = FAR_PTR(ur+1); - ireg.ebx.w[0] = PXENV_UDP_READ; - ireg.es = SEG(ur); - ireg.edi.w[0] = OFFS(ur); - __intcall(0x22, &ireg, &oreg); + err = pxe_call(PXENV_UDP_READ, ur); - if (!(oreg.eflags.l & EFLAGS_CF) && - ur->status == PXENV_STATUS_SUCCESS && + if (!err && ur->status == PXENV_STATUS_SUCCESS && tftp->srv_ip == ur->src_ip && (tftp->srv_port == 0 || tftp->srv_port == ur->s_port)) { |