0023-wifi-ath11k-initialize-hw_ops-for-IPQ5018.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. From ba60f2793d3a37a00da14bb56a26558a902d2831 Mon Sep 17 00:00:00 2001
  2. From: Sriram R <quic_srirrama@quicinc.com>
  3. Date: Fri, 2 Dec 2022 23:37:14 +0200
  4. Subject: [PATCH] wifi: ath11k: initialize hw_ops for IPQ5018
  5. The ipq5018_ops is initialized for IPQ5018. This is different from
  6. other platforms.
  7. Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
  8. Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
  9. Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  10. Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  11. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  12. Link: https://lore.kernel.org/r/20221122132152.17771-7-quic_kathirve@quicinc.com
  13. ---
  14. drivers/net/wireless/ath/ath11k/core.c | 1 +
  15. drivers/net/wireless/ath/ath11k/hw.c | 40 ++++++++++++++++++++++++++
  16. drivers/net/wireless/ath/ath11k/hw.h | 1 +
  17. 3 files changed, 42 insertions(+)
  18. --- a/drivers/net/wireless/ath/ath11k/core.c
  19. +++ b/drivers/net/wireless/ath/ath11k/core.c
  20. @@ -635,6 +635,7 @@ static const struct ath11k_hw_params ath
  21. },
  22. .internal_sleep_clock = false,
  23. .regs = &ipq5018_regs,
  24. + .hw_ops = &ipq5018_ops,
  25. .host_ce_config = ath11k_host_ce_config_qcn9074,
  26. .ce_count = CE_CNT_5018,
  27. .target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
  28. --- a/drivers/net/wireless/ath/ath11k/hw.c
  29. +++ b/drivers/net/wireless/ath/ath11k/hw.c
  30. @@ -1084,6 +1084,46 @@ const struct ath11k_hw_ops wcn6750_ops =
  31. .get_ring_selector = ath11k_hw_wcn6750_get_tcl_ring_selector,
  32. };
  33. +/* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */
  34. +const struct ath11k_hw_ops ipq5018_ops = {
  35. + .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id,
  36. + .wmi_init_config = ath11k_init_wmi_config_ipq8074,
  37. + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074,
  38. + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074,
  39. + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable,
  40. + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu,
  41. + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu,
  42. + .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes,
  43. + .rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status,
  44. + .rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid,
  45. + .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type,
  46. + .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type,
  47. + .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl,
  48. + .rx_desc_get_ldpc_support = ath11k_hw_qcn9074_rx_desc_get_ldpc_support,
  49. + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld,
  50. + .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid,
  51. + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no,
  52. + .rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len,
  53. + .rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi,
  54. + .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs,
  55. + .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw,
  56. + .rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq,
  57. + .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type,
  58. + .rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss,
  59. + .rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid,
  60. + .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id,
  61. + .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end,
  62. + .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag,
  63. + .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id,
  64. + .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len,
  65. + .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
  66. + .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
  67. + .mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
  68. + .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
  69. + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
  70. +
  71. +};
  72. +
  73. #define ATH11K_TX_RING_MASK_0 BIT(0)
  74. #define ATH11K_TX_RING_MASK_1 BIT(1)
  75. #define ATH11K_TX_RING_MASK_2 BIT(2)
  76. --- a/drivers/net/wireless/ath/ath11k/hw.h
  77. +++ b/drivers/net/wireless/ath/ath11k/hw.h
  78. @@ -275,6 +275,7 @@ extern const struct ath11k_hw_ops qca639
  79. extern const struct ath11k_hw_ops qcn9074_ops;
  80. extern const struct ath11k_hw_ops wcn6855_ops;
  81. extern const struct ath11k_hw_ops wcn6750_ops;
  82. +extern const struct ath11k_hw_ops ipq5018_ops;
  83. extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
  84. extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;