diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-07-19 23:47:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:28 -0400 |
commit | b68518fcbc6e0fe8c06a218cd2b92f62f3730cf9 (patch) | |
tree | 220a8125be09c980d03a552db21a0b0385700f6f | |
parent | 3409ff7711bcf70390d5ba8ebde5d913b5266a45 (diff) |
iwmc3200wifi: use cfg80211_connect_result to send req/resp IE
cfg80211_connect_result() let us specify associate request and
response IEs as parameters after we are connected. We use this
capability instead of doing it ourselves with WEXT.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/iwm.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/main.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/rx.c | 36 |
3 files changed, 35 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/iwm.h b/drivers/net/wireless/iwmc3200wifi/iwm.h index 79d9d89d47ae..2175a481d2f4 100644 --- a/drivers/net/wireless/iwmc3200wifi/iwm.h +++ b/drivers/net/wireless/iwmc3200wifi/iwm.h | |||
@@ -281,6 +281,11 @@ struct iwm_priv { | |||
281 | struct work_struct reset_worker; | 281 | struct work_struct reset_worker; |
282 | struct mutex mutex; | 282 | struct mutex mutex; |
283 | 283 | ||
284 | u8 *req_ie; | ||
285 | int req_ie_len; | ||
286 | u8 *resp_ie; | ||
287 | int resp_ie_len; | ||
288 | |||
284 | char private[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 289 | char private[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
285 | }; | 290 | }; |
286 | 291 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/main.c b/drivers/net/wireless/iwmc3200wifi/main.c index 484f110151b7..cf2574442b57 100644 --- a/drivers/net/wireless/iwmc3200wifi/main.c +++ b/drivers/net/wireless/iwmc3200wifi/main.c | |||
@@ -497,6 +497,13 @@ void iwm_link_off(struct iwm_priv *iwm) | |||
497 | memset(wstats, 0, sizeof(struct iw_statistics)); | 497 | memset(wstats, 0, sizeof(struct iw_statistics)); |
498 | wstats->qual.updated = IW_QUAL_ALL_INVALID; | 498 | wstats->qual.updated = IW_QUAL_ALL_INVALID; |
499 | 499 | ||
500 | kfree(iwm->req_ie); | ||
501 | iwm->req_ie = NULL; | ||
502 | iwm->req_ie_len = 0; | ||
503 | kfree(iwm->resp_ie); | ||
504 | iwm->resp_ie = NULL; | ||
505 | iwm->resp_ie_len = 0; | ||
506 | |||
500 | del_timer_sync(&iwm->watchdog); | 507 | del_timer_sync(&iwm->watchdog); |
501 | } | 508 | } |
502 | 509 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c index 82b572a6fc0b..6743391a45be 100644 --- a/drivers/net/wireless/iwmc3200wifi/rx.c +++ b/drivers/net/wireless/iwmc3200wifi/rx.c | |||
@@ -519,7 +519,8 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf, | |||
519 | 519 | ||
520 | cfg80211_connect_result(iwm_to_ndev(iwm), | 520 | cfg80211_connect_result(iwm_to_ndev(iwm), |
521 | complete->bssid, | 521 | complete->bssid, |
522 | NULL, 0, NULL, 0, | 522 | iwm->req_ie, iwm->req_ie_len, |
523 | iwm->resp_ie, iwm->resp_ie_len, | ||
523 | WLAN_STATUS_SUCCESS, GFP_KERNEL); | 524 | WLAN_STATUS_SUCCESS, GFP_KERNEL); |
524 | break; | 525 | break; |
525 | case UMAC_ASSOC_COMPLETE_FAILURE: | 526 | case UMAC_ASSOC_COMPLETE_FAILURE: |
@@ -771,37 +772,46 @@ static int iwm_mlme_mgt_frame(struct iwm_priv *iwm, u8 *buf, | |||
771 | unsigned long buf_size, struct iwm_wifi_cmd *cmd) | 772 | unsigned long buf_size, struct iwm_wifi_cmd *cmd) |
772 | { | 773 | { |
773 | struct iwm_umac_notif_mgt_frame *mgt_frame = | 774 | struct iwm_umac_notif_mgt_frame *mgt_frame = |
774 | (struct iwm_umac_notif_mgt_frame *)buf; | 775 | (struct iwm_umac_notif_mgt_frame *)buf; |
775 | struct ieee80211_mgmt *mgt = (struct ieee80211_mgmt *)mgt_frame->frame; | 776 | struct ieee80211_mgmt *mgt = (struct ieee80211_mgmt *)mgt_frame->frame; |
776 | u8 *ie; | 777 | u8 *ie; |
777 | unsigned int event; | ||
778 | union iwreq_data wrqu; | ||
779 | 778 | ||
780 | IWM_HEXDUMP(iwm, DBG, MLME, "MGT: ", mgt_frame->frame, | 779 | IWM_HEXDUMP(iwm, DBG, MLME, "MGT: ", mgt_frame->frame, |
781 | le16_to_cpu(mgt_frame->len)); | 780 | le16_to_cpu(mgt_frame->len)); |
782 | 781 | ||
783 | if (ieee80211_is_assoc_req(mgt->frame_control)) { | 782 | if (ieee80211_is_assoc_req(mgt->frame_control)) { |
784 | ie = mgt->u.assoc_req.variable;; | 783 | ie = mgt->u.assoc_req.variable;; |
785 | event = IWEVASSOCREQIE; | 784 | iwm->req_ie_len = |
785 | le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt); | ||
786 | kfree(iwm->req_ie); | ||
787 | iwm->req_ie = kmemdup(mgt->u.assoc_req.variable, | ||
788 | iwm->req_ie_len, GFP_KERNEL); | ||
786 | } else if (ieee80211_is_reassoc_req(mgt->frame_control)) { | 789 | } else if (ieee80211_is_reassoc_req(mgt->frame_control)) { |
787 | ie = mgt->u.reassoc_req.variable;; | 790 | ie = mgt->u.reassoc_req.variable;; |
788 | event = IWEVASSOCREQIE; | 791 | iwm->req_ie_len = |
792 | le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt); | ||
793 | kfree(iwm->req_ie); | ||
794 | iwm->req_ie = kmemdup(mgt->u.reassoc_req.variable, | ||
795 | iwm->req_ie_len, GFP_KERNEL); | ||
789 | } else if (ieee80211_is_assoc_resp(mgt->frame_control)) { | 796 | } else if (ieee80211_is_assoc_resp(mgt->frame_control)) { |
790 | ie = mgt->u.assoc_resp.variable;; | 797 | ie = mgt->u.assoc_resp.variable;; |
791 | event = IWEVASSOCRESPIE; | 798 | iwm->resp_ie_len = |
799 | le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt); | ||
800 | kfree(iwm->resp_ie); | ||
801 | iwm->resp_ie = kmemdup(mgt->u.assoc_resp.variable, | ||
802 | iwm->resp_ie_len, GFP_KERNEL); | ||
792 | } else if (ieee80211_is_reassoc_resp(mgt->frame_control)) { | 803 | } else if (ieee80211_is_reassoc_resp(mgt->frame_control)) { |
793 | ie = mgt->u.reassoc_resp.variable;; | 804 | ie = mgt->u.reassoc_resp.variable;; |
794 | event = IWEVASSOCRESPIE; | 805 | iwm->resp_ie_len = |
806 | le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt); | ||
807 | kfree(iwm->resp_ie); | ||
808 | iwm->resp_ie = kmemdup(mgt->u.reassoc_resp.variable, | ||
809 | iwm->resp_ie_len, GFP_KERNEL); | ||
795 | } else { | 810 | } else { |
796 | IWM_ERR(iwm, "Unsupported management frame"); | 811 | IWM_ERR(iwm, "Unsupported management frame"); |
797 | return 0; | 812 | return 0; |
798 | } | 813 | } |
799 | 814 | ||
800 | wrqu.data.length = le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt); | ||
801 | |||
802 | IWM_HEXDUMP(iwm, DBG, MLME, "EVT: ", ie, wrqu.data.length); | ||
803 | wireless_send_event(iwm_to_ndev(iwm), event, &wrqu, ie); | ||
804 | |||
805 | return 0; | 815 | return 0; |
806 | } | 816 | } |
807 | 817 | ||