diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-16 17:23:36 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-03-30 04:17:11 -0400 |
commit | d0d1a12f9cc665f3fcac5288ab84429a91abd4e9 (patch) | |
tree | 41f02d2b43570ffda1f3db3302dfe45f748d9e07 /net | |
parent | a9409093d23c822d13a73f8d2df7e6fa987ae485 (diff) |
mac80211: notify the driver about association status
This can allow the driver to take action based on the
success / failure of the association.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7865998d69dd..b6817c4c4449 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3041,6 +3041,10 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
3041 | u8 *pos; | 3041 | u8 *pos; |
3042 | bool reassoc; | 3042 | bool reassoc; |
3043 | struct cfg80211_bss *bss; | 3043 | struct cfg80211_bss *bss; |
3044 | struct ieee80211_event event = { | ||
3045 | .type = MLME_EVENT, | ||
3046 | .u.mlme.data = ASSOC_EVENT, | ||
3047 | }; | ||
3044 | 3048 | ||
3045 | sdata_assert_lock(sdata); | 3049 | sdata_assert_lock(sdata); |
3046 | 3050 | ||
@@ -3092,6 +3096,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
3092 | sdata_info(sdata, "%pM denied association (code=%d)\n", | 3096 | sdata_info(sdata, "%pM denied association (code=%d)\n", |
3093 | mgmt->sa, status_code); | 3097 | mgmt->sa, status_code); |
3094 | ieee80211_destroy_assoc_data(sdata, false); | 3098 | ieee80211_destroy_assoc_data(sdata, false); |
3099 | event.u.mlme.status = MLME_DENIED; | ||
3100 | event.u.mlme.reason = status_code; | ||
3101 | drv_event_callback(sdata->local, sdata, &event); | ||
3095 | } else { | 3102 | } else { |
3096 | if (!ieee80211_assoc_success(sdata, bss, mgmt, len)) { | 3103 | if (!ieee80211_assoc_success(sdata, bss, mgmt, len)) { |
3097 | /* oops -- internal error -- send timeout for now */ | 3104 | /* oops -- internal error -- send timeout for now */ |
@@ -3099,6 +3106,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
3099 | cfg80211_assoc_timeout(sdata->dev, bss); | 3106 | cfg80211_assoc_timeout(sdata->dev, bss); |
3100 | return; | 3107 | return; |
3101 | } | 3108 | } |
3109 | event.u.mlme.status = MLME_SUCCESS; | ||
3110 | drv_event_callback(sdata->local, sdata, &event); | ||
3102 | sdata_info(sdata, "associated\n"); | 3111 | sdata_info(sdata, "associated\n"); |
3103 | 3112 | ||
3104 | /* | 3113 | /* |
@@ -3835,9 +3844,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3835 | if ((ifmgd->assoc_data->need_beacon && !ifmgd->have_beacon) || | 3844 | if ((ifmgd->assoc_data->need_beacon && !ifmgd->have_beacon) || |
3836 | ieee80211_do_assoc(sdata)) { | 3845 | ieee80211_do_assoc(sdata)) { |
3837 | struct cfg80211_bss *bss = ifmgd->assoc_data->bss; | 3846 | struct cfg80211_bss *bss = ifmgd->assoc_data->bss; |
3847 | struct ieee80211_event event = { | ||
3848 | .type = MLME_EVENT, | ||
3849 | .u.mlme.data = ASSOC_EVENT, | ||
3850 | .u.mlme.status = MLME_TIMEOUT, | ||
3851 | }; | ||
3838 | 3852 | ||
3839 | ieee80211_destroy_assoc_data(sdata, false); | 3853 | ieee80211_destroy_assoc_data(sdata, false); |
3840 | cfg80211_assoc_timeout(sdata->dev, bss); | 3854 | cfg80211_assoc_timeout(sdata->dev, bss); |
3855 | drv_event_callback(sdata->local, sdata, &event); | ||
3841 | } | 3856 | } |
3842 | } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started) | 3857 | } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started) |
3843 | run_again(sdata, ifmgd->assoc_data->timeout); | 3858 | run_again(sdata, ifmgd->assoc_data->timeout); |