コード例 #1
0
/**
 * opal_get_indicator_list - Build indicator list of given type
 *
 * @indicator	identification or fault indicator
 * @list	loc_code structure
 *
 * Returns :
 *	0 on success, !0 otherwise
 */
static int
opal_get_indicator_list(int indicator, struct loc_code **list)
{
	/*
	 * We treat first indicator in fault indicator list as
	 * check log indicator. Hence parse attention indicator.
	 */
	if (indicator == LED_TYPE_FAULT)
		opal_get_indices(LED_TYPE_ATTN, list);

	/* FRU fault indicators are not supported in Guiding Light mode */
	if (indicator == LED_TYPE_FAULT &&
	    operating_mode == LED_MODE_GUIDING_LIGHT)
		return 0;

	/* Get OPAL indicator list */
	opal_get_indices(indicator, list);

	/* SES indicators */
	get_ses_indices(indicator, list);

	/* Marvell HDD LEDs (indicators) */
	get_mv_indices(indicator, list);

	/*
	 * The list pointer (*list) is initially NULL.
	 * If it's not-NULL here, we found indicators.
	 */
	return !(*list);
}
コード例 #2
0
/**
 * get_rtas_indicator_list - Build indicator list of given type
 *
 * @indicator	identification or attention indicator
 * @list	loc_code structure
 *
 * Returns :
 *	0 on success, !0 otherwise
 */
static int
get_rtas_indicator_list(int indicator, struct loc_code **list)
{
	int	rc;

	/* Get RTAS indicator list */
	rc = get_rtas_indices(indicator, list);
	if (rc)
		return rc;

	/* FRU fault indicators are not supported in Guiding Light mode */
	if (indicator == LED_TYPE_FAULT &&
	    operating_mode == LED_MODE_GUIDING_LIGHT)
		return rc;

	/* SES indicators */
	get_ses_indices(indicator, list);

	return rc;
}