Lines Matching refs:wmi_handle
163 static void wmi_minidump_detach(struct wmi_unified *wmi_handle) in wmi_minidump_detach() argument
166 &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info; in wmi_minidump_detach()
181 static void wmi_minidump_attach(struct wmi_unified *wmi_handle) in wmi_minidump_attach() argument
184 &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info; in wmi_minidump_attach()
194 info = &wmi_handle->log_info.wmi_command_log_buf_info; in wmi_minidump_attach()
203 info = &wmi_handle->log_info.wmi_event_log_buf_info; in wmi_minidump_attach()
212 info = &wmi_handle->log_info.wmi_rx_event_log_buf_info; in wmi_minidump_attach()
222 &wmi_handle->log_info, in wmi_minidump_attach()
223 sizeof(wmi_handle->log_info)); in wmi_minidump_attach()
442 static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle) in wmi_log_init() argument
445 &wmi_handle->log_info.wmi_command_log_buf_info; in wmi_log_init()
447 &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info; in wmi_log_init()
450 &wmi_handle->log_info.wmi_event_log_buf_info; in wmi_log_init()
452 &wmi_handle->log_info.wmi_rx_event_log_buf_info; in wmi_log_init()
455 &wmi_handle->log_info.wmi_mgmt_command_log_buf_info; in wmi_log_init()
457 &wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info; in wmi_log_init()
459 &wmi_handle->log_info.wmi_mgmt_event_log_buf_info; in wmi_log_init()
461 &wmi_handle->log_info.wmi_diag_event_log_buf_info; in wmi_log_init()
520 qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock); in wmi_log_init()
521 wmi_handle->log_info.wmi_logging_enable = 1; in wmi_log_init()
526 static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle) in wmi_log_init() argument
529 &wmi_handle->log_info.wmi_command_log_buf_info; in wmi_log_init()
531 &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info; in wmi_log_init()
534 &wmi_handle->log_info.wmi_event_log_buf_info; in wmi_log_init()
536 &wmi_handle->log_info.wmi_rx_event_log_buf_info; in wmi_log_init()
539 &wmi_handle->log_info.wmi_mgmt_command_log_buf_info; in wmi_log_init()
541 &wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info; in wmi_log_init()
543 &wmi_handle->log_info.wmi_mgmt_event_log_buf_info; in wmi_log_init()
545 &wmi_handle->log_info.wmi_diag_event_log_buf_info; in wmi_log_init()
547 wmi_handle->log_info.wmi_logging_enable = 0; in wmi_log_init()
653 qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock); in wmi_log_init()
654 wmi_handle->log_info.wmi_logging_enable = 1; in wmi_log_init()
656 wmi_filtered_logging_init(wmi_handle); in wmi_log_init()
670 static inline void wmi_log_buffer_free(struct wmi_unified *wmi_handle) in wmi_log_buffer_free() argument
672 wmi_filtered_logging_free(wmi_handle); in wmi_log_buffer_free()
674 if (wmi_handle->log_info.wmi_command_log_buf_info.buf) in wmi_log_buffer_free()
675 qdf_mem_free(wmi_handle->log_info.wmi_command_log_buf_info.buf); in wmi_log_buffer_free()
676 if (wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info.buf) in wmi_log_buffer_free()
678 wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info.buf); in wmi_log_buffer_free()
679 if (wmi_handle->log_info.wmi_event_log_buf_info.buf) in wmi_log_buffer_free()
680 qdf_mem_free(wmi_handle->log_info.wmi_event_log_buf_info.buf); in wmi_log_buffer_free()
681 if (wmi_handle->log_info.wmi_rx_event_log_buf_info.buf) in wmi_log_buffer_free()
683 wmi_handle->log_info.wmi_rx_event_log_buf_info.buf); in wmi_log_buffer_free()
684 if (wmi_handle->log_info.wmi_mgmt_command_log_buf_info.buf) in wmi_log_buffer_free()
686 wmi_handle->log_info.wmi_mgmt_command_log_buf_info.buf); in wmi_log_buffer_free()
687 if (wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info.buf) in wmi_log_buffer_free()
689 wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info.buf); in wmi_log_buffer_free()
690 if (wmi_handle->log_info.wmi_mgmt_event_log_buf_info.buf) in wmi_log_buffer_free()
692 wmi_handle->log_info.wmi_mgmt_event_log_buf_info.buf); in wmi_log_buffer_free()
693 if (wmi_handle->log_info.wmi_diag_event_log_buf_info.buf) in wmi_log_buffer_free()
695 wmi_handle->log_info.wmi_diag_event_log_buf_info.buf); in wmi_log_buffer_free()
696 wmi_handle->log_info.wmi_logging_enable = 0; in wmi_log_buffer_free()
698 qdf_spinlock_destroy(&wmi_handle->log_info.wmi_record_lock); in wmi_log_buffer_free()
701 static inline void wmi_log_buffer_free(struct wmi_unified *wmi_handle) in wmi_log_buffer_free() argument
768 wmi_dump_last_cmd_rec_info(wmi_unified_t wmi_handle) { in wmi_dump_last_cmd_rec_info() argument
774 &wmi_handle->log_info.wmi_command_log_buf_info; in wmi_dump_last_cmd_rec_info()
776 &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info; in wmi_dump_last_cmd_rec_info()
778 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_dump_last_cmd_rec_info()
797 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_dump_last_cmd_rec_info()
996 wmi_unified_t wmi_handle = (wmi_unified_t) m->private; \
998 &wmi_handle->log_info.wmi_##func_base##_buf_info;\
1003 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);\
1005 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);\
1022 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);\
1054 wmi_unified_t wmi_handle = (wmi_unified_t) m->private; \
1056 &wmi_handle->log_info.wmi_##func_base##_buf_info;\
1061 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);\
1063 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);\
1080 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);\
1132 wmi_unified_t wmi_handle = (wmi_unified_t) m->private; in debug_wmi_enable_show() local
1135 wmi_handle->log_info.wmi_logging_enable); in debug_wmi_enable_show()
1181 wmi_unified_t wmi_handle = \
1183 struct wmi_log_buf_t *wmi_log = &wmi_handle->log_info. \
1199 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);\
1204 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);\
1238 wmi_unified_t wmi_handle = in debug_wmi_enable_write() local
1253 wmi_handle->log_info.wmi_logging_enable = k; in debug_wmi_enable_write()
1350 static void wmi_debugfs_create(wmi_unified_t wmi_handle, in wmi_debugfs_create() argument
1359 wmi_handle->debugfs_de[i] = qdf_debugfs_create_entry( in wmi_debugfs_create()
1363 wmi_handle, in wmi_debugfs_create()
1366 if (!wmi_handle->debugfs_de[i]) { in wmi_debugfs_create()
1376 wmi_log_buffer_free(wmi_handle); in wmi_debugfs_create()
1386 static void wmi_debugfs_remove(wmi_unified_t wmi_handle) in wmi_debugfs_remove() argument
1389 struct dentry *dentry = wmi_handle->log_info.wmi_log_debugfs_dir; in wmi_debugfs_remove()
1393 if (wmi_handle->debugfs_de[i]) in wmi_debugfs_remove()
1394 wmi_handle->debugfs_de[i] = NULL; in wmi_debugfs_remove()
1410 static QDF_STATUS wmi_debugfs_init(wmi_unified_t wmi_handle, uint32_t pdev_idx) in wmi_debugfs_init() argument
1415 wmi_handle->soc->soc_idx, pdev_idx); in wmi_debugfs_init()
1417 wmi_handle->log_info.wmi_log_debugfs_dir = in wmi_debugfs_init()
1420 if (!wmi_handle->log_info.wmi_log_debugfs_dir) { in wmi_debugfs_init()
1424 wmi_debugfs_create(wmi_handle, in wmi_debugfs_init()
1425 wmi_handle->log_info.wmi_log_debugfs_dir); in wmi_debugfs_init()
1430 void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd, in wmi_mgmt_cmd_record() argument
1441 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_mgmt_cmd_record()
1443 WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd, (uint8_t *)data); in wmi_mgmt_cmd_record()
1444 wmi_specific_cmd_record(wmi_handle, cmd, (uint8_t *)data); in wmi_mgmt_cmd_record()
1445 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_mgmt_cmd_record()
1448 static void wmi_debugfs_remove(wmi_unified_t wmi_handle) { } in wmi_debugfs_remove() argument
1449 void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd, in wmi_mgmt_cmd_record() argument
1451 static inline void wmi_log_buffer_free(struct wmi_unified *wmi_handle) { } in wmi_log_buffer_free() argument
1452 static void wmi_minidump_detach(struct wmi_unified *wmi_handle) { } in wmi_minidump_detach() argument
1453 static void wmi_minidump_attach(struct wmi_unified *wmi_handle) { } in wmi_minidump_attach() argument
1454 static void wmi_dump_last_cmd_rec_info(wmi_unified_t wmi_handle) { } in wmi_dump_last_cmd_rec_info() argument
1467 static uint32_t wmi_ext_dbg_msg_enqueue(struct wmi_unified *wmi_handle, in wmi_ext_dbg_msg_enqueue() argument
1472 qdf_spinlock_acquire(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_enqueue()
1473 qdf_list_insert_back_size(&wmi_handle->wmi_ext_dbg_msg_queue, in wmi_ext_dbg_msg_enqueue()
1475 qdf_spinlock_release(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_enqueue()
1487 *wmi_handle) in wmi_ext_dbg_msg_dequeue() argument
1491 qdf_spinlock_acquire(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_dequeue()
1492 qdf_list_remove_front(&wmi_handle->wmi_ext_dbg_msg_queue, &list_node); in wmi_ext_dbg_msg_dequeue()
1493 qdf_spinlock_release(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_dequeue()
1510 static QDF_STATUS wmi_ext_dbg_msg_record(struct wmi_unified *wmi_handle, in wmi_ext_dbg_msg_record() argument
1525 list_size = wmi_ext_dbg_msg_enqueue(wmi_handle, msg); in wmi_ext_dbg_msg_record()
1527 if (list_size >= wmi_handle->wmi_ext_dbg_msg_queue_size) { in wmi_ext_dbg_msg_record()
1528 msg = wmi_ext_dbg_msg_dequeue(wmi_handle); in wmi_ext_dbg_msg_record()
1543 static QDF_STATUS wmi_ext_dbg_msg_cmd_record(struct wmi_unified *wmi_handle, in wmi_ext_dbg_msg_cmd_record() argument
1546 return wmi_ext_dbg_msg_record(wmi_handle, buf, len, in wmi_ext_dbg_msg_cmd_record()
1558 static QDF_STATUS wmi_ext_dbg_msg_event_record(struct wmi_unified *wmi_handle, in wmi_ext_dbg_msg_event_record() argument
1564 if (id != wmi_handle->wmi_events[wmi_diag_event_id]) in wmi_ext_dbg_msg_event_record()
1565 return wmi_ext_dbg_msg_record(wmi_handle, buf, len, in wmi_ext_dbg_msg_event_record()
1577 static void wmi_ext_dbg_msg_queue_init(struct wmi_unified *wmi_handle) in wmi_ext_dbg_msg_queue_init() argument
1579 qdf_list_create(&wmi_handle->wmi_ext_dbg_msg_queue, in wmi_ext_dbg_msg_queue_init()
1580 wmi_handle->wmi_ext_dbg_msg_queue_size); in wmi_ext_dbg_msg_queue_init()
1581 qdf_spinlock_create(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_queue_init()
1590 static void wmi_ext_dbg_msg_queue_deinit(struct wmi_unified *wmi_handle) in wmi_ext_dbg_msg_queue_deinit() argument
1592 qdf_list_destroy(&wmi_handle->wmi_ext_dbg_msg_queue); in wmi_ext_dbg_msg_queue_deinit()
1593 qdf_spinlock_destroy(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_queue_deinit()
1607 struct wmi_unified *wmi_handle = (struct wmi_unified *)arg; in wmi_ext_dbg_msg_show() local
1611 msg = wmi_ext_dbg_msg_dequeue(wmi_handle); in wmi_ext_dbg_msg_show()
1628 qdf_spinlock_acquire(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_show()
1629 qdf_list_insert_front(&wmi_handle->wmi_ext_dbg_msg_queue, in wmi_ext_dbg_msg_show()
1631 qdf_spinlock_release(&wmi_handle->wmi_ext_dbg_msg_queue_lock); in wmi_ext_dbg_msg_show()
1664 static QDF_STATUS wmi_ext_dbgfs_init(struct wmi_unified *wmi_handle, in wmi_ext_dbgfs_init() argument
1674 if (wmi_handle->soc->soc_idx == 0 && pdev_idx == 0) { in wmi_ext_dbgfs_init()
1678 wmi_handle->soc->soc_idx, pdev_idx); in wmi_ext_dbgfs_init()
1689 wmi_ext_dbgfs_ops[pdev_idx].priv = wmi_handle; in wmi_ext_dbgfs_init()
1697 wmi_handle->wmi_ext_dbg_dentry = dentry; in wmi_ext_dbgfs_init()
1698 wmi_handle->wmi_ext_dbg_msg_queue_size = WMI_EXT_DBG_QUEUE_SIZE; in wmi_ext_dbgfs_init()
1699 wmi_ext_dbg_msg_queue_init(wmi_handle); in wmi_ext_dbgfs_init()
1710 static QDF_STATUS wmi_ext_dbgfs_deinit(struct wmi_unified *wmi_handle) in wmi_ext_dbgfs_deinit() argument
1714 while ((msg = wmi_ext_dbg_msg_dequeue(wmi_handle))) in wmi_ext_dbgfs_deinit()
1717 wmi_ext_dbg_msg_queue_deinit(wmi_handle); in wmi_ext_dbgfs_deinit()
1718 qdf_debugfs_remove_dir_recursive(wmi_handle->wmi_ext_dbg_dentry); in wmi_ext_dbgfs_deinit()
1726 *wmi_handle, in wmi_ext_dbg_msg_cmd_record() argument
1733 *wmi_handle, in wmi_ext_dbg_msg_event_record() argument
1739 static inline QDF_STATUS wmi_ext_dbgfs_init(struct wmi_unified *wmi_handle, in wmi_ext_dbgfs_init() argument
1745 static inline QDF_STATUS wmi_ext_dbgfs_deinit(struct wmi_unified *wmi_handle) in wmi_ext_dbgfs_deinit() argument
1752 int wmi_get_host_credits(wmi_unified_t wmi_handle);
1757 wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint32_t len, in wmi_buf_alloc_debug() argument
1763 if (roundup(len, 4) > wmi_handle->max_msg_len) { in wmi_buf_alloc_debug()
1766 wmi_handle->max_msg_len); in wmi_buf_alloc_debug()
1771 wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, WBUFF_MAX_POOL_ID, in wmi_buf_alloc_debug()
1802 wmi_buf_t wmi_buf_alloc_fl(wmi_unified_t wmi_handle, uint32_t len, in wmi_buf_alloc_fl() argument
1807 if (roundup(len, 4) > wmi_handle->max_msg_len) { in wmi_buf_alloc_fl()
1809 len, func, line, wmi_handle->max_msg_len); in wmi_buf_alloc_fl()
1813 wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, WBUFF_MAX_POOL_ID, in wmi_buf_alloc_fl()
1846 uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle) in wmi_get_max_msg_len() argument
1848 return wmi_handle->max_msg_len - WMI_MIN_HEAD_ROOM; in wmi_get_max_msg_len()
1917 static inline void wmi_interface_sequence_reset(struct wmi_unified *wmi_handle) in wmi_interface_sequence_reset() argument
1919 wmi_handle->wmi_sequence = 0; in wmi_interface_sequence_reset()
1920 wmi_handle->wmi_exp_sequence = 0; in wmi_interface_sequence_reset()
1921 wmi_handle->wmi_sequence_stop = false; in wmi_interface_sequence_reset()
1924 static inline void wmi_interface_sequence_init(struct wmi_unified *wmi_handle) in wmi_interface_sequence_init() argument
1926 qdf_spinlock_create(&wmi_handle->wmi_seq_lock); in wmi_interface_sequence_init()
1927 wmi_interface_sequence_reset(wmi_handle); in wmi_interface_sequence_init()
1930 static inline void wmi_interface_sequence_deinit(struct wmi_unified *wmi_handle) in wmi_interface_sequence_deinit() argument
1932 qdf_spinlock_destroy(&wmi_handle->wmi_seq_lock); in wmi_interface_sequence_deinit()
1935 void wmi_interface_sequence_stop(struct wmi_unified *wmi_handle) in wmi_interface_sequence_stop() argument
1937 wmi_handle->wmi_sequence_stop = true; in wmi_interface_sequence_stop()
1940 static inline QDF_STATUS wmi_htc_send_pkt(struct wmi_unified *wmi_handle, in wmi_htc_send_pkt() argument
1947 qdf_spin_lock_bh(&wmi_handle->wmi_seq_lock); in wmi_htc_send_pkt()
1948 status = htc_send_pkt(wmi_handle->htc_handle, pkt); in wmi_htc_send_pkt()
1950 qdf_spin_unlock_bh(&wmi_handle->wmi_seq_lock); in wmi_htc_send_pkt()
1951 qdf_atomic_dec(&wmi_handle->pending_cmds); in wmi_htc_send_pkt()
1958 qdf_nbuf_set_mark(buf, wmi_handle->wmi_sequence); in wmi_htc_send_pkt()
1960 wmi_handle->wmi_sequence = (wmi_handle->wmi_sequence + 1) in wmi_htc_send_pkt()
1961 & (wmi_handle->wmi_max_cmds - 1); in wmi_htc_send_pkt()
1962 qdf_spin_unlock_bh(&wmi_handle->wmi_seq_lock); in wmi_htc_send_pkt()
1967 static inline void wmi_interface_sequence_check(struct wmi_unified *wmi_handle, in wmi_interface_sequence_check() argument
1971 if (wmi_handle->wmi_sequence_stop) in wmi_interface_sequence_check()
1974 qdf_spin_lock_bh(&wmi_handle->wmi_seq_lock); in wmi_interface_sequence_check()
1976 if (qdf_nbuf_get_mark(buf) != wmi_handle->wmi_exp_sequence) { in wmi_interface_sequence_check()
1977 qdf_spin_unlock_bh(&wmi_handle->wmi_seq_lock); in wmi_interface_sequence_check()
1980 wmi_handle->wmi_exp_sequence, in wmi_interface_sequence_check()
1983 qdf_trigger_self_recovery(wmi_handle->soc, in wmi_interface_sequence_check()
1987 wmi_handle->wmi_exp_sequence = in wmi_interface_sequence_check()
1988 (wmi_handle->wmi_exp_sequence + 1) in wmi_interface_sequence_check()
1989 & (wmi_handle->wmi_max_cmds - 1); in wmi_interface_sequence_check()
1990 qdf_spin_unlock_bh(&wmi_handle->wmi_seq_lock); in wmi_interface_sequence_check()
1994 static inline void wmi_interface_sequence_reset(struct wmi_unified *wmi_handle) in wmi_interface_sequence_reset() argument
1998 static inline void wmi_interface_sequence_init(struct wmi_unified *wmi_handle) in wmi_interface_sequence_init() argument
2002 static inline void wmi_interface_sequence_deinit(struct wmi_unified *wmi_handle) in wmi_interface_sequence_deinit() argument
2006 void wmi_interface_sequence_stop(struct wmi_unified *wmi_handle) in wmi_interface_sequence_stop() argument
2010 static inline QDF_STATUS wmi_htc_send_pkt(struct wmi_unified *wmi_handle, in wmi_htc_send_pkt() argument
2016 status = htc_send_pkt(wmi_handle->htc_handle, pkt); in wmi_htc_send_pkt()
2018 qdf_atomic_dec(&wmi_handle->pending_cmds); in wmi_htc_send_pkt()
2028 static inline void wmi_interface_sequence_check(struct wmi_unified *wmi_handle, in wmi_interface_sequence_check() argument
2034 static inline void wmi_unified_debug_dump(wmi_unified_t wmi_handle) in wmi_unified_debug_dump() argument
2037 wmi_handle->wmi_endpoint_id, in wmi_unified_debug_dump()
2038 htc_get_tx_queue_depth(wmi_handle->htc_handle, in wmi_unified_debug_dump()
2039 wmi_handle->wmi_endpoint_id), in wmi_unified_debug_dump()
2040 wmi_handle->soc->soc_idx, in wmi_unified_debug_dump()
2041 (wmi_handle->target_type == in wmi_unified_debug_dump()
2096 wmi_unified_is_max_pending_commands_reached(wmi_unified_t wmi_handle) in wmi_unified_is_max_pending_commands_reached() argument
2101 wmi_handle->soc->wmi_psoc); in wmi_unified_is_max_pending_commands_reached()
2107 return ((qdf_atomic_read(&wmi_handle->pending_cmds) >= in wmi_unified_is_max_pending_commands_reached()
2108 wmi_handle->wmi_max_cmds) && in wmi_unified_is_max_pending_commands_reached()
2113 wmi_unified_is_max_pending_commands_reached(wmi_unified_t wmi_handle) in wmi_unified_is_max_pending_commands_reached() argument
2115 return (qdf_atomic_read(&wmi_handle->pending_cmds) >= in wmi_unified_is_max_pending_commands_reached()
2116 wmi_handle->wmi_max_cmds); in wmi_unified_is_max_pending_commands_reached()
2120 QDF_STATUS wmi_unified_cmd_send_fl(wmi_unified_t wmi_handle, wmi_buf_t buf, in wmi_unified_cmd_send_fl() argument
2128 rtpm_inprogress = wmi_get_runtime_pm_inprogress(wmi_handle); in wmi_unified_cmd_send_fl()
2130 htc_tag = wmi_handle->ops->wmi_set_htc_tx_tag(wmi_handle, buf, in wmi_unified_cmd_send_fl()
2132 } else if (qdf_atomic_read(&wmi_handle->is_target_suspended) && in wmi_unified_cmd_send_fl()
2140 if (wmi_handle->wmi_stopinprogress) { in wmi_unified_cmd_send_fl()
2142 func, line, wmi_handle); in wmi_unified_cmd_send_fl()
2146 if (wmi_has_wow_enable_ack_failed(wmi_handle)) { in wmi_unified_cmd_send_fl()
2154 if (wmi_handle->target_type == WMI_TLV_TARGET) { in wmi_unified_cmd_send_fl()
2157 if (wmi_handle->ops->wmi_check_command_params(NULL, buf_ptr, len, cmd_id) in wmi_unified_cmd_send_fl()
2175 qdf_atomic_inc(&wmi_handle->pending_cmds); in wmi_unified_cmd_send_fl()
2176 if (wmi_unified_is_max_pending_commands_reached(wmi_handle)) { in wmi_unified_cmd_send_fl()
2177 wmi_dump_last_cmd_rec_info(wmi_handle); in wmi_unified_cmd_send_fl()
2179 wmi_get_host_credits(wmi_handle)); in wmi_unified_cmd_send_fl()
2180 htc_dump_counter_info(wmi_handle->htc_handle); in wmi_unified_cmd_send_fl()
2181 qdf_atomic_dec(&wmi_handle->pending_cmds); in wmi_unified_cmd_send_fl()
2183 func, line, wmi_handle->wmi_max_cmds); in wmi_unified_cmd_send_fl()
2184 wmi_unified_debug_dump(wmi_handle); in wmi_unified_cmd_send_fl()
2185 htc_ce_tasklet_debug_dump(wmi_handle->htc_handle); in wmi_unified_cmd_send_fl()
2186 qdf_trigger_self_recovery(wmi_handle->soc->wmi_psoc, in wmi_unified_cmd_send_fl()
2193 qdf_atomic_dec(&wmi_handle->pending_cmds); in wmi_unified_cmd_send_fl()
2203 wmi_handle->wmi_endpoint_id, htc_tag); in wmi_unified_cmd_send_fl()
2207 wmi_ext_dbg_msg_cmd_record(wmi_handle, in wmi_unified_cmd_send_fl()
2210 if (wmi_handle->log_info.wmi_logging_enable) { in wmi_unified_cmd_send_fl()
2211 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_unified_cmd_send_fl()
2218 if (wmi_handle->ops->is_management_record(cmd_id) == false) { in wmi_unified_cmd_send_fl()
2220 wmi_handle->soc->buf_offset_command; in wmi_unified_cmd_send_fl()
2222 WMI_COMMAND_RECORD(wmi_handle, cmd_id, tmpbuf); in wmi_unified_cmd_send_fl()
2223 wmi_specific_cmd_record(wmi_handle, cmd_id, tmpbuf); in wmi_unified_cmd_send_fl()
2226 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_unified_cmd_send_fl()
2229 return wmi_htc_send_pkt(wmi_handle, pkt, func, line); in wmi_unified_cmd_send_fl()
2240 static int wmi_unified_get_event_handler_ix(wmi_unified_t wmi_handle, in wmi_unified_get_event_handler_ix() argument
2245 struct wmi_soc *soc = wmi_handle->soc; in wmi_unified_get_event_handler_ix()
2249 if (wmi_handle->event_id[idx] == event_id && in wmi_unified_get_event_handler_ix()
2250 wmi_handle->event_handler[idx]) { in wmi_unified_get_event_handler_ix()
2270 wmi_register_event_handler_with_ctx(wmi_unified_t wmi_handle, in wmi_register_event_handler_with_ctx() argument
2280 if (!wmi_handle) { in wmi_register_event_handler_with_ctx()
2285 soc = wmi_handle->soc; in wmi_register_event_handler_with_ctx()
2294 if (wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) { in wmi_register_event_handler_with_ctx()
2300 evt_id = wmi_handle->wmi_events[event_id]; in wmi_register_event_handler_with_ctx()
2302 if (wmi_unified_get_event_handler_ix(wmi_handle, evt_id) != -1) { in wmi_register_event_handler_with_ctx()
2314 wmi_handle->event_handler[idx] = handler_func; in wmi_register_event_handler_with_ctx()
2315 wmi_handle->event_id[idx] = evt_id; in wmi_register_event_handler_with_ctx()
2318 wmi_handle->ctx[idx].exec_ctx = rx_ctx; in wmi_register_event_handler_with_ctx()
2319 wmi_handle->ctx[idx].buff_type = rx_buf_type; in wmi_register_event_handler_with_ctx()
2327 wmi_unified_register_event(wmi_unified_t wmi_handle, in wmi_unified_register_event() argument
2331 return wmi_register_event_handler_with_ctx(wmi_handle, event_id, in wmi_unified_register_event()
2338 wmi_unified_register_event_handler(wmi_unified_t wmi_handle, in wmi_unified_register_event_handler() argument
2343 return wmi_register_event_handler_with_ctx(wmi_handle, event_id, in wmi_unified_register_event_handler()
2351 wmi_unified_register_raw_event_handler(wmi_unified_t wmi_handle, in wmi_unified_register_raw_event_handler() argument
2356 return wmi_register_event_handler_with_ctx(wmi_handle, event_id, in wmi_unified_register_raw_event_handler()
2363 QDF_STATUS wmi_unified_unregister_event(wmi_unified_t wmi_handle, in wmi_unified_unregister_event() argument
2370 if (!wmi_handle) { in wmi_unified_unregister_event()
2375 soc = wmi_handle->soc; in wmi_unified_unregister_event()
2377 wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) { in wmi_unified_unregister_event()
2383 evt_id = wmi_handle->wmi_events[event_id]; in wmi_unified_unregister_event()
2385 idx = wmi_unified_get_event_handler_ix(wmi_handle, evt_id); in wmi_unified_unregister_event()
2391 wmi_handle->event_handler[idx] = NULL; in wmi_unified_unregister_event()
2392 wmi_handle->event_id[idx] = 0; in wmi_unified_unregister_event()
2394 wmi_handle->event_handler[idx] = in wmi_unified_unregister_event()
2395 wmi_handle->event_handler[soc->max_event_idx]; in wmi_unified_unregister_event()
2396 wmi_handle->event_id[idx] = in wmi_unified_unregister_event()
2397 wmi_handle->event_id[soc->max_event_idx]; in wmi_unified_unregister_event()
2401 wmi_handle->ctx[idx].exec_ctx = in wmi_unified_unregister_event()
2402 wmi_handle->ctx[soc->max_event_idx].exec_ctx; in wmi_unified_unregister_event()
2403 wmi_handle->ctx[idx].buff_type = in wmi_unified_unregister_event()
2404 wmi_handle->ctx[soc->max_event_idx].buff_type; in wmi_unified_unregister_event()
2411 QDF_STATUS wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle, in wmi_unified_unregister_event_handler() argument
2418 if (!wmi_handle) { in wmi_unified_unregister_event_handler()
2423 soc = wmi_handle->soc; in wmi_unified_unregister_event_handler()
2430 if (wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) { in wmi_unified_unregister_event_handler()
2435 evt_id = wmi_handle->wmi_events[event_id]; in wmi_unified_unregister_event_handler()
2437 idx = wmi_unified_get_event_handler_ix(wmi_handle, evt_id); in wmi_unified_unregister_event_handler()
2443 wmi_handle->event_handler[idx] = NULL; in wmi_unified_unregister_event_handler()
2444 wmi_handle->event_id[idx] = 0; in wmi_unified_unregister_event_handler()
2446 wmi_handle->event_handler[idx] = in wmi_unified_unregister_event_handler()
2447 wmi_handle->event_handler[soc->max_event_idx]; in wmi_unified_unregister_event_handler()
2448 wmi_handle->event_id[idx] = in wmi_unified_unregister_event_handler()
2449 wmi_handle->event_id[soc->max_event_idx]; in wmi_unified_unregister_event_handler()
2453 wmi_handle->ctx[idx].exec_ctx = in wmi_unified_unregister_event_handler()
2454 wmi_handle->ctx[soc->max_event_idx].exec_ctx; in wmi_unified_unregister_event_handler()
2455 wmi_handle->ctx[idx].buff_type = in wmi_unified_unregister_event_handler()
2456 wmi_handle->ctx[soc->max_event_idx].buff_type; in wmi_unified_unregister_event_handler()
2465 wmi_process_rx_diag_event_worker_thread_ctx(struct wmi_unified *wmi_handle, in wmi_process_rx_diag_event_worker_thread_ctx() argument
2470 qdf_spin_lock_bh(&wmi_handle->diag_eventq_lock); in wmi_process_rx_diag_event_worker_thread_ctx()
2473 &wmi_handle->diag_event_queue); in wmi_process_rx_diag_event_worker_thread_ctx()
2476 qdf_spin_unlock_bh(&wmi_handle->diag_eventq_lock); in wmi_process_rx_diag_event_worker_thread_ctx()
2477 wmi_handle->wmi_rx_diag_events_dropped++; in wmi_process_rx_diag_event_worker_thread_ctx()
2479 wmi_handle->wmi_rx_diag_events_dropped); in wmi_process_rx_diag_event_worker_thread_ctx()
2485 qdf_nbuf_queue_add(&wmi_handle->diag_event_queue, evt_buf); in wmi_process_rx_diag_event_worker_thread_ctx()
2486 qdf_spin_unlock_bh(&wmi_handle->diag_eventq_lock); in wmi_process_rx_diag_event_worker_thread_ctx()
2487 qdf_queue_work(0, wmi_handle->wmi_rx_diag_work_queue, in wmi_process_rx_diag_event_worker_thread_ctx()
2488 &wmi_handle->rx_diag_event_work); in wmi_process_rx_diag_event_worker_thread_ctx()
2491 void wmi_process_fw_event_worker_thread_ctx(struct wmi_unified *wmi_handle, in wmi_process_fw_event_worker_thread_ctx() argument
2495 qdf_spin_lock_bh(&wmi_handle->eventq_lock); in wmi_process_fw_event_worker_thread_ctx()
2496 qdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf); in wmi_process_fw_event_worker_thread_ctx()
2497 qdf_spin_unlock_bh(&wmi_handle->eventq_lock); in wmi_process_fw_event_worker_thread_ctx()
2498 qdf_queue_work(0, wmi_handle->wmi_rx_work_queue, in wmi_process_fw_event_worker_thread_ctx()
2499 &wmi_handle->rx_event_work); in wmi_process_fw_event_worker_thread_ctx()
2512 wmi_is_event_critical(struct wmi_unified *wmi_handle, uint32_t event_id) in wmi_is_event_critical() argument
2514 if (wmi_handle->wmi_events[wmi_roam_synch_event_id] == event_id) in wmi_is_event_critical()
2541 struct wmi_unified *wmi_handle; in wmi_process_fw_event_handler() local
2544 wmi_handle = (struct wmi_unified *)params->wmi_handle; in wmi_process_fw_event_handler()
2547 wmi_process_fw_event(wmi_handle, params->evt_buf); in wmi_process_fw_event_handler()
2549 if (wmi_is_event_critical(wmi_handle, event_id)) in wmi_process_fw_event_handler()
2550 qdf_atomic_dec(&wmi_handle->critical_events_in_flight); in wmi_process_fw_event_handler()
2580 params_buf->wmi_handle = wmi; in wmi_process_fw_event_sched_thread_ctx()
2675 static void wmi_process_control_rx(struct wmi_unified *wmi_handle, in wmi_process_control_rx() argument
2678 struct wmi_soc *soc = wmi_handle->soc; in wmi_process_control_rx()
2684 idx = wmi_unified_get_event_handler_ix(wmi_handle, id); in wmi_process_control_rx()
2692 exec_ctx = wmi_handle->ctx[idx].exec_ctx; in wmi_process_control_rx()
2696 if (wmi_handle->log_info.wmi_logging_enable) { in wmi_process_control_rx()
2700 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_process_control_rx()
2702 if (wmi_handle->ops->is_diag_event(id)) { in wmi_process_control_rx()
2703 WMI_DIAG_RX_EVENT_RECORD(wmi_handle, id, in wmi_process_control_rx()
2705 wmi_handle->soc->buf_offset_event)); in wmi_process_control_rx()
2706 } else if (wmi_handle->ops->is_management_record(id)) { in wmi_process_control_rx()
2707 WMI_MGMT_RX_EVENT_RECORD(wmi_handle, id, in wmi_process_control_rx()
2709 wmi_handle->soc->buf_offset_event)); in wmi_process_control_rx()
2711 WMI_RX_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data + in wmi_process_control_rx()
2712 wmi_handle->soc->buf_offset_event)); in wmi_process_control_rx()
2714 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); in wmi_process_control_rx()
2719 wmi_process_fw_event_worker_thread_ctx(wmi_handle, evt_buf); in wmi_process_control_rx()
2721 wmi_process_fw_event(wmi_handle, evt_buf); in wmi_process_control_rx()
2723 wmi_process_fw_event_sched_thread_ctx(wmi_handle, evt_buf); in wmi_process_control_rx()
2725 wmi_process_rx_diag_event_worker_thread_ctx(wmi_handle, in wmi_process_control_rx()
2744 struct wmi_unified *wmi_handle; in wmi_control_rx() local
2749 wmi_handle = wmi_get_pdev_ep(soc, htc_packet->Endpoint); in wmi_control_rx()
2750 if (!wmi_handle) { in wmi_control_rx()
2757 wmi_process_control_rx(wmi_handle, evt_buf); in wmi_control_rx()
2772 struct wmi_unified *wmi_handle; in wmi_control_diag_rx() local
2777 wmi_handle = soc->wmi_pdev[0]; in wmi_control_diag_rx()
2779 if (!wmi_handle) { in wmi_control_diag_rx()
2785 wmi_process_control_rx(wmi_handle, evt_buf); in wmi_control_diag_rx()
2800 struct wmi_unified *wmi_handle; in wmi_control_dbr_rx() local
2804 wmi_handle = soc->wmi_pdev[0]; in wmi_control_dbr_rx()
2806 if (!wmi_handle) { in wmi_control_dbr_rx()
2813 wmi_process_control_rx(wmi_handle, evt_buf); in wmi_control_dbr_rx()
2818 QDF_STATUS wmi_unified_cmd_send_over_qmi(struct wmi_unified *wmi_handle, in wmi_unified_cmd_send_over_qmi() argument
2835 wmi_handle, in wmi_unified_cmd_send_over_qmi()
2841 ret = qdf_atomic_inc_return(&wmi_handle->num_stats_over_qmi); in wmi_unified_cmd_send_over_qmi()
2851 struct wmi_unified *wmi_handle = wmi_cb_ctx; in __wmi_process_qmi_fw_event() local
2855 if (!wmi_handle || !buf || !len) { in __wmi_process_qmi_fw_event()
2856 wmi_err_rl("%s is invalid", !wmi_handle ? in __wmi_process_qmi_fw_event()
2861 evt_buf = wmi_buf_alloc(wmi_handle, len); in __wmi_process_qmi_fw_event()
2868 wmi_process_control_rx(wmi_handle, evt_buf); in __wmi_process_qmi_fw_event()
2887 void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) in wmi_process_fw_event() argument
2889 __wmi_control_rx(wmi_handle, evt_buf); in wmi_process_fw_event()
2892 void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) in __wmi_control_rx() argument
2907 wmi_ext_dbg_msg_event_record(wmi_handle, qdf_nbuf_data(evt_buf), in __wmi_control_rx()
2917 if (wmi_handle->target_type == WMI_TLV_TARGET) { in __wmi_control_rx()
2920 wmi_handle->ops->wmi_check_and_pad_event(wmi_handle->scn_handle, in __wmi_control_rx()
2932 idx = wmi_unified_get_event_handler_ix(wmi_handle, id); in __wmi_control_rx()
2940 if (wmi_handle->log_info.wmi_logging_enable) { in __wmi_control_rx()
2941 qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); in __wmi_control_rx()
2943 if (wmi_handle->ops->is_diag_event(id)) { in __wmi_control_rx()
2948 } else if (wmi_handle->ops->is_management_record(id)) { in __wmi_control_rx()
2955 wmi_handle->soc->buf_offset_event; in __wmi_control_rx()
2957 WMI_EVENT_RECORD(wmi_handle, id, tmpbuf); in __wmi_control_rx()
2958 wmi_specific_evt_record(wmi_handle, id, tmpbuf); in __wmi_control_rx()
2960 qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); in __wmi_control_rx()
2964 if (wmi_handle->target_type == WMI_TLV_TARGET) { in __wmi_control_rx()
2965 ev_buff_type = wmi_handle->ctx[idx].buff_type; in __wmi_control_rx()
2967 if (qdf_likely(wmi_handle->event_handler[idx])) in __wmi_control_rx()
2968 wmi_handle->event_handler[idx] (wmi_handle->scn_handle, in __wmi_control_rx()
2973 wmi_handle->event_handler[idx] (wmi_handle->scn_handle, in __wmi_control_rx()
2978 wmi_handle->event_handler[idx] (wmi_handle->scn_handle, in __wmi_control_rx()
2984 if (wmi_handle->target_type == WMI_TLV_TARGET) in __wmi_control_rx()
2985 wmi_handle->ops->wmi_free_allocated_event(id, &wmi_cmd_struct_ptr); in __wmi_control_rx()
3115 static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle) in wmi_runtime_pm_init() argument
3117 qdf_atomic_init(&wmi_handle->runtime_pm_inprogress); in wmi_runtime_pm_init()
3120 void wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, A_BOOL val) in wmi_set_runtime_pm_inprogress() argument
3122 qdf_atomic_set(&wmi_handle->runtime_pm_inprogress, val); in wmi_set_runtime_pm_inprogress()
3125 bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle) in wmi_get_runtime_pm_inprogress() argument
3127 return qdf_atomic_read(&wmi_handle->runtime_pm_inprogress); in wmi_get_runtime_pm_inprogress()
3130 static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle) in wmi_runtime_pm_init() argument
3135 void wmi_set_wow_enable_ack_failed(wmi_unified_t wmi_handle) in wmi_set_wow_enable_ack_failed() argument
3137 qdf_atomic_set(&wmi_handle->is_wow_enable_ack_failed, 1); in wmi_set_wow_enable_ack_failed()
3140 void wmi_clear_wow_enable_ack_failed(wmi_unified_t wmi_handle) in wmi_clear_wow_enable_ack_failed() argument
3142 qdf_atomic_set(&wmi_handle->is_wow_enable_ack_failed, 0); in wmi_clear_wow_enable_ack_failed()
3145 bool wmi_has_wow_enable_ack_failed(wmi_unified_t wmi_handle) in wmi_has_wow_enable_ack_failed() argument
3147 return qdf_atomic_read(&wmi_handle->is_wow_enable_ack_failed); in wmi_has_wow_enable_ack_failed()
3150 void *wmi_unified_get_soc_handle(struct wmi_unified *wmi_handle) in wmi_unified_get_soc_handle() argument
3152 return wmi_handle->soc; in wmi_unified_get_soc_handle()
3163 static inline void wmi_interface_logging_init(struct wmi_unified *wmi_handle, in wmi_interface_logging_init() argument
3166 if (QDF_STATUS_SUCCESS == wmi_log_init(wmi_handle)) { in wmi_interface_logging_init()
3167 qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock); in wmi_interface_logging_init()
3168 wmi_debugfs_init(wmi_handle, pdev_idx); in wmi_interface_logging_init()
3172 static inline void wmi_interface_logging_init(struct wmi_unified *wmi_handle, in wmi_interface_logging_init() argument
3178 static QDF_STATUS wmi_initialize_worker_context(struct wmi_unified *wmi_handle) in wmi_initialize_worker_context() argument
3180 wmi_handle->wmi_rx_work_queue = in wmi_initialize_worker_context()
3182 if (!wmi_handle->wmi_rx_work_queue) { in wmi_initialize_worker_context()
3187 qdf_spinlock_create(&wmi_handle->eventq_lock); in wmi_initialize_worker_context()
3188 qdf_nbuf_queue_init(&wmi_handle->event_queue); in wmi_initialize_worker_context()
3189 qdf_create_work(0, &wmi_handle->rx_event_work, in wmi_initialize_worker_context()
3190 wmi_rx_event_work, wmi_handle); in wmi_initialize_worker_context()
3192 wmi_handle->wmi_rx_diag_work_queue = in wmi_initialize_worker_context()
3194 if (!wmi_handle->wmi_rx_diag_work_queue) { in wmi_initialize_worker_context()
3198 qdf_spinlock_create(&wmi_handle->diag_eventq_lock); in wmi_initialize_worker_context()
3199 qdf_nbuf_queue_init(&wmi_handle->diag_event_queue); in wmi_initialize_worker_context()
3200 qdf_create_work(0, &wmi_handle->rx_diag_event_work, in wmi_initialize_worker_context()
3201 wmi_rx_diag_event_work, wmi_handle); in wmi_initialize_worker_context()
3202 wmi_handle->wmi_rx_diag_events_dropped = 0; in wmi_initialize_worker_context()
3209 struct wmi_unified *wmi_handle; in wmi_unified_get_pdev_handle() local
3216 wmi_handle = in wmi_unified_get_pdev_handle()
3219 if (!wmi_handle) in wmi_unified_get_pdev_handle()
3222 status = wmi_initialize_worker_context(wmi_handle); in wmi_unified_get_pdev_handle()
3226 wmi_handle->scn_handle = soc->scn_handle; in wmi_unified_get_pdev_handle()
3227 wmi_handle->event_id = soc->event_id; in wmi_unified_get_pdev_handle()
3228 wmi_handle->event_handler = soc->event_handler; in wmi_unified_get_pdev_handle()
3229 wmi_handle->ctx = soc->ctx; in wmi_unified_get_pdev_handle()
3230 wmi_handle->ops = soc->ops; in wmi_unified_get_pdev_handle()
3231 wmi_handle->wmi_events = soc->wmi_events; in wmi_unified_get_pdev_handle()
3232 wmi_handle->services = soc->services; in wmi_unified_get_pdev_handle()
3233 wmi_handle->soc = soc; in wmi_unified_get_pdev_handle()
3234 wmi_handle->cmd_pdev_id_map = soc->cmd_pdev_id_map; in wmi_unified_get_pdev_handle()
3235 wmi_handle->evt_pdev_id_map = soc->evt_pdev_id_map; in wmi_unified_get_pdev_handle()
3236 wmi_handle->cmd_phy_id_map = soc->cmd_phy_id_map; in wmi_unified_get_pdev_handle()
3237 wmi_handle->evt_phy_id_map = soc->evt_phy_id_map; in wmi_unified_get_pdev_handle()
3238 wmi_interface_logging_init(wmi_handle, pdev_idx); in wmi_unified_get_pdev_handle()
3239 qdf_atomic_init(&wmi_handle->is_target_suspended); in wmi_unified_get_pdev_handle()
3240 qdf_atomic_init(&wmi_handle->is_wow_enable_ack_failed); in wmi_unified_get_pdev_handle()
3241 wmi_handle->target_type = soc->target_type; in wmi_unified_get_pdev_handle()
3242 wmi_handle->wmi_max_cmds = soc->wmi_max_cmds; in wmi_unified_get_pdev_handle()
3244 wmi_interface_sequence_init(wmi_handle); in wmi_unified_get_pdev_handle()
3245 if (wmi_ext_dbgfs_init(wmi_handle, pdev_idx) != in wmi_unified_get_pdev_handle()
3249 soc->wmi_pdev[pdev_idx] = wmi_handle; in wmi_unified_get_pdev_handle()
3251 wmi_handle = soc->wmi_pdev[pdev_idx]; in wmi_unified_get_pdev_handle()
3253 qdf_atomic_init(&wmi_handle->pending_cmds); in wmi_unified_get_pdev_handle()
3254 wmi_handle->wmi_stopinprogress = 0; in wmi_unified_get_pdev_handle()
3255 wmi_handle->wmi_endpoint_id = soc->wmi_endpoint_id[pdev_idx]; in wmi_unified_get_pdev_handle()
3256 wmi_handle->htc_handle = soc->htc_handle; in wmi_unified_get_pdev_handle()
3257 wmi_handle->max_msg_len = soc->max_msg_len[pdev_idx]; in wmi_unified_get_pdev_handle()
3258 wmi_handle->tag_crash_inject = false; in wmi_unified_get_pdev_handle()
3259 wmi_interface_sequence_reset(wmi_handle); in wmi_unified_get_pdev_handle()
3261 return wmi_handle; in wmi_unified_get_pdev_handle()
3264 qdf_mem_free(wmi_handle); in wmi_unified_get_pdev_handle()
3273 void (*wmi_attach)(wmi_unified_t wmi_handle)) in wmi_unified_register_module() argument
3288 static void wmi_wbuff_register(struct wmi_unified *wmi_handle) in wmi_wbuff_register() argument
3309 wmi_handle->wbuff_handle = in wmi_wbuff_register()
3320 static inline void wmi_wbuff_deregister(struct wmi_unified *wmi_handle) in wmi_wbuff_deregister() argument
3322 wbuff_module_deregister(wmi_handle->wbuff_handle); in wmi_wbuff_deregister()
3323 wmi_handle->wbuff_handle = NULL; in wmi_wbuff_deregister()
3329 struct wmi_unified *wmi_handle; in wmi_unified_attach() local
3337 wmi_handle = in wmi_unified_attach()
3340 if (!wmi_handle) { in wmi_unified_attach()
3345 status = wmi_initialize_worker_context(wmi_handle); in wmi_unified_attach()
3349 wmi_handle->soc = soc; in wmi_unified_attach()
3350 wmi_handle->soc->soc_idx = param->soc_id; in wmi_unified_attach()
3351 wmi_handle->soc->is_async_ep = param->is_async_ep; in wmi_unified_attach()
3352 wmi_handle->event_id = soc->event_id; in wmi_unified_attach()
3353 wmi_handle->event_handler = soc->event_handler; in wmi_unified_attach()
3354 wmi_handle->ctx = soc->ctx; in wmi_unified_attach()
3355 wmi_handle->wmi_events = soc->wmi_events; in wmi_unified_attach()
3356 wmi_handle->services = soc->services; in wmi_unified_attach()
3357 wmi_handle->scn_handle = scn_handle; in wmi_unified_attach()
3358 wmi_handle->cmd_pdev_id_map = soc->cmd_pdev_id_map; in wmi_unified_attach()
3359 wmi_handle->evt_pdev_id_map = soc->evt_pdev_id_map; in wmi_unified_attach()
3360 wmi_handle->cmd_phy_id_map = soc->cmd_phy_id_map; in wmi_unified_attach()
3361 wmi_handle->evt_phy_id_map = soc->evt_phy_id_map; in wmi_unified_attach()
3363 wmi_handle->target_type = param->target_type; in wmi_unified_attach()
3370 wmi_attach_register[param->target_type](wmi_handle); in wmi_unified_attach()
3376 qdf_atomic_init(&wmi_handle->pending_cmds); in wmi_unified_attach()
3377 qdf_atomic_init(&wmi_handle->is_target_suspended); in wmi_unified_attach()
3378 qdf_atomic_init(&wmi_handle->is_target_suspend_acked); in wmi_unified_attach()
3379 qdf_atomic_init(&wmi_handle->num_stats_over_qmi); in wmi_unified_attach()
3380 qdf_atomic_init(&wmi_handle->is_wow_enable_ack_failed); in wmi_unified_attach()
3381 wmi_runtime_pm_init(wmi_handle); in wmi_unified_attach()
3382 wmi_interface_logging_init(wmi_handle, WMI_HOST_PDEV_ID_0); in wmi_unified_attach()
3384 wmi_interface_sequence_init(wmi_handle); in wmi_unified_attach()
3386 wmi_handle->use_cookie = param->use_cookie; in wmi_unified_attach()
3387 wmi_handle->osdev = param->osdev; in wmi_unified_attach()
3388 wmi_handle->wmi_stopinprogress = 0; in wmi_unified_attach()
3389 wmi_handle->wmi_max_cmds = param->max_commands; in wmi_unified_attach()
3394 soc->ops = wmi_handle->ops; in wmi_unified_attach()
3395 soc->wmi_pdev[0] = wmi_handle; in wmi_unified_attach()
3396 if (wmi_ext_dbgfs_init(wmi_handle, 0) != QDF_STATUS_SUCCESS) in wmi_unified_attach()
3399 wmi_wbuff_register(wmi_handle); in wmi_unified_attach()
3401 wmi_hang_event_notifier_register(wmi_handle); in wmi_unified_attach()
3403 wmi_minidump_attach(wmi_handle); in wmi_unified_attach()
3405 return wmi_handle; in wmi_unified_attach()
3409 qdf_mem_free(wmi_handle); in wmi_unified_attach()
3414 void wmi_unified_detach(struct wmi_unified *wmi_handle) in wmi_unified_detach() argument
3420 wmi_minidump_detach(wmi_handle); in wmi_unified_detach()
3424 wmi_wbuff_deregister(wmi_handle); in wmi_unified_detach()
3426 soc = wmi_handle->soc; in wmi_unified_detach()
3495 wmi_unified_remove_work(struct wmi_unified *wmi_handle) in wmi_unified_remove_work() argument
3499 qdf_flush_workqueue(0, wmi_handle->wmi_rx_work_queue); in wmi_unified_remove_work()
3500 qdf_spin_lock_bh(&wmi_handle->eventq_lock); in wmi_unified_remove_work()
3501 buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); in wmi_unified_remove_work()
3504 buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); in wmi_unified_remove_work()
3506 qdf_spin_unlock_bh(&wmi_handle->eventq_lock); in wmi_unified_remove_work()
3509 qdf_flush_workqueue(0, wmi_handle->wmi_rx_diag_work_queue); in wmi_unified_remove_work()
3510 qdf_spin_lock_bh(&wmi_handle->diag_eventq_lock); in wmi_unified_remove_work()
3511 buf = qdf_nbuf_queue_remove(&wmi_handle->diag_event_queue); in wmi_unified_remove_work()
3514 buf = qdf_nbuf_queue_remove(&wmi_handle->diag_event_queue); in wmi_unified_remove_work()
3516 qdf_spin_unlock_bh(&wmi_handle->diag_eventq_lock); in wmi_unified_remove_work()
3533 struct wmi_unified *wmi_handle; in wmi_htc_tx_complete() local
3543 wmi_handle = wmi_get_pdev_ep(soc, htc_pkt->Endpoint); in wmi_htc_tx_complete()
3544 if (!wmi_handle) { in wmi_htc_tx_complete()
3551 log_info = &wmi_handle->log_info; in wmi_htc_tx_complete()
3553 if (wmi_handle && log_info->wmi_logging_enable) { in wmi_htc_tx_complete()
3564 offset_ptr = buf_ptr + wmi_handle->soc->buf_offset_command; in wmi_htc_tx_complete()
3565 if (wmi_handle->ops->is_management_record(cmd_id)) { in wmi_htc_tx_complete()
3566 WMI_MGMT_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id, in wmi_htc_tx_complete()
3569 if (wmi_handle->ops->is_force_fw_hang_cmd(cmd_id)) { in wmi_htc_tx_complete()
3574 WMI_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id, in wmi_htc_tx_complete()
3583 wmi_interface_sequence_check(wmi_handle, wmi_cmd_buf); in wmi_htc_tx_complete()
3589 qdf_atomic_dec(&wmi_handle->pending_cmds); in wmi_htc_tx_complete()
3670 wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle, in wmi_unified_connect_htc_service() argument
3676 wmi_handle->soc->htc_handle = htc_handle; in wmi_unified_connect_htc_service()
3683 wmi_connect_pdev_htc_service(wmi_handle->soc, i); in wmi_unified_connect_htc_service()
3685 wmi_handle->htc_handle = htc_handle; in wmi_unified_connect_htc_service()
3686 wmi_handle->wmi_endpoint_id = wmi_handle->soc->wmi_endpoint_id[0]; in wmi_unified_connect_htc_service()
3687 wmi_handle->max_msg_len = wmi_handle->soc->max_msg_len[0]; in wmi_unified_connect_htc_service()
3694 QDF_STATUS wmi_diag_connect_pdev_htc_service(struct wmi_unified *wmi_handle, in wmi_diag_connect_pdev_htc_service() argument
3704 connect.EpCallbacks.pContext = wmi_handle->soc; in wmi_diag_connect_pdev_htc_service()
3722 if (wmi_handle->soc->is_async_ep) in wmi_diag_connect_pdev_htc_service()
3725 wmi_handle->soc->wmi_diag_endpoint_id = response.Endpoint; in wmi_diag_connect_pdev_htc_service()
3732 QDF_STATUS wmi_dbr_connect_pdev_htc_service(struct wmi_unified *wmi_handle, in wmi_dbr_connect_pdev_htc_service() argument
3742 connect.EpCallbacks.pContext = wmi_handle->soc; in wmi_dbr_connect_pdev_htc_service()
3760 if (wmi_handle->soc->is_async_ep) in wmi_dbr_connect_pdev_htc_service()
3763 wmi_handle->soc->wmi_dbr_endpoint_id = response.Endpoint; in wmi_dbr_connect_pdev_htc_service()
3769 int wmi_get_host_credits(wmi_unified_t wmi_handle) in wmi_get_host_credits() argument
3773 htc_get_control_endpoint_tx_host_credits(wmi_handle->htc_handle, in wmi_get_host_credits()
3778 int wmi_get_pending_cmds(wmi_unified_t wmi_handle) in wmi_get_pending_cmds() argument
3780 return qdf_atomic_read(&wmi_handle->pending_cmds); in wmi_get_pending_cmds()
3783 void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val) in wmi_set_target_suspend() argument
3785 qdf_atomic_set(&wmi_handle->is_target_suspended, val); in wmi_set_target_suspend()
3788 void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, A_BOOL val) in wmi_set_target_suspend_acked() argument
3790 qdf_atomic_set(&wmi_handle->is_target_suspend_acked, val); in wmi_set_target_suspend_acked()
3791 qdf_atomic_set(&wmi_handle->num_stats_over_qmi, 0); in wmi_set_target_suspend_acked()
3794 bool wmi_is_target_suspended(struct wmi_unified *wmi_handle) in wmi_is_target_suspended() argument
3796 return qdf_atomic_read(&wmi_handle->is_target_suspended); in wmi_is_target_suspended()
3800 bool wmi_is_target_suspend_acked(struct wmi_unified *wmi_handle) in wmi_is_target_suspend_acked() argument
3802 return qdf_atomic_read(&wmi_handle->is_target_suspend_acked); in wmi_is_target_suspend_acked()
3807 void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val) in wmi_set_qmi_stats() argument
3809 wmi_handle->is_qmi_stats_enabled = val; in wmi_set_qmi_stats()
3812 bool wmi_is_qmi_stats_enabled(struct wmi_unified *wmi_handle) in wmi_is_qmi_stats_enabled() argument
3814 return wmi_handle->is_qmi_stats_enabled; in wmi_is_qmi_stats_enabled()
3818 void wmi_tag_crash_inject(wmi_unified_t wmi_handle, A_BOOL flag) in wmi_tag_crash_inject() argument
3820 wmi_handle->tag_crash_inject = flag; in wmi_tag_crash_inject()
3823 void wmi_set_is_wow_bus_suspended(wmi_unified_t wmi_handle, A_BOOL val) in wmi_set_is_wow_bus_suspended() argument
3825 qdf_atomic_set(&wmi_handle->is_wow_bus_suspended, val); in wmi_set_is_wow_bus_suspended()
3828 void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val) in wmi_set_tgt_assert() argument
3830 wmi_handle->tgt_force_assert_enable = val; in wmi_set_tgt_assert()
3834 wmi_stop(wmi_unified_t wmi_handle) in wmi_stop() argument
3838 wmi_handle->wmi_stopinprogress = 1; in wmi_stop()
3843 wmi_start(wmi_unified_t wmi_handle) in wmi_start() argument
3847 wmi_handle->wmi_stopinprogress = 0; in wmi_start()
3852 wmi_is_blocked(wmi_unified_t wmi_handle) in wmi_is_blocked() argument
3854 return (!(!wmi_handle->wmi_stopinprogress)); in wmi_is_blocked()
3858 wmi_flush_endpoint(wmi_unified_t wmi_handle) in wmi_flush_endpoint() argument
3860 htc_flush_endpoint(wmi_handle->htc_handle, in wmi_flush_endpoint()
3861 wmi_handle->wmi_endpoint_id, 0); in wmi_flush_endpoint()
3865 HTC_ENDPOINT_ID wmi_get_endpoint(wmi_unified_t wmi_handle) in wmi_get_endpoint() argument
3867 return wmi_handle->wmi_endpoint_id; in wmi_get_endpoint()
3870 void wmi_pdev_id_conversion_enable(wmi_unified_t wmi_handle, in wmi_pdev_id_conversion_enable() argument
3874 if (wmi_handle->target_type == WMI_TLV_TARGET) in wmi_pdev_id_conversion_enable()
3875 wmi_handle->ops->wmi_pdev_id_conversion_enable(wmi_handle, in wmi_pdev_id_conversion_enable()
3880 int __wmi_validate_handle(wmi_unified_t wmi_handle, const char *func) in __wmi_validate_handle() argument
3882 if (!wmi_handle) { in __wmi_validate_handle()