smd.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Copyright (c) 2013 Eugene Krasnikov <[email protected]>
  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 ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _SMD_H_
  17. #define _SMD_H_
  18. #include "wcn36xx.h"
  19. /* Max shared size is 4k but we take less.*/
  20. #define WCN36XX_NV_FRAGMENT_SIZE 3072
  21. #define WCN36XX_HAL_BUF_SIZE 4096
  22. #define HAL_MSG_TIMEOUT 10000
  23. #define WCN36XX_SMSM_WLAN_TX_ENABLE 0x00000400
  24. #define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY 0x00000200
  25. /* The PNO version info be contained in the rsp msg */
  26. #define WCN36XX_FW_MSG_PNO_VERSION_MASK 0x8000
  27. enum wcn36xx_fw_msg_result {
  28. WCN36XX_FW_MSG_RESULT_SUCCESS = 0,
  29. WCN36XX_FW_MSG_RESULT_SUCCESS_SYNC = 1,
  30. WCN36XX_FW_MSG_RESULT_MEM_FAIL = 5,
  31. };
  32. /******************************/
  33. /* SMD requests and responses */
  34. /******************************/
  35. struct wcn36xx_fw_msg_status_rsp {
  36. u32 status;
  37. } __packed;
  38. struct wcn36xx_hal_ind_msg {
  39. struct list_head list;
  40. size_t msg_len;
  41. u8 msg[];
  42. };
  43. struct wcn36xx;
  44. struct rpmsg_device;
  45. int wcn36xx_smd_open(struct wcn36xx *wcn);
  46. void wcn36xx_smd_close(struct wcn36xx *wcn);
  47. int wcn36xx_smd_load_nv(struct wcn36xx *wcn);
  48. int wcn36xx_smd_start(struct wcn36xx *wcn);
  49. int wcn36xx_smd_stop(struct wcn36xx *wcn);
  50. int wcn36xx_smd_start_scan(struct wcn36xx *wcn, u8 scan_channel);
  51. int wcn36xx_smd_end_scan(struct wcn36xx *wcn, u8 scan_channel);
  52. int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode,
  53. struct ieee80211_vif *vif);
  54. int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode,
  55. struct ieee80211_vif *vif);
  56. int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, u8 *channels, size_t channel_count);
  57. int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  58. struct cfg80211_scan_request *req);
  59. int wcn36xx_smd_stop_hw_scan(struct wcn36xx *wcn);
  60. int wcn36xx_smd_update_channel_list(struct wcn36xx *wcn, struct cfg80211_scan_request *req);
  61. int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif);
  62. int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr);
  63. int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index);
  64. int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch);
  65. int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid,
  66. const u8 *sta_mac,
  67. enum wcn36xx_hal_link_state state);
  68. int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  69. struct ieee80211_sta *sta, const u8 *bssid,
  70. bool update);
  71. int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif);
  72. int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  73. struct ieee80211_sta *sta);
  74. int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  75. struct sk_buff *skb_beacon, u16 tim_off,
  76. u16 p2p_off);
  77. int wcn36xx_smd_switch_channel(struct wcn36xx *wcn,
  78. struct ieee80211_vif *vif, int ch);
  79. int wcn36xx_smd_process_ptt_msg(struct wcn36xx *wcn,
  80. struct ieee80211_vif *vif,
  81. void *ptt_msg, size_t len,
  82. void **ptt_rsp_msg);
  83. int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
  84. struct ieee80211_vif *vif,
  85. struct sk_buff *skb);
  86. int wcn36xx_smd_set_stakey(struct wcn36xx *wcn,
  87. enum ani_ed_type enc_type,
  88. u8 keyidx,
  89. u8 keylen,
  90. u8 *key,
  91. u8 sta_index);
  92. int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
  93. enum ani_ed_type enc_type,
  94. u8 bssidx,
  95. u8 keyidx,
  96. u8 keylen,
  97. u8 *key);
  98. int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn,
  99. enum ani_ed_type enc_type,
  100. u8 keyidx,
  101. u8 sta_index);
  102. int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
  103. enum ani_ed_type enc_type,
  104. u8 bssidx,
  105. u8 keyidx);
  106. int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
  107. int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
  108. int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim);
  109. int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
  110. struct ieee80211_vif *vif,
  111. int packet_type);
  112. int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2,
  113. u32 arg3, u32 arg4, u32 arg5);
  114. int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn);
  115. int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn,
  116. struct ieee80211_sta *sta,
  117. u16 tid,
  118. u16 *ssn,
  119. u8 direction,
  120. u8 sta_index);
  121. int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id);
  122. int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 direction, u8 sta_index);
  123. int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u16 *ssn);
  124. int wcn36xx_smd_get_stats(struct wcn36xx *wcn, u8 sta_index, u32 stats_mask,
  125. struct station_info *sinfo);
  126. int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value);
  127. int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev,
  128. void *buf, int len, void *priv, u32 addr);
  129. int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn,
  130. struct ieee80211_vif *vif,
  131. struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp);
  132. int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  133. bool enable);
  134. int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  135. bool enable);
  136. int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  137. bool enable);
  138. int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn,
  139. struct ieee80211_vif *vif);
  140. int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn);
  141. int wcn36xx_smd_host_resume(struct wcn36xx *wcn);
  142. int wcn36xx_smd_enter_imps(struct wcn36xx *wcn);
  143. int wcn36xx_smd_exit_imps(struct wcn36xx *wcn);
  144. int wcn36xx_smd_add_beacon_filter(struct wcn36xx *wcn,
  145. struct ieee80211_vif *vif);
  146. #endif /* _SMD_H_ */