Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118652
b: refs/heads/master
c: fd0fcf5
h: refs/heads/master
v: v3
  • Loading branch information
Michael Buesch authored and David S. Miller committed Nov 10, 2008
1 parent f1db444 commit 222988c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 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: 9581483444d002e0b3807d9e66f552f372a6fc5e
refs/heads/master: fd0fcf5c29dd0339c5f5d86eb2cbe9fdad5bcd73
42 changes: 35 additions & 7 deletions trunk/include/linux/ssb/ssb.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,16 @@ static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
return pci_dma_mapping_error(dev->bus->host_pci, addr);
#endif
break;
case SSB_BUSTYPE_SSB:
return dma_mapping_error(dev->dev, addr);
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
return -ENOSYS;
}

Expand All @@ -441,12 +445,16 @@ static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
return pci_map_single(dev->bus->host_pci, p, size, dir);
#endif
break;
case SSB_BUSTYPE_SSB:
return dma_map_single(dev->dev, p, size, dir);
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
return 0;
}

Expand All @@ -455,14 +463,18 @@ static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_a
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_unmap_single(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}

static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
Expand All @@ -472,15 +484,19 @@ static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}

static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
Expand All @@ -490,15 +506,19 @@ static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}

static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
Expand All @@ -509,17 +529,21 @@ static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
/* Just sync everything. That's all the PCI API can do. */
pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
offset + size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}

static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
Expand All @@ -530,17 +554,21 @@ static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
/* Just sync everything. That's all the PCI API can do. */
pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
offset + size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}


Expand Down

0 comments on commit 222988c

Please sign in to comment.