1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * HiSilicon PCIe Trace and Tuning (PTT) support 4 * Copyright (c) 2022 HiSilicon Technologies Co., Ltd. 5 */ 6 7 #ifndef INCLUDE__HISI_PTT_PKT_DECODER_H__ 8 #define INCLUDE__HISI_PTT_PKT_DECODER_H__ 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 #define HISI_PTT_8DW_CHECK_MASK GENMASK(31, 11) 14 #define HISI_PTT_IS_8DW_PKT GENMASK(31, 11) 15 #define HISI_PTT_MAX_SPACE_LEN 10 16 #define HISI_PTT_FIELD_LENTH 4 17 18 enum hisi_ptt_pkt_type { 19 HISI_PTT_4DW_PKT, 20 HISI_PTT_8DW_PKT, 21 HISI_PTT_PKT_MAX 22 }; 23 24 static int hisi_ptt_pkt_size[] = { 25 [HISI_PTT_4DW_PKT] = 16, 26 [HISI_PTT_8DW_PKT] = 32, 27 }; 28 29 int hisi_ptt_pkt_desc(const unsigned char *buf, int pos, enum hisi_ptt_pkt_type type); 30 31 #endif 32