예제 #1
0
VOID AndesCmdMsgBh(unsigned long param)
{
	RTMP_ADAPTER *ad = (RTMP_ADAPTER *)param;
	struct MCU_CTRL *ctl = &ad->MCUCtrl;
	struct cmd_msg *msg = NULL;

	while ((msg = AndesDequeueCmdMsg(ctl, &ctl->rx_doneq))) {
		switch (msg->state) {
			case rx_done:
				AndesRxProcessCmdMsg(ad, msg);
				AndesFreeCmdMsg(msg);
				break;
			case rx_receive_fail:
				AndesFreeCmdMsg(msg);
				break;
			default:
				AndesFreeCmdMsg(msg);
				MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("unknow msg state(%d)\n", msg->state));
				break;
		}
	}

	while ((msg = AndesDequeueCmdMsg(ctl, &ctl->tx_doneq))) {
		switch (msg->state) {
			case tx_done:
			case tx_kickout_fail:
			case tx_timeout_fail:
				AndesFreeCmdMsg(msg);
				break;
			default:
				AndesFreeCmdMsg(msg);
				MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("unknow msg state(%d)\n", msg->state));
				break;
		}
	}

	if (OS_TEST_BIT(MCU_INIT, &ctl->flags)) {
		AndesBhSchedule(ad);
	}
}
예제 #2
0
VOID AndesCleanupCmdMsg(RTMP_ADAPTER *ad, MT_DL_LIST *list)
{
	unsigned long flags;
	struct cmd_msg *msg, *msg_tmp;
	NDIS_SPIN_LOCK *lock;
	struct MCU_CTRL *ctl = &ad->MCUCtrl;

	lock = AndesGetSpinLock(ctl, list);

	RTMP_SPIN_LOCK_IRQSAVE(lock, &flags);
	DlListForEachSafe(msg, msg_tmp, list, struct cmd_msg, list) {
		_AndesUnlinkCmdMsg(msg, list);
		AndesFreeCmdMsg(msg);
	}