Skip to content

Commit c700a94

Browse files
committed
wifi: iwlwifi: unify iwlagn_scd_bc_tbl_entry and iwl_gen3_bc_tbl_entry
As those are now the same, unify and adjust the documentation. Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250511195137.b7ddfade8fec.I2bf97252c4bd751077ade204767eed02d815614d@changeid
1 parent 6204d51 commit c700a94

File tree

4 files changed

+16
-29
lines changed

4 files changed

+16
-29
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-fh.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -717,30 +717,19 @@ struct iwl_tfh_tfd {
717717
/* Fixed (non-configurable) rx data from phy */
718718

719719
/**
720-
* struct iwlagn_scd_bc_tbl_entry - scheduler byte count table entry
720+
* struct iwl_bc_tbl_entry - scheduler byte count table entry
721721
* base physical address provided by SCD_DRAM_BASE_ADDR
722722
* For devices up to 22000:
723723
* @tfd_offset:
724724
* For devices up to 22000:
725725
* 0-12 - tx command byte count
726726
* 12-16 - station index
727-
* For 22000:
727+
* For 22000 and on:
728728
* 0-12 - tx command byte count
729729
* 12-13 - number of 64 byte chunks
730730
* 14-16 - reserved
731731
*/
732-
struct iwlagn_scd_bc_tbl_entry {
733-
__le16 tfd_offset;
734-
} __packed;
735-
736-
/**
737-
* struct iwl_gen3_bc_tbl_entry - scheduler byte count table entry gen3
738-
* For AX210 and on:
739-
* @tfd_offset: 0-12 - tx command byte count
740-
* 12-13 - number of 64 byte chunks
741-
* 14-16 - reserved
742-
*/
743-
struct iwl_gen3_bc_tbl_entry {
732+
struct iwl_bc_tbl_entry {
744733
__le16 tfd_offset;
745734
} __packed;
746735

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3785,6 +3785,7 @@ iwl_trans_pcie_alloc(struct pci_dev *pdev,
37853785
{
37863786
struct iwl_trans_pcie *trans_pcie, **priv;
37873787
struct iwl_trans *trans;
3788+
unsigned int bc_tbl_n_entries;
37883789
int ret, addr_size;
37893790
u32 bar0;
37903791

@@ -3833,14 +3834,14 @@ iwl_trans_pcie_alloc(struct pci_dev *pdev,
38333834
}
38343835

38353836
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
3836-
trans_pcie->txqs.bc_tbl_size =
3837-
sizeof(struct iwl_gen3_bc_tbl_entry) * TFD_QUEUE_BC_SIZE_BZ;
3837+
bc_tbl_n_entries = TFD_QUEUE_BC_SIZE_BZ;
38383838
else if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
3839-
trans_pcie->txqs.bc_tbl_size =
3840-
sizeof(struct iwl_gen3_bc_tbl_entry) * TFD_QUEUE_BC_SIZE_AX210;
3839+
bc_tbl_n_entries = TFD_QUEUE_BC_SIZE_AX210;
38413840
else
3842-
trans_pcie->txqs.bc_tbl_size =
3843-
sizeof(struct iwlagn_scd_bc_tbl_entry) * TFD_QUEUE_BC_SIZE;
3841+
bc_tbl_n_entries = TFD_QUEUE_BC_SIZE;
3842+
3843+
trans_pcie->txqs.bc_tbl_size =
3844+
sizeof(struct iwl_bc_tbl_entry) * bc_tbl_n_entries;
38443845
/*
38453846
* For gen2 devices, we use a single allocation for each byte-count
38463847
* table, but they're pretty small (1k) so use a DMA pool that we

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ static void iwl_pcie_gen2_update_byte_tbl(struct iwl_trans *trans,
561561
int num_tbs)
562562
{
563563
int idx = iwl_txq_get_cmd_index(txq, txq->write_ptr);
564+
struct iwl_bc_tbl_entry *scd_bc_tbl = txq->bc_tbl.addr;
564565
u8 filled_tfd_size, num_fetch_chunks;
565566
u16 len = byte_cnt;
566567
__le16 bc_ent;
@@ -581,19 +582,15 @@ static void iwl_pcie_gen2_update_byte_tbl(struct iwl_trans *trans,
581582
num_fetch_chunks = DIV_ROUND_UP(filled_tfd_size, 64) - 1;
582583

583584
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
584-
struct iwl_gen3_bc_tbl_entry *scd_bc_tbl_gen3 = txq->bc_tbl.addr;
585-
586585
WARN_ON(len > 0x3FFF);
587586
bc_ent = cpu_to_le16(len | (num_fetch_chunks << 14));
588-
scd_bc_tbl_gen3[idx].tfd_offset = bc_ent;
589587
} else {
590-
struct iwlagn_scd_bc_tbl_entry *scd_bc_tbl = txq->bc_tbl.addr;
591-
592588
len = DIV_ROUND_UP(len, 4);
593589
WARN_ON(len > 0xFFF);
594590
bc_ent = cpu_to_le16(len | (num_fetch_chunks << 12));
595-
scd_bc_tbl[idx].tfd_offset = bc_ent;
596591
}
592+
593+
scd_bc_tbl[idx].tfd_offset = bc_ent;
597594
}
598595

599596
static u8 iwl_txq_gen2_get_num_tbs(struct iwl_tfh_tfd *tfd)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq,
796796
return -ENOMEM;
797797
}
798798

799-
#define BC_TABLE_SIZE (sizeof(struct iwlagn_scd_bc_tbl_entry) * TFD_QUEUE_BC_SIZE)
799+
#define BC_TABLE_SIZE (sizeof(struct iwl_bc_tbl_entry) * TFD_QUEUE_BC_SIZE)
800800

801801
/*
802802
* iwl_pcie_tx_alloc - allocate TX context
@@ -2067,7 +2067,7 @@ static void iwl_txq_gen1_update_byte_cnt_tbl(struct iwl_trans *trans,
20672067
int num_tbs)
20682068
{
20692069
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
2070-
struct iwlagn_scd_bc_tbl_entry *scd_bc_tbl;
2070+
struct iwl_bc_tbl_entry *scd_bc_tbl;
20712071
int write_ptr = txq->write_ptr;
20722072
int txq_id = txq->id;
20732073
u8 sec_ctl = 0;
@@ -2314,7 +2314,7 @@ static void iwl_txq_gen1_inval_byte_cnt_tbl(struct iwl_trans *trans,
23142314
int read_ptr)
23152315
{
23162316
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
2317-
struct iwlagn_scd_bc_tbl_entry *scd_bc_tbl = trans_pcie->txqs.scd_bc_tbls.addr;
2317+
struct iwl_bc_tbl_entry *scd_bc_tbl = trans_pcie->txqs.scd_bc_tbls.addr;
23182318
int txq_id = txq->id;
23192319
u8 sta_id = 0;
23202320
__le16 bc_ent;

0 commit comments

Comments
 (0)