Skip to content

Commit 22a6741

Browse files
committed
wifi: iwlwifi: rename ctx-info-gen3 to ctx-info-v2
Context info was introduced in 22000, and was significantly changed in ax210. The new version of context info was called 'gen3', probably because in 22000, the gen2 transport was added. But this name is just wrong: - if 'gen' enumerates transports, there was not a gen3 transport, just a few modifications to gen1/2 transports needed for ax210. - if 'gen' enumerates devices, then we can just use the device names. Also, context info will soon become a lib, agnostic of the transport generations. Simply replace 'gen3' with 'v2'. Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250511195137.a580bd8d4f74.Ie413a02233f1a5ad538e13071c09760b9d97be3b@changeid
1 parent f60c366 commit 22a6741

File tree

8 files changed

+77
-77
lines changed

8 files changed

+77
-77
lines changed

drivers/net/wireless/intel/iwlwifi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ iwlwifi-objs += iwl-nvm-utils.o
88
iwlwifi-objs += iwl-utils.o
99
iwlwifi-objs += iwl-phy-db.o iwl-nvm-parse.o
1010
iwlwifi-objs += pcie/drv.o pcie/rx.o pcie/tx.o pcie/trans.o
11-
iwlwifi-objs += pcie/ctxt-info.o pcie/ctxt-info-gen3.o
11+
iwlwifi-objs += pcie/ctxt-info.o pcie/ctxt-info-v2.o
1212
iwlwifi-objs += pcie/trans-gen2.o pcie/tx-gen2.o
1313

1414
CFLAGS_pcie/drv.o += -Wno-override-init

drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h renamed to drivers/net/wireless/intel/iwlwifi/iwl-context-info-v2.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/*
33
* Copyright (C) 2018, 2020-2025 Intel Corporation
44
*/
5-
#ifndef __iwl_context_info_file_gen3_h__
6-
#define __iwl_context_info_file_gen3_h__
5+
#ifndef __iwl_context_info_file_v2_h__
6+
#define __iwl_context_info_file_v2_h__
77

88
#include "iwl-context-info.h"
99

@@ -250,7 +250,7 @@ struct iwl_prph_info {
250250
} __packed; /* PERIPH_INFO_S */
251251

252252
/**
253-
* struct iwl_context_info_gen3 - device INIT configuration
253+
* struct iwl_context_info_v2 - device INIT configuration
254254
* @version: version of the context information
255255
* @size: size of context information in DWs
256256
* @config: context in which the peripheral would execute - a subset of
@@ -293,7 +293,7 @@ struct iwl_prph_info {
293293
* @prph_scratch_size: the size of the peripheral scratch structure in DWs
294294
* @reserved: reserved
295295
*/
296-
struct iwl_context_info_gen3 {
296+
struct iwl_context_info_v2 {
297297
__le16 version;
298298
__le16 size;
299299
__le32 config;
@@ -323,22 +323,22 @@ struct iwl_context_info_gen3 {
323323
__le32 reserved;
324324
} __packed; /* IPC_CONTEXT_INFO_S */
325325

326-
int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
327-
const struct iwl_fw *fw,
328-
const struct fw_img *img);
329-
void iwl_pcie_ctxt_info_gen3_kick(struct iwl_trans *trans);
330-
void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans, bool alive);
326+
int iwl_pcie_ctxt_info_v2_alloc(struct iwl_trans *trans,
327+
const struct iwl_fw *fw,
328+
const struct fw_img *img);
329+
void iwl_pcie_ctxt_info_v2_kick(struct iwl_trans *trans);
330+
void iwl_pcie_ctxt_info_v2_free(struct iwl_trans *trans, bool alive);
331331

