FreeBSD/sys/dev/nxge/xgehal/xgehal-mgmt.c
/**
 * xge_hal_setpause_data -  set/reset pause frame generation.
 * @devh: HAL device handle.
 * @tx: A field that indicates the pause generation capability to be
 * set on the NIC.
 * @rx: A field that indicates the pause reception capability to be
 * set on the NIC.
 *
 * It can be used to set or reset Pause frame generation or reception
 * support of the NIC.
 * Return value:
 * int, returns 0 on Success
 */
set/reset pause frame generation.
@devh: HAL device handle.
@tx: A field that indicates the pause generation capability to be
set on the NIC.
@rx: A field that indicates the pause reception capability to be
set on the NIC.

It can be used to set or reset Pause frame generation or reception
support of the NIC.
Return value:
int, returns 0 on Success
set / reset pause frame generation . @devh : HAL device handle . @tx : A field that indicates the pause generation capability to be set on the NIC . @rx : A field that indicates the pause reception capability to be set on the NIC . It can be used to set or reset Pause frame generation or reception support of the NIC . Return value : int returns 0 on Success
int xge_hal_setpause_data(xge_hal_device_h devh, int tx, int rx)
{
	xge_hal_device_t *hldev = (xge_hal_device_t*)devh;
	xge_hal_pci_bar0_t *bar0 = (xge_hal_pci_bar0_t *)hldev->bar0;
	u64 val64;
	val64 = xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                &bar0->rmac_pause_cfg);
	if (tx)
	    val64 |= XGE_HAL_RMAC_PAUSE_GEN_EN;
	else
	    val64 &= ~XGE_HAL_RMAC_PAUSE_GEN_EN;
	if (rx)
	    val64 |= XGE_HAL_RMAC_PAUSE_RCV_EN;
	else
	    val64 &= ~XGE_HAL_RMAC_PAUSE_RCV_EN;
	xge_os_pio_mem_write64(hldev->pdev, hldev->regh0,
	             val64, &bar0->rmac_pause_cfg);
	return 0;
}
int xge_hal_setpause_data ( xge_hal_device_h devh , int tx , int rx ) { xge_hal_device_t * hldev = ( xge_hal_device_t * ) devh ; xge_hal_pci_bar0_t * bar0 = ( xge_hal_pci_bar0_t * ) hldev -> bar0 ; u64 val64 ; val64 = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> rmac_pause_cfg ) ; if ( tx ) val64 |= XGE_HAL_RMAC_PAUSE_GEN_EN ; else val64 &= ~ XGE_HAL_RMAC_PAUSE_GEN_EN ; if ( rx ) val64 |= XGE_HAL_RMAC_PAUSE_RCV_EN ; else val64 &= ~ XGE_HAL_RMAC_PAUSE_RCV_EN ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> rmac_pause_cfg ) ; return 0 ; }
xge_hal_setpause_data -  set/reset pause frame generation.
xge_hal_setpause_data - set / reset pause frame generation .