diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bcmsysport.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 4a75b1de22e0..f9a3c1a76d5d 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -1192,7 +1192,7 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb, | |||
1192 | u32 csum_info; | 1192 | u32 csum_info; |
1193 | u8 ip_proto; | 1193 | u8 ip_proto; |
1194 | u16 csum_start; | 1194 | u16 csum_start; |
1195 | u16 ip_ver; | 1195 | __be16 ip_ver; |
1196 | 1196 | ||
1197 | /* Re-allocate SKB if needed */ | 1197 | /* Re-allocate SKB if needed */ |
1198 | if (unlikely(skb_headroom(skb) < sizeof(*tsb))) { | 1198 | if (unlikely(skb_headroom(skb) < sizeof(*tsb))) { |
@@ -1211,12 +1211,12 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb, | |||
1211 | memset(tsb, 0, sizeof(*tsb)); | 1211 | memset(tsb, 0, sizeof(*tsb)); |
1212 | 1212 | ||
1213 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1213 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1214 | ip_ver = htons(skb->protocol); | 1214 | ip_ver = skb->protocol; |
1215 | switch (ip_ver) { | 1215 | switch (ip_ver) { |
1216 | case ETH_P_IP: | 1216 | case htons(ETH_P_IP): |
1217 | ip_proto = ip_hdr(skb)->protocol; | 1217 | ip_proto = ip_hdr(skb)->protocol; |
1218 | break; | 1218 | break; |
1219 | case ETH_P_IPV6: | 1219 | case htons(ETH_P_IPV6): |
1220 | ip_proto = ipv6_hdr(skb)->nexthdr; | 1220 | ip_proto = ipv6_hdr(skb)->nexthdr; |
1221 | break; | 1221 | break; |
1222 | default: | 1222 | default: |
@@ -1230,7 +1230,8 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb, | |||
1230 | 1230 | ||
1231 | if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { | 1231 | if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { |
1232 | csum_info |= L4_LENGTH_VALID; | 1232 | csum_info |= L4_LENGTH_VALID; |
1233 | if (ip_proto == IPPROTO_UDP && ip_ver == ETH_P_IP) | 1233 | if (ip_proto == IPPROTO_UDP && |
1234 | ip_ver == htons(ETH_P_IP)) | ||
1234 | csum_info |= L4_UDP; | 1235 | csum_info |= L4_UDP; |
1235 | } else { | 1236 | } else { |
1236 | csum_info = 0; | 1237 | csum_info = 0; |
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 264fb37dd341..0445f2c0c629 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
@@ -1489,7 +1489,7 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, | |||
1489 | struct sk_buff *new_skb; | 1489 | struct sk_buff *new_skb; |
1490 | u16 offset; | 1490 | u16 offset; |
1491 | u8 ip_proto; | 1491 | u8 ip_proto; |
1492 | u16 ip_ver; | 1492 | __be16 ip_ver; |
1493 | u32 tx_csum_info; | 1493 | u32 tx_csum_info; |
1494 | 1494 | ||
1495 | if (unlikely(skb_headroom(skb) < sizeof(*status))) { | 1495 | if (unlikely(skb_headroom(skb) < sizeof(*status))) { |
@@ -1509,12 +1509,12 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, | |||
1509 | status = (struct status_64 *)skb->data; | 1509 | status = (struct status_64 *)skb->data; |
1510 | 1510 | ||
1511 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1511 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1512 | ip_ver = htons(skb->protocol); | 1512 | ip_ver = skb->protocol; |
1513 | switch (ip_ver) { | 1513 | switch (ip_ver) { |
1514 | case ETH_P_IP: | 1514 | case htons(ETH_P_IP): |
1515 | ip_proto = ip_hdr(skb)->protocol; | 1515 | ip_proto = ip_hdr(skb)->protocol; |
1516 | break; | 1516 | break; |
1517 | case ETH_P_IPV6: | 1517 | case htons(ETH_P_IPV6): |
1518 | ip_proto = ipv6_hdr(skb)->nexthdr; | 1518 | ip_proto = ipv6_hdr(skb)->nexthdr; |
1519 | break; | 1519 | break; |
1520 | default: | 1520 | default: |
@@ -1530,7 +1530,8 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, | |||
1530 | */ | 1530 | */ |
1531 | if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { | 1531 | if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { |
1532 | tx_csum_info |= STATUS_TX_CSUM_LV; | 1532 | tx_csum_info |= STATUS_TX_CSUM_LV; |
1533 | if (ip_proto == IPPROTO_UDP && ip_ver == ETH_P_IP) | 1533 | if (ip_proto == IPPROTO_UDP && |
1534 | ip_ver == htons(ETH_P_IP)) | ||
1534 | tx_csum_info |= STATUS_TX_CSUM_PROTO_UDP; | 1535 | tx_csum_info |= STATUS_TX_CSUM_PROTO_UDP; |
1535 | } else { | 1536 | } else { |
1536 | tx_csum_info = 0; | 1537 | tx_csum_info = 0; |