diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-16 17:23:35 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-03-30 04:17:10 -0400 |
commit | a9409093d23c822d13a73f8d2df7e6fa987ae485 (patch) | |
tree | 55cb607c2b20ae7338e5abfdd6f0b9dd14b88c21 /net/mac80211/mlme.c | |
parent | a818292952bbfad12ec5a32ab01330cb1ceed013 (diff) |
mac80211: notify the driver about authentication status
This can allow the driver to take action based on the
success / failure of the authentication.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-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 a8c8fe4c9f49..7865998d69dd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2495,6 +2495,10 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, | |||
2495 | u8 bssid[ETH_ALEN]; | 2495 | u8 bssid[ETH_ALEN]; |
2496 | u16 auth_alg, auth_transaction, status_code; | 2496 | u16 auth_alg, auth_transaction, status_code; |
2497 | struct sta_info *sta; | 2497 | struct sta_info *sta; |
2498 | struct ieee80211_event event = { | ||
2499 | .type = MLME_EVENT, | ||
2500 | .u.mlme.data = AUTH_EVENT, | ||
2501 | }; | ||
2498 | 2502 | ||
2499 | sdata_assert_lock(sdata); | 2503 | sdata_assert_lock(sdata); |
2500 | 2504 | ||
@@ -2527,6 +2531,9 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, | |||
2527 | mgmt->sa, status_code); | 2531 | mgmt->sa, status_code); |
2528 | ieee80211_destroy_auth_data(sdata, false); | 2532 | ieee80211_destroy_auth_data(sdata, false); |
2529 | cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len); | 2533 | cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len); |
2534 | event.u.mlme.status = MLME_DENIED; | ||
2535 | event.u.mlme.reason = status_code; | ||
2536 | drv_event_callback(sdata->local, sdata, &event); | ||
2530 | return; | 2537 | return; |
2531 | } | 2538 | } |
2532 | 2539 | ||
@@ -2549,6 +2556,8 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, | |||
2549 | return; | 2556 | return; |
2550 | } | 2557 | } |
2551 | 2558 | ||
2559 | event.u.mlme.status = MLME_SUCCESS; | ||
2560 | drv_event_callback(sdata->local, sdata, &event); | ||
2552 | sdata_info(sdata, "authenticated\n"); | 2561 | sdata_info(sdata, "authenticated\n"); |
2553 | ifmgd->auth_data->done = true; | 2562 | ifmgd->auth_data->done = true; |
2554 | ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC; | 2563 | ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC; |
@@ -3805,12 +3814,18 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3805 | ieee80211_destroy_auth_data(sdata, false); | 3814 | ieee80211_destroy_auth_data(sdata, false); |
3806 | } else if (ieee80211_probe_auth(sdata)) { | 3815 | } else if (ieee80211_probe_auth(sdata)) { |
3807 | u8 bssid[ETH_ALEN]; | 3816 | u8 bssid[ETH_ALEN]; |
3817 | struct ieee80211_event event = { | ||
3818 | .type = MLME_EVENT, | ||
3819 | .u.mlme.data = AUTH_EVENT, | ||
3820 | .u.mlme.status = MLME_TIMEOUT, | ||
3821 | }; | ||
3808 | 3822 | ||
3809 | memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN); | 3823 | memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN); |
3810 | 3824 | ||
3811 | ieee80211_destroy_auth_data(sdata, false); | 3825 | ieee80211_destroy_auth_data(sdata, false); |
3812 | 3826 | ||
3813 | cfg80211_auth_timeout(sdata->dev, bssid); | 3827 | cfg80211_auth_timeout(sdata->dev, bssid); |
3828 | drv_event_callback(sdata->local, sdata, &event); | ||
3814 | } | 3829 | } |
3815 | } else if (ifmgd->auth_data && ifmgd->auth_data->timeout_started) | 3830 | } else if (ifmgd->auth_data && ifmgd->auth_data->timeout_started) |
3816 | run_again(sdata, ifmgd->auth_data->timeout); | 3831 | run_again(sdata, ifmgd->auth_data->timeout); |