aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-03-27 14:53:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:28 -0400
commit53b46b8444f600cc1744521ea096ea0c5d494dd0 (patch)
tree2f9d3a465a55be2992a8f895c1d09f4cdff3c060
parent1778092e1739155acec35a3bccee2fb8a1ae4e91 (diff)
nl80211: Generate deauth/disassoc event for locally generated frames
Previously, nl80211 mlme events were generated only for received deauthentication and disassociation frames. We need to do the same for locally generated ones in order to let applications know that we disconnected (e.g., when AP does not reply to a probe). Rename the nl80211 and cfg80211 functions (s/rx_//) to make it clearer that they are used for both received and locally generated frames. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/cfg80211.h16
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/wireless/mlme.c13
-rw-r--r--net/wireless/nl80211.c11
-rw-r--r--net/wireless/nl80211.h12
5 files changed, 31 insertions, 29 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d1b8f0d53c57..ec33096fc655 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -917,28 +917,28 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
917void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); 917void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
918 918
919/** 919/**
920 * cfg80211_send_rx_deauth - notification of processed deauthentication 920 * cfg80211_send_deauth - notification of processed deauthentication
921 * @dev: network device 921 * @dev: network device
922 * @buf: deauthentication frame (header + body) 922 * @buf: deauthentication frame (header + body)
923 * @len: length of the frame data 923 * @len: length of the frame data
924 * 924 *
925 * This function is called whenever deauthentication has been processed in 925 * This function is called whenever deauthentication has been processed in
926 * station mode. 926 * station mode. This includes both received deauthentication frames and
927 * locally generated ones.
927 */ 928 */
928void cfg80211_send_rx_deauth(struct net_device *dev, const u8 *buf, 929void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
929 size_t len);
930 930
931/** 931/**
932 * cfg80211_send_rx_disassoc - notification of processed disassociation 932 * cfg80211_send_disassoc - notification of processed disassociation
933 * @dev: network device 933 * @dev: network device
934 * @buf: disassociation response frame (header + body) 934 * @buf: disassociation response frame (header + body)
935 * @len: length of the frame data 935 * @len: length of the frame data
936 * 936 *
937 * This function is called whenever disassociation has been processed in 937 * This function is called whenever disassociation has been processed in
938 * station mode. 938 * station mode. This includes both received disassociation frames and locally
939 * generated ones.
939 */ 940 */
940void cfg80211_send_rx_disassoc(struct net_device *dev, const u8 *buf, 941void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
941 size_t len);
942 942
943/** 943/**
944 * cfg80211_hold_bss - exclude bss from expiration 944 * cfg80211_hold_bss - exclude bss from expiration
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 132938b073dc..08db02c237c9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -325,6 +325,10 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
325 /* u.deauth.reason_code == u.disassoc.reason_code */ 325 /* u.deauth.reason_code == u.disassoc.reason_code */
326 mgmt->u.deauth.reason_code = cpu_to_le16(reason); 326 mgmt->u.deauth.reason_code = cpu_to_le16(reason);
327 327
328 if (stype == IEEE80211_STYPE_DEAUTH)
329 cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, skb->len);
330 else
331 cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, skb->len);
328 ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); 332 ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED);
329} 333}
330 334
@@ -1187,7 +1191,7 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1187 1191
1188 ieee80211_set_disassoc(sdata, true, false, 0); 1192 ieee80211_set_disassoc(sdata, true, false, 0);
1189 ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED; 1193 ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED;
1190 cfg80211_send_rx_deauth(sdata->dev, (u8 *) mgmt, len); 1194 cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, len);
1191} 1195}
1192 1196
1193 1197
@@ -1218,7 +1222,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1218 } 1222 }
1219 1223
1220 ieee80211_set_disassoc(sdata, false, false, reason_code); 1224 ieee80211_set_disassoc(sdata, false, false, reason_code);
1221 cfg80211_send_rx_disassoc(sdata->dev, (u8 *) mgmt, len); 1225 cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, len);
1222} 1226}
1223 1227
1224 1228
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index bec5721b6f99..33ff7cca496b 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -28,19 +28,18 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
28} 28}
29EXPORT_SYMBOL(cfg80211_send_rx_assoc); 29EXPORT_SYMBOL(cfg80211_send_rx_assoc);
30 30
31void cfg80211_send_rx_deauth(struct net_device *dev, const u8 *buf, size_t len) 31void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len)
32{ 32{
33 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 33 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
34 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 34 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
35 nl80211_send_rx_deauth(rdev, dev, buf, len); 35 nl80211_send_deauth(rdev, dev, buf, len);
36} 36}
37EXPORT_SYMBOL(cfg80211_send_rx_deauth); 37EXPORT_SYMBOL(cfg80211_send_deauth);
38 38
39void cfg80211_send_rx_disassoc(struct net_device *dev, const u8 *buf, 39void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len)
40 size_t len)
41{ 40{
42 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 41 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
43 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 42 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
44 nl80211_send_rx_disassoc(rdev, dev, buf, len); 43 nl80211_send_disassoc(rdev, dev, buf, len);
45} 44}
46EXPORT_SYMBOL(cfg80211_send_rx_disassoc); 45EXPORT_SYMBOL(cfg80211_send_disassoc);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c04df6a6af78..195424eee77d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3415,17 +3415,16 @@ void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
3415 nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_ASSOCIATE); 3415 nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_ASSOCIATE);
3416} 3416}
3417 3417
3418void nl80211_send_rx_deauth(struct cfg80211_registered_device *rdev, 3418void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
3419 struct net_device *netdev, const u8 *buf, 3419 struct net_device *netdev, const u8 *buf, size_t len)
3420 size_t len)
3421{ 3420{
3422 nl80211_send_mlme_event(rdev, netdev, buf, len, 3421 nl80211_send_mlme_event(rdev, netdev, buf, len,
3423 NL80211_CMD_DEAUTHENTICATE); 3422 NL80211_CMD_DEAUTHENTICATE);
3424} 3423}
3425 3424
3426void nl80211_send_rx_disassoc(struct cfg80211_registered_device *rdev, 3425void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
3427 struct net_device *netdev, const u8 *buf, 3426 struct net_device *netdev, const u8 *buf,
3428 size_t len) 3427 size_t len)
3429{ 3428{
3430 nl80211_send_mlme_event(rdev, netdev, buf, len, 3429 nl80211_send_mlme_event(rdev, netdev, buf, len,
3431 NL80211_CMD_DISASSOCIATE); 3430 NL80211_CMD_DISASSOCIATE);
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index b77af4ab80be..55686fc264f0 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -17,11 +17,11 @@ extern void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
17extern void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev, 17extern void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
18 struct net_device *netdev, 18 struct net_device *netdev,
19 const u8 *buf, size_t len); 19 const u8 *buf, size_t len);
20extern void nl80211_send_rx_deauth(struct cfg80211_registered_device *rdev, 20extern void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
21 struct net_device *netdev, 21 struct net_device *netdev,
22 const u8 *buf, size_t len); 22 const u8 *buf, size_t len);
23extern void nl80211_send_rx_disassoc(struct cfg80211_registered_device *rdev, 23extern void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
24 struct net_device *netdev, 24 struct net_device *netdev,
25 const u8 *buf, size_t len); 25 const u8 *buf, size_t len);
26 26
27#endif /* __NET_WIRELESS_NL80211_H */ 27#endif /* __NET_WIRELESS_NL80211_H */