ipoib_cm_desc_t *p_desc;\r
uint32_t i = 0;\r
NDIS_PACKET *p_packet;\r
+ NDIS_TCP_IP_CHECKSUM_PACKET_INFO chksum;\r
\r
IPOIB_ENTER( IPOIB_DBG_RECV );\r
UNUSED_PARAM( p_endpt );\r
p_port->cm_recv_mgr.depth--;\r
continue;\r
}\r
- p_desc->ndis_csum.Value = 0;\r
- p_desc->ndis_csum.Receive.NdisPacketTcpChecksumSucceeded = TRUE;\r
- p_desc->ndis_csum.Receive.NdisPacketUdpChecksumSucceeded = TRUE;\r
- p_desc->ndis_csum.Receive.NdisPacketIpChecksumSucceeded = TRUE;\r
- NDIS_PER_PACKET_INFO_FROM_PACKET( p_packet, TcpIpChecksumPacketInfo ) =\r
- (void*)(uintn_t)p_desc->ndis_csum.Value;\r
+ chksum.Value = 0;\r
+ switch( p_port->p_adapter->params.recv_chksum_offload )\r
+ {\r
+ default:\r
+ CL_ASSERT( FALSE );\r
+ case CSUM_DISABLED:\r
+ NDIS_PER_PACKET_INFO_FROM_PACKET( p_packet, TcpIpChecksumPacketInfo ) =\r
+ (void*)(uintn_t)chksum.Value;\r
+ break;\r
+ case CSUM_ENABLED:\r
+ /* Get the checksums directly from packet information. */\r
+ /* In this case, no one of cheksum's cat get false value */\r
+ /* If hardware checksum failed or wasn't calculated, NDIS will recalculate it again */\r
+ NDIS_PER_PACKET_INFO_FROM_PACKET( p_packet, TcpIpChecksumPacketInfo ) = \r
+ (void*)(uintn_t)(p_desc->ndis_csum.Value);\r
+ break;\r
+ case CSUM_BYPASS:\r
+ /* Flag the checksums as having been calculated. */\r
+ chksum.Receive.NdisPacketTcpChecksumSucceeded = TRUE;\r
+ chksum.Receive.NdisPacketUdpChecksumSucceeded = TRUE;\r
+ chksum.Receive.NdisPacketIpChecksumSucceeded = TRUE;\r
+ NDIS_PER_PACKET_INFO_FROM_PACKET( p_packet, TcpIpChecksumPacketInfo ) =\r
+ (void*)(uintn_t)chksum.Value;\r
+ break;\r
+ }\r
\r
NDIS_SET_PACKET_STATUS( p_packet, NDIS_STATUS_SUCCESS );\r
p_port->cm_recv_mgr.recv_pkt_array[i] = p_packet;\r
NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
EVENT_IPOIB_CONNECTED_MODE_ERR, 1, 0xbadc0de2 );\r
}\r
- else \r
- {\r
- /* now we can adjust csum capabilities */\r
- if (p_port->p_adapter->params.send_chksum_offload )\r
- p_port->p_adapter->params.send_chksum_offload = CSUM_DISABLED;\r
-\r
- if (p_port->p_adapter->params.recv_chksum_offload == CSUM_ENABLED)\r
- p_port->p_adapter->params.recv_chksum_offload = CSUM_BYPASS;\r
- }\r
-\r
}\r
IPOIB_EXIT( IPOIB_DBG_INIT );\r
return IB_SUCCESS;\r