dp_ipa.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2017, The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _DP_IPA_H_
  17. #define _DP_IPA_H_
  18. #ifdef IPA_OFFLOAD
  19. #define IPA_TCL_DATA_RING_IDX 2
  20. #define IPA_TX_COMP_RING_IDX 2
  21. #define IPA_REO_DEST_RING_IDX 3
  22. /**
  23. * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware
  24. * @eth: ether II header
  25. */
  26. struct dp_ipa_uc_tx_hdr {
  27. struct ethhdr eth;
  28. } __packed;
  29. /**
  30. * struct dp_ipa_uc_rx_hdr - full rx header registered to IPA hardware
  31. * @eth: ether II header
  32. */
  33. struct dp_ipa_uc_rx_hdr {
  34. struct ethhdr eth;
  35. } __packed;
  36. #define DP_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct dp_ipa_uc_tx_hdr)
  37. #define DP_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct dp_ipa_uc_rx_hdr)
  38. #define DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 0
  39. QDF_STATUS dp_ipa_get_resource(struct cdp_pdev *pdev);
  40. QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_pdev *pdev);
  41. QDF_STATUS dp_ipa_uc_set_active(struct cdp_pdev *pdev, bool uc_active,
  42. bool is_tx);
  43. QDF_STATUS dp_ipa_op_response(struct cdp_pdev *pdev, uint8_t *op_msg);
  44. QDF_STATUS dp_ipa_register_op_cb(struct cdp_pdev *pdev, ipa_uc_op_cb_type op_cb,
  45. void *usr_ctxt);
  46. QDF_STATUS dp_ipa_get_stat(struct cdp_pdev *pdev);
  47. qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_vdev *vdev, qdf_nbuf_t skb);
  48. QDF_STATUS dp_ipa_enable_autonomy(struct cdp_pdev *pdev);
  49. QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *pdev);
  50. QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
  51. void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
  52. uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
  53. uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
  54. QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle,
  55. uint32_t rx_pipe_handle);
  56. QDF_STATUS dp_ipa_remove_header(char *name);
  57. int dp_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
  58. uint8_t session_id, bool is_ipv6_enabled);
  59. int dp_ipa_register_interface(char *ifname, bool is_ipv6_enabled);
  60. QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
  61. qdf_ipa_client_type_t prod_client,
  62. qdf_ipa_client_type_t cons_client,
  63. uint8_t session_id, bool is_ipv6_enabled);
  64. QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
  65. QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *pdev);
  66. QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *pdev);
  67. QDF_STATUS dp_ipa_set_perf_level(int client,
  68. uint32_t max_supported_bw_mbps);
  69. int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev);
  70. int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev);
  71. int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  72. struct dp_pdev *pdev);
  73. #else
  74. static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
  75. {
  76. return QDF_STATUS_SUCCESS;
  77. }
  78. static inline int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
  79. {
  80. return QDF_STATUS_SUCCESS;
  81. }
  82. static inline int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  83. struct dp_pdev *pdev)
  84. {
  85. return 0;
  86. }
  87. #endif
  88. #endif /* _DP_IPA_H_ */