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

Commit c6419eca authored by Chandrasekaran, Manishekar's avatar Chandrasekaran, Manishekar Committed by Akash Patel
Browse files

qcacld-3.0: Accommodate channel bandwidth as input during channel switch

Add support to include channel bandwidth as one of the inputs to
decide the channel switch parameters. Currently only the target channel
is used as the input to decide the channel switch parameters. With this
fix, user specified channel bandwidth is also taken into consideration.

Change-Id: Ic49b24edde6cabc52aa2b38110763da82da6790d
CRs-Fixed: 955368
parent 28c9b2ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1545,7 +1545,7 @@ const char *hdd_get_fwpath(void);
void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind);
hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
						uint32_t sme_session_id);

phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width);
uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
			uint8_t bw_offset);

+4 −1
Original line number Diff line number Diff line
@@ -11115,6 +11115,7 @@ static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
	uint8_t channel;
	uint16_t freq;
	int ret;
	phy_ch_width ch_width;

	hddLog(LOG1, FL("Set Freq %d"),
		  csa_params->chandef.chan->center_freq);
@@ -11132,7 +11133,9 @@ static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
	freq = csa_params->chandef.chan->center_freq;
	channel = cds_freq_to_chan(freq);

	ret = hdd_softap_set_channel_change(dev, channel);
	ch_width = hdd_map_nl_chan_width(csa_params->chandef.width);

	ret = hdd_softap_set_channel_change(dev, channel, ch_width);
	return ret;
}

+12 −6
Original line number Diff line number Diff line
@@ -1701,7 +1701,8 @@ CDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
		  FL("Channel change indication from peer for channel %d"),
				pSapEvent->sapevt.sap_chan_cng_ind.new_chan);
		if (hdd_softap_set_channel_change(dev,
			 pSapEvent->sapevt.sap_chan_cng_ind.new_chan))
			 pSapEvent->sapevt.sap_chan_cng_ind.new_chan,
			 CH_WIDTH_MAX))
			return CDF_STATUS_E_FAILURE;
		else
			return CDF_STATUS_SUCCESS;
@@ -1893,10 +1894,13 @@ int hdd_softap_unpack_ie(tHalHandle halHandle,
 *
 * @dev: pointer to the net device.
 * @target_channel: target channel number.
 * @target_bw: Target bandwidth to move.
 * If no bandwidth is specified, the value is CH_WIDTH_MAX
 *
 * Return: 0 for success, non zero for failure
 */
int hdd_softap_set_channel_change(struct net_device *dev, int target_channel)
int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
				 phy_ch_width target_bw)
{
	CDF_STATUS status;
	int ret = 0;
@@ -1960,12 +1964,13 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel)
		p_cds_context,
#endif
		(uint32_t)
		target_channel);
		target_channel,
		target_bw);

	if (CDF_STATUS_SUCCESS != status) {
		hddLog(LOGE,
		       FL("SAP set channel failed for channel = %d"),
		       target_channel);
		       FL("SAP set channel failed for channel = %d, bw:%d"),
		       target_channel, target_bw);
		/*
		 * If channel change command fails then clear the
		 * radar found flag and also restart the netif
@@ -2287,7 +2292,8 @@ static __iw_softap_setparam(struct net_device *dev,
			hddLog(LOG1,
			       "SET Channel Change to new channel= %d",
			       set_value);
			ret = hdd_softap_set_channel_change(dev, set_value);
			ret = hdd_softap_set_channel_change(dev, set_value,
								CH_WIDTH_MAX);
		} else {
			hddLog(LOGE,
			       FL("Channel Change Failed, Device in test mode"));
+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -58,7 +58,8 @@ eCsrAuthType
hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4]);

int hdd_softap_set_channel_change(struct net_device *dev,
					  int target_channel);
				int target_channel,
				phy_ch_width target_bw);

eCsrEncryptionType
hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]);
+33 −0
Original line number Diff line number Diff line
@@ -349,6 +349,39 @@ static int con_mode;
/* Variable to hold connection mode including module parameter con_mode */
static int curr_con_mode;

/**
 * hdd_map_nl_chan_width() - Map NL channel width to internal representation
 * @ch_width: NL channel width
 *
 * Converts the NL channel width to the driver's internal representation
 *
 * Return: Converted channel width. In case of non matching NL channel width,
 * CH_WIDTH_MAX will be returned.
 */
phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width)
{
	switch (ch_width) {
	case NL80211_CHAN_WIDTH_20_NOHT:
	case NL80211_CHAN_WIDTH_20:
		return CH_WIDTH_20MHZ;
	case NL80211_CHAN_WIDTH_40:
		return CH_WIDTH_40MHZ;
		break;
	case NL80211_CHAN_WIDTH_80:
		return CH_WIDTH_80MHZ;
	case NL80211_CHAN_WIDTH_80P80:
		return CH_WIDTH_80P80MHZ;
	case NL80211_CHAN_WIDTH_160:
		return CH_WIDTH_160MHZ;
	case NL80211_CHAN_WIDTH_5:
	case NL80211_CHAN_WIDTH_10:
	default:
		hdd_err("Invalid channel width %d, setting to default",
				ch_width);
		return CH_WIDTH_MAX;
	}
}

/* wlan_hdd_find_opclass() - Find operating class for a channel
 * @hal: handler to HAL
 * @channel: channel id
Loading