Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83649
b: refs/heads/master
c: 324ff2c
h: refs/heads/master
i:
  83647: 4f6502c
v: v3
  • Loading branch information
Byron Bradley authored and Jeff Garzik committed Feb 5, 2008
1 parent 46564ad commit c4d9f15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39dbd9587bebedbd72be9a8a30a8c4783f3ef7eb
refs/heads/master: 324ff2c1793b6d3d5c377cf6de2ada9b49af227a
11 changes: 8 additions & 3 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,11 @@ static void eth_tx_fill_frag_descs(struct mv643xx_private *mp,
}
}

static inline __be16 sum16_as_be(__sum16 sum)
{
return (__force __be16)sum;
}

/**
* eth_tx_submit_descs_for_skb - submit data from an skb to the tx hw
*
Expand Down Expand Up @@ -1689,7 +1694,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);

if (skb->ip_summed == CHECKSUM_PARTIAL) {
BUG_ON(skb->protocol != ETH_P_IP);
BUG_ON(skb->protocol != htons(ETH_P_IP));

cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
ETH_GEN_IP_V_4_CHECKSUM |
Expand All @@ -1698,10 +1703,10 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
switch (ip_hdr(skb)->protocol) {
case IPPROTO_UDP:
cmd_sts |= ETH_UDP_FRAME;
desc->l4i_chk = udp_hdr(skb)->check;
desc->l4i_chk = ntohs(sum16_as_be(udp_hdr(skb)->check));
break;
case IPPROTO_TCP:
desc->l4i_chk = tcp_hdr(skb)->check;
desc->l4i_chk = ntohs(sum16_as_be(tcp_hdr(skb)->check));
break;
default:
BUG();
Expand Down

0 comments on commit c4d9f15

Please sign in to comment.