|
iPXE
|
DMA mappings. More...
#include <stdint.h>#include <ipxe/api.h>#include <ipxe/io.h>#include <ipxe/malloc.h>#include <ipxe/umalloc.h>#include <config/ioapi.h>#include <bits/dma.h>Go to the source code of this file.
Data Structures | |
| struct | dma_mapping |
| A DMA mapping. More... | |
| struct | dma_device |
| A DMA-capable device. More... | |
| struct | dma_operations |
| DMA operations. More... | |
Macros | |
| #define | DMAAPI_PREFIX_op __op_ |
| #define | DMAAPI_PREFIX_flat __flat_ |
| #define | DMA_TX 0x01 |
| Device will read data from host memory. More... | |
| #define | DMA_RX 0x02 |
| Device will write data to host memory. More... | |
| #define | DMA_BI ( DMA_TX | DMA_RX ) |
| Device will both read data from and write data to host memory. More... | |
| #define | DMAAPI_INLINE(_subsys, _api_func) SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) |
| Calculate static inline DMA I/O API function name. More... | |
| #define | PROVIDE_DMAAPI(_subsys, _api_func, _func) PROVIDE_SINGLE_API ( DMAAPI_PREFIX_ ## _subsys, _api_func, _func ) |
| Provide a DMA I/O API implementation. More... | |
| #define | PROVIDE_DMAAPI_INLINE(_subsys, _api_func) PROVIDE_SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) |
| Provide a static inline DMA I/O API implementation. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static __always_inline int | DMAAPI_INLINE (flat, dma_map)(struct dma_device *dma |
| Map buffer for DMA. More... | |
| static __always_inline void | DMAAPI_INLINE (flat, dma_unmap)(struct dma_mapping *map |
| Unmap buffer. More... | |
| void | dma_unmap (struct dma_mapping *map, size_t len) |
| Unmap buffer. More... | |
| void * | dma_alloc (struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align) |
| Allocate and map DMA-coherent buffer. More... | |
| void | dma_free (struct dma_mapping *map, void *addr, size_t len) |
| Unmap and free DMA-coherent buffer. More... | |
| void * | dma_umalloc (struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align) |
| Allocate and map DMA-coherent buffer from external (user) memory. More... | |
| void | dma_ufree (struct dma_mapping *map, void *addr, size_t len) |
| Unmap and free DMA-coherent buffer from external (user) memory. More... | |
| void | dma_set_mask (struct dma_device *dma, physaddr_t mask) |
| Set addressable space mask. More... | |
| physaddr_t | dma (struct dma_mapping *map, void *addr) |
| Get DMA address from virtual address. More... | |
| static __always_inline int | dma_mapped (struct dma_mapping *map) |
| Check if DMA unmapping is required. More... | |
| static __always_inline void | dma_init (struct dma_device *dma, struct dma_operations *op) |
| Initialise DMA device. More... | |
| static __always_inline void | dma_set_mask_64bit (struct dma_device *dma) |
| Set 64-bit addressable space mask. More... | |
Variables | |
| static __always_inline int struct dma_mapping * | map |
| static __always_inline int struct dma_mapping void *addr | __unused |
DMA mappings.
Definition in file dma.h.
| #define DMAAPI_INLINE | ( | _subsys, | |
| _api_func | |||
| ) | SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) |
| #define PROVIDE_DMAAPI | ( | _subsys, | |
| _api_func, | |||
| _func | |||
| ) | PROVIDE_SINGLE_API ( DMAAPI_PREFIX_ ## _subsys, _api_func, _func ) |
| #define PROVIDE_DMAAPI_INLINE | ( | _subsys, | |
| _api_func | |||
| ) | PROVIDE_SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Map buffer for DMA.
| dma | DMA device |
| map | DMA mapping to fill in |
| addr | Buffer address |
| len | Length of buffer |
| flags | Mapping flags |
| rc | Return status code |
|
inlinestatic |
Unmap buffer.
| map | DMA mapping |
| len | Used length |
| void dma_unmap | ( | struct dma_mapping * | map, |
| size_t | len | ||
| ) |
| void* dma_alloc | ( | struct dma_device * | dma, |
| struct dma_mapping * | map, | ||
| size_t | len, | ||
| size_t | align | ||
| ) |
Allocate and map DMA-coherent buffer.
| dma | DMA device |
| map | DMA mapping to fill in |
| len | Length of buffer |
| align | Physical alignment |
| addr | Buffer address, or NULL on error |
Referenced by atl_ring_alloc(), bnxt_alloc_hwrm_mem(), bnxt_alloc_rings_mem(), cgem_create_ring(), dwmac_create_ring(), gve_admin_alloc(), gve_alloc_queue(), gve_alloc_shared(), intel_create_ring(), intelxl_alloc_admin(), intelxl_alloc_ring(), pci_msix_enable(), rdc_create_ring(), realtek_create_buffer(), realtek_create_ring(), vp_alloc_vq(), xhci_context(), xhci_dcbaa_alloc(), xhci_device_open(), xhci_event_alloc(), xhci_ring_alloc(), and xhci_scratchpad_alloc().
| void dma_free | ( | struct dma_mapping * | map, |
| void * | addr, | ||
| size_t | len | ||
| ) |
Unmap and free DMA-coherent buffer.
| map | DMA mapping |
| addr | Buffer address |
| len | Length of buffer |
Referenced by atl_ring_free(), bnxt_free_hwrm_mem(), bnxt_free_rings_mem(), cgem_destroy_ring(), dwmac_destroy_ring(), gve_admin_alloc(), gve_admin_free(), gve_alloc_queue(), gve_alloc_shared(), gve_free_queue(), gve_free_shared(), intel_destroy_ring(), intelxl_alloc_ring(), intelxl_free_admin(), intelxl_free_ring(), pci_msix_disable(), pci_msix_enable(), rdc_destroy_ring(), realtek_destroy_buffer(), realtek_destroy_ring(), vp_free_vq(), xhci_context(), xhci_dcbaa_alloc(), xhci_dcbaa_free(), xhci_device_close(), xhci_device_open(), xhci_event_alloc(), xhci_event_free(), xhci_ring_alloc(), xhci_ring_free(), xhci_scratchpad_alloc(), and xhci_scratchpad_free().
| void* dma_umalloc | ( | struct dma_device * | dma, |
| struct dma_mapping * | map, | ||
| size_t | len, | ||
| size_t | align | ||
| ) |
Allocate and map DMA-coherent buffer from external (user) memory.
| dma | DMA device |
| map | DMA mapping to fill in |
| len | Length of buffer |
| align | Physical alignment |
| addr | Buffer address, or NULL on error |
Referenced by gve_alloc_qpl(), gve_alloc_queue(), and xhci_scratchpad_alloc().
| void dma_ufree | ( | struct dma_mapping * | map, |
| void * | addr, | ||
| size_t | len | ||
| ) |
Unmap and free DMA-coherent buffer from external (user) memory.
| map | DMA mapping |
| addr | Buffer address |
| len | Length of buffer |
Referenced by gve_alloc_queue(), gve_free_qpl(), gve_free_queue(), xhci_scratchpad_alloc(), and xhci_scratchpad_free().
| void dma_set_mask | ( | struct dma_device * | dma, |
| physaddr_t | mask | ||
| ) |
Set addressable space mask.
| dma | DMA device |
| mask | Addressable space mask |
Referenced by dma_set_mask_64bit().
| physaddr_t dma | ( | struct dma_mapping * | map, |
| void * | addr | ||
| ) |
Get DMA address from virtual address.
| map | DMA mapping |
| addr | Address within the mapped region |
| addr | Device-side DMA address |
Referenced by alloc_rx_iob(), atl_ring_alloc(), cgem_create_ring(), dma_init(), dma_op_alloc(), dma_op_free(), dma_op_map(), dma_op_set_mask(), dma_op_ufree(), dma_op_umalloc(), dma_op_unmap(), dma_set_mask_64bit(), dwmac_create_ring(), efipci_dma_alloc(), efipci_dma_free(), efipci_dma_map(), efipci_dma_set_mask(), efipci_dma_unmap(), gve_admin_alloc(), gve_admin_enable(), gve_alloc_qpl(), gve_alloc_queue(), gve_alloc_shared(), gve_configure(), gve_create_rx_param(), gve_create_tx_param(), gve_describe(), gve_register(), ice_admin_add_txq(), intel_create_ring(), intelxl_admin_command(), intelxl_admin_event_init(), intelxl_create_ring(), intelxl_enable_admin(), intelxlvf_admin_configure(), iob_dma(), iob_map(), iob_map_rx(), iob_map_tx(), myri10ge_net_poll(), pci_msix_enable(), rdc_create_ring(), realtek_create_buffer(), realtek_create_ring(), virtnet_enqueue_iob(), vp_find_vq(), vpm_find_vqs(), xhci_abort(), xhci_address_device_input(), xhci_command_alloc(), xhci_configure_endpoint_input(), xhci_context(), xhci_dcbaa_alloc(), xhci_device_open(), xhci_event_alloc(), xhci_event_poll(), xhci_ring_alloc(), xhci_scratchpad_alloc(), and xhci_set_tr_dequeue_pointer().
|
inlinestatic |
Check if DMA unmapping is required.
| map | DMA mapping |
| unmap | Unmapping is required |
Definition at line 441 of file dma.h.
References dma_mapping::dma, map, and NULL.
Referenced by free_iob(), net_discard(), netdev_rx(), netdev_rx_err(), netdev_tx(), and netdev_tx_err().
|
inlinestatic |
Initialise DMA device.
| dma | DMA device |
| op | DMA operations |
Definition at line 453 of file dma.h.
Referenced by efipci_info().
|
inlinestatic |
Set 64-bit addressable space mask.
| dma | DMA device |
Definition at line 466 of file dma.h.
References dma(), and dma_set_mask().
Referenced by gve_probe(), ice_probe(), intel_probe(), intelx_probe(), intelxl_probe(), intelxlvf_probe(), intelxvf_probe(), realtek_detect(), virtnet_probe_legacy(), virtnet_probe_modern(), and xhci_init().
| __always_inline int struct dma_mapping* map |
Definition at line 183 of file dma.h.
Referenced by arbel_cmd_map_fa(), arbel_cmd_map_icm(), arbel_cmd_map_icm_aux(), arbel_map_vpm(), dma_mapped(), dma_op_alloc(), dma_op_free(), dma_op_map(), dma_op_ufree(), dma_op_umalloc(), dma_op_unmap(), efi_shim_get_memory_map(), efifb_colour_map(), efifb_select_mode(), efipci_dma_alloc(), efipci_dma_free(), efipci_dma_map(), efipci_dma_unmap(), fbcon_colour(), fbcon_init(), hermon_cmd_map_fa(), hermon_cmd_map_icm(), hermon_cmd_map_icm_aux(), hermon_map_vpm(), nii_map(), nii_pci_close(), nii_unmap(), nodnic_port_allocate_dbr_dma(), rsn_get_desc(), rsn_pick_desc(), sec80211_detect_ie(), sec80211_rsn_get_net80211_crypt(), skge_rx_setup(), skge_xmit_frame(), sky2_rx_add(), and xhci_context().
| __always_inline void size_t len __unused |
1.8.15