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

Commit 0edef215 authored by Dan Williams's avatar Dan Williams Committed by David S. Miller
Browse files

[PATCH] libertas: send association events on adhoc reassociation



Send association event to userspace when reassociating to the same
ad-hoc network, because it's still an association.

Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9556d212
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -213,11 +213,22 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
	    && !libertas_ssid_cmp(adapter->curbssparams.ssid,
	                          adapter->curbssparams.ssid_len,
	                          bss->ssid, bss->ssid_len)
	    && (adapter->mode == IW_MODE_ADHOC)) {
		lbs_deb_join(
		       "ADHOC_J_CMD: New ad-hoc SSID is the same as current, "
		       "not attempting to re-join");
		return -1;
	    && (adapter->mode == IW_MODE_ADHOC)
	    && (adapter->connect_status == LIBERTAS_CONNECTED)) {
		union iwreq_data wrqu;

		lbs_deb_join("ADHOC_J_CMD: New ad-hoc SSID is the same as "
		             "current, not attempting to re-join");

		/* Send the re-association event though, because the association
		 * request really was successful, even if just a null-op.
		 */
		memset(&wrqu, 0, sizeof(wrqu));
		memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid,
		       ETH_ALEN);
		wrqu.ap_addr.sa_family = ARPHRD_ETHER;
		wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
		goto out;
	}

	/* Use shortpreamble only when both creator and card supports
@@ -242,6 +253,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
				    0, CMD_OPTION_WAITFORRSP,
				    OID_802_11_SSID, assoc_req);

out:
	return ret;
}