software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Send bss_start command to MLAN
 *
 *  @param priv          A pointer to moal_private structure
 *  @param wait_option          Wait option
 *  @param ssid_bssid    A point to mlan_ssid_bssid structure
 *
 *  @return              MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise fail
 */
@brief Send bss_start command to MLAN
@param priv          A pointer to moal_private structure
@param wait_option          Wait option
@param ssid_bssid    A point to mlan_ssid_bssid structure


@brief Send bss_start command to MLAN @param priv A pointer to moal_private structure @param wait_option Wait option @param ssid_bssid A point to mlan_ssid_bssid structure
mlan_status
woal_bss_start(moal_private *priv, t_u8 wait_option,
	       mlan_ssid_bssid *ssid_bssid)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_bss *bss = NULL;
	mlan_status status;
	mlan_ssid_bssid temp_ssid_bssid;
	ENTER();
	woal_stop_queue(priv->netdev);
	if (priv->media_connected == MFALSE) {
		if (netif_carrier_ok(priv->netdev))
			netif_carrier_off(priv->netdev);
	}
	if (!ssid_bssid) {
		LEAVE();
		return MLAN_STATUS_FAILURE;
	}
	memcpy(&temp_ssid_bssid, ssid_bssid, sizeof(mlan_ssid_bssid));
	if (MLAN_STATUS_SUCCESS ==
	    woal_find_best_network(priv, wait_option, &temp_ssid_bssid))
		woal_check_mc_connection(priv, wait_option,
					 temp_ssid_bssid.channel);
	req = (mlan_ioctl_req *)woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
	if (req == NULL) {
		status = MLAN_STATUS_FAILURE;
		goto done;
	}
	bss = (mlan_ds_bss *)req->pbuf;
	bss->sub_command = MLAN_OID_BSS_START;
	if (ssid_bssid)
		memcpy(&bss->param.ssid_bssid, ssid_bssid,
		       sizeof(mlan_ssid_bssid));
	req->req_id = MLAN_IOCTL_BSS;
	req->action = MLAN_ACT_SET;
	status = woal_request_ioctl(priv, req, wait_option);
	if (ssid_bssid)
		memcpy(ssid_bssid, &bss->param.ssid_bssid,
		       sizeof(mlan_ssid_bssid));
#ifdef STA_CFG80211
#ifdef STA_SUPPORT
	priv->assoc_status = req->status_code;
#endif
#endif
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return status;
}
mlan_status woal_bss_start ( moal_private * priv , t_u8 wait_option , mlan_ssid_bssid * ssid_bssid ) { mlan_ioctl_req * req = NULL ; mlan_ds_bss * bss = NULL ; mlan_status status ; mlan_ssid_bssid temp_ssid_bssid ; ENTER ( ) ; woal_stop_queue ( priv -> netdev ) ; if ( priv -> media_connected == MFALSE ) { if ( netif_carrier_ok ( priv -> netdev ) ) netif_carrier_off ( priv -> netdev ) ; } if ( ! ssid_bssid ) { LEAVE ( ) ; return MLAN_STATUS_FAILURE ; } memcpy ( & temp_ssid_bssid , ssid_bssid , sizeof ( mlan_ssid_bssid ) ) ; if ( MLAN_STATUS_SUCCESS == woal_find_best_network ( priv , wait_option , & temp_ssid_bssid ) ) woal_check_mc_connection ( priv , wait_option , temp_ssid_bssid . channel ) ; req = ( mlan_ioctl_req * ) woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_bss ) ) ; if ( req == NULL ) { status = MLAN_STATUS_FAILURE ; goto done ; } bss = ( mlan_ds_bss * ) req -> pbuf ; bss -> sub_command = MLAN_OID_BSS_START ; if ( ssid_bssid ) memcpy ( & bss -> param . ssid_bssid , ssid_bssid , sizeof ( mlan_ssid_bssid ) ) ; req -> req_id = MLAN_IOCTL_BSS ; req -> action = MLAN_ACT_SET ; status = woal_request_ioctl ( priv , req , wait_option ) ; if ( ssid_bssid ) memcpy ( ssid_bssid , & bss -> param . ssid_bssid , sizeof ( mlan_ssid_bssid ) ) ; #ifdef STA_CFG80211 #ifdef STA_SUPPORT priv -> assoc_status = req -> status_code ; #endif #endif done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return status ; }
@brief Send bss_start command to MLAN
  @param priv          A pointer to moal_private structure
  @param wait_option          Wait option
  @param ssid_bssid    A point to mlan_ssid_bssid structure
@brief Send bss_start command to MLAN @param priv A pointer to moal_private structure @param wait_option Wait option @param ssid_bssid A point to mlan_ssid_bssid structure
/* Stop the O.S. TX queue When we are roaming */ /* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* Send IOCTL request to MLAN */