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

Commit 1e7e5a0d authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by Kalle Valo
Browse files

wil6210: fix for probe_resp IE's



Parameters for the start_ap and change_bcon contains
probe response template and probe response IE's.

supplicant puts in the proberesp_ies only WPS related IE's,
while firmware need all IE's, most notable is RSN that is not
included in the proberesp_ies.

Always use IE's provided by the bcon->probe_resp

Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent bb6c8dcc
Loading
Loading
Loading
Loading
+21 −10
Original line number Original line Diff line number Diff line
@@ -669,11 +669,6 @@ static int wil_fix_bcon(struct wil6210_priv *wil,
	if (bcon->probe_resp_len <= hlen)
	if (bcon->probe_resp_len <= hlen)
		return 0;
		return 0;


	if (!bcon->proberesp_ies) {
		bcon->proberesp_ies = f->u.probe_resp.variable;
		bcon->proberesp_ies_len = bcon->probe_resp_len - hlen;
		rc = 1;
	}
	if (!bcon->assocresp_ies) {
	if (!bcon->assocresp_ies) {
		bcon->assocresp_ies = f->u.probe_resp.variable;
		bcon->assocresp_ies = f->u.probe_resp.variable;
		bcon->assocresp_ies_len = bcon->probe_resp_len - hlen;
		bcon->assocresp_ies_len = bcon->probe_resp_len - hlen;
@@ -688,9 +683,19 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
				      struct cfg80211_beacon_data *bcon)
				      struct cfg80211_beacon_data *bcon)
{
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct ieee80211_mgmt *f = (struct ieee80211_mgmt *)bcon->probe_resp;
	size_t hlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
	const u8 *pr_ies = NULL;
	size_t pr_ies_len = 0;
	int rc;
	int rc;


	wil_dbg_misc(wil, "%s()\n", __func__);
	wil_dbg_misc(wil, "%s()\n", __func__);
	wil_print_bcon_data(bcon);

	if (bcon->probe_resp_len > hlen) {
		pr_ies = f->u.probe_resp.variable;
		pr_ies_len = bcon->probe_resp_len - hlen;
	}


	if (wil_fix_bcon(wil, bcon)) {
	if (wil_fix_bcon(wil, bcon)) {
		wil_dbg_misc(wil, "Fixed bcon\n");
		wil_dbg_misc(wil, "Fixed bcon\n");
@@ -703,9 +708,7 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
	 * wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
	 * wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
	 * bcon->beacon_ies);
	 * bcon->beacon_ies);
	 */
	 */
	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_RESP,
	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, pr_ies_len, pr_ies);
			bcon->proberesp_ies_len,
			bcon->proberesp_ies);
	if (rc) {
	if (rc) {
		wil_err(wil, "set_ie(PROBE_RESP) failed\n");
		wil_err(wil, "set_ie(PROBE_RESP) failed\n");
		return rc;
		return rc;
@@ -733,6 +736,10 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	struct cfg80211_beacon_data *bcon = &info->beacon;
	struct cfg80211_beacon_data *bcon = &info->beacon;
	struct cfg80211_crypto_settings *crypto = &info->crypto;
	struct cfg80211_crypto_settings *crypto = &info->crypto;
	u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
	u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
	struct ieee80211_mgmt *f = (struct ieee80211_mgmt *)bcon->probe_resp;
	size_t hlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
	const u8 *pr_ies = NULL;
	size_t pr_ies_len = 0;


	wil_dbg_misc(wil, "%s()\n", __func__);
	wil_dbg_misc(wil, "%s()\n", __func__);


@@ -752,6 +759,11 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	wil_print_bcon_data(bcon);
	wil_print_bcon_data(bcon);
	wil_print_crypto(wil, crypto);
	wil_print_crypto(wil, crypto);


	if (bcon->probe_resp_len > hlen) {
		pr_ies = f->u.probe_resp.variable;
		pr_ies_len = bcon->probe_resp_len - hlen;
	}

	if (wil_fix_bcon(wil, bcon)) {
	if (wil_fix_bcon(wil, bcon)) {
		wil_dbg_misc(wil, "Fixed bcon\n");
		wil_dbg_misc(wil, "Fixed bcon\n");
		wil_print_bcon_data(bcon);
		wil_print_bcon_data(bcon);
@@ -779,8 +791,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	 * wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
	 * wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
	 * bcon->beacon_ies);
	 * bcon->beacon_ies);
	 */
	 */
	wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, bcon->proberesp_ies_len,
	wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, pr_ies_len, pr_ies);
		   bcon->proberesp_ies);
	wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP, bcon->assocresp_ies_len,
	wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP, bcon->assocresp_ies_len,
		   bcon->assocresp_ies);
		   bcon->assocresp_ies);