forked from mirrors/linux
		
	 a7cf3d24ee
			
		
	
	
		a7cf3d24ee
		
	
	
	
	
		
			
			The udp_ip4_ind bit is set only for IPv4 UDP non-fragmented packets
so that the hardware can flip the checksum to 0xFFFF if the computed
checksum is 0 per RFC768.
However, this bit had to be set for IPv6 UDP non fragmented packets
as well per hardware requirements. Otherwise, IPv6 UDP packets
with computed checksum as 0 were transmitted by hardware and were
dropped in the network.
In addition to setting this bit for IPv6 UDP, the field is also
appropriately renamed to udp_ind as part of this change.
Fixes: 5eb5f8608e ("net: qualcomm: rmnet: Add support for TX checksum offload")
Cc: Sean Tranchetti <stranche@codeaurora.org>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
		
	
			
		
			
				
	
	
		
			55 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0-only
 | |
|  * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 | |
|  */
 | |
| 
 | |
| #ifndef _LINUX_IF_RMNET_H_
 | |
| #define _LINUX_IF_RMNET_H_
 | |
| 
 | |
| struct rmnet_map_header {
 | |
| #if defined(__LITTLE_ENDIAN_BITFIELD)
 | |
| 	u8  pad_len:6;
 | |
| 	u8  reserved_bit:1;
 | |
| 	u8  cd_bit:1;
 | |
| #elif defined (__BIG_ENDIAN_BITFIELD)
 | |
| 	u8  cd_bit:1;
 | |
| 	u8  reserved_bit:1;
 | |
| 	u8  pad_len:6;
 | |
| #else
 | |
| #error	"Please fix <asm/byteorder.h>"
 | |
| #endif
 | |
| 	u8  mux_id;
 | |
| 	__be16 pkt_len;
 | |
| }  __aligned(1);
 | |
| 
 | |
| struct rmnet_map_dl_csum_trailer {
 | |
| 	u8  reserved1;
 | |
| #if defined(__LITTLE_ENDIAN_BITFIELD)
 | |
| 	u8  valid:1;
 | |
| 	u8  reserved2:7;
 | |
| #elif defined (__BIG_ENDIAN_BITFIELD)
 | |
| 	u8  reserved2:7;
 | |
| 	u8  valid:1;
 | |
| #else
 | |
| #error	"Please fix <asm/byteorder.h>"
 | |
| #endif
 | |
| 	u16 csum_start_offset;
 | |
| 	u16 csum_length;
 | |
| 	__be16 csum_value;
 | |
| } __aligned(1);
 | |
| 
 | |
| struct rmnet_map_ul_csum_header {
 | |
| 	__be16 csum_start_offset;
 | |
| #if defined(__LITTLE_ENDIAN_BITFIELD)
 | |
| 	u16 csum_insert_offset:14;
 | |
| 	u16 udp_ind:1;
 | |
| 	u16 csum_enabled:1;
 | |
| #elif defined (__BIG_ENDIAN_BITFIELD)
 | |
| 	u16 csum_enabled:1;
 | |
| 	u16 udp_ind:1;
 | |
| 	u16 csum_insert_offset:14;
 | |
| #else
 | |
| #error	"Please fix <asm/byteorder.h>"
 | |
| #endif
 | |
| } __aligned(1);
 | |
| 
 | |
| #endif /* !(_LINUX_IF_RMNET_H_) */
 |