aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/mvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mvm.h')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h162
1 files changed, 66 insertions, 96 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index cf70f681d1ac..2d4bad5fe825 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -6,7 +6,7 @@
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 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 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -76,6 +76,7 @@
76#include "iwl-notif-wait.h" 76#include "iwl-notif-wait.h"
77#include "iwl-eeprom-parse.h" 77#include "iwl-eeprom-parse.h"
78#include "iwl-fw-file.h" 78#include "iwl-fw-file.h"
79#include "iwl-config.h"
79#include "sta.h" 80#include "sta.h"
80#include "fw-api.h" 81#include "fw-api.h"
81#include "constants.h" 82#include "constants.h"
@@ -275,6 +276,7 @@ enum iwl_mvm_ref_type {
275 IWL_MVM_REF_UCODE_DOWN, 276 IWL_MVM_REF_UCODE_DOWN,
276 IWL_MVM_REF_SCAN, 277 IWL_MVM_REF_SCAN,
277 IWL_MVM_REF_ROC, 278 IWL_MVM_REF_ROC,
279 IWL_MVM_REF_ROC_AUX,
278 IWL_MVM_REF_P2P_CLIENT, 280 IWL_MVM_REF_P2P_CLIENT,
279 IWL_MVM_REF_AP_IBSS, 281 IWL_MVM_REF_AP_IBSS,
280 IWL_MVM_REF_USER, 282 IWL_MVM_REF_USER,
@@ -445,10 +447,26 @@ iwl_mvm_vif_from_mac80211(struct ieee80211_vif *vif)
445 447
446extern const u8 tid_to_mac80211_ac[]; 448extern const u8 tid_to_mac80211_ac[];
447 449
450#define IWL_MVM_SCAN_STOPPING_SHIFT 8
451
448enum iwl_scan_status { 452enum iwl_scan_status {
449 IWL_MVM_SCAN_NONE, 453 IWL_MVM_SCAN_REGULAR = BIT(0),
450 IWL_MVM_SCAN_OS, 454 IWL_MVM_SCAN_SCHED = BIT(1),
451 IWL_MVM_SCAN_SCHED, 455 IWL_MVM_SCAN_NETDETECT = BIT(2),
456
457 IWL_MVM_SCAN_STOPPING_REGULAR = BIT(8),
458 IWL_MVM_SCAN_STOPPING_SCHED = BIT(9),
459 IWL_MVM_SCAN_STOPPING_NETDETECT = BIT(10),
460
461 IWL_MVM_SCAN_REGULAR_MASK = IWL_MVM_SCAN_REGULAR |
462 IWL_MVM_SCAN_STOPPING_REGULAR,
463 IWL_MVM_SCAN_SCHED_MASK = IWL_MVM_SCAN_SCHED |
464 IWL_MVM_SCAN_STOPPING_SCHED,
465 IWL_MVM_SCAN_NETDETECT_MASK = IWL_MVM_SCAN_NETDETECT |
466 IWL_MVM_SCAN_STOPPING_NETDETECT,
467
468 IWL_MVM_SCAN_STOPPING_MASK = 0xff << IWL_MVM_SCAN_STOPPING_SHIFT,
469 IWL_MVM_SCAN_MASK = 0xff,
452}; 470};
453 471
454/** 472/**
@@ -463,49 +481,6 @@ struct iwl_nvm_section {
463 const u8 *data; 481 const u8 *data;
464}; 482};
465 483
466/*
467 * Tx-backoff threshold
468 * @temperature: The threshold in Celsius
469 * @backoff: The tx-backoff in uSec
470 */
471struct iwl_tt_tx_backoff {
472 s32 temperature;
473 u32 backoff;
474};
475
476#define TT_TX_BACKOFF_SIZE 6
477
478/**
479 * struct iwl_tt_params - thermal throttling parameters
480 * @ct_kill_entry: CT Kill entry threshold
481 * @ct_kill_exit: CT Kill exit threshold
482 * @ct_kill_duration: The time intervals (in uSec) in which the driver needs
483 * to checks whether to exit CT Kill.
484 * @dynamic_smps_entry: Dynamic SMPS entry threshold
485 * @dynamic_smps_exit: Dynamic SMPS exit threshold
486 * @tx_protection_entry: TX protection entry threshold
487 * @tx_protection_exit: TX protection exit threshold
488 * @tx_backoff: Array of thresholds for tx-backoff , in ascending order.
489 * @support_ct_kill: Support CT Kill?
490 * @support_dynamic_smps: Support dynamic SMPS?
491 * @support_tx_protection: Support tx protection?
492 * @support_tx_backoff: Support tx-backoff?
493 */
494struct iwl_tt_params {
495 s32 ct_kill_entry;
496 s32 ct_kill_exit;
497 u32 ct_kill_duration;
498 s32 dynamic_smps_entry;
499 s32 dynamic_smps_exit;
500 s32 tx_protection_entry;
501 s32 tx_protection_exit;
502 struct iwl_tt_tx_backoff tx_backoff[TT_TX_BACKOFF_SIZE];
503 bool support_ct_kill;
504 bool support_dynamic_smps;
505 bool support_tx_protection;
506 bool support_tx_backoff;
507};
508
509/** 484/**
510 * struct iwl_mvm_tt_mgnt - Thermal Throttling Management structure 485 * struct iwl_mvm_tt_mgnt - Thermal Throttling Management structure
511 * @ct_kill_exit: worker to exit thermal kill 486 * @ct_kill_exit: worker to exit thermal kill
@@ -520,7 +495,7 @@ struct iwl_mvm_tt_mgmt {
520 bool dynamic_smps; 495 bool dynamic_smps;
521 u32 tx_backoff; 496 u32 tx_backoff;
522 u32 min_backoff; 497 u32 min_backoff;
523 const struct iwl_tt_params *params; 498 struct iwl_tt_params params;
524 bool throttle; 499 bool throttle;
525}; 500};
526 501
@@ -647,13 +622,15 @@ struct iwl_mvm {
647 u32 rts_threshold; 622 u32 rts_threshold;
648 623
649 /* Scan status, cmd (pre-allocated) and auxiliary station */ 624 /* Scan status, cmd (pre-allocated) and auxiliary station */
650 enum iwl_scan_status scan_status; 625 unsigned int scan_status;
651 void *scan_cmd; 626 void *scan_cmd;
652 struct iwl_mcast_filter_cmd *mcast_filter_cmd; 627 struct iwl_mcast_filter_cmd *mcast_filter_cmd;
653 628
629 /* max number of simultaneous scans the FW supports */
630 unsigned int max_scans;
631
654 /* UMAC scan tracking */ 632 /* UMAC scan tracking */
655 u32 scan_uid[IWL_MVM_MAX_SIMULTANEOUS_SCANS]; 633 u32 scan_uid_status[IWL_MVM_MAX_UMAC_SCANS];
656 u8 scan_seq_num, sched_scan_seq_num;
657 634
658 /* rx chain antennas set through debugfs for the scan command */ 635 /* rx chain antennas set through debugfs for the scan command */
659 u8 scan_rx_ant; 636 u8 scan_rx_ant;
@@ -843,6 +820,8 @@ struct iwl_mvm {
843 } tdls_cs; 820 } tdls_cs;
844 821
845 struct iwl_mvm_shared_mem_cfg shared_mem_cfg; 822 struct iwl_mvm_shared_mem_cfg shared_mem_cfg;
823
824 u32 ciphers[6];
846}; 825};
847 826
848/* Extract MVM priv from op_mode and _hw */ 827/* Extract MVM priv from op_mode and _hw */
@@ -912,14 +891,15 @@ static inline bool iwl_mvm_is_d0i3_supported(struct iwl_mvm *mvm)
912 return mvm->trans->cfg->d0i3 && 891 return mvm->trans->cfg->d0i3 &&
913 mvm->trans->d0i3_mode != IWL_D0I3_MODE_OFF && 892 mvm->trans->d0i3_mode != IWL_D0I3_MODE_OFF &&
914 !iwlwifi_mod_params.d0i3_disable && 893 !iwlwifi_mod_params.d0i3_disable &&
915 (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_D0I3_SUPPORT); 894 fw_has_capa(&mvm->fw->ucode_capa,
895 IWL_UCODE_TLV_CAPA_D0I3_SUPPORT);
916} 896}
917 897
918static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm) 898static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm)
919{ 899{
920 bool nvm_lar = mvm->nvm_data->lar_enabled; 900 bool nvm_lar = mvm->nvm_data->lar_enabled;
921 bool tlv_lar = mvm->fw->ucode_capa.capa[0] & 901 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa,
922 IWL_UCODE_TLV_CAPA_LAR_SUPPORT; 902 IWL_UCODE_TLV_CAPA_LAR_SUPPORT);
923 903
924 if (iwlwifi_mod_params.lar_disable) 904 if (iwlwifi_mod_params.lar_disable)
925 return false; 905 return false;
@@ -936,24 +916,28 @@ static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm)
936 916
937static inline bool iwl_mvm_is_wifi_mcc_supported(struct iwl_mvm *mvm) 917static inline bool iwl_mvm_is_wifi_mcc_supported(struct iwl_mvm *mvm)
938{ 918{
939 return mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_WIFI_MCC_UPDATE || 919 return fw_has_api(&mvm->fw->ucode_capa,
940 mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC; 920 IWL_UCODE_TLV_API_WIFI_MCC_UPDATE) ||
921 fw_has_capa(&mvm->fw->ucode_capa,
922 IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC);
941} 923}
942 924
943static inline bool iwl_mvm_is_scd_cfg_supported(struct iwl_mvm *mvm) 925static inline bool iwl_mvm_is_scd_cfg_supported(struct iwl_mvm *mvm)
944{ 926{
945 return mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_SCD_CFG; 927 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_SCD_CFG);
946} 928}
947 929
948static inline bool iwl_mvm_bt_is_plcr_supported(struct iwl_mvm *mvm) 930static inline bool iwl_mvm_bt_is_plcr_supported(struct iwl_mvm *mvm)
949{ 931{
950 return (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BT_COEX_PLCR) && 932 return fw_has_capa(&mvm->fw->ucode_capa,
933 IWL_UCODE_TLV_CAPA_BT_COEX_PLCR) &&
951 IWL_MVM_BT_COEX_CORUNNING; 934 IWL_MVM_BT_COEX_CORUNNING;
952} 935}
953 936
954static inline bool iwl_mvm_bt_is_rrc_supported(struct iwl_mvm *mvm) 937static inline bool iwl_mvm_bt_is_rrc_supported(struct iwl_mvm *mvm)
955{ 938{
956 return (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BT_COEX_RRC) && 939 return fw_has_capa(&mvm->fw->ucode_capa,
940 IWL_UCODE_TLV_CAPA_BT_COEX_RRC) &&
957 IWL_MVM_BT_COEX_RRC; 941 IWL_MVM_BT_COEX_RRC;
958} 942}
959 943
@@ -1083,8 +1067,6 @@ int iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1083 struct iwl_device_cmd *cmd); 1067 struct iwl_device_cmd *cmd);
1084int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, 1068int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1085 struct iwl_device_cmd *cmd); 1069 struct iwl_device_cmd *cmd);
1086int iwl_mvm_rx_radio_ver(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1087 struct iwl_device_cmd *cmd);
1088int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm, 1070int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm,
1089 struct iwl_rx_cmd_buffer *rxb, 1071 struct iwl_rx_cmd_buffer *rxb,
1090 struct iwl_device_cmd *cmd); 1072 struct iwl_device_cmd *cmd);
@@ -1093,8 +1075,6 @@ int iwl_mvm_rx_fw_error(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1093int iwl_mvm_rx_card_state_notif(struct iwl_mvm *mvm, 1075int iwl_mvm_rx_card_state_notif(struct iwl_mvm *mvm,
1094 struct iwl_rx_cmd_buffer *rxb, 1076 struct iwl_rx_cmd_buffer *rxb,
1095 struct iwl_device_cmd *cmd); 1077 struct iwl_device_cmd *cmd);
1096int iwl_mvm_rx_radio_ver(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1097 struct iwl_device_cmd *cmd);
1098int iwl_mvm_rx_mfuart_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, 1078int iwl_mvm_rx_mfuart_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1099 struct iwl_device_cmd *cmd); 1079 struct iwl_device_cmd *cmd);
1100int iwl_mvm_rx_shared_mem_cfg_notif(struct iwl_mvm *mvm, 1080int iwl_mvm_rx_shared_mem_cfg_notif(struct iwl_mvm *mvm,
@@ -1146,48 +1126,38 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, bool force_upload,
1146 struct ieee80211_vif *disabled_vif); 1126 struct ieee80211_vif *disabled_vif);
1147 1127
1148/* Scanning */ 1128/* Scanning */
1129int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1130 struct cfg80211_scan_request *req,
1131 struct ieee80211_scan_ies *ies);
1149int iwl_mvm_scan_size(struct iwl_mvm *mvm); 1132int iwl_mvm_scan_size(struct iwl_mvm *mvm);
1150int iwl_mvm_cancel_scan(struct iwl_mvm *mvm); 1133int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify);
1151int iwl_mvm_max_scan_ie_len(struct iwl_mvm *mvm, bool is_sched_scan); 1134int iwl_mvm_max_scan_ie_len(struct iwl_mvm *mvm);
1152void iwl_mvm_report_scan_aborted(struct iwl_mvm *mvm); 1135void iwl_mvm_report_scan_aborted(struct iwl_mvm *mvm);
1153 1136
1154/* Scheduled scan */ 1137/* Scheduled scan */
1155int iwl_mvm_rx_scan_offload_complete_notif(struct iwl_mvm *mvm, 1138int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
1156 struct iwl_rx_cmd_buffer *rxb, 1139 struct iwl_rx_cmd_buffer *rxb,
1157 struct iwl_device_cmd *cmd); 1140 struct iwl_device_cmd *cmd);
1158int iwl_mvm_rx_scan_offload_iter_complete_notif(struct iwl_mvm *mvm, 1141int iwl_mvm_rx_lmac_scan_iter_complete_notif(struct iwl_mvm *mvm,
1159 struct iwl_rx_cmd_buffer *rxb, 1142 struct iwl_rx_cmd_buffer *rxb,
1160 struct iwl_device_cmd *cmd); 1143 struct iwl_device_cmd *cmd);
1161int iwl_mvm_config_sched_scan_profiles(struct iwl_mvm *mvm, 1144int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
1162 struct cfg80211_sched_scan_request *req); 1145 struct ieee80211_vif *vif,
1163int iwl_mvm_scan_offload_start(struct iwl_mvm *mvm, 1146 struct cfg80211_sched_scan_request *req,
1164 struct ieee80211_vif *vif, 1147 struct ieee80211_scan_ies *ies,
1165 struct cfg80211_sched_scan_request *req, 1148 int type);
1166 struct ieee80211_scan_ies *ies); 1149int iwl_mvm_rx_scan_match_found(struct iwl_mvm *mvm,
1167int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify); 1150 struct iwl_rx_cmd_buffer *rxb,
1168int iwl_mvm_rx_scan_offload_results(struct iwl_mvm *mvm, 1151 struct iwl_device_cmd *cmd);
1169 struct iwl_rx_cmd_buffer *rxb,
1170 struct iwl_device_cmd *cmd);
1171
1172/* Unified scan */
1173int iwl_mvm_unified_scan_lmac(struct iwl_mvm *mvm,
1174 struct ieee80211_vif *vif,
1175 struct ieee80211_scan_request *req);
1176int iwl_mvm_unified_sched_scan_lmac(struct iwl_mvm *mvm,
1177 struct ieee80211_vif *vif,
1178 struct cfg80211_sched_scan_request *req,
1179 struct ieee80211_scan_ies *ies);
1180 1152
1181/* UMAC scan */ 1153/* UMAC scan */
1182int iwl_mvm_config_scan(struct iwl_mvm *mvm); 1154int iwl_mvm_config_scan(struct iwl_mvm *mvm);
1183int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1184 struct ieee80211_scan_request *req);
1185int iwl_mvm_sched_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1186 struct cfg80211_sched_scan_request *req,
1187 struct ieee80211_scan_ies *ies);
1188int iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm, 1155int iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
1189 struct iwl_rx_cmd_buffer *rxb, 1156 struct iwl_rx_cmd_buffer *rxb,
1190 struct iwl_device_cmd *cmd); 1157 struct iwl_device_cmd *cmd);
1158int iwl_mvm_rx_umac_scan_iter_complete_notif(struct iwl_mvm *mvm,
1159 struct iwl_rx_cmd_buffer *rxb,
1160 struct iwl_device_cmd *cmd);
1191 1161
1192/* MVM debugfs */ 1162/* MVM debugfs */
1193#ifdef CONFIG_IWLWIFI_DEBUGFS 1163#ifdef CONFIG_IWLWIFI_DEBUGFS