software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Get current channel of active interface
 *
 *  @param priv        A pointer to moal_private
 *  @param channel 	   A pointer to chan_band_info structure
 *
 *  @return            MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief Get current channel of active interface
@param priv        A pointer to moal_private
@param channel         A pointer to chan_band_info structure


@brief Get current channel of active interface @param priv A pointer to moal_private @param channel A pointer to chan_band_info structure
mlan_status
woal_get_active_intf_channel(moal_private *priv, chan_band_info * channel)
{
	moal_handle *handle = priv->phandle;
	int i;
	for (i = 0; i < handle->priv_num; i++) {
#ifdef STA_SUPPORT
		if (GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_STA) {
			if (handle->priv[i]->media_connected == MTRUE)
				return woal_get_sta_channel(handle->priv[i],
							    MOAL_IOCTL_WAIT,
							    channel);
		}
#endif
#ifdef UAP_SUPPORT
		if (GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_UAP) {
			if (handle->priv[i]->bss_started == MTRUE)
				return woal_set_get_ap_channel(handle->priv[i],
							       MLAN_ACT_GET,
							       MOAL_IOCTL_WAIT,
							       channel);
		}
#endif
	}
	return MLAN_STATUS_FAILURE;
}
mlan_status woal_get_active_intf_channel ( moal_private * priv , chan_band_info * channel ) { moal_handle * handle = priv -> phandle ; int i ; for ( i = 0 ; i < handle -> priv_num ; i ++ ) { #ifdef STA_SUPPORT if ( GET_BSS_ROLE ( handle -> priv [ i ] ) == MLAN_BSS_ROLE_STA ) { if ( handle -> priv [ i ] -> media_connected == MTRUE ) return woal_get_sta_channel ( handle -> priv [ i ] , MOAL_IOCTL_WAIT , channel ) ; } #endif #ifdef UAP_SUPPORT if ( GET_BSS_ROLE ( handle -> priv [ i ] ) == MLAN_BSS_ROLE_UAP ) { if ( handle -> priv [ i ] -> bss_started == MTRUE ) return woal_set_get_ap_channel ( handle -> priv [ i ] , MLAN_ACT_GET , MOAL_IOCTL_WAIT , channel ) ; } #endif } return MLAN_STATUS_FAILURE ; }
@brief Get current channel of active interface
  @param priv        A pointer to moal_private
  @param channel         A pointer to chan_band_info structure
@brief Get current channel of active interface @param priv A pointer to moal_private @param channel A pointer to chan_band_info structure