diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-09-01 09:14:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-01 12:48:27 -0400 |
commit | de15fd31fcabb4b81a556736dd67ec4f71462f07 (patch) | |
tree | 8ed270f543c6518beb732642022ebf1eacefd45f | |
parent | d041811d931d4f515fd58e222757cbc7d6375db4 (diff) |
iwmc3200wifi: use cfg80211_roamed to send roam event
The device sends connection terminated and [re]association success
(or failure) events when roaming occours. The patch uses
cfg80211_roamed instead of cfg80211_connect_result to notify SME
for roaming.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/cfg80211.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/commands.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/iwm.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/rx.c | 26 |
4 files changed, 23 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c index 2784b089f491..a56a2b0ac99a 100644 --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c | |||
@@ -673,7 +673,7 @@ static int iwm_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, | |||
673 | IWM_DBG_WEXT(iwm, DBG, "Active: %d\n", iwm->umac_profile_active); | 673 | IWM_DBG_WEXT(iwm, DBG, "Active: %d\n", iwm->umac_profile_active); |
674 | 674 | ||
675 | if (iwm->umac_profile_active) | 675 | if (iwm->umac_profile_active) |
676 | return iwm_invalidate_mlme_profile(iwm); | 676 | iwm_invalidate_mlme_profile(iwm); |
677 | 677 | ||
678 | return 0; | 678 | return 0; |
679 | } | 679 | } |
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index a68a2aff3c1e..23b52fa2605f 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c | |||
@@ -756,6 +756,7 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm) | |||
756 | return ret; | 756 | return ret; |
757 | } | 757 | } |
758 | 758 | ||
759 | set_bit(IWM_STATUS_SME_CONNECTING, &iwm->status); | ||
759 | return 0; | 760 | return 0; |
760 | } | 761 | } |
761 | 762 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/iwm.h b/drivers/net/wireless/iwmc3200wifi/iwm.h index 7a51bc340fda..f054cc828d8d 100644 --- a/drivers/net/wireless/iwmc3200wifi/iwm.h +++ b/drivers/net/wireless/iwmc3200wifi/iwm.h | |||
@@ -175,7 +175,7 @@ struct iwm_key { | |||
175 | #define IWM_STATUS_READY 0 | 175 | #define IWM_STATUS_READY 0 |
176 | #define IWM_STATUS_SCANNING 1 | 176 | #define IWM_STATUS_SCANNING 1 |
177 | #define IWM_STATUS_SCAN_ABORTING 2 | 177 | #define IWM_STATUS_SCAN_ABORTING 2 |
178 | #define IWM_STATUS_ASSOCIATING 3 | 178 | #define IWM_STATUS_SME_CONNECTING 3 |
179 | #define IWM_STATUS_ASSOCIATED 4 | 179 | #define IWM_STATUS_ASSOCIATED 4 |
180 | 180 | ||
181 | struct iwm_tx_queue { | 181 | struct iwm_tx_queue { |
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c index 86079a187eef..9e6f2cd38d60 100644 --- a/drivers/net/wireless/iwmc3200wifi/rx.c +++ b/drivers/net/wireless/iwmc3200wifi/rx.c | |||
@@ -487,8 +487,6 @@ static int iwm_mlme_assoc_start(struct iwm_priv *iwm, u8 *buf, | |||
487 | 487 | ||
488 | start = (struct iwm_umac_notif_assoc_start *)buf; | 488 | start = (struct iwm_umac_notif_assoc_start *)buf; |
489 | 489 | ||
490 | set_bit(IWM_STATUS_ASSOCIATING, &iwm->status); | ||
491 | |||
492 | IWM_DBG_MLME(iwm, INFO, "Association with %pM Started, reason: %d\n", | 490 | IWM_DBG_MLME(iwm, INFO, "Association with %pM Started, reason: %d\n", |
493 | start->bssid, le32_to_cpu(start->roam_reason)); | 491 | start->bssid, le32_to_cpu(start->roam_reason)); |
494 | 492 | ||
@@ -507,14 +505,23 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf, | |||
507 | IWM_DBG_MLME(iwm, INFO, "Association with %pM completed, status: %d\n", | 505 | IWM_DBG_MLME(iwm, INFO, "Association with %pM completed, status: %d\n", |
508 | complete->bssid, complete->status); | 506 | complete->bssid, complete->status); |
509 | 507 | ||
510 | clear_bit(IWM_STATUS_ASSOCIATING, &iwm->status); | ||
511 | |||
512 | switch (le32_to_cpu(complete->status)) { | 508 | switch (le32_to_cpu(complete->status)) { |
513 | case UMAC_ASSOC_COMPLETE_SUCCESS: | 509 | case UMAC_ASSOC_COMPLETE_SUCCESS: |
514 | set_bit(IWM_STATUS_ASSOCIATED, &iwm->status); | 510 | set_bit(IWM_STATUS_ASSOCIATED, &iwm->status); |
515 | memcpy(iwm->bssid, complete->bssid, ETH_ALEN); | 511 | memcpy(iwm->bssid, complete->bssid, ETH_ALEN); |
516 | iwm->channel = complete->channel; | 512 | iwm->channel = complete->channel; |
517 | 513 | ||
514 | /* Internal roaming state, avoid notifying SME. */ | ||
515 | if (!test_and_clear_bit(IWM_STATUS_SME_CONNECTING, &iwm->status) | ||
516 | && iwm->conf.mode == UMAC_MODE_BSS) { | ||
517 | cfg80211_roamed(iwm_to_ndev(iwm), | ||
518 | complete->bssid, | ||
519 | iwm->req_ie, iwm->req_ie_len, | ||
520 | iwm->resp_ie, iwm->resp_ie_len, | ||
521 | GFP_KERNEL); | ||
522 | break; | ||
523 | } | ||
524 | |||
518 | iwm_link_on(iwm); | 525 | iwm_link_on(iwm); |
519 | 526 | ||
520 | if (iwm->conf.mode == UMAC_MODE_IBSS) | 527 | if (iwm->conf.mode == UMAC_MODE_IBSS) |
@@ -531,6 +538,11 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf, | |||
531 | memset(iwm->bssid, 0, ETH_ALEN); | 538 | memset(iwm->bssid, 0, ETH_ALEN); |
532 | iwm->channel = 0; | 539 | iwm->channel = 0; |
533 | 540 | ||
541 | /* Internal roaming state, avoid notifying SME. */ | ||
542 | if (!test_and_clear_bit(IWM_STATUS_SME_CONNECTING, &iwm->status) | ||
543 | && iwm->conf.mode == UMAC_MODE_BSS) | ||
544 | break; | ||
545 | |||
534 | iwm_link_off(iwm); | 546 | iwm_link_off(iwm); |
535 | 547 | ||
536 | if (iwm->conf.mode == UMAC_MODE_IBSS) | 548 | if (iwm->conf.mode == UMAC_MODE_IBSS) |
@@ -540,6 +552,7 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf, | |||
540 | NULL, 0, NULL, 0, | 552 | NULL, 0, NULL, 0, |
541 | WLAN_STATUS_UNSPECIFIED_FAILURE, | 553 | WLAN_STATUS_UNSPECIFIED_FAILURE, |
542 | GFP_KERNEL); | 554 | GFP_KERNEL); |
555 | break; | ||
543 | default: | 556 | default: |
544 | break; | 557 | break; |
545 | } | 558 | } |
@@ -562,7 +575,7 @@ static int iwm_mlme_profile_invalidate(struct iwm_priv *iwm, u8 *buf, | |||
562 | IWM_DBG_MLME(iwm, INFO, "Profile Invalidated. Reason: %d\n", | 575 | IWM_DBG_MLME(iwm, INFO, "Profile Invalidated. Reason: %d\n", |
563 | le32_to_cpu(invalid->reason)); | 576 | le32_to_cpu(invalid->reason)); |
564 | 577 | ||
565 | clear_bit(IWM_STATUS_ASSOCIATING, &iwm->status); | 578 | clear_bit(IWM_STATUS_SME_CONNECTING, &iwm->status); |
566 | clear_bit(IWM_STATUS_ASSOCIATED, &iwm->status); | 579 | clear_bit(IWM_STATUS_ASSOCIATED, &iwm->status); |
567 | 580 | ||
568 | iwm->umac_profile_active = 0; | 581 | iwm->umac_profile_active = 0; |
@@ -813,7 +826,8 @@ static int iwm_mlme_mgt_frame(struct iwm_priv *iwm, u8 *buf, | |||
813 | iwm->resp_ie = kmemdup(mgt->u.reassoc_resp.variable, | 826 | iwm->resp_ie = kmemdup(mgt->u.reassoc_resp.variable, |
814 | iwm->resp_ie_len, GFP_KERNEL); | 827 | iwm->resp_ie_len, GFP_KERNEL); |
815 | } else { | 828 | } else { |
816 | IWM_ERR(iwm, "Unsupported management frame"); | 829 | IWM_ERR(iwm, "Unsupported management frame: 0x%x", |
830 | cpu_to_le16(mgt->frame_control)); | ||
817 | return 0; | 831 | return 0; |
818 | } | 832 | } |
819 | 833 | ||