wmi_api.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. //------------------------------------------------------------------------------
  2. // <copyright file="wmi_api.h" company="Atheros">
  3. // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved.
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License version 2 as
  7. // published by the Free Software Foundation;
  8. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // This file contains the definitions for the Wireless Module Interface (WMI).
  18. //
  19. // Author(s): ="Atheros"
  20. //==============================================================================
  21. #ifndef _WMI_API_H_
  22. #define _WMI_API_H_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /*
  27. * IP QoS Field definitions according to 802.1p
  28. */
  29. #define BEST_EFFORT_PRI 0
  30. #define BACKGROUND_PRI 1
  31. #define EXCELLENT_EFFORT_PRI 3
  32. #define CONTROLLED_LOAD_PRI 4
  33. #define VIDEO_PRI 5
  34. #define VOICE_PRI 6
  35. #define NETWORK_CONTROL_PRI 7
  36. #define MAX_NUM_PRI 8
  37. #define UNDEFINED_PRI (0xff)
  38. #define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000 /* 5 seconds */
  39. #define A_ROUND_UP(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
  40. typedef enum {
  41. ATHEROS_COMPLIANCE = 0x1,
  42. }TSPEC_PARAM_COMPLIANCE;
  43. struct wmi_t;
  44. void *wmi_init(void *devt);
  45. void wmi_qos_state_init(struct wmi_t *wmip);
  46. void wmi_shutdown(struct wmi_t *wmip);
  47. HTC_ENDPOINT_ID wmi_get_control_ep(struct wmi_t * wmip);
  48. void wmi_set_control_ep(struct wmi_t * wmip, HTC_ENDPOINT_ID eid);
  49. A_UINT16 wmi_get_mapped_qos_queue(struct wmi_t *, A_UINT8);
  50. A_STATUS wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf);
  51. A_STATUS wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType, A_BOOL bMoreData);
  52. A_STATUS wmi_dot3_2_dix(struct wmi_t *wmip, void *osbuf);
  53. A_STATUS wmi_dot11_hdr_remove (struct wmi_t *wmip, void *osbuf);
  54. A_STATUS wmi_dot11_hdr_add(struct wmi_t *wmip, void *osbuf, NETWORK_TYPE mode);
  55. A_STATUS wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf);
  56. A_STATUS wmi_syncpoint(struct wmi_t *wmip);
  57. A_STATUS wmi_syncpoint_reset(struct wmi_t *wmip);
  58. A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT32 layer2Priority, A_BOOL wmmEnabled);
  59. A_UINT8 wmi_determine_userPriority (A_UINT8 *pkt, A_UINT32 layer2Pri);
  60. A_STATUS wmi_control_rx(struct wmi_t *wmip, void *osbuf);
  61. void wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg);
  62. void wmi_free_allnodes(struct wmi_t *wmip);
  63. bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr);
  64. void wmi_free_node(struct wmi_t *wmip, const A_UINT8 *macaddr);
  65. typedef enum {
  66. NO_SYNC_WMIFLAG = 0,
  67. SYNC_BEFORE_WMIFLAG, /* transmit all queued data before cmd */
  68. SYNC_AFTER_WMIFLAG, /* any new data waits until cmd execs */
  69. SYNC_BOTH_WMIFLAG,
  70. END_WMIFLAG /* end marker */
  71. } WMI_SYNC_FLAG;
  72. A_STATUS wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId,
  73. WMI_SYNC_FLAG flag);
  74. A_STATUS wmi_connect_cmd(struct wmi_t *wmip,
  75. NETWORK_TYPE netType,
  76. DOT11_AUTH_MODE dot11AuthMode,
  77. AUTH_MODE authMode,
  78. CRYPTO_TYPE pairwiseCrypto,
  79. A_UINT8 pairwiseCryptoLen,
  80. CRYPTO_TYPE groupCrypto,
  81. A_UINT8 groupCryptoLen,
  82. int ssidLength,
  83. A_UCHAR *ssid,
  84. A_UINT8 *bssid,
  85. A_UINT16 channel,
  86. A_UINT32 ctrl_flags);
  87. A_STATUS wmi_reconnect_cmd(struct wmi_t *wmip,
  88. A_UINT8 *bssid,
  89. A_UINT16 channel);
  90. A_STATUS wmi_disconnect_cmd(struct wmi_t *wmip);
  91. A_STATUS wmi_getrev_cmd(struct wmi_t *wmip);
  92. A_STATUS wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType,
  93. A_BOOL forceFgScan, A_BOOL isLegacy,
  94. A_UINT32 homeDwellTime, A_UINT32 forceScanInterval,
  95. A_INT8 numChan, A_UINT16 *channelList);
  96. A_STATUS wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec,
  97. A_UINT16 fg_end_sec, A_UINT16 bg_sec,
  98. A_UINT16 minact_chdw_msec,
  99. A_UINT16 maxact_chdw_msec, A_UINT16 pas_chdw_msec,
  100. A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags,
  101. A_UINT32 max_dfsch_act_time,
  102. A_UINT16 maxact_scan_per_ssid);
  103. A_STATUS wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask);
  104. A_STATUS wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag,
  105. A_UINT8 ssidLength, A_UCHAR *ssid);
  106. A_STATUS wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons);
  107. A_STATUS wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmisstime, A_UINT16 bmissbeacons);
  108. A_STATUS wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType,
  109. A_UINT8 ieLen, A_UINT8 *ieInfo);
  110. A_STATUS wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode);
  111. A_STATUS wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl,
  112. A_UINT16 atim_windows, A_UINT16 timeout_value);
  113. A_STATUS wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod,
  114. A_UINT16 psPollNum, A_UINT16 dtimPolicy);
  115. A_STATUS wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout);
  116. A_STATUS wmi_sync_cmd(struct wmi_t *wmip, A_UINT8 syncNumber);
  117. A_STATUS wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *pstream);
  118. A_STATUS wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 streamID);
  119. A_STATUS wmi_set_framerate_cmd(struct wmi_t *wmip, A_UINT8 bEnable, A_UINT8 type, A_UINT8 subType, A_UINT16 rateMask);
  120. A_STATUS wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 dataRate, A_INT32 mgmtRate, A_INT32 ctlRate);
  121. A_STATUS wmi_get_bitrate_cmd(struct wmi_t *wmip);
  122. A_INT8 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate);
  123. A_STATUS wmi_get_regDomain_cmd(struct wmi_t *wmip);
  124. A_STATUS wmi_get_channelList_cmd(struct wmi_t *wmip);
  125. A_STATUS wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam,
  126. WMI_PHY_MODE mode, A_INT8 numChan,
  127. A_UINT16 *channelList);
  128. A_STATUS wmi_set_snr_threshold_params(struct wmi_t *wmip,
  129. WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd);
  130. A_STATUS wmi_set_rssi_threshold_params(struct wmi_t *wmip,
  131. WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd);
  132. A_STATUS wmi_clr_rssi_snr(struct wmi_t *wmip);
  133. A_STATUS wmi_set_lq_threshold_params(struct wmi_t *wmip,
  134. WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd);
  135. A_STATUS wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold);
  136. A_STATUS wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status);
  137. A_STATUS wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 bitmask);
  138. A_STATUS wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie,
  139. A_UINT32 source);
  140. A_STATUS wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask,
  141. A_UINT16 tsr, A_BOOL rep, A_UINT16 size,
  142. A_UINT32 valid);
  143. A_STATUS wmi_get_stats_cmd (struct wmi_t *wmip);
  144. A_STATUS wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex,
  145. CRYPTO_TYPE keyType, A_UINT8 keyUsage,
  146. A_UINT8 keyLength,A_UINT8 *keyRSC,
  147. A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl, A_UINT8 *mac,
  148. WMI_SYNC_FLAG sync_flag);
  149. A_STATUS wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk);
  150. A_STATUS wmi_delete_krk_cmd(struct wmi_t *wmip);
  151. A_STATUS wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex);
  152. A_STATUS wmi_set_akmp_params_cmd(struct wmi_t *wmip,
  153. WMI_SET_AKMP_PARAMS_CMD *akmpParams);
  154. A_STATUS wmi_get_pmkid_list_cmd(struct wmi_t *wmip);
  155. A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip,
  156. WMI_SET_PMKID_LIST_CMD *pmkInfo);
  157. A_STATUS wmi_abort_scan_cmd(struct wmi_t *wmip);
  158. A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM);
  159. A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip);
  160. A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid);
  161. A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex);
  162. A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en);
  163. A_STATUS wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId,
  164. A_BOOL set);
  165. A_STATUS wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT16 txop,
  166. A_UINT8 eCWmin, A_UINT8 eCWmax,
  167. A_UINT8 aifsn);
  168. A_STATUS wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType,
  169. A_UINT8 trafficClass, A_UINT8 maxRetries,
  170. A_UINT8 enableNotify);
  171. void wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid);
  172. A_STATUS wmi_get_roam_tbl_cmd(struct wmi_t *wmip);
  173. A_STATUS wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType);
  174. A_STATUS wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p,
  175. A_UINT8 size);
  176. A_STATUS wmi_set_powersave_timers_cmd(struct wmi_t *wmip,
  177. WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd,
  178. A_UINT8 size);
  179. A_STATUS wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode);
  180. A_STATUS wmi_opt_tx_frame_cmd(struct wmi_t *wmip,
  181. A_UINT8 frmType,
  182. A_UINT8 *dstMacAddr,
  183. A_UINT8 *bssid,
  184. A_UINT16 optIEDataLen,
  185. A_UINT8 *optIEData);
  186. A_STATUS wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl);
  187. A_STATUS wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize);
  188. A_STATUS wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSpLen);
  189. A_UINT8 convert_userPriority_to_trafficClass(A_UINT8 userPriority);
  190. A_UINT8 wmi_get_power_mode_cmd(struct wmi_t *wmip);
  191. A_STATUS wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance);
  192. #ifdef CONFIG_HOST_TCMD_SUPPORT
  193. A_STATUS wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len);
  194. #endif
  195. A_STATUS wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status);
  196. A_STATUS wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd);
  197. /*
  198. * This function is used to configure the fix rates mask to the target.
  199. */
  200. A_STATUS wmi_set_fixrates_cmd(struct wmi_t *wmip, A_INT16 fixRatesMask);
  201. A_STATUS wmi_get_ratemask_cmd(struct wmi_t *wmip);
  202. A_STATUS wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode);
  203. A_STATUS wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode);
  204. A_STATUS wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status);
  205. A_STATUS wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG txEnable);
  206. A_STATUS wmi_set_country(struct wmi_t *wmip, A_UCHAR *countryCode);
  207. A_STATUS wmi_get_keepalive_configured(struct wmi_t *wmip);
  208. A_UINT8 wmi_get_keepalive_cmd(struct wmi_t *wmip);
  209. A_STATUS wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval);
  210. A_STATUS wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType,
  211. A_UINT8 ieLen,A_UINT8 *ieInfo);
  212. A_STATUS wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen);
  213. A_INT32 wmi_get_rate(A_INT8 rateindex);
  214. A_STATUS wmi_set_ip_cmd(struct wmi_t *wmip, WMI_SET_IP_CMD *cmd);
  215. /*Wake on Wireless WMI commands*/
  216. A_STATUS wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, WMI_SET_HOST_SLEEP_MODE_CMD *cmd);
  217. A_STATUS wmi_set_wow_mode_cmd(struct wmi_t *wmip, WMI_SET_WOW_MODE_CMD *cmd);
  218. A_STATUS wmi_get_wow_list_cmd(struct wmi_t *wmip, WMI_GET_WOW_LIST_CMD *cmd);
  219. A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip,
  220. WMI_ADD_WOW_PATTERN_CMD *cmd, A_UINT8* pattern, A_UINT8* mask, A_UINT8 pattern_size);
  221. A_STATUS wmi_del_wow_pattern_cmd(struct wmi_t *wmip,
  222. WMI_DEL_WOW_PATTERN_CMD *cmd);
  223. A_STATUS wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status);
  224. A_STATUS
  225. wmi_set_params_cmd(struct wmi_t *wmip, A_UINT32 opcode, A_UINT32 length, A_CHAR* buffer);
  226. A_STATUS
  227. wmi_set_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 dot1, A_UINT8 dot2, A_UINT8 dot3, A_UINT8 dot4);
  228. A_STATUS
  229. wmi_del_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 dot1, A_UINT8 dot2, A_UINT8 dot3, A_UINT8 dot4);
  230. bss_t *
  231. wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid,
  232. A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID);
  233. bss_t *
  234. wmi_find_matching_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid,
  235. A_UINT32 ssidLength,
  236. A_UINT32 dot11AuthMode, A_UINT32 authMode,
  237. A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp);
  238. void
  239. wmi_node_return (struct wmi_t *wmip, bss_t *bss);
  240. void
  241. wmi_set_nodeage(struct wmi_t *wmip, A_UINT32 nodeAge);
  242. #if defined(CONFIG_TARGET_PROFILE_SUPPORT)
  243. A_STATUS wmi_prof_cfg_cmd(struct wmi_t *wmip, A_UINT32 period, A_UINT32 nbins);
  244. A_STATUS wmi_prof_addr_set_cmd(struct wmi_t *wmip, A_UINT32 addr);
  245. A_STATUS wmi_prof_start_cmd(struct wmi_t *wmip);
  246. A_STATUS wmi_prof_stop_cmd(struct wmi_t *wmip);
  247. A_STATUS wmi_prof_count_get_cmd(struct wmi_t *wmip);
  248. #endif /* CONFIG_TARGET_PROFILE_SUPPORT */
  249. #ifdef OS_ROAM_MANAGEMENT
  250. void wmi_scan_indication (struct wmi_t *wmip);
  251. #endif
  252. A_STATUS
  253. wmi_set_target_event_report_cmd(struct wmi_t *wmip, WMI_SET_TARGET_EVENT_REPORT_CMD* cmd);
  254. #ifdef PYXIS_ADHOC
  255. A_STATUS
  256. wmi_set_pyxis_gen_config (struct wmi_t *wmip, A_UINT32 dataWindowSizeMin, A_UINT32 dataWindowSizeMax, A_UINT8 maxJoiners);
  257. A_STATUS
  258. wmi_set_pyxis_dscvr_config (struct wmi_t *wmip, A_UINT32 dscvrWindow, A_UINT32 dscvrInterval,
  259. A_UINT32 probeInterval, A_UINT32 probePeriod, A_UINT16 dscvrChannel);
  260. A_STATUS
  261. wmi_pyxis_disconnect_cmd (struct wmi_t *wmip, A_UINT8 *bssid);
  262. A_STATUS
  263. wmi_pyxis_join_cmd (struct wmi_t *wmip, NETWORK_TYPE wmiNetworkType,
  264. DOT11_AUTH_MODE dot11AuthMode, AUTH_MODE authMode,
  265. CRYPTO_TYPE pairwiseCrypto, A_UINT8 pairwiseCryptoLen,
  266. CRYPTO_TYPE groupCrypto, A_UINT8 groupCryptoLen,
  267. A_UINT8 *bssid, A_UINT8 *nwBSSID, A_UINT16 channel, A_UINT32 ctrl_flags
  268. );
  269. #endif
  270. bss_t *wmi_rm_current_bss (struct wmi_t *wmip, A_UINT8 *id);
  271. A_STATUS wmi_add_current_bss (struct wmi_t *wmip, A_UINT8 *id, bss_t *bss);
  272. /*
  273. * AP mode
  274. */
  275. A_STATUS
  276. wmi_ap_profile_commit(struct wmi_t *wmip, WMI_CONNECT_CMD *p);
  277. A_STATUS
  278. wmi_ap_set_hidden_ssid(struct wmi_t *wmip, A_UINT8 hidden_ssid);
  279. A_STATUS
  280. wmi_ap_set_num_sta(struct wmi_t *wmip, A_UINT8 num_sta);
  281. A_STATUS
  282. wmi_ap_set_acl_policy(struct wmi_t *wmip, A_UINT8 policy);
  283. A_STATUS
  284. wmi_ap_acl_mac_list(struct wmi_t *wmip, WMI_AP_ACL_MAC_CMD *a);
  285. A_UINT8
  286. acl_add_del_mac(WMI_AP_ACL *a, WMI_AP_ACL_MAC_CMD *acl);
  287. A_STATUS
  288. wmi_ap_set_mlme(struct wmi_t *wmip, A_UINT8 cmd, A_UINT8 *mac, A_UINT16 reason);
  289. A_STATUS
  290. wmi_set_pvb_cmd(struct wmi_t *wmip, A_UINT16 aid, A_BOOL flag);
  291. A_STATUS
  292. wmi_ap_conn_inact_time(struct wmi_t *wmip, A_UINT32 period);
  293. A_STATUS
  294. wmi_ap_bgscan_time(struct wmi_t *wmip, A_UINT32 period, A_UINT32 dwell);
  295. A_STATUS
  296. wmi_ap_set_dtim(struct wmi_t *wmip, A_UINT8 dtim);
  297. #ifdef __cplusplus
  298. }
  299. #endif
  300. #endif /* _WMI_API_H_ */