aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-05-15 11:44:01 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-05-24 18:02:20 -0400
commit91bf9b26fc95c505846bc2f744a73b51f2aaee1d (patch)
tree0a8cad8fa49ccb5f4899446ce78d183d50d377af /net/wireless/nl80211.c
parent38fd2143fa653f80729800c1d61d4207b91dca42 (diff)
cfg80211: remove some locked wrappers from mlme API
By making all the API functions require wdev locking we can clean up the API a bit, getting rid of the locking version of each function. This also decreases the size of cfg80211 by a small amount. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 74cdb1a0cf31..49c2f2f511dc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5904,10 +5904,13 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
5904 if (local_state_change) 5904 if (local_state_change)
5905 return 0; 5905 return 0;
5906 5906
5907 return cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid, 5907 wdev_lock(dev->ieee80211_ptr);
5908 ssid, ssid_len, ie, ie_len, 5908 err = cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
5909 key.p.key, key.p.key_len, key.idx, 5909 ssid, ssid_len, ie, ie_len,
5910 sae_data, sae_data_len); 5910 key.p.key, key.p.key_len, key.idx,
5911 sae_data, sae_data_len);
5912 wdev_unlock(dev->ieee80211_ptr);
5913 return err;
5911} 5914}
5912 5915
5913static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, 5916static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
@@ -6074,9 +6077,12 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
6074 } 6077 }
6075 6078
6076 err = nl80211_crypto_settings(rdev, info, &req.crypto, 1); 6079 err = nl80211_crypto_settings(rdev, info, &req.crypto, 1);
6077 if (!err) 6080 if (!err) {
6081 wdev_lock(dev->ieee80211_ptr);
6078 err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, 6082 err = cfg80211_mlme_assoc(rdev, dev, chan, bssid,
6079 ssid, ssid_len, &req); 6083 ssid, ssid_len, &req);
6084 wdev_unlock(dev->ieee80211_ptr);
6085 }
6080 6086
6081 return err; 6087 return err;
6082} 6088}
@@ -6086,7 +6092,7 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
6086 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 6092 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6087 struct net_device *dev = info->user_ptr[1]; 6093 struct net_device *dev = info->user_ptr[1];
6088 const u8 *ie = NULL, *bssid; 6094 const u8 *ie = NULL, *bssid;
6089 int ie_len = 0; 6095 int ie_len = 0, err;
6090 u16 reason_code; 6096 u16 reason_code;
6091 bool local_state_change; 6097 bool local_state_change;
6092 6098
@@ -6121,8 +6127,11 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
6121 6127
6122 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE]; 6128 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE];
6123 6129
6124 return cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code, 6130 wdev_lock(dev->ieee80211_ptr);
6125 local_state_change); 6131 err = cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code,
6132 local_state_change);
6133 wdev_unlock(dev->ieee80211_ptr);
6134 return err;
6126} 6135}
6127 6136
6128static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info) 6137static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
@@ -6130,7 +6139,7 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
6130 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 6139 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6131 struct net_device *dev = info->user_ptr[1]; 6140 struct net_device *dev = info->user_ptr[1];
6132 const u8 *ie = NULL, *bssid; 6141 const u8 *ie = NULL, *bssid;
6133 int ie_len = 0; 6142 int ie_len = 0, err;
6134 u16 reason_code; 6143 u16 reason_code;
6135 bool local_state_change; 6144 bool local_state_change;
6136 6145
@@ -6165,8 +6174,11 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
6165 6174
6166 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE]; 6175 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE];
6167 6176
6168 return cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code, 6177 wdev_lock(dev->ieee80211_ptr);
6169 local_state_change); 6178 err = cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code,
6179 local_state_change);
6180 wdev_unlock(dev->ieee80211_ptr);
6181 return err;
6170} 6182}
6171 6183
6172static bool 6184static bool