aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/main.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2011-10-25 10:04:13 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:58:48 -0500
commit240d279940ef496e9456db2287b7989f6521e2e2 (patch)
tree9e5959c4db18a3849576f43d339d41ebac725e92 /drivers/net/wireless/ath/ath6kl/main.c
parent334234b51453fe5def250bd60ea63b1f04a8e0d2 (diff)
ath6kl: Take vif information from wmi event
Interface index is passed in wmi command header from target. Use this index to get the appropriate vif. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/main.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/main.c121
1 files changed, 56 insertions, 65 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 992990192cd9..19b64ae08e12 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -441,7 +441,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
441 if (test_bit(WMI_READY, &ar->flag)) { 441 if (test_bit(WMI_READY, &ar->flag)) {
442 discon_issued = (test_bit(CONNECTED, &vif->flags) || 442 discon_issued = (test_bit(CONNECTED, &vif->flags) ||
443 test_bit(CONNECT_PEND, &vif->flags)); 443 test_bit(CONNECT_PEND, &vif->flags));
444 ath6kl_disconnect(ar, vif->fw_vif_idx); 444 ath6kl_disconnect(vif);
445 if (!keep_profile) 445 if (!keep_profile)
446 ath6kl_init_profile_info(ar); 446 ath6kl_init_profile_info(ar);
447 447
@@ -462,7 +462,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
462 * are collected. 462 * are collected.
463 */ 463 */
464 if (discon_issued) 464 if (discon_issued)
465 ath6kl_disconnect_event(ar, DISCONNECT_CMD, 465 ath6kl_disconnect_event(vif, DISCONNECT_CMD,
466 (vif->nw_type & AP_NETWORK) ? 466 (vif->nw_type & AP_NETWORK) ?
467 bcast_mac : vif->bssid, 467 bcast_mac : vif->bssid,
468 0, NULL, 0); 468 0, NULL, 0);
@@ -498,10 +498,8 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
498 ath6kl_reset_device(ar, ar->target_type, true, true); 498 ath6kl_reset_device(ar, ar->target_type, true, true);
499} 499}
500 500
501static void ath6kl_install_static_wep_keys(struct ath6kl *ar) 501static void ath6kl_install_static_wep_keys(struct ath6kl_vif *vif)
502{ 502{
503 /* TODO: Findout vif */
504 struct ath6kl_vif *vif = ar->vif;
505 u8 index; 503 u8 index;
506 u8 keyusage; 504 u8 keyusage;
507 505
@@ -511,7 +509,7 @@ static void ath6kl_install_static_wep_keys(struct ath6kl *ar)
511 if (index == vif->def_txkey_index) 509 if (index == vif->def_txkey_index)
512 keyusage |= TX_USAGE; 510 keyusage |= TX_USAGE;
513 511
514 ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, 512 ath6kl_wmi_addkey_cmd(vif->ar->wmi, vif->fw_vif_idx,
515 index, 513 index,
516 WEP_CRYPT, 514 WEP_CRYPT,
517 keyusage, 515 keyusage,
@@ -524,13 +522,12 @@ static void ath6kl_install_static_wep_keys(struct ath6kl *ar)
524 } 522 }
525} 523}
526 524
527void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel) 525void ath6kl_connect_ap_mode_bss(struct ath6kl_vif *vif, u16 channel)
528{ 526{
527 struct ath6kl *ar = vif->ar;
529 struct ath6kl_req_key *ik; 528 struct ath6kl_req_key *ik;
530 int res; 529 int res;
531 u8 key_rsc[ATH6KL_KEY_SEQ_LEN]; 530 u8 key_rsc[ATH6KL_KEY_SEQ_LEN];
532 /* TODO: Pass vif instead of taking it from ar */
533 struct ath6kl_vif *vif = ar->vif;
534 531
535 ik = &ar->ap_mode_bkey; 532 ik = &ar->ap_mode_bkey;
536 533
@@ -539,7 +536,7 @@ void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel)
539 switch (vif->auth_mode) { 536 switch (vif->auth_mode) {
540 case NONE_AUTH: 537 case NONE_AUTH:
541 if (vif->prwise_crypto == WEP_CRYPT) 538 if (vif->prwise_crypto == WEP_CRYPT)
542 ath6kl_install_static_wep_keys(ar); 539 ath6kl_install_static_wep_keys(vif);
543 break; 540 break;
544 case WPA_PSK_AUTH: 541 case WPA_PSK_AUTH:
545 case WPA2_PSK_AUTH: 542 case WPA2_PSK_AUTH:
@@ -561,15 +558,16 @@ void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel)
561 break; 558 break;
562 } 559 }
563 560
564 ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0); 561 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, NONE_BSS_FILTER, 0);
565 set_bit(CONNECTED, &vif->flags); 562 set_bit(CONNECTED, &vif->flags);
566 netif_carrier_on(ar->net_dev); 563 netif_carrier_on(vif->ndev);
567} 564}
568 565
569void ath6kl_connect_ap_mode_sta(struct ath6kl *ar, u16 aid, u8 *mac_addr, 566void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr,
570 u8 keymgmt, u8 ucipher, u8 auth, 567 u8 keymgmt, u8 ucipher, u8 auth,
571 u8 assoc_req_len, u8 *assoc_info) 568 u8 assoc_req_len, u8 *assoc_info)
572{ 569{
570 struct ath6kl *ar = vif->ar;
573 u8 *ies = NULL, *wpa_ie = NULL, *pos; 571 u8 *ies = NULL, *wpa_ie = NULL, *pos;
574 size_t ies_len = 0; 572 size_t ies_len = 0;
575 struct station_info sinfo; 573 struct station_info sinfo;
@@ -624,9 +622,9 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl *ar, u16 aid, u8 *mac_addr,
624 sinfo.assoc_req_ies_len = ies_len; 622 sinfo.assoc_req_ies_len = ies_len;
625 sinfo.filled |= STATION_INFO_ASSOC_REQ_IES; 623 sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
626 624
627 cfg80211_new_sta(ar->net_dev, mac_addr, &sinfo, GFP_KERNEL); 625 cfg80211_new_sta(vif->ndev, mac_addr, &sinfo, GFP_KERNEL);
628 626
629 netif_wake_queue(ar->net_dev); 627 netif_wake_queue(vif->ndev);
630} 628}
631 629
632/* Functions for Tx credit handling */ 630/* Functions for Tx credit handling */
@@ -916,17 +914,14 @@ void disconnect_timer_handler(unsigned long ptr)
916 struct ath6kl_vif *vif = netdev_priv(dev); 914 struct ath6kl_vif *vif = netdev_priv(dev);
917 915
918 ath6kl_init_profile_info(vif->ar); 916 ath6kl_init_profile_info(vif->ar);
919 ath6kl_disconnect(vif->ar, vif->fw_vif_idx); 917 ath6kl_disconnect(vif);
920} 918}
921 919
922void ath6kl_disconnect(struct ath6kl *ar, u8 if_idx) 920void ath6kl_disconnect(struct ath6kl_vif *vif)
923{ 921{
924 /* TODO: Pass vif instead of taking it from ar */
925 struct ath6kl_vif *vif = ar->vif;
926
927 if (test_bit(CONNECTED, &vif->flags) || 922 if (test_bit(CONNECTED, &vif->flags) ||
928 test_bit(CONNECT_PEND, &vif->flags)) { 923 test_bit(CONNECT_PEND, &vif->flags)) {
929 ath6kl_wmi_disconnect_cmd(ar->wmi, if_idx); 924 ath6kl_wmi_disconnect_cmd(vif->ar->wmi, vif->fw_vif_idx);
930 /* 925 /*
931 * Disconnect command is issued, clear the connect pending 926 * Disconnect command is issued, clear the connect pending
932 * flag. The connected flag will be cleared in 927 * flag. The connected flag will be cleared in
@@ -971,7 +966,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar)
971 printk(KERN_WARNING "ath6kl: failed to disable scan " 966 printk(KERN_WARNING "ath6kl: failed to disable scan "
972 "during suspend\n"); 967 "during suspend\n");
973 968
974 ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED); 969 ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
975 970
976 /* save the current power mode before enabling power save */ 971 /* save the current power mode before enabling power save */
977 ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; 972 ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
@@ -1027,31 +1022,30 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
1027 test_bit(TESTMODE, &ar->flag) ? " testmode" : ""); 1022 test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
1028} 1023}
1029 1024
1030void ath6kl_scan_complete_evt(struct ath6kl *ar, int status) 1025void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
1031{ 1026{
1032 /* TODO: Pass vif instead of taking it from ar */ 1027 struct ath6kl *ar = vif->ar;
1033 struct ath6kl_vif *vif = ar->vif;
1034 1028
1035 ath6kl_cfg80211_scan_complete_event(ar, status); 1029 ath6kl_cfg80211_scan_complete_event(vif, status);
1036 1030
1037 if (!ar->usr_bss_filter) { 1031 if (!ar->usr_bss_filter) {
1038 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); 1032 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
1039 ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0); 1033 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
1034 NONE_BSS_FILTER, 0);
1040 } 1035 }
1041 1036
1042 ath6kl_dbg(ATH6KL_DBG_WLAN_SCAN, "scan complete: %d\n", status); 1037 ath6kl_dbg(ATH6KL_DBG_WLAN_SCAN, "scan complete: %d\n", status);
1043} 1038}
1044 1039
1045void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid, 1040void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel, u8 *bssid,
1046 u16 listen_int, u16 beacon_int, 1041 u16 listen_int, u16 beacon_int,
1047 enum network_type net_type, u8 beacon_ie_len, 1042 enum network_type net_type, u8 beacon_ie_len,
1048 u8 assoc_req_len, u8 assoc_resp_len, 1043 u8 assoc_req_len, u8 assoc_resp_len,
1049 u8 *assoc_info) 1044 u8 *assoc_info)
1050{ 1045{
1051 /* TODO: findout vif instead of taking it from ar */ 1046 struct ath6kl *ar = vif->ar;
1052 struct ath6kl_vif *vif = ar->vif;
1053 1047
1054 ath6kl_cfg80211_connect_event(ar, channel, bssid, 1048 ath6kl_cfg80211_connect_event(vif, channel, bssid,
1055 listen_int, beacon_int, 1049 listen_int, beacon_int,
1056 net_type, beacon_ie_len, 1050 net_type, beacon_ie_len,
1057 assoc_req_len, assoc_resp_len, 1051 assoc_req_len, assoc_resp_len,
@@ -1065,13 +1059,13 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
1065 ar->listen_intvl_t, 1059 ar->listen_intvl_t,
1066 ar->listen_intvl_b); 1060 ar->listen_intvl_b);
1067 1061
1068 netif_wake_queue(ar->net_dev); 1062 netif_wake_queue(vif->ndev);
1069 1063
1070 /* Update connect & link status atomically */ 1064 /* Update connect & link status atomically */
1071 spin_lock_bh(&ar->lock); 1065 spin_lock_bh(&ar->lock);
1072 set_bit(CONNECTED, &vif->flags); 1066 set_bit(CONNECTED, &vif->flags);
1073 clear_bit(CONNECT_PEND, &vif->flags); 1067 clear_bit(CONNECT_PEND, &vif->flags);
1074 netif_carrier_on(ar->net_dev); 1068 netif_carrier_on(vif->ndev);
1075 spin_unlock_bh(&ar->lock); 1069 spin_unlock_bh(&ar->lock);
1076 1070
1077 aggr_reset_state(vif->aggr_cntxt); 1071 aggr_reset_state(vif->aggr_cntxt);
@@ -1085,16 +1079,17 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
1085 1079
1086 if (!ar->usr_bss_filter) { 1080 if (!ar->usr_bss_filter) {
1087 set_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); 1081 set_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
1088 ath6kl_wmi_bssfilter_cmd(ar->wmi, CURRENT_BSS_FILTER, 0); 1082 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
1083 CURRENT_BSS_FILTER, 0);
1089 } 1084 }
1090} 1085}
1091 1086
1092void ath6kl_tkip_micerr_event(struct ath6kl *ar, u8 keyid, bool ismcast) 1087void ath6kl_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, bool ismcast)
1093{ 1088{
1094 struct ath6kl_sta *sta; 1089 struct ath6kl_sta *sta;
1095 /* TODO: Findout vif */ 1090 struct ath6kl *ar = vif->ar;
1096 struct ath6kl_vif *vif = ar->vif;
1097 u8 tsc[6]; 1091 u8 tsc[6];
1092
1098 /* 1093 /*
1099 * For AP case, keyid will have aid of STA which sent pkt with 1094 * For AP case, keyid will have aid of STA which sent pkt with
1100 * MIC error. Use this aid to get MAC & send it to hostapd. 1095 * MIC error. Use this aid to get MAC & send it to hostapd.
@@ -1108,20 +1103,19 @@ void ath6kl_tkip_micerr_event(struct ath6kl *ar, u8 keyid, bool ismcast)
1108 "ap tkip mic error received from aid=%d\n", keyid); 1103 "ap tkip mic error received from aid=%d\n", keyid);
1109 1104
1110 memset(tsc, 0, sizeof(tsc)); /* FIX: get correct TSC */ 1105 memset(tsc, 0, sizeof(tsc)); /* FIX: get correct TSC */
1111 cfg80211_michael_mic_failure(ar->net_dev, sta->mac, 1106 cfg80211_michael_mic_failure(vif->ndev, sta->mac,
1112 NL80211_KEYTYPE_PAIRWISE, keyid, 1107 NL80211_KEYTYPE_PAIRWISE, keyid,
1113 tsc, GFP_KERNEL); 1108 tsc, GFP_KERNEL);
1114 } else 1109 } else
1115 ath6kl_cfg80211_tkip_micerr_event(ar, keyid, ismcast); 1110 ath6kl_cfg80211_tkip_micerr_event(vif, keyid, ismcast);
1116 1111
1117} 1112}
1118 1113
1119static void ath6kl_update_target_stats(struct ath6kl *ar, u8 *ptr, u32 len) 1114static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len)
1120{ 1115{
1121 struct wmi_target_stats *tgt_stats = 1116 struct wmi_target_stats *tgt_stats =
1122 (struct wmi_target_stats *) ptr; 1117 (struct wmi_target_stats *) ptr;
1123 /* TODO: Findout vif */ 1118 struct ath6kl *ar = vif->ar;
1124 struct ath6kl_vif *vif = ar->vif;
1125 struct target_stats *stats = &vif->target_stats; 1119 struct target_stats *stats = &vif->target_stats;
1126 struct tkip_ccmp_stats *ccmp_stats; 1120 struct tkip_ccmp_stats *ccmp_stats;
1127 u8 ac; 1121 u8 ac;
@@ -1229,13 +1223,12 @@ static void ath6kl_add_le32(__le32 *var, __le32 val)
1229 *var = cpu_to_le32(le32_to_cpu(*var) + le32_to_cpu(val)); 1223 *var = cpu_to_le32(le32_to_cpu(*var) + le32_to_cpu(val));
1230} 1224}
1231 1225
1232void ath6kl_tgt_stats_event(struct ath6kl *ar, u8 *ptr, u32 len) 1226void ath6kl_tgt_stats_event(struct ath6kl_vif *vif, u8 *ptr, u32 len)
1233{ 1227{
1234 struct wmi_ap_mode_stat *p = (struct wmi_ap_mode_stat *) ptr; 1228 struct wmi_ap_mode_stat *p = (struct wmi_ap_mode_stat *) ptr;
1229 struct ath6kl *ar = vif->ar;
1235 struct wmi_ap_mode_stat *ap = &ar->ap_stats; 1230 struct wmi_ap_mode_stat *ap = &ar->ap_stats;
1236 struct wmi_per_sta_stat *st_ap, *st_p; 1231 struct wmi_per_sta_stat *st_ap, *st_p;
1237 /* TODO: Findout vif */
1238 struct ath6kl_vif *vif = ar->vif;
1239 u8 ac; 1232 u8 ac;
1240 1233
1241 if (vif->nw_type == AP_NETWORK) { 1234 if (vif->nw_type == AP_NETWORK) {
@@ -1257,7 +1250,7 @@ void ath6kl_tgt_stats_event(struct ath6kl *ar, u8 *ptr, u32 len)
1257 } 1250 }
1258 1251
1259 } else { 1252 } else {
1260 ath6kl_update_target_stats(ar, ptr, len); 1253 ath6kl_update_target_stats(vif, ptr, len);
1261 } 1254 }
1262} 1255}
1263 1256
@@ -1276,13 +1269,12 @@ void ath6kl_txpwr_rx_evt(void *devt, u8 tx_pwr)
1276 wake_up(&ar->event_wq); 1269 wake_up(&ar->event_wq);
1277} 1270}
1278 1271
1279void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid) 1272void ath6kl_pspoll_event(struct ath6kl_vif *vif, u8 aid)
1280{ 1273{
1281 struct ath6kl_sta *conn; 1274 struct ath6kl_sta *conn;
1282 struct sk_buff *skb; 1275 struct sk_buff *skb;
1283 bool psq_empty = false; 1276 bool psq_empty = false;
1284 /* TODO: Pass vif instead of taking it from ar */ 1277 struct ath6kl *ar = vif->ar;
1285 struct ath6kl_vif *vif = ar->vif;
1286 1278
1287 conn = ath6kl_find_sta_by_aid(ar, aid); 1279 conn = ath6kl_find_sta_by_aid(ar, aid);
1288 1280
@@ -1305,7 +1297,7 @@ void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid)
1305 spin_unlock_bh(&conn->psq_lock); 1297 spin_unlock_bh(&conn->psq_lock);
1306 1298
1307 conn->sta_flags |= STA_PS_POLLED; 1299 conn->sta_flags |= STA_PS_POLLED;
1308 ath6kl_data_tx(skb, ar->net_dev); 1300 ath6kl_data_tx(skb, vif->ndev);
1309 conn->sta_flags &= ~STA_PS_POLLED; 1301 conn->sta_flags &= ~STA_PS_POLLED;
1310 1302
1311 spin_lock_bh(&conn->psq_lock); 1303 spin_lock_bh(&conn->psq_lock);
@@ -1316,12 +1308,11 @@ void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid)
1316 ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, conn->aid, 0); 1308 ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, conn->aid, 0);
1317} 1309}
1318 1310
1319void ath6kl_dtimexpiry_event(struct ath6kl *ar) 1311void ath6kl_dtimexpiry_event(struct ath6kl_vif *vif)
1320{ 1312{
1321 bool mcastq_empty = false; 1313 bool mcastq_empty = false;
1322 struct sk_buff *skb; 1314 struct sk_buff *skb;
1323 /* TODO: Pass vif instead of taking it from ar */ 1315 struct ath6kl *ar = vif->ar;
1324 struct ath6kl_vif *vif = ar->vif;
1325 1316
1326 /* 1317 /*
1327 * If there are no associated STAs, ignore the DTIM expiry event. 1318 * If there are no associated STAs, ignore the DTIM expiry event.
@@ -1349,7 +1340,7 @@ void ath6kl_dtimexpiry_event(struct ath6kl *ar)
1349 while ((skb = skb_dequeue(&ar->mcastpsq)) != NULL) { 1340 while ((skb = skb_dequeue(&ar->mcastpsq)) != NULL) {
1350 spin_unlock_bh(&ar->mcastpsq_lock); 1341 spin_unlock_bh(&ar->mcastpsq_lock);
1351 1342
1352 ath6kl_data_tx(skb, ar->net_dev); 1343 ath6kl_data_tx(skb, vif->ndev);
1353 1344
1354 spin_lock_bh(&ar->mcastpsq_lock); 1345 spin_lock_bh(&ar->mcastpsq_lock);
1355 } 1346 }
@@ -1361,12 +1352,11 @@ void ath6kl_dtimexpiry_event(struct ath6kl *ar)
1361 ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, MCAST_AID, 0); 1352 ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, MCAST_AID, 0);
1362} 1353}
1363 1354
1364void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid, 1355void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid,
1365 u8 assoc_resp_len, u8 *assoc_info, 1356 u8 assoc_resp_len, u8 *assoc_info,
1366 u16 prot_reason_status) 1357 u16 prot_reason_status)
1367{ 1358{
1368 /* TODO: Findout vif instead of taking it from ar */ 1359 struct ath6kl *ar = vif->ar;
1369 struct ath6kl_vif *vif = ar->vif;
1370 1360
1371 if (vif->nw_type == AP_NETWORK) { 1361 if (vif->nw_type == AP_NETWORK) {
1372 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status)) 1362 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status))
@@ -1386,17 +1376,17 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1386 1376
1387 if (!is_broadcast_ether_addr(bssid)) { 1377 if (!is_broadcast_ether_addr(bssid)) {
1388 /* send event to application */ 1378 /* send event to application */
1389 cfg80211_del_sta(ar->net_dev, bssid, GFP_KERNEL); 1379 cfg80211_del_sta(vif->ndev, bssid, GFP_KERNEL);
1390 } 1380 }
1391 1381
1392 if (memcmp(ar->net_dev->dev_addr, bssid, ETH_ALEN) == 0) { 1382 if (memcmp(vif->ndev->dev_addr, bssid, ETH_ALEN) == 0) {
1393 memset(vif->wep_key_list, 0, sizeof(vif->wep_key_list)); 1383 memset(vif->wep_key_list, 0, sizeof(vif->wep_key_list));
1394 clear_bit(CONNECTED, &vif->flags); 1384 clear_bit(CONNECTED, &vif->flags);
1395 } 1385 }
1396 return; 1386 return;
1397 } 1387 }
1398 1388
1399 ath6kl_cfg80211_disconnect_event(ar, reason, bssid, 1389 ath6kl_cfg80211_disconnect_event(vif, reason, bssid,
1400 assoc_resp_len, assoc_info, 1390 assoc_resp_len, assoc_info,
1401 prot_reason_status); 1391 prot_reason_status);
1402 1392
@@ -1414,7 +1404,8 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1414 */ 1404 */
1415 if (reason == DISCONNECT_CMD) { 1405 if (reason == DISCONNECT_CMD) {
1416 if (!ar->usr_bss_filter && test_bit(WMI_READY, &ar->flag)) 1406 if (!ar->usr_bss_filter && test_bit(WMI_READY, &ar->flag))
1417 ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0); 1407 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
1408 NONE_BSS_FILTER, 0);
1418 } else { 1409 } else {
1419 set_bit(CONNECT_PEND, &vif->flags); 1410 set_bit(CONNECT_PEND, &vif->flags);
1420 if (((reason == ASSOC_FAILED) && 1411 if (((reason == ASSOC_FAILED) &&
@@ -1429,7 +1420,7 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1429 /* update connect & link status atomically */ 1420 /* update connect & link status atomically */
1430 spin_lock_bh(&ar->lock); 1421 spin_lock_bh(&ar->lock);
1431 clear_bit(CONNECTED, &vif->flags); 1422 clear_bit(CONNECTED, &vif->flags);
1432 netif_carrier_off(ar->net_dev); 1423 netif_carrier_off(vif->ndev);
1433 spin_unlock_bh(&ar->lock); 1424 spin_unlock_bh(&ar->lock);
1434 1425
1435 if ((reason != CSERV_DISCONNECT) || (vif->reconnect_flag != 1)) 1426 if ((reason != CSERV_DISCONNECT) || (vif->reconnect_flag != 1))
@@ -1438,7 +1429,7 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1438 if (reason != CSERV_DISCONNECT) 1429 if (reason != CSERV_DISCONNECT)
1439 ar->user_key_ctrl = 0; 1430 ar->user_key_ctrl = 0;
1440 1431
1441 netif_stop_queue(ar->net_dev); 1432 netif_stop_queue(vif->ndev);
1442 memset(vif->bssid, 0, sizeof(vif->bssid)); 1433 memset(vif->bssid, 0, sizeof(vif->bssid));
1443 vif->bss_ch = 0; 1434 vif->bss_ch = 0;
1444 1435
@@ -1472,7 +1463,7 @@ static int ath6kl_close(struct net_device *dev)
1472 1463
1473 netif_stop_queue(dev); 1464 netif_stop_queue(dev);
1474 1465
1475 ath6kl_disconnect(ar, vif->fw_vif_idx); 1466 ath6kl_disconnect(vif);
1476 1467
1477 if (test_bit(WMI_READY, &ar->flag)) { 1468 if (test_bit(WMI_READY, &ar->flag)) {
1478 if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 1469 if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF,
@@ -1482,7 +1473,7 @@ static int ath6kl_close(struct net_device *dev)
1482 clear_bit(WLAN_ENABLED, &vif->flags); 1473 clear_bit(WLAN_ENABLED, &vif->flags);
1483 } 1474 }
1484 1475
1485 ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED); 1476 ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
1486 1477
1487 return 0; 1478 return 0;
1488} 1479}