示例#1
0
文件: lpc.c 项目: fourier49/BIZ_EC
void pm1_ibf_interrupt(void)
{
	int is_cmd;
	uint8_t value, result;

	if (pm_get_status(LPC_ACPI_CMD) & EC_LPC_STATUS_FROM_HOST) {
		/* Set the busy bit */
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_PROCESSING, 1);

		/* data from command port or data port */
		is_cmd = pm_get_status(LPC_ACPI_CMD) & EC_LPC_STATUS_LAST_CMD;

		/* Get command or data */
		value = pm_get_data_in(LPC_ACPI_CMD);

		/* Handle whatever this was. */
		if (acpi_ap_to_ec(is_cmd, value, &result))
			pm_put_data_out(LPC_ACPI_CMD, result);

		/* Clear the busy bit */
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_PROCESSING, 0);

		/*
		 * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty
		 * Output Buffer Full condition on the kernel channel.
		 */
		lpc_generate_sci();
	}

	task_clear_pending_irq(IT83XX_IRQ_PMC_IN);
}
示例#2
0
文件: lpc.c 项目: fourier49/BIZ_EC
void pm3_ibf_interrupt(void)
{
	if (pm_get_status(LPC_HOST_PORT_80H) & EC_LPC_STATUS_FROM_HOST)
		port_80_write(pm_get_data_in(LPC_HOST_PORT_80H));

	task_clear_pending_irq(IT83XX_IRQ_PMC3_IN);
}
示例#3
0
文件: lpc.c 项目: fourier49/BIZ_EC
static void update_host_event_status(void)
{
	int need_sci = 0;
	int need_smi = 0;

	if (!init_done)
		return;

	/* Disable PMC1 interrupt while updating status register */
	task_disable_irq(IT83XX_IRQ_PMC_IN);

	if (host_events & event_mask[LPC_HOST_EVENT_SMI]) {
		/* Only generate SMI for first event */
		if (!(pm_get_status(LPC_ACPI_CMD) & EC_LPC_STATUS_SMI_PENDING))
			need_smi = 1;
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_SMI_PENDING, 1);
	} else {
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_SMI_PENDING, 0);
	}

	if (host_events & event_mask[LPC_HOST_EVENT_SCI]) {
		/* Generate SCI for every event */
		need_sci = 1;
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_SCI_PENDING, 1);
	} else {
		pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_SCI_PENDING, 0);
	}

	/* Copy host events to mapped memory */
	*(uint32_t *)host_get_memmap(EC_MEMMAP_HOST_EVENTS) = host_events;

	task_enable_irq(IT83XX_IRQ_PMC_IN);

	/* Process the wake events. */
	lpc_update_wake(host_events & event_mask[LPC_HOST_EVENT_WAKE]);

	/* Send pulse on SMI signal if needed */
	if (need_smi)
		lpc_generate_smi();

	/* ACPI 5.0-12.6.1: Generate SCI for SCI_EVT=1. */
	if (need_sci)
		lpc_generate_sci();
}
示例#4
0
文件: lpc.c 项目: fourier49/BIZ_EC
void pm2_ibf_interrupt(void)
{
	uint8_t value __attribute__((unused)) = 0;
	uint8_t status;

	status = pm_get_status(LPC_HOST_CMD);
	/* IBE */
	if (!(status & EC_LPC_STATUS_FROM_HOST)) {
		task_clear_pending_irq(IT83XX_IRQ_PMC2_IN);
		return;
	}

	/* IBF and data port */
	if (!(status & EC_LPC_STATUS_LAST_CMD)) {
		/* R/C IBF*/
		value = pm_get_data_in(LPC_HOST_CMD);
		task_clear_pending_irq(IT83XX_IRQ_PMC2_IN);
		return;
	}

	/* Set the busy bit */
	pm_set_status(LPC_HOST_CMD, EC_LPC_STATUS_PROCESSING, 1);

	/*
	 * Read the command byte.  This clears the FRMH bit in
	 * the status byte.
	 */
	host_cmd_args.command = pm_get_data_in(LPC_HOST_CMD);

	host_cmd_args.result = EC_RES_SUCCESS;
	if (host_cmd_args.command != EC_COMMAND_PROTOCOL_3)
		host_cmd_args.send_response = lpc_send_response;
	host_cmd_flags = lpc_host_args->flags;

	/* We only support new style command (v3) now */
	if (host_cmd_args.command == EC_COMMAND_PROTOCOL_3) {
		lpc_packet.send_response = lpc_send_response_packet;

		lpc_packet.request = (const void *)host_cmd_memmap;
		lpc_packet.request_temp = params_copy;
		lpc_packet.request_max = sizeof(params_copy);
		/* Don't know the request size so pass in the entire buffer */
		lpc_packet.request_size = EC_LPC_HOST_PACKET_SIZE;

		lpc_packet.response = (void *)host_cmd_memmap;
		lpc_packet.response_max = EC_LPC_HOST_PACKET_SIZE;
		lpc_packet.response_size = 0;

		lpc_packet.driver_result = EC_RES_SUCCESS;
		host_packet_receive(&lpc_packet);

		task_clear_pending_irq(IT83XX_IRQ_PMC2_IN);
		return;
	} else {
		/* Old style command, now unsupported */
		host_cmd_args.result = EC_RES_INVALID_COMMAND;
	}

	/* Hand off to host command handler */
	host_command_received(&host_cmd_args);

	task_clear_pending_irq(IT83XX_IRQ_PMC2_IN);
}
示例#5
0
文件: bmc.c 项目: ryanSie/Advantech
/**
 * respond to an request message from Carrier Manager/BMC.
 *
 * \param request message which has to be responded
 * \param response response message
 */
