software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 * @brief Set region code
 *
 * @param priv     A pointer to moal_private structure
 * @param region   A pointer to region string
 *
 * @return         MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success, otherwise fail
 */
@brief Set region code
@param priv     A pointer to moal_private structure
@param region   A pointer to region string


@brief Set region code @param priv A pointer to moal_private structure @param region A pointer to region string
mlan_status
woal_set_region_code(moal_private *priv, char *region)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	mlan_ds_misc_cfg *cfg = NULL;
	mlan_ioctl_req *req = NULL;
	ENTER();
	if (woal_is_country_code_supported(region))
		return woal_set_countrycode(priv, region);
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	cfg = (mlan_ds_misc_cfg *)req->pbuf;
	cfg->sub_command = MLAN_OID_MISC_REGION;
	req->req_id = MLAN_IOCTL_MISC_CFG;
	req->action = MLAN_ACT_SET;
	cfg->param.region_code = region_string_2_region_code(region);
	ret = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
mlan_status woal_set_region_code ( moal_private * priv , char * region ) { mlan_status ret = MLAN_STATUS_SUCCESS ; mlan_ds_misc_cfg * cfg = NULL ; mlan_ioctl_req * req = NULL ; ENTER ( ) ; if ( woal_is_country_code_supported ( region ) ) return woal_set_countrycode ( priv , region ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_misc_cfg ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } cfg = ( mlan_ds_misc_cfg * ) req -> pbuf ; cfg -> sub_command = MLAN_OID_MISC_REGION ; req -> req_id = MLAN_IOCTL_MISC_CFG ; req -> action = MLAN_ACT_SET ; cfg -> param . region_code = region_string_2_region_code ( region ) ; ret = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Set region code
 @param priv     A pointer to moal_private structure
 @param region   A pointer to region string
@brief Set region code @param priv A pointer to moal_private structure @param region A pointer to region string