erpt: add new IDs/categories

This commit is contained in:
Michael Scire 2024-03-28 03:51:10 -07:00
parent 23d6014f91
commit 05df389d30
2 changed files with 851 additions and 825 deletions

View file

@ -138,48 +138,49 @@
HANDLER(SdCardMountInfo, 97 ) \
HANDLER(RetailInteractiveDisplayInfo, 98 ) \
HANDLER(CompositorStateInfo, 99 ) \
HANDLER(CompositorLayerInfo, 100) \
HANDLER(CompositorDisplayInfo, 101) \
HANDLER(CompositorHWCInfo, 102) \
HANDLER(MonitorCapability, 103) \
HANDLER(ErrorReportSharePermissionInfo, 104) \
HANDLER(MultimediaInfo, 105) \
HANDLER(ConnectedControllerInfo, 106) \
HANDLER(FsMemoryInfo, 107) \
HANDLER(UserClockContextInfo, 108) \
HANDLER(NetworkClockContextInfo, 109) \
HANDLER(AcpGeneralSettingsInfo, 110) \
HANDLER(AcpPlayLogSettingsInfo, 111) \
HANDLER(AcpAocSettingsInfo, 112) \
HANDLER(AcpBcatSettingsInfo, 113) \
HANDLER(AcpStorageSettingsInfo, 114) \
HANDLER(AcpRatingSettingsInfo, 115) \
HANDLER(MonitorSettings, 116) \
HANDLER(RebootlessSystemUpdateVersionInfo, 117) \
HANDLER(NifmConnectionTestInfo, 118) \
HANDLER(PcieLoggedStateInfo, 119) \
HANDLER(NetworkSecurityCertificateInfo, 120) \
HANDLER(AcpNeighborDetectionInfo, 121) \
HANDLER(GpuCrashInfo, 122) \
HANDLER(UsbStateInfo, 123) \
HANDLER(NvHostErrInfo, 124) \
HANDLER(RunningUlaInfo, 125) \
HANDLER(InternalPanelInfo, 126) \
HANDLER(ResourceLimitLimitInfo, 127) \
HANDLER(ResourceLimitPeakInfo, 128) \
HANDLER(TouchScreenInfo, 129) \
HANDLER(AcpUserAccountSettingsInfo, 130) \
HANDLER(AudioDeviceInfo, 131) \
HANDLER(AbnormalWakeInfo, 132) \
HANDLER(ServiceProfileInfo, 133) \
HANDLER(BluetoothAudioInfo, 134) \
HANDLER(BluetoothPairingCountInfo, 135) \
HANDLER(FsProxyErrorInfo2, 136) \
HANDLER(BuiltInWirelessOUIInfo, 137) \
HANDLER(WirelessAPOUIInfo, 138) \
HANDLER(EthernetAdapterOUIInfo, 139) \
HANDLER(NANDTypeInfo, 140) \
HANDLER(MicroSDTypeInfo, 141) \
HANDLER(CompositorLayerInfo, 100 ) \
HANDLER(CompositorDisplayInfo, 101 ) \
HANDLER(CompositorHWCInfo, 102 ) \
HANDLER(MonitorCapability, 103 ) \
HANDLER(ErrorReportSharePermissionInfo, 104 ) \
HANDLER(MultimediaInfo, 105 ) \
HANDLER(ConnectedControllerInfo, 106 ) \
HANDLER(FsMemoryInfo, 107 ) \
HANDLER(UserClockContextInfo, 108 ) \
HANDLER(NetworkClockContextInfo, 109 ) \
HANDLER(AcpGeneralSettingsInfo, 110 ) \
HANDLER(AcpPlayLogSettingsInfo, 111 ) \
HANDLER(AcpAocSettingsInfo, 112 ) \
HANDLER(AcpBcatSettingsInfo, 113 ) \
HANDLER(AcpStorageSettingsInfo, 114 ) \
HANDLER(AcpRatingSettingsInfo, 115 ) \
HANDLER(MonitorSettings, 116 ) \
HANDLER(RebootlessSystemUpdateVersionInfo, 117 ) \
HANDLER(NifmConnectionTestInfo, 118 ) \
HANDLER(PcieLoggedStateInfo, 119 ) \
HANDLER(NetworkSecurityCertificateInfo, 120 ) \
HANDLER(AcpNeighborDetectionInfo, 121 ) \
HANDLER(GpuCrashInfo, 122 ) \
HANDLER(UsbStateInfo, 123 ) \
HANDLER(NvHostErrInfo, 124 ) \
HANDLER(RunningUlaInfo, 125 ) \
HANDLER(InternalPanelInfo, 126 ) \
HANDLER(ResourceLimitLimitInfo, 127 ) \
HANDLER(ResourceLimitPeakInfo, 128 ) \
HANDLER(TouchScreenInfo, 129 ) \
HANDLER(AcpUserAccountSettingsInfo, 130 ) \
HANDLER(AudioDeviceInfo, 131 ) \
HANDLER(AbnormalWakeInfo, 132 ) \
HANDLER(ServiceProfileInfo, 133 ) \
HANDLER(BluetoothAudioInfo, 134 ) \
HANDLER(BluetoothPairingCountInfo, 135 ) \
HANDLER(FsProxyErrorInfo2, 136 ) \
HANDLER(BuiltInWirelessOUIInfo, 137 ) \
HANDLER(WirelessAPOUIInfo, 138 ) \
HANDLER(EthernetAdapterOUIInfo, 139 ) \
HANDLER(NANDTypeInfo, 140 ) \
HANDLER(MicroSDTypeInfo, 141 ) \
HANDLER(TestNx, 1000) \
#define AMS_ERPT_FOREACH_FIELD(HANDLER) \
HANDLER(TestU64, 0, Test, FieldType_NumericU64, FieldFlag_None ) \
@ -863,4 +864,18 @@
HANDLER(MicroSDType, 678, MicroSDTypeInfo, FieldType_U8Array, FieldFlag_None ) \
HANDLER(GameCardLastDeactivateReasonResult, 679, GameCardErrorInfo, FieldType_NumericU32, FieldFlag_None ) \
HANDLER(GameCardLastDeactivateReason, 680, GameCardErrorInfo, FieldType_NumericU8, FieldFlag_None ) \
HANDLER(InvalidErrorCode, 681, ErrorInfo, FieldType_String, FieldFlag_None ) \
HANDLER(TestStringNx, 1000, TestNx, FieldType_String, FieldFlag_None ) \
HANDLER(BoostModeCurrentLimit, 1001, BatteryChargeInfo, FieldType_NumericI32, FieldFlag_None ) \
HANDLER(ChargeConfiguration, 1002, BatteryChargeInfo, FieldType_NumericI32, FieldFlag_None ) \
HANDLER(HizMode, 1003, BatteryChargeInfo, FieldType_Bool, FieldFlag_None ) \
HANDLER(PowerSupplyPath, 1004, BatteryChargeInfo, FieldType_NumericI32, FieldFlag_None ) \
HANDLER(ControllerPowerSupplyAcquired, 1005, BatteryChargeInfo, FieldType_Bool, FieldFlag_None ) \
HANDLER(OtgRequested, 1006, BatteryChargeInfo, FieldType_Bool, FieldFlag_None ) \
HANDLER(AdspExceptionRegisters, 1007, AdspErrorInfo, FieldType_U32Array, FieldFlag_None ) \
HANDLER(AdspExceptionSpsr, 1008, AdspErrorInfo, FieldType_NumericU32, FieldFlag_None ) \
HANDLER(AdspExceptionArmModeRegisters, 1009, AdspErrorInfo, FieldType_U32Array, FieldFlag_None ) \
HANDLER(AdspExceptionStackAddress, 1010, AdspErrorInfo, FieldType_NumericU32, FieldFlag_None ) \
HANDLER(AdspExceptionStackDump, 1011, AdspErrorInfo, FieldType_U32Array, FieldFlag_None ) \
HANDLER(AdspExceptionReason, 1012, AdspErrorInfo, FieldType_NumericU32, FieldFlag_None ) \

