diff options
author | Jon Mason <jon.mason@intel.com> | 2013-02-12 11:52:50 -0500 |
---|---|---|
committer | Jon Mason <jon.mason@intel.com> | 2013-09-05 14:04:09 -0400 |
commit | 282a2feeb9bfb1d1dfbad93df206b74eaf80d564 (patch) | |
tree | 9265a6308dd746606dbcb0bac330082f97780be9 /drivers/ntb/ntb_hw.c | |
parent | ac477afb0431386575ef453f50fa0052c3f0461b (diff) |
NTB: Use DMA Engine to Transmit and Receive
Allocate and use a DMA engine channel to transmit and receive data over
NTB. If none is allocated, fall back to using the CPU to transfer data.
Signed-off-by: Jon Mason <jon.mason@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'drivers/ntb/ntb_hw.c')
-rw-r--r-- | drivers/ntb/ntb_hw.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c index ab34795cf125..0345817a8355 100644 --- a/drivers/ntb/ntb_hw.c +++ b/drivers/ntb/ntb_hw.c | |||
@@ -350,6 +350,23 @@ int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val) | |||
350 | } | 350 | } |
351 | 351 | ||
352 | /** | 352 | /** |
353 | * ntb_get_mw_base() - get addr for the NTB memory window | ||
354 | * @ndev: pointer to ntb_device instance | ||
355 | * @mw: memory window number | ||
356 | * | ||
357 | * This function provides the base address of the memory window specified. | ||
358 | * | ||
359 | * RETURNS: address, or NULL on error. | ||
360 | */ | ||
361 | resource_size_t ntb_get_mw_base(struct ntb_device *ndev, unsigned int mw) | ||
362 | { | ||
363 | if (mw >= ntb_max_mw(ndev)) | ||
364 | return 0; | ||
365 | |||
366 | return pci_resource_start(ndev->pdev, MW_TO_BAR(mw)); | ||
367 | } | ||
368 | |||
369 | /** | ||
353 | * ntb_get_mw_vbase() - get virtual addr for the NTB memory window | 370 | * ntb_get_mw_vbase() - get virtual addr for the NTB memory window |
354 | * @ndev: pointer to ntb_device instance | 371 | * @ndev: pointer to ntb_device instance |
355 | * @mw: memory window number | 372 | * @mw: memory window number |