FreeBSD/sys/dev/nxge/xgehal/xgehal-device.c
/**
 * xge_hal_device_is_slot_freeze
 * @devh: the device
 *
 * Returns non-zero if the slot is freezed.
 * The determination is made based on the adapter_status
 * register which will never give all FFs, unless PCI read
 * cannot go through.
 */
xge_hal_device_is_slot_freeze
@devh: the device

Returns non-zero if the slot is freezed.
The determination is made based on the adapter_status
register which will never give all FFs, unless PCI read
cannot go through.
xge_hal_device_is_slot_freeze @devh : the device Returns non - zero if the slot is freezed . The determination is made based on the adapter_status register which will never give all FFs unless PCI read cannot go through .
int
xge_hal_device_is_slot_freeze(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 *)(void *)hldev->bar0;
	u16 device_id;
	u64 adapter_status =
	    xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                  &bar0->adapter_status);
	xge_os_pci_read16(hldev->pdev,hldev->cfgh,
	        xge_offsetof(xge_hal_pci_config_le_t, device_id),
	        &device_id);
#ifdef TX_DEBUG
	if (adapter_status == XGE_HAL_ALL_FOXES)
	{
	    u64 dummy;
	    dummy = xge_os_pio_mem_read64(hldev->pdev, hldev->regh0,
	                    &bar0->pcc_enable);
	    printf(">>> Slot is frozen!\n");
	    brkpoint(0);
	}
#endif
	return((adapter_status == XGE_HAL_ALL_FOXES) || (device_id == 0xffff));
}
int xge_hal_device_is_slot_freeze ( 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 * ) ( void * ) hldev -> bar0 ; u16 device_id ; u64 adapter_status = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> adapter_status ) ; xge_os_pci_read16 ( hldev -> pdev , hldev -> cfgh , xge_offsetof ( xge_hal_pci_config_le_t , device_id ) , & device_id ) ; #ifdef TX_DEBUG if ( adapter_status == XGE_HAL_ALL_FOXES ) { u64 dummy ; dummy = xge_os_pio_mem_read64 ( hldev -> pdev , hldev -> regh0 , & bar0 -> pcc_enable ) ; printf ( " \n " ) ; brkpoint ( 0 ) ; } #endif return ( ( adapter_status == XGE_HAL_ALL_FOXES ) || ( device_id == 0xffff ) ) ; }
xge_hal_device_is_slot_freeze
 @devh: the device
xge_hal_device_is_slot_freeze @devh : the device