332-
int iwl_trans_pcie_ctx_info_gen3_load_pnvm(struct iwl_trans *trans,
333-
const struct iwl_pnvm_image *pnvm_payloads,
334-
const struct iwl_ucode_capabilities *capa);
335-
void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
336-
const struct iwl_ucode_capabilities *capa);
332+
int iwl_trans_pcie_ctx_info_v2_load_pnvm(struct iwl_trans *trans,
333+
const struct iwl_pnvm_image *pnvm_payloads,
334+
const struct iwl_ucode_capabilities *capa);
335+
void iwl_trans_pcie_ctx_info_v2_set_pnvm(struct iwl_trans *trans,
336+
const struct iwl_ucode_capabilities *capa);
337337
int
338-
iwl_trans_pcie_ctx_info_gen3_load_reduce_power(struct iwl_trans *trans,
339-
const struct iwl_pnvm_image *payloads,
340-
const struct iwl_ucode_capabilities *capa);
338+
iwl_trans_pcie_ctx_info_v2_load_reduce_power(struct iwl_trans *trans,
339+
const struct iwl_pnvm_image *payloads,
340+
const struct iwl_ucode_capabilities *capa);
341341
void
342-
iwl_trans_pcie_ctx_info_gen3_set_reduce_power(struct iwl_trans *trans,
343-
const struct iwl_ucode_capabilities *capa);
344-
#endif /* __iwl_context_info_file_gen3_h__ */
342+
iwl_trans_pcie_ctx_info_v2_set_reduce_power(struct iwl_trans *trans,
343+
const struct iwl_ucode_capabilities *capa);
344+
#endif /* __iwl_context_info_file_v2_h__ */

drivers/net/wireless/intel/iwlwifi/iwl-trans.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/dmapool.h>
1616
#include "fw/api/commands.h"
1717
#include "pcie/internal.h"
18-
#include "iwl-context-info-gen3.h"
18+
#include "iwl-context-info-v2.h"
1919

2020
struct iwl_trans_dev_restart_data {
2121
struct list_head list;
@@ -813,29 +813,29 @@ int iwl_trans_load_pnvm(struct iwl_trans *trans,
813813
const struct iwl_pnvm_image *pnvm_data,
814814
const struct iwl_ucode_capabilities *capa)
815815
{
816-
return iwl_trans_pcie_ctx_info_gen3_load_pnvm(trans, pnvm_data, capa);
816+
return iwl_trans_pcie_ctx_info_v2_load_pnvm(trans, pnvm_data, capa);
817817
}
818818
IWL_EXPORT_SYMBOL(iwl_trans_load_pnvm);
819819

820820
void iwl_trans_set_pnvm(struct iwl_trans *trans,
821821
const struct iwl_ucode_capabilities *capa)
822822
{
823-
iwl_trans_pcie_ctx_info_gen3_set_pnvm(trans, capa);
823+
iwl_trans_pcie_ctx_info_v2_set_pnvm(trans, capa);
824824
}
825825
IWL_EXPORT_SYMBOL(iwl_trans_set_pnvm);
826826

827827
int iwl_trans_load_reduce_power(struct iwl_trans *trans,
828828
const struct iwl_pnvm_image *payloads,
829829
const struct iwl_ucode_capabilities *capa)
830830
{
831-
return iwl_trans_pcie_ctx_info_gen3_load_reduce_power(trans, payloads,
831+
return iwl_trans_pcie_ctx_info_v2_load_reduce_power(trans, payloads,
832832
capa);
833833
}
834834
IWL_EXPORT_SYMBOL(iwl_trans_load_reduce_power);
835835

836836
void iwl_trans_set_reduce_power(struct iwl_trans *trans,
837837
const struct iwl_ucode_capabilities *capa)
838838
{
839-
iwl_trans_pcie_ctx_info_gen3_set_reduce_power(trans, capa);
839+
iwl_trans_pcie_ctx_info_v2_set_reduce_power(trans, capa);
840840
}
841841
IWL_EXPORT_SYMBOL(iwl_trans_set_reduce_power);

drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c renamed to drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-v2.c

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <linux/dmi.h>
66
#include "iwl-trans.h"
77
#include "iwl-fh.h"
8-
#include "iwl-context-info-gen3.h"
8+
#include "iwl-context-info-v2.h"
99
#include "internal.h"
1010
#include "iwl-prph.h"
1111

@@ -97,12 +97,12 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans,
9797
*control_flags |= IWL_PRPH_SCRATCH_EARLY_DEBUG_EN | dbg_flags;
9898
}
9999

100-
int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
101-
const struct iwl_fw *fw,
102-
const struct fw_img *img)
100+
int iwl_pcie_ctxt_info_v2_alloc(struct iwl_trans *trans,
101+
const struct iwl_fw *fw,
102+
const struct fw_img *img)
103103
{
104104
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
105-
struct iwl_context_info_gen3 *ctxt_info_gen3;
105+
struct iwl_context_info_v2 *ctxt_info_v2;
106106
struct iwl_prph_scratch *prph_scratch;
107107
struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl;
108108
struct iwl_prph_info *prph_info;
@@ -213,18 +213,18 @@ int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
213213
}
214214

