wifi: iwlwifi: updates intended for v6.4 2023-04-13
cover wifi: iwlwifi: updates intended for v6.4 2023-04-13
From: Gregory Greenman <[email protected]>
Hi,
Here's the next set of iwlwifi patches for v6.4. It's the ususal developement, mostly cleanups and bugfixes.
Thanks,
Gregory
Avraham Stern (3):
wifi: iwlwifi: mvm: use OFDM rate if IEEE80211_TX_CTL_NO_CCK_RATE is set
wifi: iwlwifi: trans: don't trigger d3 interrupt twice
wifi: iwlwifi: mvm: don't set CHECKSUM_COMPLETE for unsupported protocols
Daniel Gabay (1):
wifi: iwlwifi: nvm: Update HE capabilities on 6GHz band for EHT device
Golan Ben Ami (1):
wifi: iwlwifi: mvm: enable bz hw checksum from c step
Johannes Berg (5):
wifi: iwlwifi: debug: fix crash in __iwl_err()
wifi: iwlwifi: nvm-parse: enable 160/320 MHz for AP mode
wifi: iwlwifi: mvm: convert TID to FW value on queue remove
wifi: iwlwifi: mvm: fix A-MSDU checks
wifi: iwlwifi: mvm: refactor TX csum mode check
Miri Korenblit (1):
wifi: iwlwifi: add a validity check of queue_id in iwl_txq_reclaim
Mukesh Sisodiya (4):
wifi: iwlwifi: Update configuration for SO,SOF MAC and HR RF
wifi: iwlwifi: mvm: move function sequence
wifi: iwlwifi: Update init sequence if tx diversity supported
wifi: iwlwifi: Update configurations for Bnj-a0 and specific rf devices
.../net/wireless/intel/iwlwifi/iwl-debug.c | 3 +- .../wireless/intel/iwlwifi/iwl-eeprom-parse.h | 5 +- .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 21 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 224 +++++++++--------- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 3 + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 13 + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 6 +- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 8 +- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 11 +- .../net/wireless/intel/iwlwifi/pcie/trans.c | 9 +- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 10 +- 13 files changed, 176 insertions(+), 144 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/15 wifi: iwlwifi: debug: fix crash in __iwl_err()
From: Johannes Berg <[email protected]>
In __iwl_err(), if we rate-limit the message away, then vaf.va is still NULL-initialized by the time we get to the tracing code, which then crashes. When it doesn't get rate-limited out, it's still wrong to reuse the old args2 that was already printed, which is why we bother making a copy in the first place.
Assign vaf.va properly to fix this.
--- drivers/net/wireless/intel/iwlwifi/iwl-debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-debug.c +2 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2005-2011, 2021 Intel Corporation +* Copyright (C) 2005-2011, 2021-2022 Intel Corporation */ #include <linux/device.h> #include <linux/interrupt.h>
@@ -57,6 +57,7 @@ void __iwl_err(struct device *dev, enum iwl_err_mode mode, const char *fmt, ...)default :break ; } + vaf.va = &args;trace_iwlwifi_err (&vaf);va_end (args); }
Signature · 1 line
2.38.1
PATCH 2/15 wifi: iwlwifi: nvm-parse: enable 160/320 MHz for AP mode
In reply to [email protected]From: Johannes Berg <[email protected]>
Initially, 160/320 MHz in AP mode were not supported. After testing, enable the wider bandwidths in AP mode as well.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +4 -7
@@ -876,16 +876,13 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK);break ;case NL80211_BAND_6GHZ : -if (!is_ap || iwlwifi_mod_params.nvm_file) - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0 ] |= -IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ ; + iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0 ] |= +IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ ; fallthrough;case NL80211_BAND_5GHZ : iftype_data->he_cap.he_cap_elem.phy_cap_info[0 ] |= -IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G ; -if (!is_ap || iwlwifi_mod_params.nvm_file) - iftype_data->he_cap.he_cap_elem.phy_cap_info[0 ] |= -IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G ; +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G ;break ;default :WARN_ON (1 );
Signature · 1 line
2.38.1
PATCH 3/15 wifi: iwlwifi: add a validity check of queue_id in iwl_txq_reclaim
In reply to [email protected]From: Miri Korenblit <[email protected]>
This function receives the queue id to reclaim packets from. Currently we're passing to it the queue id we received from the FW in the flush response. We don't do any check of this value and it might be invalid. In such case we will refer to a pointer to a queue which might be NULL. Fix this by adding a validity check of the queue id before using it.
--- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/queue/tx.c +7 -3
@@ -1554,14 +1554,18 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn, struct sk_buff_head *skbs) {struct iwl_txq *txq = trans->txqs.txq[txq_id]; -int tfd_num =iwl_txq_get_cmd_index (txq, ssn); -int read_ptr =iwl_txq_get_cmd_index (txq, txq->read_ptr); -int last_to_free; +int tfd_num, read_ptr, last_to_free;/* This function is not meant to release cmd queue*/ if (WARN_ON (txq_id == trans->txqs.cmd.q_id))return ; +if (WARN_ON (!txq)) +return ; + + tfd_num =iwl_txq_get_cmd_index (txq, ssn); + read_ptr =iwl_txq_get_cmd_index (txq, txq->read_ptr); +spin_lock_bh (&txq->lock);if (!test_bit (txq_id, trans->txqs.queue_used)) {
Signature · 1 line
2.38.1
PATCH 4/15 wifi: iwlwifi: Update configuration for SO,SOF MAC and HR RF
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
update the device configuration for HR1 device for SO and SOF device. QuZ device configuration is corrected to support specific CRF.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +7 -2
@@ -995,6 +995,11 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY, IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB, IWL_CFG_ANY, iwl_cfg_quz_a0_hr_b0, iwl_ax203_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_QUZ ,SILICON_B_STEP , +IWL_CFG_RF_TYPE_HR2 ,IWL_CFG_ANY , +IWL_CFG_160 ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_ANY , + iwl_cfg_quz_a0_hr_b0, iwl_ax201_name),/* QnJ with Hr */ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
@@ -1090,7 +1095,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY ,IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY ,IWL_CFG_RF_TYPE_HR1 ,IWL_CFG_ANY , -IWL_CFG_160 ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_ANY , +IWL_CFG_NO_160 ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_ANY , iwl_cfg_so_a0_hr_a0, iwl_ax101_name), _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY,
@@ -1107,7 +1112,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY ,IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY ,IWL_CFG_RF_TYPE_HR1 ,IWL_CFG_ANY , -IWL_CFG_160 ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_ANY , +IWL_CFG_NO_160 ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_ANY , iwl_cfg_so_a0_hr_a0, iwl_ax101_name), _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
Signature · 1 line
2.38.1
PATCH 5/15 wifi: iwlwifi: mvm: convert TID to FW value on queue remove
In reply to [email protected]From: Johannes Berg <[email protected]>
On queue remove, we should convert the TID value to the firmware value (8 -> 15) just like we do on queue add. Otherwise, the firmware will not be able to find the correct queue to remove.
--- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +3 -0
@@ -268,6 +268,9 @@ static int iwl_mvm_mld_disable_txq(struct iwl_mvm *mvm, int sta_id,int queue = *queueptr;int ret =0 ; +if (tid ==IWL_MAX_TID_COUNT ) + tid =IWL_MGMT_TID ; +if (mvm->sta_remove_requires_queue_remove) {u32 cmd_id =WIDE_ID (DATA_PATH_GROUP ,SCD_QUEUE_CONFIG_CMD );
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +5 -1
@@ -356,10 +356,14 @@ static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, SCD_QUEUE_CONFIG_CMD);struct iwl_scd_queue_cfg_cmd remove_cmd = { .operation =cpu_to_le32 (IWL_SCD_QUEUE_REMOVE ), - .u.remove.tid =cpu_to_le32 (tid), .u.remove.sta_mask =cpu_to_le32 (BIT (sta_id)), }; +if (tid ==IWL_MAX_TID_COUNT ) + tid =IWL_MGMT_TID ; + + remove_cmd.u.remove.tid =cpu_to_le32 (tid); + ret =iwl_mvm_send_cmd_pdu (mvm, cmd_id,0 ,sizeof (remove_cmd), &remove_cmd);
Signature · 1 line
2.38.1
PATCH 6/15 wifi: iwlwifi: mvm: use OFDM rate if IEEE80211_TX_CTL_NO_CCK_RATE is set
In reply to [email protected]From: Avraham Stern <[email protected]>
IEEE80211_TX_CTL_NO_CCK_RATE indicates that CCK rates should not be used, but is ignored by the driver. Fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +2 -1
@@ -343,7 +343,8 @@ static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm,* For non 2 GHZ band, remap mac80211 rate * indices into driver indices */ -if (info->band !=NL80211_BAND_2GHZ ) +if (info->band !=NL80211_BAND_2GHZ || + (info->flags &IEEE80211_TX_CTL_NO_CCK_RATE )) rate_idx +=IWL_FIRST_OFDM_RATE ;/* For 2.4 GHZ band, check that there is no need to remap */
Signature · 1 line
2.38.1
PATCH 7/15 wifi: iwlwifi: mvm: enable bz hw checksum from c step
In reply to [email protected]From: Golan Ben Ami <[email protected]>
B step doesn't support full checksum yet, move to c step.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +1 -1
@@ -187,7 +187,7 @@ static u32 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb,if (mvm->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_BZ || (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_BZ &&CSR_HW_REV_TYPE (mvm->trans->hw_rev) ==IWL_CFG_MAC_TYPE_GL && - mvm->trans->hw_rev_step ==SILICON_A_STEP )) + mvm->trans->hw_rev_step <=SILICON_B_STEP ))return iwl_mvm_tx_csum_pre_bz (mvm, skb, info, amsdu);return iwl_mvm_tx_csum_bz (mvm, skb, amsdu); }
Signature · 1 line
2.38.1
PATCH 8/15 wifi: iwlwifi: mvm: fix A-MSDU checks
In reply to [email protected]From: Johannes Berg <[email protected]>
Since Gl A-step devices use the old checksum hardware, we shouldn't use the Bz code to check for A-MSDU combining ability; fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +4 -1
@@ -6129,7 +6129,10 @@ static bool iwl_mvm_mac_can_aggregate(struct ieee80211_hw *hw, {struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -if (mvm->trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_BZ ) +if (mvm->trans->trans_cfg->device_family >IWL_DEVICE_FAMILY_BZ || + (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_BZ && + !(CSR_HW_REV_TYPE (mvm->trans->hw_rev) ==IWL_CFG_MAC_TYPE_GL && + mvm->trans->hw_rev_step ==SILICON_A_STEP )))return iwl_mvm_tx_csum_bz (mvm, head, true) ==iwl_mvm_tx_csum_bz (mvm, skb, true);
Signature · 1 line
2.38.1
PATCH 9/15 wifi: iwlwifi: mvm: refactor TX csum mode check
In reply to [email protected]From: Johannes Berg <[email protected]>
There are two modes now, and we have two places checking that must be in sync. Refactor the logic into a new small helper function.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 +---- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 13 +++++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 5 +---- 3 files changed, 15 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 -4
@@ -6129,10 +6129,7 @@ static bool iwl_mvm_mac_can_aggregate(struct ieee80211_hw *hw, {struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -if (mvm->trans->trans_cfg->device_family >IWL_DEVICE_FAMILY_BZ || - (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_BZ && - !(CSR_HW_REV_TYPE (mvm->trans->hw_rev) ==IWL_CFG_MAC_TYPE_GL && - mvm->trans->hw_rev_step ==SILICON_A_STEP ))) +if (iwl_mvm_has_new_tx_csum (mvm))return iwl_mvm_tx_csum_bz (mvm, head, true) ==iwl_mvm_tx_csum_bz (mvm, skb, true);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +13 -0
@@ -1522,6 +1522,19 @@ static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm) IWL_UCODE_TLV_CAPA_CTDP_SUPPORT); } +static inline bool iwl_mvm_has_new_tx_csum (struct iwl_mvm *mvm) +{ +if (mvm->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_BZ ) +return false; + +if (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_BZ && +CSR_HW_REV_TYPE (mvm->trans->hw_rev) ==IWL_CFG_MAC_TYPE_GL && + mvm->trans->hw_rev_step <=SILICON_B_STEP ) +return false; + +return true; +} +extern const u8 iwl_mvm_ac_to_tx_fifo[];extern const u8 iwl_mvm_ac_to_gen2_tx_fifo[];
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +1 -4
@@ -184,10 +184,7 @@ static u32 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb, struct ieee80211_tx_info *info, bool amsdu) { -if (mvm->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_BZ || - (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_BZ && -CSR_HW_REV_TYPE (mvm->trans->hw_rev) ==IWL_CFG_MAC_TYPE_GL && - mvm->trans->hw_rev_step <=SILICON_B_STEP )) +if (!iwl_mvm_has_new_tx_csum (mvm))return iwl_mvm_tx_csum_pre_bz (mvm, skb, info, amsdu);return iwl_mvm_tx_csum_bz (mvm, skb, amsdu); }
Signature · 1 line
2.38.1
PATCH 10/15 wifi: iwlwifi: nvm: Update HE capabilities on 6GHz band for EHT device
In reply to [email protected]From: Daniel Gabay <[email protected]>
Max A-MPDU length exponent shall be set to 2 for EHT capable device on 6GHz band in order to support 4MB aggregation.
Update HE MAC capabilities accordingly for station and softap interfaces.
This change requires to add another ieee80211_sband_iftype_data for uhb since high/uhb are no longer the same.
--- drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.h | 5 ++--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.h +2 -3
@@ -47,13 +47,12 @@ struct iwl_nvm_data {struct ieee80211_supported_band bands[NUM_NL80211_BANDS ];/* -* iftype data for low (2.4 GHz) and high (5 and 6 GHz) bands, -* we can use the same for 5 and 6 GHz bands because they have -* the same data +* iftype data for low (2.4 GHz) high (5 GHz) and uhb (6 GHz) bands */ struct {struct ieee80211_sband_iftype_data low[2 ];struct ieee80211_sband_iftype_data high[2 ]; +struct ieee80211_sband_iftype_data uhb[2 ]; } iftd;struct ieee80211_channel channels[];
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +8 -2
@@ -860,7 +860,10 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,/* Advertise an A-MPDU exponent extension based on * operating band */ -if (sband->band !=NL80211_BAND_2GHZ ) +if (sband->band ==NL80211_BAND_6GHZ && iftype_data->eht_cap.has_eht) + iftype_data->he_cap.he_cap_elem.mac_cap_info[3 ] |= +IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 ; +else if (sband->band !=NL80211_BAND_2GHZ ) iftype_data->he_cap.he_cap_elem.mac_cap_info[3 ] |=IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 ;else
@@ -996,15 +999,18 @@ static void iwl_init_he_hw_capab(struct iwl_trans *trans,BUILD_BUG_ON (sizeof (data->iftd.low) !=sizeof (iwl_he_eht_capa));BUILD_BUG_ON (sizeof (data->iftd.high) !=sizeof (iwl_he_eht_capa)); +BUILD_BUG_ON (sizeof (data->iftd.uhb) !=sizeof (iwl_he_eht_capa));switch (sband->band) {case NL80211_BAND_2GHZ : iftype_data = data->iftd.low;break ;case NL80211_BAND_5GHZ : -case NL80211_BAND_6GHZ : iftype_data = data->iftd.high;break ; +case NL80211_BAND_6GHZ : + iftype_data = data->iftd.uhb; +break ;default :WARN_ON (1 );return ;
Signature · 1 line
2.38.1
PATCH 11/15 wifi: iwlwifi: mvm: move function sequence
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
Need to move a function definition and actual changes will be done in following commit.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 210 ++++++++++---------- 1 file changed, 105 insertions(+), 105 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +105 -105
@@ -467,111 +467,6 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,return 0 ; } -static int iwl_run_unified_mvm_ucode (struct iwl_mvm *mvm) -{ -struct iwl_notification_wait init_wait; -struct iwl_nvm_access_complete_cmd nvm_complete = {}; -struct iwl_init_extended_cfg_cmd init_cfg = { - .init_flags =cpu_to_le32 (BIT (IWL_INIT_NVM )), - }; -static const u16 init_complete[] = { -INIT_COMPLETE_NOTIF , - }; -int ret; - -if (mvm->trans->cfg->tx_with_siso_diversity) - init_cfg.init_flags |=cpu_to_le32 (BIT (IWL_INIT_PHY )); - -lockdep_assert_held (&mvm->mutex); - - mvm->rfkill_safe_init_done = false; - -iwl_init_notification_wait (&mvm->notif_wait, - &init_wait, - init_complete, -ARRAY_SIZE (init_complete), - iwl_wait_init_complete, -NULL ); - -iwl_dbg_tlv_time_point (&mvm->fwrt,IWL_FW_INI_TIME_POINT_EARLY ,NULL ); - -/* Will also start the device */ - ret =iwl_mvm_load_ucode_wait_alive (mvm,IWL_UCODE_REGULAR ); -if (ret) { -IWL_ERR (mvm,"Failed to start RT ucode: %d\n" , ret); - goto error; - } -iwl_dbg_tlv_time_point (&mvm->fwrt,IWL_FW_INI_TIME_POINT_AFTER_ALIVE , -NULL ); - -/* Send init config command to mark that we are sending NVM access -* commands -*/ - ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (SYSTEM_GROUP , -INIT_EXTENDED_CFG_CMD ), -CMD_SEND_IN_RFKILL , -sizeof (init_cfg), &init_cfg); -if (ret) { -IWL_ERR (mvm,"Failed to run init config command: %d\n" , - ret); - goto error; - } - -/* Load NVM to NIC if needed */ -if (mvm->nvm_file_name) { - ret =iwl_read_external_nvm (mvm->trans, mvm->nvm_file_name, - mvm->nvm_sections); -if (ret) - goto error; - ret =iwl_mvm_load_nvm_to_nic (mvm); -if (ret) - goto error; - } - -if (IWL_MVM_PARSE_NVM && !mvm->nvm_data) { - ret =iwl_nvm_init (mvm); -if (ret) { -IWL_ERR (mvm,"Failed to read NVM: %d\n" , ret); - goto error; - } - } - - ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (REGULATORY_AND_NVM_GROUP , -NVM_ACCESS_COMPLETE ), -CMD_SEND_IN_RFKILL , -sizeof (nvm_complete), &nvm_complete); -if (ret) { -IWL_ERR (mvm,"Failed to run complete NVM access: %d\n" , - ret); - goto error; - } - -/* We wait for the INIT complete notification */ - ret =iwl_wait_notification (&mvm->notif_wait, &init_wait, -MVM_UCODE_ALIVE_TIMEOUT ); -if (ret) -return ret; - -/* Read the NVM only at driver load time, no need to do this twice */ -if (!IWL_MVM_PARSE_NVM && !mvm->nvm_data) { - mvm->nvm_data =iwl_get_nvm (mvm->trans, mvm->fw); -if (IS_ERR (mvm->nvm_data)) { - ret =PTR_ERR (mvm->nvm_data); - mvm->nvm_data =NULL ; -IWL_ERR (mvm,"Failed to read NVM: %d\n" , ret); -return ret; - } - } - - mvm->rfkill_safe_init_done = true; - -return 0 ; - -error: -iwl_remove_notification (&mvm->notif_wait, &init_wait); -return ret; -} -#ifdef CONFIG_ACPI static void iwl_mvm_phy_filter_init (struct iwl_mvm *mvm,struct iwl_phy_specific_cfg *phy_filters)
@@ -698,6 +593,111 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)return iwl_mvm_send_cmd_pdu (mvm, cmd_id,0 , cmd_size, &phy_cfg_cmd); } +static int iwl_run_unified_mvm_ucode (struct iwl_mvm *mvm) +{ +struct iwl_notification_wait init_wait; +struct iwl_nvm_access_complete_cmd nvm_complete = {}; +struct iwl_init_extended_cfg_cmd init_cfg = { + .init_flags =cpu_to_le32 (BIT (IWL_INIT_NVM )), + }; +static const u16 init_complete[] = { +INIT_COMPLETE_NOTIF , + }; +int ret; + +if (mvm->trans->cfg->tx_with_siso_diversity) + init_cfg.init_flags |=cpu_to_le32 (BIT (IWL_INIT_PHY )); + +lockdep_assert_held (&mvm->mutex); + + mvm->rfkill_safe_init_done = false; + +iwl_init_notification_wait (&mvm->notif_wait, + &init_wait, + init_complete, +ARRAY_SIZE (init_complete), + iwl_wait_init_complete, +NULL ); + +iwl_dbg_tlv_time_point (&mvm->fwrt,IWL_FW_INI_TIME_POINT_EARLY ,NULL ); + +/* Will also start the device */ + ret =iwl_mvm_load_ucode_wait_alive (mvm,IWL_UCODE_REGULAR ); +if (ret) { +IWL_ERR (mvm,"Failed to start RT ucode: %d\n" , ret); + goto error; + } +iwl_dbg_tlv_time_point (&mvm->fwrt,IWL_FW_INI_TIME_POINT_AFTER_ALIVE , +NULL ); + +/* Send init config command to mark that we are sending NVM access +* commands +*/ + ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (SYSTEM_GROUP , +INIT_EXTENDED_CFG_CMD ), +CMD_SEND_IN_RFKILL , +sizeof (init_cfg), &init_cfg); +if (ret) { +IWL_ERR (mvm,"Failed to run init config command: %d\n" , + ret); + goto error; + } + +/* Load NVM to NIC if needed */ +if (mvm->nvm_file_name) { + ret =iwl_read_external_nvm (mvm->trans, mvm->nvm_file_name, + mvm->nvm_sections); +if (ret) + goto error; + ret =iwl_mvm_load_nvm_to_nic (mvm); +if (ret) + goto error; + } + +if (IWL_MVM_PARSE_NVM && !mvm->nvm_data) { + ret =iwl_nvm_init (mvm); +if (ret) { +IWL_ERR (mvm,"Failed to read NVM: %d\n" , ret); + goto error; + } + } + + ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (REGULATORY_AND_NVM_GROUP , +NVM_ACCESS_COMPLETE ), +CMD_SEND_IN_RFKILL , +sizeof (nvm_complete), &nvm_complete); +if (ret) { +IWL_ERR (mvm,"Failed to run complete NVM access: %d\n" , + ret); + goto error; + } + +/* We wait for the INIT complete notification */ + ret =iwl_wait_notification (&mvm->notif_wait, &init_wait, +MVM_UCODE_ALIVE_TIMEOUT ); +if (ret) +return ret; + +/* Read the NVM only at driver load time, no need to do this twice */ +if (!IWL_MVM_PARSE_NVM && !mvm->nvm_data) { + mvm->nvm_data =iwl_get_nvm (mvm->trans, mvm->fw); +if (IS_ERR (mvm->nvm_data)) { + ret =PTR_ERR (mvm->nvm_data); + mvm->nvm_data =NULL ; +IWL_ERR (mvm,"Failed to read NVM: %d\n" , ret); +return ret; + } + } + + mvm->rfkill_safe_init_done = true; + +return 0 ; + +error: +iwl_remove_notification (&mvm->notif_wait, &init_wait); +return ret; +} +int iwl_run_init_mvm_ucode (struct iwl_mvm *mvm) {struct iwl_notification_wait calib_wait;
Signature · 1 line
2.38.1
PATCH 12/15 wifi: iwlwifi: Update init sequence if tx diversity supported
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
PHY configuration command need to be sent to FW if the tx diversity with SISO is supported.
This need to be sent to get the init notification from FW.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +10 -4
@@ -672,6 +672,13 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm) goto error; } + ret =iwl_send_phy_cfg_cmd (mvm); +if (ret) { +IWL_ERR (mvm,"Failed to run PHY configuration: %d\n" , + ret); + goto error; + } +/* We wait for the INIT complete notification */ ret =iwl_wait_notification (&mvm->notif_wait, &init_wait,MVM_UCODE_ALIVE_TIMEOUT );
@@ -1538,12 +1545,11 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ret =iwl_send_phy_db_data (mvm->phy_db);if (ret) goto error; + ret =iwl_send_phy_cfg_cmd (mvm); +if (ret) + goto error; } - ret =iwl_send_phy_cfg_cmd (mvm); -if (ret) - goto error; - ret =iwl_mvm_send_bt_init_conf (mvm);if (ret) goto error;
Signature · 1 line
2.38.1
PATCH 13/15 wifi: iwlwifi: Update configurations for Bnj-a0 and specific rf devices
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
Correction in config data is done for loading the ucode.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +1 -1
@@ -1235,7 +1235,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY ,IWL_CFG_MAC_TYPE_GL ,SILICON_A_STEP ,IWL_CFG_RF_TYPE_HR1 ,IWL_CFG_ANY , -IWL_CFG_ANY ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_IS_JACKET , +IWL_CFG_ANY ,IWL_CFG_ANY ,IWL_CFG_NO_CDB ,IWL_CFG_NO_JACKET , iwl_cfg_bnj_a0_hr_b0, iwl_bz_name), _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_GL, SILICON_B_STEP,
Signature · 1 line
2.38.1
PATCH 14/15 wifi: iwlwifi: trans: don't trigger d3 interrupt twice
In reply to [email protected]From: Avraham Stern <[email protected]>
When the IPC registers are used for sleep control, setting the IPC sleep bit already triggers an interrupt to the fw, so there is no need to also set the doorbell. Setting also the doorbell triggers the sleep interrupt twice which lead to an assert.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +3 -6
@@ -1522,19 +1522,16 @@ static int iwl_pcie_d3_handshake(struct iwl_trans *trans, bool suspend)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);int ret; -if (trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_AX210 ) { +if (trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_AX210 )iwl_write_umac_prph (trans,UREG_DOORBELL_TO_ISR6 , suspend ?UREG_DOORBELL_TO_ISR6_SUSPEND :UREG_DOORBELL_TO_ISR6_RESUME ); - }else if (trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_BZ ) { +else if (trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_BZ )iwl_write32 (trans,CSR_IPC_SLEEP_CONTROL , suspend ?CSR_IPC_SLEEP_CONTROL_SUSPEND :CSR_IPC_SLEEP_CONTROL_RESUME ); -iwl_write_umac_prph (trans,UREG_DOORBELL_TO_ISR6 , -UREG_DOORBELL_TO_ISR6_SLEEP_CTRL ); - }else { +else return 0 ; - } ret =wait_event_timeout (trans_pcie->sx_waitq, trans_pcie->sx_complete,2 *HZ );
Signature · 1 line
2.38.1
PATCH 15/15 wifi: iwlwifi: mvm: don't set CHECKSUM_COMPLETE for unsupported protocols
In reply to [email protected]From: Avraham Stern <[email protected]>
On Bz devices, CHECKSUM_COMPLETE was set for unsupported protocols which results in a warning. Fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +2 -3
@@ -172,8 +172,7 @@ static int iwl_mvm_create_skb(struct iwl_mvm *mvm, struct sk_buff *skb,* Starting from Bz hardware, it calculates starting directly after * the MAC header, so that matches mac80211's expectation. */ -if (skb->ip_summed ==CHECKSUM_COMPLETE && - mvm->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_BZ ) { +if (skb->ip_summed ==CHECKSUM_COMPLETE ) {struct {u8 hdr[6 ];__be16 type;
@@ -188,7 +187,7 @@ static int iwl_mvm_create_skb(struct iwl_mvm *mvm, struct sk_buff *skb, shdr->type !=htons (ETH_P_PAE ) && shdr->type != htons(ETH_P_TDLS)))) skb->ip_summed = CHECKSUM_NONE; - else + else if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ) /* mac80211 assumes full CSUM including SNAP header */ skb_postpush_rcsum(skb, shdr, sizeof(*shdr)); }
Signature · 1 line
2.38.1