aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-12 10:43:19 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-15 03:41:39 -0500
commit4a3cb702b05868f67c4ee3da3380461c5b90b4ca (patch)
tree557b28bd820e50ad7d3c758c34a60d5df006f6ed
parent50640f169372b9977487a328dedf13a8debedff7 (diff)
mac80211: constify IE parsing
Make all the parsed IE pointers const, and propagate the change to all the users etc. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/linux/ieee80211.h2
-rw-r--r--net/mac80211/ht.c2
-rw-r--r--net/mac80211/ieee80211_i.h87
-rw-r--r--net/mac80211/mesh.h11
-rw-r--r--net/mac80211/mesh_hwmp.c42
-rw-r--r--net/mac80211/mesh_pathtbl.c11
-rw-r--r--net/mac80211/mlme.c15
-rw-r--r--net/mac80211/util.c4
-rw-r--r--net/mac80211/vht.c9
9 files changed, 96 insertions, 87 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 12b5996533ec..e085fcf52b26 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2152,7 +2152,7 @@ static inline unsigned long ieee80211_tu_to_usec(unsigned long tu)
2152 * @tim_len: length of the TIM IE 2152 * @tim_len: length of the TIM IE
2153 * @aid: the AID to look for 2153 * @aid: the AID to look for
2154 */ 2154 */
2155static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, 2155static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2156 u8 tim_len, u16 aid) 2156 u8 tim_len, u16 aid)
2157{ 2157{
2158 u8 mask; 2158 u8 mask;
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 797969bc26e1..b84147ac5b4c 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -94,7 +94,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
94 94
95bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, 95bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
96 struct ieee80211_supported_band *sband, 96 struct ieee80211_supported_band *sband,
97 struct ieee80211_ht_cap *ht_cap_ie, 97 const struct ieee80211_ht_cap *ht_cap_ie,
98 struct sta_info *sta) 98 struct sta_info *sta)
99{ 99{
100 struct ieee80211_sta_ht_cap ht_cap; 100 struct ieee80211_sta_ht_cap ht_cap;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d1074442f1b5..d702f7dc321b 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1163,41 +1163,41 @@ struct ieee80211_ra_tid {
1163 1163
1164/* Parsed Information Elements */ 1164/* Parsed Information Elements */
1165struct ieee802_11_elems { 1165struct ieee802_11_elems {
1166 u8 *ie_start; 1166 const u8 *ie_start;
1167 size_t total_len; 1167 size_t total_len;
1168 1168
1169 /* pointers to IEs */ 1169 /* pointers to IEs */
1170 u8 *ssid; 1170 const u8 *ssid;
1171 u8 *supp_rates; 1171 const u8 *supp_rates;
1172 u8 *fh_params; 1172 const u8 *fh_params;
1173 u8 *ds_params; 1173 const u8 *ds_params;
1174 u8 *cf_params; 1174 const u8 *cf_params;
1175 struct ieee80211_tim_ie *tim; 1175 const struct ieee80211_tim_ie *tim;
1176 u8 *ibss_params; 1176 const u8 *ibss_params;
1177 u8 *challenge; 1177 const u8 *challenge;
1178 u8 *rsn; 1178 const u8 *rsn;
1179 u8 *erp_info; 1179 const u8 *erp_info;
1180 u8 *ext_supp_rates; 1180 const u8 *ext_supp_rates;
1181 u8 *wmm_info; 1181 const u8 *wmm_info;
1182 u8 *wmm_param; 1182 const u8 *wmm_param;
1183 struct ieee80211_ht_cap *ht_cap_elem; 1183 const struct ieee80211_ht_cap *ht_cap_elem;
1184 struct ieee80211_ht_operation *ht_operation; 1184 const struct ieee80211_ht_operation *ht_operation;
1185 struct ieee80211_vht_cap *vht_cap_elem; 1185 const struct ieee80211_vht_cap *vht_cap_elem;
1186 struct ieee80211_vht_operation *vht_operation; 1186 const struct ieee80211_vht_operation *vht_operation;
1187 struct ieee80211_meshconf_ie *mesh_config; 1187 const struct ieee80211_meshconf_ie *mesh_config;
1188 u8 *mesh_id; 1188 const u8 *mesh_id;
1189 u8 *peering; 1189 const u8 *peering;
1190 __le16 *awake_window; 1190 const __le16 *awake_window;
1191 u8 *preq; 1191 const u8 *preq;
1192 u8 *prep; 1192 const u8 *prep;
1193 u8 *perr; 1193 const u8 *perr;
1194 struct ieee80211_rann_ie *rann; 1194 const struct ieee80211_rann_ie *rann;
1195 struct ieee80211_channel_sw_ie *ch_switch_ie; 1195 const struct ieee80211_channel_sw_ie *ch_switch_ie;
1196 u8 *country_elem; 1196 const u8 *country_elem;
1197 u8 *pwr_constr_elem; 1197 const u8 *pwr_constr_elem;
1198 u8 *quiet_elem; /* first quite element */ 1198 const u8 *quiet_elem; /* first quite element */
1199 u8 *timeout_int; 1199 const u8 *timeout_int;
1200 u8 *opmode_notif; 1200 const u8 *opmode_notif;
1201 1201
1202 /* length of them, respectively */ 1202 /* length of them, respectively */
1203 u8 ssid_len; 1203 u8 ssid_len;
@@ -1276,10 +1276,10 @@ void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
1276int ieee80211_max_network_latency(struct notifier_block *nb, 1276int ieee80211_max_network_latency(struct notifier_block *nb,
1277 unsigned long data, void *dummy); 1277 unsigned long data, void *dummy);
1278int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata); 1278int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
1279void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 1279void
1280 struct ieee80211_channel_sw_ie *sw_elem, 1280ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1281 struct ieee80211_bss *bss, 1281 const struct ieee80211_channel_sw_ie *sw_elem,
1282 u64 timestamp); 1282 struct ieee80211_bss *bss, u64 timestamp);
1283void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); 1283void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata);
1284void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); 1284void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
1285void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata); 1285void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
@@ -1387,7 +1387,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
1387 struct ieee80211_sta_ht_cap *ht_cap); 1387 struct ieee80211_sta_ht_cap *ht_cap);
1388bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, 1388bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
1389 struct ieee80211_supported_band *sband, 1389 struct ieee80211_supported_band *sband,
1390 struct ieee80211_ht_cap *ht_cap_ie, 1390 const struct ieee80211_ht_cap *ht_cap_ie,
1391 struct sta_info *sta); 1391 struct sta_info *sta);
1392void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, 1392void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
1393 const u8 *da, u16 tid, 1393 const u8 *da, u16 tid,
@@ -1428,10 +1428,11 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
1428u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs); 1428u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
1429 1429
1430/* VHT */ 1430/* VHT */
1431void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, 1431void
1432 struct ieee80211_supported_band *sband, 1432ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
1433 struct ieee80211_vht_cap *vht_cap_ie, 1433 struct ieee80211_supported_band *sband,
1434 struct sta_info *sta); 1434 const struct ieee80211_vht_cap *vht_cap_ie,
1435 struct sta_info *sta);
1435enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta); 1436enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
1436void ieee80211_sta_set_rx_nss(struct sta_info *sta); 1437void ieee80211_sta_set_rx_nss(struct sta_info *sta);
1437void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, 1438void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
@@ -1555,7 +1556,7 @@ static inline void ieee80211_add_pending_skbs(struct ieee80211_local *local,
1555 1556
1556void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 1557void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1557 u16 transaction, u16 auth_alg, u16 status, 1558 u16 transaction, u16 auth_alg, u16 status,
1558 u8 *extra, size_t extra_len, const u8 *bssid, 1559 const u8 *extra, size_t extra_len, const u8 *bssid,
1559 const u8 *da, const u8 *key, u8 key_len, u8 key_idx, 1560 const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
1560 u32 tx_flags); 1561 u32 tx_flags);
1561void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, 1562void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
@@ -1606,7 +1607,7 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
1606 1607
1607/* channel management */ 1608/* channel management */
1608void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan, 1609void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan,
1609 struct ieee80211_ht_operation *ht_oper, 1610 const struct ieee80211_ht_operation *ht_oper,
1610 struct cfg80211_chan_def *chandef); 1611 struct cfg80211_chan_def *chandef);
1611 1612
1612int __must_check 1613int __must_check
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 7ad035f0cacc..a1bad310f2e9 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -265,8 +265,8 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
265int mesh_nexthop_resolve(struct sk_buff *skb, 265int mesh_nexthop_resolve(struct sk_buff *skb,
266 struct ieee80211_sub_if_data *sdata); 266 struct ieee80211_sub_if_data *sdata);
267void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata); 267void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata);
268struct mesh_path *mesh_path_lookup(u8 *dst, 268struct mesh_path *mesh_path_lookup(const u8 *dst,
269 struct ieee80211_sub_if_data *sdata); 269 struct ieee80211_sub_if_data *sdata);
270struct mesh_path *mpp_path_lookup(u8 *dst, 270struct mesh_path *mpp_path_lookup(u8 *dst,
271 struct ieee80211_sub_if_data *sdata); 271 struct ieee80211_sub_if_data *sdata);
272int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata); 272int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata);
@@ -276,7 +276,7 @@ void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop);
276void mesh_path_expire(struct ieee80211_sub_if_data *sdata); 276void mesh_path_expire(struct ieee80211_sub_if_data *sdata);
277void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, 277void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
278 struct ieee80211_mgmt *mgmt, size_t len); 278 struct ieee80211_mgmt *mgmt, size_t len);
279int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata); 279int mesh_path_add(const u8 *dst, struct ieee80211_sub_if_data *sdata);
280 280
281int mesh_path_add_gate(struct mesh_path *mpath); 281int mesh_path_add_gate(struct mesh_path *mpath);
282int mesh_path_send_to_gates(struct mesh_path *mpath); 282int mesh_path_send_to_gates(struct mesh_path *mpath);
@@ -301,8 +301,9 @@ void mesh_sta_cleanup(struct sta_info *sta);
301void mesh_mpath_table_grow(void); 301void mesh_mpath_table_grow(void);
302void mesh_mpp_table_grow(void); 302void mesh_mpp_table_grow(void);
303/* Mesh paths */ 303/* Mesh paths */
304int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn, __le16 target_rcode, 304int mesh_path_error_tx(u8 ttl, const u8 *target, __le32 target_sn,
305 const u8 *ra, struct ieee80211_sub_if_data *sdata); 305 __le16 target_rcode, const u8 *ra,
306 struct ieee80211_sub_if_data *sdata);
306void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta); 307void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta);
307void mesh_path_flush_pending(struct mesh_path *mpath); 308void mesh_path_flush_pending(struct mesh_path *mpath);
308void mesh_path_tx_pending(struct mesh_path *mpath); 309void mesh_path_tx_pending(struct mesh_path *mpath);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index f0dd8742ed42..585c1e26cca8 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -30,14 +30,14 @@
30 30
31static void mesh_queue_preq(struct mesh_path *, u8); 31static void mesh_queue_preq(struct mesh_path *, u8);
32 32
33static inline u32 u32_field_get(u8 *preq_elem, int offset, bool ae) 33static inline u32 u32_field_get(const u8 *preq_elem, int offset, bool ae)
34{ 34{
35 if (ae) 35 if (ae)
36 offset += 6; 36 offset += 6;
37 return get_unaligned_le32(preq_elem + offset); 37 return get_unaligned_le32(preq_elem + offset);
38} 38}
39 39
40static inline u32 u16_field_get(u8 *preq_elem, int offset, bool ae) 40static inline u32 u16_field_get(const u8 *preq_elem, int offset, bool ae)
41{ 41{
42 if (ae) 42 if (ae)
43 offset += 6; 43 offset += 6;
@@ -102,10 +102,13 @@ enum mpath_frame_type {
102static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 102static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
103 103
104static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, 104static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
105 u8 *orig_addr, __le32 orig_sn, u8 target_flags, u8 *target, 105 const u8 *orig_addr, __le32 orig_sn,
106 __le32 target_sn, const u8 *da, u8 hop_count, u8 ttl, 106 u8 target_flags, const u8 *target,
107 __le32 lifetime, __le32 metric, __le32 preq_id, 107 __le32 target_sn, const u8 *da,
108 struct ieee80211_sub_if_data *sdata) 108 u8 hop_count, u8 ttl,
109 __le32 lifetime, __le32 metric,
110 __le32 preq_id,
111 struct ieee80211_sub_if_data *sdata)
109{ 112{
110 struct ieee80211_local *local = sdata->local; 113 struct ieee80211_local *local = sdata->local;
111 struct sk_buff *skb; 114 struct sk_buff *skb;
@@ -235,7 +238,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
235 * also acquires in the TX path. To avoid a deadlock we don't transmit the 238 * also acquires in the TX path. To avoid a deadlock we don't transmit the
236 * frame directly but add it to the pending queue instead. 239 * frame directly but add it to the pending queue instead.
237 */ 240 */
238int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn, 241int mesh_path_error_tx(u8 ttl, const u8 *target, __le32 target_sn,
239 __le16 target_rcode, const u8 *ra, 242 __le16 target_rcode, const u8 *ra,
240 struct ieee80211_sub_if_data *sdata) 243 struct ieee80211_sub_if_data *sdata)
241{ 244{
@@ -369,14 +372,14 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local,
369 * path routing information is updated. 372 * path routing information is updated.
370 */ 373 */
371static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, 374static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
372 struct ieee80211_mgmt *mgmt, 375 struct ieee80211_mgmt *mgmt,
373 u8 *hwmp_ie, enum mpath_frame_type action) 376 const u8 *hwmp_ie, enum mpath_frame_type action)
374{ 377{
375 struct ieee80211_local *local = sdata->local; 378 struct ieee80211_local *local = sdata->local;
376 struct mesh_path *mpath; 379 struct mesh_path *mpath;
377 struct sta_info *sta; 380 struct sta_info *sta;
378 bool fresh_info; 381 bool fresh_info;
379 u8 *orig_addr, *ta; 382 const u8 *orig_addr, *ta;
380 u32 orig_sn, orig_metric; 383 u32 orig_sn, orig_metric;
381 unsigned long orig_lifetime, exp_time; 384 unsigned long orig_lifetime, exp_time;
382 u32 last_hop_metric, new_metric; 385 u32 last_hop_metric, new_metric;
@@ -511,11 +514,11 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
511 514
512static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, 515static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
513 struct ieee80211_mgmt *mgmt, 516 struct ieee80211_mgmt *mgmt,
514 u8 *preq_elem, u32 metric) 517 const u8 *preq_elem, u32 metric)
515{ 518{
516 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 519 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
517 struct mesh_path *mpath = NULL; 520 struct mesh_path *mpath = NULL;
518 u8 *target_addr, *orig_addr; 521 const u8 *target_addr, *orig_addr;
519 const u8 *da; 522 const u8 *da;
520 u8 target_flags, ttl, flags; 523 u8 target_flags, ttl, flags;
521 u32 orig_sn, target_sn, lifetime, orig_metric; 524 u32 orig_sn, target_sn, lifetime, orig_metric;
@@ -648,11 +651,11 @@ next_hop_deref_protected(struct mesh_path *mpath)
648 651
649static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, 652static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
650 struct ieee80211_mgmt *mgmt, 653 struct ieee80211_mgmt *mgmt,
651 u8 *prep_elem, u32 metric) 654 const u8 *prep_elem, u32 metric)
652{ 655{
653 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 656 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
654 struct mesh_path *mpath; 657 struct mesh_path *mpath;
655 u8 *target_addr, *orig_addr; 658 const u8 *target_addr, *orig_addr;
656 u8 ttl, hopcount, flags; 659 u8 ttl, hopcount, flags;
657 u8 next_hop[ETH_ALEN]; 660 u8 next_hop[ETH_ALEN];
658 u32 target_sn, orig_sn, lifetime; 661 u32 target_sn, orig_sn, lifetime;
@@ -711,12 +714,13 @@ fail:
711} 714}
712 715
713static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, 716static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
714 struct ieee80211_mgmt *mgmt, u8 *perr_elem) 717 struct ieee80211_mgmt *mgmt,
718 const u8 *perr_elem)
715{ 719{
716 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 720 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
717 struct mesh_path *mpath; 721 struct mesh_path *mpath;
718 u8 ttl; 722 u8 ttl;
719 u8 *ta, *target_addr; 723 const u8 *ta, *target_addr;
720 u32 target_sn; 724 u32 target_sn;
721 u16 target_rcode; 725 u16 target_rcode;
722 726
@@ -758,15 +762,15 @@ endperr:
758} 762}
759 763
760static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, 764static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
761 struct ieee80211_mgmt *mgmt, 765 struct ieee80211_mgmt *mgmt,
762 struct ieee80211_rann_ie *rann) 766 const struct ieee80211_rann_ie *rann)
763{ 767{
764 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 768 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
765 struct ieee80211_local *local = sdata->local; 769 struct ieee80211_local *local = sdata->local;
766 struct sta_info *sta; 770 struct sta_info *sta;
767 struct mesh_path *mpath; 771 struct mesh_path *mpath;
768 u8 ttl, flags, hopcount; 772 u8 ttl, flags, hopcount;
769 u8 *orig_addr; 773 const u8 *orig_addr;
770 u32 orig_sn, metric, metric_txsta, interval; 774 u32 orig_sn, metric, metric_txsta, interval;
771 bool root_is_gate; 775 bool root_is_gate;
772 776
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index d5786c3eaee2..2ce4c4023a97 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -181,7 +181,7 @@ errcopy:
181 return -ENOMEM; 181 return -ENOMEM;
182} 182}
183 183
184static u32 mesh_table_hash(u8 *addr, struct ieee80211_sub_if_data *sdata, 184static u32 mesh_table_hash(const u8 *addr, struct ieee80211_sub_if_data *sdata,
185 struct mesh_table *tbl) 185 struct mesh_table *tbl)
186{ 186{
187 /* Use last four bytes of hw addr and interface index as hash index */ 187 /* Use last four bytes of hw addr and interface index as hash index */
@@ -326,8 +326,8 @@ static void mesh_path_move_to_queue(struct mesh_path *gate_mpath,
326} 326}
327 327
328 328
329static struct mesh_path *mpath_lookup(struct mesh_table *tbl, u8 *dst, 329static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst,
330 struct ieee80211_sub_if_data *sdata) 330 struct ieee80211_sub_if_data *sdata)
331{ 331{
332 struct mesh_path *mpath; 332 struct mesh_path *mpath;
333 struct hlist_node *n; 333 struct hlist_node *n;
@@ -359,7 +359,8 @@ static struct mesh_path *mpath_lookup(struct mesh_table *tbl, u8 *dst,
359 * 359 *
360 * Locking: must be called within a read rcu section. 360 * Locking: must be called within a read rcu section.
361 */ 361 */
362struct mesh_path *mesh_path_lookup(u8 *dst, struct ieee80211_sub_if_data *sdata) 362struct mesh_path *mesh_path_lookup(const u8 *dst,
363 struct ieee80211_sub_if_data *sdata)
363{ 364{
364 return mpath_lookup(rcu_dereference(mesh_paths), dst, sdata); 365 return mpath_lookup(rcu_dereference(mesh_paths), dst, sdata);
365} 366}
@@ -494,7 +495,7 @@ int mesh_gate_num(struct ieee80211_sub_if_data *sdata)
494 * 495 *
495 * State: the initial state of the new path is set to 0 496 * State: the initial state of the new path is set to 0
496 */ 497 */
497int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata) 498int mesh_path_add(const u8 *dst, struct ieee80211_sub_if_data *sdata)
498{ 499{
499 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 500 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
500 struct ieee80211_local *local = sdata->local; 501 struct ieee80211_local *local = sdata->local;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 05b229e3b226..7a8cd789e487 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1041,10 +1041,10 @@ static void ieee80211_chswitch_timer(unsigned long data)
1041 ieee80211_queue_work(&sdata->local->hw, &ifmgd->chswitch_work); 1041 ieee80211_queue_work(&sdata->local->hw, &ifmgd->chswitch_work);
1042} 1042}
1043 1043
1044void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 1044void
1045 struct ieee80211_channel_sw_ie *sw_elem, 1045ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1046 struct ieee80211_bss *bss, 1046 const struct ieee80211_channel_sw_ie *sw_elem,
1047 u64 timestamp) 1047 struct ieee80211_bss *bss, u64 timestamp)
1048{ 1048{
1049 struct cfg80211_bss *cbss = 1049 struct cfg80211_bss *cbss =
1050 container_of((void *)bss, struct cfg80211_bss, priv); 1050 container_of((void *)bss, struct cfg80211_bss, priv);
@@ -1479,13 +1479,14 @@ void ieee80211_dfs_cac_timer_work(struct work_struct *work)
1479/* MLME */ 1479/* MLME */
1480static bool ieee80211_sta_wmm_params(struct ieee80211_local *local, 1480static bool ieee80211_sta_wmm_params(struct ieee80211_local *local,
1481 struct ieee80211_sub_if_data *sdata, 1481 struct ieee80211_sub_if_data *sdata,
1482 u8 *wmm_param, size_t wmm_param_len) 1482 const u8 *wmm_param, size_t wmm_param_len)
1483{ 1483{
1484 struct ieee80211_tx_queue_params params; 1484 struct ieee80211_tx_queue_params params;
1485 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1485 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1486 size_t left; 1486 size_t left;
1487 int count; 1487 int count;
1488 u8 *pos, uapsd_queues = 0; 1488 const u8 *pos;
1489 u8 uapsd_queues = 0;
1489 1490
1490 if (!local->ops->conf_tx) 1491 if (!local->ops->conf_tx)
1491 return false; 1492 return false;
@@ -2670,7 +2671,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2670 need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period; 2671 need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period;
2671 2672
2672 if (elems->tim && !elems->parse_error) { 2673 if (elems->tim && !elems->parse_error) {
2673 struct ieee80211_tim_ie *tim_ie = elems->tim; 2674 const struct ieee80211_tim_ie *tim_ie = elems->tim;
2674 sdata->u.mgd.dtim_period = tim_ie->dtim_period; 2675 sdata->u.mgd.dtim_period = tim_ie->dtim_period;
2675 } 2676 }
2676 } 2677 }
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e24ff38606a9..0f38f43ac62e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1035,7 +1035,7 @@ u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
1035 1035
1036void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 1036void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1037 u16 transaction, u16 auth_alg, u16 status, 1037 u16 transaction, u16 auth_alg, u16 status,
1038 u8 *extra, size_t extra_len, const u8 *da, 1038 const u8 *extra, size_t extra_len, const u8 *da,
1039 const u8 *bssid, const u8 *key, u8 key_len, u8 key_idx, 1039 const u8 *bssid, const u8 *key, u8 key_len, u8 key_idx,
1040 u32 tx_flags) 1040 u32 tx_flags)
1041{ 1041{
@@ -1947,7 +1947,7 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1947} 1947}
1948 1948
1949void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan, 1949void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan,
1950 struct ieee80211_ht_operation *ht_oper, 1950 const struct ieee80211_ht_operation *ht_oper,
1951 struct cfg80211_chan_def *chandef) 1951 struct cfg80211_chan_def *chandef)
1952{ 1952{
1953 enum nl80211_channel_type channel_type; 1953 enum nl80211_channel_type channel_type;
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index a9549fcc5a04..a2c2258bc84e 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -13,10 +13,11 @@
13#include "rate.h" 13#include "rate.h"
14 14
15 15
16void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, 16void
17 struct ieee80211_supported_band *sband, 17ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
18 struct ieee80211_vht_cap *vht_cap_ie, 18 struct ieee80211_supported_band *sband,
19 struct sta_info *sta) 19 const struct ieee80211_vht_cap *vht_cap_ie,
20 struct sta_info *sta)
20{ 21{
21 struct ieee80211_sta_vht_cap *vht_cap = &sta->sta.vht_cap; 22 struct ieee80211_sta_vht_cap *vht_cap = &sta->sta.vht_cap;
22 23