software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Driver handling for remove customeie
 *
 *  @param pmadapter    Pointer to mlan_adapter
 *  @param pmpriv       Pointer to mlan_private
 *
 *  @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE or MLAN_STATUS_PENDING
 */
@brief Driver handling for remove customeie
@param pmadapter    Pointer to mlan_adapter
@param pmpriv       Pointer to mlan_private


@brief Driver handling for remove customeie @param pmadapter Pointer to mlan_adapter @param pmpriv Pointer to mlan_private
mlan_status
wlan_11h_remove_custom_ie(mlan_adapter *pmadapter, mlan_private *pmpriv)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	wlan_radar_det_hndlg_state_t *pstate_rdh = &pmadapter->state_rdh;
	mlan_ioctl_req *pioctl_req = MNULL;
	ENTER();
	if (pstate_rdh->stage == RDH_SET_CUSTOM_IE) {
		pstate_rdh->priv_curr_idx = RDH_STAGE_FIRST_ENTRY_PRIV_IDX;
		PRINTM(MMSG, "Removing CHAN_SW IE from interfaces.\n");
		while ((++pstate_rdh->priv_curr_idx) <
		       pstate_rdh->priv_list_count) {
			pmpriv = pstate_rdh->priv_list[pstate_rdh->
						       priv_curr_idx];
			if (!wlan_11h_is_dfs_master(pmpriv))
				continue;
			ret = wlan_11h_prepare_custom_ie_chansw(pmadapter,
								&pioctl_req,
								MFALSE);
			if ((ret != MLAN_STATUS_SUCCESS) || !pioctl_req) {
				PRINTM(MERROR,
				       "%s(): Error in preparing CHAN_SW IE.\n",
				       __func__);
				goto done;
			}
			pioctl_req->bss_index = pmpriv->bss_index;
			ret = wlan_misc_ioctl_custom_ie_list(pmadapter,
							     pioctl_req,
							     MFALSE);
			if (ret != MLAN_STATUS_SUCCESS &&
			    ret != MLAN_STATUS_PENDING) {
				PRINTM(MERROR,
				       "%s(): Could not remove IE for priv=%p [priv_bss_idx=%d]!\n",
				       __func__, pmpriv, pmpriv->bss_index);
			}
			pmadapter->callbacks.moal_mfree(pmadapter->pmoal_handle,
							(t_u8 *)pioctl_req);
		}
	}
done:
	LEAVE();
	return ret;
}
mlan_status wlan_11h_remove_custom_ie ( mlan_adapter * pmadapter , mlan_private * pmpriv ) { mlan_status ret = MLAN_STATUS_SUCCESS ; wlan_radar_det_hndlg_state_t * pstate_rdh = & pmadapter -> state_rdh ; mlan_ioctl_req * pioctl_req = MNULL ; ENTER ( ) ; if ( pstate_rdh -> stage == RDH_SET_CUSTOM_IE ) { pstate_rdh -> priv_curr_idx = RDH_STAGE_FIRST_ENTRY_PRIV_IDX ; PRINTM ( MMSG , " \n " ) ; while ( ( ++ pstate_rdh -> priv_curr_idx ) < pstate_rdh -> priv_list_count ) { pmpriv = pstate_rdh -> priv_list [ pstate_rdh -> priv_curr_idx ] ; if ( ! wlan_11h_is_dfs_master ( pmpriv ) ) continue ; ret = wlan_11h_prepare_custom_ie_chansw ( pmadapter , & pioctl_req , MFALSE ) ; if ( ( ret != MLAN_STATUS_SUCCESS ) || ! pioctl_req ) { PRINTM ( MERROR , " \n " , __func__ ) ; goto done ; } pioctl_req -> bss_index = pmpriv -> bss_index ; ret = wlan_misc_ioctl_custom_ie_list ( pmadapter , pioctl_req , MFALSE ) ; if ( ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING ) { PRINTM ( MERROR , " \n " , __func__ , pmpriv , pmpriv -> bss_index ) ; } pmadapter -> callbacks . moal_mfree ( pmadapter -> pmoal_handle , ( t_u8 * ) pioctl_req ) ; } } done : LEAVE ( ) ; return ret ; }
@brief Driver handling for remove customeie
  @param pmadapter    Pointer to mlan_adapter
  @param pmpriv       Pointer to mlan_private
@brief Driver handling for remove customeie @param pmadapter Pointer to mlan_adapter @param pmpriv Pointer to mlan_private
/* TODO: hiow to handle this error case??  ignore & continue? */ /* free ioctl buffer memory before we leave */