diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-03-30 02:10:28 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-04-13 15:23:11 -0400 |
commit | 3afec63957658d4c0fe5a25636a10b12bde9bad6 (patch) | |
tree | ad5d772dbe687b309fd7119ef66018d1fd7e2976 /drivers/net/wireless/iwlwifi/mvm/d3.c | |
parent | 73e5f2c5d76264743ec75f96f3dc3932fff52171 (diff) |
iwlwifi: remove IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API flag
All the supported firmwares have this flag set.
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/d3.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/d3.c | 72 |
1 files changed, 22 insertions, 50 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c index e56f5a0edf85..5c9f14d1a4e0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/iwlwifi/mvm/d3.c | |||
@@ -744,10 +744,8 @@ static int iwl_mvm_get_last_nonqos_seq(struct iwl_mvm *mvm, | |||
744 | int err; | 744 | int err; |
745 | u32 size; | 745 | u32 size; |
746 | 746 | ||
747 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API) { | 747 | cmd.data[0] = &query_cmd; |
748 | cmd.data[0] = &query_cmd; | 748 | cmd.len[0] = sizeof(query_cmd); |
749 | cmd.len[0] = sizeof(query_cmd); | ||
750 | } | ||
751 | 749 | ||
752 | err = iwl_mvm_send_cmd(mvm, &cmd); | 750 | err = iwl_mvm_send_cmd(mvm, &cmd); |
753 | if (err) | 751 | if (err) |
@@ -758,10 +756,8 @@ static int iwl_mvm_get_last_nonqos_seq(struct iwl_mvm *mvm, | |||
758 | err = -EINVAL; | 756 | err = -EINVAL; |
759 | } else { | 757 | } else { |
760 | err = le16_to_cpup((__le16 *)cmd.resp_pkt->data); | 758 | err = le16_to_cpup((__le16 *)cmd.resp_pkt->data); |
761 | /* new API returns next, not last-used seqno */ | 759 | /* firmware returns next, not last-used seqno */ |
762 | if (mvm->fw->ucode_capa.flags & | 760 | err = (u16) (err - 0x10); |
763 | IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API) | ||
764 | err = (u16) (err - 0x10); | ||
765 | } | 761 | } |
766 | 762 | ||
767 | iwl_free_resp(&cmd); | 763 | iwl_free_resp(&cmd); |
@@ -785,10 +781,6 @@ void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
785 | 781 | ||
786 | mvmvif->seqno_valid = false; | 782 | mvmvif->seqno_valid = false; |
787 | 783 | ||
788 | if (!(mvm->fw->ucode_capa.flags & | ||
789 | IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API)) | ||
790 | return; | ||
791 | |||
792 | if (iwl_mvm_send_cmd_pdu(mvm, NON_QOS_TX_COUNTER_CMD, CMD_SYNC, | 784 | if (iwl_mvm_send_cmd_pdu(mvm, NON_QOS_TX_COUNTER_CMD, CMD_SYNC, |
793 | sizeof(query_cmd), &query_cmd)) | 785 | sizeof(query_cmd), &query_cmd)) |
794 | IWL_ERR(mvm, "failed to set non-QoS seqno\n"); | 786 | IWL_ERR(mvm, "failed to set non-QoS seqno\n"); |
@@ -1277,7 +1269,7 @@ static void iwl_mvm_set_tkip_rx_seq(struct tkip_sc *scs, | |||
1277 | } | 1269 | } |
1278 | 1270 | ||
1279 | static void iwl_mvm_set_key_rx_seq(struct ieee80211_key_conf *key, | 1271 | static void iwl_mvm_set_key_rx_seq(struct ieee80211_key_conf *key, |
1280 | struct iwl_wowlan_status_v6 *status) | 1272 | struct iwl_wowlan_status *status) |
1281 | { | 1273 | { |
1282 | union iwl_all_tsc_rsc *rsc = &status->gtk.rsc.all_tsc_rsc; | 1274 | union iwl_all_tsc_rsc *rsc = &status->gtk.rsc.all_tsc_rsc; |
1283 | 1275 | ||
@@ -1294,7 +1286,7 @@ static void iwl_mvm_set_key_rx_seq(struct ieee80211_key_conf *key, | |||
1294 | } | 1286 | } |
1295 | 1287 | ||
1296 | struct iwl_mvm_d3_gtk_iter_data { | 1288 | struct iwl_mvm_d3_gtk_iter_data { |
1297 | struct iwl_wowlan_status_v6 *status; | 1289 | struct iwl_wowlan_status *status; |
1298 | void *last_gtk; | 1290 | void *last_gtk; |
1299 | u32 cipher; | 1291 | u32 cipher; |
1300 | bool find_phase, unhandled_cipher; | 1292 | bool find_phase, unhandled_cipher; |
@@ -1370,7 +1362,7 @@ static void iwl_mvm_d3_update_gtks(struct ieee80211_hw *hw, | |||
1370 | 1362 | ||
1371 | static bool iwl_mvm_setup_connection_keep(struct iwl_mvm *mvm, | 1363 | static bool iwl_mvm_setup_connection_keep(struct iwl_mvm *mvm, |
1372 | struct ieee80211_vif *vif, | 1364 | struct ieee80211_vif *vif, |
1373 | struct iwl_wowlan_status_v6 *status) | 1365 | struct iwl_wowlan_status *status) |
1374 | { | 1366 | { |
1375 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 1367 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
1376 | struct iwl_mvm_d3_gtk_iter_data gtkdata = { | 1368 | struct iwl_mvm_d3_gtk_iter_data gtkdata = { |
@@ -1468,7 +1460,7 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, | |||
1468 | .flags = CMD_SYNC | CMD_WANT_SKB, | 1460 | .flags = CMD_SYNC | CMD_WANT_SKB, |
1469 | }; | 1461 | }; |
1470 | struct iwl_wowlan_status_data status; | 1462 | struct iwl_wowlan_status_data status; |
1471 | struct iwl_wowlan_status_v6 *status_v6; | 1463 | struct iwl_wowlan_status *fw_status; |
1472 | int ret, len, status_size, i; | 1464 | int ret, len, status_size, i; |
1473 | bool keep; | 1465 | bool keep; |
1474 | struct ieee80211_sta *ap_sta; | 1466 | struct ieee80211_sta *ap_sta; |
@@ -1505,10 +1497,7 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, | |||
1505 | if (!cmd.resp_pkt) | 1497 | if (!cmd.resp_pkt) |
1506 | goto out_unlock; | 1498 | goto out_unlock; |
1507 | 1499 | ||
1508 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API) | 1500 | status_size = sizeof(*fw_status); |
1509 | status_size = sizeof(struct iwl_wowlan_status_v6); | ||
1510 | else | ||
1511 | status_size = sizeof(struct iwl_wowlan_status_v4); | ||
1512 | 1501 | ||
1513 | len = iwl_rx_packet_payload_len(cmd.resp_pkt); | 1502 | len = iwl_rx_packet_payload_len(cmd.resp_pkt); |
1514 | if (len < status_size) { | 1503 | if (len < status_size) { |
@@ -1516,35 +1505,18 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, | |||
1516 | goto out_free_resp; | 1505 | goto out_free_resp; |
1517 | } | 1506 | } |
1518 | 1507 | ||
1519 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_D3_CONTINUITY_API) { | 1508 | fw_status = (void *)cmd.resp_pkt->data; |
1520 | status_v6 = (void *)cmd.resp_pkt->data; | 1509 | |
1521 | 1510 | status.pattern_number = le16_to_cpu(fw_status->pattern_number); | |
1522 | status.pattern_number = le16_to_cpu(status_v6->pattern_number); | 1511 | for (i = 0; i < 8; i++) |
1523 | for (i = 0; i < 8; i++) | 1512 | status.qos_seq_ctr[i] = |
1524 | status.qos_seq_ctr[i] = | 1513 | le16_to_cpu(fw_status->qos_seq_ctr[i]); |
1525 | le16_to_cpu(status_v6->qos_seq_ctr[i]); | 1514 | status.wakeup_reasons = le32_to_cpu(fw_status->wakeup_reasons); |
1526 | status.wakeup_reasons = le32_to_cpu(status_v6->wakeup_reasons); | 1515 | status.wake_packet_length = |
1527 | status.wake_packet_length = | 1516 | le32_to_cpu(fw_status->wake_packet_length); |
1528 | le32_to_cpu(status_v6->wake_packet_length); | 1517 | status.wake_packet_bufsize = |
1529 | status.wake_packet_bufsize = | 1518 | le32_to_cpu(fw_status->wake_packet_bufsize); |
1530 | le32_to_cpu(status_v6->wake_packet_bufsize); | 1519 | status.wake_packet = fw_status->wake_packet; |
1531 | status.wake_packet = status_v6->wake_packet; | ||
1532 | } else { | ||
1533 | struct iwl_wowlan_status_v4 *status_v4; | ||
1534 | status_v6 = NULL; | ||
1535 | status_v4 = (void *)cmd.resp_pkt->data; | ||
1536 | |||
1537 | status.pattern_number = le16_to_cpu(status_v4->pattern_number); | ||
1538 | for (i = 0; i < 8; i++) | ||
1539 | status.qos_seq_ctr[i] = | ||
1540 | le16_to_cpu(status_v4->qos_seq_ctr[i]); | ||
1541 | status.wakeup_reasons = le32_to_cpu(status_v4->wakeup_reasons); | ||
1542 | status.wake_packet_length = | ||
1543 | le32_to_cpu(status_v4->wake_packet_length); | ||
1544 | status.wake_packet_bufsize = | ||
1545 | le32_to_cpu(status_v4->wake_packet_bufsize); | ||
1546 | status.wake_packet = status_v4->wake_packet; | ||
1547 | } | ||
1548 | 1520 | ||
1549 | if (len != status_size + ALIGN(status.wake_packet_bufsize, 4)) { | 1521 | if (len != status_size + ALIGN(status.wake_packet_bufsize, 4)) { |
1550 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); | 1522 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); |
@@ -1571,7 +1543,7 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, | |||
1571 | 1543 | ||
1572 | iwl_mvm_report_wakeup_reasons(mvm, vif, &status); | 1544 | iwl_mvm_report_wakeup_reasons(mvm, vif, &status); |
1573 | 1545 | ||
1574 | keep = iwl_mvm_setup_connection_keep(mvm, vif, status_v6); | 1546 | keep = iwl_mvm_setup_connection_keep(mvm, vif, fw_status); |
1575 | 1547 | ||
1576 | iwl_free_resp(&cmd); | 1548 | iwl_free_resp(&cmd); |
1577 | return keep; | 1549 | return keep; |