software/drivers/sd8887/src/wlan/mlinux/moal_uap_cfg80211.c
/**
 * @brief change BSS
 *
 * @param wiphy           A pointer to wiphy structure
 * @param dev             A pointer to net_device structure
 * @param params          A pointer to bss_parameters structure
 *
 * @return                0 -- success, otherwise fail
 */
@brief change BSS
@param wiphy           A pointer to wiphy structure
@param dev             A pointer to net_device structure
@param params          A pointer to bss_parameters structure

@return                0 -- success, otherwise fail
@brief change BSS @param wiphy A pointer to wiphy structure @param dev A pointer to net_device structure @param params A pointer to bss_parameters structure @return 0 -- success otherwise fail
int
woal_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev,
			 struct bss_parameters *params)
{
	int ret = 0;
	t_u8 change = MFALSE;
	mlan_uap_bss_param *sys_config = NULL;
	u8 bss_started = MFALSE;
	t_u8 pkt_forward_ctl;
	moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
	ENTER();
	PRINTM(MIOCTL, "isolate=%d\n", params->ap_isolate);
	sys_config = kzalloc(sizeof(mlan_uap_bss_param), GFP_ATOMIC);
	if (!sys_config) {
		PRINTM(MERROR, "Fail to alloc memory for mlan_uap_bss_param\n");
		LEAVE();
		return -EFAULT;
	}
	if (MLAN_STATUS_SUCCESS != woal_set_get_sys_config(priv,
							   MLAN_ACT_GET,
							   MOAL_IOCTL_WAIT,
							   sys_config)) {
		PRINTM(MERROR, "Error getting AP confiruration\n");
		ret = -EFAULT;
		goto done;
	}
	pkt_forward_ctl = sys_config->pkt_forward_ctl;
	if (params->ap_isolate) {
		sys_config->pkt_forward_ctl |= PKT_FWD_INTRA_BCAST;
		sys_config->pkt_forward_ctl |= PKT_FWD_INTRA_UCAST;
	} else {
		sys_config->pkt_forward_ctl &= ~PKT_FWD_INTRA_BCAST;
		sys_config->pkt_forward_ctl &= ~PKT_FWD_INTRA_UCAST;
	}
	if (pkt_forward_ctl != sys_config->pkt_forward_ctl) {
		change = MTRUE;
		PRINTM(MIOCTL, "ap_isolate=%xd\n", params->ap_isolate);
	}
	if (change) {
		if (priv->bss_started == MTRUE) {
			bss_started = MTRUE;
			woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT,
					  UAP_BSS_STOP);
		}
		if (params->use_short_preamble == 1)
			sys_config->preamble_type = 1;
		else if (params->use_short_preamble == 0)
			sys_config->preamble_type = 2;
		else
			sys_config->preamble_type = 0;
		if (MLAN_STATUS_SUCCESS == woal_set_get_sys_config(priv,
								   MLAN_ACT_SET,
								   MOAL_IOCTL_WAIT,
								   sys_config))
			ret = 0;
		if (bss_started)
			woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT,
					  UAP_BSS_START);
	}
done:
	kfree(sys_config);
	LEAVE();
	return ret;
}
int woal_cfg80211_change_bss ( struct wiphy * wiphy , struct net_device * dev , struct bss_parameters * params ) { int ret = 0 ; t_u8 change = MFALSE ; mlan_uap_bss_param * sys_config = NULL ; u8 bss_started = MFALSE ; t_u8 pkt_forward_ctl ; moal_private * priv = ( moal_private * ) woal_get_netdev_priv ( dev ) ; ENTER ( ) ; PRINTM ( MIOCTL , " \n " , params -> ap_isolate ) ; sys_config = kzalloc ( sizeof ( mlan_uap_bss_param ) , GFP_ATOMIC ) ; if ( ! sys_config ) { PRINTM ( MERROR , " \n " ) ; LEAVE ( ) ; return - EFAULT ; } if ( MLAN_STATUS_SUCCESS != woal_set_get_sys_config ( priv , MLAN_ACT_GET , MOAL_IOCTL_WAIT , sys_config ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } pkt_forward_ctl = sys_config -> pkt_forward_ctl ; if ( params -> ap_isolate ) { sys_config -> pkt_forward_ctl |= PKT_FWD_INTRA_BCAST ; sys_config -> pkt_forward_ctl |= PKT_FWD_INTRA_UCAST ; } else { sys_config -> pkt_forward_ctl &= ~ PKT_FWD_INTRA_BCAST ; sys_config -> pkt_forward_ctl &= ~ PKT_FWD_INTRA_UCAST ; } if ( pkt_forward_ctl != sys_config -> pkt_forward_ctl ) { change = MTRUE ; PRINTM ( MIOCTL , " \n " , params -> ap_isolate ) ; } if ( change ) { if ( priv -> bss_started == MTRUE ) { bss_started = MTRUE ; woal_uap_bss_ctrl ( priv , MOAL_IOCTL_WAIT_TIMEOUT , UAP_BSS_STOP ) ; } if ( params -> use_short_preamble == 1 ) sys_config -> preamble_type = 1 ; else if ( params -> use_short_preamble == 0 ) sys_config -> preamble_type = 2 ; else sys_config -> preamble_type = 0 ; if ( MLAN_STATUS_SUCCESS == woal_set_get_sys_config ( priv , MLAN_ACT_SET , MOAL_IOCTL_WAIT , sys_config ) ) ret = 0 ; if ( bss_started ) woal_uap_bss_ctrl ( priv , MOAL_IOCTL_WAIT_TIMEOUT , UAP_BSS_START ) ; } done : kfree ( sys_config ) ; LEAVE ( ) ; return ret ; }
@brief change BSS
 @param wiphy           A pointer to wiphy structure
 @param dev             A pointer to net_device structure
 @param params          A pointer to bss_parameters structure
@brief change BSS @param wiphy A pointer to wiphy structure @param dev A pointer to net_device structure @param params A pointer to bss_parameters structure
/** disable packet forwarding */