core.c
/*
 * @brief Creates control message response for Get Endpoint ID.
 * See DSP0236 1.3.0 12.4.
 */
@brief Creates control message response for Get Endpoint ID.
@brief Creates control message response for Get Endpoint ID .
int mctp_ctrl_cmd_get_endpoint_id(struct mctp *mctp, mctp_eid_t dest_eid,
				  bool bus_owner,
				  struct mctp_ctrl_resp_get_eid *response)
{
	struct mctp_bus *bus = find_bus_for_eid(mctp, dest_eid);
	if (response == NULL)
		return -1;
	response->eid = mctp_bus_get_eid(bus);
	response->eid_type = 0;
	if (mctp->route_policy == ROUTE_BRIDGE || bus_owner)
		SET_ENDPOINT_TYPE(response->eid_type, MCTP_BUS_OWNER_BRIDGE);
	if (bus->has_static_eid)
		SET_ENDPOINT_ID_TYPE(response->eid_type, MCTP_STATIC_EID);
	response->medium_data = mctp_binding_get_medium_info(bus->binding);
	response->completion_code = MCTP_CTRL_CC_SUCCESS;
	return 0;
}
int mctp_ctrl_cmd_get_endpoint_id ( struct mctp * mctp , mctp_eid_t dest_eid , bool bus_owner , struct mctp_ctrl_resp_get_eid * response ) { struct mctp_bus * bus = find_bus_for_eid ( mctp , dest_eid ) ; if ( response == NULL ) return -1 ; response -> eid = mctp_bus_get_eid ( bus ) ; response -> eid_type = 0 ; if ( mctp -> route_policy == ROUTE_BRIDGE || bus_owner ) SET_ENDPOINT_TYPE ( response -> eid_type , MCTP_BUS_OWNER_BRIDGE ) ; if ( bus -> has_static_eid ) SET_ENDPOINT_ID_TYPE ( response -> eid_type , MCTP_STATIC_EID ) ; response -> medium_data = mctp_binding_get_medium_info ( bus -> binding ) ; response -> completion_code = MCTP_CTRL_CC_SUCCESS ; return 0 ; }
@brief Creates control message response for Get Endpoint ID.
@brief Creates control message response for Get Endpoint ID .