FreeBSD/sys/dev/nxge/xgehal/xgehal-device.c
/*
 * __hal_device_led_actifity_fix
 * @hldev: pointer to xge_hal_device_t structure
 *
 * SXE-002: Configure link and activity LED to turn it off
 */


SXE-002: Configure link and activity LED to turn it off
SXE - 002 : Configure link and activity LED to turn it off
static void
__hal_device_led_actifity_fix(xge_hal_device_t *hldev)
{
	xge_hal_pci_bar0_t *bar0 = (xge_hal_pci_bar0_t *)(void *)hldev->bar0;
	u16 subid;
	u64 val64;
	xge_os_pci_read16(hldev->pdev, hldev->cfgh,
	    xge_offsetof(xge_hal_pci_config_le_t, subsystem_id), &subid);
	if ((subid & 0xFF) >= 0x07) {
	    val64 = xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                                &bar0->beacon_control);
	    val64 |= 0x0000800000000000ULL;
	    xge_os_pio_mem_write64(hldev->pdev, hldev->regh0,
	                 val64, &bar0->beacon_control);
	    val64 = 0x0411040400000000ULL;
	    xge_os_pio_mem_write64(hldev->pdev, hldev->regh0, val64,
	                (void *) ((u8 *)bar0 + 0x2700));
	}
}
static void __hal_device_led_actifity_fix ( xge_hal_device_t * hldev ) { xge_hal_pci_bar0_t * bar0 = ( xge_hal_pci_bar0_t * ) ( void * ) hldev -> bar0 ; u16 subid ; u64 val64 ; xge_os_pci_read16 ( hldev -> pdev , hldev -> cfgh , xge_offsetof ( xge_hal_pci_config_le_t , subsystem_id ) , & subid ) ; if ( ( subid & 0xFF ) >= 0x07 ) { val64 = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> beacon_control ) ; val64 |= 0x0000800000000000ULL ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> beacon_control ) ; val64 = 0x0411040400000000ULL ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , ( void * ) ( ( u8 * ) bar0 + 0x2700 ) ) ; } }
__hal_device_led_actifity_fix
 @hldev: pointer to xge_hal_device_t structure
__hal_device_led_actifity_fix @hldev : pointer to xge_hal_device_t structure
/*
	 *  In the case of Herc, there is a new register named beacon control
	 *  is added which was not present in Xena.
	 *  Beacon control register in Herc is at the same offset as
	 *  gpio control register in Xena.  It means they are one and same in
	 *  the case of Xena. Also, gpio control register offset in Herc and
	 *  Xena is different.
	 *  The current register map represents Herc(It means we have
	 *  both beacon  and gpio control registers in register map).
	 *  WRT transition from Xena to Herc, all the code in Xena which was
	 *  using  gpio control register for LED handling would  have to
	 *  use beacon control register in Herc and the rest of the code
	 *  which uses gpio control in Xena  would use the same register
	 *  in Herc.
	 *  WRT LED handling(following code), In the case of Herc, beacon
	 *  control register has to be used. This is applicable for Xena also,
	 *  since it represents the gpio control register in Xena.
	 */