diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mvm.h')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 191 |
1 files changed, 135 insertions, 56 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index d2cf751db68d..7ba5bc2ed1c4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
| 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
| 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
| 11 | * Copyright(c) 2018 Intel Corporation | ||
| 11 | * | 12 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
| @@ -18,11 +19,6 @@ | |||
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * General Public License for more details. | 20 | * General Public License for more details. |
| 20 | * | 21 | * |
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program; if not, write to the Free Software | ||
| 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, | ||
| 24 | * USA | ||
| 25 | * | ||
| 26 | * The full GNU General Public License is included in this distribution | 22 | * The full GNU General Public License is included in this distribution |
| 27 | * in the file called COPYING. | 23 | * in the file called COPYING. |
| 28 | * | 24 | * |
| @@ -35,6 +31,7 @@ | |||
| 35 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
| 36 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
| 37 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
| 34 | * Copyright(c) 2018 Intel Corporation | ||
| 38 | * All rights reserved. | 35 | * All rights reserved. |
| 39 | * | 36 | * |
| 40 | * Redistribution and use in source and binary forms, with or without | 37 | * Redistribution and use in source and binary forms, with or without |
| @@ -90,7 +87,9 @@ | |||
| 90 | #include "fw/runtime.h" | 87 | #include "fw/runtime.h" |
| 91 | #include "fw/dbg.h" | 88 | #include "fw/dbg.h" |
| 92 | #include "fw/acpi.h" | 89 | #include "fw/acpi.h" |
| 93 | #include "fw/debugfs.h" | 90 | #include "iwl-nvm-parse.h" |
| 91 | |||
| 92 | #include <linux/average.h> | ||
| 94 | 93 | ||
| 95 | #define IWL_MVM_MAX_ADDRESSES 5 | 94 | #define IWL_MVM_MAX_ADDRESSES 5 |
| 96 | /* RSSI offset for WkP */ | 95 | /* RSSI offset for WkP */ |
| @@ -332,6 +331,18 @@ struct iwl_mvm_vif_bf_data { | |||
| 332 | }; | 331 | }; |
| 333 | 332 | ||
| 334 | /** | 333 | /** |
| 334 | * struct iwl_probe_resp_data - data for NoA/CSA updates | ||
| 335 | * @rcu_head: used for freeing the data on update | ||
| 336 | * @notif: notification data | ||
| 337 | * @noa_len: length of NoA attribute, calculated from the notification | ||
| 338 | */ | ||
| 339 | struct iwl_probe_resp_data { | ||
| 340 | struct rcu_head rcu_head; | ||
| 341 | struct iwl_probe_resp_data_notif notif; | ||
| 342 | int noa_len; | ||
| 343 | }; | ||
| 344 | |||
| 345 | /** | ||
| 335 | * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context | 346 | * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context |
| 336 | * @id: between 0 and 3 | 347 | * @id: between 0 and 3 |
| 337 | * @color: to solve races upon MAC addition and removal | 348 | * @color: to solve races upon MAC addition and removal |
| @@ -361,6 +372,8 @@ struct iwl_mvm_vif_bf_data { | |||
| 361 | * average signal of beacons retrieved from the firmware | 372 | * average signal of beacons retrieved from the firmware |
| 362 | * @csa_failed: CSA failed to schedule time event, report an error later | 373 | * @csa_failed: CSA failed to schedule time event, report an error later |
| 363 | * @features: hw features active for this vif | 374 | * @features: hw features active for this vif |
| 375 | * @probe_resp_data: data from FW notification to store NOA and CSA related | ||
| 376 | * data to be inserted into probe response. | ||
| 364 | */ | 377 | */ |
| 365 | struct iwl_mvm_vif { | 378 | struct iwl_mvm_vif { |
| 366 | struct iwl_mvm *mvm; | 379 | struct iwl_mvm *mvm; |
| @@ -444,6 +457,8 @@ struct iwl_mvm_vif { | |||
| 444 | /* FW identified misbehaving AP */ | 457 | /* FW identified misbehaving AP */ |
| 445 | u8 uapsd_misbehaving_bssid[ETH_ALEN]; | 458 | u8 uapsd_misbehaving_bssid[ETH_ALEN]; |
| 446 | 459 | ||
| 460 | struct delayed_work uapsd_nonagg_detected_wk; | ||
| 461 | |||
| 447 | /* Indicates that CSA countdown may be started */ | 462 | /* Indicates that CSA countdown may be started */ |
| 448 | bool csa_countdown; | 463 | bool csa_countdown; |
| 449 | bool csa_failed; | 464 | bool csa_failed; |
| @@ -454,6 +469,9 @@ struct iwl_mvm_vif { | |||
| 454 | 469 | ||
| 455 | /* TCP Checksum Offload */ | 470 | /* TCP Checksum Offload */ |
| 456 | netdev_features_t features; | 471 | netdev_features_t features; |
| 472 | |||
| 473 | struct iwl_probe_resp_data __rcu *probe_resp_data; | ||
| 474 | struct ieee80211_key_conf *ap_wep_key; | ||
| 457 | }; | 475 | }; |
| 458 | 476 | ||
| 459 | static inline struct iwl_mvm_vif * | 477 | static inline struct iwl_mvm_vif * |
| @@ -494,6 +512,7 @@ enum iwl_mvm_scan_type { | |||
| 494 | IWL_SCAN_TYPE_WILD, | 512 | IWL_SCAN_TYPE_WILD, |
| 495 | IWL_SCAN_TYPE_MILD, | 513 | IWL_SCAN_TYPE_MILD, |
| 496 | IWL_SCAN_TYPE_FRAGMENTED, | 514 | IWL_SCAN_TYPE_FRAGMENTED, |
| 515 | IWL_SCAN_TYPE_FAST_BALANCE, | ||
| 497 | }; | 516 | }; |
| 498 | 517 | ||
| 499 | enum iwl_mvm_sched_scan_pass_all_states { | 518 | enum iwl_mvm_sched_scan_pass_all_states { |
| @@ -503,18 +522,6 @@ enum iwl_mvm_sched_scan_pass_all_states { | |||
| 503 | }; | 522 | }; |
| 504 | 523 | ||
| 505 | /** | 524 | /** |
| 506 | * struct iwl_nvm_section - describes an NVM section in memory. | ||
| 507 | * | ||
| 508 | * This struct holds an NVM section read from the NIC using NVM_ACCESS_CMD, | ||
| 509 | * and saved for later use by the driver. Not all NVM sections are saved | ||
| 510 | * this way, only the needed ones. | ||
| 511 | */ | ||
| 512 | struct iwl_nvm_section { | ||
| 513 | u16 length; | ||
| 514 | const u8 *data; | ||
| 515 | }; | ||
| 516 | |||
| 517 | /** | ||
| 518 | * struct iwl_mvm_tt_mgnt - Thermal Throttling Management structure | 525 | * struct iwl_mvm_tt_mgnt - Thermal Throttling Management structure |
| 519 | * @ct_kill_exit: worker to exit thermal kill | 526 | * @ct_kill_exit: worker to exit thermal kill |
| 520 | * @dynamic_smps: Is thermal throttling enabled dynamic_smps? | 527 | * @dynamic_smps: Is thermal throttling enabled dynamic_smps? |
| @@ -595,6 +602,53 @@ enum iwl_mvm_tdls_cs_state { | |||
| 595 | IWL_MVM_TDLS_SW_ACTIVE, | 602 | IWL_MVM_TDLS_SW_ACTIVE, |
| 596 | }; | 603 | }; |
| 597 | 604 | ||
| 605 | enum iwl_mvm_traffic_load { | ||
| 606 | IWL_MVM_TRAFFIC_LOW, | ||
| 607 | IWL_MVM_TRAFFIC_MEDIUM, | ||
| 608 | IWL_MVM_TRAFFIC_HIGH, | ||
| 609 | }; | ||
| 610 | |||
| 611 | DECLARE_EWMA(rate, 16, 16) | ||
| 612 | |||
| 613 | struct iwl_mvm_tcm_mac { | ||
| 614 | struct { | ||
| 615 | u32 pkts[IEEE80211_NUM_ACS]; | ||
| 616 | u32 airtime; | ||
| 617 | } tx; | ||
| 618 | struct { | ||
| 619 | u32 pkts[IEEE80211_NUM_ACS]; | ||
| 620 | u32 airtime; | ||
| 621 | u32 last_ampdu_ref; | ||
| 622 | } rx; | ||
| 623 | struct { | ||
| 624 | /* track AP's transfer in client mode */ | ||
| 625 | u64 rx_bytes; | ||
| 626 | struct ewma_rate rate; | ||
| 627 | bool detected; | ||
| 628 | } uapsd_nonagg_detect; | ||
| 629 | bool opened_rx_ba_sessions; | ||
| 630 | }; | ||
| 631 | |||
| 632 | struct iwl_mvm_tcm { | ||
| 633 | struct delayed_work work; | ||
| 634 | spinlock_t lock; /* used when time elapsed */ | ||
| 635 | unsigned long ts; /* timestamp when period ends */ | ||
| 636 | unsigned long ll_ts; | ||
| 637 | unsigned long uapsd_nonagg_ts; | ||
| 638 | bool paused; | ||
| 639 | struct iwl_mvm_tcm_mac data[NUM_MAC_INDEX_DRIVER]; | ||
| 640 | struct { | ||
| 641 | u32 elapsed; /* milliseconds for this TCM period */ | ||
| 642 | u32 airtime[NUM_MAC_INDEX_DRIVER]; | ||
| 643 | enum iwl_mvm_traffic_load load[NUM_MAC_INDEX_DRIVER]; | ||
| 644 | enum iwl_mvm_traffic_load band_load[NUM_NL80211_BANDS]; | ||
| 645 | enum iwl_mvm_traffic_load global_load; | ||
| 646 | bool low_latency[NUM_MAC_INDEX_DRIVER]; | ||
| 647 | bool change[NUM_MAC_INDEX_DRIVER]; | ||
| 648 | bool global_change; | ||
| 649 | } result; | ||
| 650 | }; | ||
| 651 | |||
| 598 | /** | 652 | /** |
| 599 | * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer | 653 | * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer |
| 600 | * @head_sn: reorder window head sn | 654 | * @head_sn: reorder window head sn |
| @@ -613,7 +667,7 @@ enum iwl_mvm_tdls_cs_state { | |||
| 613 | struct iwl_mvm_reorder_buffer { | 667 | struct iwl_mvm_reorder_buffer { |
| 614 | u16 head_sn; | 668 | u16 head_sn; |
| 615 | u16 num_stored; | 669 | u16 num_stored; |
| 616 | u8 buf_size; | 670 | u16 buf_size; |
| 617 | int queue; | 671 | int queue; |
| 618 | u16 last_amsdu; | 672 | u16 last_amsdu; |
| 619 | u8 last_sub_index; | 673 | u8 last_sub_index; |
| @@ -700,24 +754,12 @@ iwl_mvm_baid_data_from_reorder_buf(struct iwl_mvm_reorder_buffer *buf) | |||
| 700 | * This is a state in which a single queue serves more than one TID, all of | 754 | * This is a state in which a single queue serves more than one TID, all of |
| 701 | * which are not aggregated. Note that the queue is only associated to one | 755 | * which are not aggregated. Note that the queue is only associated to one |
| 702 | * RA. | 756 | * RA. |
| 703 | * @IWL_MVM_QUEUE_INACTIVE: queue is allocated but no traffic on it | ||
| 704 | * This is a state of a queue that has had traffic on it, but during the | ||
| 705 | * last %IWL_MVM_DQA_QUEUE_TIMEOUT time period there has been no traffic on | ||
| 706 | * it. In this state, when a new queue is needed to be allocated but no | ||
| 707 | * such free queue exists, an inactive queue might be freed and given to | ||
| 708 | * the new RA/TID. | ||
| 709 | * @IWL_MVM_QUEUE_RECONFIGURING: queue is being reconfigured | ||
| 710 | * This is the state of a queue that has had traffic pass through it, but | ||
| 711 | * needs to be reconfigured for some reason, e.g. the queue needs to | ||
| 712 | * become unshared and aggregations re-enabled on. | ||
| 713 | */ | 757 | */ |
| 714 | enum iwl_mvm_queue_status { | 758 | enum iwl_mvm_queue_status { |
| 715 | IWL_MVM_QUEUE_FREE, | 759 | IWL_MVM_QUEUE_FREE, |
| 716 | IWL_MVM_QUEUE_RESERVED, | 760 | IWL_MVM_QUEUE_RESERVED, |
| 717 | IWL_MVM_QUEUE_READY, | 761 | IWL_MVM_QUEUE_READY, |
| 718 | IWL_MVM_QUEUE_SHARED, | 762 | IWL_MVM_QUEUE_SHARED, |
| 719 | IWL_MVM_QUEUE_INACTIVE, | ||
| 720 | IWL_MVM_QUEUE_RECONFIGURING, | ||
| 721 | }; | 763 | }; |
| 722 | 764 | ||
| 723 | #define IWL_MVM_DQA_QUEUE_TIMEOUT (5 * HZ) | 765 | #define IWL_MVM_DQA_QUEUE_TIMEOUT (5 * HZ) |
| @@ -734,6 +776,17 @@ struct iwl_mvm_geo_profile { | |||
| 734 | u8 values[ACPI_GEO_TABLE_SIZE]; | 776 | u8 values[ACPI_GEO_TABLE_SIZE]; |
| 735 | }; | 777 | }; |
| 736 | 778 | ||
| 779 | struct iwl_mvm_dqa_txq_info { | ||
| 780 | u8 ra_sta_id; /* The RA this queue is mapped to, if exists */ | ||
| 781 | bool reserved; /* Is this the TXQ reserved for a STA */ | ||
| 782 | u8 mac80211_ac; /* The mac80211 AC this queue is mapped to */ | ||
| 783 | u8 txq_tid; /* The TID "owner" of this queue*/ | ||
| 784 | u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */ | ||
| 785 | /* Timestamp for inactivation per TID of this queue */ | ||
| 786 | unsigned long last_frame_time[IWL_MAX_TID_COUNT + 1]; | ||
| 787 | enum iwl_mvm_queue_status status; | ||
| 788 | }; | ||
| 789 | |||
| 737 | struct iwl_mvm { | 790 | struct iwl_mvm { |
| 738 | /* for logger access */ | 791 | /* for logger access */ |
| 739 | struct device *dev; | 792 | struct device *dev; |
| @@ -790,17 +843,7 @@ struct iwl_mvm { | |||
| 790 | 843 | ||
| 791 | u16 hw_queue_to_mac80211[IWL_MAX_TVQM_QUEUES]; | 844 | u16 hw_queue_to_mac80211[IWL_MAX_TVQM_QUEUES]; |
| 792 | 845 | ||
| 793 | struct { | 846 | struct iwl_mvm_dqa_txq_info queue_info[IWL_MAX_HW_QUEUES]; |
| 794 | u8 hw_queue_refcount; | ||
| 795 | u8 ra_sta_id; /* The RA this queue is mapped to, if exists */ | ||
| 796 | bool reserved; /* Is this the TXQ reserved for a STA */ | ||
| 797 | u8 mac80211_ac; /* The mac80211 AC this queue is mapped to */ | ||
| 798 | u8 txq_tid; /* The TID "owner" of this queue*/ | ||
| 799 | u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */ | ||
| 800 | /* Timestamp for inactivation per TID of this queue */ | ||
| 801 | unsigned long last_frame_time[IWL_MAX_TID_COUNT + 1]; | ||
| 802 | enum iwl_mvm_queue_status status; | ||
| 803 | } queue_info[IWL_MAX_HW_QUEUES]; | ||
| 804 | spinlock_t queue_info_lock; /* For syncing queue mgmt operations */ | 847 | spinlock_t queue_info_lock; /* For syncing queue mgmt operations */ |
| 805 | struct work_struct add_stream_wk; /* To add streams to queues */ | 848 | struct work_struct add_stream_wk; /* To add streams to queues */ |
| 806 | 849 | ||
| @@ -829,7 +872,10 @@ struct iwl_mvm { | |||
| 829 | unsigned int scan_status; | 872 | unsigned int scan_status; |
| 830 | void *scan_cmd; | 873 | void *scan_cmd; |
| 831 | struct iwl_mcast_filter_cmd *mcast_filter_cmd; | 874 | struct iwl_mcast_filter_cmd *mcast_filter_cmd; |
| 875 | /* For CDB this is low band scan type, for non-CDB - type. */ | ||
| 832 | enum iwl_mvm_scan_type scan_type; | 876 | enum iwl_mvm_scan_type scan_type; |
| 877 | enum iwl_mvm_scan_type hb_scan_type; | ||
| 878 | |||
| 833 | enum iwl_mvm_sched_scan_pass_all_states sched_scan_pass_all; | 879 | enum iwl_mvm_sched_scan_pass_all_states sched_scan_pass_all; |
| 834 | struct delayed_work scan_timeout_dwork; | 880 | struct delayed_work scan_timeout_dwork; |
| 835 | 881 | ||
| @@ -978,6 +1024,13 @@ struct iwl_mvm { | |||
| 978 | */ | 1024 | */ |
| 979 | bool temperature_test; /* Debug test temperature is enabled */ | 1025 | bool temperature_test; /* Debug test temperature is enabled */ |
| 980 | 1026 | ||
| 1027 | unsigned long bt_coex_last_tcm_ts; | ||
| 1028 | struct iwl_mvm_tcm tcm; | ||
| 1029 | |||
| 1030 | u8 uapsd_noagg_bssid_write_idx; | ||
| 1031 | struct mac_address uapsd_noagg_bssids[IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM] | ||
| 1032 | __aligned(2); | ||
| 1033 | |||
| 981 | struct iwl_time_quota_cmd last_quota_cmd; | 1034 | struct iwl_time_quota_cmd last_quota_cmd; |
| 982 | 1035 | ||
| 983 | #ifdef CONFIG_NL80211_TESTMODE | 1036 | #ifdef CONFIG_NL80211_TESTMODE |
| @@ -1178,6 +1231,11 @@ static inline bool iwl_mvm_is_oce_supported(struct iwl_mvm *mvm) | |||
| 1178 | return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE); | 1231 | return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE); |
| 1179 | } | 1232 | } |
| 1180 | 1233 | ||
| 1234 | static inline bool iwl_mvm_is_frag_ebs_supported(struct iwl_mvm *mvm) | ||
| 1235 | { | ||
| 1236 | return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_FRAG_EBS); | ||
| 1237 | } | ||
| 1238 | |||
| 1181 | static inline bool iwl_mvm_enter_d0i3_on_suspend(struct iwl_mvm *mvm) | 1239 | static inline bool iwl_mvm_enter_d0i3_on_suspend(struct iwl_mvm *mvm) |
| 1182 | { | 1240 | { |
| 1183 | /* For now we only use this mode to differentiate between | 1241 | /* For now we only use this mode to differentiate between |
| @@ -1293,6 +1351,16 @@ static inline bool iwl_mvm_is_cdb_supported(struct iwl_mvm *mvm) | |||
| 1293 | IWL_UCODE_TLV_CAPA_CDB_SUPPORT); | 1351 | IWL_UCODE_TLV_CAPA_CDB_SUPPORT); |
| 1294 | } | 1352 | } |
| 1295 | 1353 | ||
| 1354 | static inline bool iwl_mvm_cdb_scan_api(struct iwl_mvm *mvm) | ||
| 1355 | { | ||
| 1356 | /* | ||
| 1357 | * TODO: should this be the same as iwl_mvm_is_cdb_supported()? | ||
| 1358 | * but then there's a little bit of code in scan that won't make | ||
| 1359 | * any sense... | ||
| 1360 | */ | ||
| 1361 | return mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000; | ||
| 1362 | } | ||
| 1363 | |||
| 1296 | static inline bool iwl_mvm_has_new_rx_stats_api(struct iwl_mvm *mvm) | 1364 | static inline bool iwl_mvm_has_new_rx_stats_api(struct iwl_mvm *mvm) |
| 1297 | { | 1365 | { |
| 1298 | return fw_has_api(&mvm->fw->ucode_capa, | 1366 | return fw_has_api(&mvm->fw->ucode_capa, |
| @@ -1438,7 +1506,6 @@ void iwl_mvm_accu_radio_stats(struct iwl_mvm *mvm); | |||
| 1438 | /* NVM */ | 1506 | /* NVM */ |
| 1439 | int iwl_nvm_init(struct iwl_mvm *mvm); | 1507 | int iwl_nvm_init(struct iwl_mvm *mvm); |
| 1440 | int iwl_mvm_load_nvm_to_nic(struct iwl_mvm *mvm); | 1508 | int iwl_mvm_load_nvm_to_nic(struct iwl_mvm *mvm); |
| 1441 | int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm); | ||
| 1442 | 1509 | ||
| 1443 | static inline u8 iwl_mvm_get_valid_tx_ant(struct iwl_mvm *mvm) | 1510 | static inline u8 iwl_mvm_get_valid_tx_ant(struct iwl_mvm *mvm) |
| 1444 | { | 1511 | { |
| @@ -1542,6 +1609,8 @@ void iwl_mvm_mac_ctxt_recalc_tsf_id(struct iwl_mvm *mvm, | |||
| 1542 | struct ieee80211_vif *vif); | 1609 | struct ieee80211_vif *vif); |
| 1543 | unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, | 1610 | unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, |
| 1544 | struct ieee80211_vif *exclude_vif); | 1611 | struct ieee80211_vif *exclude_vif); |
| 1612 | void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, | ||
| 1613 | struct iwl_rx_cmd_buffer *rxb); | ||
| 1545 | void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm, | 1614 | void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm, |
| 1546 | struct iwl_rx_cmd_buffer *rxb); | 1615 | struct iwl_rx_cmd_buffer *rxb); |
| 1547 | /* Bindings */ | 1616 | /* Bindings */ |
| @@ -1625,7 +1694,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 1625 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | 1694 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ |
| 1626 | 1695 | ||
| 1627 | /* rate scaling */ | 1696 | /* rate scaling */ |
| 1628 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init); | 1697 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync); |
| 1629 | void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg); | 1698 | void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg); |
| 1630 | int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate); | 1699 | int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate); |
| 1631 | void rs_update_last_rssi(struct iwl_mvm *mvm, | 1700 | void rs_update_last_rssi(struct iwl_mvm *mvm, |
| @@ -1673,6 +1742,7 @@ void iwl_mvm_ipv6_addr_change(struct ieee80211_hw *hw, | |||
| 1673 | void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw, | 1742 | void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw, |
| 1674 | struct ieee80211_vif *vif, int idx); | 1743 | struct ieee80211_vif *vif, int idx); |
| 1675 | extern const struct file_operations iwl_dbgfs_d3_test_ops; | 1744 | extern const struct file_operations iwl_dbgfs_d3_test_ops; |
| 1745 | struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm); | ||
| 1676 | #ifdef CONFIG_PM | 1746 | #ifdef CONFIG_PM |
| 1677 | int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, | 1747 | int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, |
| 1678 | struct ieee80211_vif *vif, | 1748 | struct ieee80211_vif *vif, |
| @@ -1716,10 +1786,13 @@ void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); | |||
| 1716 | void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); | 1786 | void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); |
| 1717 | int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); | 1787 | int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); |
| 1718 | bool iwl_mvm_ref_taken(struct iwl_mvm *mvm); | 1788 | bool iwl_mvm_ref_taken(struct iwl_mvm *mvm); |
| 1789 | |||
| 1790 | #ifdef CONFIG_PM | ||
| 1719 | void iwl_mvm_d0i3_enable_tx(struct iwl_mvm *mvm, __le16 *qos_seq); | 1791 | void iwl_mvm_d0i3_enable_tx(struct iwl_mvm *mvm, __le16 *qos_seq); |
| 1720 | int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode); | 1792 | int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode); |
| 1721 | int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode); | 1793 | int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode); |
| 1722 | int _iwl_mvm_exit_d0i3(struct iwl_mvm *mvm); | 1794 | int _iwl_mvm_exit_d0i3(struct iwl_mvm *mvm); |
| 1795 | #endif | ||
| 1723 | 1796 | ||
| 1724 | /* BT Coex */ | 1797 | /* BT Coex */ |
| 1725 | int iwl_mvm_send_bt_init_conf(struct iwl_mvm *mvm); | 1798 | int iwl_mvm_send_bt_init_conf(struct iwl_mvm *mvm); |
| @@ -1736,6 +1809,7 @@ bool iwl_mvm_bt_coex_is_ant_avail(struct iwl_mvm *mvm, u8 ant); | |||
| 1736 | bool iwl_mvm_bt_coex_is_shared_ant_avail(struct iwl_mvm *mvm); | 1809 | bool iwl_mvm_bt_coex_is_shared_ant_avail(struct iwl_mvm *mvm); |
| 1737 | bool iwl_mvm_bt_coex_is_tpc_allowed(struct iwl_mvm *mvm, | 1810 | bool iwl_mvm_bt_coex_is_tpc_allowed(struct iwl_mvm *mvm, |
| 1738 | enum nl80211_band band); | 1811 | enum nl80211_band band); |
| 1812 | u8 iwl_mvm_bt_coex_get_single_ant_msk(struct iwl_mvm *mvm, u8 enabled_ants); | ||
| 1739 | u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, | 1813 | u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, |
| 1740 | struct ieee80211_tx_info *info, u8 ac); | 1814 | struct ieee80211_tx_info *info, u8 ac); |
| 1741 | 1815 | ||
| @@ -1771,6 +1845,8 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
| 1771 | enum iwl_mvm_low_latency_cause cause); | 1845 | enum iwl_mvm_low_latency_cause cause); |
| 1772 | /* get SystemLowLatencyMode - only needed for beacon threshold? */ | 1846 | /* get SystemLowLatencyMode - only needed for beacon threshold? */ |
| 1773 | bool iwl_mvm_low_latency(struct iwl_mvm *mvm); | 1847 | bool iwl_mvm_low_latency(struct iwl_mvm *mvm); |
| 1848 | bool iwl_mvm_low_latency_band(struct iwl_mvm *mvm, enum nl80211_band band); | ||
| 1849 | |||
| 1774 | /* get VMACLowLatencyMode */ | 1850 | /* get VMACLowLatencyMode */ |
| 1775 | static inline bool iwl_mvm_vif_low_latency(struct iwl_mvm_vif *mvmvif) | 1851 | static inline bool iwl_mvm_vif_low_latency(struct iwl_mvm_vif *mvmvif) |
| 1776 | { | 1852 | { |
| @@ -1797,17 +1873,6 @@ void iwl_mvm_vif_set_low_latency(struct iwl_mvm_vif *mvmvif, bool set, | |||
| 1797 | mvmvif->low_latency &= ~cause; | 1873 | mvmvif->low_latency &= ~cause; |
| 1798 | } | 1874 | } |
| 1799 | 1875 | ||
| 1800 | /* hw scheduler queue config */ | ||
| 1801 | bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | ||
| 1802 | u16 ssn, const struct iwl_trans_txq_scd_cfg *cfg, | ||
| 1803 | unsigned int wdg_timeout); | ||
| 1804 | int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, int mac80211_queue, | ||
| 1805 | u8 sta_id, u8 tid, unsigned int timeout); | ||
| 1806 | |||
| 1807 | int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | ||
| 1808 | u8 tid, u8 flags); | ||
| 1809 | int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, u8 minq, u8 maxq); | ||
| 1810 | |||
| 1811 | /* Return a bitmask with all the hw supported queues, except for the | 1876 | /* Return a bitmask with all the hw supported queues, except for the |
| 1812 | * command queue, which can't be flushed. | 1877 | * command queue, which can't be flushed. |
| 1813 | */ | 1878 | */ |
| @@ -1819,6 +1884,11 @@ static inline u32 iwl_mvm_flushable_queues(struct iwl_mvm *mvm) | |||
| 1819 | 1884 | ||
| 1820 | static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) | 1885 | static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) |
| 1821 | { | 1886 | { |
| 1887 | lockdep_assert_held(&mvm->mutex); | ||
| 1888 | /* calling this function without using dump_start/end since at this | ||
| 1889 | * point we already hold the op mode mutex | ||
| 1890 | */ | ||
| 1891 | iwl_fw_dbg_collect_sync(&mvm->fwrt); | ||
| 1822 | iwl_fw_cancel_timestamp(&mvm->fwrt); | 1892 | iwl_fw_cancel_timestamp(&mvm->fwrt); |
| 1823 | iwl_free_fw_paging(&mvm->fwrt); | 1893 | iwl_free_fw_paging(&mvm->fwrt); |
| 1824 | clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); | 1894 | clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); |
| @@ -1904,7 +1974,16 @@ void iwl_mvm_reorder_timer_expired(struct timer_list *t); | |||
| 1904 | struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm); | 1974 | struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm); |
| 1905 | bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm); | 1975 | bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm); |
| 1906 | 1976 | ||
| 1907 | void iwl_mvm_inactivity_check(struct iwl_mvm *mvm); | 1977 | #define MVM_TCM_PERIOD_MSEC 500 |
| 1978 | #define MVM_TCM_PERIOD (HZ * MVM_TCM_PERIOD_MSEC / 1000) | ||
| 1979 | #define MVM_LL_PERIOD (10 * HZ) | ||
| 1980 | void iwl_mvm_tcm_work(struct work_struct *work); | ||
| 1981 | void iwl_mvm_recalc_tcm(struct iwl_mvm *mvm); | ||
| 1982 | void iwl_mvm_pause_tcm(struct iwl_mvm *mvm, bool with_cancel); | ||
| 1983 | void iwl_mvm_resume_tcm(struct iwl_mvm *mvm); | ||
| 1984 | void iwl_mvm_tcm_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | ||
| 1985 | void iwl_mvm_tcm_rm_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | ||
| 1986 | u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed); | ||
| 1908 | 1987 | ||
| 1909 | void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error); | 1988 | void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error); |
| 1910 | unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, | 1989 | unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, |
