#ifndef R92C_FW_CMD_H
#define R92C_FW_CMD_H
struct r92c_fw_cmd {
uint8_t id;
#define R92C_CMD_SET_PWRMODE 1
#define R92C_CMD_JOINBSS_RPT 2
#define R92C_CMD_RSVD_PAGE 3
#define R92C_CMD_RSSI_SETTING 5
#define R92C_CMD_MACID_CONFIG 6
#define R92C_CMD_FLAG_EXT 0x80
uint8_t msg[5];
} __packed __attribute__((aligned(4)));
struct r92c_fw_cmd_joinbss_rpt {
uint8_t mstatus;
#define R92C_MSTATUS_DISASSOC 0x00
#define R92C_MSTATUS_ASSOC 0x01
} __packed;
struct r92c_fw_cmd_pwrmode {
uint8_t mode;
#define R92C_PWRMODE_CAM 0
#define R92C_PWRMODE_MIN 1
#define R92C_PWRMODE_MAX 2
#define R92C_PWRMODE_DTIM 3
#define R92C_PWRMODE_UAPSD_WMM 5
#define R92C_PWRMODE_UAPSD 6
#define R92C_PWRMODE_IBSS 7
uint8_t smart_ps;
#define R92C_PWRMODE_SMARTPS_NULLDATA 2
uint8_t bcn_pass;
} __packed;
struct r92c_fw_cmd_rsvdpage {
uint8_t probe_resp;
uint8_t ps_poll;
uint8_t null_data;
} __packed;
struct r92c_fw_cmd_rssi {
uint8_t macid;
uint8_t reserved;
uint8_t pwdb;
} __packed;
struct r92c_fw_cmd_macid_cfg {
uint32_t mask;
uint8_t macid;
#define R92C_CMD_MACID_VALID 0x80
#define R92C_CMD_MACID_SGI 0x20
} __packed;
#define R92C_C2H_MSG_MAX_LEN 16
struct r92c_c2h_evt {
uint8_t evtb0;
#define R92C_C2H_EVTB0_ID_M 0x0f
#define R92C_C2H_EVTB0_ID_S 0
#define R92C_C2H_EVTB0_LEN_M 0xf0
#define R92C_C2H_EVTB0_LEN_S 4
uint8_t seq;
} __packed;
#define R92C_C2H_EVT_DEBUG 0
#define R92C_C2H_EVT_TX_REPORT 3
#define R92C_C2H_EVT_EXT_RA_RPT 6
struct r92c_c2h_tx_rpt {
uint8_t rptb0;
#define R92C_RPTB0_RETRY_CNT_M 0x3f
#define R92C_RPTB0_RETRY_CNT_S 0
uint8_t rptb1;
#define R92C_RPTB1_RTS_RETRY_CNT_M 0x3f
#define R92C_RPTB1_RTS_RETRY_CNT_S 0
uint8_t queue_time_low;
uint8_t queue_time_high;
uint8_t rptb4;
#define R92C_RPTB4_MISSED_PKT_NUM_M 0x1f
#define R92C_RPTB4_MISSED_PKT_NUM_S 0
uint8_t rptb5;
#define R92C_RPTB5_MACID_M 0x1f
#define R92C_RPTB5_MACID_S 0
#define R92C_RPTB5_DES1_FRAGSSN_M 0xe0
#define R92C_RPTB5_DES1_FRAGSSN_S 5
uint8_t rptb6;
#define R92C_RPTB6_RPT_PKT_NUM_M 0x1f
#define R92C_RPTB6_RPT_PKT_NUM_S 0
#define R92C_RPTB6_PKT_DROP 0x20
#define R92C_RPTB6_LIFE_EXPIRE 0x40
#define R92C_RPTB6_RETRY_OVER 0x80
uint8_t rptb7;
#define R92C_RPTB7_EDCA_M 0x0f
#define R92C_RPTB7_EDCA_S 0
#define R92C_RPTB7_BMC 0x20
#define R92C_RPTB7_PKT_OK 0x40
#define R92C_RPTB7_INT_CCX 0x80
} __packed;
#endif