aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndriy Voskoboinyk <avos@FreeBSD.org>2016-05-19 21:08:33 +0000
committerAndriy Voskoboinyk <avos@FreeBSD.org>2016-05-19 21:08:33 +0000
commit6dbbec938582d8eaa6c26b73c0a51ba3aaf91478 (patch)
tree0aecf881cda9333ff7448e08575b57a74ec4547a /sys
parent19c2700231ac99bf98afe7b727c6f4cc116a5aa4 (diff)
downloadsrc-6dbbec938582d8eaa6c26b73c0a51ba3aaf91478.tar.gz
src-6dbbec938582d8eaa6c26b73c0a51ba3aaf91478.zip
net80211: fix more compiler warnings.
ieee80211.c: add_chanlist(): 'error' variable will be uninitialized if no channels were passed; return '0' instead. ieee80211_action.c: ieee80211_send_action_register(): drop 'break' after 'return'. ieee80211_crypto_none.c: none_encap(): 'keyid' is not used in non-debug builds; hide it behind IEEE80211_DEBUG ifdef. ieee80211_freebsd.c: Staticize global 'ieee80211_debug' variable (used only in this file). ieee80211_hostap.c: Fix a comment (associatio -> association). ieee80211_ht.c: ieee80211_setup_htrates(): initialize 'maxunequalmcs' to 0 to mute compiler warning. ieee80211_hwmp.c: hwmp_recv_preq(): copy 'prep' between conditional blocks to fix -Wshadow warning. ieee80211_mesh.c: mesh_newstate(): remove duplicate 'ni' definition. mesh_recv_group_data(): fix -Wempty-body warning in non-debug builds. ieee80211_phy.c: ieee80211_compute_duration(): remove 'break' after panic() call. ieee80211_scan_sta.c: Hide some TDMA-specific macros under IEEE80211_SUPPORT_TDMA ifdef adhoc_pick_bss(): remove 'ic' pointer redefinition. ieee80211_sta.c: sta_beacon_miss(): remove 'ic' pointer redefinition. ieee80211_superg.c: superg_ioctl_set80211(): drop unreachable return. Tested with clang 3.8.0, gcc 4.6.4 and gcc 5.3.0.
Notes
Notes: svn path=/head/; revision=300232
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211.c2
-rw-r--r--sys/net80211/ieee80211_action.c1
-rw-r--r--sys/net80211/ieee80211_crypto_none.c2
-rw-r--r--sys/net80211/ieee80211_freebsd.c2
-rw-r--r--sys/net80211/ieee80211_hostap.c2
-rw-r--r--sys/net80211/ieee80211_ht.c4
-rw-r--r--sys/net80211/ieee80211_hwmp.c5
-rw-r--r--sys/net80211/ieee80211_mesh.c10
-rw-r--r--sys/net80211/ieee80211_phy.c1
-rw-r--r--sys/net80211/ieee80211_scan_sta.c3
-rw-r--r--sys/net80211/ieee80211_sta.c1
-rw-r--r--sys/net80211/ieee80211_superg.c1
12 files changed, 17 insertions, 17 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 453f11931fd0..39da95fe1a96 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1207,7 +1207,7 @@ add_chanlist(struct ieee80211_channel chans[], int maxchans, int *nchans,
}
}
- return (error);
+ return (0);
}
int
diff --git a/sys/net80211/ieee80211_action.c b/sys/net80211/ieee80211_action.c
index 9c7598932970..a42b469e7c92 100644
--- a/sys/net80211/ieee80211_action.c
+++ b/sys/net80211/ieee80211_action.c
@@ -103,7 +103,6 @@ ieee80211_send_action_register(int cat, int act, ieee80211_send_action_func *f)
break;
meshaction_send_action[act] = f;
return 0;
- break;
case IEEE80211_ACTION_CAT_VENDOR:
if (act >= nitems(vendor_send_action))
break;
diff --git a/sys/net80211/ieee80211_crypto_none.c b/sys/net80211/ieee80211_crypto_none.c
index fef4c0946b20..fd5cb6a7e292 100644
--- a/sys/net80211/ieee80211_crypto_none.c
+++ b/sys/net80211/ieee80211_crypto_none.c
@@ -101,7 +101,6 @@ none_encap(struct ieee80211_key *k, struct mbuf *m)
struct ieee80211vap *vap = k->wk_private;
#ifdef IEEE80211_DEBUG
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
-#endif
uint8_t keyid;
keyid = ieee80211_crypto_get_keyid(vap, k);
@@ -112,6 +111,7 @@ none_encap(struct ieee80211_key *k, struct mbuf *m)
*/
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr1,
"key id %u is not set (encap)", keyid);
+#endif
vap->iv_stats.is_tx_badcipher++;
return 0;
}
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index 373b0539ba20..0333e9b0f190 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters");
#ifdef IEEE80211_DEBUG
-int ieee80211_debug = 0;
+static int ieee80211_debug = 0;
SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug,
0, "debugging printfs");
#endif
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index 60535b2c8e3a..5b7611e142e6 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -1067,7 +1067,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
*/
ni->ni_flags |= IEEE80211_NODE_AREF;
/*
- * Mark the node as requiring a valid associatio id
+ * Mark the node as requiring a valid association id
* before outbound traffic is permitted.
*/
ni->ni_flags |= IEEE80211_NODE_ASSOCID;
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 0320c2dfde00..7e3616d3791c 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -1643,6 +1643,7 @@ ieee80211_setup_htrates(struct ieee80211_node *ni, const uint8_t *ie, int flags)
int i, maxequalmcs, maxunequalmcs;
maxequalmcs = ic->ic_txstream * 8 - 1;
+ maxunequalmcs = 0;
if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) {
if (ic->ic_txstream >= 2)
maxunequalmcs = 38;
@@ -1650,8 +1651,7 @@ ieee80211_setup_htrates(struct ieee80211_node *ni, const uint8_t *ie, int flags)
maxunequalmcs = 52;
if (ic->ic_txstream >= 4)
maxunequalmcs = 76;
- } else
- maxunequalmcs = 0;
+ }
rs = &ni->ni_htrates;
memset(rs, 0, sizeof(*rs));
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c
index 192024e28293..332f1405e432 100644
--- a/sys/net80211/ieee80211_hwmp.c
+++ b/sys/net80211/ieee80211_hwmp.c
@@ -944,7 +944,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
struct ieee80211_hwmp_route *hrorig = NULL;
struct ieee80211_hwmp_route *hrtarg = NULL;
struct ieee80211_hwmp_state *hs = vap->iv_hwmp;
- struct ieee80211_meshprep_ie prep;
ieee80211_hwmp_seq preqid; /* last seen preqid for orig */
uint32_t metric = 0;
@@ -1057,6 +1056,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
IEEE80211_ADDR_EQ(vap->iv_myaddr, rttarg->rt_mesh_gate) &&
rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY &&
rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) {
+ struct ieee80211_meshprep_ie prep;
+
/*
* When we are the target we shall update our own HWMP seq
* number with max of (current and preq->seq) + 1
@@ -1139,6 +1140,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
*/
if ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 ||
(preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) {
+ struct ieee80211_meshprep_ie prep;
+
prep.prep_flags = 0;
prep.prep_hopcount = 0;
prep.prep_ttl = ms->ms_ttl;
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
index 7ba784b417eb..c8e69b742382 100644
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -803,16 +803,15 @@ mesh_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
* Update bss node channel to reflect where
* we landed after CSA.
*/
- ieee80211_node_set_chan(vap->iv_bss,
+ ieee80211_node_set_chan(ni,
ieee80211_ht_adjust_channel(ic, ic->ic_curchan,
- ieee80211_htchanflags(vap->iv_bss->ni_chan)));
+ ieee80211_htchanflags(ni->ni_chan)));
/* XXX bypass debug msgs */
break;
case IEEE80211_S_SCAN:
case IEEE80211_S_RUN:
#ifdef IEEE80211_DEBUG
if (ieee80211_msg_debug(vap)) {
- struct ieee80211_node *ni = vap->iv_bss;
ieee80211_note(vap,
"synchronized with %s meshid ",
ether_sprintf(ni->ni_meshid));
@@ -827,7 +826,7 @@ mesh_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
default:
break;
}
- ieee80211_node_authorize(vap->iv_bss);
+ ieee80211_node_authorize(ni);
callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact,
mesh_rt_cleanup_cb, vap);
mesh_gatemode_setup(vap);
@@ -1510,10 +1509,11 @@ mesh_recv_group_data(struct ieee80211vap *vap, struct mbuf *m,
* will sent it on another port member.
*/
if (ms->ms_flags & IEEE80211_MESHFLAGS_GATE &&
- ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
+ ms->ms_flags & IEEE80211_MESHFLAGS_FWD) {
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH,
MC01(mc)->mc_addr4, "%s",
"forward from MBSS to the DS");
+ }
}
}
return (0); /* process locally */
diff --git a/sys/net80211/ieee80211_phy.c b/sys/net80211/ieee80211_phy.c
index 13cecb6ad92c..644f52fe522c 100644
--- a/sys/net80211/ieee80211_phy.c
+++ b/sys/net80211/ieee80211_phy.c
@@ -563,7 +563,6 @@ ieee80211_compute_duration(const struct ieee80211_rate_table *rt,
default:
panic("%s: unknown phy %u (rate %u)\n", __func__,
rt->info[rix].phy, rate);
- break;
}
return txTime;
}
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index 8d9946d5b481..47b0573639b8 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -129,11 +129,13 @@ static void sta_flush_table(struct sta_table *);
#define MATCH_NOTSEEN 0x00080 /* not seen in recent scans */
#define MATCH_RSSI 0x00100 /* rssi deemed too low to use */
#define MATCH_CC 0x00200 /* country code mismatch */
+#ifdef IEEE80211_SUPPORT_TDMA
#define MATCH_TDMA_NOIE 0x00400 /* no TDMA ie */
#define MATCH_TDMA_NOTMASTER 0x00800 /* not TDMA master */
#define MATCH_TDMA_NOSLOT 0x01000 /* all TDMA slots occupied */
#define MATCH_TDMA_LOCAL 0x02000 /* local address */
#define MATCH_TDMA_VERSION 0x04000 /* protocol version mismatch */
+#endif
#define MATCH_MESH_NOID 0x10000 /* no MESHID ie */
#define MATCH_MESHID 0x20000 /* meshid mismatch */
static int match_bss(struct ieee80211vap *,
@@ -1615,7 +1617,6 @@ notfound:
} else
chan = vap->iv_des_chan;
if (chan != NULL) {
- struct ieee80211com *ic = vap->iv_ic;
/*
* Create a HT capable IBSS; the per-node
* probe request/response will result in
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
index 90561b290c85..9100fb0817e3 100644
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -154,7 +154,6 @@ sta_beacon_miss(struct ieee80211vap *vap)
vap->iv_stats.is_beacon_miss++;
if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) {
#ifdef IEEE80211_SUPPORT_SUPERG
- struct ieee80211com *ic = vap->iv_ic;
/*
* If we receive a beacon miss interrupt when using
diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c
index 278ba88e7f4f..5565e5ebf990 100644
--- a/sys/net80211/ieee80211_superg.c
+++ b/sys/net80211/ieee80211_superg.c
@@ -1044,7 +1044,6 @@ superg_ioctl_set80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
default:
return ENOSYS;
}
- return 0;
}
IEEE80211_IOCTL_SET(superg, superg_ioctl_set80211);