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/main.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/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/main.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index fff1f4a57c17..992990192cd9 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); | 444 | ath6kl_disconnect(ar, vif->fw_vif_idx); |
445 | if (!keep_profile) | 445 | if (!keep_profile) |
446 | ath6kl_init_profile_info(ar); | 446 | ath6kl_init_profile_info(ar); |
447 | 447 | ||
@@ -511,7 +511,7 @@ static void ath6kl_install_static_wep_keys(struct ath6kl *ar) | |||
511 | if (index == vif->def_txkey_index) | 511 | if (index == vif->def_txkey_index) |
512 | keyusage |= TX_USAGE; | 512 | keyusage |= TX_USAGE; |
513 | 513 | ||
514 | ath6kl_wmi_addkey_cmd(ar->wmi, | 514 | ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, |
515 | index, | 515 | index, |
516 | WEP_CRYPT, | 516 | WEP_CRYPT, |
517 | keyusage, | 517 | keyusage, |
@@ -551,7 +551,7 @@ void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel) | |||
551 | "the initial group key for AP mode\n"); | 551 | "the initial group key for AP mode\n"); |
552 | memset(key_rsc, 0, sizeof(key_rsc)); | 552 | memset(key_rsc, 0, sizeof(key_rsc)); |
553 | res = ath6kl_wmi_addkey_cmd( | 553 | res = ath6kl_wmi_addkey_cmd( |
554 | ar->wmi, ik->key_index, ik->key_type, | 554 | ar->wmi, vif->fw_vif_idx, ik->key_index, ik->key_type, |
555 | GROUP_USAGE, ik->key_len, key_rsc, ik->key, | 555 | GROUP_USAGE, ik->key_len, key_rsc, ik->key, |
556 | KEY_OP_INIT_VAL, NULL, SYNC_BOTH_WMIFLAG); | 556 | KEY_OP_INIT_VAL, NULL, SYNC_BOTH_WMIFLAG); |
557 | if (res) { | 557 | if (res) { |
@@ -913,20 +913,20 @@ void ath6k_credit_distribute(struct htc_credit_state_info *cred_info, | |||
913 | void disconnect_timer_handler(unsigned long ptr) | 913 | void disconnect_timer_handler(unsigned long ptr) |
914 | { | 914 | { |
915 | struct net_device *dev = (struct net_device *)ptr; | 915 | struct net_device *dev = (struct net_device *)ptr; |
916 | struct ath6kl *ar = ath6kl_priv(dev); | 916 | struct ath6kl_vif *vif = netdev_priv(dev); |
917 | 917 | ||
918 | ath6kl_init_profile_info(ar); | 918 | ath6kl_init_profile_info(vif->ar); |
919 | ath6kl_disconnect(ar); | 919 | ath6kl_disconnect(vif->ar, vif->fw_vif_idx); |
920 | } | 920 | } |
921 | 921 | ||
922 | void ath6kl_disconnect(struct ath6kl *ar) | 922 | void ath6kl_disconnect(struct ath6kl *ar, u8 if_idx) |
923 | { | 923 | { |
924 | /* TODO: Pass vif instead of taking it from ar */ | 924 | /* TODO: Pass vif instead of taking it from ar */ |
925 | struct ath6kl_vif *vif = ar->vif; | 925 | struct ath6kl_vif *vif = ar->vif; |
926 | 926 | ||
927 | if (test_bit(CONNECTED, &vif->flags) || | 927 | if (test_bit(CONNECTED, &vif->flags) || |
928 | test_bit(CONNECT_PEND, &vif->flags)) { | 928 | test_bit(CONNECT_PEND, &vif->flags)) { |
929 | ath6kl_wmi_disconnect_cmd(ar->wmi); | 929 | ath6kl_wmi_disconnect_cmd(ar->wmi, if_idx); |
930 | /* | 930 | /* |
931 | * Disconnect command is issued, clear the connect pending | 931 | * Disconnect command is issued, clear the connect pending |
932 | * flag. The connected flag will be cleared in | 932 | * flag. The connected flag will be cleared in |
@@ -961,13 +961,13 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar) | |||
961 | 961 | ||
962 | if (test_bit(CONNECTED, &vif->flags) || | 962 | if (test_bit(CONNECTED, &vif->flags) || |
963 | test_bit(CONNECT_PEND, &vif->flags)) | 963 | test_bit(CONNECT_PEND, &vif->flags)) |
964 | ath6kl_wmi_disconnect_cmd(ar->wmi); | 964 | ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); |
965 | 965 | ||
966 | vif->sme_state = SME_DISCONNECTED; | 966 | vif->sme_state = SME_DISCONNECTED; |
967 | 967 | ||
968 | /* disable scanning */ | 968 | /* disable scanning */ |
969 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, 0xFFFF, 0, 0, 0, 0, 0, 0, 0, | 969 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0, |
970 | 0, 0) != 0) | 970 | 0, 0, 0, 0, 0, 0, 0) != 0) |
971 | printk(KERN_WARNING "ath6kl: failed to disable scan " | 971 | printk(KERN_WARNING "ath6kl: failed to disable scan " |
972 | "during suspend\n"); | 972 | "during suspend\n"); |
973 | 973 | ||
@@ -976,7 +976,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar) | |||
976 | /* save the current power mode before enabling power save */ | 976 | /* save the current power mode before enabling power save */ |
977 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; | 977 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; |
978 | 978 | ||
979 | if (ath6kl_wmi_powermode_cmd(ar->wmi, REC_POWER) != 0) | 979 | if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0) |
980 | ath6kl_warn("ath6kl_deep_sleep_enable: " | 980 | ath6kl_warn("ath6kl_deep_sleep_enable: " |
981 | "wmi_powermode_cmd failed\n"); | 981 | "wmi_powermode_cmd failed\n"); |
982 | } | 982 | } |
@@ -1061,7 +1061,8 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid, | |||
1061 | vif->bss_ch = channel; | 1061 | vif->bss_ch = channel; |
1062 | 1062 | ||
1063 | if ((vif->nw_type == INFRA_NETWORK)) | 1063 | if ((vif->nw_type == INFRA_NETWORK)) |
1064 | ath6kl_wmi_listeninterval_cmd(ar->wmi, ar->listen_intvl_t, | 1064 | ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, |
1065 | ar->listen_intvl_t, | ||
1065 | ar->listen_intvl_b); | 1066 | ar->listen_intvl_b); |
1066 | 1067 | ||
1067 | netif_wake_queue(ar->net_dev); | 1068 | netif_wake_queue(ar->net_dev); |
@@ -1280,6 +1281,8 @@ void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid) | |||
1280 | struct ath6kl_sta *conn; | 1281 | struct ath6kl_sta *conn; |
1281 | struct sk_buff *skb; | 1282 | struct sk_buff *skb; |
1282 | bool psq_empty = false; | 1283 | bool psq_empty = false; |
1284 | /* TODO: Pass vif instead of taking it from ar */ | ||
1285 | struct ath6kl_vif *vif = ar->vif; | ||
1283 | 1286 | ||
1284 | conn = ath6kl_find_sta_by_aid(ar, aid); | 1287 | conn = ath6kl_find_sta_by_aid(ar, aid); |
1285 | 1288 | ||
@@ -1310,7 +1313,7 @@ void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid) | |||
1310 | spin_unlock_bh(&conn->psq_lock); | 1313 | spin_unlock_bh(&conn->psq_lock); |
1311 | 1314 | ||
1312 | if (psq_empty) | 1315 | if (psq_empty) |
1313 | ath6kl_wmi_set_pvb_cmd(ar->wmi, conn->aid, 0); | 1316 | ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, conn->aid, 0); |
1314 | } | 1317 | } |
1315 | 1318 | ||
1316 | void ath6kl_dtimexpiry_event(struct ath6kl *ar) | 1319 | void ath6kl_dtimexpiry_event(struct ath6kl *ar) |
@@ -1355,7 +1358,7 @@ void ath6kl_dtimexpiry_event(struct ath6kl *ar) | |||
1355 | clear_bit(DTIM_EXPIRED, &vif->flags); | 1358 | clear_bit(DTIM_EXPIRED, &vif->flags); |
1356 | 1359 | ||
1357 | /* clear the LSB of the BitMapCtl field of the TIM IE */ | 1360 | /* clear the LSB of the BitMapCtl field of the TIM IE */ |
1358 | ath6kl_wmi_set_pvb_cmd(ar->wmi, MCAST_AID, 0); | 1361 | ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, MCAST_AID, 0); |
1359 | } | 1362 | } |
1360 | 1363 | ||
1361 | void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid, | 1364 | void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid, |
@@ -1377,7 +1380,8 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid, | |||
1377 | 1380 | ||
1378 | /* clear the LSB of the TIM IE's BitMapCtl field */ | 1381 | /* clear the LSB of the TIM IE's BitMapCtl field */ |
1379 | if (test_bit(WMI_READY, &ar->flag)) | 1382 | if (test_bit(WMI_READY, &ar->flag)) |
1380 | ath6kl_wmi_set_pvb_cmd(ar->wmi, MCAST_AID, 0); | 1383 | ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, |
1384 | MCAST_AID, 0); | ||
1381 | } | 1385 | } |
1382 | 1386 | ||
1383 | if (!is_broadcast_ether_addr(bssid)) { | 1387 | if (!is_broadcast_ether_addr(bssid)) { |
@@ -1468,11 +1472,11 @@ static int ath6kl_close(struct net_device *dev) | |||
1468 | 1472 | ||
1469 | netif_stop_queue(dev); | 1473 | netif_stop_queue(dev); |
1470 | 1474 | ||
1471 | ath6kl_disconnect(ar); | 1475 | ath6kl_disconnect(ar, vif->fw_vif_idx); |
1472 | 1476 | ||
1473 | if (test_bit(WMI_READY, &ar->flag)) { | 1477 | if (test_bit(WMI_READY, &ar->flag)) { |
1474 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, 0xFFFF, 0, 0, 0, 0, 0, 0, | 1478 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, |
1475 | 0, 0, 0)) | 1479 | 0, 0, 0, 0, 0, 0, 0, 0, 0)) |
1476 | return -EIO; | 1480 | return -EIO; |
1477 | 1481 | ||
1478 | clear_bit(WLAN_ENABLED, &vif->flags); | 1482 | clear_bit(WLAN_ENABLED, &vif->flags); |