software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Send set MAC address request to MLAN
 *
 *  @param priv   A pointer to moal_private structure
 *  @param wait_option wait option
 *
 *  @return       MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING
 *                  -- success, otherwise fail
 */
@brief Send set MAC address request to MLAN
@param priv   A pointer to moal_private structure
@param wait_option wait option


@brief Send set MAC address request to MLAN @param priv A pointer to moal_private structure @param wait_option wait option
mlan_status
woal_request_set_mac_address(moal_private *priv, t_u8 wait_option)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_bss *bss = NULL;
	mlan_status status;
	ENTER();
	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_MAC_ADDR;
	memcpy(&bss->param.mac_addr, priv->current_addr,
	       sizeof(mlan_802_11_mac_addr));
	req->req_id = MLAN_IOCTL_BSS;
	req->action = MLAN_ACT_SET;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status == MLAN_STATUS_FAILURE) {
		PRINTM(MERROR,
		       "set mac address failed! status=%d, error_code=0x%x\n",
		       status, req->status_code);
	} else {
		memcpy(priv->netdev->dev_addr, priv->current_addr, ETH_ALEN);
		HEXDUMP("priv->MacAddr:", priv->current_addr, ETH_ALEN);
	}
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return status;
}
mlan_status woal_request_set_mac_address ( moal_private * priv , t_u8 wait_option ) { mlan_ioctl_req * req = NULL ; mlan_ds_bss * bss = NULL ; mlan_status status ; ENTER ( ) ; 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_MAC_ADDR ; memcpy ( & bss -> param . mac_addr , priv -> current_addr , sizeof ( mlan_802_11_mac_addr ) ) ; req -> req_id = MLAN_IOCTL_BSS ; req -> action = MLAN_ACT_SET ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status == MLAN_STATUS_FAILURE ) { PRINTM ( MERROR , " \n " , status , req -> status_code ) ; } else { memcpy ( priv -> netdev -> dev_addr , priv -> current_addr , ETH_ALEN ) ; HEXDUMP ( " " , priv -> current_addr , ETH_ALEN ) ; } done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return status ; }
@brief Send set MAC address request to MLAN
  @param priv   A pointer to moal_private structure
  @param wait_option wait option
@brief Send set MAC address request to MLAN @param priv A pointer to moal_private structure @param wait_option wait option
/* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* Send IOCTL request to MLAN */