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

Commit 78279500 authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar
Browse files

wil6210: notify cfg80211_new_sta upon connection before init tx ring



In AP mode upon client connection, sometimes Rx data packet
(e.g EAPOL) arrives before driver notify cfg80211_new_sta to kernel.
This causes the Rx packet to get lost.
To fix this, as part of connect event handling,
call cfg80211_new_sta() earlier, before initializing Tx ring.

Change-Id: Ife5fd7a5c79da4c0dd094c2b9cbc3785a165331d
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
parent 3081488d
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -1069,6 +1069,24 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
			mutex_unlock(&wil->mutex);
			return;
		}

		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
		if (!sinfo) {
			wmi_disconnect_sta(vif, wil->sta[evt->cid].addr,
					   WLAN_REASON_UNSPECIFIED, false);
			rc = -ENOMEM;
			goto out;
		}

		sinfo->generation = wil->sinfo_gen++;

		if (assoc_req_ie) {
			sinfo->assoc_req_ies = assoc_req_ie;
			sinfo->assoc_req_ies_len = assoc_req_ielen;
		}

		cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL);
		kfree(sinfo);
	}

	ether_addr_copy(wil->sta[evt->cid].addr, evt->bssid);
@@ -1111,28 +1129,10 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
		   (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {

		if (rc) {
			if (disable_ap_sme)
			/* notify new_sta has failed */
			cfg80211_del_sta(ndev, evt->bssid, GFP_KERNEL);
			goto out;
		}

		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
		if (!sinfo) {
			rc = -ENOMEM;
			goto out;
		}

		sinfo->generation = wil->sinfo_gen++;

		if (assoc_req_ie) {
			sinfo->assoc_req_ies = assoc_req_ie;
			sinfo->assoc_req_ies_len = assoc_req_ielen;
		}

		cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL);

		kfree(sinfo);
	} else {
		wil_err(wil, "unhandled iftype %d for CID %d\n", wdev->iftype,
			evt->cid);