int bmc_respond(ipmbMSG_t *request, ipmbMSG_t *response)
{
	int ret = E_OK;

	/* Initialize general response message parameters */
	response->rsSA = request->rqSA;
	response->netFN = (request->netFN | 0x01);	/* response */
	response->rsLUN = request->rqLUN;
	response->rqSA = global_data.bmc_ipmb_addr;	/* BMC's IPMB address */
	response->rqSeq = request->rqSeq;
	response->rqLUN = request->rsLUN;
	response->cmd = request->cmd;
	response->orig_channel = request->dest_channel;	/* swap destination and origin channel */
	response->dest_channel = request->orig_channel;
	response->data_len = 0;

	/* first evaluate net function */
	switch (request->netFN)
	{
	/* NetFN = 0x04 (Sensor/Event) */
	case NETFN_SENSOR_EVENT_RQ:
		switch (request->cmd)
		{
		case CMD_SET_EVENT_RECEIVER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_EVENT_RECEIVER'\n");
			bmc_set_event_receiver(request, response);
			break;

		case CMD_GET_EVENT_RECEIVER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_EVENT_RECEIVER'\n");
			bmc_get_event_receiver(request, response);
			break;

		case CMD_PLATFORM_EVENT:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_PLATFORM_EVENT'\n");
			bmc_platform_event(request, response);
			break;

#ifdef CFG_PEF_ENABLE
		case CMD_GET_PEF_CAPABILITIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_PEF_CAPABILITIES'\n");
			bmc_get_pef_capabilities(request, response);
			break;

		case CMD_ARM_PEF_POSTPONE_TIMER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_ARM_PEF_POSTPONE_TIMER'\n");
			bmc_arm_pef_postpone_timer(request, response);
			break;

		case CMD_SET_PEF_CONFIGURATION:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_PEF_CONFIG'\n");
			bmc_set_pef_config(request, response);	/* see event.c */
			break;

		case CMD_GET_PEF_CONFIGURATION:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_PEF_CONFIG'\n");
			bmc_get_pef_config(request, response);	/* see event.c */
			break;

		case CMD_SET_LAST_PROCESSED_EVENT_ID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_LAST_PROCESSED_EVENT_ID'\n");
			bmc_set_last_processed_eventid(request, response);	/* see event.c */
			break;

		case CMD_GET_LAST_PROCESSED_EVENT_ID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_LAST_PROCESSED_EVENT_ID'\n");
			bmc_get_last_processed_eventid(request, response);	/* see event.c */
			break;
#endif /* CFG_PEF_ENABLE */

		case CMD_GET_DEVICE_SDR_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_DEVICE_SDR_INFO'\n");
			bmc_get_device_sdr_info(request, response);
			break;

		case CMD_GET_DEVICE_SDR:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_DEVICE_SDR'\n");
			bmc_get_sdr_entry(request, response);
			break;

		case CMD_RES_DEVICE_SDR_REPO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_RES_DEVICE_SDR_REPO'\n");
			bmc_sdr_reserve_id(request, response);
			break;
			
#if 0
		case CMD_GET_SENSOR_READING_FACTORS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_READING_FACTORS'\n");
			bmc_unknown_command(request, response);
			break;
#endif

		case CMD_SET_SENSOR_HYSTERESIS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SENSOR_HYSTERESIS'\n");
			bmc_set_sensor_hysteresis(request, response);
			break;

		case CMD_GET_SENSOR_HYSTERESIS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_HYSTERESIS'\n");
			bmc_get_sensor_hysteresis(request, response);
			break;

		case CMD_SET_SENSOR_TRESHOLD:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SENSOR_TRESHOLD'\n");
			bmc_set_sensor_threshold(request, response);
			break;

		case CMD_GET_SENSOR_TRESHOLD:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_TRESHOLD'\n");
			bmc_get_sensor_threshold(request, response);
			break;

		case CMD_SET_SENSOR_EVENT_ENABLE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SENSOR_EVENT_ENABLE'\n");
			bmc_set_sensor_event_en(request, response);
			break;

		case CMD_GET_SENSOR_EVENT_ENABLE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_EVENT_ENABLE'\n");
			bmc_get_sensor_event_en(request, response);
			break;

		case CMD_REARM_SENSOR_EVENTS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_REARM_SENSOR_EVENTS'\n");
			bmc_rearm_sensor_events(request, response);
			break;

		case CMD_GET_SENSOR_EVENT_STATUS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_EVENT_STATUS'\n");
			bmc_get_sensor_event_status(request, response);
			break;

		case CMD_GET_SENSOR_READING:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_READING'\n");
			bmc_get_sensor_reading(request, response);
			break;
			
#if 0
		case CMD_SET_SENSOR_TYPE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SENSOR_TYPE'\n");
			bmc_set_sensor_type(request, response);
			break;

		case CMD_GET_SENSOR_TYPE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SENSOR_TYPE'\n");
			bmc_get_sensor_type(request, response);
			break;
#endif

			/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

	/* NetFN = 0x05 (Sensor/Event) */
#ifdef CFG_ATCA
	case NETFN_SENSOR_EVENT_RS:
		switch (request->cmd)
		{
		case CMD_PLATFORM_EVENT:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_handle_response: 'CMD_PLATFORM_EVENT'\n");
			bmc_platform_event_response(request);
			break;

			/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown rsp 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			break;
		}
		break;
#endif

		/* NetFN = 0x06 (Application) */
	case NETFN_APP_RQ:
		switch (request->cmd)
		{
		case CMD_GET_DEVICE_ID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_DEVICE_ID'\n");
			bmc_get_device_id(request, response);
			break;

		case CMD_COLD_RESET:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_COLD_RESET'\n");
			bmc_cold_reset(request, response);
			break;
			
#ifndef CFG_MCMC
		case CMD_WARM_RESET:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_WARM_RESET'\n");
			bmc_warm_reset(request, response);
			break;
#endif

		case CMD_GET_SELF_TEST_RESULT:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SELF_TEST_RESULT'\n");
			bmc_get_selftest_results(request, response);
			break;

		case CMD_GET_DEVICE_GUID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_DEVICE_GUID'\n");
			bmc_get_device_guid(request, response);
			break;

		case CMD_RESET_WD_TIMER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_RESET_WD_TIMER'\n");
			bmc_reset_watchdog(request, response);
			break;

		case CMD_SET_WD_TIMER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_WD_TIMER' timer use:%d\n", (request->data[0] & 0x7));
			bmc_set_wd_timer(request, response);
			break;

		case CMD_GET_WD_TIMER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_WD_TIMER'\n");
			bmc_get_wd_timer(request, response);
			break;

		case CMD_SET_BMC_GLOBAL_ENABLES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_BMC_GLOBAL_ENABLES'\n");
			bmc_set_global_enables(request, response);
			break;

		case CMD_GET_BMC_GLOBAL_ENABLES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_BMC_GLOBAL_ENABLES'\n");
			bmc_get_global_enables(request, response);
			break;

		case CMD_CLR_MSG_FLAG:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_CLR_MSG_FLAG' %02x\n", request->data[0]);
			bmc_clr_msg_flags(request, response);
			break;

		case CMD_GET_MSG_FLAG:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_MSG_FLAG'\n");
			bmc_get_msg_flags(request, response);
			break;

		case CMD_GET_MSG:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_MSG'\n");
			bmc_get_recv_msg(request, response);
			break;

		case CMD_READ_EVENT_MSG_BUFFER:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_READ_EVENT_MSG_BUFFER'\n");
			bmc_read_event_msg_buffer(request, response);
			break;

		case CMD_GET_SYSTEM_GUID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SYSTEM_GUID'\n");
			bmc_get_device_guid(request, response);
			break;

#ifndef CFG_MCMC
		case CMD_GET_CHAN_AUTH_CAP:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_CHAN_AUTH_CAP'\n");
			bmc_get_chan_auth_cap(request, response);
			break;

		case CMD_SET_CHANNEL_ACCESS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_CHANNEL_ACCESS' %02x\n", request->data[0]);
			bmc_set_channel_access(request, response);
			break;

		case CMD_GET_CHANNEL_ACCESS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_CHANNEL_ACCESS' %02x\n", request->data[0]);
			bmc_get_channel_access(request, response);
			break;
#endif

		case CMD_GET_CH_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_CH_INFO' ch 0x%02x\n", request->data[0]);
			bmc_get_ch_info(request, response);
			break;

#ifndef CFG_MCMC
		case CMD_SET_USER_ACCESS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_USER_ACCESS' ch 0x%02x\n", (request->data[0] & 0x0F));
			bmc_set_user_access(request, response);
			break;

		case CMD_GET_USER_ACCESS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_USER_ACCESS' ch 0x%02x\n", (request->data[0] & 0x0F));
			bmc_get_user_access(request, response);
			break;

		case CMD_SET_USER_NAME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_USER_NAME'\n");
			bmc_set_user_name(request, response);
			break;

		case CMD_GET_USER_NAME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_USER_NAME'\n");
			bmc_get_user_name(request, response);
			break;

		case CMD_SET_USER_PASSWORD:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_USER_PASSWORD'\n");
			bmc_set_user_password(request, response);
			break;
#endif

		case CMD_MASTER_WRITE_READ:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_MASTER_WRITE_READ'\n");
			bmc_master_write_read(request, response);
			break;

			/* NOTE: Removed because command is optional and we do not support
			 * a valid System Interface as defined by IPMI2.0 table 22-12.
			 */
#if 0
		case CMD_GET_SYS_INT_CAP:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SYS_INT_CAP' %02x\n", request->data[0]);
			bmc_get_sys_cap(request, response);
			break;
#endif

		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

		/* NetFN = 0x0A (Storage) */
	case NETFN_STORAGE_RQ:
		switch (request->cmd)
		{
		case CMD_GET_FRU_INVENTORY_AREA_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_FRU_INVENTORY_AREA_INFO'\n");
			bmc_fru_invent_area(request, response);
			break;

		case CMD_READ_FRU_DATA:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_READ_FRU_DATA'\n");
			bmc_read_fru_data(request, response);
			break;

		case CMD_WRITE_FRU_DATA:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_WRITE_FRU_DATA'\n");
			bmc_write_fru_data(request, response);
			break;

		case CMD_GET_SDR_REPO_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SDR_REPO_INFO'\n");
			bmc_get_sdr_repo_info(request, response);
			break;

		case CMD_RES_SDR_REPO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_RES_SDR_REPO'\n");
			bmc_sdr_reserve_id(request, response);
			break;

		case CMD_GET_SDR:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SDR' ID:%02x%02x\n", request->data[3], request->data[2]);
			bmc_get_sdr_entry(request, response);
			break;

		case CMD_ADD_SDR:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_ADD_SDR'\n");
			bmc_add_sdr(request, response);
			break;

		case CMD_PART_ADD_SDR:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_PART_ADD_SDR'\n");
			bmc_part_add_sdr(request, response);
			break;
#if 0
		case CMD_DEL_SDR:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_DEL_SDR' ID:%02x%02x\n", request->data[3], request->data[2]);
			bmc_del_sdr(request, response);
			break;
#endif
		case CMD_CLR_SDR_REPO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_CLR_SDR_REPO'\n");
			bmc_clr_sdr_repo(request, response);
			break;

#ifndef CFG_MCMC
		case CMD_GET_SDR_REPO_TIME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SDR_REPO_TIME'\n");
			bmc_sel_time_get(request, response);
			break;

		case CMD_SET_SDR_REPO_TIME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SDR_REPO_TIME'\n");
			bmc_sel_time_set(request, response);
			break;
#endif	// END CFG_MCMC

#ifdef CFG_SEL_ENABLE
		case CMD_GET_SEL_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SEL_INFO'\n");
			bmc_get_sel_info(request, response);
			break;

#ifndef CFG_MCMC
		case CMD_GET_SEL_ALLOC_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SEL_ALLOC_INFO'\n");
			bmc_get_sel_alloc_info(request, response);
			break;
#endif	// END CFG_MCMC

		case CMD_RESERVE_SEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_RESERVE_SEL'\n");
			bmc_sel_reserve_id(request, response);
			break;

		case CMD_GET_SEL_ENTRY:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SEL_ENTRY' ID:%02x%02x\n", request->data[3], request->data[2]);
			bmc_get_sel_entry(request, response);
			break;

		case CMD_ADD_SEL_ENTRY:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_ADD_SEL_ENTRY'\n");
			if (xSemaphoreTake(sel_in_use, QUEUE_BLOCK_SEM) == pdTRUE)	/* wait until sel access is free */
			{
				bmc_add_sel_entry(request, response);
				xSemaphoreGive(sel_in_use);
			}
			else
			{
				/* print error message and retry... */
				debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Could not obtain semaphore for SEL.\n", __func__);
			}
			break;

		case CMD_CLR_SEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_CLR_SEL'\n");
			bmc_clr_sel(request, response);
			break;

		case CMD_GET_SEL_TIME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_SEL_TIME'\n");
			bmc_sel_time_get(request, response);
			break;

		case CMD_SET_SEL_TIME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_SEL_TIME'\n");
			bmc_sel_time_set(request, response);
			break;
#endif /* CFG_SEL_ENABLE */

			/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

#ifndef CFG_MCMC
		/* NetFN = 0x0B (Storage) */
	case NETFN_STORAGE_RS:
		switch (request->cmd)
		{
		case CMD_READ_FRU_DATA:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_response_handle : 'CMD_READ_FRU_DATA'\n");
			bmc_read_fru_data_response(request);
			break;

		case CMD_WRITE_FRU_DATA:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_response_handle : 'CMD_WRITE_FRU_DATA'\n");
			bmc_write_fru_data_response(request);
			break;

#ifdef ADV_OEM_RTC_SYNC
		case CMD_GET_SEL_TIME:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_response_handle: 'CMD_GET_SEL_TIME'\n");
			bmc_get_sel_time_response(request);
			break;
#endif
		/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown rsp 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			break;
		}
		break;
#endif	// END CFG_MCMC

		/* NetFN = 0x0C (Transport) */
	case NETFN_TRANSPORT_RQ:
		switch (request->cmd)
		{
#ifdef CFG_LAN
		case CMD_SET_LAN_CONFIG_PARAM:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_LAN_CONFIG_PARAM'\n");
			bmc_set_lan_config(request, response);
			break;

		case CMD_GET_LAN_CONFIG_PARAM:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_LAN_CONFIG_PARAM'\n");
			bmc_get_lan_config(request, response);
			break;
#endif
			/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

		/* NetFN = 0x2C (Group Extension -> PICMG) */
	case NETFN_PICMG_RQ:
		/* check for PICMG identifier */
		if ((request->data_len < 1) || (request->data[0] != PICMG_IDENTIFIER))
		{
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown identifier in NetFN Group Extension\n", __func__);
			bmc_unknown_command(request, response);
			break;
		}

		/* PICMG identifier is valid, process command */
		switch (request->cmd)
		{
		case CMD_GET_PICMG_PROPERTIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_PICMG_PROPERTIES'\n");
			bmc_get_picmg_prop(request, response);
			break;

#if defined(CFG_ATCA) || defined(CFG_MCMC)
		case CMD_GET_ADDRESS_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_ADDRESS_INFO'\n");
			bmc_get_address_info(request, response);
			break;
#endif

#ifdef CFG_CHECKPOINT
		case CMD_GET_SHELF_ADDRESS_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_response : 'CMD_GET_SHELF_ADDRESS_INFO'\n");
			bmc_get_shelf_address(request, response);
			break;
#endif

#ifndef CFG_MCMC
		case CMD_FRU_CONTROL_CAPABILITIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_FRU_CONTROL_CAPABILITIES'\n");
			bmc_fru_control_cap(request, response);
			break;

		case CMD_FRU_CONTROL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_FRU_CONTROL'\n");
			bmc_fru_control(request, response);
			break;

		case CMD_GET_FRU_LED_PROPERTIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'GET_FRU_LED_PROP'\n");
			bmc_get_fru_led_properties(request, response);
			break;

		case CMD_GET_LED_COLOR_CAPABILITIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'GET_LED_COLOR_CAP'\n");
			bmc_get_led_color_capabilities(request, response);
			break;
#endif

		case CMD_SET_FRU_LED_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'SET_FRU_LED'\n");
			bmc_set_fru_led_state(request, response);
			break;

		case CMD_GET_FRU_LED_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'GET_FRU_LED'\n");
			bmc_get_fru_led_state(request, response);
			break;

#ifdef CFG_ATCA
		case CMD_SET_IPMB_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_IPMB_STATE'\n");
			bmc_set_ipmb_state(request, response);
			break;

		case CMD_SET_FRU_ACTIVATION_POLICY:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_FRU_ACTIVATION_POLICY'\n");
			bmc_set_fru_activation_policy(request, response);
			break;

		case CMD_GET_FRU_ACTIVATION_POLICY:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_FRU_ACTIVATION_POLICY'\n");
			bmc_get_fru_activation_policy(request, response);
			break;

		case CMD_SET_FRU_ACTIVATION:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_FRU_ACTIVATION'\n");
			bmc_set_fru_activation(request, response);
			break;
#endif

		case CMD_GET_DEVICE_LOCATOR_RECORD_ID:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_DEVICE_LOCATOR_RECORD_ID'\n");
			bmc_get_device_locator_record(request, response);
			break;

#ifdef CFG_ATCA
		case CMD_SET_PORT_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'SET_PORT_STATE'\n");
			bmc_set_port_state(request, response);
			break;

		case CMD_GET_PORT_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'GET_PORT_STATE'\n");
			bmc_get_port_state(request, response);
			break;

		case CMD_COMPUTE_POWER_PROPERTIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_COMPUTE_POWER_PROPERTIES'\n");
			bmc_compute_power_properties(request, response);
			break;

		case CMD_SET_POWER_LEVEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'SET_POWER_LEVEL'\n");
			bmc_set_power_level(request, response);
			break;

		case CMD_GET_POWER_LEVEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'GET_POWER_LEVEL'\n");
			bmc_get_power_level(request, response);
			break;

		case CMD_GET_IPMB_LINK_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_IPMB_LINK_INFO'\n");
			bmc_get_ipmb_link_info(request, response);
			break;
#endif

#ifdef CFG_NCP3110
		case CMD_GET_FAN_SPEED_PROP:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_FAN_SPEED_PROP'\n");
			bmc_get_fan_speed_prop(request, response);
			break;

		case CMD_SET_FAN_LEVEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_FAN_LEVEL'\n");
			bmc_set_fan_level(request, response);
			break;

		case CMD_GET_FAN_LEVEL:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_FAN_LEVEL'\n");
			bmc_get_fan_level(request, response);
			break;
#endif

#if defined(CFG_MMC) || defined(CFG_IRTM)
		case CMD_SET_AMC_PORT_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_AMC_PORT_STATE'\n");
			bmc_set_amc_port_state(request, response);
			break;

		case CMD_GET_AMC_PORT_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_AMC_PORT_STATE'\n");
			bmc_get_amc_port_state(request, response);
			break;

		case CMD_SET_CLOCK_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_SET_CLOCK_STATE'\n");
			bmc_set_amc_clock_state(request, response);
			break;

		case CMD_GET_CLOCK_STATE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_CLOCK_STATE'\n");
			bmc_get_amc_clock_state(request, response);
			break;
#endif /* CFG_MMC || CFG_IRTM */

#ifdef CFG_EMMCPM
		case CMD_POWER_CHANNEL_CONTROL:
			debug_uart_printf(DBG_GRP_BMC, 3, "pm_respond: 'CMD_POWER_CHANNEL_CONTROL'\n");
			pm_power_chan_control(request, response);
			break;

		case CMD_GET_POWER_CHANNEL_STATUS:
			debug_uart_printf(DBG_GRP_BMC, 3, "pm_respond: 'CMD_GET_POWER_CHANNEL_STATUS'\n");
			pm_get_power_chan_status(request, response);
			break;

		case CMD_PM_RESET:
			debug_uart_printf(DBG_GRP_BMC, 3, "pm_respond: 'CMD_PM_RESET'\n");
			pm_reset(request, response);
			break;

		case CMD_GET_PM_STATUS:
			debug_uart_printf(DBG_GRP_BMC, 3, "pm_respond: 'CMD_GET_PM_STATUS'\n");
			pm_get_status(request, response);
			break;

		case CMD_PM_HEARTBEAT:
			debug_uart_printf(DBG_GRP_BMC, 3, "pm_respond: 'CMD_PM_HEARTBEAT'\n");
			pm_heartbeat(request, response);
			break;
#endif

		case CMD_GET_UPGRADE_CAPABILITIES:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_UPGRADE_CAPABILITIES'\n");
			bmc_get_upgrade_cap(request, response);
			break;

		case CMD_GET_COMPONENT_PROP:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_COMPONENT_PROP'\n");
			bmc_get_component_prop(request, response);
			break;

		case CMD_ABORT_FIRMWARE_UPGRADE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_ABORT_FIRMWARE_UPGRADE'\n");
			bmc_abort_firmware_upgrade(request, response);
			break;

		case CMD_INITIATE_UPGRADE_ACTION:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_INITIATE_UPGRADE_ACTION'\n");
			bmc_init_upgrade_action(request, response);
			break;

		case CMD_UPLOAD_FIRMWARE_BLOCK:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_UPLOAD_FIRMWARE_BLOCK'\n");
			bmc_upload_firmware_block(request, response);
			break;

		case CMD_FINISH_FIRMWARE_UPLOAD:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_FINISH_FIRMWARE_UPLOAD'\n");
			bmc_finish_firmware_upload(request, response);
			break;

		case CMD_GET_UPGRADE_STATUS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_GET_UPGRADE_STATUS'\n");
			bmc_get_upgrade_status(request, response);
			break;

		case CMD_ACTIVATE_FIRMWARE:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_ACTIVATE_FIRMWARE'\n");
			bmc_activate_firmware(request, response);
			break;

		case CMD_QUERY_SELFTEST_RESULTS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_QUERY_SELFTEST_RESULTS'\n");
			bmc_query_selftest_results(request, response);
			break;

		case CMD_QUERY_ROLLBACK_STATUS:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_QUERY_ROLLBACK_STATUS'\n");
			bmc_query_rollback_status(request, response);
			break;

		case CMD_INIT_MANUAL_ROLLBACK:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_INIT_MANUAL_ROLLBACK'\n");
			bmc_init_manual_rollback(request, response);
			break;

		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

#ifndef CFG_MCMC
		/* NetFN = 0x2D (Group Extension -> PICMG) */
	case NETFN_PICMG_RS:
		switch (request->cmd)
		{
		case CMD_GET_SHELF_ADDRESS_INFO:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_response_handle : 'CMD_GET_SHELF_ADDRESS_INFO'\n");
			bmc_get_shelf_address_response(request);
			break;

		/* Unknown command, respond with "invalid command" */
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown rsp 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			break;
		}
		break;
#endif

		/* NetFN = 0x2E (OEM / Group) */
	case NETFN_OEM_RQ:
		switch (request->cmd)
		{
		case ADV_OEM_GET_HW_REVISION:
            debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_OEM_GET_HW_REVISION'\n");
            bmc_oem_get_hw_revision(request, response);
            break;
		case ADV_OEM_WRITE_CONF:
			debug_uart_printf(DBG_GRP_BMC, 3, "bmc_respond: 'CMD_OEM_WRITE_CONFIGURATION'\n");
			bmc_oem_write_config_setting(request, response);
			break;
		default:
			debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown cmd 0x%02x netFN 0x%02x\n", __func__, request->cmd, request->netFN);
			bmc_unknown_command(request, response);
			break;
		}
		break;

		/* Unknown netFN, respond with "invalid command" */
	default:
		debug_uart_printf(DBG_GRP_BMC, 3, "ERR: %s: Unknown NetFn 0x%02x cmd %02x dest chan %02x\n", __func__, request->netFN, request->cmd, request->dest_channel);
		bmc_unknown_command(request, response);
		break;
	}
	return ret;
}