software/drivers/sd8887/src/wlan/mlan/mlan_cmdevt.c
/**
 *  @brief This function handles the timeout of command sending.
 *          It will re-send the same command again.
 *
 *  @param function_context   A pointer to function_context
 *  @return                   N/A
 */
@brief This function handles the timeout of command sending.
It will re-send the same command again.

@param function_context   A pointer to function_context
@return                   N/A
@brief This function handles the timeout of command sending . It will re - send the same command again . @param function_context A pointer to function_context @return N / A
t_void
wlan_cmd_timeout_func(t_void *function_context)
{
	mlan_adapter *pmadapter = (mlan_adapter *)function_context;
	cmd_ctrl_node *pcmd_node = MNULL;
	mlan_ioctl_req *pioctl_buf = MNULL;
#ifdef DEBUG_LEVEL1
	t_u32 sec = 0, usec = 0;
#endif
	t_u8 i;
	mlan_private *pmpriv = MNULL;
	ENTER();
	pmadapter->cmd_timer_is_set = MFALSE;
	if (!pmadapter->curr_cmd) {
		if (pmadapter->ext_scan && pmadapter->ext_scan_enh &&
		    pmadapter->scan_processing) {
			PRINTM(MMSG, "Ext scan enh timeout\n");
			pmadapter->ext_scan_timeout = MTRUE;
			wlan_dump_info(pmadapter, REASON_CODE_EXT_SCAN_TIMEOUT);
			goto exit;
		}
		PRINTM(MWARN, "CurCmd Empty\n");
		goto exit;
	}
	pmadapter->num_cmd_timeout++;
	pmadapter->dbg.num_cmd_timeout++;
	pcmd_node = pmadapter->curr_cmd;
	if (pcmd_node->pioctl_buf != MNULL) {
		pioctl_buf = (mlan_ioctl_req *)pcmd_node->pioctl_buf;
		pioctl_buf->status_code = MLAN_ERROR_CMD_TIMEOUT;
	}
	pmadapter->dbg.timeout_cmd_id =
		pmadapter->dbg.last_cmd_id[pmadapter->dbg.last_cmd_index];
	pmadapter->dbg.timeout_cmd_act =
		pmadapter->dbg.last_cmd_act[pmadapter->dbg.last_cmd_index];
	PRINTM_GET_SYS_TIME(MERROR, &sec, &usec);
	PRINTM(MERROR, "Timeout cmd id (%lu.%06lu) = 0x%x, act = 0x%x\n", sec,
	       usec, pmadapter->dbg.timeout_cmd_id,
	       pmadapter->dbg.timeout_cmd_act);
	if (pcmd_node->cmdbuf) {
		t_u8 *pcmd_buf;
		pcmd_buf =
			pcmd_node->cmdbuf->pbuf +
			pcmd_node->cmdbuf->data_offset + INTF_HEADER_LEN;
		for (i = 0; i < 16; i++)
			PRINTM(MERROR, "%02x ", *pcmd_buf++);
		PRINTM(MERROR, "\n");
	}
	pmpriv = pcmd_node->priv;
	if (pmpriv)
		PRINTM(MERROR, "BSS type = %d BSS role= %d\n", pmpriv->bss_type,
		       pmpriv->bss_role);
	wlan_dump_info(pmadapter, REASON_CODE_CMD_TIMEOUT);
	if (pmadapter->hw_status == WlanHardwareStatusInitializing ||
	    pmadapter->hw_status == WlanHardwareStatusGetHwSpec)
		wlan_init_fw_complete(pmadapter);
	else {
		if (pmpriv) {
			wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP,
					MNULL);
		} else {
			wlan_recv_event(wlan_get_priv
					(pmadapter, MLAN_BSS_ROLE_ANY),
					MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
		}
	}
exit:
	LEAVE();
	return;
}
t_void wlan_cmd_timeout_func ( t_void * function_context ) { mlan_adapter * pmadapter = ( mlan_adapter * ) function_context ; cmd_ctrl_node * pcmd_node = MNULL ; mlan_ioctl_req * pioctl_buf = MNULL ; #ifdef DEBUG_LEVEL1 t_u32 sec = 0 , usec = 0 ; #endif t_u8 i ; mlan_private * pmpriv = MNULL ; ENTER ( ) ; pmadapter -> cmd_timer_is_set = MFALSE ; if ( ! pmadapter -> curr_cmd ) { if ( pmadapter -> ext_scan && pmadapter -> ext_scan_enh && pmadapter -> scan_processing ) { PRINTM ( MMSG , " \n " ) ; pmadapter -> ext_scan_timeout = MTRUE ; wlan_dump_info ( pmadapter , REASON_CODE_EXT_SCAN_TIMEOUT ) ; goto exit ; } PRINTM ( MWARN , " \n " ) ; goto exit ; } pmadapter -> num_cmd_timeout ++ ; pmadapter -> dbg . num_cmd_timeout ++ ; pcmd_node = pmadapter -> curr_cmd ; if ( pcmd_node -> pioctl_buf != MNULL ) { pioctl_buf = ( mlan_ioctl_req * ) pcmd_node -> pioctl_buf ; pioctl_buf -> status_code = MLAN_ERROR_CMD_TIMEOUT ; } pmadapter -> dbg . timeout_cmd_id = pmadapter -> dbg . last_cmd_id [ pmadapter -> dbg . last_cmd_index ] ; pmadapter -> dbg . timeout_cmd_act = pmadapter -> dbg . last_cmd_act [ pmadapter -> dbg . last_cmd_index ] ; PRINTM_GET_SYS_TIME ( MERROR , & sec , & usec ) ; PRINTM ( MERROR , " \n " , sec , usec , pmadapter -> dbg . timeout_cmd_id , pmadapter -> dbg . timeout_cmd_act ) ; if ( pcmd_node -> cmdbuf ) { t_u8 * pcmd_buf ; pcmd_buf = pcmd_node -> cmdbuf -> pbuf + pcmd_node -> cmdbuf -> data_offset + INTF_HEADER_LEN ; for ( i = 0 ; i < 16 ; i ++ ) PRINTM ( MERROR , " " , * pcmd_buf ++ ) ; PRINTM ( MERROR , " \n " ) ; } pmpriv = pcmd_node -> priv ; if ( pmpriv ) PRINTM ( MERROR , " \n " , pmpriv -> bss_type , pmpriv -> bss_role ) ; wlan_dump_info ( pmadapter , REASON_CODE_CMD_TIMEOUT ) ; if ( pmadapter -> hw_status == WlanHardwareStatusInitializing || pmadapter -> hw_status == WlanHardwareStatusGetHwSpec ) wlan_init_fw_complete ( pmadapter ) ; else { if ( pmpriv ) { wlan_recv_event ( pmpriv , MLAN_EVENT_ID_DRV_DBG_DUMP , MNULL ) ; } else { wlan_recv_event ( wlan_get_priv ( pmadapter , MLAN_BSS_ROLE_ANY ) , MLAN_EVENT_ID_DRV_DBG_DUMP , MNULL ) ; } } exit : LEAVE ( ) ; return ; }
@brief This function handles the timeout of command sending.
@brief This function handles the timeout of command sending .
/* Signal MOAL to perform extra handling for debugging */