sdk/userspace/fpga_libs/fpga_mgmt/fpga_hal_mbox.c
/** Test and Clear (TC) async write acknowledgement */
Test and Clear (TC) async write acknowledgement
Test and Clear ( TC ) async write acknowledgement
int 
fpga_hal_mbox_write_async_tc_ack(pci_bar_handle_t handle, bool *ack)
{
	uint32_t val;
	int ret = fpga_pci_peek(handle, FMB_REG_STATUS, &val);
	fail_on(ret != 0, err, "fpga_pci_peek(status) failed");
	if (val & FMB_TX_EVT) {
		ret = fpga_pci_poke(handle, FMB_REG_STATUS, FMB_TX_EVT);
		fail_on(ret != 0, err, "fpga_pci_poke(status) failed");
		*ack = true;
	} else {
		*ack = false;
	}
	return 0;
err:
	return -1;
}
int fpga_hal_mbox_write_async_tc_ack ( pci_bar_handle_t handle , bool * ack ) { uint32_t val ; int ret = fpga_pci_peek ( handle , FMB_REG_STATUS , & val ) ; fail_on ( ret != 0 , err , " " ) ; if ( val & FMB_TX_EVT ) { ret = fpga_pci_poke ( handle , FMB_REG_STATUS , FMB_TX_EVT ) ; fail_on ( ret != 0 , err , " " ) ; * ack = true ; } else { * ack = false ; } return 0 ; err : return -1 ; }
Test and Clear (TC) async write acknowledgement
Test and Clear ( TC ) async write acknowledgement
/** Check for TX event */ /** Acknowledge the TX event */ /** Setup the return */ /** Setup the return */