Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 536436d6 authored by spuligil's avatar spuligil
Browse files

fw-api: CL 8188153 - update fw common interface files

Change-Id: Ia67da22639fd31eb83858023418ab607ca0069cf
HTT: define T2H and H2T CHAN_CALDATA msgs
CRs-Fixed: 2262693
parent 826a9ccf
Loading
Loading
Loading
Loading
+230 −12
Original line number Diff line number Diff line
@@ -193,9 +193,11 @@
 *      HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
 * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
 *      htt_tx_data_hdr_information
 * 3.73 Add channel pre-calibration data upload and download messages defs for
 *      HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
 */
#define HTT_CURRENT_VERSION_MAJOR 3
#define HTT_CURRENT_VERSION_MINOR 72
#define HTT_CURRENT_VERSION_MINOR 73
#define HTT_NUM_TX_FRAG_DESC  1024
@@ -536,6 +538,7 @@ enum htt_h2t_msg_type {
    HTT_H2T_MSG_TYPE_PPDU_STATS_CFG        = 0x11,
    HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG      = 0x12,
    HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG  = 0x13,
    HTT_H2T_MSG_TYPE_CHAN_CALDATA          = 0x14,
    /* keep this last */
    HTT_H2T_NUM_MSGS
@@ -6340,6 +6343,7 @@ enum htt_t2h_msg_type {
     * to provide to the monitor mode interface.
     */
    HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND   = 0x25,
    HTT_T2H_MSG_TYPE_CHAN_CALDATA             = 0x26,
    HTT_T2H_MSG_TYPE_TEST,
    /* keep this last */
@@ -13046,27 +13050,39 @@ struct htt_ul_ofdma_user_info_v0 {
    A_UINT32 word1;
};
#define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
    A_UINT32 w0_fw_rsvd:30; \
    A_UINT32 w0_valid:1; \
    A_UINT32 w0_version:1;
struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
    HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
};
#define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
    A_UINT32 w1_nss:3; \
    A_UINT32 w1_mcs:4; \
    A_UINT32 w1_ldpc:1; \
    A_UINT32 w1_dcm:1; \
    A_UINT32 w1_ru_start:7; \
    A_UINT32 w1_ru_size:3; \
    A_UINT32 w1_trig_type:4; \
    A_UINT32 w1_unused:9;
struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
    HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
};
/* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
    union {
        A_UINT32 word0;
        struct {
            A_UINT32 w0_fw_rsvd:30;
            A_UINT32 w0_valid:1;
            A_UINT32 w0_version:1;
            HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
        };
    };
    union {
        A_UINT32 word1;
        struct {
            A_UINT32 w1_nss:3;
            A_UINT32 w1_mcs:4;
            A_UINT32 w1_ldpc:1;
            A_UINT32 w1_dcm:1;
            A_UINT32 w1_ru_start:7;
            A_UINT32 w1_ru_size:3;
            A_UINT32 w1_trig_type:4;
            A_UINT32 w1_unused:9;
            HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
        };
    };
} POSTPACK;
@@ -13218,5 +13234,207 @@ enum HTT_UL_OFDMA_TRIG_TYPE {
        ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
    } while (0)
/**
 * @brief target -> host channel calibration data message
 * @brief host -> target channel calibration data message
 *
 * @details
 * The following field definitions describe the format of the channel
 * calibration data message sent from the target to the host when
 * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
 * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
 * The message is defined as htt_chan_caldata_msg followed by a variable
 * number of 32-bit character values.
 *
 * |31              21|20|19   16|15  13|  12|11      8|7            0|
 * |------------------------------------------------------------------|
 * |       rsv        | A| frag  | rsv  |ck_v| sub_type|   msg type   |
 * |------------------------------------------------------------------|
 * |        payload size         |               mhz                  |
 * |------------------------------------------------------------------|
 * |      center frequency 2     |          center frequency 1        |
 * |------------------------------------------------------------------|
 * |                              check sum                           |
 * |------------------------------------------------------------------|
 * |                              payload                             |
 * |------------------------------------------------------------------|
 * message info field:
 *   - MSG_TYPE
 *     Bits 7:0
 *     Purpose: identifies this as a channel calibration data message
 *     Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
 *            HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
 *   - SUB_TYPE
 *     Bits 11:8
 *     Purpose: T2H: indicates whether target is providing chan cal data
 *                   to the host to store, or requesting that the host
 *                   download previously-stored data.
 *              H2T: indicates whether the host is providing the requested
 *                   channel cal data, or if it is rejecting the data
 *                   request because it does not have the requested data.
 *     Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
 *   - CHKSUM_VALID
 *     Bit 12
 *     Purpose: indicates if the checksum field is valid
 *     value:
 *   - FRAG
 *     Bit 19:16
 *     Purpose: indicates the fragment index for message
 *     value: 0 for first fragment, 1 for second fragment, ...
 *   - APPEND
 *     Bit 20
 *     Purpose: indicates if this is the last fragment
 *     value: 0 = final fragment, 1 = more fragments will be appended
 *
 * channel and payload size field
 *   - MHZ
 *     Bits 15:0
 *     Purpose: indicates the channel primary frequency
 *     Value:
 *   - PAYLOAD_SIZE
 *     Bits 31:16
 *     Purpose: indicates the bytes of calibration data in payload
 *     Value:
 *
 * center frequency field
 *   - CENTER FREQUENCY 1
 *     Bits 15:0
 *     Purpose: indicates the channel center frequency
 *     Value: channel center frequency, in MHz units
 *   - CENTER FREQUENCY 2
 *     Bits 31:16
 *     Purpose: indicates the secondary channel center frequency,
 *              only for 11acvht 80plus80 mode
 *     Value:  secondary channel center frequeny, in MHz units, if applicable
 *
 * checksum field
 *   - CHECK_SUM
 *     Bits 31:0
 *     Purpose: check the payload data, it is just for this fragment.
 *              This is intended for the target to check that the channel
 *              calibration data returned by the host is the unmodified data
 *              that was previously provided to the host by the target.
 *     value: checksum of fragment payload
 */
