dp_ipa.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2017, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _DP_IPA_H_
  14. #define _DP_IPA_H_
  15. #ifdef IPA_OFFLOAD
  16. #define IPA_TCL_DATA_RING_IDX 2
  17. #define IPA_TX_COMP_RING_IDX 2
  18. #define IPA_REO_DEST_RING_IDX 3
  19. /**
  20. * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware
  21. * @eth: ether II header
  22. */
  23. struct dp_ipa_uc_tx_hdr {
  24. struct ethhdr eth;
  25. } __packed;
  26. /**
  27. * struct dp_ipa_uc_rx_hdr - full rx header registered to IPA hardware
  28. * @eth: ether II header
  29. */
  30. struct dp_ipa_uc_rx_hdr {
  31. struct ethhdr eth;
  32. } __packed;
  33. #define DP_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct dp_ipa_uc_tx_hdr)
  34. #define DP_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct dp_ipa_uc_rx_hdr)
  35. #define DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 0
  36. QDF_STATUS dp_ipa_get_resource(struct cdp_pdev *pdev);
  37. QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_pdev *pdev);
  38. QDF_STATUS dp_ipa_uc_set_active(struct cdp_pdev *pdev, bool uc_active,
  39. bool is_tx);
  40. QDF_STATUS dp_ipa_op_response(struct cdp_pdev *pdev, uint8_t *op_msg);
  41. QDF_STATUS dp_ipa_register_op_cb(struct cdp_pdev *pdev, ipa_uc_op_cb_type op_cb,
  42. void *usr_ctxt);
  43. QDF_STATUS dp_ipa_get_stat(struct cdp_pdev *pdev);
  44. qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_vdev *vdev, qdf_nbuf_t skb);
  45. QDF_STATUS dp_ipa_enable_autonomy(struct cdp_pdev *pdev);
  46. QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *pdev);
  47. QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
  48. void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
  49. uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
  50. uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
  51. QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle,
  52. uint32_t rx_pipe_handle);
  53. QDF_STATUS dp_ipa_remove_header(char *name);
  54. int dp_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
  55. uint8_t session_id, bool is_ipv6_enabled);
  56. int dp_ipa_register_interface(char *ifname, bool is_ipv6_enabled);
  57. QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
  58. enum ipa_client_type prod_client,
  59. enum ipa_client_type cons_client,
  60. uint8_t session_id, bool is_ipv6_enabled);
  61. QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
  62. QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *pdev);
  63. QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *pdev);
  64. QDF_STATUS dp_ipa_set_perf_level(int client,
  65. uint32_t max_supported_bw_mbps);
  66. #endif
  67. #endif /* _DP_IPA_H_ */