コード例 #1
0
static int modemctl_notify_call(struct notifier_block *nfb,
		unsigned long event, void *arg)
{
	struct modem_ctl *mc = container_of(nfb, struct modem_ctl, event_nfb);
	static int abnormal_rx_cnt = 0;

	mif_info("got event: %ld\n", event);

	switch (event) {
	case MDM_EVENT_CP_FORCE_RESET:
		if (mc->iod && mc->iod->modem_state_changed)
			mc->iod->modem_state_changed(mc->iod, STATE_CRASH_RESET);
		if (mc->bootd && mc->bootd->modem_state_changed)
			mc->bootd->modem_state_changed(mc->bootd, STATE_CRASH_RESET);
		break;
	case MDM_EVENT_CP_FORCE_CRASH:
		ss300_force_crash_exit(mc);
		break;
	case MDM_EVENT_CP_ABNORMAL_RX:
		if (abnormal_rx_cnt < 5) {
			abnormal_rx_cnt++;
		} else {
			mif_err("abnormal rx count was overflowed.\n");
			abnormal_rx_cnt = 0;
#ifdef DEBUG_MODEM_IF
			ss300_force_crash_exit(mc);
#endif
		}
		break;
	}

	return 0;
}
コード例 #2
0
static int modemctl_notify_call(struct notifier_block *nfb,
		unsigned long event, void *arg)
{
	struct modem_ctl *mc = container_of(nfb, struct modem_ctl, event_nfb);
	static int abnormal_rx_cnt = 0;

	mif_info("got event: %ld\n", event);
	mc->crash_info = event;

	switch (event) {
	case MDM_EVENT_CP_FORCE_RESET:
		if (mc->iod && mc->iod->modem_state_changed)
			mc->iod->modem_state_changed(mc->iod, STATE_CRASH_RESET);
		if (mc->bootd && mc->bootd->modem_state_changed)
			mc->bootd->modem_state_changed(mc->bootd, STATE_CRASH_RESET);
		break;
	case MDM_CRASH_PM_FAIL:
	case MDM_CRASH_PM_CP_FAIL:
	case MDM_CRASH_INVALID_RB:
	case MDD_CRASH_INVALID_IOD:
	case MDM_CRASH_INVALID_SKBCB:
	case MDM_CRASH_INVALID_SKBIOD:
	case MDM_CRASH_NO_MEM:
	case MDM_CRASH_CMD_RESET:
	case MDM_CRASH_CMD_EXIT:
	case MDM_EVENT_CP_FORCE_CRASH:
		ss300_force_crash_exit(mc);
		break;
	case MDM_EVENT_CP_ABNORMAL_RX:
		if (abnormal_rx_cnt < 5) {
			abnormal_rx_cnt++;
		} else {
			mif_err("abnormal rx count was overflowed.\n");
			abnormal_rx_cnt = 0;
		}
		break;
	}

	return 0;
}