Path: blob/main/sys/contrib/dev/mediatek/mt76/mt7615/mcu.h
48524 views
/* SPDX-License-Identifier: ISC */1/* Copyright (C) 2019 MediaTek Inc. */23#ifndef __MT7615_MCU_H4#define __MT7615_MCU_H56#include "../mt76_connac_mcu.h"78struct mt7615_mcu_txd {9__le32 txd[8];1011__le16 len;12__le16 pq_id;1314u8 cid;15u8 pkt_type;16u8 set_query; /* FW don't care */17u8 seq;1819u8 uc_d2b0_rev;20u8 ext_cid;21u8 s2d_index;22u8 ext_cid_ack;2324u32 reserved[5];25} __packed __aligned(4);2627/**28* struct mt7615_uni_txd - mcu command descriptor for firmware v329* @txd: hardware descriptor30* @len: total length not including txd31* @cid: command identifier32* @pkt_type: must be 0xa0 (cmd packet by long format)33* @frag_n: fragment number34* @seq: sequence number35* @checksum: 0 mean there is no checksum36* @s2d_index: index for command source and destination37* Definition | value | note38* CMD_S2D_IDX_H2N | 0x00 | command from HOST to WM39* CMD_S2D_IDX_C2N | 0x01 | command from WA to WM40* CMD_S2D_IDX_H2C | 0x02 | command from HOST to WA41* CMD_S2D_IDX_H2N_AND_H2C | 0x03 | command from HOST to WA and WM42*43* @option: command option44* BIT[0]: UNI_CMD_OPT_BIT_ACK45* set to 1 to request a fw reply46* if UNI_CMD_OPT_BIT_0_ACK is set and UNI_CMD_OPT_BIT_2_SET_QUERY47* is set, mcu firmware will send response event EID = 0x0148* (UNI_EVENT_ID_CMD_RESULT) to the host.49* BIT[1]: UNI_CMD_OPT_BIT_UNI_CMD50* 0: original command51* 1: unified command52* BIT[2]: UNI_CMD_OPT_BIT_SET_QUERY53* 0: QUERY command54* 1: SET command55*/56struct mt7615_uni_txd {57__le32 txd[8];5859/* DW1 */60__le16 len;61__le16 cid;6263/* DW2 */64u8 reserved;65u8 pkt_type;66u8 frag_n;67u8 seq;6869/* DW3 */70__le16 checksum;71u8 s2d_index;72u8 option;7374/* DW4 */75u8 reserved2[4];76} __packed __aligned(4);7778enum {79MT_SKU_CCK_1_2 = 0,80MT_SKU_CCK_55_11,81MT_SKU_OFDM_6_9,82MT_SKU_OFDM_12_18,83MT_SKU_OFDM_24_36,84MT_SKU_OFDM_48,85MT_SKU_OFDM_54,86MT_SKU_HT20_0_8,87MT_SKU_HT20_32,88MT_SKU_HT20_1_2_9_10,89MT_SKU_HT20_3_4_11_12,90MT_SKU_HT20_5_13,91MT_SKU_HT20_6_14,92MT_SKU_HT20_7_15,93MT_SKU_HT40_0_8,94MT_SKU_HT40_32,95MT_SKU_HT40_1_2_9_10,96MT_SKU_HT40_3_4_11_12,97MT_SKU_HT40_5_13,98MT_SKU_HT40_6_14,99MT_SKU_HT40_7_15,100MT_SKU_VHT20_0,101MT_SKU_VHT20_1_2,102MT_SKU_VHT20_3_4,103MT_SKU_VHT20_5_6,104MT_SKU_VHT20_7,105MT_SKU_VHT20_8,106MT_SKU_VHT20_9,107MT_SKU_VHT40_0,108MT_SKU_VHT40_1_2,109MT_SKU_VHT40_3_4,110MT_SKU_VHT40_5_6,111MT_SKU_VHT40_7,112MT_SKU_VHT40_8,113MT_SKU_VHT40_9,114MT_SKU_VHT80_0,115MT_SKU_VHT80_1_2,116MT_SKU_VHT80_3_4,117MT_SKU_VHT80_5_6,118MT_SKU_VHT80_7,119MT_SKU_VHT80_8,120MT_SKU_VHT80_9,121MT_SKU_VHT160_0,122MT_SKU_VHT160_1_2,123MT_SKU_VHT160_3_4,124MT_SKU_VHT160_5_6,125MT_SKU_VHT160_7,126MT_SKU_VHT160_8,127MT_SKU_VHT160_9,128MT_SKU_1SS_DELTA,129MT_SKU_2SS_DELTA,130MT_SKU_3SS_DELTA,131MT_SKU_4SS_DELTA,132};133134struct mt7615_mcu_rxd {135__le32 rxd[4];136137__le16 len;138__le16 pkt_type_id;139140u8 eid;141u8 seq;142__le16 __rsv;143144u8 ext_eid;145u8 __rsv1[2];146u8 s2d_index;147};148149struct mt7615_mcu_csa_notify {150struct mt7615_mcu_rxd rxd;151152u8 omac_idx;153u8 csa_count;154u8 rsv[2];155} __packed;156157struct mt7615_mcu_rdd_report {158struct mt7615_mcu_rxd rxd;159160u8 band_idx;161u8 long_detected;162u8 constant_prf_detected;163u8 staggered_prf_detected;164u8 radar_type_idx;165u8 periodic_pulse_num;166u8 long_pulse_num;167u8 hw_pulse_num;168169u8 out_lpn;170u8 out_spn;171u8 out_crpn;172u8 out_crpw;173u8 out_crbn;174u8 out_stgpn;175u8 out_stgpw;176177u8 _rsv[2];178179__le32 out_pri_const;180__le32 out_pri_stg[3];181182struct {183__le32 start;184__le16 pulse_width;185__le16 pulse_power;186} long_pulse[32];187188struct {189__le32 start;190__le16 pulse_width;191__le16 pulse_power;192} periodic_pulse[32];193194struct {195__le32 start;196__le16 pulse_width;197__le16 pulse_power;198u8 sc_pass;199u8 sw_reset;200} hw_pulse[32];201};202203enum {204MCU_ATE_SET_FREQ_OFFSET = 0xa,205MCU_ATE_SET_TX_POWER_CONTROL = 0x15,206};207208struct mt7615_roc_tlv {209u8 bss_idx;210u8 token;211u8 active;212u8 primary_chan;213u8 sco;214u8 band;215u8 width; /* To support 80/160MHz bandwidth */216u8 freq_seg1; /* To support 80/160MHz bandwidth */217u8 freq_seg2; /* To support 80/160MHz bandwidth */218u8 req_type;219u8 dbdc_band;220u8 rsv0;221__le32 max_interval; /* ms */222u8 rsv1[8];223} __packed;224225enum {226FW_STATE_PWR_ON = 1,227FW_STATE_N9_RDY = 2,228};229230enum {231DBDC_TYPE_WMM,232DBDC_TYPE_MGMT,233DBDC_TYPE_BSS,234DBDC_TYPE_MBSS,235DBDC_TYPE_REPEATER,236DBDC_TYPE_MU,237DBDC_TYPE_BF,238DBDC_TYPE_PTA,239__DBDC_TYPE_MAX,240};241242#endif243244245