FreeBSD/sys/dev/nxge/xgehal/xgehal-mgmt.c
/**
 * __hal_chk_xpak_counter -  check the Xpak error count and log the msg.
 * @hldev: pointer to xge_hal_device_t structure
 * @type:  xpak stats error type
 * @value: xpak stats value
 *
 * It is used to log the error message based on the xpak stats value
 * Return value:
 * None
 */
check the Xpak error count and log the msg.
@hldev: pointer to xge_hal_device_t structure
@type:  xpak stats error type
@value: xpak stats value

It is used to log the error message based on the xpak stats value
Return value:
None
check the Xpak error count and log the msg . @hldev : pointer to xge_hal_device_t structure @type : xpak stats error type @value : xpak stats value It is used to log the error message based on the xpak stats value Return value : None
void __hal_chk_xpak_counter(xge_hal_device_t *hldev, int type, u32 value)
{
	if(value == 3)
	{
	    switch(type)
	    {
	    case 1:
	        hldev->stats.sw_dev_err_stats.xpak_counter.
	            excess_temp = 0;
	        if (g_xge_hal_driver->uld_callbacks.xpak_alarm_log) {
	            g_xge_hal_driver->uld_callbacks.xpak_alarm_log(
	                hldev->upper_layer_info,
	                XGE_HAL_XPAK_ALARM_EXCESS_TEMP);
	        }
	        break;
	    case 2:
	        hldev->stats.sw_dev_err_stats.xpak_counter.
	            excess_bias_current = 0;
	        if (g_xge_hal_driver->uld_callbacks.xpak_alarm_log) {
	            g_xge_hal_driver->uld_callbacks.xpak_alarm_log(
	                hldev->upper_layer_info,
	                XGE_HAL_XPAK_ALARM_EXCESS_BIAS_CURRENT);
	        }
	        break;
	    case 3:
	        hldev->stats.sw_dev_err_stats.xpak_counter.
	            excess_laser_output = 0;
	        if (g_xge_hal_driver->uld_callbacks.xpak_alarm_log) {
	            g_xge_hal_driver->uld_callbacks.xpak_alarm_log(
	                hldev->upper_layer_info,
	                XGE_HAL_XPAK_ALARM_EXCESS_LASER_OUTPUT);
	        }
	        break;
	    default:
	        xge_debug_osdep(XGE_TRACE, "Incorrect XPAK Alarm "
	        "type ");
	    }
	}
}
void __hal_chk_xpak_counter ( xge_hal_device_t * hldev , int type , u32 value ) { if ( value == 3 ) { switch ( type ) { case 1 : hldev -> stats . sw_dev_err_stats . xpak_counter . excess_temp = 0 ; if ( g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ) { g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ( hldev -> upper_layer_info , XGE_HAL_XPAK_ALARM_EXCESS_TEMP ) ; } break ; case 2 : hldev -> stats . sw_dev_err_stats . xpak_counter . excess_bias_current = 0 ; if ( g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ) { g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ( hldev -> upper_layer_info , XGE_HAL_XPAK_ALARM_EXCESS_BIAS_CURRENT ) ; } break ; case 3 : hldev -> stats . sw_dev_err_stats . xpak_counter . excess_laser_output = 0 ; if ( g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ) { g_xge_hal_driver -> uld_callbacks . xpak_alarm_log ( hldev -> upper_layer_info , XGE_HAL_XPAK_ALARM_EXCESS_LASER_OUTPUT ) ; } break ; default : xge_debug_osdep ( XGE_TRACE , " " " " ) ; } } }
__hal_chk_xpak_counter -  check the Xpak error count and log the msg.
__hal_chk_xpak_counter - check the Xpak error count and log the msg .
/*
	 * If the value is high for three consecutive cylce,
	 * log a error message
	 */ /*
	         * Notify the ULD on Excess Xpak temperature alarm msg
	         */ /*
	         * Notify the ULD on Excess  xpak bias current alarm msg
	         */ /*
	         * Notify the ULD on Excess Xpak Laser o/p power
	         * alarm msg
	         */