dp_ipa.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. enum ipa_client_type prod_client,
  62. enum ipa_client_type 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. #endif
  70. #endif /* _DP_IPA_H_ */