FreeBSD/sys/dev/nxge/xgehal/xgehal-mgmt.c
/**
 * xge_hal_flick_link_led - Flick (blink) link LED.
 * @devh: HAL device handle.
 *
 * Depending on the card revision flicker the link LED by using the
 * beacon control or the adapter_control register.
 */
Flick (blink) link LED.
@devh: HAL device handle.

Depending on the card revision flicker the link LED by using the
beacon control or the adapter_control register.
Flick ( blink ) link LED . @devh : HAL device handle . Depending on the card revision flicker the link LED by using the beacon control or the adapter_control register .
void
xge_hal_flick_link_led(xge_hal_device_h devh)
{
	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 = 0;
	if ((xge_hal_device_check_id(hldev) == XGE_HAL_CARD_XENA) &&
	   (xge_hal_device_rev(hldev) <= 3)) {
	    val64 = xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                      &bar0->adapter_control);
	    val64 ^= XGE_HAL_ADAPTER_LED_ON;
	    xge_os_pio_mem_write64(hldev->pdev, hldev->regh0, val64,
	                &bar0->adapter_control);
	    return;
	}
	val64 = xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                  &bar0->beacon_control);
	val64 ^= XGE_HAL_GPIO_CTRL_GPIO_0;
	xge_os_pio_mem_write64(hldev->pdev, hldev->regh0, val64,
	               &bar0->beacon_control);
}
void xge_hal_flick_link_led ( xge_hal_device_h devh ) { 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 = 0 ; if ( ( xge_hal_device_check_id ( hldev ) == XGE_HAL_CARD_XENA ) && ( xge_hal_device_rev ( hldev ) <= 3 ) ) { val64 = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> adapter_control ) ; val64 ^= XGE_HAL_ADAPTER_LED_ON ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> adapter_control ) ; return ; } val64 = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> beacon_control ) ; val64 ^= XGE_HAL_GPIO_CTRL_GPIO_0 ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> beacon_control ) ; }
xge_hal_flick_link_led - Flick (blink) link LED.
xge_hal_flick_link_led - Flick ( blink ) link LED .
/*
	 * For Xena 3 and lower revision cards, adapter control needs to be
	 * used for making LED ON/OFF.
	 */ /*
	 * Use beacon control register to control the Link LED.
	 * Note that, in the case of Xena, beacon control register represents
	 * the gpio control register. In the case of Herc, LED handling is
	 * done by beacon control register as opposed to gpio control register
	 * in Xena.
	 */