aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/3com
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-18 17:00:24 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-19 03:10:46 -0400
commit9e903e085262ffbf1fc44a17ac06058aca03524a (patch)
tree4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/ethernet/3com
parentdd767856a36e00b631d65ebc4bb81b19915532d6 (diff)
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize all references to skb frags size. Define accessors : skb_frag_size() to fetch frag size, and skb_frag_size_{set|add|sub}() to manipulate it. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/3com')
-rw-r--r--drivers/net/ethernet/3com/3c59x.c6
-rw-r--r--drivers/net/ethernet/3com/typhoon.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 9ca45dcba755..b42c06baba89 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2182,12 +2182,12 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2182 cpu_to_le32(pci_map_single( 2182 cpu_to_le32(pci_map_single(
2183 VORTEX_PCI(vp), 2183 VORTEX_PCI(vp),
2184 (void *)skb_frag_address(frag), 2184 (void *)skb_frag_address(frag),
2185 frag->size, PCI_DMA_TODEVICE)); 2185 skb_frag_size(frag), PCI_DMA_TODEVICE));
2186 2186
2187 if (i == skb_shinfo(skb)->nr_frags-1) 2187 if (i == skb_shinfo(skb)->nr_frags-1)
2188 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size|LAST_FRAG); 2188 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG);
2189 else 2189 else
2190 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size); 2190 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag));
2191 } 2191 }
2192 } 2192 }
2193#else 2193#else
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 11f8858c786d..20ea07508ac7 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -810,15 +810,15 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
810 txd->frag.addrHi = 0; 810 txd->frag.addrHi = 0;
811 first_txd->numDesc++; 811 first_txd->numDesc++;
812 812
813 for(i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 813 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
814 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 814 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
815 void *frag_addr; 815 void *frag_addr;
816 816
817 txd = (struct tx_desc *) (txRing->ringBase + 817 txd = (struct tx_desc *) (txRing->ringBase +
818 txRing->lastWrite); 818 txRing->lastWrite);
819 typhoon_inc_tx_index(&txRing->lastWrite, 1); 819 typhoon_inc_tx_index(&txRing->lastWrite, 1);
820 820
821 len = frag->size; 821 len = skb_frag_size(frag);
822 frag_addr = skb_frag_address(frag); 822 frag_addr = skb_frag_address(frag);
823 skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len, 823 skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len,
824 PCI_DMA_TODEVICE); 824 PCI_DMA_TODEVICE);