diff options
Diffstat (limited to 'drivers/staging/gdm724x/gdm_lte.c')
-rw-r--r-- | drivers/staging/gdm724x/gdm_lte.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index a3e046c..cf80998 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -178,10 +178,10 @@ static int gdm_lte_emulate_arp(struct sk_buff *skb_in, u32 nic_type) return 0; } -static int icmp6_checksum(struct ipv6hdr *ipv6, u16 *ptr, int len) +static __sum16 icmp6_checksum(struct ipv6hdr *ipv6, u16 *ptr, int len) { unsigned short *w = ptr; - int sum = 0; + __wsum sum = 0; int i; union { @@ -203,19 +203,16 @@ static int icmp6_checksum(struct ipv6hdr *ipv6, u16 *ptr, int len) w = (u16 *)&pseudo_header; for (i = 0; i < ARRAY_SIZE(pseudo_header.pa); i++) - sum += pseudo_header.pa[i]; + sum = csum_add(sum, csum_unfold( + (__force __sum16)pseudo_header.pa[i])); w = ptr; while (len > 1) { - sum += *w++; + sum = csum_add(sum, csum_unfold((__force __sum16)*w++)); len -= 2; } - sum = (sum >> 16) + (sum & 0xFFFF); - sum += (sum >> 16); - sum = ~sum & 0xffff; - - return sum; + return csum_fold(sum); } static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type) @@ -353,7 +350,7 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb) struct ipv6hdr *ipv6; int mac_proto; void *network_data; - u32 nic_type = 0; + u32 nic_type; /* NIC TYPE is based on the nic_id of this net_device */ nic_type = 0x00000010 | nic->nic_id; |