Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193918
b: refs/heads/master
c: 5acbbd4
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and David S. Miller committed Apr 2, 2010
1 parent 93a23bf commit 47bc8f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 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: 4fd89b7af28292e190650b9b9bc4308658d81dd1
refs/heads/master: 5acbbd428db47b12f137a8a2aa96b3c0a96b744e
20 changes: 14 additions & 6 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
#include <linux/jhash.h>
#include <linux/random.h>
#include <trace/events/napi.h>
#include <linux/pci.h>

#include "net-sysfs.h"

Expand Down Expand Up @@ -1804,14 +1805,21 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{
#ifdef CONFIG_HIGHMEM
int i;
if (!(dev->features & NETIF_F_HIGHDMA)) {
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
if (PageHighMem(skb_shinfo(skb)->frags[i].page))
return 1;
}

if (dev->features & NETIF_F_HIGHDMA)
return 0;

for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
if (PageHighMem(skb_shinfo(skb)->frags[i].page))
return 1;
if (PCI_DMA_BUS_IS_PHYS) {
struct device *pdev = dev->dev.parent;

for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
dma_addr_t addr = page_to_phys(skb_shinfo(skb)->frags[i].page);
if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask)
return 1;
}
}
#endif
return 0;
}
Expand Down

0 comments on commit 47bc8f5

Please sign in to comment.