From patchwork Sat Mar 31 07:05:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 10318863 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F9E360212 for ; Sat, 31 Mar 2018 07:08:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4002A2A066 for ; Sat, 31 Mar 2018 07:08:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3504F2A06C; Sat, 31 Mar 2018 07:08:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B27002A066 for ; Sat, 31 Mar 2018 07:08:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbeCaHIi (ORCPT ); Sat, 31 Mar 2018 03:08:38 -0400 Received: from smtprelay0151.hostedemail.com ([216.40.44.151]:52168 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752448AbeCaHFp (ORCPT ); Sat, 31 Mar 2018 03:05:45 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 71EAE181D3417; Sat, 31 Mar 2018 07:05:44 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: title91_894687fff7343 X-Filterd-Recvd-Size: 7267 Received: from joe-laptop.perches.com (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sat, 31 Mar 2018 07:05:43 +0000 (UTC) From: Joe Perches To: Johannes Berg Cc: "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/12] net: mac80211: Use global ether_broadcast_addr Date: Sat, 31 Mar 2018 00:05:18 -0700 Message-Id: X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove statics and use the new global ether_broadcast_addr instead to save some overall object code size. Signed-off-by: Joe Perches --- net/mac80211/iface.c | 5 +---- net/mac80211/key.c | 6 ++---- net/mac80211/mesh_hwmp.c | 19 ++++++++++--------- net/mac80211/mesh_pathtbl.c | 8 ++++---- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index d13ba064951f..f203efc3c532 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1387,9 +1387,6 @@ static void ieee80211_recalc_smps_work(struct work_struct *work) static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, enum nl80211_iftype type) { - static const u8 bssid_wildcard[ETH_ALEN] = {0xff, 0xff, 0xff, - 0xff, 0xff, 0xff}; - /* clear type-dependent union */ memset(&sdata->u, 0, sizeof(sdata->u)); @@ -1442,7 +1439,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, ieee80211_sta_setup_sdata(sdata); break; case NL80211_IFTYPE_OCB: - sdata->vif.bss_conf.bssid = bssid_wildcard; + sdata->vif.bss_conf.bssid = ether_broadcast_addr; ieee80211_ocb_setup_sdata(sdata); break; case NL80211_IFTYPE_ADHOC: diff --git a/net/mac80211/key.c b/net/mac80211/key.c index aee05ec3f7ea..429f0f4bdc0d 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -53,8 +53,6 @@ * remove the key which waits for an RCU grace period. */ -static const u8 bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - static void assert_key_lock(struct ieee80211_local *local) { lockdep_assert_held(&local->key_mtx); @@ -196,7 +194,7 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) sdata_err(sdata, "failed to set key (%d, %pM) to hardware (%d)\n", key->conf.keyidx, - sta ? sta->sta.addr : bcast_addr, ret); + sta ? sta->sta.addr : ether_broadcast_addr, ret); out_unsupported: switch (key->conf.cipher) { @@ -253,7 +251,7 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) sdata_err(sdata, "failed to remove key (%d, %pM) from hardware (%d)\n", key->conf.keyidx, - sta ? sta->sta.addr : bcast_addr, ret); + sta ? sta->sta.addr : ether_broadcast_addr, ret); key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; } diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 35ad3983ae4b..23027ea80593 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -97,8 +97,6 @@ enum mpath_frame_type { MPATH_RANN }; -static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, const u8 *orig_addr, u32 orig_sn, u8 target_flags, const u8 *target, @@ -645,7 +643,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, preq_id = PREQ_IE_PREQ_ID(preq_elem); hopcount = PREQ_IE_HOPCOUNT(preq_elem) + 1; da = (mpath && mpath->is_root) ? - mpath->rann_snd_addr : broadcast_addr; + mpath->rann_snd_addr : ether_broadcast_addr; if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) { target_addr = PREQ_IE_TARGET_ADDR(preq_elem); @@ -779,7 +777,7 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, goto endperr; mesh_path_error_tx(sdata, ttl, target_addr, target_sn, target_rcode, - broadcast_addr); + ether_broadcast_addr); } else spin_unlock_bh(&mpath->state_lock); } @@ -877,7 +875,8 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, if (ifmsh->mshcfg.dot11MeshForwarding) { mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr, - orig_sn, 0, NULL, 0, broadcast_addr, + orig_sn, 0, NULL, 0, + ether_broadcast_addr, hopcount, ttl, interval, new_metric, 0, sdata); } @@ -1080,7 +1079,7 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata) target_flags &= ~IEEE80211_PREQ_TO_FLAG; spin_unlock_bh(&mpath->state_lock); - da = (mpath->is_root) ? mpath->rann_snd_addr : broadcast_addr; + da = (mpath->is_root) ? mpath->rann_snd_addr : ether_broadcast_addr; mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn, target_flags, mpath->dst, mpath->sn, da, 0, ttl, lifetime, 0, ifmsh->preq_id++, sdata); @@ -1244,7 +1243,8 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) switch (ifmsh->mshcfg.dot11MeshHWMPRootMode) { case IEEE80211_PROACTIVE_RANN: mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr, - ++ifmsh->sn, 0, NULL, 0, broadcast_addr, + ++ifmsh->sn, 0, NULL, 0, + ether_broadcast_addr, 0, ifmsh->mshcfg.element_ttl, interval, 0, 0, sdata); break; @@ -1257,8 +1257,9 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) IEEE80211_PREQ_USN_FLAG; mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr, ++ifmsh->sn, target_flags, - (u8 *) broadcast_addr, 0, broadcast_addr, - 0, ifmsh->mshcfg.element_ttl, interval, + ether_broadcast_addr, 0, + ether_broadcast_addr, 0, + ifmsh->mshcfg.element_ttl, interval, 0, ifmsh->preq_id++, sdata); break; default: diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index a5125624a76d..8b16f7315fac 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -501,7 +501,6 @@ void mesh_plink_broken(struct sta_info *sta) { struct ieee80211_sub_if_data *sdata = sta->sdata; struct mesh_table *tbl = sdata->u.mesh.mesh_paths; - static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct mesh_path *mpath; struct rhashtable_iter iter; int ret; @@ -525,9 +524,10 @@ void mesh_plink_broken(struct sta_info *sta) ++mpath->sn; spin_unlock_bh(&mpath->state_lock); mesh_path_error_tx(sdata, - sdata->u.mesh.mshcfg.element_ttl, - mpath->dst, mpath->sn, - WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast); + sdata->u.mesh.mshcfg.element_ttl, + mpath->dst, mpath->sn, + WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, + ether_broadcast_addr); } } rhashtable_walk_stop(&iter);