From patchwork Fri May 13 15:46:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 572779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32D3FC433EF for ; Fri, 13 May 2022 15:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234100AbiEMPqd (ORCPT ); Fri, 13 May 2022 11:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234690AbiEMPqa (ORCPT ); Fri, 13 May 2022 11:46:30 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD1378906 for ; Fri, 13 May 2022 08:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=/HfO9igH16wOqQfB6JAxr0ynOq6uUAL4wR354aq33fc=; t=1652456789; x=1653666389; b=cg+0+fCKMY20CtDh/mcaRQCxIOGcValE85mdRhThVBLsHULxl6239ghDNRYIIF0gVei1JeBGWL0 r8gF/jVq37xjlMUMKs8O1+44ZgDO3UIAdvPFdlf++wqUfzIiOqR2gmNCVHzSqvTN06b0lpd475OOT OQqZqIE6A8h/C2DoteLqijrcjHpKediTwqdstpTdMU+1o4qOBnV0X1w58zkLIoPUCPOI0kPkn04QY ze8X1ITMFcDO4iaYWfiWy2aS2X8CKIfBiNwRFELaqhjLJzlyEuAkR4nKnXDCJVTwrP6CUyARfecjs aquYZQ1LczSkVEnFh8ZG8y862wpBbKjO9ewA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1npXUp-00Aeu2-Ev; Fri, 13 May 2022 17:46:27 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 1/2] mac80211: remove unused argument to ieee80211_sta_connection_lost() Date: Fri, 13 May 2022 17:46:23 +0200 Message-Id: <20220513174623.a713706d6970.I43b954414c811cfcc6bc394809b31a6bb78d6d12@changeid> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg We never use the bssid argument to ieee80211_sta_connection_lost() so we might as well just remove it. Signed-off-by: Johannes Berg --- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/main.c | 4 ++-- net/mac80211/mlme.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e58aa6fa58f2..d072f20e3c5a 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1859,7 +1859,7 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata); void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); void ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata); void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, - u8 *bssid, u8 reason, bool tx); + u8 reason, bool tx); /* IBSS code */ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 03f772c4ee42..5a385d4146b9 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -287,8 +287,8 @@ static void ieee80211_restart_work(struct work_struct *work) if (sdata->vif.csa_active) { sdata_lock(sdata); ieee80211_sta_connection_lost(sdata, - sdata->u.mgd.bssid, - WLAN_REASON_UNSPECIFIED, false); + WLAN_REASON_UNSPECIFIED, + false); sdata_unlock(sdata); } } diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 26b4863ae1ea..e2637404ccd1 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4503,7 +4503,7 @@ static void ieee80211_sta_timer(struct timer_list *t) } void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, - u8 *bssid, u8 reason, bool tx) + u8 reason, bool tx) { u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; @@ -4758,7 +4758,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) mlme_dbg(sdata, "No ack for nullfunc frame to AP %pM, disconnecting.\n", bssid); - ieee80211_sta_connection_lost(sdata, bssid, + ieee80211_sta_connection_lost(sdata, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); } @@ -4768,7 +4768,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) mlme_dbg(sdata, "Failed to send nullfunc to AP %pM after %dms, disconnecting\n", bssid, probe_wait_ms); - ieee80211_sta_connection_lost(sdata, bssid, + ieee80211_sta_connection_lost(sdata, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); } else if (ifmgd->probe_send_count < max_tries) { mlme_dbg(sdata, @@ -4785,7 +4785,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) "No probe response from AP %pM after %dms, disconnecting.\n", bssid, probe_wait_ms); - ieee80211_sta_connection_lost(sdata, bssid, + ieee80211_sta_connection_lost(sdata, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); } } @@ -4940,7 +4940,6 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; mlme_dbg(sdata, "driver requested disconnect after resume\n"); ieee80211_sta_connection_lost(sdata, - ifmgd->bssid, WLAN_REASON_UNSPECIFIED, true); sdata_unlock(sdata); @@ -4951,7 +4950,6 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_HW_RESTART; mlme_dbg(sdata, "driver requested disconnect after hardware restart\n"); ieee80211_sta_connection_lost(sdata, - ifmgd->bssid, WLAN_REASON_UNSPECIFIED, true); sdata_unlock(sdata); From patchwork Fri May 13 15:46:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 572491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06D30C433FE for ; Fri, 13 May 2022 15:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378980AbiEMPqe (ORCPT ); Fri, 13 May 2022 11:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378538AbiEMPqb (ORCPT ); Fri, 13 May 2022 11:46:31 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE2877890D for ; Fri, 13 May 2022 08:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=KVL3igQkNKBiZlNHb0ywwgObE0JV9FXtyZNUOcsrbQY=; t=1652456789; x=1653666389; b=VZpCA28youg52JobXx7Sx3ci/UIpecV2ktKJXOymbogvYYh CQoA7jUA0uTWVvBN1kQRmnyBwEk4ygFgk10c7mDgoLPh0+1N5yGBPp3dX/aDYwjQhaWhxTQpy54+F dcHipriqLOLthTjoBuh3xXbXSWjuSg2ygAv+/c/xRT08cUis/6laXc+qIFx653UJuQbUmMPqt+264 iqjop6ARu8G/m9LLGHiWSxic7/iHL+AJV5So03ZBxhxKrnxzvixNNQTq5T4IEcZcl8dFO9HO5C/6W IF5ktIqhK3hiLH9oondoxWHzLUME9mvDWjo2p7RwuFWGxLNqLIbjn0gCdswFI0+g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1npXUp-00Aeu2-Nb; Fri, 13 May 2022 17:46:27 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 2/2] mac80211: remove useless bssid copy Date: Fri, 13 May 2022 17:46:24 +0200 Message-Id: <20220513174623.0d659c04ecee.I0809095c59f04c312e6b594ccde238db34e45af6@changeid> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220513174623.a713706d6970.I43b954414c811cfcc6bc394809b31a6bb78d6d12@changeid> References: <20220513174623.a713706d6970.I43b954414c811cfcc6bc394809b31a6bb78d6d12@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg We don't need to copy this locally, we now only use the variable to print before doing other things. Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e2637404ccd1..d38d100b5aed 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4734,11 +4734,9 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL && ifmgd->associated) { - u8 bssid[ETH_ALEN]; + u8 *bssid = ifmgd->bssid; int max_tries; - memcpy(bssid, ifmgd->bssid, ETH_ALEN); - if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) max_tries = max_nullfunc_tries; else