215215
/* Allocate context info */
216-
ctxt_info_gen3 = dma_alloc_coherent(trans->dev,
217-
sizeof(*ctxt_info_gen3),
218-
&trans_pcie->ctxt_info_dma_addr,
219-
GFP_KERNEL);
220-
if (!ctxt_info_gen3) {
216+
ctxt_info_v2 = dma_alloc_coherent(trans->dev,
217+
sizeof(*ctxt_info_v2),
218+
&trans_pcie->ctxt_info_dma_addr,
219+
GFP_KERNEL);
220+
if (!ctxt_info_v2) {
221221
ret = -ENOMEM;
222222
goto err_free_prph_info;
223223
}
224224

225-
ctxt_info_gen3->prph_info_base_addr =
225+
ctxt_info_v2->prph_info_base_addr =
226226
cpu_to_le64(trans_pcie->prph_info_dma_addr);
227-
ctxt_info_gen3->prph_scratch_base_addr =
227+
ctxt_info_v2->prph_scratch_base_addr =
228228
cpu_to_le64(trans_pcie->prph_scratch_dma_addr);
229229

230230
/*
@@ -236,29 +236,29 @@ int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
236236
sizeof(prph_scratch->dram.fseq_img) !=
237237
sizeof(*prph_scratch));
238238
if (control_flags_ext & IWL_PRPH_SCRATCH_EXT_EXT_FSEQ)
239-
ctxt_info_gen3->prph_scratch_size =
239+
ctxt_info_v2->prph_scratch_size =
240240
cpu_to_le32(sizeof(*prph_scratch));
241241
else
242-
ctxt_info_gen3->prph_scratch_size =
242+
ctxt_info_v2->prph_scratch_size =
243243
cpu_to_le32(offsetofend(typeof(*prph_scratch),
244244
dram.common));
245245

246-
ctxt_info_gen3->cr_head_idx_arr_base_addr =
246+
ctxt_info_v2->cr_head_idx_arr_base_addr =
247247
cpu_to_le64(trans_pcie->rxq->rb_stts_dma);
248-
ctxt_info_gen3->tr_tail_idx_arr_base_addr =
248+
ctxt_info_v2->tr_tail_idx_arr_base_addr =
249249
cpu_to_le64(trans_pcie->prph_info_dma_addr + PAGE_SIZE / 2);
250-
ctxt_info_gen3->cr_tail_idx_arr_base_addr =
250+
ctxt_info_v2->cr_tail_idx_arr_base_addr =
251251
cpu_to_le64(trans_pcie->prph_info_dma_addr + 3 * PAGE_SIZE / 4);
252-
ctxt_info_gen3->mtr_base_addr =
252+
ctxt_info_v2->mtr_base_addr =
253253
cpu_to_le64(trans_pcie->txqs.txq[trans->conf.cmd_queue]->dma_addr);
254-
ctxt_info_gen3->mcr_base_addr =
254+
ctxt_info_v2->mcr_base_addr =
255255
cpu_to_le64(trans_pcie->rxq->used_bd_dma);
256-
ctxt_info_gen3->mtr_size =
256+
ctxt_info_v2->mtr_size =
257257
cpu_to_le16(TFD_QUEUE_CB_SIZE(cmdq_size));
258-
ctxt_info_gen3->mcr_size =
258+
ctxt_info_v2->mcr_size =
259259
cpu_to_le16(RX_QUEUE_CB_SIZE(iwl_trans_get_num_rbds(trans)));
260260

261-
trans_pcie->ctxt_info_gen3 = ctxt_info_gen3;
261+
trans_pcie->ctxt_info_v2 = ctxt_info_v2;
262262
trans_pcie->prph_info = prph_info;
263263
trans_pcie->prph_scratch = prph_scratch;
264264

@@ -277,10 +277,10 @@ int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
277277
return 0;
278278

279279
err_free_ctxt_info:
280-
dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3),
281-
trans_pcie->ctxt_info_gen3,
280+
dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_v2),
281+
trans_pcie->ctxt_info_v2,
282282
trans_pcie->ctxt_info_dma_addr);
283-
trans_pcie->ctxt_info_gen3 = NULL;
283+
trans_pcie->ctxt_info_v2 = NULL;
284284
err_free_prph_info:
285285
dma_free_coherent(trans->dev, PAGE_SIZE, prph_info,
286286
trans_pcie->prph_info_dma_addr);
@@ -294,7 +294,7 @@ int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
294294

295295
}
296296

297-
void iwl_pcie_ctxt_info_gen3_kick(struct iwl_trans *trans)
297+
void iwl_pcie_ctxt_info_v2_kick(struct iwl_trans *trans)
298298
{
299299
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
300300

@@ -309,7 +309,7 @@ void iwl_pcie_ctxt_info_gen3_kick(struct iwl_trans *trans)
309309
CSR_AUTO_FUNC_BOOT_ENA);
310310
}
311311

312-
void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans, bool alive)
312+
void iwl_pcie_ctxt_info_v2_free(struct iwl_trans *trans, bool alive)
313313
{
314314
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
315315

@@ -327,15 +327,15 @@ void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans, bool alive)
327327
if (alive)
328328
return;
329329

330-
if (!trans_pcie->ctxt_info_gen3)
330+
if (!trans_pcie->ctxt_info_v2)
331331
return;
332332

333-
/* ctxt_info_gen3 and prph_scratch are still needed for PNVM load */
334-
dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3),
335-
trans_pcie->ctxt_info_gen3,
333+
/* ctxt_info_v2 and prph_scratch are still needed for PNVM load */
334+
dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_v2),
335+
trans_pcie->ctxt_info_v2,
336336
trans_pcie->ctxt_info_dma_addr);
337337
trans_pcie->ctxt_info_dma_addr = 0;
338-
trans_pcie->ctxt_info_gen3 = NULL;
338+
trans_pcie->ctxt_info_v2 = NULL;
339339

