aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-11 00:04:22 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:26 -0400
commitaa8223c7bb0b05183e1737881ed21827aa5b9e73 (patch)
tree05c9832326edfeb878472f15cf8133ed9f014cdf /drivers/net
parentab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (diff)
[SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/atl1/atl1_main.c7
-rw-r--r--drivers/net/bnx2.c8
-rw-r--r--drivers/net/chelsio/sge.c2
-rw-r--r--drivers/net/cxgb3/sge.c2
-rw-r--r--drivers/net/e1000/e1000_main.c11
-rw-r--r--drivers/net/ioc3-eth.c2
-rw-r--r--drivers/net/ixgb/ixgb_main.c7
-rw-r--r--drivers/net/mv643xx_eth.c2
-rw-r--r--drivers/net/tg3.c15
9 files changed, 29 insertions, 27 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 8d5994751e2e..d60c2217332c 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1298,9 +1298,10 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,
1298 1298
1299 iph->tot_len = 0; 1299 iph->tot_len = 0;
1300 iph->check = 0; 1300 iph->check = 0;
1301 skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, 1301 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
1302 iph->daddr, 0, 1302 iph->daddr, 0,
1303 IPPROTO_TCP, 0); 1303 IPPROTO_TCP,
1304 0);
1304 ipofst = skb_network_offset(skb); 1305 ipofst = skb_network_offset(skb);
1305 if (ipofst != ENET_HEADER_SIZE) /* 802.3 frame */ 1306 if (ipofst != ENET_HEADER_SIZE) /* 802.3 frame */
1306 tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT; 1307 tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 73512fb16452..7e7b5f344030 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4524,7 +4524,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4524 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO; 4524 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;
4525 4525
4526 tcp_opt_len = 0; 4526 tcp_opt_len = 0;
4527 if (skb->h.th->doff > 5) 4527 if (tcp_hdr(skb)->doff > 5)
4528 tcp_opt_len = tcp_optlen(skb); 4528 tcp_opt_len = tcp_optlen(skb);
4529 4529
4530 ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); 4530 ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
@@ -4532,9 +4532,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4532 iph = ip_hdr(skb); 4532 iph = ip_hdr(skb);
4533 iph->check = 0; 4533 iph->check = 0;
4534 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); 4534 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
4535 skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 4535 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
4536 0, IPPROTO_TCP, 0); 4536 iph->daddr, 0,
4537 4537 IPPROTO_TCP, 0);
4538 if (tcp_opt_len || (iph->ihl > 5)) { 4538 if (tcp_opt_len || (iph->ihl > 5)) {
4539 vlan_tag_flags |= ((iph->ihl - 5) + 4539 vlan_tag_flags |= ((iph->ihl - 5) +
4540 (tcp_opt_len >> 2)) << 8; 4540 (tcp_opt_len >> 2)) << 8;
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index a4204dff3636..43e92f9f0bcd 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -1872,7 +1872,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
1872 hdr->opcode = CPL_TX_PKT_LSO; 1872 hdr->opcode = CPL_TX_PKT_LSO;
1873 hdr->ip_csum_dis = hdr->l4_csum_dis = 0; 1873 hdr->ip_csum_dis = hdr->l4_csum_dis = 0;
1874 hdr->ip_hdr_words = ip_hdr(skb)->ihl; 1874 hdr->ip_hdr_words = ip_hdr(skb)->ihl;
1875 hdr->tcp_hdr_words = skb->h.th->doff; 1875 hdr->tcp_hdr_words = tcp_hdr(skb)->doff;
1876 hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type, 1876 hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type,
1877 skb_shinfo(skb)->gso_size)); 1877 skb_shinfo(skb)->gso_size));
1878 hdr->len = htonl(skb->len - sizeof(*hdr)); 1878 hdr->len = htonl(skb->len - sizeof(*hdr));
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index d38b1bcd138e..a70fe9145a2e 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -901,7 +901,7 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
901 CPL_ETH_II : CPL_ETH_II_VLAN; 901 CPL_ETH_II : CPL_ETH_II_VLAN;
902 tso_info |= V_LSO_ETH_TYPE(eth_type) | 902 tso_info |= V_LSO_ETH_TYPE(eth_type) |
903 V_LSO_IPHDR_WORDS(ip_hdr(skb)->ihl) | 903 V_LSO_IPHDR_WORDS(ip_hdr(skb)->ihl) |
904 V_LSO_TCPHDR_WORDS(skb->h.th->doff); 904 V_LSO_TCPHDR_WORDS(tcp_hdr(skb)->doff);
905 hdr->lso_info = htonl(tso_info); 905 hdr->lso_info = htonl(tso_info);
906 flits = 3; 906 flits = 3;
907 } else { 907 } else {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4572fbba50f9..e86deb2ef823 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2893,14 +2893,15 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2893 struct iphdr *iph = ip_hdr(skb); 2893 struct iphdr *iph = ip_hdr(skb);
2894 iph->tot_len = 0; 2894 iph->tot_len = 0;
2895 iph->check = 0; 2895 iph->check = 0;
2896 skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, 2896 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
2897 iph->daddr, 0, 2897 iph->daddr, 0,
2898 IPPROTO_TCP, 0); 2898 IPPROTO_TCP,
2899 0);
2899 cmd_length = E1000_TXD_CMD_IP; 2900 cmd_length = E1000_TXD_CMD_IP;
2900 ipcse = skb_transport_offset(skb) - 1; 2901 ipcse = skb_transport_offset(skb) - 1;
2901 } else if (skb->protocol == htons(ETH_P_IPV6)) { 2902 } else if (skb->protocol == htons(ETH_P_IPV6)) {
2902 ipv6_hdr(skb)->payload_len = 0; 2903 ipv6_hdr(skb)->payload_len = 0;
2903 skb->h.th->check = 2904 tcp_hdr(skb)->check =
2904 ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 2905 ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
2905 &ipv6_hdr(skb)->daddr, 2906 &ipv6_hdr(skb)->daddr,
2906 0, IPPROTO_TCP, 0); 2907 0, IPPROTO_TCP, 0);
@@ -2909,7 +2910,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2909 ipcss = skb_network_offset(skb); 2910 ipcss = skb_network_offset(skb);
2910 ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data; 2911 ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
2911 tucss = skb_transport_offset(skb); 2912 tucss = skb_transport_offset(skb);
2912 tucso = (void *)&(skb->h.th->check) - (void *)skb->data; 2913 tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
2913 tucse = 0; 2914 tucse = 0;
2914 2915
2915 cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE | 2916 cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index ba012e10d79a..bc62e770a256 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1426,7 +1426,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
1426 } 1426 }
1427 if (proto == IPPROTO_TCP) { 1427 if (proto == IPPROTO_TCP) {
1428 csoff += offsetof(struct tcphdr, check); 1428 csoff += offsetof(struct tcphdr, check);
1429 skb->h.th->check = csum; 1429 tcp_hdr(skb)->check = csum;
1430 } 1430 }
1431 1431
1432 w0 = ETXD_DOCHECKSUM | (csoff << ETXD_CHKOFF_SHIFT); 1432 w0 = ETXD_DOCHECKSUM | (csoff << ETXD_CHKOFF_SHIFT);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 96550d681623..e729ced52dc3 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1195,13 +1195,14 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
1195 iph = ip_hdr(skb); 1195 iph = ip_hdr(skb);
1196 iph->tot_len = 0; 1196 iph->tot_len = 0;
1197 iph->check = 0; 1197 iph->check = 0;
1198 skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 1198 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
1199 0, IPPROTO_TCP, 0); 1199 iph->daddr, 0,
1200 IPPROTO_TCP, 0);
1200 ipcss = skb_network_offset(skb); 1201 ipcss = skb_network_offset(skb);
1201 ipcso = (void *)&(iph->check) - (void *)skb->data; 1202 ipcso = (void *)&(iph->check) - (void *)skb->data;
1202 ipcse = skb_transport_offset(skb) - 1; 1203 ipcse = skb_transport_offset(skb) - 1;
1203 tucss = skb_transport_offset(skb); 1204 tucss = skb_transport_offset(skb);
1204 tucso = (void *)&(skb->h.th->check) - (void *)skb->data; 1205 tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
1205 tucse = 0; 1206 tucse = 0;
1206 1207
1207 i = adapter->tx_ring.next_to_use; 1208 i = adapter->tx_ring.next_to_use;
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 43723839e934..ab15ecd4b3d6 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1169,7 +1169,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
1169 desc->l4i_chk = udp_hdr(skb)->check; 1169 desc->l4i_chk = udp_hdr(skb)->check;
1170 break; 1170 break;
1171 case IPPROTO_TCP: 1171 case IPPROTO_TCP:
1172 desc->l4i_chk = skb->h.th->check; 1172 desc->l4i_chk = tcp_hdr(skb)->check;
1173 break; 1173 break;
1174 default: 1174 default:
1175 BUG(); 1175 BUG();
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 7ca30d76bf6f..414365c3198d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3922,7 +3922,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
3922 base_flags |= (TXD_FLAG_CPU_PRE_DMA | 3922 base_flags |= (TXD_FLAG_CPU_PRE_DMA |
3923 TXD_FLAG_CPU_POST_DMA); 3923 TXD_FLAG_CPU_POST_DMA);
3924 3924
3925 skb->h.th->check = 0; 3925 tcp_hdr(skb)->check = 0;
3926 3926
3927 } 3927 }
3928 else if (skb->ip_summed == CHECKSUM_PARTIAL) 3928 else if (skb->ip_summed == CHECKSUM_PARTIAL)
@@ -4080,14 +4080,13 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
4080 iph->check = 0; 4080 iph->check = 0;
4081 iph->tot_len = htons(mss + hdr_len); 4081 iph->tot_len = htons(mss + hdr_len);
4082 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { 4082 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
4083 skb->h.th->check = 0; 4083 tcp_hdr(skb)->check = 0;
4084 base_flags &= ~TXD_FLAG_TCPUDP_CSUM; 4084 base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
4085 } 4085 } else
4086 else { 4086 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
4087 skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, 4087 iph->daddr, 0,
4088 iph->daddr, 0, 4088 IPPROTO_TCP,
4089 IPPROTO_TCP, 0); 4089 0);
4090 }
4091 4090
4092 if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) || 4091 if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
4093 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) { 4092 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {