1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 * 6 ******************************************************************************/ 7 #ifndef __HAL_VERSION_DEF_H__ 8 #define __HAL_VERSION_DEF_H__ 9 10 /* HAL_IC_TYPE_E */ 11 typedef enum tag_HAL_IC_Type_Definition { 12 CHIP_8192S = 0, 13 CHIP_8188C = 1, 14 CHIP_8192C = 2, 15 CHIP_8192D = 3, 16 CHIP_8723A = 4, 17 CHIP_8188E = 5, 18 CHIP_8812 = 6, 19 CHIP_8821 = 7, 20 CHIP_8723B = 8, 21 CHIP_8192E = 9, 22 } HAL_IC_TYPE_E; 23 24 /* HAL_CHIP_TYPE_E */ 25 typedef enum tag_HAL_CHIP_Type_Definition { 26 TEST_CHIP = 0, 27 NORMAL_CHIP = 1, 28 FPGA = 2, 29 } HAL_CHIP_TYPE_E; 30 31 /* HAL_CUT_VERSION_E */ 32 typedef enum tag_HAL_Cut_Version_Definition { 33 A_CUT_VERSION = 0, 34 B_CUT_VERSION = 1, 35 C_CUT_VERSION = 2, 36 D_CUT_VERSION = 3, 37 E_CUT_VERSION = 4, 38 F_CUT_VERSION = 5, 39 G_CUT_VERSION = 6, 40 H_CUT_VERSION = 7, 41 I_CUT_VERSION = 8, 42 J_CUT_VERSION = 9, 43 K_CUT_VERSION = 10, 44 } HAL_CUT_VERSION_E; 45 46 /* HAL_Manufacturer */ 47 typedef enum tag_HAL_Manufacturer_Version_Definition { 48 CHIP_VENDOR_TSMC = 0, 49 CHIP_VENDOR_UMC = 1, 50 CHIP_VENDOR_SMIC = 2, 51 } HAL_VENDOR_E; 52 53 typedef enum tag_HAL_RF_Type_Definition { 54 RF_TYPE_1T1R = 0, 55 RF_TYPE_1T2R = 1, 56 RF_TYPE_2T2R = 2, 57 RF_TYPE_2T3R = 3, 58 RF_TYPE_2T4R = 4, 59 RF_TYPE_3T3R = 5, 60 RF_TYPE_3T4R = 6, 61 RF_TYPE_4T4R = 7, 62 } HAL_RF_TYPE_E; 63 64 typedef struct tag_HAL_VERSION { 65 HAL_IC_TYPE_E ICType; 66 HAL_CHIP_TYPE_E ChipType; 67 HAL_CUT_VERSION_E CUTVersion; 68 HAL_VENDOR_E VendorType; 69 HAL_RF_TYPE_E RFType; 70 u8 ROMVer; 71 } HAL_VERSION, *PHAL_VERSION; 72 73 /* VERSION_8192C VersionID; */ 74 /* HAL_VERSION VersionID; */ 75 76 /* Get element */ 77 #define GET_CVID_IC_TYPE(version) ((HAL_IC_TYPE_E)((version).ICType)) 78 #define GET_CVID_CHIP_TYPE(version) ((HAL_CHIP_TYPE_E)((version).ChipType)) 79 #define GET_CVID_RF_TYPE(version) ((HAL_RF_TYPE_E)((version).RFType)) 80 #define GET_CVID_MANUFACTUER(version) ((HAL_VENDOR_E)((version).VendorType)) 81 #define GET_CVID_CUT_VERSION(version) ((HAL_CUT_VERSION_E)((version).CUTVersion)) 82 #define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK) 83 84 /* */ 85 /* Common Macro. -- */ 86 /* */ 87 /* HAL_VERSION VersionID */ 88 89 /* HAL_CHIP_TYPE_E */ 90 #define IS_TEST_CHIP(version) ((GET_CVID_CHIP_TYPE(version) == TEST_CHIP) ? true : false) 91 #define IS_NORMAL_CHIP(version) ((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? true : false) 92 93 /* HAL_CUT_VERSION_E */ 94 #define IS_A_CUT(version) ((GET_CVID_CUT_VERSION(version) == A_CUT_VERSION) ? true : false) 95 #define IS_B_CUT(version) ((GET_CVID_CUT_VERSION(version) == B_CUT_VERSION) ? true : false) 96 #define IS_C_CUT(version) ((GET_CVID_CUT_VERSION(version) == C_CUT_VERSION) ? true : false) 97 #define IS_D_CUT(version) ((GET_CVID_CUT_VERSION(version) == D_CUT_VERSION) ? true : false) 98 #define IS_E_CUT(version) ((GET_CVID_CUT_VERSION(version) == E_CUT_VERSION) ? true : false) 99 #define IS_I_CUT(version) ((GET_CVID_CUT_VERSION(version) == I_CUT_VERSION) ? true : false) 100 #define IS_J_CUT(version) ((GET_CVID_CUT_VERSION(version) == J_CUT_VERSION) ? true : false) 101 #define IS_K_CUT(version) ((GET_CVID_CUT_VERSION(version) == K_CUT_VERSION) ? true : false) 102 103 /* HAL_VENDOR_E */ 104 #define IS_CHIP_VENDOR_TSMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC) ? true : false) 105 #define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC) ? true : false) 106 #define IS_CHIP_VENDOR_SMIC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_SMIC) ? true : false) 107 108 /* HAL_RF_TYPE_E */ 109 #define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R) ? true : false) 110 #define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R) ? true : false) 111 #define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R) ? true : false) 112 113 #endif 114