diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-05-19 11:53:16 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-05-19 11:53:16 -0400 |
commit | c1e5f4714d591cc0a5e986613fdefa61abe98ac2 (patch) | |
tree | 41e8b20e1c93e142f5dfbca513fbb770445102c6 | |
parent | 3b3a0162fade6b83d5c83efafcd5adb9e4537047 (diff) |
cfg80211: constify more pointers in the cfg80211 API
This also propagates through the drivers.
The orinoco driver uses the cfg80211 API structs for internal
bookkeeping, and so needs a (void *) cast that removes the
const - but that's OK because it allocates those pointers.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/defs.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/wext.c | 4 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/cfg80211.c | 2 | ||||
-rw-r--r-- | include/net/cfg80211.h | 23 | ||||
-rw-r--r-- | net/wireless/ibss.c | 2 | ||||
-rw-r--r-- | net/wireless/sme.c | 2 | ||||
-rw-r--r-- | net/wireless/util.c | 3 |
12 files changed, 29 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 8b4ce28e3ce8..051094604e21 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -2322,7 +2322,7 @@ int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index, | |||
2322 | return ret; | 2322 | return ret; |
2323 | } | 2323 | } |
2324 | 2324 | ||
2325 | int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, u8 *krk) | 2325 | int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, const u8 *krk) |
2326 | { | 2326 | { |
2327 | struct sk_buff *skb; | 2327 | struct sk_buff *skb; |
2328 | struct wmi_add_krk_cmd *cmd; | 2328 | struct wmi_add_krk_cmd *cmd; |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index b5f226503baf..39ee35e60c1d 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h | |||
@@ -2617,7 +2617,7 @@ int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index, | |||
2617 | u8 *key_material, | 2617 | u8 *key_material, |
2618 | u8 key_op_ctrl, u8 *mac_addr, | 2618 | u8 key_op_ctrl, u8 *mac_addr, |
2619 | enum wmi_sync_flag sync_flag); | 2619 | enum wmi_sync_flag sync_flag); |
2620 | int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, u8 *krk); | 2620 | int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, const u8 *krk); |
2621 | int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index); | 2621 | int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index); |
2622 | int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid, | 2622 | int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid, |
2623 | const u8 *pmkid, bool set); | 2623 | const u8 *pmkid, bool set); |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index e4d7031df05c..47a998d8f99e 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -1006,9 +1006,8 @@ struct cmd_key_material { | |||
1006 | } __packed; | 1006 | } __packed; |
1007 | 1007 | ||
1008 | static int lbs_set_key_material(struct lbs_private *priv, | 1008 | static int lbs_set_key_material(struct lbs_private *priv, |
1009 | int key_type, | 1009 | int key_type, int key_info, |
1010 | int key_info, | 1010 | const u8 *key, u16 key_len) |
1011 | u8 *key, u16 key_len) | ||
1012 | { | 1011 | { |
1013 | struct cmd_key_material cmd; | 1012 | struct cmd_key_material cmd; |
1014 | int ret; | 1013 | int ret; |
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h index ab966f08024a..407784aca627 100644 --- a/drivers/net/wireless/libertas/defs.h +++ b/drivers/net/wireless/libertas/defs.h | |||
@@ -90,7 +90,8 @@ do { if ((lbs_debug & (grp)) == (grp)) \ | |||
90 | #define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args) | 90 | #define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args) |
91 | 91 | ||
92 | #ifdef DEBUG | 92 | #ifdef DEBUG |
93 | static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len) | 93 | static inline void lbs_deb_hex(unsigned int grp, const char *prompt, |
94 | const u8 *buf, int len) | ||
94 | { | 95 | { |
95 | int i = 0; | 96 | int i = 0; |
96 | 97 | ||
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 49300d04efdf..e27e32851f1e 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -988,8 +988,8 @@ int __orinoco_hw_setup_enc(struct orinoco_private *priv) | |||
988 | * tsc must be NULL or up to 8 bytes | 988 | * tsc must be NULL or up to 8 bytes |
989 | */ | 989 | */ |
990 | int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, | 990 | int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, |
991 | int set_tx, u8 *key, u8 *rsc, size_t rsc_len, | 991 | int set_tx, const u8 *key, const u8 *rsc, |
992 | u8 *tsc, size_t tsc_len) | 992 | size_t rsc_len, const u8 *tsc, size_t tsc_len) |
993 | { | 993 | { |
994 | struct { | 994 | struct { |
995 | __le16 idx; | 995 | __le16 idx; |
diff --git a/drivers/net/wireless/orinoco/hw.h b/drivers/net/wireless/orinoco/hw.h index 8f6831f4e328..466d1ede76f1 100644 --- a/drivers/net/wireless/orinoco/hw.h +++ b/drivers/net/wireless/orinoco/hw.h | |||
@@ -38,8 +38,8 @@ int __orinoco_hw_set_wap(struct orinoco_private *priv); | |||
38 | int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv); | 38 | int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv); |
39 | int __orinoco_hw_setup_enc(struct orinoco_private *priv); | 39 | int __orinoco_hw_setup_enc(struct orinoco_private *priv); |
40 | int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, | 40 | int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, |
41 | int set_tx, u8 *key, u8 *rsc, size_t rsc_len, | 41 | int set_tx, const u8 *key, const u8 *rsc, |
42 | u8 *tsc, size_t tsc_len); | 42 | size_t rsc_len, const u8 *tsc, size_t tsc_len); |
43 | int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx); | 43 | int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx); |
44 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, | 44 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, |
45 | struct net_device *dev, | 45 | struct net_device *dev, |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index b7a867b50b94..6abdaf0aa052 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -52,9 +52,9 @@ static int orinoco_set_key(struct orinoco_private *priv, int index, | |||
52 | priv->keys[index].seq_len = seq_len; | 52 | priv->keys[index].seq_len = seq_len; |
53 | 53 | ||
54 | if (key_len) | 54 | if (key_len) |
55 | memcpy(priv->keys[index].key, key, key_len); | 55 | memcpy((void *)priv->keys[index].key, key, key_len); |
56 | if (seq_len) | 56 | if (seq_len) |
57 | memcpy(priv->keys[index].seq, seq, seq_len); | 57 | memcpy((void *)priv->keys[index].seq, seq, seq_len); |
58 | 58 | ||
59 | switch (alg) { | 59 | switch (alg) { |
60 | case ORINOCO_ALG_TKIP: | 60 | case ORINOCO_ALG_TKIP: |
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index f7eb8163d4fb..723319ee08f3 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c | |||
@@ -84,7 +84,7 @@ static int prism2_domibset_uint32(wlandevice_t *wlandev, u32 did, u32 data) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | static int prism2_domibset_pstr32(wlandevice_t *wlandev, | 86 | static int prism2_domibset_pstr32(wlandevice_t *wlandev, |
87 | u32 did, u8 len, u8 *data) | 87 | u32 did, u8 len, const u8 *data) |
88 | { | 88 | { |
89 | struct p80211msg_dot11req_mibset msg; | 89 | struct p80211msg_dot11req_mibset msg; |
90 | p80211item_pstr32_t *mibitem = | 90 | p80211item_pstr32_t *mibitem = |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index d4a602b92edf..3299d1b731ef 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -341,8 +341,8 @@ struct vif_params { | |||
341 | * @seq_len: length of @seq. | 341 | * @seq_len: length of @seq. |
342 | */ | 342 | */ |
343 | struct key_params { | 343 | struct key_params { |
344 | u8 *key; | 344 | const u8 *key; |
345 | u8 *seq; | 345 | const u8 *seq; |
346 | int key_len; | 346 | int key_len; |
347 | int seq_len; | 347 | int seq_len; |
348 | u32 cipher; | 348 | u32 cipher; |
@@ -1169,7 +1169,7 @@ struct bss_parameters { | |||
1169 | int use_cts_prot; | 1169 | int use_cts_prot; |
1170 | int use_short_preamble; | 1170 | int use_short_preamble; |
1171 | int use_short_slot_time; | 1171 | int use_short_slot_time; |
1172 | u8 *basic_rates; | 1172 | const u8 *basic_rates; |
1173 | u8 basic_rates_len; | 1173 | u8 basic_rates_len; |
1174 | int ap_isolate; | 1174 | int ap_isolate; |
1175 | int ht_opmode; | 1175 | int ht_opmode; |
@@ -1699,10 +1699,10 @@ struct cfg80211_disassoc_request { | |||
1699 | * @ht_capa_mask: The bits of ht_capa which are to be used. | 1699 | * @ht_capa_mask: The bits of ht_capa which are to be used. |
1700 | */ | 1700 | */ |
1701 | struct cfg80211_ibss_params { | 1701 | struct cfg80211_ibss_params { |
1702 | u8 *ssid; | 1702 | const u8 *ssid; |
1703 | u8 *bssid; | 1703 | const u8 *bssid; |
1704 | struct cfg80211_chan_def chandef; | 1704 | struct cfg80211_chan_def chandef; |
1705 | u8 *ie; | 1705 | const u8 *ie; |
1706 | u8 ssid_len, ie_len; | 1706 | u8 ssid_len, ie_len; |
1707 | u16 beacon_interval; | 1707 | u16 beacon_interval; |
1708 | u32 basic_rates; | 1708 | u32 basic_rates; |
@@ -1811,8 +1811,8 @@ struct cfg80211_bitrate_mask { | |||
1811 | * @pmkid: The PMK material itself. | 1811 | * @pmkid: The PMK material itself. |
1812 | */ | 1812 | */ |
1813 | struct cfg80211_pmksa { | 1813 | struct cfg80211_pmksa { |
1814 | u8 *bssid; | 1814 | const u8 *bssid; |
1815 | u8 *pmkid; | 1815 | const u8 *pmkid; |
1816 | }; | 1816 | }; |
1817 | 1817 | ||
1818 | /** | 1818 | /** |
@@ -3289,7 +3289,7 @@ struct wireless_dev { | |||
3289 | struct cfg80211_ibss_params ibss; | 3289 | struct cfg80211_ibss_params ibss; |
3290 | struct cfg80211_connect_params connect; | 3290 | struct cfg80211_connect_params connect; |
3291 | struct cfg80211_cached_keys *keys; | 3291 | struct cfg80211_cached_keys *keys; |
3292 | u8 *ie; | 3292 | const u8 *ie; |
3293 | size_t ie_len; | 3293 | size_t ie_len; |
3294 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | 3294 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; |
3295 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 3295 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
@@ -3530,7 +3530,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, | |||
3530 | * Return: 0 on success, or a negative error code. | 3530 | * Return: 0 on success, or a negative error code. |
3531 | */ | 3531 | */ |
3532 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | 3532 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, |
3533 | enum nl80211_iftype iftype, u8 *bssid, bool qos); | 3533 | enum nl80211_iftype iftype, const u8 *bssid, |
3534 | bool qos); | ||
3534 | 3535 | ||
3535 | /** | 3536 | /** |
3536 | * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame | 3537 | * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame |
@@ -4319,7 +4320,7 @@ void cfg80211_roamed_bss(struct net_device *dev, struct cfg80211_bss *bss, | |||
4319 | * and not try to connect to any AP any more. | 4320 | * and not try to connect to any AP any more. |
4320 | */ | 4321 | */ |
4321 | void cfg80211_disconnected(struct net_device *dev, u16 reason, | 4322 | void cfg80211_disconnected(struct net_device *dev, u16 reason, |
4322 | u8 *ie, size_t ie_len, gfp_t gfp); | 4323 | const u8 *ie, size_t ie_len, gfp_t gfp); |
4323 | 4324 | ||
4324 | /** | 4325 | /** |
4325 | * cfg80211_ready_on_channel - notification of remain_on_channel start | 4326 | * cfg80211_ready_on_channel - notification of remain_on_channel start |
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 6b50588b709f..8f345da3ea5f 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -420,8 +420,8 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev, | |||
420 | if (len > 0 && ssid[len - 1] == '\0') | 420 | if (len > 0 && ssid[len - 1] == '\0') |
421 | len--; | 421 | len--; |
422 | 422 | ||
423 | memcpy(wdev->ssid, ssid, len); | ||
423 | wdev->wext.ibss.ssid = wdev->ssid; | 424 | wdev->wext.ibss.ssid = wdev->ssid; |
424 | memcpy(wdev->wext.ibss.ssid, ssid, len); | ||
425 | wdev->wext.ibss.ssid_len = len; | 425 | wdev->wext.ibss.ssid_len = len; |
426 | 426 | ||
427 | wdev_lock(wdev); | 427 | wdev_lock(wdev); |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 4bc21a2b1989..ea701bbacc6a 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -879,7 +879,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, | |||
879 | } | 879 | } |
880 | 880 | ||
881 | void cfg80211_disconnected(struct net_device *dev, u16 reason, | 881 | void cfg80211_disconnected(struct net_device *dev, u16 reason, |
882 | u8 *ie, size_t ie_len, gfp_t gfp) | 882 | const u8 *ie, size_t ie_len, gfp_t gfp) |
883 | { | 883 | { |
884 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 884 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
885 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); | 885 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 8c61d5c6fad3..fa61ac9c9b26 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -476,7 +476,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, | |||
476 | EXPORT_SYMBOL(ieee80211_data_to_8023); | 476 | EXPORT_SYMBOL(ieee80211_data_to_8023); |
477 | 477 | ||
478 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | 478 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, |
479 | enum nl80211_iftype iftype, u8 *bssid, bool qos) | 479 | enum nl80211_iftype iftype, |
480 | const u8 *bssid, bool qos) | ||
480 | { | 481 | { |
481 | struct ieee80211_hdr hdr; | 482 | struct ieee80211_hdr hdr; |
482 | u16 hdrlen, ethertype; | 483 | u16 hdrlen, ethertype; |