dp_ipa.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) 2017-2018, 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. #define IPA_RX_REFILL_BUF_RING_IDX 2
  23. /**
  24. * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware
  25. * @eth: ether II header
  26. */
  27. struct dp_ipa_uc_tx_hdr {
  28. struct ethhdr eth;
  29. } __packed;
  30. /**
  31. * struct dp_ipa_uc_rx_hdr - full rx header registered to IPA hardware
  32. * @eth: ether II header
  33. */
  34. struct dp_ipa_uc_rx_hdr {
  35. struct ethhdr eth;
  36. } __packed;
  37. #define DP_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct dp_ipa_uc_tx_hdr)
  38. #define DP_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct dp_ipa_uc_rx_hdr)
  39. #define DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 0
  40. QDF_STATUS dp_ipa_get_resource(struct cdp_pdev *pdev);
  41. QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_pdev *pdev);
  42. QDF_STATUS dp_ipa_uc_set_active(struct cdp_pdev *pdev, bool uc_active,
  43. bool is_tx);
  44. QDF_STATUS dp_ipa_op_response(struct cdp_pdev *pdev, uint8_t *op_msg);
  45. QDF_STATUS dp_ipa_register_op_cb(struct cdp_pdev *pdev, ipa_uc_op_cb_type op_cb,
  46. void *usr_ctxt);
  47. QDF_STATUS dp_ipa_get_stat(struct cdp_pdev *pdev);
  48. qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_vdev *vdev, qdf_nbuf_t skb);
  49. QDF_STATUS dp_ipa_enable_autonomy(struct cdp_pdev *pdev);
  50. QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *pdev);
  51. QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
  52. void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
  53. uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
  54. uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
  55. QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle,
  56. uint32_t rx_pipe_handle);
  57. QDF_STATUS dp_ipa_remove_header(char *name);
  58. int dp_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
  59. uint8_t session_id, bool is_ipv6_enabled);
  60. int dp_ipa_register_interface(char *ifname, bool is_ipv6_enabled);
  61. QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
  62. qdf_ipa_client_type_t prod_client,
  63. qdf_ipa_client_type_t cons_client,
  64. uint8_t session_id, bool is_ipv6_enabled);
  65. QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
  66. QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *pdev);
  67. QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *pdev);
  68. QDF_STATUS dp_ipa_set_perf_level(int client,
  69. uint32_t max_supported_bw_mbps);
  70. int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev);
  71. int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev);
  72. int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  73. struct dp_pdev *pdev);
  74. #else
  75. static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
  76. {
  77. return QDF_STATUS_SUCCESS;
  78. }
  79. static inline int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
  80. {
  81. return QDF_STATUS_SUCCESS;
  82. }
  83. static inline int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  84. struct dp_pdev *pdev)
  85. {
  86. return 0;
  87. }
  88. #endif
  89. #endif /* _DP_IPA_H_ */