software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Get channel list
 *
 *  @param priv            A pointer to moal_private structure
 *  @param wait_option     Wait option
 *  @param chan_list       A pointer to mlan_chan_list structure
 *
 *  @return                MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise fail
 */
@brief Get channel list
@param priv            A pointer to moal_private structure
@param wait_option     Wait option
@param chan_list       A pointer to mlan_chan_list structure


@brief Get channel list @param priv A pointer to moal_private structure @param wait_option Wait option @param chan_list A pointer to mlan_chan_list structure
mlan_status
woal_get_channel_list(moal_private *priv, t_u8 wait_option,
		      mlan_chan_list *chan_list)
{
	int ret = 0;
	mlan_ds_bss *bss = NULL;
	mlan_ioctl_req *req = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	bss = (mlan_ds_bss *)req->pbuf;
	bss->sub_command = MLAN_OID_BSS_CHANNEL_LIST;
	req->req_id = MLAN_IOCTL_BSS;
	req->action = MLAN_ACT_GET;
	status = woal_request_ioctl(priv, req, wait_option);
	if (status == MLAN_STATUS_SUCCESS) {
		if (chan_list) {
			memcpy(chan_list, &bss->param.chanlist,
			       sizeof(mlan_chan_list));
		}
	}
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return status;
}
mlan_status woal_get_channel_list ( moal_private * priv , t_u8 wait_option , mlan_chan_list * chan_list ) { int ret = 0 ; mlan_ds_bss * bss = NULL ; mlan_ioctl_req * req = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_bss ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } bss = ( mlan_ds_bss * ) req -> pbuf ; bss -> sub_command = MLAN_OID_BSS_CHANNEL_LIST ; req -> req_id = MLAN_IOCTL_BSS ; req -> action = MLAN_ACT_GET ; status = woal_request_ioctl ( priv , req , wait_option ) ; if ( status == MLAN_STATUS_SUCCESS ) { if ( chan_list ) { memcpy ( chan_list , & bss -> param . chanlist , sizeof ( mlan_chan_list ) ) ; } } done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return status ; }
@brief Get channel list
  @param priv            A pointer to moal_private structure
  @param wait_option     Wait option
  @param chan_list       A pointer to mlan_chan_list structure
@brief Get channel list @param priv A pointer to moal_private structure @param wait_option Wait option @param chan_list A pointer to mlan_chan_list structure
/* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* Send IOCTL request to MLAN */