diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mvm.h')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 150 | 
1 files changed, 30 insertions, 120 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index a263cc629d75..843d00bf2bd5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -258,38 +258,6 @@ enum iwl_mvm_smps_type_request {  	NUM_IWL_MVM_SMPS_REQ,  }; -enum iwl_mvm_ref_type { -	IWL_MVM_REF_UCODE_DOWN, -	IWL_MVM_REF_SCAN, -	IWL_MVM_REF_ROC, -	IWL_MVM_REF_ROC_AUX, -	IWL_MVM_REF_P2P_CLIENT, -	IWL_MVM_REF_AP_IBSS, -	IWL_MVM_REF_USER, -	IWL_MVM_REF_TX, -	IWL_MVM_REF_TX_AGG, -	IWL_MVM_REF_ADD_IF, -	IWL_MVM_REF_START_AP, -	IWL_MVM_REF_BSS_CHANGED, -	IWL_MVM_REF_PREPARE_TX, -	IWL_MVM_REF_PROTECT_TDLS, -	IWL_MVM_REF_CHECK_CTKILL, -	IWL_MVM_REF_PRPH_READ, -	IWL_MVM_REF_PRPH_WRITE, -	IWL_MVM_REF_NMI, -	IWL_MVM_REF_TM_CMD, -	IWL_MVM_REF_EXIT_WORK, -	IWL_MVM_REF_PROTECT_CSA, -	IWL_MVM_REF_FW_DBG_COLLECT, -	IWL_MVM_REF_INIT_UCODE, -	IWL_MVM_REF_SENDING_CMD, -	IWL_MVM_REF_RX, - -	/* update debugfs.c when changing this */ - -	IWL_MVM_REF_COUNT, -}; -  enum iwl_bt_force_ant_mode {  	BT_FORCE_ANT_DIS = 0,  	BT_FORCE_ANT_AUTO, @@ -504,6 +472,9 @@ struct iwl_mvm_vif {  	/* we can only have 2 GTK + 2 IGTK active at a time */  	struct ieee80211_key_conf *ap_early_keys[4]; + +	/* 26-tone RU OFDMA transmissions should be blocked */ +	bool he_ru_2mhz_block;  };  static inline struct iwl_mvm_vif * @@ -617,11 +588,6 @@ struct iwl_mvm_frame_stats {  	int last_frame_idx;  }; -enum { -	D0I3_DEFER_WAKEUP, -	D0I3_PENDING_WAKEUP, -}; -  #define IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE 0xff  #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100  #define IWL_MVM_DEBUG_SET_TEMPERATURE_MAX 200 @@ -695,6 +661,12 @@ struct iwl_mvm_tcm {   * @valid: reordering is valid for this queue   * @lock: protect reorder buffer internal state   * @mvm: mvm pointer, needed for frame timer context + * @consec_oldsn_drops: consecutive drops due to old SN + * @consec_oldsn_ampdu_gp2: A-MPDU GP2 timestamp to track + *	when to apply old SN consecutive drop workaround + * @consec_oldsn_prev_drop: track whether or not an MPDU + *	that was single/part of the previous A-MPDU was + *	dropped due to old SN   */  struct iwl_mvm_reorder_buffer {  	u16 head_sn; @@ -708,6 +680,9 @@ struct iwl_mvm_reorder_buffer {  	bool valid;  	spinlock_t lock;  	struct iwl_mvm *mvm; +	unsigned int consec_oldsn_drops; +	u32 consec_oldsn_ampdu_gp2; +	unsigned int consec_oldsn_prev_drop:1;  } ____cacheline_aligned_in_smp;  /** @@ -1011,10 +986,6 @@ struct iwl_mvm {  	unsigned long fw_key_table[BITS_TO_LONGS(STA_KEY_MAX_NUM)];  	u8 fw_key_deleted[STA_KEY_MAX_NUM]; -	/* references taken by the driver and spinlock protecting them */ -	spinlock_t refs_lock; -	u8 refs[IWL_MVM_REF_COUNT]; -  	u8 vif_count;  	struct ieee80211_vif __rcu *vif_id_to_mac[NUM_MAC_INDEX_DRIVER]; @@ -1039,6 +1010,7 @@ struct iwl_mvm {  	struct ieee80211_channel **nd_channels;  	int n_nd_channels;  	bool net_detect; +	u8 offload_tid;  #ifdef CONFIG_IWLWIFI_DEBUGFS  	bool d3_wake_sysassert;  	bool d3_test_active; @@ -1048,17 +1020,6 @@ struct iwl_mvm {  #endif  #endif -	/* d0i3 */ -	u8 d0i3_ap_sta_id; -	bool d0i3_offloading; -	struct work_struct d0i3_exit_work; -	struct sk_buff_head d0i3_tx; -	/* protect d0i3_suspend_flags */ -	struct mutex d0i3_suspend_mutex; -	unsigned long d0i3_suspend_flags; -	/* sync d0i3_tx queue and IWL_MVM_STATUS_IN_D0I3 status flag */ -	spinlock_t d0i3_tx_lock; -	wait_queue_head_t d0i3_exit_waitq;  	wait_queue_head_t rx_sync_waitq;  	/* BT-Coex */ @@ -1184,6 +1145,8 @@ struct iwl_mvm {  	struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM];  	struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES];  	u32 geo_rev; +	struct iwl_ppag_table_cmd ppag_table; +	u32 ppag_rev;  #endif  }; @@ -1201,7 +1164,6 @@ struct iwl_mvm {   * @IWL_MVM_STATUS_ROC_RUNNING: remain-on-channel is running   * @IWL_MVM_STATUS_HW_RESTART_REQUESTED: HW restart was requested   * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active - * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3   * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running   * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running   * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA @@ -1212,7 +1174,6 @@ enum iwl_mvm_status {  	IWL_MVM_STATUS_ROC_RUNNING,  	IWL_MVM_STATUS_HW_RESTART_REQUESTED,  	IWL_MVM_STATUS_IN_HW_RESTART, -	IWL_MVM_STATUS_IN_D0I3,  	IWL_MVM_STATUS_ROC_AUX_RUNNING,  	IWL_MVM_STATUS_FIRMWARE_RUNNING,  	IWL_MVM_STATUS_NEED_FLUSH_P2P, @@ -1291,13 +1252,6 @@ iwl_mvm_rcu_dereference_vif_id(struct iwl_mvm *mvm, u8 vif_id, bool rcu)  					 lockdep_is_held(&mvm->mutex));  } -static inline bool iwl_mvm_is_d0i3_supported(struct iwl_mvm *mvm) -{ -	return !iwlwifi_mod_params.d0i3_disable && -		fw_has_capa(&mvm->fw->ucode_capa, -			    IWL_UCODE_TLV_CAPA_D0I3_SUPPORT); -} -  static inline bool iwl_mvm_is_adaptive_dwell_supported(struct iwl_mvm *mvm)  {  	return fw_has_api(&mvm->fw->ucode_capa, @@ -1333,19 +1287,6 @@ static inline bool iwl_mvm_is_short_beacon_notif_supported(struct iwl_mvm *mvm)  			  IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF);  } -static inline bool iwl_mvm_enter_d0i3_on_suspend(struct iwl_mvm *mvm) -{ -	/* For now we only use this mode to differentiate between -	 * slave transports, which handle D0i3 entry in suspend by -	 * themselves in conjunction with runtime PM D0i3.  So, this -	 * function is used to check whether we need to do anything -	 * when entering suspend or if the transport layer has already -	 * done it. -	 */ -	return (mvm->trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3) && -		(mvm->trans->runtime_pm_mode != IWL_PLAT_PM_MODE_D0I3); -} -  static inline bool iwl_mvm_is_dqa_data_queue(struct iwl_mvm *mvm, u8 queue)  {  	return (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE) && @@ -1424,13 +1365,13 @@ static inline bool iwl_mvm_has_new_rx_api(struct iwl_mvm *mvm)  static inline bool iwl_mvm_has_new_tx_api(struct iwl_mvm *mvm)  {  	/* TODO - replace with TLV once defined */ -	return mvm->trans->cfg->use_tfh; +	return mvm->trans->trans_cfg->use_tfh;  }  static inline bool iwl_mvm_has_unified_ucode(struct iwl_mvm *mvm)  {  	/* TODO - better define this */ -	return mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000; +	return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000;  }  static inline bool iwl_mvm_is_cdb_supported(struct iwl_mvm *mvm) @@ -1455,7 +1396,13 @@ static inline bool iwl_mvm_cdb_scan_api(struct iwl_mvm *mvm)  	 * but then there's a little bit of code in scan that won't make  	 * any sense...  	 */ -	return mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000; +	return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000; +} + +static inline bool iwl_mvm_is_scan_ext_chan_supported(struct iwl_mvm *mvm) +{ +	return fw_has_api(&mvm->fw->ucode_capa, +			  IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER);  }  static inline bool iwl_mvm_has_new_rx_stats_api(struct iwl_mvm *mvm) @@ -1487,7 +1434,6 @@ iwl_mvm_get_agg_status(struct iwl_mvm *mvm, void *tx_resp)  static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm)  { -#ifdef CONFIG_THERMAL  	/* these two TLV are redundant since the responsibility to CT-kill by  	 * FW happens only after we send at least one command of  	 * temperature THs report. @@ -1496,9 +1442,6 @@ static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm)  			   IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW) &&  	       fw_has_capa(&mvm->fw->ucode_capa,  			   IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT); -#else /* CONFIG_THERMAL */ -	return false; -#endif /* CONFIG_THERMAL */  }  static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm) @@ -1663,6 +1606,8 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,  				struct iwl_rx_cmd_buffer *rxb, int queue);  void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,  			      struct iwl_rx_cmd_buffer *rxb, int queue); +void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, +				  struct iwl_rx_cmd_buffer *rxb, int queue);  int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,  			    const u8 *data, u32 count, bool async);  void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi, @@ -1863,30 +1808,9 @@ void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw,  extern const struct file_operations iwl_dbgfs_d3_test_ops;  struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm);  #ifdef CONFIG_PM -int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, -				     struct ieee80211_vif *vif, -				     bool host_awake, -				     u32 cmd_flags); -void iwl_mvm_d0i3_update_keys(struct iwl_mvm *mvm, -			      struct ieee80211_vif *vif, -			      struct iwl_wowlan_status *status);  void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,  				 struct ieee80211_vif *vif);  #else -static inline int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, -						   struct ieee80211_vif *vif, -						   bool host_awake, -						   u32 cmd_flags) -{ -	return 0; -} - -static inline void iwl_mvm_d0i3_update_keys(struct iwl_mvm *mvm, -					    struct ieee80211_vif *vif, -					    struct iwl_wowlan_status *status) -{ -} -  static inline void  iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif)  { @@ -1900,19 +1824,6 @@ int iwl_mvm_send_proto_offload(struct iwl_mvm *mvm,  			       bool offload_ns,  			       u32 cmd_flags); -/* D0i3 */ -void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); -void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); -int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type); -bool iwl_mvm_ref_taken(struct iwl_mvm *mvm); - -#ifdef CONFIG_PM -void iwl_mvm_d0i3_enable_tx(struct iwl_mvm *mvm, __le16 *qos_seq); -int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode); -int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode); -int _iwl_mvm_exit_d0i3(struct iwl_mvm *mvm); -#endif -  /* BT Coex */  int iwl_mvm_send_bt_init_conf(struct iwl_mvm *mvm);  void iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, @@ -1943,9 +1854,6 @@ iwl_mvm_beacon_filter_debugfs_parameters(struct ieee80211_vif *vif,  					 struct iwl_beacon_filter_cmd *cmd)  {}  #endif -int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm, -				   struct ieee80211_vif *vif, -				   bool enable, u32 flags);  int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,  				 struct ieee80211_vif *vif,  				 u32 flags); @@ -2025,7 +1933,7 @@ void iwl_mvm_vif_set_low_latency(struct iwl_mvm_vif *mvmvif, bool set,   */  static inline u32 iwl_mvm_flushable_queues(struct iwl_mvm *mvm)  { -	return ((BIT(mvm->cfg->base_params->num_of_queues) - 1) & +	return ((BIT(mvm->trans->trans_cfg->base_params->num_of_queues) - 1) &  		~BIT(IWL_MVM_DQA_CMD_QUEUE));  } @@ -2034,7 +1942,8 @@ static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm)  	lockdep_assert_held(&mvm->mutex);  	iwl_fw_cancel_timestamp(&mvm->fwrt);  	clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); -	iwl_fwrt_stop_device(&mvm->fwrt); +	iwl_fw_dbg_stop_sync(&mvm->fwrt); +	iwl_trans_stop_device(mvm->trans);  	iwl_free_fw_paging(&mvm->fwrt);  	iwl_fw_dump_conf_clear(&mvm->fwrt);  } @@ -2154,6 +2063,7 @@ void iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm,  int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b);  int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm); +int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm);  #ifdef CONFIG_IWLWIFI_DEBUGFS  void iwl_mvm_sta_add_debugfs(struct ieee80211_hw *hw,  			     struct ieee80211_vif *vif,  |