software/drivers/sd8887/src/wlan/mlan/mlan_sta_cmdresp.c
/**
 *  @brief This function handles the command response error for TDLS operation
 *
 *  @param pmpriv       A pointer to mlan_private structure
 *  @param resp         A pointer to HostCmd_DS_COMMAND
 *  @param pioctl_buf   A pointer to mlan_ioctl_req structure
 *
 *  @return             N/A
 */
@brief This function handles the command response error for TDLS operation
@param pmpriv       A pointer to mlan_private structure
@param resp         A pointer to HostCmd_DS_COMMAND
@param pioctl_buf   A pointer to mlan_ioctl_req structure

@return             N/A
@brief This function handles the command response error for TDLS operation @param pmpriv A pointer to mlan_private structure @param resp A pointer to HostCmd_DS_COMMAND @param pioctl_buf A pointer to mlan_ioctl_req structure @return N / A
static void
wlan_process_cmdreps_error_tdls_operation(mlan_private *pmpriv,
					  HostCmd_DS_COMMAND *resp,
					  mlan_ioctl_req *pioctl_buf)
{
	mlan_adapter *pmadapter = pmpriv->adapter;
	HostCmd_DS_TDLS_OPER *ptdls_oper_data = &(resp->params.tdls_oper_data);
	sta_node *sta_ptr = MNULL;
	t_u16 reason;
	ENTER();
	ptdls_oper_data->tdls_action =
		wlan_le16_to_cpu(ptdls_oper_data->tdls_action);
	reason = wlan_le16_to_cpu(ptdls_oper_data->reason);
	sta_ptr = wlan_get_station_entry(pmpriv, ptdls_oper_data->peer_mac);
	switch (ptdls_oper_data->tdls_action) {
	case TDLS_CREATE:
		if (reason != TDLS_LINK_EXISTS && sta_ptr) {
			PRINTM(MERROR,
			       "TDLS CREATE operation: command error, reason %d\n",
			       reason);
			sta_ptr->status = TDLS_SETUP_FAILURE;
		}
		if (reason == TDLS_LINK_EXISTS && pioctl_buf)
			pioctl_buf->status_code = MLAN_STATUS_SUCCESS;
		break;
	case TDLS_CONFIG:
		PRINTM(MERROR,
		       "TDLS CONFIG operation: command error, reason %d\n",
		       reason);
		if (sta_ptr)
			sta_ptr->status = TDLS_SETUP_FAILURE;
		break;
	case TDLS_DELETE:
		wlan_restore_tdls_packets(pmpriv, ptdls_oper_data->peer_mac,
					  TDLS_TEAR_DOWN);
		if (sta_ptr) {
			if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH
			    (sta_ptr->ExtCap.ext_cap))
				wlan_tdls_config(pmpriv, MFALSE);
			if (sta_ptr->is_11n_enabled) {
				wlan_cleanup_reorder_tbl(pmpriv,
							 ptdls_oper_data->
							 peer_mac);
				wlan_11n_cleanup_txbastream_tbl(pmpriv,
								ptdls_oper_data->
								peer_mac);
			}
			if (sta_ptr->status >= TDLS_SETUP_INPROGRESS)
				wlan_delete_station_entry(pmpriv,
							  ptdls_oper_data->
							  peer_mac);
		}
		if (MTRUE == wlan_is_station_list_empty(pmpriv))
			pmadapter->tdls_status = TDLS_NOT_SETUP;
		else
			pmadapter->tdls_status = TDLS_IN_BASE_CHANNEL;
		if (reason == TDLS_LINK_NONEXISTENT) {
			if (pioctl_buf)
				pioctl_buf->status_code = MLAN_STATUS_SUCCESS;
		} else {
			PRINTM(MERROR,
			       "TDLS DELETE operation: command error, reason %d\n",
			       reason);
		}
		break;
	}
	LEAVE();
	return;
}
static void wlan_process_cmdreps_error_tdls_operation ( mlan_private * pmpriv , HostCmd_DS_COMMAND * resp , mlan_ioctl_req * pioctl_buf ) { mlan_adapter * pmadapter = pmpriv -> adapter ; HostCmd_DS_TDLS_OPER * ptdls_oper_data = & ( resp -> params . tdls_oper_data ) ; sta_node * sta_ptr = MNULL ; t_u16 reason ; ENTER ( ) ; ptdls_oper_data -> tdls_action = wlan_le16_to_cpu ( ptdls_oper_data -> tdls_action ) ; reason = wlan_le16_to_cpu ( ptdls_oper_data -> reason ) ; sta_ptr = wlan_get_station_entry ( pmpriv , ptdls_oper_data -> peer_mac ) ; switch ( ptdls_oper_data -> tdls_action ) { case TDLS_CREATE : if ( reason != TDLS_LINK_EXISTS && sta_ptr ) { PRINTM ( MERROR , " \n " , reason ) ; sta_ptr -> status = TDLS_SETUP_FAILURE ; } if ( reason == TDLS_LINK_EXISTS && pioctl_buf ) pioctl_buf -> status_code = MLAN_STATUS_SUCCESS ; break ; case TDLS_CONFIG : PRINTM ( MERROR , " \n " , reason ) ; if ( sta_ptr ) sta_ptr -> status = TDLS_SETUP_FAILURE ; break ; case TDLS_DELETE : wlan_restore_tdls_packets ( pmpriv , ptdls_oper_data -> peer_mac , TDLS_TEAR_DOWN ) ; if ( sta_ptr ) { if ( ISSUPP_EXTCAP_TDLS_CHAN_SWITCH ( sta_ptr -> ExtCap . ext_cap ) ) wlan_tdls_config ( pmpriv , MFALSE ) ; if ( sta_ptr -> is_11n_enabled ) { wlan_cleanup_reorder_tbl ( pmpriv , ptdls_oper_data -> peer_mac ) ; wlan_11n_cleanup_txbastream_tbl ( pmpriv , ptdls_oper_data -> peer_mac ) ; } if ( sta_ptr -> status >= TDLS_SETUP_INPROGRESS ) wlan_delete_station_entry ( pmpriv , ptdls_oper_data -> peer_mac ) ; } if ( MTRUE == wlan_is_station_list_empty ( pmpriv ) ) pmadapter -> tdls_status = TDLS_NOT_SETUP ; else pmadapter -> tdls_status = TDLS_IN_BASE_CHANNEL ; if ( reason == TDLS_LINK_NONEXISTENT ) { if ( pioctl_buf ) pioctl_buf -> status_code = MLAN_STATUS_SUCCESS ; } else { PRINTM ( MERROR , " \n " , reason ) ; } break ; } LEAVE ( ) ; return ; }
@brief This function handles the command response error for TDLS operation
  @param pmpriv       A pointer to mlan_private structure
  @param resp         A pointer to HostCmd_DS_COMMAND
  @param pioctl_buf   A pointer to mlan_ioctl_req structure
@brief This function handles the command response error for TDLS operation @param pmpriv A pointer to mlan_private structure @param resp A pointer to HostCmd_DS_COMMAND @param pioctl_buf A pointer to mlan_ioctl_req structure
/* TDLS create command error */ /* TDLS config command error */ /* TDLS delete command error */ /**tdls cs stop*/