PREPACK struct htt_chan_caldata_msg {
    /* DWORD 0: message info */
    A_UINT32
        msg_type: 8,
        sub_type: 4 ,
        chksum_valid: 1, /** 1:valid, 0:invalid  */
        reserved1: 3,
        frag_idx: 4,     /** fragment index for calibration data */
        appending: 1,    /** 0: no fragment appending,
                          *  1: extra fragment appending */
        reserved2: 11;
    /* DWORD 1: channel and payload size */
    A_UINT32
        mhz: 16,          /** primary 20 MHz channel frequency in mhz */
        payload_size: 16; /** unit: bytes */
    /* DWORD 2: center frequency */
    A_UINT32
        band_center_freq1: 16, /** Center frequency 1 in MHz */
        band_center_freq2: 16; /** Center frequency 2 in MHz,
                                *  valid only for 11acvht 80plus80 mode */
    /* DWORD 3: check sum */
    A_UINT32 chksum;
    /* variable length for calibration data */
    A_UINT32   payload[1/* or more */];
} POSTPACK;
/* T2H SUBTYPE */
#define HTT_T2H_MSG_CHAN_CALDATA_REQ     0
#define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD  1
/* H2T SUBTYPE */
#define HTT_H2T_MSG_CHAN_CALDATA_REJ       0
#define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD  1
#define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S    8
#define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M    0x00000f00
#define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
#define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S    12
#define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M    0x00001000
#define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
#define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S    16
#define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M    0x000f0000
#define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
#define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_APPENDING_S    20
#define HTT_CHAN_CALDATA_MSG_APPENDING_M    0x00100000
#define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
#define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_MHZ_S    0
#define HTT_CHAN_CALDATA_MSG_MHZ_M    0x0000ffff
#define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
#define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S    0
#define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M    0xffff0000
#define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
#define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_FREQ1_S    0
#define HTT_CHAN_CALDATA_MSG_FREQ1_M    0x0000ffff
#define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
#define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
    } while (0)
#define HTT_CHAN_CALDATA_MSG_FREQ2_S    16
#define HTT_CHAN_CALDATA_MSG_FREQ2_M    0xffff0000
#define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
    (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
#define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
    do {                                                     \
        HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val);  \
        ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
    } while (0)
#endif