xref: /freebsd/sys/dev/rtwn/rtl8723b/r23b_fw_cmd.h (revision 551b7c5e12bfea623a47edf97ad5689732a1233f)
1 /*
2  * Copyright (c) 2026 Ahmad Khalifa <vexeduxr@FreeBSD.org>
3  *
4  * SPDX-License-Identifier: BSD-2-Clause
5  */
6 
7 #ifndef R23B_FW_CMD_H
8 #define R23B_FW_CMD_H
9 
10 /*
11  * Host to firmware commands.
12  */
13 #define R23B_CMD_RSSI_SETTING	0x42
14 #define R23B_CMD_PS_TDMA	0x60
15 #define R23B_CMD_BT_INFO	0x61
16 #define R23B_CMD_BT_WLANACT	0x63
17 #define R23B_CMD_ANT_INV	0x65
18 #define R23B_CMD_BT_MP_OPER	0x67
19 #define R23B_CMD_WLAN_CALIB	0x6d
20 #define R23B_CMD_BT_GRANT	0x6e
21 
22 #define R23B_CMD_BT_WLANACT_IGNORE	((uint8_t[]){ 0 })
23 
24 #define R23B_CMD_WLAN_CALIB_BEGIN	((uint8_t[]){ 1 })
25 #define R23B_CMD_WLAN_CALIB_END		((uint8_t[]){ 0 })
26 
27 #define R23B_CMD_BT_GRANT_LOW		((uint8_t[]){ 0 })
28 #define R23B_CMD_BT_GRANT_HIGH		((uint8_t[]){ 1 })
29 
30 /* Structure for R23B_CMD_RSSI_SETTING. */
31 struct r23b_fw_cmd_rssi {
32 	uint8_t	macid;
33 	uint8_t	reserved;
34 	uint8_t	pwdb;
35 	uint8_t uldl;
36 } __packed;
37 
38 /* Structure for R23B_CMD_BT_MP_OPER. */
39 struct r23b_fw_cmd_btoper {
40 	uint8_t req_num;
41 	uint8_t opcode;
42 #define R23B_BT_MP_OPER_WRITE_VAL	0xd
43 #define R23B_BT_MP_OPER_WRITE_ADDR	0xc
44 
45 	uint8_t value;
46 	uint8_t addr;
47 } __packed;
48 
49 /* Structure for R23B_CMD_ANT_INV. */
50 struct r23b_fw_cmd_antinv {
51 	uint8_t invert;
52 	uint8_t internal_switch;
53 } __packed;
54 
55 #endif
56