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

Commit 44ca509c authored by Nachiket Kukade's avatar Nachiket Kukade Committed by Kalle Valo
Browse files

mwifiex: fix bandwidth display problem



Instead of using HT info from beacon IEs, use HT info from
association response frame to update bandwidth in
cfg80211_get_channel handler.

Signed-off-by: default avatarNachiket Kukade <kukaden@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 48dc5fb3
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3793,8 +3793,8 @@ static int mwifiex_cfg80211_get_channel(struct wiphy *wiphy,
		freq = ieee80211_channel_to_frequency(curr_bss->channel, band);
		freq = ieee80211_channel_to_frequency(curr_bss->channel, band);
		chan = ieee80211_get_channel(wiphy, freq);
		chan = ieee80211_get_channel(wiphy, freq);


		if (curr_bss->bcn_ht_oper) {
		if (priv->ht_param_present) {
			second_chan_offset = curr_bss->bcn_ht_oper->ht_param &
			second_chan_offset = priv->assoc_resp_ht_param &
					IEEE80211_HT_PARAM_CHA_SEC_OFFSET;
					IEEE80211_HT_PARAM_CHA_SEC_OFFSET;
			chan_type = mwifiex_sec_chan_offset_to_chan_type
			chan_type = mwifiex_sec_chan_offset_to_chan_type
							(second_chan_offset);
							(second_chan_offset);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1063,7 +1063,7 @@ struct ieee_types_assoc_rsp {
	__le16 cap_info_bitmap;
	__le16 cap_info_bitmap;
	__le16 status_code;
	__le16 status_code;
	__le16 a_id;
	__le16 a_id;
	u8 ie_buffer[1];
	u8 ie_buffer[0];
} __packed;
} __packed;


struct host_cmd_ds_802_11_associate_rsp {
struct host_cmd_ds_802_11_associate_rsp {
+15 −0
Original line number Original line Diff line number Diff line
@@ -644,6 +644,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
	struct mwifiex_bssdescriptor *bss_desc;
	struct mwifiex_bssdescriptor *bss_desc;
	bool enable_data = true;
	bool enable_data = true;
	u16 cap_info, status_code, aid;
	u16 cap_info, status_code, aid;
	const u8 *ie_ptr;
	struct ieee80211_ht_operation *assoc_resp_ht_oper;


	assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params;
	assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params;


@@ -733,6 +735,19 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
			= ((bss_desc->wmm_ie.qos_info_bitmap &
			= ((bss_desc->wmm_ie.qos_info_bitmap &
				IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) ? 1 : 0);
				IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) ? 1 : 0);


	/* Store the bandwidth information from assoc response */
	ie_ptr = cfg80211_find_ie(WLAN_EID_HT_OPERATION, assoc_rsp->ie_buffer,
				  priv->assoc_rsp_size
				  - sizeof(struct ieee_types_assoc_rsp));
	if (ie_ptr) {
		assoc_resp_ht_oper = (struct ieee80211_ht_operation *)(ie_ptr
					+ sizeof(struct ieee_types_header));
		priv->assoc_resp_ht_param = assoc_resp_ht_oper->ht_param;
		priv->ht_param_present = true;
	} else {
		priv->ht_param_present = false;
	}

	mwifiex_dbg(priv->adapter, INFO,
	mwifiex_dbg(priv->adapter, INFO,
		    "info: ASSOC_RESP: curr_pkt_filter is %#x\n",
		    "info: ASSOC_RESP: curr_pkt_filter is %#x\n",
		    priv->curr_pkt_filter);
		    priv->curr_pkt_filter);
+2 −0
Original line number Original line Diff line number Diff line
@@ -674,6 +674,8 @@ struct mwifiex_private {
	struct mwifiex_ds_mem_rw mem_rw;
	struct mwifiex_ds_mem_rw mem_rw;
	struct sk_buff_head bypass_txq;
	struct sk_buff_head bypass_txq;
	struct mwifiex_user_scan_chan hidden_chan[MWIFIEX_USER_SCAN_CHAN_MAX];
	struct mwifiex_user_scan_chan hidden_chan[MWIFIEX_USER_SCAN_CHAN_MAX];
	u8 assoc_resp_ht_param;
	bool ht_param_present;
};
};




+3 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,9 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
	priv->is_data_rate_auto = true;
	priv->is_data_rate_auto = true;
	priv->data_rate = 0;
	priv->data_rate = 0;


	priv->assoc_resp_ht_param = 0;
	priv->ht_param_present = false;

	if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA ||
	if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA ||
	     GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) && priv->hist_data)
	     GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) && priv->hist_data)
		mwifiex_hist_data_reset(priv);
		mwifiex_hist_data_reset(priv);