2 * Copyright (c) 2014 Jan Kolarik
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * Definitions of the Atheros WMI protocol specified in the
32 * Wireless Module Interface (WMI).
41 /* Macros for creating service identificators. */
42 #define WMI_SERVICE_GROUP 1
44 #define CREATE_SERVICE_ID(group, i) \
45 (unsigned int) (((unsigned int) group << 8) | (unsigned int) (i))
47 #define WMI_MGMT_CMD_MASK 0x1000
49 /** WMI header structure.
53 uint16_t command_id
; /**< Big Endian value! */
54 uint16_t sequence_number
; /**< Big Endian value! */
55 } __attribute__((packed
)) wmi_command_header_t
;
61 WMI_CONTROL_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 0),
62 WMI_BEACON_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 1),
63 WMI_CAB_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 2),
64 WMI_UAPSD_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 3),
65 WMI_MGMT_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 4),
66 WMI_DATA_VOICE_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 5),
67 WMI_DATA_VIDEO_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 6),
68 WMI_DATA_BE_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 7),
69 WMI_DATA_BK_SERVICE
= CREATE_SERVICE_ID(WMI_SERVICE_GROUP
, 8)
72 /** List of WMI commands
79 /* Commands used for HOST -> DEVICE communication */
101 WMI_TARGET_IC_UPDATE
,
111 /**Structure used when sending registry buffer
115 uint32_t offset
; /**< Big Endian value! */
116 uint32_t value
; /**< Big Endian value! */
119 extern int wmi_reg_read(htc_device_t
*, uint32_t, uint32_t *);
120 extern int wmi_reg_write(htc_device_t
*, uint32_t, uint32_t);
121 extern int wmi_reg_set_clear_bit(htc_device_t
*, uint32_t, uint32_t, uint32_t);
122 extern int wmi_reg_set_bit(htc_device_t
*, uint32_t, uint32_t);
123 extern int wmi_reg_clear_bit(htc_device_t
*, uint32_t, uint32_t);
124 extern int wmi_reg_buffer_write(htc_device_t
*, wmi_reg_t
*, size_t);
125 extern int wmi_send_command(htc_device_t
*, wmi_command_t
, uint8_t *, uint32_t,
128 #endif /* ATHEROS_WMI_H */