View file

@ -238,6 +238,7 @@ CATEGORIES = {
139 : 'EthernetAdapterOUIInfo',
140 : 'NANDTypeInfo',
141 : 'MicroSDTypeInfo',
1000 : 'TestNx',
}
FIELD_TYPES = {
@ -408,6 +409,14 @@ def find_flags(full, num_fields, magic_idx):
ind = full.index(KNOWN) - magic_idx
return list(up('<'+'B'*num_fields, full[ind:ind+num_fields]))
def find_id_array(full, num_fields, magic_idx, table_format):
if table_format == 0:
return list(range(num_fields))
else:
KNOWN = pk('<IIIIII', *range(444, 450))
ind = full.index(KNOWN) - 4 * magic_idx
return list(up('<' + 'I'*num_fields, full[ind:ind+4*num_fields]))
def cat_to_string(c):
return CATEGORIES[c] if c in CATEGORIES else 'Category_Unknown%d' % c
@ -430,6 +439,8 @@ def main(argc, argv):
cats = find_categories(full, NUM_FIELDS)
types = find_types(full, NUM_FIELDS)
flags = find_flags(full, NUM_FIELDS, fields.index('TestStringEncrypt') - 1)
ids = find_id_array(full, NUM_FIELDS, fields.index('TestStringEncrypt'), table_format)
assert ids[:4] == [0, 1, 2, 3]
print 'Identified %d fields.' % NUM_FIELDS
mf = max(len(s) for s in fields)
mc = max(len(cat_to_string(c)) for c in cats)
@ -453,8 +464,8 @@ def main(argc, argv):
out.write('\n')
out.write('#define AMS_ERPT_FOREACH_FIELD(HANDLER) \\\n')
for i in xrange(NUM_FIELDS):
f, c, t, l = fields[i], cats[i], types[i], flags[i]
out.write((' HANDLER(%%-%ds %%-4s %%-%ds %%-%ds %%-%ds) \\\n' % (mf+1, mc+1, mt+1, ml)) % (f+',', '%d,'%i, cat_to_string(c)+',', typ_to_string(t)+',', flg_to_string(l)))
f, c, t, l, d = fields[i], cats[i], types[i], flags[i], ids[i]
out.write((' HANDLER(%%-%ds %%-4s %%-%ds %%-%ds %%-%ds) \\\n' % (mf+1, mc+1, mt+1, ml)) % (f+',', '%d,'%d, cat_to_string(c)+',', typ_to_string(t)+',', flg_to_string(l)))
out.write('\n')
return 0