blob: 293480dba42cac86820f7a92e713f5cf7d45df64 [file] [log] [blame]
Prakash Dhavalid5c9f1c2015-11-08 19:04:44 -08001/*
Houston Hoffmanc5141b02015-11-18 02:36:30 -08002 * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
Prakash Dhavalid5c9f1c2015-11-08 19:04:44 -08003 *
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"
37#include "cdf_atomic.h"
38
39#define WMI_UNIFIED_MAX_EVENT 0x100
40#define WMI_MAX_CMDS 1024
41
42typedef cdf_nbuf_t wmi_buf_t;
43
44#ifdef WMI_INTERFACE_EVENT_LOGGING
45
46#define WMI_EVENT_DEBUG_MAX_ENTRY (1024)
47
48struct 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
54struct 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
63struct 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
70struct wmi_unified {
71 ol_scn_t scn_handle; /* handle to device */
72 cdf_atomic_t pending_cmds;
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;
79 cdf_spinlock_t eventq_lock;
80 cdf_nbuf_queue_t event_queue;
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
88 cdf_spinlock_t wmi_record_lock;
89#endif /*WMI_INTERFACE_EVENT_LOGGING */
90
91 cdf_atomic_t is_target_suspended;
Houston Hoffmanc5141b02015-11-18 02:36:30 -080092
93#ifdef FEATURE_RUNTIME_PM
94 cdf_atomic_t runtime_pm_inprogress;
95#endif
96
Prakash Dhavalid5c9f1c2015-11-08 19:04:44 -080097 int (*wma_process_fw_event_handler_cbk)(struct wmi_unified *wmi_handle,
98 wmi_buf_t evt_buf);
99};
100#endif