Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Houston Hoffman | 1460fa3 | 2015-11-18 02:36:30 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * This file contains the API definitions for the Unified Wireless Module Interface (WMI). |
| 30 | */ |
| 31 | #ifndef _WMI_UNIFIED_PRIV_H_ |
| 32 | #define _WMI_UNIFIED_PRIV_H_ |
| 33 | #include <osdep.h> |
| 34 | #include "a_types.h" |
| 35 | #include "wmi.h" |
| 36 | #include "wmi_unified.h" |
Anurag Chouhan | 8e0ccd3 | 2016-02-19 15:30:20 +0530 | [diff] [blame] | 37 | #include "qdf_atomic.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 38 | |
| 39 | #define WMI_UNIFIED_MAX_EVENT 0x100 |
| 40 | #define WMI_MAX_CMDS 1024 |
| 41 | |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame^] | 42 | typedef qdf_nbuf_t wmi_buf_t; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 43 | |
| 44 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
| 45 | |
| 46 | #define WMI_EVENT_DEBUG_MAX_ENTRY (1024) |
| 47 | |
| 48 | struct wmi_command_debug { |
| 49 | uint32_t command; |
| 50 | uint32_t data[4]; /*16 bytes of WMI cmd excluding TLV and WMI headers */ |
| 51 | uint64_t time; |
| 52 | }; |
| 53 | |
| 54 | struct wmi_event_debug { |
| 55 | uint32_t event; |
| 56 | uint32_t data[4]; /*16 bytes of WMI event data excluding TLV header */ |
| 57 | uint64_t time; |
| 58 | }; |
| 59 | |
| 60 | #endif /*WMI_INTERFACE_EVENT_LOGGING */ |
| 61 | |
| 62 | #ifdef WLAN_OPEN_SOURCE |
| 63 | struct fwdebug { |
| 64 | struct sk_buff_head fwlog_queue; |
| 65 | struct completion fwlog_completion; |
| 66 | A_BOOL fwlog_open; |
| 67 | }; |
| 68 | #endif /* WLAN_OPEN_SOURCE */ |
| 69 | |
| 70 | struct wmi_unified { |
| 71 | ol_scn_t scn_handle; /* handle to device */ |
Anurag Chouhan | 8e0ccd3 | 2016-02-19 15:30:20 +0530 | [diff] [blame] | 72 | qdf_atomic_t pending_cmds; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 73 | HTC_ENDPOINT_ID wmi_endpoint_id; |
| 74 | uint16_t max_msg_len; |
| 75 | WMI_EVT_ID event_id[WMI_UNIFIED_MAX_EVENT]; |
| 76 | wmi_unified_event_handler event_handler[WMI_UNIFIED_MAX_EVENT]; |
| 77 | uint32_t max_event_idx; |
| 78 | void *htc_handle; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 79 | qdf_spinlock_t eventq_lock; |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame^] | 80 | qdf_nbuf_queue_t event_queue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | struct work_struct rx_event_work; |
| 82 | #ifdef WLAN_OPEN_SOURCE |
| 83 | struct fwdebug dbglog; |
| 84 | struct dentry *debugfs_phy; |
| 85 | #endif /* WLAN_OPEN_SOURCE */ |
| 86 | |
| 87 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 88 | qdf_spinlock_t wmi_record_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | #endif /*WMI_INTERFACE_EVENT_LOGGING */ |
| 90 | |
Anurag Chouhan | 8e0ccd3 | 2016-02-19 15:30:20 +0530 | [diff] [blame] | 91 | qdf_atomic_t is_target_suspended; |
Houston Hoffman | 1460fa3 | 2015-11-18 02:36:30 -0800 | [diff] [blame] | 92 | |
| 93 | #ifdef FEATURE_RUNTIME_PM |
Anurag Chouhan | 8e0ccd3 | 2016-02-19 15:30:20 +0530 | [diff] [blame] | 94 | qdf_atomic_t runtime_pm_inprogress; |
Houston Hoffman | 1460fa3 | 2015-11-18 02:36:30 -0800 | [diff] [blame] | 95 | #endif |
| 96 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | int (*wma_process_fw_event_handler_cbk)(struct wmi_unified *wmi_handle, |
| 98 | wmi_buf_t evt_buf); |
| 99 | }; |
| 100 | #endif |