FreeBSD/sys/dev/ixl/ixl_pf_main.c
/*
** Caller must init and delete sbuf; this function will clear and
** finish it for caller.
**
** XXX: Cannot use the SEID for this, since there is no longer a 
** fixed mapping between SEID and element type.
*/
Caller must init and delete sbuf; this function will clear and
finish it for caller.

Cannot use the SEID for this, since there is no longer a
fixed mapping between SEID and element type.
Caller must init and delete sbuf ; this function will clear and finish it for caller . Cannot use the SEID for this since there is no longer a fixed mapping between SEID and element type .
char *
ixl_switch_element_string(struct sbuf *s,
    struct i40e_aqc_switch_config_element_resp *element)
{
	sbuf_clear(s);
	switch (element->element_type) {
	case I40E_AQ_SW_ELEM_TYPE_MAC:
		sbuf_printf(s, "MAC %3d", element->element_info);
		break;
	case I40E_AQ_SW_ELEM_TYPE_PF:
		sbuf_printf(s, "PF  %3d", element->element_info);
		break;
	case I40E_AQ_SW_ELEM_TYPE_VF:
		sbuf_printf(s, "VF  %3d", element->element_info);
		break;
	case I40E_AQ_SW_ELEM_TYPE_EMP:
		sbuf_cat(s, "EMP");
		break;
	case I40E_AQ_SW_ELEM_TYPE_BMC:
		sbuf_cat(s, "BMC");
		break;
	case I40E_AQ_SW_ELEM_TYPE_PV:
		sbuf_cat(s, "PV");
		break;
	case I40E_AQ_SW_ELEM_TYPE_VEB:
		sbuf_cat(s, "VEB");
		break;
	case I40E_AQ_SW_ELEM_TYPE_PA:
		sbuf_cat(s, "PA");
		break;
	case I40E_AQ_SW_ELEM_TYPE_VSI:
		sbuf_printf(s, "VSI %3d", element->element_info);
		break;
	default:
		sbuf_cat(s, "?");
		break;
	}
	sbuf_finish(s);
	return sbuf_data(s);
}
char * ixl_switch_element_string ( struct sbuf * s , struct i40e_aqc_switch_config_element_resp * element ) { sbuf_clear ( s ) ; switch ( element -> element_type ) { case I40E_AQ_SW_ELEM_TYPE_MAC : sbuf_printf ( s , " " , element -> element_info ) ; break ; case I40E_AQ_SW_ELEM_TYPE_PF : sbuf_printf ( s , " " , element -> element_info ) ; break ; case I40E_AQ_SW_ELEM_TYPE_VF : sbuf_printf ( s , " " , element -> element_info ) ; break ; case I40E_AQ_SW_ELEM_TYPE_EMP : sbuf_cat ( s , " " ) ; break ; case I40E_AQ_SW_ELEM_TYPE_BMC : sbuf_cat ( s , " " ) ; break ; case I40E_AQ_SW_ELEM_TYPE_PV : sbuf_cat ( s , " " ) ; break ; case I40E_AQ_SW_ELEM_TYPE_VEB : sbuf_cat ( s , " " ) ; break ; case I40E_AQ_SW_ELEM_TYPE_PA : sbuf_cat ( s , " " ) ; break ; case I40E_AQ_SW_ELEM_TYPE_VSI : sbuf_printf ( s , " " , element -> element_info ) ; break ; default : sbuf_cat ( s , " " ) ; break ; } sbuf_finish ( s ) ; return sbuf_data ( s ) ; }
Caller must init and delete sbuf; this function will clear and
finish it for caller.
Caller must init and delete sbuf ; this function will clear and finish it for caller .