diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2011-10-25 10:04:12 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 05:58:48 -0500 |
commit | 334234b51453fe5def250bd60ea63b1f04a8e0d2 (patch) | |
tree | 02767138ce4b82161af2f6bb8c15d9842666caaa /drivers/net/wireless/ath/ath6kl/cfg80211.c | |
parent | b95907a744fb2afe282cebd9b58371533818fbae (diff) |
ath6kl: Maintain firmware interface index in struct ath6kl_vif
Pass this index to target in wmi commands to specify the interface
for which the command needs to be handled.
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/cfg80211.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 125 |
1 files changed, 73 insertions, 52 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index aa40d39e5ce1..54679f22377e 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -269,9 +269,10 @@ static bool ath6kl_is_rsn_ie(const u8 *pos) | |||
269 | return pos[0] == WLAN_EID_RSN; | 269 | return pos[0] == WLAN_EID_RSN; |
270 | } | 270 | } |
271 | 271 | ||
272 | static int ath6kl_set_assoc_req_ies(struct ath6kl *ar, const u8 *ies, | 272 | static int ath6kl_set_assoc_req_ies(struct ath6kl_vif *vif, const u8 *ies, |
273 | size_t ies_len) | 273 | size_t ies_len) |
274 | { | 274 | { |
275 | struct ath6kl *ar = vif->ar; | ||
275 | const u8 *pos; | 276 | const u8 *pos; |
276 | u8 *buf = NULL; | 277 | u8 *buf = NULL; |
277 | size_t len = 0; | 278 | size_t len = 0; |
@@ -298,8 +299,8 @@ static int ath6kl_set_assoc_req_ies(struct ath6kl *ar, const u8 *ies, | |||
298 | } | 299 | } |
299 | } | 300 | } |
300 | 301 | ||
301 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, WMI_FRAME_ASSOC_REQ, | 302 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, |
302 | buf, len); | 303 | WMI_FRAME_ASSOC_REQ, buf, len); |
303 | kfree(buf); | 304 | kfree(buf); |
304 | return ret; | 305 | return ret; |
305 | } | 306 | } |
@@ -354,7 +355,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
354 | } | 355 | } |
355 | 356 | ||
356 | if (sme->ie && (sme->ie_len > 0)) { | 357 | if (sme->ie && (sme->ie_len > 0)) { |
357 | status = ath6kl_set_assoc_req_ies(ar, sme->ie, sme->ie_len); | 358 | status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len); |
358 | if (status) | 359 | if (status) |
359 | return status; | 360 | return status; |
360 | } | 361 | } |
@@ -363,7 +364,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
363 | vif->ssid_len == sme->ssid_len && | 364 | vif->ssid_len == sme->ssid_len && |
364 | !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { | 365 | !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { |
365 | vif->reconnect_flag = true; | 366 | vif->reconnect_flag = true; |
366 | status = ath6kl_wmi_reconnect_cmd(ar->wmi, vif->req_bssid, | 367 | status = ath6kl_wmi_reconnect_cmd(ar->wmi, vif->fw_vif_idx, |
368 | vif->req_bssid, | ||
367 | vif->ch_hint); | 369 | vif->ch_hint); |
368 | 370 | ||
369 | up(&ar->sem); | 371 | up(&ar->sem); |
@@ -374,7 +376,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
374 | return 0; | 376 | return 0; |
375 | } else if (vif->ssid_len == sme->ssid_len && | 377 | } else if (vif->ssid_len == sme->ssid_len && |
376 | !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { | 378 | !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { |
377 | ath6kl_disconnect(ar); | 379 | ath6kl_disconnect(ar, vif->fw_vif_idx); |
378 | } | 380 | } |
379 | 381 | ||
380 | memset(vif->ssid, 0, sizeof(vif->ssid)); | 382 | memset(vif->ssid, 0, sizeof(vif->ssid)); |
@@ -425,7 +427,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
425 | key->cipher = vif->prwise_crypto; | 427 | key->cipher = vif->prwise_crypto; |
426 | vif->def_txkey_index = sme->key_idx; | 428 | vif->def_txkey_index = sme->key_idx; |
427 | 429 | ||
428 | ath6kl_wmi_addkey_cmd(ar->wmi, sme->key_idx, | 430 | ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, sme->key_idx, |
429 | vif->prwise_crypto, | 431 | vif->prwise_crypto, |
430 | GROUP_USAGE | TX_USAGE, | 432 | GROUP_USAGE | TX_USAGE, |
431 | key->key_len, | 433 | key->key_len, |
@@ -455,7 +457,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
455 | vif->grp_crypto_len, vif->ch_hint); | 457 | vif->grp_crypto_len, vif->ch_hint); |
456 | 458 | ||
457 | vif->reconnect_flag = 0; | 459 | vif->reconnect_flag = 0; |
458 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->nw_type, | 460 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, |
459 | vif->dot11_auth_mode, vif->auth_mode, | 461 | vif->dot11_auth_mode, vif->auth_mode, |
460 | vif->prwise_crypto, | 462 | vif->prwise_crypto, |
461 | vif->prwise_crypto_len, | 463 | vif->prwise_crypto_len, |
@@ -639,7 +641,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy, | |||
639 | } | 641 | } |
640 | 642 | ||
641 | vif->reconnect_flag = 0; | 643 | vif->reconnect_flag = 0; |
642 | ath6kl_disconnect(ar); | 644 | ath6kl_disconnect(ar, vif->fw_vif_idx); |
643 | memset(vif->ssid, 0, sizeof(vif->ssid)); | 645 | memset(vif->ssid, 0, sizeof(vif->ssid)); |
644 | vif->ssid_len = 0; | 646 | vif->ssid_len = 0; |
645 | 647 | ||
@@ -695,7 +697,7 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason, | |||
695 | */ | 697 | */ |
696 | 698 | ||
697 | if (reason != DISCONNECT_CMD) { | 699 | if (reason != DISCONNECT_CMD) { |
698 | ath6kl_wmi_disconnect_cmd(ar->wmi); | 700 | ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); |
699 | return; | 701 | return; |
700 | } | 702 | } |
701 | 703 | ||
@@ -747,14 +749,15 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, | |||
747 | request->n_ssids = MAX_PROBED_SSID_INDEX - 1; | 749 | request->n_ssids = MAX_PROBED_SSID_INDEX - 1; |
748 | 750 | ||
749 | for (i = 0; i < request->n_ssids; i++) | 751 | for (i = 0; i < request->n_ssids; i++) |
750 | ath6kl_wmi_probedssid_cmd(ar->wmi, i + 1, | 752 | ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, |
751 | SPECIFIC_SSID_FLAG, | 753 | i + 1, SPECIFIC_SSID_FLAG, |
752 | request->ssids[i].ssid_len, | 754 | request->ssids[i].ssid_len, |
753 | request->ssids[i].ssid); | 755 | request->ssids[i].ssid); |
754 | } | 756 | } |
755 | 757 | ||
756 | if (request->ie) { | 758 | if (request->ie) { |
757 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, WMI_FRAME_PROBE_REQ, | 759 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, |
760 | WMI_FRAME_PROBE_REQ, | ||
758 | request->ie, request->ie_len); | 761 | request->ie, request->ie_len); |
759 | if (ret) { | 762 | if (ret) { |
760 | ath6kl_err("failed to set Probe Request appie for " | 763 | ath6kl_err("failed to set Probe Request appie for " |
@@ -788,8 +791,9 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, | |||
788 | if (test_bit(CONNECTED, &vif->flags)) | 791 | if (test_bit(CONNECTED, &vif->flags)) |
789 | force_fg_scan = 1; | 792 | force_fg_scan = 1; |
790 | 793 | ||
791 | ret = ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, force_fg_scan, | 794 | ret = ath6kl_wmi_startscan_cmd(ar->wmi, vif->fw_vif_idx, WMI_LONG_SCAN, |
792 | false, 0, 0, n_channels, channels); | 795 | force_fg_scan, false, 0, 0, n_channels, |
796 | channels); | ||
793 | if (ret) | 797 | if (ret) |
794 | ath6kl_err("wmi_startscan_cmd failed\n"); | 798 | ath6kl_err("wmi_startscan_cmd failed\n"); |
795 | else | 799 | else |
@@ -820,8 +824,8 @@ void ath6kl_cfg80211_scan_complete_event(struct ath6kl *ar, int status) | |||
820 | 824 | ||
821 | if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) { | 825 | if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) { |
822 | for (i = 0; i < vif->scan_req->n_ssids; i++) { | 826 | for (i = 0; i < vif->scan_req->n_ssids; i++) { |
823 | ath6kl_wmi_probedssid_cmd(ar->wmi, i + 1, | 827 | ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, |
824 | DISABLE_SSID_FLAG, | 828 | i + 1, DISABLE_SSID_FLAG, |
825 | 0, NULL); | 829 | 0, NULL); |
826 | } | 830 | } |
827 | } | 831 | } |
@@ -942,7 +946,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
942 | return 0; | 946 | return 0; |
943 | } | 947 | } |
944 | 948 | ||
945 | status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->def_txkey_index, | 949 | status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, |
950 | vif->def_txkey_index, | ||
946 | key_type, key_usage, key->key_len, | 951 | key_type, key_usage, key->key_len, |
947 | key->seq, key->key, KEY_OP_INIT_VAL, | 952 | key->seq, key->key, KEY_OP_INIT_VAL, |
948 | (u8 *) mac_addr, SYNC_BOTH_WMIFLAG); | 953 | (u8 *) mac_addr, SYNC_BOTH_WMIFLAG); |
@@ -980,7 +985,7 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, | |||
980 | 985 | ||
981 | vif->keys[key_index].key_len = 0; | 986 | vif->keys[key_index].key_len = 0; |
982 | 987 | ||
983 | return ath6kl_wmi_deletekey_cmd(ar->wmi, key_index); | 988 | return ath6kl_wmi_deletekey_cmd(ar->wmi, vif->fw_vif_idx, key_index); |
984 | } | 989 | } |
985 | 990 | ||
986 | static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, | 991 | static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, |
@@ -1062,7 +1067,8 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, | |||
1062 | if (vif->next_mode == AP_NETWORK && !test_bit(CONNECTED, &vif->flags)) | 1067 | if (vif->next_mode == AP_NETWORK && !test_bit(CONNECTED, &vif->flags)) |
1063 | return 0; /* Delay until AP mode has been started */ | 1068 | return 0; /* Delay until AP mode has been started */ |
1064 | 1069 | ||
1065 | status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->def_txkey_index, | 1070 | status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, |
1071 | vif->def_txkey_index, | ||
1066 | key_type, key_usage, | 1072 | key_type, key_usage, |
1067 | key->key_len, key->seq, key->key, | 1073 | key->key_len, key->seq, key->key, |
1068 | KEY_OP_INIT_VAL, NULL, | 1074 | KEY_OP_INIT_VAL, NULL, |
@@ -1179,6 +1185,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, | |||
1179 | { | 1185 | { |
1180 | struct ath6kl *ar = ath6kl_priv(dev); | 1186 | struct ath6kl *ar = ath6kl_priv(dev); |
1181 | struct wmi_power_mode_cmd mode; | 1187 | struct wmi_power_mode_cmd mode; |
1188 | struct ath6kl_vif *vif = netdev_priv(dev); | ||
1182 | 1189 | ||
1183 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: pmgmt %d, timeout %d\n", | 1190 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: pmgmt %d, timeout %d\n", |
1184 | __func__, pmgmt, timeout); | 1191 | __func__, pmgmt, timeout); |
@@ -1194,7 +1201,8 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, | |||
1194 | mode.pwr_mode = MAX_PERF_POWER; | 1201 | mode.pwr_mode = MAX_PERF_POWER; |
1195 | } | 1202 | } |
1196 | 1203 | ||
1197 | if (ath6kl_wmi_powermode_cmd(ar->wmi, mode.pwr_mode) != 0) { | 1204 | if (ath6kl_wmi_powermode_cmd(ar->wmi, vif->fw_vif_idx, |
1205 | mode.pwr_mode) != 0) { | ||
1198 | ath6kl_err("wmi_powermode_cmd failed\n"); | 1206 | ath6kl_err("wmi_powermode_cmd failed\n"); |
1199 | return -EIO; | 1207 | return -EIO; |
1200 | } | 1208 | } |
@@ -1299,7 +1307,7 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, | |||
1299 | vif->prwise_crypto_len, vif->grp_crypto, | 1307 | vif->prwise_crypto_len, vif->grp_crypto, |
1300 | vif->grp_crypto_len, vif->ch_hint); | 1308 | vif->grp_crypto_len, vif->ch_hint); |
1301 | 1309 | ||
1302 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->nw_type, | 1310 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, |
1303 | vif->dot11_auth_mode, vif->auth_mode, | 1311 | vif->dot11_auth_mode, vif->auth_mode, |
1304 | vif->prwise_crypto, | 1312 | vif->prwise_crypto, |
1305 | vif->prwise_crypto_len, | 1313 | vif->prwise_crypto_len, |
@@ -1321,7 +1329,7 @@ static int ath6kl_cfg80211_leave_ibss(struct wiphy *wiphy, | |||
1321 | if (!ath6kl_cfg80211_ready(ar)) | 1329 | if (!ath6kl_cfg80211_ready(ar)) |
1322 | return -EIO; | 1330 | return -EIO; |
1323 | 1331 | ||
1324 | ath6kl_disconnect(ar); | 1332 | ath6kl_disconnect(ar, vif->fw_vif_idx); |
1325 | memset(vif->ssid, 0, sizeof(vif->ssid)); | 1333 | memset(vif->ssid, 0, sizeof(vif->ssid)); |
1326 | vif->ssid_len = 0; | 1334 | vif->ssid_len = 0; |
1327 | 1335 | ||
@@ -1416,7 +1424,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1416 | 1424 | ||
1417 | set_bit(STATS_UPDATE_PEND, &vif->flags); | 1425 | set_bit(STATS_UPDATE_PEND, &vif->flags); |
1418 | 1426 | ||
1419 | ret = ath6kl_wmi_get_stats_cmd(ar->wmi); | 1427 | ret = ath6kl_wmi_get_stats_cmd(ar->wmi, vif->fw_vif_idx); |
1420 | 1428 | ||
1421 | if (ret != 0) { | 1429 | if (ret != 0) { |
1422 | up(&ar->sem); | 1430 | up(&ar->sem); |
@@ -1500,7 +1508,9 @@ static int ath6kl_set_pmksa(struct wiphy *wiphy, struct net_device *netdev, | |||
1500 | struct cfg80211_pmksa *pmksa) | 1508 | struct cfg80211_pmksa *pmksa) |
1501 | { | 1509 | { |
1502 | struct ath6kl *ar = ath6kl_priv(netdev); | 1510 | struct ath6kl *ar = ath6kl_priv(netdev); |
1503 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, pmksa->bssid, | 1511 | struct ath6kl_vif *vif = netdev_priv(netdev); |
1512 | |||
1513 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, pmksa->bssid, | ||
1504 | pmksa->pmkid, true); | 1514 | pmksa->pmkid, true); |
1505 | } | 1515 | } |
1506 | 1516 | ||
@@ -1508,7 +1518,9 @@ static int ath6kl_del_pmksa(struct wiphy *wiphy, struct net_device *netdev, | |||
1508 | struct cfg80211_pmksa *pmksa) | 1518 | struct cfg80211_pmksa *pmksa) |
1509 | { | 1519 | { |
1510 | struct ath6kl *ar = ath6kl_priv(netdev); | 1520 | struct ath6kl *ar = ath6kl_priv(netdev); |
1511 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, pmksa->bssid, | 1521 | struct ath6kl_vif *vif = netdev_priv(netdev); |
1522 | |||
1523 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, pmksa->bssid, | ||
1512 | pmksa->pmkid, false); | 1524 | pmksa->pmkid, false); |
1513 | } | 1525 | } |
1514 | 1526 | ||
@@ -1518,8 +1530,8 @@ static int ath6kl_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev) | |||
1518 | struct ath6kl_vif *vif = netdev_priv(netdev); | 1530 | struct ath6kl_vif *vif = netdev_priv(netdev); |
1519 | 1531 | ||
1520 | if (test_bit(CONNECTED, &vif->flags)) | 1532 | if (test_bit(CONNECTED, &vif->flags)) |
1521 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->bssid, | 1533 | return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, |
1522 | NULL, false); | 1534 | vif->bssid, NULL, false); |
1523 | return 0; | 1535 | return 0; |
1524 | } | 1536 | } |
1525 | 1537 | ||
@@ -1564,9 +1576,10 @@ static bool ath6kl_is_p2p_ie(const u8 *pos) | |||
1564 | pos[4] == 0x9a && pos[5] == 0x09; | 1576 | pos[4] == 0x9a && pos[5] == 0x09; |
1565 | } | 1577 | } |
1566 | 1578 | ||
1567 | static int ath6kl_set_ap_probe_resp_ies(struct ath6kl *ar, const u8 *ies, | 1579 | static int ath6kl_set_ap_probe_resp_ies(struct ath6kl_vif *vif, |
1568 | size_t ies_len) | 1580 | const u8 *ies, size_t ies_len) |
1569 | { | 1581 | { |
1582 | struct ath6kl *ar = vif->ar; | ||
1570 | const u8 *pos; | 1583 | const u8 *pos; |
1571 | u8 *buf = NULL; | 1584 | u8 *buf = NULL; |
1572 | size_t len = 0; | 1585 | size_t len = 0; |
@@ -1593,8 +1606,8 @@ static int ath6kl_set_ap_probe_resp_ies(struct ath6kl *ar, const u8 *ies, | |||
1593 | } | 1606 | } |
1594 | } | 1607 | } |
1595 | 1608 | ||
1596 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, WMI_FRAME_PROBE_RESP, | 1609 | ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, |
1597 | buf, len); | 1610 | WMI_FRAME_PROBE_RESP, buf, len); |
1598 | kfree(buf); | 1611 | kfree(buf); |
1599 | return ret; | 1612 | return ret; |
1600 | } | 1613 | } |
@@ -1620,20 +1633,22 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
1620 | return -EOPNOTSUPP; | 1633 | return -EOPNOTSUPP; |
1621 | 1634 | ||
1622 | if (info->beacon_ies) { | 1635 | if (info->beacon_ies) { |
1623 | res = ath6kl_wmi_set_appie_cmd(ar->wmi, WMI_FRAME_BEACON, | 1636 | res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, |
1637 | WMI_FRAME_BEACON, | ||
1624 | info->beacon_ies, | 1638 | info->beacon_ies, |
1625 | info->beacon_ies_len); | 1639 | info->beacon_ies_len); |
1626 | if (res) | 1640 | if (res) |
1627 | return res; | 1641 | return res; |
1628 | } | 1642 | } |
1629 | if (info->proberesp_ies) { | 1643 | if (info->proberesp_ies) { |
1630 | res = ath6kl_set_ap_probe_resp_ies(ar, info->proberesp_ies, | 1644 | res = ath6kl_set_ap_probe_resp_ies(vif, info->proberesp_ies, |
1631 | info->proberesp_ies_len); | 1645 | info->proberesp_ies_len); |
1632 | if (res) | 1646 | if (res) |
1633 | return res; | 1647 | return res; |
1634 | } | 1648 | } |
1635 | if (info->assocresp_ies) { | 1649 | if (info->assocresp_ies) { |
1636 | res = ath6kl_wmi_set_appie_cmd(ar->wmi, WMI_FRAME_ASSOC_RESP, | 1650 | res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, |
1651 | WMI_FRAME_ASSOC_RESP, | ||
1637 | info->assocresp_ies, | 1652 | info->assocresp_ies, |
1638 | info->assocresp_ies_len); | 1653 | info->assocresp_ies_len); |
1639 | if (res) | 1654 | if (res) |
@@ -1734,7 +1749,7 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
1734 | p.dot11_auth_mode = vif->dot11_auth_mode; | 1749 | p.dot11_auth_mode = vif->dot11_auth_mode; |
1735 | p.ch = cpu_to_le16(vif->next_chan); | 1750 | p.ch = cpu_to_le16(vif->next_chan); |
1736 | 1751 | ||
1737 | res = ath6kl_wmi_ap_profile_commit(ar->wmi, &p); | 1752 | res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p); |
1738 | if (res < 0) | 1753 | if (res < 0) |
1739 | return res; | 1754 | return res; |
1740 | 1755 | ||
@@ -1763,7 +1778,7 @@ static int ath6kl_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
1763 | if (!test_bit(CONNECTED, &vif->flags)) | 1778 | if (!test_bit(CONNECTED, &vif->flags)) |
1764 | return -ENOTCONN; | 1779 | return -ENOTCONN; |
1765 | 1780 | ||
1766 | ath6kl_wmi_disconnect_cmd(ar->wmi); | 1781 | ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); |
1767 | clear_bit(CONNECTED, &vif->flags); | 1782 | clear_bit(CONNECTED, &vif->flags); |
1768 | 1783 | ||
1769 | return 0; | 1784 | return 0; |
@@ -1783,10 +1798,10 @@ static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev, | |||
1783 | return -EOPNOTSUPP; | 1798 | return -EOPNOTSUPP; |
1784 | 1799 | ||
1785 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED)) | 1800 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED)) |
1786 | return ath6kl_wmi_ap_set_mlme(ar->wmi, WMI_AP_MLME_AUTHORIZE, | 1801 | return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, |
1787 | mac, 0); | 1802 | WMI_AP_MLME_AUTHORIZE, mac, 0); |
1788 | return ath6kl_wmi_ap_set_mlme(ar->wmi, WMI_AP_MLME_UNAUTHORIZE, mac, | 1803 | return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, |
1789 | 0); | 1804 | WMI_AP_MLME_UNAUTHORIZE, mac, 0); |
1790 | } | 1805 | } |
1791 | 1806 | ||
1792 | static int ath6kl_remain_on_channel(struct wiphy *wiphy, | 1807 | static int ath6kl_remain_on_channel(struct wiphy *wiphy, |
@@ -1797,13 +1812,14 @@ static int ath6kl_remain_on_channel(struct wiphy *wiphy, | |||
1797 | u64 *cookie) | 1812 | u64 *cookie) |
1798 | { | 1813 | { |
1799 | struct ath6kl *ar = ath6kl_priv(dev); | 1814 | struct ath6kl *ar = ath6kl_priv(dev); |
1815 | struct ath6kl_vif *vif = netdev_priv(dev); | ||
1800 | 1816 | ||
1801 | /* TODO: if already pending or ongoing remain-on-channel, | 1817 | /* TODO: if already pending or ongoing remain-on-channel, |
1802 | * return -EBUSY */ | 1818 | * return -EBUSY */ |
1803 | *cookie = 1; /* only a single pending request is supported */ | 1819 | *cookie = 1; /* only a single pending request is supported */ |
1804 | 1820 | ||
1805 | return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, chan->center_freq, | 1821 | return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx, |
1806 | duration); | 1822 | chan->center_freq, duration); |
1807 | } | 1823 | } |
1808 | 1824 | ||
1809 | static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy, | 1825 | static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy, |
@@ -1811,16 +1827,19 @@ static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy, | |||
1811 | u64 cookie) | 1827 | u64 cookie) |
1812 | { | 1828 | { |
1813 | struct ath6kl *ar = ath6kl_priv(dev); | 1829 | struct ath6kl *ar = ath6kl_priv(dev); |
1830 | struct ath6kl_vif *vif = netdev_priv(dev); | ||
1814 | 1831 | ||
1815 | if (cookie != 1) | 1832 | if (cookie != 1) |
1816 | return -ENOENT; | 1833 | return -ENOENT; |
1817 | 1834 | ||
1818 | return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi); | 1835 | return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx); |
1819 | } | 1836 | } |
1820 | 1837 | ||
1821 | static int ath6kl_send_go_probe_resp(struct ath6kl *ar, const u8 *buf, | 1838 | static int ath6kl_send_go_probe_resp(struct ath6kl_vif *vif, |
1822 | size_t len, unsigned int freq) | 1839 | const u8 *buf, size_t len, |
1840 | unsigned int freq) | ||
1823 | { | 1841 | { |
1842 | struct ath6kl *ar = vif->ar; | ||
1824 | const u8 *pos; | 1843 | const u8 *pos; |
1825 | u8 *p2p; | 1844 | u8 *p2p; |
1826 | int p2p_len; | 1845 | int p2p_len; |
@@ -1847,8 +1866,8 @@ static int ath6kl_send_go_probe_resp(struct ath6kl *ar, const u8 *buf, | |||
1847 | pos += 2 + pos[1]; | 1866 | pos += 2 + pos[1]; |
1848 | } | 1867 | } |
1849 | 1868 | ||
1850 | ret = ath6kl_wmi_send_probe_response_cmd(ar->wmi, freq, mgmt->da, | 1869 | ret = ath6kl_wmi_send_probe_response_cmd(ar->wmi, vif->fw_vif_idx, freq, |
1851 | p2p, p2p_len); | 1870 | mgmt->da, p2p, p2p_len); |
1852 | kfree(p2p); | 1871 | kfree(p2p); |
1853 | return ret; | 1872 | return ret; |
1854 | } | 1873 | } |
@@ -1874,7 +1893,7 @@ static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct net_device *dev, | |||
1874 | * command to allow the target to fill in the generic IEs. | 1893 | * command to allow the target to fill in the generic IEs. |
1875 | */ | 1894 | */ |
1876 | *cookie = 0; /* TX status not supported */ | 1895 | *cookie = 0; /* TX status not supported */ |
1877 | return ath6kl_send_go_probe_resp(ar, buf, len, | 1896 | return ath6kl_send_go_probe_resp(vif, buf, len, |
1878 | chan->center_freq); | 1897 | chan->center_freq); |
1879 | } | 1898 | } |
1880 | 1899 | ||
@@ -1888,7 +1907,8 @@ static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct net_device *dev, | |||
1888 | } | 1907 | } |
1889 | 1908 | ||
1890 | *cookie = id; | 1909 | *cookie = id; |
1891 | return ath6kl_wmi_send_action_cmd(ar->wmi, id, chan->center_freq, wait, | 1910 | return ath6kl_wmi_send_action_cmd(ar->wmi, vif->fw_vif_idx, id, |
1911 | chan->center_freq, wait, | ||
1892 | buf, len); | 1912 | buf, len); |
1893 | } | 1913 | } |
1894 | 1914 | ||
@@ -2093,7 +2113,7 @@ void ath6kl_deinit_if_data(struct ath6kl_vif *vif) | |||
2093 | } | 2113 | } |
2094 | 2114 | ||
2095 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | 2115 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, |
2096 | enum nl80211_iftype type) | 2116 | enum nl80211_iftype type, u8 fw_vif_idx) |
2097 | { | 2117 | { |
2098 | struct net_device *ndev; | 2118 | struct net_device *ndev; |
2099 | struct ath6kl_vif *vif; | 2119 | struct ath6kl_vif *vif; |
@@ -2111,6 +2131,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | |||
2111 | SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy)); | 2131 | SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy)); |
2112 | vif->wdev.netdev = ndev; | 2132 | vif->wdev.netdev = ndev; |
2113 | vif->wdev.iftype = type; | 2133 | vif->wdev.iftype = type; |
2134 | vif->fw_vif_idx = fw_vif_idx; | ||
2114 | ar->wdev = &vif->wdev; | 2135 | ar->wdev = &vif->wdev; |
2115 | ar->net_dev = ndev; | 2136 | ar->net_dev = ndev; |
2116 | 2137 | ||