aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/adaptec
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/adaptec
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/adaptec')
-rw-r--r--drivers/net/ethernet/adaptec/starfire.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index d6b015598569..6d9f6911000f 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -1256,12 +1256,12 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
1256 np->tx_info[entry].mapping = 1256 np->tx_info[entry].mapping =
1257 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE); 1257 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE);
1258 } else { 1258 } else {
1259 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1]; 1259 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1];
1260 status |= this_frag->size; 1260 status |= skb_frag_size(this_frag);
1261 np->tx_info[entry].mapping = 1261 np->tx_info[entry].mapping =
1262 pci_map_single(np->pci_dev, 1262 pci_map_single(np->pci_dev,
1263 skb_frag_address(this_frag), 1263 skb_frag_address(this_frag),
1264 this_frag->size, 1264 skb_frag_size(this_frag),
1265 PCI_DMA_TODEVICE); 1265 PCI_DMA_TODEVICE);
1266 } 1266 }
1267 1267
@@ -1378,7 +1378,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
1378 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1378 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1379 pci_unmap_single(np->pci_dev, 1379 pci_unmap_single(np->pci_dev,
1380 np->tx_info[entry].mapping, 1380 np->tx_info[entry].mapping,
1381 skb_shinfo(skb)->frags[i].size, 1381 skb_frag_size(&skb_shinfo(skb)->frags[i]),
1382 PCI_DMA_TODEVICE); 1382 PCI_DMA_TODEVICE);
1383 np->dirty_tx++; 1383 np->dirty_tx++;
1384 entry++; 1384 entry++;