wlcore.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /*
  2. * This file is part of wlcore
  3. *
  4. * Copyright (C) 2011 Texas Instruments Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #ifndef __WLCORE_H__
  22. #define __WLCORE_H__
  23. #include <linux/platform_device.h>
  24. #include "wlcore_i.h"
  25. #include "event.h"
  26. #include "boot.h"
  27. /* The maximum number of Tx descriptors in all chip families */
  28. #define WLCORE_MAX_TX_DESCRIPTORS 32
  29. /*
  30. * We always allocate this number of mac addresses. If we don't
  31. * have enough allocated addresses, the LAA bit is used
  32. */
  33. #define WLCORE_NUM_MAC_ADDRESSES 3
  34. /* wl12xx/wl18xx maximum transmission power (in dBm) */
  35. #define WLCORE_MAX_TXPWR 25
  36. /* forward declaration */
  37. struct wl1271_tx_hw_descr;
  38. enum wl_rx_buf_align;
  39. struct wl1271_rx_descriptor;
  40. struct wlcore_ops {
  41. int (*setup)(struct wl1271 *wl);
  42. int (*identify_chip)(struct wl1271 *wl);
  43. int (*identify_fw)(struct wl1271 *wl);
  44. int (*boot)(struct wl1271 *wl);
  45. int (*plt_init)(struct wl1271 *wl);
  46. int (*trigger_cmd)(struct wl1271 *wl, int cmd_box_addr,
  47. void *buf, size_t len);
  48. int (*ack_event)(struct wl1271 *wl);
  49. int (*wait_for_event)(struct wl1271 *wl, enum wlcore_wait_event event,
  50. bool *timeout);
  51. int (*process_mailbox_events)(struct wl1271 *wl);
  52. u32 (*calc_tx_blocks)(struct wl1271 *wl, u32 len, u32 spare_blks);
  53. void (*set_tx_desc_blocks)(struct wl1271 *wl,
  54. struct wl1271_tx_hw_descr *desc,
  55. u32 blks, u32 spare_blks);
  56. void (*set_tx_desc_data_len)(struct wl1271 *wl,
  57. struct wl1271_tx_hw_descr *desc,
  58. struct sk_buff *skb);
  59. enum wl_rx_buf_align (*get_rx_buf_align)(struct wl1271 *wl,
  60. u32 rx_desc);
  61. int (*prepare_read)(struct wl1271 *wl, u32 rx_desc, u32 len);
  62. u32 (*get_rx_packet_len)(struct wl1271 *wl, void *rx_data,
  63. u32 data_len);
  64. int (*tx_delayed_compl)(struct wl1271 *wl);
  65. void (*tx_immediate_compl)(struct wl1271 *wl);
  66. int (*hw_init)(struct wl1271 *wl);
  67. int (*init_vif)(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  68. void (*convert_fw_status)(struct wl1271 *wl, void *raw_fw_status,
  69. struct wl_fw_status *fw_status);
  70. u32 (*sta_get_ap_rate_mask)(struct wl1271 *wl,
  71. struct wl12xx_vif *wlvif);
  72. int (*get_pg_ver)(struct wl1271 *wl, s8 *ver);
  73. int (*get_mac)(struct wl1271 *wl);
  74. void (*set_tx_desc_csum)(struct wl1271 *wl,
  75. struct wl1271_tx_hw_descr *desc,
  76. struct sk_buff *skb);
  77. void (*set_rx_csum)(struct wl1271 *wl,
  78. struct wl1271_rx_descriptor *desc,
  79. struct sk_buff *skb);
  80. u32 (*ap_get_mimo_wide_rate_mask)(struct wl1271 *wl,
  81. struct wl12xx_vif *wlvif);
  82. int (*debugfs_init)(struct wl1271 *wl, struct dentry *rootdir);
  83. int (*handle_static_data)(struct wl1271 *wl,
  84. struct wl1271_static_data *static_data);
  85. int (*scan_start)(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  86. struct cfg80211_scan_request *req);
  87. int (*scan_stop)(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  88. int (*sched_scan_start)(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  89. struct cfg80211_sched_scan_request *req,
  90. struct ieee80211_scan_ies *ies);
  91. void (*sched_scan_stop)(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  92. int (*get_spare_blocks)(struct wl1271 *wl, bool is_gem);
  93. int (*set_key)(struct wl1271 *wl, enum set_key_cmd cmd,
  94. struct ieee80211_vif *vif,
  95. struct ieee80211_sta *sta,
  96. struct ieee80211_key_conf *key_conf);
  97. int (*channel_switch)(struct wl1271 *wl,
  98. struct wl12xx_vif *wlvif,
  99. struct ieee80211_channel_switch *ch_switch);
  100. u32 (*pre_pkt_send)(struct wl1271 *wl, u32 buf_offset, u32 last_len);
  101. void (*sta_rc_update)(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  102. struct ieee80211_sta *sta, u32 changed);
  103. int (*set_peer_cap)(struct wl1271 *wl,
  104. struct ieee80211_sta_ht_cap *ht_cap,
  105. bool allow_ht_operation,
  106. u32 rate_set, u8 hlid);
  107. u32 (*convert_hwaddr)(struct wl1271 *wl, u32 hwaddr);
  108. bool (*lnk_high_prio)(struct wl1271 *wl, u8 hlid,
  109. struct wl1271_link *lnk);
  110. bool (*lnk_low_prio)(struct wl1271 *wl, u8 hlid,
  111. struct wl1271_link *lnk);
  112. int (*smart_config_start)(struct wl1271 *wl, u32 group_bitmap);
  113. int (*smart_config_stop)(struct wl1271 *wl);
  114. int (*smart_config_set_group_key)(struct wl1271 *wl, u16 group_id,
  115. u8 key_len, u8 *key);
  116. };
  117. enum wlcore_partitions {
  118. PART_DOWN,
  119. PART_WORK,
  120. PART_BOOT,
  121. PART_DRPW,
  122. PART_TOP_PRCM_ELP_SOC,
  123. PART_PHY_INIT,
  124. PART_TABLE_LEN,
  125. };
  126. struct wlcore_partition {
  127. u32 size;
  128. u32 start;
  129. };
  130. struct wlcore_partition_set {
  131. struct wlcore_partition mem;
  132. struct wlcore_partition reg;
  133. struct wlcore_partition mem2;
  134. struct wlcore_partition mem3;
  135. };
  136. enum wlcore_registers {
  137. /* register addresses, used with partition translation */
  138. REG_ECPU_CONTROL,
  139. REG_INTERRUPT_NO_CLEAR,
  140. REG_INTERRUPT_ACK,
  141. REG_COMMAND_MAILBOX_PTR,
  142. REG_EVENT_MAILBOX_PTR,
  143. REG_INTERRUPT_TRIG,
  144. REG_INTERRUPT_MASK,
  145. REG_PC_ON_RECOVERY,
  146. REG_CHIP_ID_B,
  147. REG_CMD_MBOX_ADDRESS,
  148. /* data access memory addresses, used with partition translation */
  149. REG_SLV_MEM_DATA,
  150. REG_SLV_REG_DATA,
  151. /* raw data access memory addresses */
  152. REG_RAW_FW_STATUS_ADDR,
  153. REG_TABLE_LEN,
  154. };
  155. struct wl1271_stats {
  156. void *fw_stats;
  157. unsigned long fw_stats_update;
  158. size_t fw_stats_len;
  159. unsigned int retry_count;
  160. unsigned int excessive_retries;
  161. };
  162. struct wl1271 {
  163. bool initialized;
  164. struct ieee80211_hw *hw;
  165. bool mac80211_registered;
  166. struct device *dev;
  167. struct platform_device *pdev;
  168. void *if_priv;
  169. struct wl1271_if_operations *if_ops;
  170. int irq;
  171. spinlock_t wl_lock;
  172. enum wlcore_state state;
  173. enum wl12xx_fw_type fw_type;
  174. bool plt;
  175. enum plt_mode plt_mode;
  176. u8 fem_manuf;
  177. u8 last_vif_count;
  178. struct mutex mutex;
  179. unsigned long flags;
  180. struct wlcore_partition_set curr_part;
  181. struct wl1271_chip chip;
  182. int cmd_box_addr;
  183. u8 *fw;
  184. size_t fw_len;
  185. void *nvs;
  186. size_t nvs_len;
  187. s8 hw_pg_ver;
  188. /* address read from the fuse ROM */
  189. u32 fuse_oui_addr;
  190. u32 fuse_nic_addr;
  191. /* we have up to 2 MAC addresses */
  192. struct mac_address addresses[WLCORE_NUM_MAC_ADDRESSES];
  193. int channel;
  194. u8 system_hlid;
  195. unsigned long links_map[BITS_TO_LONGS(WLCORE_MAX_LINKS)];
  196. unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)];
  197. unsigned long roc_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)];
  198. unsigned long rate_policies_map[
  199. BITS_TO_LONGS(WL12XX_MAX_RATE_POLICIES)];
  200. unsigned long klv_templates_map[
  201. BITS_TO_LONGS(WLCORE_MAX_KLV_TEMPLATES)];
  202. u8 session_ids[WLCORE_MAX_LINKS];
  203. struct list_head wlvif_list;
  204. u8 sta_count;
  205. u8 ap_count;
  206. struct wl1271_acx_mem_map *target_mem_map;
  207. /* Accounting for allocated / available TX blocks on HW */
  208. u32 tx_blocks_freed;
  209. u32 tx_blocks_available;
  210. u32 tx_allocated_blocks;
  211. u32 tx_results_count;
  212. /* Accounting for allocated / available Tx packets in HW */
  213. u32 tx_pkts_freed[NUM_TX_QUEUES];
  214. u32 tx_allocated_pkts[NUM_TX_QUEUES];
  215. /* Transmitted TX packets counter for chipset interface */
  216. u32 tx_packets_count;
  217. /* Time-offset between host and chipset clocks */
  218. s64 time_offset;
  219. /* Frames scheduled for transmission, not handled yet */
  220. int tx_queue_count[NUM_TX_QUEUES];
  221. unsigned long queue_stop_reasons[
  222. NUM_TX_QUEUES * WLCORE_NUM_MAC_ADDRESSES];
  223. /* Frames received, not handled yet by mac80211 */
  224. struct sk_buff_head deferred_rx_queue;
  225. /* Frames sent, not returned yet to mac80211 */
  226. struct sk_buff_head deferred_tx_queue;
  227. struct work_struct tx_work;
  228. struct workqueue_struct *freezable_wq;
  229. /* Pending TX frames */
  230. unsigned long tx_frames_map[BITS_TO_LONGS(WLCORE_MAX_TX_DESCRIPTORS)];
  231. struct sk_buff *tx_frames[WLCORE_MAX_TX_DESCRIPTORS];
  232. int tx_frames_cnt;
  233. /* FW Rx counter */
  234. u32 rx_counter;
  235. /* Intermediate buffer, used for packet aggregation */
  236. u8 *aggr_buf;
  237. u32 aggr_buf_size;
  238. /* Reusable dummy packet template */
  239. struct sk_buff *dummy_packet;
  240. /* Network stack work */
  241. struct work_struct netstack_work;
  242. /* FW log buffer */
  243. u8 *fwlog;
  244. /* Number of valid bytes in the FW log buffer */
  245. ssize_t fwlog_size;
  246. /* FW log end marker */
  247. u32 fwlog_end;
  248. /* FW memory block size */
  249. u32 fw_mem_block_size;
  250. /* Sysfs FW log entry readers wait queue */
  251. wait_queue_head_t fwlog_waitq;
  252. /* Hardware recovery work */
  253. struct work_struct recovery_work;
  254. bool watchdog_recovery;
  255. /* Reg domain last configuration */
  256. u32 reg_ch_conf_last[2];
  257. /* Reg domain pending configuration */
  258. u32 reg_ch_conf_pending[2];
  259. /* Pointer that holds DMA-friendly block for the mailbox */
  260. void *mbox;
  261. /* The mbox event mask */
  262. u32 event_mask;
  263. /* events to unmask only when ap interface is up */
  264. u32 ap_event_mask;
  265. /* Mailbox pointers */
  266. u32 mbox_size;
  267. u32 mbox_ptr[2];
  268. /* Are we currently scanning */
  269. struct wl12xx_vif *scan_wlvif;
  270. struct wl1271_scan scan;
  271. struct delayed_work scan_complete_work;
  272. struct ieee80211_vif *roc_vif;
  273. struct delayed_work roc_complete_work;
  274. struct wl12xx_vif *sched_vif;
  275. /* The current band */
  276. enum ieee80211_band band;
  277. struct completion *elp_compl;
  278. struct delayed_work elp_work;
  279. /* in dBm */
  280. int power_level;
  281. struct wl1271_stats stats;
  282. __le32 *buffer_32;
  283. u32 buffer_cmd;
  284. u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
  285. void *raw_fw_status;
  286. struct wl_fw_status *fw_status;
  287. struct wl1271_tx_hw_res_if *tx_res_if;
  288. /* Current chipset configuration */
  289. struct wlcore_conf conf;
  290. bool sg_enabled;
  291. bool enable_11a;
  292. int recovery_count;
  293. /* Most recently reported noise in dBm */
  294. s8 noise;
  295. /* bands supported by this instance of wl12xx */
  296. struct ieee80211_supported_band bands[WLCORE_NUM_BANDS];
  297. /*
  298. * wowlan trigger was configured during suspend.
  299. * (currently, only "ANY" trigger is supported)
  300. */
  301. bool wow_enabled;
  302. bool irq_wake_enabled;
  303. /*
  304. * AP-mode - links indexed by HLID. The global and broadcast links
  305. * are always active.
  306. */
  307. struct wl1271_link links[WLCORE_MAX_LINKS];
  308. /* number of currently active links */
  309. int active_link_count;
  310. /* Fast/slow links bitmap according to FW */
  311. unsigned long fw_fast_lnk_map;
  312. /* AP-mode - a bitmap of links currently in PS mode according to FW */
  313. unsigned long ap_fw_ps_map;
  314. /* AP-mode - a bitmap of links currently in PS mode in mac80211 */
  315. unsigned long ap_ps_map;
  316. /* Quirks of specific hardware revisions */
  317. unsigned int quirks;
  318. /* Platform limitations */
  319. unsigned int platform_quirks;
  320. /* number of currently active RX BA sessions */
  321. int ba_rx_session_count;
  322. /* Maximum number of supported RX BA sessions */
  323. int ba_rx_session_count_max;
  324. /* AP-mode - number of currently connected stations */
  325. int active_sta_count;
  326. /* Flag determining whether AP should broadcast OFDM-only rates */
  327. bool ofdm_only_ap;
  328. /* last wlvif we transmitted from */
  329. struct wl12xx_vif *last_wlvif;
  330. /* work to fire when Tx is stuck */
  331. struct delayed_work tx_watchdog_work;
  332. struct wlcore_ops *ops;
  333. /* pointer to the lower driver partition table */
  334. const struct wlcore_partition_set *ptable;
  335. /* pointer to the lower driver register table */
  336. const int *rtable;
  337. /* name of the firmwares to load - for PLT, single role, multi-role */
  338. const char *plt_fw_name;
  339. const char *sr_fw_name;
  340. const char *mr_fw_name;
  341. u8 scan_templ_id_2_4;
  342. u8 scan_templ_id_5;
  343. u8 sched_scan_templ_id_2_4;
  344. u8 sched_scan_templ_id_5;
  345. u8 max_channels_5;
  346. /* per-chip-family private structure */
  347. void *priv;
  348. /* number of TX descriptors the HW supports. */
  349. u32 num_tx_desc;
  350. /* number of RX descriptors the HW supports. */
  351. u32 num_rx_desc;
  352. /* number of links the HW supports */
  353. u8 num_links;
  354. /* max stations a single AP can support */
  355. u8 max_ap_stations;
  356. /* translate HW Tx rates to standard rate-indices */
  357. const u8 **band_rate_to_idx;
  358. /* size of table for HW rates that can be received from chip */
  359. u8 hw_tx_rate_tbl_size;
  360. /* this HW rate and below are considered HT rates for this chip */
  361. u8 hw_min_ht_rate;
  362. /* HW HT (11n) capabilities */
  363. struct ieee80211_sta_ht_cap ht_cap[WLCORE_NUM_BANDS];
  364. /* size of the private FW status data */
  365. size_t fw_status_len;
  366. size_t fw_status_priv_len;
  367. /* RX Data filter rule state - enabled/disabled */
  368. unsigned long rx_filter_enabled[BITS_TO_LONGS(WL1271_MAX_RX_FILTERS)];
  369. /* size of the private static data */
  370. size_t static_data_priv_len;
  371. /* the current channel type */
  372. enum nl80211_channel_type channel_type;
  373. /* mutex for protecting the tx_flush function */
  374. struct mutex flush_mutex;
  375. /* sleep auth value currently configured to FW */
  376. int sleep_auth;
  377. /* the number of allocated MAC addresses in this chip */
  378. int num_mac_addr;
  379. /* minimum FW version required for the driver to work in single-role */
  380. unsigned int min_sr_fw_ver[NUM_FW_VER];
  381. /* minimum FW version required for the driver to work in multi-role */
  382. unsigned int min_mr_fw_ver[NUM_FW_VER];
  383. struct completion nvs_loading_complete;
  384. /* interface combinations supported by the hw */
  385. const struct ieee80211_iface_combination *iface_combinations;
  386. u8 n_iface_combinations;
  387. };
  388. int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
  389. int wlcore_remove(struct platform_device *pdev);
  390. struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
  391. u32 mbox_size);
  392. int wlcore_free_hw(struct wl1271 *wl);
  393. int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
  394. struct ieee80211_vif *vif,
  395. struct ieee80211_sta *sta,
  396. struct ieee80211_key_conf *key_conf);
  397. void wlcore_regdomain_config(struct wl1271 *wl);
  398. void wlcore_update_inconn_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  399. struct wl1271_station *wl_sta, bool in_conn);
  400. static inline void
  401. wlcore_set_ht_cap(struct wl1271 *wl, enum ieee80211_band band,
  402. struct ieee80211_sta_ht_cap *ht_cap)
  403. {
  404. memcpy(&wl->ht_cap[band], ht_cap, sizeof(*ht_cap));
  405. }
  406. /* Tell wlcore not to care about this element when checking the version */
  407. #define WLCORE_FW_VER_IGNORE -1
  408. static inline void
  409. wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip,
  410. unsigned int iftype_sr, unsigned int major_sr,
  411. unsigned int subtype_sr, unsigned int minor_sr,
  412. unsigned int iftype_mr, unsigned int major_mr,
  413. unsigned int subtype_mr, unsigned int minor_mr)
  414. {
  415. wl->min_sr_fw_ver[FW_VER_CHIP] = chip;
  416. wl->min_sr_fw_ver[FW_VER_IF_TYPE] = iftype_sr;
  417. wl->min_sr_fw_ver[FW_VER_MAJOR] = major_sr;
  418. wl->min_sr_fw_ver[FW_VER_SUBTYPE] = subtype_sr;
  419. wl->min_sr_fw_ver[FW_VER_MINOR] = minor_sr;
  420. wl->min_mr_fw_ver[FW_VER_CHIP] = chip;
  421. wl->min_mr_fw_ver[FW_VER_IF_TYPE] = iftype_mr;
  422. wl->min_mr_fw_ver[FW_VER_MAJOR] = major_mr;
  423. wl->min_mr_fw_ver[FW_VER_SUBTYPE] = subtype_mr;
  424. wl->min_mr_fw_ver[FW_VER_MINOR] = minor_mr;
  425. }
  426. /* Firmware image load chunk size */
  427. #define CHUNK_SIZE 16384
  428. /* Quirks */
  429. /* Each RX/TX transaction requires an end-of-transaction transfer */
  430. #define WLCORE_QUIRK_END_OF_TRANSACTION BIT(0)
  431. /* the first start_role(sta) sometimes doesn't work on wl12xx */
  432. #define WLCORE_QUIRK_START_STA_FAILS BIT(1)
  433. /* wl127x and SPI don't support SDIO block size alignment */
  434. #define WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN BIT(2)
  435. /* means aggregated Rx packets are aligned to a SDIO block */
  436. #define WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN BIT(3)
  437. /* Older firmwares did not implement the FW logger over bus feature */
  438. #define WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED BIT(4)
  439. /* Older firmwares use an old NVS format */
  440. #define WLCORE_QUIRK_LEGACY_NVS BIT(5)
  441. /* pad only the last frame in the aggregate buffer */
  442. #define WLCORE_QUIRK_TX_PAD_LAST_FRAME BIT(7)
  443. /* extra header space is required for TKIP */
  444. #define WLCORE_QUIRK_TKIP_HEADER_SPACE BIT(8)
  445. /* Some firmwares not support sched scans while connected */
  446. #define WLCORE_QUIRK_NO_SCHED_SCAN_WHILE_CONN BIT(9)
  447. /* separate probe response templates for one-shot and sched scans */
  448. #define WLCORE_QUIRK_DUAL_PROBE_TMPL BIT(10)
  449. /* Firmware requires reg domain configuration for active calibration */
  450. #define WLCORE_QUIRK_REGDOMAIN_CONF BIT(11)
  451. /* The FW only support a zero session id for AP */
  452. #define WLCORE_QUIRK_AP_ZERO_SESSION_ID BIT(12)
  453. /* TODO: move all these common registers and values elsewhere */
  454. #define HW_ACCESS_ELP_CTRL_REG 0x1FFFC
  455. /* ELP register commands */
  456. #define ELPCTRL_WAKE_UP 0x1
  457. #define ELPCTRL_WAKE_UP_WLAN_READY 0x5
  458. #define ELPCTRL_SLEEP 0x0
  459. /* ELP WLAN_READY bit */
  460. #define ELPCTRL_WLAN_READY 0x2
  461. /*************************************************************************
  462. Interrupt Trigger Register (Host -> WiLink)
  463. **************************************************************************/
  464. /* Hardware to Embedded CPU Interrupts - first 32-bit register set */
  465. /*
  466. * The host sets this bit to inform the Wlan
  467. * FW that a TX packet is in the XFER
  468. * Buffer #0.
  469. */
  470. #define INTR_TRIG_TX_PROC0 BIT(2)
  471. /*
  472. * The host sets this bit to inform the FW
  473. * that it read a packet from RX XFER
  474. * Buffer #0.
  475. */
  476. #define INTR_TRIG_RX_PROC0 BIT(3)
  477. #define INTR_TRIG_DEBUG_ACK BIT(4)
  478. #define INTR_TRIG_STATE_CHANGED BIT(5)
  479. /* Hardware to Embedded CPU Interrupts - second 32-bit register set */
  480. /*
  481. * The host sets this bit to inform the FW
  482. * that it read a packet from RX XFER
  483. * Buffer #1.
  484. */
  485. #define INTR_TRIG_RX_PROC1 BIT(17)
  486. /*
  487. * The host sets this bit to inform the Wlan
  488. * hardware that a TX packet is in the XFER
  489. * Buffer #1.
  490. */
  491. #define INTR_TRIG_TX_PROC1 BIT(18)
  492. #define ACX_SLV_SOFT_RESET_BIT BIT(1)
  493. #define SOFT_RESET_MAX_TIME 1000000
  494. #define SOFT_RESET_STALL_TIME 1000
  495. #define ECPU_CONTROL_HALT 0x00000101
  496. #define WELP_ARM_COMMAND_VAL 0x4
  497. #endif /* __WLCORE_H__ */