From nobody Thu Dec 30 19:22:30 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F075F191EEFC; Thu, 30 Dec 2021 19:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JPypG3qTTz3BwC; Thu, 30 Dec 2021 19:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 618B81DCC1; Thu, 30 Dec 2021 19:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BUJMUv7017188; Thu, 30 Dec 2021 19:22:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BUJMUg8017187; Thu, 30 Dec 2021 19:22:30 GMT (envelope-from git) Date: Thu, 30 Dec 2021 19:22:30 GMT Message-Id: <202112301922.1BUJMUg8017187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8c90bf16bc2c - stable/13 - net80211: fix -Wunused-but-set-variable warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c90bf16bc2c6a95701a847820a5101c7125d0fe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640892150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MsJ8jhtWbuO8WF/wPFWnzK+L/8QKYVuHRNfmjwXtuzE=; b=MIZMH3fff9TtM0NlZQU3WxcCVr8Kja0jF+rjnGE3HI9DfWBU00DDOHsRt7PT1WYq2KZTD0 4rWJsTH2FtRA3LHNMCktx5cz9bwU7i/V2nsb+CXFRJB/aRPbywegwiZQTFwTYcislZmT0/ Xaq9LiX6Z3RL0j2eccXcWnplGb7j7Qfppbv3NbEgcVt0ECiryuDkCBg3VhIn/gT1SJoqPH HVU3kEYfMw3ujv9DjkZwve9qMniLdydkw2zaUkGqmsBH7MfgNUuy6o7nXyGwGzpw0gwo/5 XIXiG6dVNNfmajVXI0zC5TEhi2SmX2CZJntYq0mkW4a95Y6LaeMWoWIp6Wa8bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640892150; a=rsa-sha256; cv=none; b=SugMH5BqPQWQ9of1aqXb2ShOw6oFs6QXpcVtkQgUMJb0kB2TDlrpZE0Khu9/rLJ4qhRUtX XmPp8TRCVeGbdn/URc0RX9IGxvCUXtZA0GNd1azGHRkD4aVjWaPK2UN18qfD1yypF4MAAW IRmUdvxjbbfWrg4fVXAxBiAdgYU3OT7WjfPBrODQ5ZHOtbET5dBVSQCSEno9H3Q8ph/l2D qaBYw+UmWyxaa+3S/jnWM3A4owyHqhD5vyUtYp0raVUrl9KcEn17Ste/UpMT0kTKrewzIE aKfjbkVpYRzPDxO4oci12AHz8gv8Cfr9uvZzh4SBLDQeNYTVX/PwdSDrwBZACw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8c90bf16bc2c6a95701a847820a5101c7125d0fe commit 8c90bf16bc2c6a95701a847820a5101c7125d0fe Author: Bjoern A. Zeeb AuthorDate: 2021-11-24 17:36:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-12-30 18:24:37 +0000 net80211: fix -Wunused-but-set-variable warnings Put the offending variables under the appropriate #ifdefs (mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and in two cases under __notyet__ to revisit why these had been left there but not used). Sponsored by: The FreeBSD Foundation (cherry picked from commit 05ea7a3e5e748547a0229efa80be0e71eaf84f52) --- sys/net80211/ieee80211_adhoc.c | 5 ++++- sys/net80211/ieee80211_crypto_wep.c | 8 +++++--- sys/net80211/ieee80211_hostap.c | 16 +++++++++++++++- sys/net80211/ieee80211_ht.c | 21 ++++++++++++++++----- sys/net80211/ieee80211_output.c | 6 ++++++ sys/net80211/ieee80211_sta.c | 7 ++++++- 6 files changed, 52 insertions(+), 11 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 150515222268..57e46dd5ad0b 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -1009,7 +1009,6 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_frame *wh; /* * Process management frames when scanning; useful for doing @@ -1018,7 +1017,11 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, if (ic->ic_flags & IEEE80211_F_SCAN) adhoc_recv_mgmt(ni, m0, subtype, rxs, rssi, nf); else { +#ifdef IEEE80211_DEBUG + struct ieee80211_frame *wh; + wh = mtod(m0, struct ieee80211_frame *); +#endif switch (subtype) { case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: case IEEE80211_FC0_SUBTYPE_ASSOC_RESP: diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index 797de006cdf2..164157559cb2 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -241,11 +241,8 @@ wep_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) { struct wep_ctx *ctx = k->wk_private; struct ieee80211vap *vap = ctx->wc_vap; - struct ieee80211_frame *wh; const struct ieee80211_rx_stats *rxs; - wh = mtod(m, struct ieee80211_frame *); - rxs = ieee80211_get_rx_params_ptr(m); if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) @@ -258,6 +255,11 @@ wep_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) */ if ((k->wk_flags & IEEE80211_KEY_SWDECRYPT) && !wep_decrypt(k, m, hdrlen)) { +#ifdef IEEE80211_DEBUG + struct ieee80211_frame *wh; + + wh = mtod(m, struct ieee80211_frame *); +#endif IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, "%s", "WEP ICV mismatch on decrypt"); vap->iv_stats.is_rx_wepfail++; diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 4fa9c6a72145..f3a85848fc84 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -997,7 +997,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, { struct ieee80211vap *vap = ni->ni_vap; uint8_t *challenge; - int allocbs, estatus; + int estatus; KASSERT(vap->iv_state == IEEE80211_S_RUN, ("state %d", vap->iv_state)); @@ -1070,17 +1070,26 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, } switch (seq) { case IEEE80211_AUTH_SHARED_REQUEST: + { +#ifdef IEEE80211_DEBUG + bool allocbs; +#endif + if (ni == vap->iv_bss) { ni = ieee80211_dup_bss(vap, wh->i_addr2); if (ni == NULL) { /* NB: no way to return an error */ return; } +#ifdef IEEE80211_DEBUG allocbs = 1; +#endif } else { if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0) (void) ieee80211_ref_node(ni); +#ifdef IEEE80211_DEBUG allocbs = 0; +#endif } /* * Mark the node as referenced to reflect that it's @@ -1120,6 +1129,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, return; } break; + } case IEEE80211_AUTH_SHARED_RESPONSE: if (ni == vap->iv_bss) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH, @@ -2299,7 +2309,9 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, case IEEE80211_FC0_SUBTYPE_DEAUTH: case IEEE80211_FC0_SUBTYPE_DISASSOC: { +#ifdef IEEE80211_DEBUG uint16_t reason; +#endif if (vap->iv_state != IEEE80211_S_RUN || /* NB: can happen when in promiscuous mode */ @@ -2312,7 +2324,9 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, * [2] reason */ IEEE80211_VERIFY_LENGTH(efrm - frm, 2, return); +#ifdef IEEE80211_DEBUG reason = le16toh(*(uint16_t *)frm); +#endif if (subtype == IEEE80211_FC0_SUBTYPE_DEAUTH) { vap->iv_stats.is_rx_deauth++; IEEE80211_NODE_STAT(ni, rx_deauth); diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index fc10e07cc4fc..e680db5faa52 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -2351,7 +2351,7 @@ ieee80211_addba_response(struct ieee80211_node *ni, int status, int baparamset, int batimeout) { struct ieee80211vap *vap = ni->ni_vap; - int bufsiz, tid; + int bufsiz; /* XXX locking */ addba_stop_timeout(tap); @@ -2360,7 +2360,9 @@ ieee80211_addba_response(struct ieee80211_node *ni, /* XXX override our request? */ tap->txa_wnd = (bufsiz == 0) ? IEEE80211_AGGR_BAWMAX : min(bufsiz, IEEE80211_AGGR_BAWMAX); +#ifdef __notyet__ tid = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_TID); +#endif tap->txa_flags |= IEEE80211_AGGR_RUNNING; tap->txa_attempts = 0; /* TODO: this should be a vap flag */ @@ -2486,16 +2488,20 @@ ht_recv_action_ba_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap; uint8_t dialogtoken, policy; uint16_t baparamset, batimeout, code; - int tid, bufsiz; - int amsdu; + int tid; +#ifdef IEEE80211_DEBUG + int amsdu, bufsiz; +#endif dialogtoken = frm[2]; code = le16dec(frm+3); baparamset = le16dec(frm+5); tid = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_TID); +#ifdef IEEE80211_DEBUG bufsiz = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_BUFSIZ); - policy = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_POLICY); amsdu = !! _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_AMSDU); +#endif + policy = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_POLICY); batimeout = le16dec(frm+7); tap = &ni->ni_tx_ampdu[tid]; @@ -2563,11 +2569,16 @@ ht_recv_action_ba_delba(struct ieee80211_node *ni, struct ieee80211com *ic = ni->ni_ic; struct ieee80211_rx_ampdu *rap; struct ieee80211_tx_ampdu *tap; - uint16_t baparamset, code; + uint16_t baparamset; +#ifdef IEEE80211_DEBUG + uint16_t code; +#endif int tid; baparamset = le16dec(frm+2); +#ifdef IEEE80211_DEBUG code = le16dec(frm+4); +#endif tid = _IEEE80211_MASKSHIFT(baparamset, IEEE80211_DELBAPS_TID); diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 4f9e9614f732..9b1898df7b10 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -126,10 +126,12 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m, struct ifnet *ifp = vap->iv_ifp; int mcast; int do_ampdu = 0; +#ifdef IEEE80211_SUPPORT_SUPERG int do_amsdu = 0; int do_ampdu_amsdu = 0; int no_ampdu = 1; /* Will be set to 0 if ampdu is active */ int do_ff = 0; +#endif if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { @@ -187,12 +189,14 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m, */ do_ampdu = ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX)); +#ifdef IEEE80211_SUPPORT_SUPERG do_amsdu = ((ni->ni_flags & IEEE80211_NODE_AMSDU_TX) && (vap->iv_flags_ht & IEEE80211_FHT_AMSDU_TX)); do_ff = ((ni->ni_flags & IEEE80211_NODE_HT) == 0) && ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) && (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)); +#endif /* * Check if A-MPDU tx aggregation is setup or if we @@ -246,9 +250,11 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m, * have also set or cleared the amsdu-in-ampdu txa_flags * combination so we can correctly do A-MPDU + A-MSDU. */ +#ifdef IEEE80211_SUPPORT_SUPERG no_ampdu = (! IEEE80211_AMPDU_RUNNING(tap) || (IEEE80211_AMPDU_NACKED(tap))); do_ampdu_amsdu = IEEE80211_AMPDU_RUNNING_AMSDU(tap); +#endif } } diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 7ea6187332b1..9e103f6877c4 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1569,7 +1569,10 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, int ix = aid / NBBY; int min = tim->tim_bitctl &~ 1; int max = tim->tim_len + min - 4; - int tim_ucast = 0, tim_mcast = 0; + int tim_ucast = 0; +#ifdef __notyet__ + int tim_mcast = 0; +#endif /* * Only do this for unicast traffic in the TIM @@ -1582,6 +1585,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, tim_ucast = 1; } +#ifdef __notyet__ /* * Do a separate notification * for the multicast bit being set. @@ -1589,6 +1593,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, if (tim->tim_bitctl & 1) { tim_mcast = 1; } +#endif /* * If the TIM indicates there's traffic for