340340
dma_free_coherent(trans->dev, sizeof(*trans_pcie->prph_scratch),
341341
trans_pcie->prph_scratch,
@@ -439,9 +439,9 @@ static int iwl_pcie_load_payloads_segments
439439

440440
}
441441

442-
int iwl_trans_pcie_ctx_info_gen3_load_pnvm(struct iwl_trans *trans,
443-
const struct iwl_pnvm_image *pnvm_payloads,
444-
const struct iwl_ucode_capabilities *capa)
442+
int iwl_trans_pcie_ctx_info_v2_load_pnvm(struct iwl_trans *trans,
443+
const struct iwl_pnvm_image *pnvm_payloads,
444+
const struct iwl_ucode_capabilities *capa)
445445
{
446446
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
447447
struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl =
@@ -521,8 +521,8 @@ static void iwl_pcie_set_contig_pnvm(struct iwl_trans *trans)
521521
cpu_to_le32(trans_pcie->pnvm_data.drams[0].size);
522522
}
523523

524-
void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
525-
const struct iwl_ucode_capabilities *capa)
524+
void iwl_trans_pcie_ctx_info_v2_set_pnvm(struct iwl_trans *trans,
525+
const struct iwl_ucode_capabilities *capa)
526526
{
527527
if (trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
528528
return;
@@ -533,9 +533,9 @@ void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
533533
iwl_pcie_set_contig_pnvm(trans);
534534
}
535535

536-
int iwl_trans_pcie_ctx_info_gen3_load_reduce_power(struct iwl_trans *trans,
537-
const struct iwl_pnvm_image *payloads,
538-
const struct iwl_ucode_capabilities *capa)
536+
int iwl_trans_pcie_ctx_info_v2_load_reduce_power(struct iwl_trans *trans,
537+
const struct iwl_pnvm_image *payloads,
538+
const struct iwl_ucode_capabilities *capa)
539539
{
540540
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
541541
struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl =
@@ -604,8 +604,8 @@ static void iwl_pcie_set_contig_reduce_power(struct iwl_trans *trans)
604604
}
605605

606606
void
607-
iwl_trans_pcie_ctx_info_gen3_set_reduce_power(struct iwl_trans *trans,
608-
const struct iwl_ucode_capabilities *capa)
607+
iwl_trans_pcie_ctx_info_v2_set_reduce_power(struct iwl_trans *trans,
608+
const struct iwl_ucode_capabilities *capa)
609609
{
610610
if (trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
611611
return;

drivers/net/wireless/intel/iwlwifi/pcie/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ struct iwl_pcie_txqs {
326326
* @global_table: table mapping received VID from hw to rxb
327327
* @rba: allocator for RX replenishing
328328
* @ctxt_info: context information for FW self init
329-
* @ctxt_info_gen3: context information for gen3 devices
329+
* @ctxt_info_v2: context information for v1 devices
330330
* @prph_info: prph info for self init
331331
* @prph_scratch: prph scratch for self init
332332
* @ctxt_info_dma_addr: dma addr of context information
@@ -408,7 +408,7 @@ struct iwl_trans_pcie {
408408
struct iwl_rb_allocator rba;
409409
union {
410410
struct iwl_context_info *ctxt_info;
411-
struct iwl_context_info_gen3 *ctxt_info_gen3;
411+
struct iwl_context_info_v2 *ctxt_info_v2;
412412
};
413413
struct iwl_prph_info *prph_info;
414414
struct iwl_prph_scratch *prph_scratch;

drivers/net/wireless/intel/iwlwifi/pcie/rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "iwl-io.h"
1313
#include "internal.h"
1414
#include "iwl-op-mode.h"
15-
#include "iwl-context-info-gen3.h"
15+
#include "iwl-context-info-v2.h"
1616
#include "fw/dbg.h"
1717

1818
/******************************************************************************

drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "iwl-trans.h"
77
#include "iwl-prph.h"
88
#include "iwl-context-info.h"
9-
#include "iwl-context-info-gen3.h"
9+
#include "iwl-context-info-v2.h"
1010
#include "internal.h"
1111
#include "fw/dbg.h"
1212

@@ -192,7 +192,7 @@ static void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans)
192192

193193
iwl_pcie_ctxt_info_free_paging(trans);
194194
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
195-
iwl_pcie_ctxt_info_gen3_free(trans, false);
195+
iwl_pcie_ctxt_info_v2_free(trans, false);
196196
else
197197
iwl_pcie_ctxt_info_free(trans);
198198

@@ -375,7 +375,7 @@ void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans)
375375
* paging memory cannot be freed included since FW will still use it
376376
*/
377377
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
378-
iwl_pcie_ctxt_info_gen3_free(trans, true);
378+
iwl_pcie_ctxt_info_v2_free(trans, true);
379379
else
380380
iwl_pcie_ctxt_info_free(trans);
381381

@@ -555,12 +555,12 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
555555

556556
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
557557
if (!top_reset_done) {
558-
ret = iwl_pcie_ctxt_info_gen3_alloc(trans, fw, img);
558+
ret = iwl_pcie_ctxt_info_v2_alloc(trans, fw, img);
559559
if (ret)
560560
goto out;
561561
}
562562

563-
iwl_pcie_ctxt_info_gen3_kick(trans);
563+
iwl_pcie_ctxt_info_v2_kick(trans);
564564
} else {
565565
ret = iwl_pcie_ctxt_info_init(trans, img);
566566
if (ret)

drivers/net/wireless/intel/iwlwifi/pcie/trans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "mei/iwl-mei.h"
2929
#include "internal.h"
3030
#include "iwl-fh.h"
31-
#include "iwl-context-info-gen3.h"
31+
#include "iwl-context-info-v2.h"
3232

3333
/* extended range in FW SRAM */
3434
#define IWL_FW_MEM_EXTENDED_START 0x40000

0 commit comments

Comments
 (0)