1 2 /* 3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 21 22 #ifndef _CE_STAT_DESC_H_ 23 #define _CE_STAT_DESC_H_ 24 #if !defined(__ASSEMBLER__) 25 #endif 26 27 #define NUM_OF_DWORDS_CE_STAT_DESC 4 28 29 struct ce_stat_desc { 30 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 31 uint32_t ce_res_5 : 8, 32 toeplitz_en : 1, 33 src_swap : 1, 34 dest_swap : 1, 35 gather : 1, 36 barrier_read : 1, 37 ce_res_6 : 3, 38 length : 16; 39 uint32_t toeplitz_hash_0 : 32; 40 uint32_t toeplitz_hash_1 : 32; 41 uint32_t fw_metadata : 16, 42 ce_res_7 : 4, 43 ring_id : 8, 44 looping_count : 4; 45 #else 46 uint32_t length : 16, 47 ce_res_6 : 3, 48 barrier_read : 1, 49 gather : 1, 50 dest_swap : 1, 51 src_swap : 1, 52 toeplitz_en : 1, 53 ce_res_5 : 8; 54 uint32_t toeplitz_hash_0 : 32; 55 uint32_t toeplitz_hash_1 : 32; 56 uint32_t looping_count : 4, 57 ring_id : 8, 58 ce_res_7 : 4, 59 fw_metadata : 16; 60 #endif 61 }; 62 63 #define CE_STAT_DESC_CE_RES_5_OFFSET 0x00000000 64 #define CE_STAT_DESC_CE_RES_5_LSB 0 65 #define CE_STAT_DESC_CE_RES_5_MSB 7 66 #define CE_STAT_DESC_CE_RES_5_MASK 0x000000ff 67 68 #define CE_STAT_DESC_TOEPLITZ_EN_OFFSET 0x00000000 69 #define CE_STAT_DESC_TOEPLITZ_EN_LSB 8 70 #define CE_STAT_DESC_TOEPLITZ_EN_MSB 8 71 #define CE_STAT_DESC_TOEPLITZ_EN_MASK 0x00000100 72 73 #define CE_STAT_DESC_SRC_SWAP_OFFSET 0x00000000 74 #define CE_STAT_DESC_SRC_SWAP_LSB 9 75 #define CE_STAT_DESC_SRC_SWAP_MSB 9 76 #define CE_STAT_DESC_SRC_SWAP_MASK 0x00000200 77 78 #define CE_STAT_DESC_DEST_SWAP_OFFSET 0x00000000 79 #define CE_STAT_DESC_DEST_SWAP_LSB 10 80 #define CE_STAT_DESC_DEST_SWAP_MSB 10 81 #define CE_STAT_DESC_DEST_SWAP_MASK 0x00000400 82 83 #define CE_STAT_DESC_GATHER_OFFSET 0x00000000 84 #define CE_STAT_DESC_GATHER_LSB 11 85 #define CE_STAT_DESC_GATHER_MSB 11 86 #define CE_STAT_DESC_GATHER_MASK 0x00000800 87 88 #define CE_STAT_DESC_BARRIER_READ_OFFSET 0x00000000 89 #define CE_STAT_DESC_BARRIER_READ_LSB 12 90 #define CE_STAT_DESC_BARRIER_READ_MSB 12 91 #define CE_STAT_DESC_BARRIER_READ_MASK 0x00001000 92 93 #define CE_STAT_DESC_CE_RES_6_OFFSET 0x00000000 94 #define CE_STAT_DESC_CE_RES_6_LSB 13 95 #define CE_STAT_DESC_CE_RES_6_MSB 15 96 #define CE_STAT_DESC_CE_RES_6_MASK 0x0000e000 97 98 #define CE_STAT_DESC_LENGTH_OFFSET 0x00000000 99 #define CE_STAT_DESC_LENGTH_LSB 16 100 #define CE_STAT_DESC_LENGTH_MSB 31 101 #define CE_STAT_DESC_LENGTH_MASK 0xffff0000 102 103 #define CE_STAT_DESC_TOEPLITZ_HASH_0_OFFSET 0x00000004 104 #define CE_STAT_DESC_TOEPLITZ_HASH_0_LSB 0 105 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MSB 31 106 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MASK 0xffffffff 107 108 #define CE_STAT_DESC_TOEPLITZ_HASH_1_OFFSET 0x00000008 109 #define CE_STAT_DESC_TOEPLITZ_HASH_1_LSB 0 110 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MSB 31 111 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MASK 0xffffffff 112 113 #define CE_STAT_DESC_FW_METADATA_OFFSET 0x0000000c 114 #define CE_STAT_DESC_FW_METADATA_LSB 0 115 #define CE_STAT_DESC_FW_METADATA_MSB 15 116 #define CE_STAT_DESC_FW_METADATA_MASK 0x0000ffff 117 118 #define CE_STAT_DESC_CE_RES_7_OFFSET 0x0000000c 119 #define CE_STAT_DESC_CE_RES_7_LSB 16 120 #define CE_STAT_DESC_CE_RES_7_MSB 19 121 #define CE_STAT_DESC_CE_RES_7_MASK 0x000f0000 122 123 #define CE_STAT_DESC_RING_ID_OFFSET 0x0000000c 124 #define CE_STAT_DESC_RING_ID_LSB 20 125 #define CE_STAT_DESC_RING_ID_MSB 27 126 #define CE_STAT_DESC_RING_ID_MASK 0x0ff00000 127 128 #define CE_STAT_DESC_LOOPING_COUNT_OFFSET 0x0000000c 129 #define CE_STAT_DESC_LOOPING_COUNT_LSB 28 130 #define CE_STAT_DESC_LOOPING_COUNT_MSB 31 131 #define CE_STAT_DESC_LOOPING_COUNT_MASK 0xf0000000 132 133 #endif 134