diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2009-10-13 07:28:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:16 -0400 |
commit | ce470613cdfde70f25419cc52a4816315825f5d9 (patch) | |
tree | 0b5d002515bdf4fc34452eb836c57278f27a826b /net | |
parent | b54853f1b157a173fe5ac9145623670c66a9e7b9 (diff) |
cfg80211: no cookies in cfg80211_send_XXX()
Get rid of cookies in cfg80211_send_XXX() functions.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 18 | ||||
-rw-r--r-- | net/wireless/mlme.c | 39 |
2 files changed, 23 insertions, 34 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 8d26e9bf8964..33a696f5f305 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -458,9 +458,15 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, | |||
458 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); | 458 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); |
459 | 459 | ||
460 | if (stype == IEEE80211_STYPE_DEAUTH) | 460 | if (stype == IEEE80211_STYPE_DEAUTH) |
461 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, cookie); | 461 | if (cookie) |
462 | __cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); | ||
463 | else | ||
464 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); | ||
462 | else | 465 | else |
463 | cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len, cookie); | 466 | if (cookie) |
467 | __cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len); | ||
468 | else | ||
469 | cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len); | ||
464 | ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); | 470 | ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); |
465 | } | 471 | } |
466 | 472 | ||
@@ -1959,12 +1965,10 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
1959 | /* no action */ | 1965 | /* no action */ |
1960 | break; | 1966 | break; |
1961 | case RX_MGMT_CFG80211_DEAUTH: | 1967 | case RX_MGMT_CFG80211_DEAUTH: |
1962 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, | 1968 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); |
1963 | NULL); | ||
1964 | break; | 1969 | break; |
1965 | case RX_MGMT_CFG80211_DISASSOC: | 1970 | case RX_MGMT_CFG80211_DISASSOC: |
1966 | cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len, | 1971 | cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len); |
1967 | NULL); | ||
1968 | break; | 1972 | break; |
1969 | default: | 1973 | default: |
1970 | WARN(1, "unexpected: %d", rma); | 1974 | WARN(1, "unexpected: %d", rma); |
@@ -2019,7 +2023,7 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
2019 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len); | 2023 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len); |
2020 | break; | 2024 | break; |
2021 | case RX_MGMT_CFG80211_DEAUTH: | 2025 | case RX_MGMT_CFG80211_DEAUTH: |
2022 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, NULL); | 2026 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); |
2023 | break; | 2027 | break; |
2024 | default: | 2028 | default: |
2025 | WARN(1, "unexpected: %d", rma); | 2029 | WARN(1, "unexpected: %d", rma); |
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index ceb2c14c8f47..a13a71205240 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -121,7 +121,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len) | |||
121 | } | 121 | } |
122 | EXPORT_SYMBOL(cfg80211_send_rx_assoc); | 122 | EXPORT_SYMBOL(cfg80211_send_rx_assoc); |
123 | 123 | ||
124 | static void __cfg80211_send_deauth(struct net_device *dev, | 124 | void __cfg80211_send_deauth(struct net_device *dev, |
125 | const u8 *buf, size_t len) | 125 | const u8 *buf, size_t len) |
126 | { | 126 | { |
127 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 127 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
@@ -177,27 +177,19 @@ static void __cfg80211_send_deauth(struct net_device *dev, | |||
177 | false, NULL); | 177 | false, NULL); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | EXPORT_SYMBOL(__cfg80211_send_deauth); | ||
180 | 181 | ||
181 | 182 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len) | |
182 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, | ||
183 | void *cookie) | ||
184 | { | 183 | { |
185 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 184 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
186 | 185 | ||
187 | BUG_ON(cookie && wdev != cookie); | 186 | wdev_lock(wdev); |
188 | 187 | __cfg80211_send_deauth(dev, buf, len); | |
189 | if (cookie) { | 188 | wdev_unlock(wdev); |
190 | /* called within callback */ | ||
191 | __cfg80211_send_deauth(dev, buf, len); | ||
192 | } else { | ||
193 | wdev_lock(wdev); | ||
194 | __cfg80211_send_deauth(dev, buf, len); | ||
195 | wdev_unlock(wdev); | ||
196 | } | ||
197 | } | 189 | } |
198 | EXPORT_SYMBOL(cfg80211_send_deauth); | 190 | EXPORT_SYMBOL(cfg80211_send_deauth); |
199 | 191 | ||
200 | static void __cfg80211_send_disassoc(struct net_device *dev, | 192 | void __cfg80211_send_disassoc(struct net_device *dev, |
201 | const u8 *buf, size_t len) | 193 | const u8 *buf, size_t len) |
202 | { | 194 | { |
203 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 195 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
@@ -238,22 +230,15 @@ static void __cfg80211_send_disassoc(struct net_device *dev, | |||
238 | from_ap = memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0; | 230 | from_ap = memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0; |
239 | __cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap); | 231 | __cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap); |
240 | } | 232 | } |
233 | EXPORT_SYMBOL(__cfg80211_send_disassoc); | ||
241 | 234 | ||
242 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, | 235 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len) |
243 | void *cookie) | ||
244 | { | 236 | { |
245 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 237 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
246 | 238 | ||
247 | BUG_ON(cookie && wdev != cookie); | 239 | wdev_lock(wdev); |
248 | 240 | __cfg80211_send_disassoc(dev, buf, len); | |
249 | if (cookie) { | 241 | wdev_unlock(wdev); |
250 | /* called within callback */ | ||
251 | __cfg80211_send_disassoc(dev, buf, len); | ||
252 | } else { | ||
253 | wdev_lock(wdev); | ||
254 | __cfg80211_send_disassoc(dev, buf, len); | ||
255 | wdev_unlock(wdev); | ||
256 | } | ||
257 | } | 242 | } |
258 | EXPORT_SYMBOL(cfg80211_send_disassoc); | 243 | EXPORT_SYMBOL(cfg80211_send_disassoc); |
259 | 244 | ||