diff options
author | avos <avos@FreeBSD.org> | 2016-05-19 21:08:33 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-05-19 21:08:33 +0000 |
commit | 70ff509d20229b79d2285c7422742fa8f0c65d6e (patch) | |
tree | 0aecf881cda9333ff7448e08575b57a74ec4547a /sys/net80211 | |
parent | 9a80f56e574be0650795978cea849a9fda91f2bb (diff) | |
download | FreeBSD-src-70ff509d20229b79d2285c7422742fa8f0c65d6e.zip FreeBSD-src-70ff509d20229b79d2285c7422742fa8f0c65d6e.tar.gz |
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.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_action.c | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_crypto_none.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_hostap.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_ht.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_hwmp.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_mesh.c | 10 | ||||
-rw-r--r-- | sys/net80211/ieee80211_phy.c | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 3 | ||||
-rw-r--r-- | sys/net80211/ieee80211_sta.c | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_superg.c | 1 |
12 files changed, 17 insertions, 17 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 453f119..39da95f 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 9c75989..a42b469 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 fef4c09..fd5cb6a 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 373b053..0333e9b 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 60535b2..5b7611e 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 0320c2d..7e3616d 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 192024e..332f140 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 7ba784b..c8e69b7 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 13cecb6..644f52f 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 8d9946d..47b0573 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 90561b2..9100fb0 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 278ba88..5565e5e 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); |