Re: [edk2] Some question for MTFTP4 protocol

2015-09-18 Thread Toy Ho
Hi,

Thanks for your information.

I have try the PxeBcTftpGetFileSize function, and i can continue the
download flow with block base method.
Flow : Read Req->OACK->ERR->DATA packet
(The Token.BufferSize is still zero, so i think i didn't get the correct
data buffer,)

But using the another buffer base method, the download flow will block at
receiving OACK packet.
Server send OACK packet continuously, so the client can't change its status
to receive DATA packet.

I'm still debugging these two problem.


2015-09-18 11:16 GMT+08:00 Ye, Ting :

> Correct a typo below. MTFTP4 server -> MTFTP4 driver.
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ye, Ting
> Sent: Friday, September 18, 2015 11:13 AM
> To: Mang Chia Ho; edk2-devel@lists.01.org
> Subject: Re: [edk2] Some question for MTFTP4 protocol
>
> Hi,
>
> For GetInfo(), the MTFTP4 driver provides a callback function named
> "Mtftp4GetInfoCheckPacket" for CheckPacket(). Even though the UEFI spec
> does not define the GetInfo() should use EFI_MTFTP4_TOKEN, the MTFTP4
> driver implements GetInfo() based on Readfile() thus it need supply
> callback function.
>
> The GetInfo() function only need one OACK packet to get the file size, so
> it sends out an error message to abort the transfer after it received an
> OACK packet from MTFTP4 server.
>
> You might refer to PxeBcTftpGetFileSize() in UefiPxebcDxe under
> MdeModulePkg for how to use Mtftp4 protocol to get file size.
>
>
> Best Regards,
> Ye Ting
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Mang Chia Ho
> Sent: Thursday, September 17, 2015 10:07 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Some question for MTFTP4 protocol
>
> Hi all,
>
> I have some question about the mtftp4 protocol.
>
> When i use the "EFI_MTFTP4_PROTOCOL.GetInfo()" function to get the file
> size of server's file.
> And server will send a OACK packet to client for file info.
> And client should use "EFI_MTFTP4_PROTOCOL.ParseOptions()" to parsing the
> OACK packet.
>
> But my mtftp protol send an error packet to server such as following
> message before the EFI_MTFTP4_PROTOCOL.ParseOptions.
> +
> ++ Opcode: Error Code (5)
> ++ Error code: Option negotiation failed (8)
> ++ Error message: User aborted the transfer
> +
>
> And i also trace the mtftp protocol source from
> MdeModulePkg\Universal\Network\Mtftp4Dxe.
> This error message was send by the Mtftp4RrqInput of Mtftp4Rrq.c file.
>
>
> ++
>
> ++
> ++if ((Instance->Token->CheckPacket != NULL) &&
> ++((Opcode == EFI_MTFTP4_OPCODE_OACK) || (Opcode ==
> EFI_MTFTP4_OPCODE_ERROR))) {
> ++  Status = Instance->Token->CheckPacket (
> ++  &Instance->Mtftp4,
> ++  Instance->Token,
> ++  (UINT16) Len,
> ++  Packet
> ++ );
> ==> The status was "EFI_ABORTED"
> ++  if (EFI_ERROR (Status)) {
> ++//
> ++// Send an error message to the server to inform it
> ++//
> ++if (Opcode != EFI_MTFTP4_OPCODE_ERROR) {
> ++  Mtftp4SendError (
> ++Instance,
> ++EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
> ++(UINT8 *) "User aborted the transfer"
> ++);
> ++}
> ++  ...
>
> ++
>
> ++
>
> But i don't know why the "Instance->Token->CheckPacket" send error status
> back.
> This CheckPacket callback function is represent for what function in the
> mtftp4 flow?
> According the uefi spec, the "EFI_MTFTP4_PROTOCOL.GetInfo()" function
> doesn't meantion any EFI_MTFTP4_TOKEN member, but only in
> "EFI_MTFTP4_PROTOCOL.ReadFile()".
>
> Please give some help about this error message.
>
>
> Thanks
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Some question for MTFTP4 protocol

2015-09-17 Thread Ye, Ting
Correct a typo below. MTFTP4 server -> MTFTP4 driver.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ye, Ting
Sent: Friday, September 18, 2015 11:13 AM
To: Mang Chia Ho; edk2-devel@lists.01.org
Subject: Re: [edk2] Some question for MTFTP4 protocol

Hi,

For GetInfo(), the MTFTP4 driver provides a callback function named 
"Mtftp4GetInfoCheckPacket" for CheckPacket(). Even though the UEFI spec does 
not define the GetInfo() should use EFI_MTFTP4_TOKEN, the MTFTP4 driver 
implements GetInfo() based on Readfile() thus it need supply callback function.

The GetInfo() function only need one OACK packet to get the file size, so it 
sends out an error message to abort the transfer after it received an OACK 
packet from MTFTP4 server.

You might refer to PxeBcTftpGetFileSize() in UefiPxebcDxe under MdeModulePkg 
for how to use Mtftp4 protocol to get file size.


Best Regards,
Ye Ting

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Mang 
Chia Ho
Sent: Thursday, September 17, 2015 10:07 PM
To: edk2-devel@lists.01.org
Subject: [edk2] Some question for MTFTP4 protocol

Hi all,

I have some question about the mtftp4 protocol.

When i use the "EFI_MTFTP4_PROTOCOL.GetInfo()" function to get the file
size of server's file.
And server will send a OACK packet to client for file info.
And client should use "EFI_MTFTP4_PROTOCOL.ParseOptions()" to parsing the
OACK packet.

But my mtftp protol send an error packet to server such as following
message before the EFI_MTFTP4_PROTOCOL.ParseOptions.
+
++ Opcode: Error Code (5)
++ Error code: Option negotiation failed (8)
++ Error message: User aborted the transfer
+

And i also trace the mtftp protocol source from
MdeModulePkg\Universal\Network\Mtftp4Dxe.
This error message was send by the Mtftp4RrqInput of Mtftp4Rrq.c file.

++
++
++if ((Instance->Token->CheckPacket != NULL) &&
++((Opcode == EFI_MTFTP4_OPCODE_OACK) || (Opcode ==
EFI_MTFTP4_OPCODE_ERROR))) {
++  Status = Instance->Token->CheckPacket (
++  &Instance->Mtftp4,
++  Instance->Token,
++  (UINT16) Len,
++  Packet
++ );
==> The status was "EFI_ABORTED"
++  if (EFI_ERROR (Status)) {
++//
++// Send an error message to the server to inform it
++//
++if (Opcode != EFI_MTFTP4_OPCODE_ERROR) {
++  Mtftp4SendError (
++Instance,
++EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
++(UINT8 *) "User aborted the transfer"
++);
++}
++  ...
++
++

But i don't know why the "Instance->Token->CheckPacket" send error status
back.
This CheckPacket callback function is represent for what function in the
mtftp4 flow?
According the uefi spec, the "EFI_MTFTP4_PROTOCOL.GetInfo()" function
doesn't meantion any EFI_MTFTP4_TOKEN member, but only in
"EFI_MTFTP4_PROTOCOL.ReadFile()".

Please give some help about this error message.


Thanks
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Some question for MTFTP4 protocol

2015-09-17 Thread Ye, Ting
Hi,

For GetInfo(), the MTFTP4 server provides a callback function named 
"Mtftp4GetInfoCheckPacket" for CheckPacket(). Even though the UEFI spec does 
not define the GetInfo() should use EFI_MTFTP4_TOKEN, the MTFTP4 driver 
implements GetInfo() based on Readfile() thus it need supply callback function.

The GetInfo() function only need one OACK packet to get the file size, so it 
sends out an error message to abort the transfer after it received an OACK 
packet from MTFTP4 server.

You might refer to PxeBcTftpGetFileSize() in UefiPxebcDxe under MdeModulePkg 
for how to use Mtftp4 protocol to get file size.


Best Regards,
Ye Ting

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Mang 
Chia Ho
Sent: Thursday, September 17, 2015 10:07 PM
To: edk2-devel@lists.01.org
Subject: [edk2] Some question for MTFTP4 protocol

Hi all,

I have some question about the mtftp4 protocol.

When i use the "EFI_MTFTP4_PROTOCOL.GetInfo()" function to get the file
size of server's file.
And server will send a OACK packet to client for file info.
And client should use "EFI_MTFTP4_PROTOCOL.ParseOptions()" to parsing the
OACK packet.

But my mtftp protol send an error packet to server such as following
message before the EFI_MTFTP4_PROTOCOL.ParseOptions.
+
++ Opcode: Error Code (5)
++ Error code: Option negotiation failed (8)
++ Error message: User aborted the transfer
+

And i also trace the mtftp protocol source from
MdeModulePkg\Universal\Network\Mtftp4Dxe.
This error message was send by the Mtftp4RrqInput of Mtftp4Rrq.c file.

++
++
++if ((Instance->Token->CheckPacket != NULL) &&
++((Opcode == EFI_MTFTP4_OPCODE_OACK) || (Opcode ==
EFI_MTFTP4_OPCODE_ERROR))) {
++  Status = Instance->Token->CheckPacket (
++  &Instance->Mtftp4,
++  Instance->Token,
++  (UINT16) Len,
++  Packet
++ );
==> The status was "EFI_ABORTED"
++  if (EFI_ERROR (Status)) {
++//
++// Send an error message to the server to inform it
++//
++if (Opcode != EFI_MTFTP4_OPCODE_ERROR) {
++  Mtftp4SendError (
++Instance,
++EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
++(UINT8 *) "User aborted the transfer"
++);
++}
++  ...
++
++

But i don't know why the "Instance->Token->CheckPacket" send error status
back.
This CheckPacket callback function is represent for what function in the
mtftp4 flow?
According the uefi spec, the "EFI_MTFTP4_PROTOCOL.GetInfo()" function
doesn't meantion any EFI_MTFTP4_TOKEN member, but only in
"EFI_MTFTP4_PROTOCOL.ReadFile()".

Please give some help about this error message.


Thanks
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel