The pdiag_dd_dma_enable() function enables and disables a DMA operation. The actual function performed depends on the bus type and operation requested.
#include <sys/pdiagex_dds.h> int32 pdiag_dd_dma_enable( handle, daddr, operation ) pdiag_info_handle_t> handle; pdiag_addr_t daddr; uint32 operation;
Where bus type = BUS_MICRO_CHANNEL and operation is PDIAG_DMA_FLUSH
If users need to change data in the DMA address space, they first change the data in their user space and then call pdiag_dd_dma_enable() with a PDIAG_DMA_FLUSH operation. If they need to read data in the DMA address space, they first call pdiag_dd_dma_enable () with a PDIAG_DMA_FLUSH operation, and then reads the data in the user space.
This routine is required only if the user wants to read the data before doing pdiag_dd_dma_complete().
Where bus type = BUS_MICRO_CHANNEL or BUS_BID and operation is PDIAG_DMA_DISABLE
Where bus type = BUS_MICRO_CHANNEL or BUS_BID and operation is PDIAG_DMA_ENABLE
The pdiag_dd_dma_enable() function can be called from the process or the interrupt environment on a BUS_MICRO_CHANNEL system. The function can only be called from the process environment on a BUS_BID system.
Parameter | Description |
---|---|
handle | Points to pdiag_info_handle_t structure which is returned from pdiag_open (). |
daddr | Pointer to the user's physical DMA address. This is returned by pdiag_dd_dma_setup() routine. |
operation | Type of operation to perform:
PDIAG_DMA_ENABLE
|
The pdiag_dd_dma_enable function returns one of the following values:
Return Value | Description |
---|---|
DGX_OK | The operation was successful. The errno is not set. |
DGX_INVALID_HANDLE | Specified handle has been closed or was not generated by the pdiag_open() call. The errno is not set. |
DGX_BADVAL_FAIL | Specified daddr is not valid. The errno is not set. |
DGX_FAIL | Application could not transfer data between the processor and the I/O controller (IOCC) data caches. The errno is set to the d_cflush or d_bflush return code. |
The pdiag_dd_dma_setup and pdiag_dd_dma_complete subroutines.
Finds all devices that share a slot with the requested device.
#include <sys/pdiag_def.h> int32 pdiag_shared_slot (char *device_instance)
The pdiag_shared_slot subroutine finds the siblings of a device and then attempts to determine which siblings are on the same slot. Under some circumstances this function may return more devices sharing a slot than physically exist. This function will always return the device instance at the front of the list, if there are no other devices sharing the slot, the function will return a pointer to the device instance.
Parameter | Description |
---|---|
device_instance | Name of device under test. |
The pdiag_shared_slot subroutine returns one of the following values:
The pdiag_set_eeh_option and pdiag_read_slot_reset subroutines.