software/drivers/sd8887/src/wlan/mlinux/moal_cfgvendor.c
/**
 * @brief send dfs vendor event to kernel
 *
 * @param priv       A pointer to moal_private
 * @param event      dfs vendor event
 * @param chandef    a pointer to struct cfg80211_chan_def
 *
 * @return      N/A
 */
@brief send dfs vendor event to kernel
@param priv       A pointer to moal_private
@param event      dfs vendor event
@param chandef    a pointer to struct cfg80211_chan_def

@return      N/A
@brief send dfs vendor event to kernel @param priv A pointer to moal_private @param event dfs vendor event @param chandef a pointer to struct cfg80211_chan_def @return N / A
void
woal_cfg80211_dfs_vendor_event(moal_private *priv, int event,
			       struct cfg80211_chan_def *chandef)
{
	dfs_event evt;
	ENTER();
	if (!chandef) {
		LEAVE();
		return;
	}
	memset(&evt, 0, sizeof(dfs_event));
	evt.freq = chandef->chan->center_freq;
	evt.chan_width = chandef->width;
	evt.cf1 = chandef->center_freq1;
	evt.cf2 = chandef->center_freq2;
	switch (chandef->width) {
	case NL80211_CHAN_WIDTH_20_NOHT:
		evt.ht_enabled = 0;
		break;
	case NL80211_CHAN_WIDTH_20:
		evt.ht_enabled = 1;
		break;
	case NL80211_CHAN_WIDTH_40:
		evt.ht_enabled = 1;
		if (chandef->center_freq1 < chandef->chan->center_freq)
			evt.chan_offset = -1;
		else
			evt.chan_offset = 1;
		break;
	case NL80211_CHAN_WIDTH_80:
	case NL80211_CHAN_WIDTH_80P80:
	case NL80211_CHAN_WIDTH_160:
		evt.ht_enabled = 1;
		break;
	default:
		break;
	}
	woal_cfg80211_vendor_event(priv, event, (t_u8 *)&evt,
				   sizeof(dfs_event));
	LEAVE();
	return;
}
void woal_cfg80211_dfs_vendor_event ( moal_private * priv , int event , struct cfg80211_chan_def * chandef ) { dfs_event evt ; ENTER ( ) ; if ( ! chandef ) { LEAVE ( ) ; return ; } memset ( & evt , 0 , sizeof ( dfs_event ) ) ; evt . freq = chandef -> chan -> center_freq ; evt . chan_width = chandef -> width ; evt . cf1 = chandef -> center_freq1 ; evt . cf2 = chandef -> center_freq2 ; switch ( chandef -> width ) { case NL80211_CHAN_WIDTH_20_NOHT : evt . ht_enabled = 0 ; break ; case NL80211_CHAN_WIDTH_20 : evt . ht_enabled = 1 ; break ; case NL80211_CHAN_WIDTH_40 : evt . ht_enabled = 1 ; if ( chandef -> center_freq1 < chandef -> chan -> center_freq ) evt . chan_offset = -1 ; else evt . chan_offset = 1 ; break ; case NL80211_CHAN_WIDTH_80 : case NL80211_CHAN_WIDTH_80P80 : case NL80211_CHAN_WIDTH_160 : evt . ht_enabled = 1 ; break ; default : break ; } woal_cfg80211_vendor_event ( priv , event , ( t_u8 * ) & evt , sizeof ( dfs_event ) ) ; LEAVE ( ) ; return ; }
@brief send dfs vendor event to kernel
 @param priv       A pointer to moal_private
 @param event      dfs vendor event
 @param chandef    a pointer to struct cfg80211_chan_def
@brief send dfs vendor event to kernel @param priv A pointer to moal_private @param event dfs vendor event @param chandef a pointer to struct cfg80211_chan_def