2 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
3 * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $
25 * Host to firmware commands.
29 #define R92C_CMD_SET_PWRMODE 1
30 #define R92C_CMD_JOINBSS_RPT 2
31 #define R92C_CMD_RSVD_PAGE 3
32 #define R92C_CMD_RSSI_SETTING 5
33 #define R92C_CMD_MACID_CONFIG 6
35 #define R92C_CMD_FLAG_EXT 0x80
38 } __packed __attribute__((aligned(4)));
40 /* Structure for R92C_CMD_JOINBSS_RPT. */
41 struct r92c_fw_cmd_joinbss_rpt {
43 #define R92C_MSTATUS_DISASSOC 0x00
44 #define R92C_MSTATUS_ASSOC 0x01
47 /* Structure for R92C_CMD_SET_PWRMODE. */
48 struct r92c_fw_cmd_pwrmode {
50 #define R92C_PWRMODE_CAM 0
51 #define R92C_PWRMODE_MIN 1
52 #define R92C_PWRMODE_MAX 2
53 #define R92C_PWRMODE_DTIM 3
54 #define R92C_PWRMODE_UAPSD_WMM 5
55 #define R92C_PWRMODE_UAPSD 6
56 #define R92C_PWRMODE_IBSS 7
59 /* XXX undocumented */
60 #define R92C_PWRMODE_SMARTPS_NULLDATA 2
62 uint8_t bcn_pass; /* unit: beacon interval */
65 /* Structure for R92C_CMD_RSVD_PAGE. */
66 struct r92c_fw_cmd_rsvdpage {
72 /* Structure for R92C_CMD_RSSI_SETTING. */
73 struct r92c_fw_cmd_rssi {
79 /* Structure for R92C_CMD_MACID_CONFIG. */
80 struct r92c_fw_cmd_macid_cfg {
83 #define R92C_CMD_MACID_VALID 0x80
87 * C2H event structure.
89 /* Bigger value is used to prevent buffer overrun. */
90 #define R92C_C2H_MSG_MAX_LEN 16
94 #define R92C_C2H_EVTB0_ID_M 0x0f
95 #define R92C_C2H_EVTB0_ID_S 0
96 #define R92C_C2H_EVTB0_LEN_M 0xf0
97 #define R92C_C2H_EVTB0_LEN_S 4
101 /* Followed by payload (see below). */
107 #define R92C_C2H_EVT_DEBUG 0
108 #define R92C_C2H_EVT_TX_REPORT 3
109 #define R92C_C2H_EVT_EXT_RA_RPT 6
111 /* Structure for R92C_C2H_EVT_TX_REPORT event. */
112 struct r92c_c2h_tx_rpt {
114 #define R92C_RPTB0_RETRY_CNT_M 0x3f
115 #define R92C_RPTB0_RETRY_CNT_S 0
117 uint8_t rptb1; /* XXX junk */
118 #define R92C_RPTB1_RTS_RETRY_CNT_M 0x3f
119 #define R92C_RPTB1_RTS_RETRY_CNT_S 0
121 uint8_t queue_time_low;
122 uint8_t queue_time_high;
124 #define R92C_RPTB4_MISSED_PKT_NUM_M 0x1f
125 #define R92C_RPTB4_MISSED_PKT_NUM_S 0
128 #define R92C_RPTB5_MACID_M 0x1f
129 #define R92C_RPTB5_MACID_S 0
130 #define R92C_RPTB5_DES1_FRAGSSN_M 0xe0
131 #define R92C_RPTB5_DES1_FRAGSSN_S 5
134 #define R92C_RPTB6_RPT_PKT_NUM_M 0x1f
135 #define R92C_RPTB6_RPT_PKT_NUM_S 0
136 #define R92C_RPTB6_PKT_DROP 0x20
137 #define R92C_RPTB6_LIFE_EXPIRE 0x40
138 #define R92C_RPTB6_RETRY_OVER 0x80
141 #define R92C_RPTB7_EDCA_M 0x0f
142 #define R92C_RPTB7_EDCA_S 0
143 #define R92C_RPTB7_BMC 0x20
144 #define R92C_RPTB7_PKT_OK 0x40
145 #define R92C_RPTB7_INT_CCX 0x80
148 #endif /* R92C_FW_CMD_H */