ath11k: firmware and board file support for PCI devices
cover ath11k: firmware and board file support for PCI devices
Here's a second set of patches adding QCA6390 PCI support to ath11k. Now m3 firmware and board file support is added as well various smaller tweaks and fixes needed QCA6390 support.
There will be two more patchsets for QCA6390 after this. Please review.
This patchset depends on the patchset:
ath11k: initial PCI support
Kalle
Carl Huang (4):
ath11k: allocate smaller chunks of memory for firmware
ath11k: fix memory OOB access in qmi_decode
ath11k: fix KASAN warning of ath11k_qmi_wlanfw_wlan_cfg_send
ath11k: enable internal sleep clock
Govind Singh (6):
ath11k: add support for m3 firmware
ath11k: add board file support for PCI devices
ath11k: fill appropriate QMI service instance id for QCA6390
ath11k: pci: add read32() and write32() hif operations
ath11k: configure copy engine msi address in CE srng
ath11k: setup ce tasklet for control path
Kalle Valo (1):
ath11k: hal: create hw_srng_config dynamically
drivers/net/wireless/ath/ath11k/ahb.c | 4 + drivers/net/wireless/ath/ath11k/ce.c | 32 ++++ drivers/net/wireless/ath/ath11k/ce.h | 2 + drivers/net/wireless/ath/ath11k/core.c | 9 +- drivers/net/wireless/ath/ath11k/core.h | 16 ++ drivers/net/wireless/ath/ath11k/dbring.c | 2 +- drivers/net/wireless/ath/ath11k/dp.c | 8 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 4 +- drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- drivers/net/wireless/ath/ath11k/hal.c | 119 +++++++------ drivers/net/wireless/ath/ath11k/hal.h | 8 +- drivers/net/wireless/ath/ath11k/hal_rx.c | 2 +- drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +- drivers/net/wireless/ath/ath11k/hif.h | 26 +++ drivers/net/wireless/ath/ath11k/hw.h | 3 + drivers/net/wireless/ath/ath11k/pci.c | 200 ++++++++++++++++++++- drivers/net/wireless/ath/ath11k/pci.h | 4 + drivers/net/wireless/ath/ath11k/qmi.c | 293 ++++++++++++++++++++++++++++--- drivers/net/wireless/ath/ath11k/qmi.h | 25 ++- 19 files changed, 654 insertions(+), 107 deletions(-)
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 1/11 ath11k: add support for m3 firmware
From: Govind Singh <[email protected]>
PCI devices like QCA6390 have a separate firmware image for the m3 micro-controller. Add support to load the firmware using m3.bin file.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/ahb.c | 1 + drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/pci.c | 1 + drivers/net/wireless/ath/ath11k/qmi.c | 82 +++++++++++++++++++++++++++++++--- drivers/net/wireless/ath/ath11k/qmi.h | 7 +++ 6 files changed, 86 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +1 -0
@@ -27,6 +27,7 @@ MODULE_DEVICE_TABLE(of, ath11k_ahb_of_match);static const struct ath11k_bus_params ath11k_ahb_bus_params = { .mhi_support = false, + .m3_fw_support = false, };/* Target firmware's Copy Engine configuration. */
drivers/net/wireless/ath/ath11k/core.h +1 -0
@@ -582,6 +582,7 @@ struct ath11k_board_data {struct ath11k_bus_params {bool mhi_support; +bool m3_fw_support; };/* IPQ8074 HW channel counters frequency value in hertz */
drivers/net/wireless/ath/ath11k/hw.h +1 -0
@@ -73,6 +73,7 @@#define ATH11K_DEFAULT_BOARD_FILE "board.bin"#define ATH11K_DEFAULT_CAL_FILE "caldata.bin"#define ATH11K_AMSS_FILE "amss.bin" +#define ATH11K_M3_FILE "m3.bin"enum ath11k_hw_rate_cck {ATH11K_HW_RATE_CCK_LP_11M =0 ,
drivers/net/wireless/ath/ath11k/pci.c +1 -0
@@ -29,6 +29,7 @@ MODULE_DEVICE_TABLE(pci, ath11k_pci_id_table);static const struct ath11k_bus_params ath11k_pci_bus_params = { .mhi_support = true, + .m3_fw_support = true, };static const struct ath11k_msi_config msi_config = {
drivers/net/wireless/ath/ath11k/qmi.c +75 -7
107 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/qmi.h +7 -0
@@ -96,6 +96,12 @@ struct target_info {char fw_build_id[ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 +1 ]; }; +struct m3_mem_region { +u32 size; +dma_addr_t paddr; +void *vaddr; +}; +struct ath11k_qmi {struct ath11k_base *ab;struct qmi_handle handle;
@@ -110,6 +116,7 @@ struct ath11k_qmi {u32 target_mem_mode;u8 cal_done;struct target_info target; +struct m3_mem_region m3_mem; };#define QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN 189
Signature · 1 line
2.7.4
Re: [PATCH 01/11] ath11k: add support for m3 firmware
Quoted 8 lines · Kalle Valo
PCI devices like QCA6390 have a separate firmware image for the m3 micro-controller. Add support to load the firmware using m3.bin file.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2Signed-off-by Govind Singh <[email protected]>Signed-off-by Kalle Valo <[email protected]>
11 patches applied to ath-next branch of ath.git, thanks.
569704544778 ath11k: add support for m3 firmware6eb6ea513828 ath11k: add board file support for PCI devices eb8de0490e1f ath11k: fill appropriate QMI service instance id for QCA6390 654e959ae0a1 ath11k: pci: add read32() and write32() hif operations c4eacabee224 ath11k: configure copy engine msi address in CE srng 2c3960c2253d ath11k: setup ce tasklet for control path 26f3a021b37c ath11k: allocate smaller chunks of memory for firmware f44dd33e6336 ath11k: fix memory OOB access in qmi_decode 6c809d04c542 ath11k: fix KASAN warning of ath11k_qmi_wlanfw_wlan_cfg_send 727fae1478a5 ath11k: enable internal sleep clockf7eb4b04ce6f ath11k: hal: create hw_srng_config dynamically
Signature · 3 lines
https://patchwork.kernel.org/patch/11713607/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH 01/11] ath11k: add support for m3 firmware
In reply to Kalle ValoQuoted 8 lines · Kalle Valo
PCI devices like QCA6390 have a separate firmware image for the m3 micro-controller. Add support to load the firmware using m3.bin file.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2Signed-off-by Govind Singh <[email protected]>Signed-off-by Kalle Valo <[email protected]>
11 patches applied to ath-next branch of ath.git, thanks.
569704544778 ath11k: add support for m3 firmware6eb6ea513828 ath11k: add board file support for PCI devices eb8de0490e1f ath11k: fill appropriate QMI service instance id for QCA6390 654e959ae0a1 ath11k: pci: add read32() and write32() hif operations c4eacabee224 ath11k: configure copy engine msi address in CE srng 2c3960c2253d ath11k: setup ce tasklet for control path 26f3a021b37c ath11k: allocate smaller chunks of memory for firmware f44dd33e6336 ath11k: fix memory OOB access in qmi_decode 6c809d04c542 ath11k: fix KASAN warning of ath11k_qmi_wlanfw_wlan_cfg_send 727fae1478a5 ath11k: enable internal sleep clockf7eb4b04ce6f ath11k: hal: create hw_srng_config dynamically
Signature · 9 lines
https://patchwork.kernel.org/patch/11713607/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/11 ath11k: add board file support for PCI devices
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
PCI devices like QCA6390 load the board file differently, add support for that and the method is chosen using bus_params variables.
Add support to create board name for different targets. This board name is used to parse the board data from board-2.bin for ahb/pci based targets.
As struct target_mem_chunk::vaddr was changed from 'u32' to 'u32 *' in ath11k_qmi_assign_target_mem_chunk() vaddr assignments were changed to NULL to avoid a compilation warning. IPQ8074 does not use the vaddr field for anything so that change does not affect functionality.
At the moment this only supports board files with BIN type. Support for ELF type, which seems to be more popular on QCA6390 devices, needs to be added later.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/ahb.c | 2 + drivers/net/wireless/ath/ath11k/core.c | 7 +- drivers/net/wireless/ath/ath11k/core.h | 15 ++++ drivers/net/wireless/ath/ath11k/pci.c | 2 + drivers/net/wireless/ath/ath11k/qmi.c | 144 +++++++++++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/qmi.h | 7 +- 6 files changed, 167 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +2 -0
@@ -28,6 +28,8 @@ MODULE_DEVICE_TABLE(of, ath11k_ahb_of_match);static const struct ath11k_bus_params ath11k_ahb_bus_params = { .mhi_support = false, .m3_fw_support = false, + .fixed_bdf_addr = true, + .fixed_mem_region = true, };/* Target firmware's Copy Engine configuration. */
drivers/net/wireless/ath/ath11k/core.c +3 -4
@@ -50,11 +50,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {static int ath11k_core_create_board_name (struct ath11k_base *ab,char *name,size_t name_len) { -/* Note: bus is fixed to ahb. When other bus type supported, -* make it to dynamic. -*/ scnprintf (name, name_len, -"bus=ahb,qmi-chip-id=%d,qmi-board-id=%d" , +"bus=%s,qmi-chip-id=%d,qmi-board-id=%d" , +ath11k_bus_str (ab->hif.bus), ab->qmi.target.chip_id, ab->qmi.target.board_id);
@@ -853,6 +851,7 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,timer_setup (&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry,0 ); ab->dev = dev; ab->bus_params = *bus_params; + ab->hif.bus = bus;return ab;
drivers/net/wireless/ath/ath11k/core.h +15 -0
@@ -583,6 +583,8 @@ struct ath11k_board_data {struct ath11k_bus_params {bool mhi_support;bool m3_fw_support; +bool fixed_bdf_addr; +bool fixed_mem_region; };/* IPQ8074 HW channel counters frequency value in hertz */
@@ -647,6 +649,7 @@ struct ath11k_base {unsigned long mem_len;struct { +enum ath11k_bus bus;const struct ath11k_hif_ops *ops; } hif;
@@ -905,4 +908,16 @@ static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab, ab->hw_params.fw.dir, filename); } +static inline const char *ath11k_bus_str (enum ath11k_bus bus) +{ +switch (bus) { +case ATH11K_BUS_PCI : +return "pci" ; +case ATH11K_BUS_AHB : +return "ahb" ; + } + +return "unknown" ; +} +#endif /* _CORE_H_ */
drivers/net/wireless/ath/ath11k/pci.c +2 -0
@@ -30,6 +30,8 @@ MODULE_DEVICE_TABLE(pci, ath11k_pci_id_table);static const struct ath11k_bus_params ath11k_pci_bus_params = { .mhi_support = true, .m3_fw_support = true, + .fixed_bdf_addr = false, + .fixed_mem_region = false, };static const struct ath11k_msi_config msi_config = {
drivers/net/wireless/ath/ath11k/qmi.c +139 -5
193 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/qmi.h +6 -1
@@ -40,6 +40,11 @@ enum ath11k_qmi_file_type { ATH11K_QMI_MAX_FILE_TYPE, }; +enum ath11k_qmi_bdf_type { +ATH11K_QMI_BDF_TYPE_BIN =0 , +ATH11K_QMI_BDF_TYPE_ELF =1 , +}; +enum ath11k_qmi_event_type {ATH11K_QMI_EVENT_SERVER_ARRIVE ,ATH11K_QMI_EVENT_SERVER_EXIT ,
@@ -83,7 +88,7 @@ struct target_mem_chunk {u32 size;u32 type;dma_addr_t paddr; -u32 vaddr; +u32 *vaddr; };struct target_info {
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/11 ath11k: fill appropriate QMI service instance id for QCA6390
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
QMI service instance id is used for qmi service lookup, IPQ8074 and QCA6390 uses different instance id for service lookup. Fill appropriate QMI service instance id for respective targets.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/ahb.c | 1 + drivers/net/wireless/ath/ath11k/pci.c | 1 + drivers/net/wireless/ath/ath11k/qmi.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.h | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/ahb.c +1 -0
@@ -581,6 +581,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) cfg->tgt_ce = target_ce_config_wlan; cfg->svc_to_ce_map_len =ARRAY_SIZE (target_service_to_ce_map_wlan); cfg->svc_to_ce_map = target_service_to_ce_map_wlan; + ab->qmi.service_ins_id =ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 ; }static void ath11k_ahb_free_ext_irq (struct ath11k_base *ab)
drivers/net/wireless/ath/ath11k/pci.c +1 -0
@@ -393,6 +393,7 @@ static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab) cfg->svc_to_ce_map = target_service_to_ce_map_wlan; cfg->svc_to_ce_map_len =ARRAY_SIZE (target_service_to_ce_map_wlan); + ab->qmi.service_ins_id =ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 ; }static void ath11k_pci_ce_irq_enable (struct ath11k_base *ab,u16 ce_id)
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
@@ -2610,7 +2610,7 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) ret =qmi_add_lookup (&ab->qmi.handle,ATH11K_QMI_WLFW_SERVICE_ID_V01 ,ATH11K_QMI_WLFW_SERVICE_VERS_V01 , -ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 ); + ab->qmi.service_ins_id);if (ret <0 ) {ath11k_warn (ab,"failed to add qmi lookup\n" );return ret;
drivers/net/wireless/ath/ath11k/qmi.h +3 -0
@@ -18,6 +18,8 @@#define ATH11K_QMI_WLFW_SERVICE_ID_V01 0x45#define ATH11K_QMI_WLFW_SERVICE_VERS_V01 0x01#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02 +#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01 +#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32#define ATH11K_QMI_RESP_LEN_MAX 8192#define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32
@@ -122,6 +124,7 @@ struct ath11k_qmi {u8 cal_done;struct target_info target;struct m3_mem_region m3_mem; +unsigned int service_ins_id; };#define QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN 189
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 4/11 ath11k: pci: add read32() and write32() hif operations
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
Add support for bus read/write/window selection operations for reading hardware memory.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/pci.c | 55 +++++++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/pci.h | 4 +++ 2 files changed, 59 insertions(+)
drivers/net/wireless/ath/ath11k/pci.c +55 -0
@@ -18,6 +18,12 @@#define ATH11K_PCI_IRQ_CE0_OFFSET 3 +#define WINDOW_ENABLE_BIT 0x40000000 +#define WINDOW_REG_ADDRESS 0x310c +#define WINDOW_VALUE_MASK GENMASK(24, 19) +#define WINDOW_START 0x80000 +#define WINDOW_RANGE_MASK GENMASK(18, 0) +#define QCA6390_DEVICE_ID 0x1101static const struct pci_device_id ath11k_pci_id_table[] = {
@@ -280,6 +286,52 @@ static const char *irq_name[ATH11K_IRQ_NUM_MAX] = { "tcl2host-status-ring", }; +static inline void ath11k_pci_select_window (struct ath11k_pci *ab_pci,u32 offset) +{ +struct ath11k_base *ab = ab_pci->ab; + +u32 window =FIELD_GET (WINDOW_VALUE_MASK , offset); + +lockdep_assert_held (&ab_pci->window_lock); + +if (window != ab_pci->register_window) { +iowrite32 (WINDOW_ENABLE_BIT | window, + ab->mem +WINDOW_REG_ADDRESS ); + ab_pci->register_window = window; + } +} + +static void ath11k_pci_write32 (struct ath11k_base *ab,u32 offset,u32 value) +{ +struct ath11k_pci *ab_pci =ath11k_pci_priv (ab); + +if (offset <WINDOW_START ) { +iowrite32 (value, ab->mem + offset); + }else { +spin_lock_bh (&ab_pci->window_lock); +ath11k_pci_select_window (ab_pci, offset); +iowrite32 (value, ab->mem +WINDOW_START + (offset &WINDOW_RANGE_MASK )); +spin_unlock_bh (&ab_pci->window_lock); + } +} + +static u32 ath11k_pci_read32 (struct ath11k_base *ab,u32 offset) +{ +struct ath11k_pci *ab_pci =ath11k_pci_priv (ab); +u32 val; + +if (offset <WINDOW_START ) { + val =ioread32 (ab->mem + offset); + }else { +spin_lock_bh (&ab_pci->window_lock); +ath11k_pci_select_window (ab_pci, offset); + val =ioread32 (ab->mem +WINDOW_START + (offset &WINDOW_RANGE_MASK )); +spin_unlock_bh (&ab_pci->window_lock); + } + +return val; +} +int ath11k_pci_get_msi_irq (struct device *dev,unsigned int vector) {struct pci_dev *pci_dev =to_pci_dev (dev);
@@ -578,6 +630,8 @@ static int ath11k_pci_start(struct ath11k_base *ab)static const struct ath11k_hif_ops ath11k_pci_hif_ops = { .start = ath11k_pci_start, .stop = ath11k_pci_stop, + .read32 = ath11k_pci_read32, + .write32 = ath11k_pci_write32, .power_down = ath11k_pci_power_down, .power_up = ath11k_pci_power_up, };
@@ -618,6 +672,7 @@ static int ath11k_pci_probe(struct pci_dev *pdev, ab_pci->pdev = pdev; ab->hif.ops = &ath11k_pci_hif_ops;pci_set_drvdata (pdev, ab); +spin_lock_init (&ab_pci->window_lock); ret =ath11k_pci_claim (ab_pci, pdev);if (ret) {
drivers/net/wireless/ath/ath11k/pci.h +4 -0
@@ -29,6 +29,10 @@ struct ath11k_pci {u32 msi_ep_base_data;struct mhi_controller *mhi_ctrl;unsigned long mhi_state; +u32 register_window; + +/* protects register_window above */ +spinlock_t window_lock; };static inline struct ath11k_pci *ath11k_pci_priv (struct ath11k_base *ab)
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 5/11 ath11k: configure copy engine msi address in CE srng
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
Fill msi base address and msi data to be programmed in CE srang. This is used by the srng to generate the msi interrupt.
Needed for PCI support.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/ce.c | 30 ++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/hal.h | 2 ++ drivers/net/wireless/ath/ath11k/hif.h | 26 ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/pci.c | 25 +++++++++++++++++++++++++ 4 files changed, 83 insertions(+)
drivers/net/wireless/ath/ath11k/ce.c +30 -0
@@ -5,6 +5,7 @@#include "dp_rx.h" #include "debug.h" +#include "hif.h" static const struct ce_attr host_ce_config_wlan[] = {/* CE0: host->target HTC control and raw streams */
@@ -352,6 +353,31 @@ static void ath11k_ce_send_done_cb(struct ath11k_ce_pipe *pipe) } } +static void ath11k_ce_srng_msi_ring_params_setup (struct ath11k_base *ab,u32 ce_id, +struct hal_srng_params *ring_params) +{ +u32 msi_data_start; +u32 msi_data_count; +u32 msi_irq_start; +u32 addr_lo; +u32 addr_hi; +int ret; + + ret =ath11k_get_user_msi_vector (ab,"CE" , + &msi_data_count, &msi_data_start, + &msi_irq_start); + +if (ret) +return ; + +ath11k_get_msi_address (ab, &addr_lo, &addr_hi); + + ring_params->msi_addr = addr_lo; + ring_params->msi_addr |= (dma_addr_t)(((uint64_t )addr_hi) <<32 ); + ring_params->msi_data = (ce_id % msi_data_count) + msi_data_start; + ring_params->flags |=HAL_SRNG_FLAGS_MSI_INTR ; +} +static int ath11k_ce_init_ring (struct ath11k_base *ab,struct ath11k_ce_ring *ce_ring,int ce_id,enum hal_ring_type type)
@@ -395,6 +421,10 @@ static int ath11k_ce_init_ring(struct ath11k_base *ab, ret, ce_id);return ret; } + +if (!(CE_ATTR_DIS_INTR & host_ce_config_wlan[ce_id].flags)) +ath11k_ce_srng_msi_ring_params_setup (ab, ce_id, ¶ms); + ce_ring->hal_ring_id = ret;return 0 ;
drivers/net/wireless/ath/ath11k/hal.h +2 -0
@@ -458,6 +458,8 @@ struct hal_srng_params {u32 flags;u32 max_buffer_len;u32 low_threshold; +dma_addr_t msi_addr; +u32 msi_data;/* Add more params as needed */ };
drivers/net/wireless/ath/ath11k/hif.h +26 -0
@@ -19,6 +19,11 @@ struct ath11k_hif_ops {void (*power_down)(struct ath11k_base *sc);int (*map_service_to_pipe)(struct ath11k_base *sc,u16 service_id,u8 *ul_pipe,u8 *dl_pipe); +int (*get_user_msi_vector)(struct ath11k_base *ab,char *user_name, +int *num_vectors,u32 *user_base_data, +u32 *base_vector); +void (*get_msi_address)(struct ath11k_base *ab,u32 *msi_addr_lo, +u32 *msi_addr_hi); };static inline int ath11k_hif_start (struct ath11k_base *sc)
@@ -66,4 +71,25 @@ static inline int ath11k_hif_map_service_to_pipe(struct ath11k_base *sc, u16 ser {return sc->hif.ops->map_service_to_pipe (sc, service_id, ul_pipe, dl_pipe); } + +static inline int ath11k_get_user_msi_vector (struct ath11k_base *ab,char *user_name, +int *num_vectors,u32 *user_base_data, +u32 *base_vector) +{ +if (!ab->hif.ops->get_user_msi_vector) +return -EOPNOTSUPP ; + +return ab->hif.ops->get_user_msi_vector (ab, user_name, num_vectors, + user_base_data, + base_vector); +} + +static inline void ath11k_get_msi_address (struct ath11k_base *ab,u32 *msi_addr_lo, +u32 *msi_addr_hi) +{ +if (!ab->hif.ops->get_msi_address) +return ; + + ab->hif.ops->get_msi_address (ab, msi_addr_lo, msi_addr_hi); +}#endif /* _HIF_H_ */
drivers/net/wireless/ath/ath11k/pci.c +25 -0
@@ -339,6 +339,18 @@ int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector)return pci_irq_vector (pci_dev, vector); } +static void ath11k_pci_get_msi_address (struct ath11k_base *ab,u32 *msi_addr_lo, +u32 *msi_addr_hi) +{ +struct pci_dev *pci_dev =to_pci_dev (ab->dev); + +pci_read_config_dword (pci_dev, pci_dev->msi_cap +PCI_MSI_ADDRESS_LO , + msi_addr_lo); + +pci_read_config_dword (pci_dev, pci_dev->msi_cap +PCI_MSI_ADDRESS_HI , + msi_addr_hi); +} +int ath11k_pci_get_user_msi_assignment (struct ath11k_pci *ab_pci,char *user_name,int *num_vectors,u32 *user_base_data,u32 *base_vector)
@@ -366,6 +378,17 @@ int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ab_pci, char *user_namreturn -EINVAL ; } +static int ath11k_get_user_msi_assignment (struct ath11k_base *ab,char *user_name, +int *num_vectors,u32 *user_base_data, +u32 *base_vector) +{ +struct ath11k_pci *ab_pci =ath11k_pci_priv (ab); + +return ath11k_pci_get_user_msi_assignment (ab_pci, user_name, + num_vectors, user_base_data, + base_vector); +} +static void ath11k_pci_free_irq (struct ath11k_base *ab) {int i, irq_idx;
@@ -634,6 +657,8 @@ static const struct ath11k_hif_ops ath11k_pci_hif_ops = { .write32 = ath11k_pci_write32, .power_down = ath11k_pci_power_down, .power_up = ath11k_pci_power_up, + .get_msi_address = ath11k_pci_get_msi_address, + .get_user_msi_vector = ath11k_get_user_msi_assignment, }; static int ath11k_pci_probe(struct pci_dev *pdev,
Signature · 1 line
2.7.4
PATCH 6/11 ath11k: setup ce tasklet for control path
In reply to Kalle ValoFrom: Govind Singh <[email protected]>
CE srng is used for control path and CE srng processing is done using tasklet bottom half. Setup ce tasklet initialization and scheduling for control path.
Needed for PCI support.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/ce.c | 2 + drivers/net/wireless/ath/ath11k/ce.h | 2 + drivers/net/wireless/ath/ath11k/pci.c | 116 +++++++++++++++++++++++++++++++--- 3 files changed, 112 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath11k/ce.c +2 -0
@@ -524,6 +524,7 @@ void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id)if ((pipe->attr_flags &CE_ATTR_DIS_INTR ) && pipe->send_cb) pipe->send_cb (pipe); } +EXPORT_SYMBOL (ath11k_ce_per_engine_service);int ath11k_ce_send (struct ath11k_base *ab,struct sk_buff *skb,u8 pipe_id,u16 transfer_id)
@@ -673,6 +674,7 @@ void ath11k_ce_rx_post_buf(struct ath11k_base *ab) } } } +EXPORT_SYMBOL (ath11k_ce_rx_post_buf);void ath11k_ce_rx_replenish_retry (struct timer_list *t) {
drivers/net/wireless/ath/ath11k/ce.h +2 -0
@@ -181,4 +181,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_base *ab);void ath11k_ce_free_pipes (struct ath11k_base *ab);int ath11k_ce_get_attr_flags (int ce_id);void ath11k_ce_poll_send_completed (struct ath11k_base *ab,u8 pipe_id); +int ath11k_ce_map_service_to_pipe (struct ath11k_base *ab,u16 service_id, +u8 *ul_pipe,u8 *dl_pipe);#endif
drivers/net/wireless/ath/ath11k/pci.c +108 -8
165 lines not on this page · raw message
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 7/11 ath11k: allocate smaller chunks of memory for firmware
In reply to Kalle ValoFrom: Carl Huang <[email protected]>
On x86 it's sometimes difficult to allocate a large contigous DMA memory, so instead allocate blocks of small chunk memory.
In ath11k_qmi_msg_mem_request_cb() the error handling was cleaned up to avoid an unused variable warning. Also changed the test from (ret < 0) to just (ret) as the functions don't return any positive values.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/qmi.c | 42 +++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/qmi.c +30 -12
@@ -1640,19 +1640,30 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab)memset (&resp,0 ,sizeof (resp)); - req->mem_seg_len = ab->qmi.mem_seg_count; +/* For QCA6390 by default FW requests a block of ~4M contiguous +* DMA memory, it's hard to allocate from OS. So host returns +* failure to FW and FW will then request mulitple blocks of small +* chunk size memory. +*/ +if (!ab->bus_params.fixed_mem_region && ab->qmi.mem_seg_count <=2 ) { +ath11k_dbg (ab,ATH11K_DBG_QMI ,"qmi delays mem_request %d\n" , + ab->qmi.mem_seg_count); +memset (req,0 ,sizeof (*req)); + }else { + req->mem_seg_len = ab->qmi.mem_seg_count; + +for (i =0 ; i < req->mem_seg_len ; i++) { + req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; + req->mem_seg[i].size = ab->qmi.target_mem[i].size; + req->mem_seg[i].type = ab->qmi.target_mem[i].type; + } + } ret =qmi_txn_init (&ab->qmi.handle, &txn, qmi_wlanfw_respond_mem_resp_msg_v01_ei, &resp);if (ret <0 ) goto out; -for (i =0 ; i < req->mem_seg_len ; i++) { - req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; - req->mem_seg[i].size = ab->qmi.target_mem[i].size; - req->mem_seg[i].type = ab->qmi.target_mem[i].type; - } - ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, QMI_WLANFW_RESPOND_MEM_REQ_V01, QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN,
@@ -2411,13 +2422,20 @@ static void ath11k_qmi_msg_mem_request_cb(struct qmi_handle *qmi_hdl, msg->mem_seg[i].type, msg->mem_seg[i].size); } -if (ab->bus_params.fixed_mem_region) +if (ab->bus_params.fixed_mem_region) { ret =ath11k_qmi_assign_target_mem_chunk (ab); -else +if (ret) { +ath11k_warn (ab,"qmi failed to assign target memory: %d\n" , + ret); +return ; + } + }else if (msg->mem_seg_len >2 ) { ret =ath11k_qmi_alloc_target_mem_chunk (ab); -if (ret <0 ) { -ath11k_warn (ab,"qmi failed to alloc target memory:%d\n" , ret); -return ; +if (ret) { +ath11k_warn (ab,"qmi failed to alloc target memory: %d\n" , + ret); +return ; + } }ath11k_qmi_driver_event_post (qmi,ATH11K_QMI_EVENT_REQUEST_MEM ,NULL );
Signature · 1 line
2.7.4
PATCH 8/11 ath11k: fix memory OOB access in qmi_decode
In reply to Kalle ValoFrom: Carl Huang <[email protected]>
The decoded_size is wrongly assigned in ath11k_qmi_msg_handlers and it results in out of boundary access in qmi_decode. The correct decoded_size should be calculated from the related ind_msg structure.
This issue is exposed with QCA6390 because it needs 11 small memory chunks which are stored in qmi_wlanfw_request_mem_ind_msg_v01 and hence the decoded_size exceeds the wrongly assigend decoded_size.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/qmi.c | 8 ++++---- drivers/net/wireless/ath/ath11k/qmi.h | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/qmi.c +4 -4
@@ -2477,21 +2477,21 @@ static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { .type = QMI_INDICATION, .msg_id = QMI_WLFW_REQUEST_MEM_IND_V01, .ei = qmi_wlanfw_request_mem_ind_msg_v01_ei, - .decoded_size = sizeof(qmi_wlanfw_request_mem_ind_msg_v01_ei), + .decoded_size = sizeof(struct qmi_wlanfw_request_mem_ind_msg_v01), .fn = ath11k_qmi_msg_mem_request_cb, }, { .type = QMI_INDICATION, .msg_id = QMI_WLFW_FW_MEM_READY_IND_V01, .ei = qmi_wlanfw_mem_ready_ind_msg_v01_ei, - .decoded_size = sizeof(qmi_wlanfw_mem_ready_ind_msg_v01_ei), + .decoded_size = sizeof(struct qmi_wlanfw_fw_mem_ready_ind_msg_v01), .fn = ath11k_qmi_msg_mem_ready_cb, }, { .type = QMI_INDICATION, .msg_id = QMI_WLFW_FW_READY_IND_V01, .ei = qmi_wlanfw_fw_ready_ind_msg_v01_ei, - .decoded_size = sizeof(qmi_wlanfw_fw_ready_ind_msg_v01_ei), + .decoded_size = sizeof(struct qmi_wlanfw_fw_ready_ind_msg_v01), .fn = ath11k_qmi_msg_fw_ready_cb, }, {
@@ -2499,7 +2499,7 @@ static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = { .msg_id = QMI_WLFW_COLD_BOOT_CAL_DONE_IND_V01, .ei = qmi_wlanfw_cold_boot_cal_done_ind_msg_v01_ei, .decoded_size = - sizeof(qmi_wlanfw_cold_boot_cal_done_ind_msg_v01_ei), + sizeof(struct qmi_wlanfw_fw_cold_cal_done_ind_msg_v01), .fn = ath11k_qmi_msg_cold_boot_cal_done_cb, }, };
drivers/net/wireless/ath/ath11k/qmi.h +8 -0
@@ -267,6 +267,14 @@ struct qmi_wlanfw_fw_mem_ready_ind_msg_v01 {char placeholder; }; +struct qmi_wlanfw_fw_ready_ind_msg_v01 { +char placeholder; +}; + +struct qmi_wlanfw_fw_cold_cal_done_ind_msg_v01 { +char placeholder; +}; +#define QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN 0#define QMI_WLANFW_CAP_RESP_MSG_V01_MAX_LEN 207#define QMI_WLANFW_CAP_REQ_V01 0x0024
Signature · 1 line
2.7.4
PATCH 9/11 ath11k: fix KASAN warning of ath11k_qmi_wlanfw_wlan_cfg_send
In reply to Kalle ValoFrom: Carl Huang <[email protected]>
It's caused by reading memory out of boundary from target_ce_config_wlan.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
@@ -2233,7 +2233,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) req->tgt_cfg_valid =1 ;/* This is number of CE configs */ req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len; -for (pipe_num =0 ; pipe_num <= req->tgt_cfg_len ; pipe_num++) { +for (pipe_num =0 ; pipe_num < req->tgt_cfg_len ; pipe_num++) { req->tgt_cfg[pipe_num].pipe_num = ce_cfg[pipe_num].pipenum; req->tgt_cfg[pipe_num].pipe_dir = ce_cfg[pipe_num].pipedir; req->tgt_cfg[pipe_num].nentries = ce_cfg[pipe_num].nentries;
Signature · 1 line
2.7.4
PATCH 10/11 ath11k: enable internal sleep clock
In reply to Kalle ValoFrom: Carl Huang <[email protected]>
On x86 and other non-qcom platforms, host needs to explicitly tell the firmware to use the internal sleep clock. Some QCA6390 modules have OTP burnt with external sleep clock selected, and these modules can't work expectedly unless firmware selects internal sleep clock.
Add a field to hw_params to support this difference.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/core.c | 2 ++ drivers/net/wireless/ath/ath11k/hw.h | 2 ++ drivers/net/wireless/ath/ath11k/qmi.c | 17 +++++++++++++++++ 3 files changed, 21 insertions(+)
drivers/net/wireless/ath/ath11k/core.c +2 -0
@@ -31,6 +31,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .bdf_addr = 0x4B0C0000, .hw_ops = &ipq8074_ops, .ring_mask = &ath11k_hw_ring_mask_ipq8074, + .internal_sleep_clock = false, }, { .name = "qca6390 hw2.0",
@@ -44,6 +45,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .bdf_addr = 0x4B0C0000, .hw_ops = &qca6390_ops, .ring_mask = &ath11k_hw_ring_mask_ipq8074, + .internal_sleep_clock = true, }, };
drivers/net/wireless/ath/ath11k/hw.h +2 -0
@@ -133,6 +133,8 @@ struct ath11k_hw_params {const struct ath11k_hw_ops *hw_ops;const struct ath11k_hw_ring_mask *ring_mask; + +bool internal_sleep_clock; };extern const struct ath11k_hw_ops ipq8074_ops;
drivers/net/wireless/ath/ath11k/qmi.c +17 -0
@@ -9,6 +9,9 @@#include <linux/of.h> #include <linux/firmware.h> +#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 +#define HOST_CSTATE_BIT 0x04 +static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = { { .data_type =QMI_OPT_FLAG ,
@@ -1531,6 +1534,20 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) req.cal_done_valid =1 ; req.cal_done = ab->qmi.cal_done; +if (ab->hw_params.internal_sleep_clock) { + req.nm_modem_valid =1 ; + +/* Notify firmware that this is non-qualcomm platform. */ + req.nm_modem |=HOST_CSTATE_BIT ; + +/* Notify firmware about the sleep clock selection, +* nm_modem_bit[1] is used for this purpose. Host driver on +* non-qualcomm platforms should select internal sleep +* clock. +*/ + req.nm_modem |=SLEEP_CLOCK_SELECT_INTERNAL_BIT ; + } + ret =qmi_txn_init (&ab->qmi.handle, &txn, qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp);if (ret <0 )
Signature · 1 line
2.7.4
PATCH 11/11 ath11k: hal: create hw_srng_config dynamically
In reply to Kalle ValoOn QCA6390 reg_start and reg_size values are different from IPQ8074 so we need to change the values runtime. As we can't modify a static const variable hw_srng_config directly, instead use it as a template, copy it and modify the copy with correct values.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
--- drivers/net/wireless/ath/ath11k/dbring.c | 2 +- drivers/net/wireless/ath/ath11k/dp.c | 8 +-- drivers/net/wireless/ath/ath11k/dp_rx.c | 4 +- drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- drivers/net/wireless/ath/ath11k/hal.c | 119 +++++++++++++++++-------------- drivers/net/wireless/ath/ath11k/hal.h | 6 +- drivers/net/wireless/ath/ath11k/hal_rx.c | 2 +- drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +- 8 files changed, 79 insertions(+), 66 deletions(-)
drivers/net/wireless/ath/ath11k/dbring.c +1 -1
@@ -168,7 +168,7 @@ int ath11k_dbring_buf_setup(struct ath11k *ar, srng = &ab->hal.srng_list[ring->refill_srng.ring_id]; ring->bufs_max = ring->refill_srng.size / -ath11k_hal_srng_get_entrysize (HAL_RXDMA_DIR_BUF ); +ath11k_hal_srng_get_entrysize (ab,HAL_RXDMA_DIR_BUF ); ring->buf_sz = db_cap->min_buf_sz; ring->buf_align = db_cap->min_buf_align;
drivers/net/wireless/ath/ath11k/dp.c +4 -4
@@ -112,8 +112,8 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring, int mac_id, int num_entries) {struct hal_srng_params params = {0 }; -int entry_sz =ath11k_hal_srng_get_entrysize (type); -int max_entries =ath11k_hal_srng_get_max_entries (type); +int entry_sz =ath11k_hal_srng_get_entrysize (ab, type); +int max_entries =ath11k_hal_srng_get_max_entries (ab, type);int ret;if (max_entries <0 || entry_sz <0 )
@@ -368,7 +368,7 @@ static int ath11k_dp_scatter_idle_link_desc_setup(struct ath11k_base *ab,u32 end_offset; n_entries_per_buf =HAL_WBM_IDLE_SCATTER_BUF_SIZE / -ath11k_hal_srng_get_entrysize (HAL_WBM_IDLE_LINK ); +ath11k_hal_srng_get_entrysize (ab,HAL_WBM_IDLE_LINK ); num_scatter_buf =DIV_ROUND_UP (size,HAL_WBM_IDLE_SCATTER_BUF_SIZE );if (num_scatter_buf >DP_IDLE_SCATTER_BUFS_MAX )
@@ -566,7 +566,7 @@ int ath11k_dp_link_desc_setup(struct ath11k_base *ab,return ret;/* Setup link desc idle list for HW internal usage */ - entry_sz =ath11k_hal_srng_get_entrysize (ring_type); + entry_sz =ath11k_hal_srng_get_entrysize (ab, ring_type); tot_mem_sz = entry_sz * n_link_desc;/* Setup scatter desc list when the total memory requirement is more */
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -2
@@ -416,7 +416,7 @@ static int ath11k_dp_rxdma_ring_buf_setup(struct ath11k *ar,int num_entries; num_entries = rx_ring->refill_buf_ring.size / -ath11k_hal_srng_get_entrysize (ringtype); +ath11k_hal_srng_get_entrysize (ar->ab, ringtype); rx_ring->bufs_max = num_entries; ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries,
@@ -4834,7 +4834,7 @@ int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar) dp_srng = &dp->rxdma_mon_desc_ring; n_link_desc = dp_srng->size / -ath11k_hal_srng_get_entrysize (HAL_RXDMA_MONITOR_DESC ); +ath11k_hal_srng_get_entrysize (ar->ab,HAL_RXDMA_MONITOR_DESC ); mon_desc_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_desc_ring.ring_id];
drivers/net/wireless/ath/ath11k/dp_tx.c +1 -1
@@ -720,7 +720,7 @@ int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id, cmd->ring_base_addr_hi = (u64 )params.ring_base_paddr >>HAL_ADDR_MSB_REG_SHIFT ; - ret =ath11k_hal_srng_get_entrysize (ring_type); + ret =ath11k_hal_srng_get_entrysize (ab, ring_type);if (ret <0 ) goto err_free;
drivers/net/wireless/ath/ath11k/hal.c +66 -53
231 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/hal.h +3 -3
@@ -841,7 +841,7 @@ struct ath11k_hal {struct hal_srng srng_list[HAL_SRNG_RING_ID_MAX ];/* SRNG configuration table */ -const struct hal_srng_config *srng_config; +struct hal_srng_config *srng_config;/* Remote pointer memory for HW/FW updates */ struct {
@@ -887,8 +887,8 @@ void ath11k_hal_ce_src_set_desc(void *buf, dma_addr_t paddr, u32 len, u32 id, u8 byte_swap_data);void ath11k_hal_ce_dst_set_desc (void *buf,dma_addr_t paddr);u32 ath11k_hal_ce_dst_status_get_length (void *buf); -int ath11k_hal_srng_get_entrysize (u32 ring_type); -int ath11k_hal_srng_get_max_entries (u32 ring_type); +int ath11k_hal_srng_get_entrysize (struct ath11k_base *ab,u32 ring_type); +int ath11k_hal_srng_get_max_entries (struct ath11k_base *ab,u32 ring_type);void ath11k_hal_srng_get_params (struct ath11k_base *ab,struct hal_srng *srng,struct hal_srng_params *params); u32 *ath11k_hal_srng_dst_get_next_entry(struct ath11k_base *ab,
drivers/net/wireless/ath/ath11k/hal_rx.c +1 -1
@@ -786,7 +786,7 @@ void ath11k_hal_reo_init_cmd_ring(struct ath11k_base *ab,memset (¶ms,0 ,sizeof (params)); - entry_size =ath11k_hal_srng_get_entrysize (HAL_REO_CMD ); + entry_size =ath11k_hal_srng_get_entrysize (ab,HAL_REO_CMD );ath11k_hal_srng_get_params (ab, srng, ¶ms); entry = (u8 *)params.ring_base_vaddr;
drivers/net/wireless/ath/ath11k/hal_tx.c +1 -1
@@ -141,7 +141,7 @@ void ath11k_hal_tx_init_data_ring(struct ath11k_base *ab, struct hal_srng *srng)memset (¶ms,0 ,sizeof (params)); - entry_size =ath11k_hal_srng_get_entrysize (HAL_TCL_DATA ); + entry_size =ath11k_hal_srng_get_entrysize (ab,HAL_TCL_DATA );ath11k_hal_srng_get_params (ab, srng, ¶ms); desc = (u8 *)params.ring_base_vaddr;
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k