FreeBSD/sys/dev/vxge/vxge.c
/*
 * vxge_stop_locked
 * Common code for both stop and part of reset.
 * disables device, interrupts and closes vpaths handle
 */
vxge_stop_locked
Common code for both stop and part of reset.
disables device, interrupts and closes vpaths handle
vxge_stop_locked Common code for both stop and part of reset . disables device interrupts and closes vpaths handle
void
vxge_stop_locked(vxge_dev_t *vdev)
{
	u64 adapter_status = 0;
	vxge_hal_status_e status;
	vxge_hal_device_t *hldev = vdev->devh;
	ifnet_t ifp = vdev->ifp;
	VXGE_DRV_LOCK_ASSERT(vdev);
	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
		return;
	vdev->is_initialized = FALSE;
	hldev->link_state = VXGE_HAL_LINK_NONE;
	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
	if_link_state_change(ifp, LINK_STATE_DOWN);
	vxge_hal_device_intr_disable(hldev);
	status = vxge_hal_device_disable(hldev);
	if (status != VXGE_HAL_OK) {
		vxge_hal_device_status(hldev, &adapter_status);
		device_printf(vdev->ndev,
		    "adapter status: 0x%llx\n", adapter_status);
	}
	vxge_vpath_reset(vdev);
	vxge_os_mdelay(1000);
	vxge_vpath_close(vdev);
}
void vxge_stop_locked ( vxge_dev_t * vdev ) { u64 adapter_status = 0 ; vxge_hal_status_e status ; vxge_hal_device_t * hldev = vdev -> devh ; ifnet_t ifp = vdev -> ifp ; VXGE_DRV_LOCK_ASSERT ( vdev ) ; if ( ! ( ifp -> if_drv_flags & IFF_DRV_RUNNING ) ) return ; vdev -> is_initialized = FALSE ; hldev -> link_state = VXGE_HAL_LINK_NONE ; ifp -> if_drv_flags &= ~ ( IFF_DRV_RUNNING | IFF_DRV_OACTIVE ) ; if_link_state_change ( ifp , LINK_STATE_DOWN ) ; vxge_hal_device_intr_disable ( hldev ) ; status = vxge_hal_device_disable ( hldev ) ; if ( status != VXGE_HAL_OK ) { vxge_hal_device_status ( hldev , & adapter_status ) ; device_printf ( vdev -> ndev , " \n " , adapter_status ) ; } vxge_vpath_reset ( vdev ) ; vxge_os_mdelay ( 1000 ) ; vxge_vpath_close ( vdev ) ; }
vxge_stop_locked
 Common code for both stop and part of reset.
vxge_stop_locked Common code for both stop and part of reset .
/* If device is not in "Running" state, return */ /* Set appropriate flags */ /* Disable interrupts */ /* Disable HAL device */ /* reset vpaths */ /* Close Vpaths */