host.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. /**
  2. * This file contains definitions of WLAN commands.
  3. */
  4. #ifndef _HOST_H_
  5. #define _HOST_H_
  6. /** PUBLIC DEFINITIONS */
  7. #define DEFAULT_AD_HOC_CHANNEL 6
  8. #define DEFAULT_AD_HOC_CHANNEL_A 36
  9. /** IEEE 802.11 oids */
  10. #define OID_802_11_SSID 0x00008002
  11. #define OID_802_11_INFRASTRUCTURE_MODE 0x00008008
  12. #define OID_802_11_FRAGMENTATION_THRESHOLD 0x00008009
  13. #define OID_802_11_RTS_THRESHOLD 0x0000800A
  14. #define OID_802_11_TX_ANTENNA_SELECTED 0x0000800D
  15. #define OID_802_11_SUPPORTED_RATES 0x0000800E
  16. #define OID_802_11_STATISTICS 0x00008012
  17. #define OID_802_11_TX_RETRYCOUNT 0x0000801D
  18. #define OID_802_11D_ENABLE 0x00008020
  19. #define cmd_option_waitforrsp 0x0002
  20. /** Host command ID */
  21. #define cmd_code_dnld 0x0002
  22. #define cmd_get_hw_spec 0x0003
  23. #define cmd_eeprom_update 0x0004
  24. #define cmd_802_11_reset 0x0005
  25. #define cmd_802_11_scan 0x0006
  26. #define cmd_802_11_get_log 0x000b
  27. #define cmd_mac_multicast_adr 0x0010
  28. #define cmd_802_11_authenticate 0x0011
  29. #define cmd_802_11_eeprom_access 0x0059
  30. #define cmd_802_11_associate 0x0050
  31. #define cmd_802_11_set_wep 0x0013
  32. #define cmd_802_11_get_stat 0x0014
  33. #define cmd_802_3_get_stat 0x0015
  34. #define cmd_802_11_snmp_mib 0x0016
  35. #define cmd_mac_reg_map 0x0017
  36. #define cmd_bbp_reg_map 0x0018
  37. #define cmd_mac_reg_access 0x0019
  38. #define cmd_bbp_reg_access 0x001a
  39. #define cmd_rf_reg_access 0x001b
  40. #define cmd_802_11_radio_control 0x001c
  41. #define cmd_802_11_rf_channel 0x001d
  42. #define cmd_802_11_rf_tx_power 0x001e
  43. #define cmd_802_11_rssi 0x001f
  44. #define cmd_802_11_rf_antenna 0x0020
  45. #define cmd_802_11_ps_mode 0x0021
  46. #define cmd_802_11_data_rate 0x0022
  47. #define cmd_rf_reg_map 0x0023
  48. #define cmd_802_11_deauthenticate 0x0024
  49. #define cmd_802_11_reassociate 0x0025
  50. #define cmd_802_11_disassociate 0x0026
  51. #define cmd_mac_control 0x0028
  52. #define cmd_802_11_ad_hoc_start 0x002b
  53. #define cmd_802_11_ad_hoc_join 0x002c
  54. #define cmd_802_11_query_tkip_reply_cntrs 0x002e
  55. #define cmd_802_11_enable_rsn 0x002f
  56. #define cmd_802_11_pairwise_tsc 0x0036
  57. #define cmd_802_11_group_tsc 0x0037
  58. #define cmd_802_11_key_material 0x005e
  59. #define cmd_802_11_set_afc 0x003c
  60. #define cmd_802_11_get_afc 0x003d
  61. #define cmd_802_11_ad_hoc_stop 0x0040
  62. #define cmd_802_11_beacon_stop 0x0049
  63. #define cmd_802_11_mac_address 0x004D
  64. #define cmd_802_11_eeprom_access 0x0059
  65. #define cmd_802_11_band_config 0x0058
  66. #define cmd_802_11d_domain_info 0x005b
  67. #define cmd_802_11_sleep_params 0x0066
  68. #define cmd_802_11_inactivity_timeout 0x0067
  69. #define cmd_802_11_tpc_cfg 0x0072
  70. #define cmd_802_11_pwr_cfg 0x0073
  71. #define cmd_802_11_led_gpio_ctrl 0x004e
  72. #define cmd_802_11_subscribe_event 0x0075
  73. #define cmd_802_11_rate_adapt_rateset 0x0076
  74. #define cmd_802_11_tx_rate_query 0x007f
  75. #define cmd_get_tsf 0x0080
  76. #define cmd_bt_access 0x0087
  77. #define cmd_ret_bt_access 0x8087
  78. #define cmd_fwt_access 0x0088
  79. #define cmd_ret_fwt_access 0x8088
  80. #define cmd_mesh_access 0x0090
  81. #define cmd_ret_mesh_access 0x8090
  82. /* For the IEEE Power Save */
  83. #define cmd_subcmd_enter_ps 0x0030
  84. #define cmd_subcmd_exit_ps 0x0031
  85. #define cmd_subcmd_sleep_confirmed 0x0034
  86. #define cmd_subcmd_full_powerdown 0x0035
  87. #define cmd_subcmd_full_powerup 0x0036
  88. /* command RET code, MSB is set to 1 */
  89. #define cmd_ret_hw_spec_info 0x8003
  90. #define cmd_ret_eeprom_update 0x8004
  91. #define cmd_ret_802_11_reset 0x8005
  92. #define cmd_ret_802_11_scan 0x8006
  93. #define cmd_ret_802_11_get_log 0x800b
  94. #define cmd_ret_mac_control 0x8028
  95. #define cmd_ret_mac_multicast_adr 0x8010
  96. #define cmd_ret_802_11_authenticate 0x8011
  97. #define cmd_ret_802_11_deauthenticate 0x8024
  98. #define cmd_ret_802_11_associate 0x8012
  99. #define cmd_ret_802_11_reassociate 0x8025
  100. #define cmd_ret_802_11_disassociate 0x8026
  101. #define cmd_ret_802_11_set_wep 0x8013
  102. #define cmd_ret_802_11_stat 0x8014
  103. #define cmd_ret_802_3_stat 0x8015
  104. #define cmd_ret_802_11_snmp_mib 0x8016
  105. #define cmd_ret_mac_reg_map 0x8017
  106. #define cmd_ret_bbp_reg_map 0x8018
  107. #define cmd_ret_rf_reg_map 0x8023
  108. #define cmd_ret_mac_reg_access 0x8019
  109. #define cmd_ret_bbp_reg_access 0x801a
  110. #define cmd_ret_rf_reg_access 0x801b
  111. #define cmd_ret_802_11_radio_control 0x801c
  112. #define cmd_ret_802_11_rf_channel 0x801d
  113. #define cmd_ret_802_11_rssi 0x801f
  114. #define cmd_ret_802_11_rf_tx_power 0x801e
  115. #define cmd_ret_802_11_rf_antenna 0x8020
  116. #define cmd_ret_802_11_ps_mode 0x8021
  117. #define cmd_ret_802_11_data_rate 0x8022
  118. #define cmd_ret_802_11_ad_hoc_start 0x802B
  119. #define cmd_ret_802_11_ad_hoc_join 0x802C
  120. #define cmd_ret_802_11_query_tkip_reply_cntrs 0x802e
  121. #define cmd_ret_802_11_enable_rsn 0x802f
  122. #define cmd_ret_802_11_pairwise_tsc 0x8036
  123. #define cmd_ret_802_11_group_tsc 0x8037
  124. #define cmd_ret_802_11_key_material 0x805e
  125. #define cmd_enable_rsn 0x0001
  126. #define cmd_disable_rsn 0x0000
  127. #define cmd_act_set 0x0001
  128. #define cmd_act_get 0x0000
  129. #define cmd_act_get_AES (cmd_act_get + 2)
  130. #define cmd_act_set_AES (cmd_act_set + 2)
  131. #define cmd_act_remove_aes (cmd_act_set + 3)
  132. #define cmd_ret_802_11_set_afc 0x803c
  133. #define cmd_ret_802_11_get_afc 0x803d
  134. #define cmd_ret_802_11_ad_hoc_stop 0x8040
  135. #define cmd_ret_802_11_beacon_stop 0x8049
  136. #define cmd_ret_802_11_mac_address 0x804D
  137. #define cmd_ret_802_11_eeprom_access 0x8059
  138. #define cmd_ret_802_11_band_config 0x8058
  139. #define cmd_ret_802_11_sleep_params 0x8066
  140. #define cmd_ret_802_11_inactivity_timeout 0x8067
  141. #define cmd_ret_802_11d_domain_info (0x8000 | \
  142. cmd_802_11d_domain_info)
  143. #define cmd_ret_802_11_tpc_cfg (cmd_802_11_tpc_cfg | 0x8000)
  144. #define cmd_ret_802_11_pwr_cfg (cmd_802_11_pwr_cfg | 0x8000)
  145. #define cmd_ret_802_11_led_gpio_ctrl 0x804e
  146. #define cmd_ret_802_11_subscribe_event (cmd_802_11_subscribe_event | 0x8000)
  147. #define cmd_ret_802_11_rate_adapt_rateset (cmd_802_11_rate_adapt_rateset | 0x8000)
  148. #define cmd_rte_802_11_tx_rate_query (cmd_802_11_tx_rate_query | 0x8000)
  149. #define cmd_ret_get_tsf 0x8080
  150. /* Define action or option for cmd_802_11_set_wep */
  151. #define cmd_act_add 0x0002
  152. #define cmd_act_remove 0x0004
  153. #define cmd_act_use_default 0x0008
  154. #define cmd_type_wep_40_bit 0x0001
  155. #define cmd_type_wep_104_bit 0x0002
  156. #define cmd_NUM_OF_WEP_KEYS 4
  157. #define cmd_WEP_KEY_INDEX_MASK 0x3fff
  158. /* Define action or option for cmd_802_11_reset */
  159. #define cmd_act_halt 0x0003
  160. /* Define action or option for cmd_802_11_scan */
  161. #define cmd_bss_type_bss 0x0001
  162. #define cmd_bss_type_ibss 0x0002
  163. #define cmd_bss_type_any 0x0003
  164. /* Define action or option for cmd_802_11_scan */
  165. #define cmd_scan_type_active 0x0000
  166. #define cmd_scan_type_passive 0x0001
  167. #define cmd_scan_radio_type_bg 0
  168. #define cmd_scan_probe_delay_time 0
  169. /* Define action or option for cmd_mac_control */
  170. #define cmd_act_mac_rx_on 0x0001
  171. #define cmd_act_mac_tx_on 0x0002
  172. #define cmd_act_mac_loopback_on 0x0004
  173. #define cmd_act_mac_wep_enable 0x0008
  174. #define cmd_act_mac_int_enable 0x0010
  175. #define cmd_act_mac_multicast_enable 0x0020
  176. #define cmd_act_mac_broadcast_enable 0x0040
  177. #define cmd_act_mac_promiscuous_enable 0x0080
  178. #define cmd_act_mac_all_multicast_enable 0x0100
  179. #define cmd_act_mac_strict_protection_enable 0x0400
  180. /* Define action or option for cmd_802_11_radio_control */
  181. #define cmd_type_auto_preamble 0x0001
  182. #define cmd_type_short_preamble 0x0002
  183. #define cmd_type_long_preamble 0x0003
  184. #define TURN_ON_RF 0x01
  185. #define RADIO_ON 0x01
  186. #define RADIO_OFF 0x00
  187. #define SET_AUTO_PREAMBLE 0x05
  188. #define SET_SHORT_PREAMBLE 0x03
  189. #define SET_LONG_PREAMBLE 0x01
  190. /* Define action or option for CMD_802_11_RF_CHANNEL */
  191. #define cmd_opt_802_11_rf_channel_get 0x00
  192. #define cmd_opt_802_11_rf_channel_set 0x01
  193. /* Define action or option for cmd_802_11_rf_tx_power */
  194. #define cmd_act_tx_power_opt_get 0x0000
  195. #define cmd_act_tx_power_opt_set_high 0x8007
  196. #define cmd_act_tx_power_opt_set_mid 0x8004
  197. #define cmd_act_tx_power_opt_set_low 0x8000
  198. #define cmd_act_tx_power_index_high 0x0007
  199. #define cmd_act_tx_power_index_mid 0x0004
  200. #define cmd_act_tx_power_index_low 0x0000
  201. /* Define action or option for cmd_802_11_data_rate */
  202. #define cmd_act_set_tx_auto 0x0000
  203. #define cmd_act_set_tx_fix_rate 0x0001
  204. #define cmd_act_get_tx_rate 0x0002
  205. #define cmd_act_set_rx 0x0001
  206. #define cmd_act_set_tx 0x0002
  207. #define cmd_act_set_both 0x0003
  208. #define cmd_act_get_rx 0x0004
  209. #define cmd_act_get_tx 0x0008
  210. #define cmd_act_get_both 0x000c
  211. /* Define action or option for cmd_802_11_ps_mode */
  212. #define cmd_type_cam 0x0000
  213. #define cmd_type_max_psp 0x0001
  214. #define cmd_type_fast_psp 0x0002
  215. /* Define action or option for cmd_bt_access */
  216. enum cmd_bt_access_opts {
  217. /* The bt commands start at 5 instead of 1 because the old dft commands
  218. * are mapped to 1-4. These old commands are no longer maintained and
  219. * should not be called.
  220. */
  221. cmd_act_bt_access_add = 5,
  222. cmd_act_bt_access_del,
  223. cmd_act_bt_access_list,
  224. cmd_act_bt_access_reset
  225. };
  226. /* Define action or option for cmd_fwt_access */
  227. enum cmd_fwt_access_opts {
  228. cmd_act_fwt_access_add = 1,
  229. cmd_act_fwt_access_del,
  230. cmd_act_fwt_access_lookup,
  231. cmd_act_fwt_access_list,
  232. cmd_act_fwt_access_list_route,
  233. cmd_act_fwt_access_list_neighbor,
  234. cmd_act_fwt_access_reset,
  235. cmd_act_fwt_access_cleanup,
  236. cmd_act_fwt_access_time,
  237. };
  238. /* Define action or option for cmd_mesh_access */
  239. enum cmd_mesh_access_opts {
  240. cmd_act_mesh_get_ttl = 1,
  241. cmd_act_mesh_set_ttl,
  242. cmd_act_mesh_get_stats,
  243. cmd_act_mesh_get_mpp,
  244. cmd_act_mesh_set_mpp,
  245. };
  246. /** Card Event definition */
  247. #define MACREG_INT_CODE_TX_PPA_FREE 0x00000000
  248. #define MACREG_INT_CODE_TX_DMA_DONE 0x00000001
  249. #define MACREG_INT_CODE_LINK_LOSE_W_SCAN 0x00000002
  250. #define MACREG_INT_CODE_LINK_LOSE_NO_SCAN 0x00000003
  251. #define MACREG_INT_CODE_LINK_SENSED 0x00000004
  252. #define MACREG_INT_CODE_CMD_FINISHED 0x00000005
  253. #define MACREG_INT_CODE_MIB_CHANGED 0x00000006
  254. #define MACREG_INT_CODE_INIT_DONE 0x00000007
  255. #define MACREG_INT_CODE_DEAUTHENTICATED 0x00000008
  256. #define MACREG_INT_CODE_DISASSOCIATED 0x00000009
  257. #define MACREG_INT_CODE_PS_AWAKE 0x0000000a
  258. #define MACREG_INT_CODE_PS_SLEEP 0x0000000b
  259. #define MACREG_INT_CODE_MIC_ERR_MULTICAST 0x0000000d
  260. #define MACREG_INT_CODE_MIC_ERR_UNICAST 0x0000000e
  261. #define MACREG_INT_CODE_WM_AWAKE 0x0000000f
  262. #define MACREG_INT_CODE_ADHOC_BCN_LOST 0x00000011
  263. #define MACREG_INT_CODE_RSSI_LOW 0x00000019
  264. #define MACREG_INT_CODE_SNR_LOW 0x0000001a
  265. #define MACREG_INT_CODE_MAX_FAIL 0x0000001b
  266. #define MACREG_INT_CODE_RSSI_HIGH 0x0000001c
  267. #define MACREG_INT_CODE_SNR_HIGH 0x0000001d
  268. #endif /* _HOST_H_ */