Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f58cf8e authored by Sandeep Puligilla's avatar Sandeep Puligilla Committed by Akash Patel
Browse files

qcacld-3.0: SAP DFS-3 Feature support

Changes needed in protocol stack related to DFS-3 feature.

Change-Id: Iec8e4e336039f5b643b9d10ee6737203222683cf
CRs-Fixed: 964262
parent 09b5e552
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,10 @@
#define IEEE80211_CHAN_VHT40MINUS       0x00400000
#define IEEE80211_CHAN_VHT40MINUS       0x00400000
/* VHT 80 channel */
/* VHT 80 channel */
#define IEEE80211_CHAN_VHT80            0x00800000
#define IEEE80211_CHAN_VHT80            0x00800000
/* VHT 80+80 Channel */
#define IEEE80211_CHAN_VHT80P80         0x01000000
/* VHT 160 Channel */
#define IEEE80211_CHAN_VHT160           0x02000000


/* token for ``any channel'' */
/* token for ``any channel'' */
#define DFS_IEEE80211_CHAN_ANY      (-1)
#define DFS_IEEE80211_CHAN_ANY      (-1)
@@ -116,9 +120,11 @@
 */
 */
struct dfs_ieee80211_channel {
struct dfs_ieee80211_channel {
	uint32_t ic_freq;
	uint32_t ic_freq;
	uint32_t ic_freq_ext;
	uint32_t ic_flags;
	uint32_t ic_flags;
	uint8_t ic_flagext;
	uint8_t ic_flagext;
	uint8_t ic_ieee;
	uint8_t ic_ieee;
	uint8_t ic_ieee_ext;
	int8_t ic_maxregpower;
	int8_t ic_maxregpower;
	int8_t ic_maxpower;
	int8_t ic_maxpower;
	int8_t ic_minpower;
	int8_t ic_minpower;
@@ -127,6 +133,7 @@ struct dfs_ieee80211_channel {
	uint32_t ic_vhtop_ch_freq_seg1;
	uint32_t ic_vhtop_ch_freq_seg1;
	uint32_t ic_vhtop_ch_freq_seg2;
	uint32_t ic_vhtop_ch_freq_seg2;
	int ic_pri_freq_center_freq_mhz_separation;
	int ic_pri_freq_center_freq_mhz_separation;
	bool ic_80p80_both_dfs;
};
};


/**
/**
+45 −9
Original line number Original line Diff line number Diff line
@@ -7388,6 +7388,8 @@ struct dfs_ieee80211_channel *wma_dfs_configure_channel(
						struct wma_vdev_start_req
						struct wma_vdev_start_req
						*req)
						*req)
{
{
	uint8_t ext_channel;

	if (dfs_ic == NULL) {
	if (dfs_ic == NULL) {
		WMA_LOGE("%s: DFS ic is Invalid", __func__);
		WMA_LOGE("%s: DFS ic is Invalid", __func__);
		return NULL;
		return NULL;
@@ -7420,23 +7422,57 @@ struct dfs_ieee80211_channel *wma_dfs_configure_channel(
	    (dfs_ic->ic_curchan->ic_ieee <= WMA_11A_CHANNEL_END)) {
	    (dfs_ic->ic_curchan->ic_ieee <= WMA_11A_CHANNEL_END)) {
		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_5GHZ;
		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_5GHZ;
	}
	}
	if (CH_WIDTH_80MHZ == req->chan_width) {

		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_VHT80;
	switch (req->chan_width) {
	}
	case CH_WIDTH_20MHZ:
	if (CH_WIDTH_40MHZ == req->chan_width) {
		dfs_ic->ic_curchan->ic_flags |=
				(req->vht_capable ? IEEE80211_CHAN_VHT20 :
							IEEE80211_CHAN_HT20);
		break;
	case CH_WIDTH_40MHZ:
		if (req->chan < req->ch_center_freq_seg0)
		if (req->chan < req->ch_center_freq_seg0)
			dfs_ic->ic_curchan->ic_flags |= (req->vht_capable ?
			dfs_ic->ic_curchan->ic_flags |=
					(req->vht_capable ?
					IEEE80211_CHAN_VHT40PLUS :
					IEEE80211_CHAN_VHT40PLUS :
					IEEE80211_CHAN_HT40PLUS);
					IEEE80211_CHAN_HT40PLUS);
		else
		else
			dfs_ic->ic_curchan->ic_flags |= (req->vht_capable ?
			dfs_ic->ic_curchan->ic_flags |=
					(req->vht_capable ?
					IEEE80211_CHAN_VHT40MINUS :
					IEEE80211_CHAN_VHT40MINUS :
					IEEE80211_CHAN_HT40MINUS);
					IEEE80211_CHAN_HT40MINUS);
	} else if (CH_WIDTH_20MHZ == req->chan_width) {
		break;
	case CH_WIDTH_80MHZ:
		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_VHT80;
		break;
	case CH_WIDTH_80P80MHZ:
		ext_channel = cds_freq_to_chan(chan->band_center_freq2);
		dfs_ic->ic_curchan->ic_flags |=
		dfs_ic->ic_curchan->ic_flags |=
			(req->vht_capable ? IEEE80211_CHAN_VHT20 :
					IEEE80211_CHAN_VHT80P80;
						IEEE80211_CHAN_HT20);
		dfs_ic->ic_curchan->ic_freq_ext =
						chan->band_center_freq2;
		dfs_ic->ic_curchan->ic_ieee_ext = ext_channel;

		/* verify both the 80MHz are DFS bands or not */
		if ((CHANNEL_STATE_DFS ==
			cds_get_bonded_channel_state(req->chan ,
						CH_WIDTH_80MHZ)) &&
			(CHANNEL_STATE_DFS ==
				cds_get_bonded_channel_state(
					ext_channel - 6 ,
					CH_WIDTH_80MHZ)))
			dfs_ic->ic_curchan->ic_80p80_both_dfs = true;
		break;
	case CH_WIDTH_160MHZ:
		dfs_ic->ic_curchan->ic_flags |=
					IEEE80211_CHAN_VHT160;
		break;
	default:
		WMA_LOGE(
		    "%s: Recieved a wrong channel width %d",
		    __func__, req->chan_width);
		break;
	}
	}

	dfs_ic->ic_curchan->ic_flagext |= IEEE80211_CHAN_DFS;
	dfs_ic->ic_curchan->ic_flagext |= IEEE80211_CHAN_DFS;


	if (req->oper_mode == BSS_OPERATIONAL_MODE_AP) {
	if (req->oper_mode == BSS_OPERATIONAL_MODE_AP) {