4 * @Abstract: internal data and structure definitions for WMI service
9 * Copyright (c) 2007 Atheros Communications Inc.
10 * All rights reserved.
14 #ifndef WMI_INTERNAL_H_
15 #define WMI_INTERNAL_H_
17 #define WMI_CMD_ALIGNMENT_SIZE 128
21 /* WMI debug log definitions */
23 #define WMI_DBG0_LOG(debugid) \
24 DBGLOG_ARG0_RECORD(DBGLOG_HEADER_UPPER_HALF(debugid, \
25 DBGLOG_MODULEID_WMI, 0))
27 #define WMI_DBG1_LOG(debugid, arg1) \
28 DBGLOG_ARG1_RECORD(DBGLOG_HEADER_UPPER_HALF(debugid, \
29 DBGLOG_MODULEID_WMI, 1), arg1)
31 #define WMI_DBG2_LOG(debugid, arg1, arg2) \
32 DBGLOG_ARG2_RECORD(DBGLOG_HEADER_UPPER_HALF(debugid, \
33 DBGLOG_MODULEID_WMI, 2), arg1, arg2)
36 #define WMI_DBG0_LOG(debugid)
37 #define WMI_DBG1_LOG(debugid, arg1)
38 #define WMI_DBG2_LOG(debugid, arg1, arg2)
39 #endif /* WMI_DEBUG */
41 #define EVT_PKT_IN_USE (1 << 0)
42 #define EVT_PKT_IS_FREE(e) !((e)->Flags & EVT_PKT_IN_USE)
43 #define EVT_MARK_FREE(e) (e)->Flags &= ~EVT_PKT_IN_USE;
44 #define EVT_MARK_INUSE(e) (e)->Flags |= EVT_PKT_IN_USE
45 #define IS_EVT_CLASS_BUFFERED(ec) ((ec) != WMI_EVT_CLASS_DIRECT_BUFFER)
47 typedef struct _WMI_POOL_STATE {
48 int MaxAllocation; /* maximum allocations allowed for this pool */
49 int CurrentAllocation; /* current allocations outstanding */
52 typedef struct _WMI_SVC_CONTEXT {
53 htc_handle_t HtcHandle;
54 pool_handle_t PoolHandle;
55 int PendingEvents; /* no. of pending events */
56 HTC_SERVICE WMIControlService; /* registered control service */
57 HTC_ENDPOINT_ID ControlEp; /* endpoint assigned to us */
58 WMI_DISPATCH_TABLE *pDispatchHead; /* dispatch list head ptr */
59 WMI_DISPATCH_TABLE *pDispatchTail; /* dispatch list tail ptr */
61 // Left a door for extension the structure
65 #endif /*WMI_INTERNAL_H_*/