software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Get STA Channel Info
 *
 *  @param priv             A pointer to moal_private structure
 *  @param wait_option      Wait option
 *  @param channel          A pointer to channel info
 *
 *  @return                     MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise fail
 */
@brief Get STA Channel Info
@param priv             A pointer to moal_private structure
@param wait_option      Wait option
@param channel          A pointer to channel info


@brief Get STA Channel Info @param priv A pointer to moal_private structure @param wait_option Wait option @param channel A pointer to channel info
mlan_status
woal_get_sta_channel(moal_private *priv, t_u8 wait_option,
		     chan_band_info * channel)
{
	int ret = 0;
	mlan_ioctl_req *req = NULL;
	mlan_ds_bss *bss = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
	if (req == NULL) {
		PRINTM(MERROR, "woal_get_sta_channel req alloc fail\n");
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	bss = (mlan_ds_bss *)req->pbuf;
	bss->sub_command = MLAN_OID_BSS_CHAN_INFO;
	req->req_id = MLAN_IOCTL_BSS;
	req->action = MLAN_ACT_GET;
	status = woal_request_ioctl(priv, req, wait_option);
	if (status == MLAN_STATUS_SUCCESS && channel)
		memcpy(channel, &(bss->param.sta_channel), sizeof(*channel));
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return status;
}
mlan_status woal_get_sta_channel ( moal_private * priv , t_u8 wait_option , chan_band_info * channel ) { int ret = 0 ; mlan_ioctl_req * req = NULL ; mlan_ds_bss * bss = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_bss ) ) ; if ( req == NULL ) { PRINTM ( MERROR , " \n " ) ; ret = MLAN_STATUS_FAILURE ; goto done ; } bss = ( mlan_ds_bss * ) req -> pbuf ; bss -> sub_command = MLAN_OID_BSS_CHAN_INFO ; req -> req_id = MLAN_IOCTL_BSS ; req -> action = MLAN_ACT_GET ; status = woal_request_ioctl ( priv , req , wait_option ) ; if ( status == MLAN_STATUS_SUCCESS && channel ) memcpy ( channel , & ( bss -> param . sta_channel ) , sizeof ( * channel ) ) ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return status ; }
@brief Get STA Channel Info
  @param priv             A pointer to moal_private structure
  @param wait_option      Wait option
  @param channel          A pointer to channel info
@brief Get STA Channel Info @param priv A pointer to moal_private structure @param wait_option Wait option @param channel A pointer to channel info
/* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* Send IOCTL request to MLAN */