]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: pcie: move invalid TX CMD into PCIe
authorJohannes Berg <johannes.berg@intel.com>
Sat, 3 May 2025 19:44:22 +0000 (22:44 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 7 May 2025 03:08:00 +0000 (06:08 +0300)
There's no reason for this to be in the generic transport
struct, move it into the PCIe code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224231.d4916769a25b.Ife9b0283e50023efb6b3f44e81a6ff3885fe5a8d@changeid
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index aa32305e05f643d3683ce58f910953f9064cd306..387a54fa728c711161ab413de80881c16efd9d95 100644 (file)
@@ -878,7 +878,6 @@ struct iwl_txq {
  * @mbx_addr_1_step: step address data 1
  * @pcie_link_speed: current PCIe link speed (%PCI_EXP_LNKSTA_CLS_*),
  *     only valid for discrete (not integrated) NICs
- * @invalid_tx_cmd: invalid TX command buffer
  * @reduced_cap_sku: reduced capability supported SKU
  * @step_urm: STEP is in URM, no support for MCS>9 in 320 MHz
  * @restart: restart worker data
@@ -962,8 +961,6 @@ struct iwl_trans {
 
        u8 pcie_link_speed;
 
-       struct iwl_dma_ptr invalid_tx_cmd;
-
        struct {
                struct work_struct wk;
                struct iwl_fw_error_dump_mode mode;
index 2cf2936dbf2d1b2f8fc8bd77dadcdf235a886a8c..6eee20ffbfc8f9f0c3ca02bc48c0218483361c64 100644 (file)
@@ -423,6 +423,7 @@ struct iwl_pcie_txqs {
  * @me_present: WiAMT/CSME is detected as present (1), not present (0)
  *     or unknown (-1, so can still use it as a boolean safely)
  * @me_recheck_wk: worker to recheck WiAMT/CSME presence
+ * @invalid_tx_cmd: invalid TX command buffer
  */
 struct iwl_trans_pcie {
        struct iwl_rxq *rxq;
@@ -525,6 +526,8 @@ struct iwl_trans_pcie {
 
        s8 me_present;
        struct delayed_work me_recheck_wk;
+
+       struct iwl_dma_ptr invalid_tx_cmd;
 };
 
 static inline struct iwl_trans_pcie *
@@ -758,10 +761,12 @@ int iwl_txq_gen2_set_tb(struct iwl_trans *trans,
 static inline void iwl_txq_set_tfd_invalid_gen2(struct iwl_trans *trans,
                                                struct iwl_tfh_tfd *tfd)
 {
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+
        tfd->num_tbs = 0;
 
-       iwl_txq_gen2_set_tb(trans, tfd, trans->invalid_tx_cmd.dma,
-                           trans->invalid_tx_cmd.size);
+       iwl_txq_gen2_set_tb(trans, tfd, trans_pcie->invalid_tx_cmd.dma,
+                           trans_pcie->invalid_tx_cmd.size);
 }
 
 void iwl_txq_gen2_tfd_unmap(struct iwl_trans *trans,
index 5b8db061792f482c5815a8dc3a915d4f6afd83ec..bd6b87e4f6e6a01f27cfd4e31d292b85ff32e24a 100644 (file)
@@ -2026,11 +2026,14 @@ void iwl_trans_pcie_free_pnvm_dram_regions(struct iwl_dram_regions *dram_regions
 
 static void iwl_pcie_free_invalid_tx_cmd(struct iwl_trans *trans)
 {
-       iwl_pcie_free_dma_ptr(trans, &trans->invalid_tx_cmd);
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+
+       iwl_pcie_free_dma_ptr(trans, &trans_pcie->invalid_tx_cmd);
 }
 
 static int iwl_pcie_alloc_invalid_tx_cmd(struct iwl_trans *trans)
 {
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        struct iwl_cmd_header_wide bad_cmd = {
                .cmd = INVALID_WR_PTR_CMD,
                .group_id = DEBUG_GROUP,
@@ -2040,11 +2043,11 @@ static int iwl_pcie_alloc_invalid_tx_cmd(struct iwl_trans *trans)
        };
        int ret;
 
-       ret = iwl_pcie_alloc_dma_ptr(trans, &trans->invalid_tx_cmd,
+       ret = iwl_pcie_alloc_dma_ptr(trans, &trans_pcie->invalid_tx_cmd,
                                     sizeof(bad_cmd));
        if (ret)
                return ret;
-       memcpy(trans->invalid_tx_cmd.addr, &bad_cmd, sizeof(bad_cmd));
+       memcpy(trans_pcie->invalid_tx_cmd.addr, &bad_cmd, sizeof(bad_cmd));
        return 0;
 }
 
index 7c8cab294321a586f24502be594128ee1a4e3f43..c728722533a8b303a9363770529ea29e457b6a2b 100644 (file)
@@ -280,10 +280,12 @@ iwl_txq_gen1_tfd_tb_get_addr(struct iwl_tfd *tfd, u8 idx)
 static void iwl_txq_set_tfd_invalid_gen1(struct iwl_trans *trans,
                                         struct iwl_tfd *tfd)
 {
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+
        tfd->num_tbs = 0;
 
-       iwl_pcie_gen1_tfd_set_tb(tfd, 0, trans->invalid_tx_cmd.dma,
-                                trans->invalid_tx_cmd.size);
+       iwl_pcie_gen1_tfd_set_tb(tfd, 0, trans_pcie->invalid_tx_cmd.dma,
+                                trans_pcie->invalid_tx_cmd.size);
 }
 
 static void iwl_txq_gen1_tfd_unmap(struct iwl_trans *trans,