Re: OID_TCP_TASK_OFFLOAD problem
- From: "Rodel Miguel" <rodel_miguel@xxxxxxxxx>
- Date: Fri, 18 Aug 2006 10:16:43 +0800
Hi Guys,
Apparently, the problem is telling the TCP/IP transport of the size of the
buffer that my NDIS_TASK_OFFLOAD needs. The driver now tells the querying
module of the number of bytes it needs and the querying module will provide
the necessary buffer size.
Bottomline: always check for the available buffers. :)
Best Regards,
Rodel
"Rodel Miguel" <rodel_miguel@xxxxxxxxx> wrote in message
news:%23pE1mKSwGHA.4872@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
My WinCE version is 4.2. I am trying to support checksum offloading on my
NIC. However, I am having some problems with OID_TCP_TASK_OFFLOAD support
on my NDIS driver. Here's the scenario:
OID_TCP_TASK_OFFLOAD is being queried by the TCP/IP transport, which I can
actually verify with some debug messages. I am giving the following
information to the InformationBuffer:
/*--------- start of code segment --------*/
NDIS_TASK_OFFLOAD_HEADER *pNetOffloadInfo = (NDIS_TASK_OFFLOAD_HEADER
*)pBuffer; // pBuffer is the InformationBuffer
NDIS_ENCAPSULATION_FORMAT *pNetEncapsulation =
(NDIS_ENCAPSULATION_FORMAT *)&pNetOffloadInfo->EncapsulationFormat;
NDIS_TASK_OFFLOAD SOffloadCapability, *pSOffloadCapability; // let us
support only checksum capability, let us do large send later
NDIS_TASK_TCP_IP_CHECKSUM SChecksumCapability; // tell NDIS of MAC's
checksum capability
/* offload capability */
SOffloadCapability.Version = 0;
SOffloadCapability.Size = sizeof(NDIS_TASK_OFFLOAD);
SOffloadCapability.Task = TcpIpChecksumNdisTask;
SOffloadCapability.OffsetNextTask = 0; // tell NDIS this is the only
task we have. Let us extend this for Large Sends Later!
SOffloadCapability.TaskBufferLength = sizeof(NDIS_TASK_TCP_IP_CHECKSUM);
/* checksum checking capability */
*((ULONG *)&SChecksumCapability.V6Receive) = 0; // there's IPv6
capability on the MAC, however, we do not need to support it yet
*((ULONG *)&SChecksumCapability.V6Transmit) = 0; // there's IPv6
capability on the MAC, however, we do not need to support it yet
*((ULONG *)&SChecksumCapability.V4Transmit) = 0;
*((ULONG *)&SChecksumCapability.V4Receive) = 0;
SChecksumCapability.V4Transmit.IpOptionsSupported = 1;
SChecksumCapability.V4Transmit.TcpOptionsSupported = 1;
SChecksumCapability.V4Transmit.TcpChecksum = 1;
SChecksumCapability.V4Transmit.UdpChecksum = 1;
SChecksumCapability.V4Transmit.IpChecksum = 1;
SChecksumCapability.V4Receive.IpOptionsSupported = 1;
SChecksumCapability.V4Receive.TcpOptionsSupported = 1;
SChecksumCapability.V4Receive.TcpChecksum = 1;
SChecksumCapability.V4Receive.UdpChecksum = 1;
SChecksumCapability.V4Receive.IpChecksum = 1;
/* copy the offload capability to the information buffer */
pNetOffloadInfo->OffsetFirstTask = sizeof(NDIS_TASK_OFFLOAD_HEADER); //
pNetOffloadInfo points to the InformationBuffer which contains the
NDIS_TASK_OFFLOAD_HEADER
pSOffloadCapability = (NDIS_TASK_OFFLOAD *)((BYTE *)pBuffer +
pNetOffloadInfo->OffsetFirstTask);
memcpy((void *)pSOffloadCapability, (void *)&SOffloadCapability,
sizeof(NDIS_TASK_OFFLOAD));
memcpy((void *)pSOffloadCapability->TaskBuffer, (void
*)&SChecksumCapability, sizeof(NDIS_TASK_TCP_IP_CHECKSUM));
/*--------- end of code segment --------*/
As a summary on the code fragment that I have given, I want to support
only TCP/IPv4 checksum offloading.
I assume that the TCP/IP stack of WinCE would automatically SET this OID,
however no set is being given by the stack. I have tried looking into the
following:
1. Assuming that the Network Application (not the WinCE's TCP/IP stack)
requests for this feature: setsockopt - there's no option to support
checksum offloading.
2. TCP/IP registry settings - there's no specific to checksum
offloading key based on the documentation
3. Check on the Send routine if the TCP/IP is actually requesting
checksum offloading, the macro NDIS_PER_PACKET_INFO_FROM_PACKET(Packet,
TcpIpChecksumPacketInfo) returns NULL always.
With this background, I have the following questions:
1. How can we be sure that TCP/IP is not having errors whenever it queries
OID_TCP_TASK_OFFLOAD?
2. Would TCP/IP stack know if we forcefully set the OID_TCP_TASK_OFFLOAD
using for example DeviceIoControl?
3. Is there a way to set this OID with Windows sockets or any other means
at the Application layer?
Thank you very much for your help!
Best Regards,
Rodel
.
- References:
- OID_TCP_TASK_OFFLOAD problem
- From: Rodel Miguel
- OID_TCP_TASK_OFFLOAD problem
- Prev by Date: Re: c# dev needs c++ code for hiding mouse on OS boot
- Next by Date: Re: can't find generation rule for some library
- Previous by thread: OID_TCP_TASK_OFFLOAD problem
- Next by thread: CF card detection in WinCE 5.0
- Index(es):
Relevant Pages
|