diff options
| author | Emmanuel Grumbach <[email protected]> | 2018-11-26 13:24:55 +0200 | 
|---|---|---|
| committer | Luca Coelho <[email protected]> | 2019-02-04 12:27:19 +0200 | 
| commit | 15e28c78c3864cd7694bc7fca5142ff1f3f8d0e7 (patch) | |
| tree | 453f89356314f155df04aa88e0c51f4334842313 | |
| parent | 2d0c66083d3f9d17e5c107c4427523d3acdd31ce (diff) | |
iwlwifi: mvm: support new format for the beacon notification
The firmware is changing the format of the beacon
notification to remove the dependency on the Tx response
format.
Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/api/tx.h | 18 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/file.h | 3 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 35 | ||||
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 | 
4 files changed, 48 insertions, 14 deletions
| diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h index 358bdf051e83..8511e735c374 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h @@ -847,13 +847,13 @@ struct iwl_beacon_notif {  } __packed;  /** - * struct iwl_extended_beacon_notif - notifies about beacon transmission + * struct iwl_extended_beacon_notif_v5 - notifies about beacon transmission   * @beacon_notify_hdr: tx response command associated with the beacon   * @tsf: last beacon tsf   * @ibss_mgr_status: whether IBSS is manager   * @gp2: last beacon time in gp2   */ -struct iwl_extended_beacon_notif { +struct iwl_extended_beacon_notif_v5 {  	struct iwl_mvm_tx_resp beacon_notify_hdr;  	__le64 tsf;  	__le32 ibss_mgr_status; @@ -861,6 +861,20 @@ struct iwl_extended_beacon_notif {  } __packed; /* BEACON_NTFY_API_S_VER_5 */  /** + * struct iwl_extended_beacon_notif - notifies about beacon transmission + * @status: the status of the Tx response of the beacon + * @tsf: last beacon tsf + * @ibss_mgr_status: whether IBSS is manager + * @gp2: last beacon time in gp2 + */ +struct iwl_extended_beacon_notif { +	__le32 status; +	__le64 tsf; +	__le32 ibss_mgr_status; +	__le32 gp2; +} __packed; /* BEACON_NTFY_API_S_VER_6_ */ + +/**   * enum iwl_dump_control - dump (flush) control flags   * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty   *	and the TFD queues are empty. diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index db392cfc2bd4..a6dd27fbe4aa 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h @@ -263,6 +263,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;   * @IWL_UCODE_TLV_API_FRAG_EBS: This ucode supports fragmented EBS   * @IWL_UCODE_TLV_API_REDUCE_TX_POWER: This ucode supports v5 of   *	the REDUCE_TX_POWER_CMD. + * @IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF: This ucode supports the short + *	version of the beacon notification.   *   * @NUM_IWL_UCODE_TLV_API: number of bits used   */ @@ -287,6 +289,7 @@ enum iwl_ucode_tlv_api {  	IWL_UCODE_TLV_API_ADAPTIVE_DWELL_V2	= (__force iwl_ucode_tlv_api_t)42,  	IWL_UCODE_TLV_API_FRAG_EBS		= (__force iwl_ucode_tlv_api_t)44,  	IWL_UCODE_TLV_API_REDUCE_TX_POWER	= (__force iwl_ucode_tlv_api_t)45, +	IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF	= (__force iwl_ucode_tlv_api_t)46,  	NUM_IWL_UCODE_TLV_API  #ifdef __CHECKER__ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 768a87e0a1c3..c1eb07c08827 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1330,7 +1330,7 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,  {  	struct iwl_rx_packet *pkt = rxb_addr(rxb);  	struct iwl_extended_beacon_notif *beacon = (void *)pkt->data; -	struct iwl_mvm_tx_resp *beacon_notify_hdr; +	struct iwl_extended_beacon_notif_v5 *beacon_v5 = (void *)pkt->data;  	struct ieee80211_vif *csa_vif;  	struct ieee80211_vif *tx_blocked_vif;  	struct agg_tx_status *agg_status; @@ -1338,18 +1338,29 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,  	lockdep_assert_held(&mvm->mutex); -	beacon_notify_hdr = &beacon->beacon_notify_hdr;  	mvm->ap_last_beacon_gp2 = le32_to_cpu(beacon->gp2); -	mvm->ibss_manager = beacon->ibss_mgr_status != 0; - -	agg_status = iwl_mvm_get_agg_status(mvm, beacon_notify_hdr); -	status = le16_to_cpu(agg_status->status) & TX_STATUS_MSK; -	IWL_DEBUG_RX(mvm, -		     "beacon status %#x retries:%d tsf:0x%016llX gp2:0x%X rate:%d\n", -		     status, beacon_notify_hdr->failure_frame, -		     le64_to_cpu(beacon->tsf), -		     mvm->ap_last_beacon_gp2, -		     le32_to_cpu(beacon_notify_hdr->initial_rate)); + +	if (!iwl_mvm_is_short_beacon_notif_supported(mvm)) { +		struct iwl_mvm_tx_resp *beacon_notify_hdr = +			&beacon_v5->beacon_notify_hdr; + +		mvm->ibss_manager = beacon_v5->ibss_mgr_status != 0; +		agg_status = iwl_mvm_get_agg_status(mvm, beacon_notify_hdr); +		status = le16_to_cpu(agg_status->status) & TX_STATUS_MSK; +		IWL_DEBUG_RX(mvm, +			     "beacon status %#x retries:%d tsf:0x%016llX gp2:0x%X rate:%d\n", +			     status, beacon_notify_hdr->failure_frame, +			     le64_to_cpu(beacon->tsf), +			     mvm->ap_last_beacon_gp2, +			     le32_to_cpu(beacon_notify_hdr->initial_rate)); +	} else { +		mvm->ibss_manager = beacon->ibss_mgr_status != 0; +		status = le32_to_cpu(beacon->status) & TX_STATUS_MSK; +		IWL_DEBUG_RX(mvm, +			     "beacon status %#x tsf:0x%016llX gp2:0x%X\n", +			     status, le64_to_cpu(beacon->tsf), +			     mvm->ap_last_beacon_gp2); +	}  	csa_vif = rcu_dereference_protected(mvm->csa_vif,  					    lockdep_is_held(&mvm->mutex)); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 12e9ecc3ee27..f7176020139d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1311,6 +1311,12 @@ static inline bool iwl_mvm_is_frag_ebs_supported(struct iwl_mvm *mvm)  	return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_FRAG_EBS);  } +static inline bool iwl_mvm_is_short_beacon_notif_supported(struct iwl_mvm *mvm) +{ +	return fw_has_api(&mvm->fw->ucode_capa, +			  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 |